/* ========================================
   Local Font: Outfit
   ======================================== */
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('../fonts/outfit-v15-latin-300.woff2') format('woff2');
}

@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/outfit-v15-latin-regular.woff2') format('woff2');
}

@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/outfit-v15-latin-500.woff2') format('woff2');
}

@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/outfit-v15-latin-600.woff2') format('woff2');
}

@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/outfit-v15-latin-700.woff2') format('woff2');
}

/* ========================================
   Theme CSS Variables (Light & Dark)
   ======================================== */
:root {
  --background: oklch(0.9911 0 0);
  --foreground: oklch(0.2046 0 0);
  --card: oklch(0.9911 0 0);
  --card-foreground: oklch(0.2046 0 0);
  --popover: oklch(0.9911 0 0);
  --popover-foreground: oklch(0.4386 0 0);
  --primary: oklch(0.6230 0.2140 259.8150);
  --primary-foreground: oklch(0.2626 0.0147 166.4589);
  --secondary: oklch(0.9940 0 0);
  --secondary-foreground: oklch(0.2046 0 0);
  --muted: oklch(0.9461 0 0);
  --muted-foreground: oklch(0.2435 0 0);
  --accent: oklch(0.9461 0 0);
  --accent-foreground: oklch(0.2435 0 0);
  --destructive: oklch(0.5523 0.1927 32.7272);
  --destructive-foreground: oklch(0.9934 0.0032 17.2118);
  --border: oklch(0.9037 0 0);
  --input: oklch(0.9731 0 0);
  --ring: oklch(0.8348 0.1302 160.9080);
  --chart-1: oklch(0.8348 0.1302 160.9080);
  --chart-2: oklch(0.6231 0.1880 259.8145);
  --chart-3: oklch(0.6056 0.2189 292.7172);
  --chart-4: oklch(0.7686 0.1647 70.0804);
  --chart-5: oklch(0.6959 0.1491 162.4796);
  --sidebar: oklch(0.9911 0 0);
  --sidebar-foreground: oklch(0.5452 0 0);
  --sidebar-primary: oklch(0.8348 0.1302 160.9080);
  --sidebar-primary-foreground: oklch(0.2626 0.0147 166.4589);
  --sidebar-accent: oklch(0.9461 0 0);
  --sidebar-accent-foreground: oklch(0.2435 0 0);
  --sidebar-border: oklch(0.9037 0 0);
  --sidebar-ring: oklch(0.8348 0.1302 160.9080);
  --font-sans: Outfit, sans-serif;
  --font-serif: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --radius: 0.5rem;
  --shadow-2xs: 0px 1px 3px 0px hsl(0 0% 0% / 0.09);
  --shadow-xs: 0px 1px 3px 0px hsl(0 0% 0% / 0.09);
  --shadow-sm: 0px 1px 3px 0px hsl(0 0% 0% / 0.17), 0px 1px 2px -1px hsl(0 0% 0% / 0.17);
  --shadow: 0px 1px 3px 0px hsl(0 0% 0% / 0.17), 0px 1px 2px -1px hsl(0 0% 0% / 0.17);
  --shadow-md: 0px 1px 3px 0px hsl(0 0% 0% / 0.17), 0px 2px 4px -1px hsl(0 0% 0% / 0.17);
  --shadow-lg: 0px 1px 3px 0px hsl(0 0% 0% / 0.17), 0px 4px 6px -1px hsl(0 0% 0% / 0.17);
  --shadow-xl: 0px 1px 3px 0px hsl(0 0% 0% / 0.17), 0px 8px 10px -1px hsl(0 0% 0% / 0.17);
  --shadow-2xl: 0px 1px 3px 0px hsl(0 0% 0% / 0.43);
  --tracking-normal: 0.025em;
  --spacing: 0.25rem;
}

.theme-dark, body.theme-dark {
  --background: oklch(0.1822 0 0);
  --foreground: oklch(0.9288 0.0126 255.5078);
  --card: oklch(0.2046 0 0);
  --card-foreground: oklch(0.9288 0.0126 255.5078);
  --popover: oklch(0.2603 0 0);
  --popover-foreground: oklch(0.7348 0 0);
  --primary: oklch(0.6230 0.2140 259.8150);
  --primary-foreground: oklch(0.9213 0.0135 167.1556);
  --secondary: oklch(0.2603 0 0);
  --secondary-foreground: oklch(0.9851 0 0);
  --muted: oklch(0.2393 0 0);
  --muted-foreground: oklch(0.7122 0 0);
  --accent: oklch(0.3132 0 0);
  --accent-foreground: oklch(0.9851 0 0);
  --destructive: oklch(0.3123 0.0852 29.7877);
  --destructive-foreground: oklch(0.9368 0.0045 34.3092);
  --border: oklch(0.2809 0 0);
  --input: oklch(0.2603 0 0);
  --ring: oklch(0.8003 0.1821 151.7110);
  --chart-1: oklch(0.8003 0.1821 151.7110);
  --chart-2: oklch(0.7137 0.1434 254.6240);
  --chart-3: oklch(0.7090 0.1592 293.5412);
  --chart-4: oklch(0.8369 0.1644 84.4286);
  --chart-5: oklch(0.7845 0.1325 181.9120);
  --sidebar: oklch(0.1822 0 0);
  --sidebar-foreground: oklch(0.6301 0 0);
  --sidebar-primary: oklch(0.4365 0.1044 156.7556);
  --sidebar-primary-foreground: oklch(0.9213 0.0135 167.1556);
  --sidebar-accent: oklch(0.3132 0 0);
  --sidebar-accent-foreground: oklch(0.9851 0 0);
  --sidebar-border: oklch(0.2809 0 0);
  --sidebar-ring: oklch(0.8003 0.1821 151.7110);
}

/* ========================================
   Base Styles
   ======================================== */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  background-color: var(--background);
  color: var(--foreground);
  letter-spacing: var(--tracking-normal);
  line-height: 1.6;
  margin: 0;
  padding: 0;
  transition: background-color 0.2s ease, color 0.2s ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  color: var(--foreground);
}

h1 { font-size: 2rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ========================================
   Card Component
   ======================================== */
.card {
  background-color: var(--card);
  color: var(--card-foreground);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 8px);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.card-body {
  padding: 1.5rem;
}

.card-title {
  font-weight: 600;
  font-size: 1.125rem;
  color: var(--foreground);
  margin-bottom: 0.25rem;
}

.card-helper-text {
  color: var(--muted-foreground);
  font-size: 0.875rem;
}

/* Login card special styling */
.login-card {
  max-width: 440px;
  margin-left: auto;
  margin-right: auto;
  border: 1px solid var(--border);
}

/* ========================================
   Form Controls
   ======================================== */
.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--foreground);
  margin-bottom: 0.375rem;
}

.form-control,
.form-select {
  display: block;
  width: 100%;
  padding: 0.625rem 0.875rem;
  font-size: 0.9375rem;
  font-family: inherit;
  line-height: 1.5;
  color: var(--foreground);
  background-color: var(--input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  appearance: none;
}

.form-control:focus,
.form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--primary) 25%, transparent);
}

.form-control::placeholder {
  color: var(--muted-foreground);
}

.form-select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.75rem center;
  background-repeat: no-repeat;
  background-size: 1.25em 1.25em;
  padding-right: 2.5rem;
}

.form-text {
  font-size: 0.8125rem;
  color: var(--muted-foreground);
  margin-top: 0.375rem;
}

/* Theme toggle switch */
.form-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.form-switch .form-check-input {
  width: 2.75rem;
  height: 1.5rem;
  margin: 0;
  background-color: var(--muted);
  border: none;
  border-radius: 9999px;
  cursor: pointer;
  appearance: none;
  position: relative;
  transition: background-color 0.2s ease;
}

.form-switch .form-check-input::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 1.25rem;
  height: 1.25rem;
  background-color: white;
  border-radius: 9999px;
  transition: transform 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.form-switch .form-check-input:checked {
  background-color: var(--primary);
}

.form-switch .form-check-input:checked::before {
  transform: translateX(1.25rem);
}

.form-switch .form-check-input:focus {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--primary) 25%, transparent);
}

.form-switch .form-check-label {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  cursor: pointer;
  font-weight: 500;
}

/* ========================================
   Buttons
   ======================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 500;
  font-family: inherit;
  line-height: 1.5;
  text-align: center;
  white-space: nowrap;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background-color: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
}

.btn-primary:hover:not(:disabled) {
  background-color: color-mix(in oklch, var(--primary) 85%, black);
  border-color: color-mix(in oklch, var(--primary) 85%, black);
}

.btn-secondary {
  background-color: var(--secondary);
  color: var(--secondary-foreground);
  border-color: var(--border);
}

.btn-secondary:hover:not(:disabled) {
  background-color: var(--accent);
}

.btn-outline-primary {
  background-color: transparent;
  color: var(--primary);
  border-color: var(--primary);
}

.btn-outline-primary:hover:not(:disabled) {
  background-color: var(--primary);
  color: var(--primary-foreground);
}

.btn-outline-secondary {
  background-color: transparent;
  color: var(--muted-foreground);
  border-color: var(--border);
}

.btn-outline-secondary:hover:not(:disabled) {
  background-color: var(--accent);
  color: var(--accent-foreground);
}

.btn-outline-danger {
  background-color: transparent;
  color: var(--destructive);
  border-color: var(--destructive);
}

.btn-outline-danger:hover:not(:disabled) {
  background-color: var(--destructive);
  color: var(--destructive-foreground);
}

.btn-sm {
  padding: 0.375rem 0.875rem;
  font-size: 0.8125rem;
}

/* ========================================
   Alert Component
   ======================================== */
.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-weight: 500;
}

.alert-danger {
  background-color: color-mix(in oklch, var(--destructive) 15%, transparent);
  color: var(--destructive);
  border: 1px solid color-mix(in oklch, var(--destructive) 30%, transparent);
}

.alert-success {
  background-color: color-mix(in oklch, var(--chart-1) 15%, transparent);
  color: var(--chart-1);
  border: 1px solid color-mix(in oklch, var(--chart-1) 30%, transparent);
}

.alert-warning {
  background-color: color-mix(in oklch, var(--chart-4) 15%, transparent);
  color: color-mix(in oklch, var(--chart-4) 70%, black);
  border: 1px solid color-mix(in oklch, var(--chart-4) 40%, transparent);
}

.alert-info {
  background-color: color-mix(in oklch, var(--primary) 15%, transparent);
  color: var(--primary);
  border: 1px solid color-mix(in oklch, var(--primary) 30%, transparent);
}

/* ========================================
   Navigation Tabs
   ======================================== */
.nav-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-item {
  display: inline-flex;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1.5rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--muted-foreground);
  background-color: transparent;
  border: none;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.nav-link:hover {
  color: var(--foreground);
  background-color: var(--accent);
}

.nav-link.active {
  color: var(--foreground);
  background-color: var(--card);
  box-shadow: var(--shadow);
}

/* ========================================
   Badge Component
   ======================================== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.375rem 0.875rem;
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: 9999px;
  white-space: nowrap;
}

.usage-badge,
.profiles-available-badge {
  background-color: color-mix(in oklch, var(--primary) 15%, transparent);
  color: var(--primary);
}

.theme-dark .usage-badge,
.theme-dark .profiles-available-badge {
  background-color: color-mix(in oklch, var(--primary) 25%, transparent);
  color: color-mix(in oklch, var(--primary) 100%, white 30%);
}

.badge-primary {
  background-color: var(--primary);
  color: var(--primary-foreground);
}

/* ========================================
   Table Component
   ======================================== */
.table-container {
  width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
}

#activeLicensesContainer {
  max-width: 100%;
  overflow-x: auto;
}

#activeLicensesContainer .table {
  table-layout: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.table th,
.table td {
  padding: 0.875rem 1rem;
  text-align: left;
  vertical-align: middle;
}

.table th {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-foreground);
  background-color: var(--muted);
  border-bottom: 1px solid var(--border);
}

.table td {
  border-bottom: 1px solid var(--border);
}

.table tbody tr:hover {
  background-color: var(--accent);
}

.table-sm th,
.table-sm td {
  padding: 0.5rem 0.75rem;
}

/* ========================================
   List Group
   ======================================== */
.list-group {
  display: flex;
  flex-direction: column;
  gap: 0;
  list-style: none;
  padding: 0;
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.list-group-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.875rem 1rem;
  background-color: var(--card);
  color: var(--foreground);
  border-bottom: 1px solid var(--border);
}

.list-group-item:last-child {
  border-bottom: none;
}

/* ========================================
   Custom App Components
   ======================================== */

/* User badges */
.user-badge-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.user-role-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 600;
}

.user-role-badge.user-role-admin {
  background-color: color-mix(in oklch, var(--primary) 15%, transparent);
  color: var(--primary);
}

.user-role-badge.user-role-issuer {
  background-color: color-mix(in oklch, var(--chart-1) 15%, transparent);
  color: var(--chart-1);
}

/* License output */
.license-output {
  background-color: var(--muted);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  padding: 1rem 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--foreground);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 320px;
  overflow: auto;
  margin: 0;
}

.license-result-heading {
  font-weight: 600;
  color: var(--foreground);
  margin-bottom: 0.5rem;
}

/* Section headings */
.section-heading {
  margin-bottom: 1rem;
}

.section-heading small {
  display: block;
  color: var(--muted-foreground);
  font-size: 0.875rem;
  margin-top: 0.25rem;
}
.active-licenses-title,
.license-profile-title {
  margin: 0;
  white-space: nowrap;
}


/* Empty state */
.empty-state {
  background-color: var(--muted);
  color: var(--muted-foreground);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  text-align: center;
  font-weight: 500;
}

/* Dynamic field helpers */
.dynamic-field-help {
  color: var(--muted-foreground);
}

#dynamicFieldsContainer .form-label {
  font-weight: 600;
  color: var(--foreground);
}

/* Admin Overview */
.admin-stat-card {
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow);
}

.admin-stat-label {
  text-transform: uppercase;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--muted-foreground);
  margin-bottom: 0.25rem;
}

.admin-stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--foreground);
}

.admin-list-group {
  gap: 0;
}

.admin-list-item {
  background-color: var(--card);
  border-color: var(--border);
  color: var(--foreground);
}

.theme-dark .admin-list-item {
  background-color: var(--muted);
}

.admin-list-unstyled {
  list-style: none;
  padding-left: 0;
  margin-bottom: 0;
}

.admin-list-unstyled .admin-list-item {
  padding: 0.5rem 0;
  border: none;
  background: transparent;
}

.admin-meta-text {
  color: var(--muted-foreground);
  font-size: 0.8125rem;
  margin-top: 1rem;
}

.admin-nav-sticky {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.75rem 0;
  background-color: var(--background);
  border-bottom: 1px solid var(--border);
}

.admin-nav-sticky .nav-link {
  text-decoration: none;
}

.admin-section {
  scroll-margin-top: 80px;
}

/* Progress bar for license usage */
.progress-bar-container {
  width: 100%;
  height: 8px;
  background-color: var(--muted);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.25rem;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.progress-success .progress-bar-fill {
  background-color: var(--chart-1);
}

.progress-warning .progress-bar-fill {
  background-color: var(--chart-4);
}

.progress-danger .progress-bar-fill {
  background-color: var(--destructive);
}

/* Additional badge variants */
.badge-success {
  background-color: color-mix(in oklch, var(--chart-1) 15%, transparent);
  color: var(--chart-1);
}

.badge-danger {
  background-color: color-mix(in oklch, var(--destructive) 15%, transparent);
  color: var(--destructive);
}

.badge-warning {
  background-color: color-mix(in oklch, var(--chart-4) 15%, transparent);
  color: color-mix(in oklch, var(--chart-4) 70%, black);
}

.badge-secondary {
  background-color: var(--muted);
  color: var(--muted-foreground);
}

.badge-outline {
  background-color: transparent;
  border: 1px solid var(--border);
  color: var(--muted-foreground);
}

/* Text color utilities */
.text-warning {
  color: color-mix(in oklch, var(--chart-4) 80%, black);
}

.text-danger {
  color: var(--destructive);
}

.text-success {
  color: var(--chart-1);
}

/* Log entries */
.log-entry {
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 0;
}

.log-entry:last-child {
  border-bottom: none;
}

.log-timestamp {
  font-size: 0.8125rem;
  color: var(--muted-foreground);
}

/* ========================================
   Utility Classes (Tailwind-like)
   ======================================== */

/* Display */
.hidden { display: none !important; }
.block { display: block; }
.inline-block { display: inline-block; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }

/* Flexbox */
.flex-wrap { flex-wrap: wrap; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.justify-center { justify-content: center; }

/* Gap */
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }

/* Width */
.w-full { width: 100%; }
.w-auto { width: auto; }

/* Spacing - Margin */
.m-0 { margin: 0; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.me-2 { margin-right: 0.5rem; }

/* Spacing - Padding */
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }

/* Text */
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-primary { color: var(--primary); }
.text-muted { color: var(--muted-foreground); }
.text-foreground { color: var(--foreground); }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-lg { font-size: 1.125rem; }
.break-words { word-break: break-word; }
.whitespace-nowrap { white-space: nowrap; }
.uppercase { text-transform: uppercase; }
.tracking-wide { letter-spacing: 0.05em; }

/* Borders */
.border { border: 1px solid var(--border); }
.border-b { border-bottom: 1px solid var(--border); }
.rounded { border-radius: var(--radius); }
.rounded-lg { border-radius: calc(var(--radius) + 4px); }
.rounded-full { border-radius: 9999px; }

/* Overflow */
.overflow-x-auto { overflow-x: auto; }
.overflow-auto { overflow: auto; }

/* ========================================
   Responsive Utilities
   ======================================== */
@media (min-width: 768px) {
  .md\:flex-row { flex-direction: row; }
  .md\:items-center { align-items: center; }
  .md\:w-auto { width: auto; }
  .md\:mb-0 { margin-bottom: 0; }
  .md\:p-4 { padding: 1rem; }
  .md\:p-6 { padding: 1.5rem; }
  
  /* Grid columns */
  .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Container */
.container {
  width: 100%;
  max-width: 1600px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 640px) {
  .container {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

/* Grid system for forms */
.form-grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 768px) {
  .form-grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}


/* ========================================
   Mobile Responsive Tweaks
   ======================================== */
@media (max-width: 767px) {
  .nav-tabs {
    flex-direction: column;
  }
  
  .nav-link {
    width: 100%;
    justify-content: center;
  }
  
  h1 {
    font-size: 1.5rem;
  }
  
  .card-body {
    padding: 1rem;
  }
}

/* ========================================
   Scrollbar Styling
   ======================================== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--muted);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--muted-foreground);
}

/* ========================================
   Focus States for Accessibility
   ======================================== */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

/* ========================================
   Selection Styling
   ======================================== */
::selection {
  background-color: color-mix(in oklch, var(--primary) 30%, transparent);
  color: var(--foreground);
}

/* ========================================
   Row/Col Grid System
   ======================================== */
.row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.g-3 {
  gap: 1rem;
}

.gy-3 {
  row-gap: 1rem;
}

.col-12 {
  grid-column: 1 / -1;
}

/* Dynamic fields container - responsive grid */
#dynamicFieldsContainer {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 640px) {
  #dynamicFieldsContainer {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  #dynamicFieldsContainer {
    grid-template-columns: repeat(3, 1fr);
  }
}

#dynamicFieldsContainer .col-md-4 {
  grid-column: auto;
}

/* License form specific */
#licenseForm {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

#licenseForm > .col-12 {
  margin-top: 0.5rem;
}

/* Login form - single column */
#loginForm {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

#loginForm .col-12 {
  width: 100%;
}

/* Admin grid */
@media (min-width: 768px) {
  .row.md\:grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .col-md {
    grid-column: auto;
  }
}
