/* GoFilament Admin Panel CSS - High-performance Filament Design System */
:root {
  --primary-50: #ecfdf5;
  --primary-100: #d1fae5;
  --primary-200: #a7f3d0;
  --primary-300: #6ee7b7;
  --primary-400: #34d399;
  --primary-500: #10b981;
  --primary-600: #059669;
  --primary-700: #047857;
  --primary-800: #065f46;
  --primary-900: #064e3b;
  --primary-950: #022c22;

  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  --gray-950: #020617;

  --danger-50: #fef2f2;
  --danger-100: #fee2e2;
  --danger-200: #fecaca;
  --danger-300: #fca5a5;
  --danger-400: #f87171;
  --danger-500: #ef4444;
  --danger-600: #dc2626;
  --danger-700: #b91c1c;
  --danger-800: #991b1b;
  --danger-900: #7f1d1d;
  --danger-950: #450a0a;

  --warning-50: #fffbeb;
  --warning-100: #fef3c7;
  --warning-200: #fde68a;
  --warning-300: #fcd34d;
  --warning-400: #fbbf24;
  --warning-500: #f59e0b;
  --warning-600: #d97706;
  --warning-700: #b45309;
  --warning-800: #92400e;
  --warning-900: #78350f;
  --warning-950: #451a03;

  --success-50: #ecfdf5;
  --success-100: #d1fae5;
  --success-200: #a7f3d0;
  --success-300: #6ee7b7;
  --success-400: #34d399;
  --success-500: #10b981;
  --success-600: #059669;
  --success-700: #047857;
  --success-800: #065f46;
  --success-900: #064e3b;
  --success-950: #022c22;

  --info-50: #f0f9ff;
  --info-100: #e0f2fe;
  --info-200: #bae6fd;
  --info-300: #7dd3fc;
  --info-400: #38bdf8;
  --info-500: #0ea5e9;
  --info-600: #0284c7;
  --info-700: #0369a1;
  --info-800: #075985;
  --info-900: #0c4a6e;
  --info-950: #082f49;

  --font-sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.dark {
  color-scheme: dark;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--gray-50);
  color: var(--gray-900);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.dark body, body.dark-mode {
  background-color: #0b1120;
  color: #f1f5f9;
}

/* Base Utility Classes */
.filament-shell {
  display: flex;
  min-height: 100vh;
  position: relative;
}

.filament-sidebar {
  width: 17rem;
  background-color: #ffffff;
  border-right: 1px solid var(--gray-200);
  display: flex;
  flex-direction: column;
  transition: width 0.2s ease, transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 30;
}

.dark .filament-sidebar {
  background-color: #111827;
  border-right-color: #1f2937;
}

.filament-sidebar.collapsed {
  width: 5rem;
}

/* Mobile Responsive Sidebar Off-Canvas Drawer */
.filament-sidebar-backdrop {
  display: none;
}

.filament-mobile-menu-btn {
  display: none;
}

.filament-sidebar-close-btn {
  display: none;
}

@media (max-width: 1024px) {
  .filament-shell {
    overflow-x: hidden;
  }
  .filament-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 18rem;
    max-width: 85vw;
    z-index: 50;
    transform: translateX(-100%);
    box-shadow: none;
  }
  [dir="rtl"] .filament-sidebar {
    left: auto;
    right: 0;
    transform: translateX(100%);
  }
  .filament-sidebar.open {
    transform: translateX(0);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
  }
  .filament-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    z-index: 40;
    opacity: 0;
    transition: opacity 0.25s ease;
  }
  .filament-sidebar-backdrop.open {
    display: block;
    opacity: 1;
  }
  .filament-mobile-menu-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    padding: 0.375rem !important;
  }
  .filament-sidebar-close-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-400);
    font-size: 1.5rem;
    line-height: 1;
    padding: 0.25rem;
    border-radius: 0.375rem;
    transition: color 0.15s ease, background-color 0.15s ease;
  }
  .filament-sidebar-close-btn:hover {
    color: var(--gray-700);
    background-color: var(--gray-100);
  }
  .dark .filament-sidebar-close-btn:hover {
    color: #ffffff;
    background-color: #1f2937;
  }
}

body.sidebar-mobile-open {
  overflow: hidden;
}

.filament-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 100%;
}

.filament-topbar {
  height: 4rem;
  background-color: #ffffff;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 20;
}

.dark .filament-topbar {
  background-color: #111827;
  border-bottom-color: #1f2937;
}

.filament-content {
  padding: 2rem 1.5rem;
  max-width: 100%;
  width: 100%;
}

.max-w-7xl { max-width: 80rem; margin: 0 auto; }
.max-w-full { max-width: 100%; }

/* Navigation */
.nav-group-title {
  padding: 0.75rem 1rem 0.25rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-400);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1rem;
  margin: 0.125rem 0.5rem;
  border-radius: 0.5rem;
  color: var(--gray-600);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.15s ease;
}

.nav-link:hover {
  background-color: var(--gray-100);
  color: var(--gray-900);
}

.dark .nav-link {
  color: var(--gray-300);
}

.dark .nav-link:hover {
  background-color: #1f2937;
  color: #ffffff;
}

.nav-link.active {
  background-color: var(--primary-50);
  color: var(--primary-700);
  font-weight: 600;
}

.dark .nav-link.active {
  background-color: rgba(16, 185, 129, 0.15);
  color: var(--primary-400);
}

.nav-badge {
  margin-left: auto;
  font-size: 0.75rem;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  background-color: var(--gray-200);
  color: var(--gray-700);
}

.dark .nav-badge {
  background-color: #374151;
  color: #d1d5db;
}

/* Cards & Sections */
.filament-card {
  background-color: #ffffff;
  border-radius: 0.75rem;
  border: 1px solid var(--gray-200);
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.dark .filament-card {
  background-color: #111827;
  border-color: #1f2937;
}

.filament-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.filament-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-900);
}

.dark .filament-title {
  color: #ffffff;
}

.filament-description {
  font-size: 0.875rem;
  color: var(--gray-500);
  margin-top: 0.25rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.btn-primary {
  background-color: var(--primary-600);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: var(--primary-700);
}

.btn-secondary {
  background-color: #ffffff;
  border-color: var(--gray-300);
  color: var(--gray-700);
}

.dark .btn-secondary {
  background-color: #1f2937;
  border-color: #374151;
  color: #e5e7eb;
}

.btn-secondary:hover {
  background-color: var(--gray-50);
}

.dark .btn-secondary:hover {
  background-color: #374151;
}

.btn-danger {
  background-color: var(--danger-600);
  color: #ffffff;
}

.btn-danger:hover {
  background-color: var(--danger-700);
}

.btn-success {
  background-color: var(--success-600);
  color: #ffffff;
}

.btn-success:hover {
  background-color: var(--success-700);
}

.btn-warning {
  background-color: var(--warning-500);
  color: #ffffff;
}

.btn-warning:hover {
  background-color: var(--warning-600);
}

.btn-info {
  background-color: var(--info-600);
  color: #ffffff;
}

.btn-info:hover {
  background-color: var(--info-700);
}

.btn-sm {
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
}

/* Forms */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 0.375rem;
}

.dark .form-label {
  color: #e5e7eb;
}

.form-control {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid var(--gray-300);
  background-color: #ffffff;
  color: var(--gray-900);
  font-size: 0.875rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.dark .form-control {
  background-color: #1f2937;
  border-color: #374151;
  color: #ffffff;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.form-error {
  color: #ef4444;
  font-size: 0.75rem;
  margin-top: 0.25rem;
}

.form-helper {
  color: var(--gray-500);
  font-size: 0.75rem;
  margin-top: 0.25rem;
}

/* Form & Component Grid System - Mobile-First & Responsive */
.grid { display: grid; gap: 1.25rem; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-cols-12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }
.col-span-1 { grid-column: span 1 / span 1; }
.col-span-2 { grid-column: span 2 / span 2; }
.col-span-3 { grid-column: span 3 / span 3; }
.col-span-4 { grid-column: span 4 / span 4; }
.col-span-6 { grid-column: span 6 / span 6; }
.col-span-12 { grid-column: span 12 / span 12; }

/* Responsive Utility Classes */
@media (min-width: 640px) {
  .sm\:grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
  .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sm\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sm\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .sm\:col-span-1 { grid-column: span 1 / span 1; }
  .sm\:col-span-2 { grid-column: span 2 / span 2; }
  .sm\:col-span-3 { grid-column: span 3 / span 3; }
}

@media (min-width: 768px) {
  .md\:grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
  .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .md\:col-span-1 { grid-column: span 1 / span 1; }
  .md\:col-span-2 { grid-column: span 2 / span 2; }
  .md\:col-span-4 { grid-column: span 4 / span 4; }
  .md\:col-span-6 { grid-column: span 6 / span 6; }
}

@media (min-width: 1024px) {
  .lg\:grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
  .lg\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .lg\:col-span-1 { grid-column: span 1 / span 1; }
  .lg\:col-span-2 { grid-column: span 2 / span 2; }
  .lg\:col-span-3 { grid-column: span 3 / span 3; }
  .lg\:col-span-4 { grid-column: span 4 / span 4; }
}

/* Mobile Screens (<= 640px) */
@media (max-width: 640px) {
  .grid-cols-2,
  .grid-cols-3,
  .grid-cols-4 {
    grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
    gap: 1rem !important;
  }
  .grid-cols-12 > [class*="col-span-"] {
    grid-column: span 12 / span 12 !important;
  }
  .filament-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.75rem !important;
  }
  .filament-header > div:last-child {
    width: 100% !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0.5rem !important;
  }
  .filament-content {
    padding: 1.25rem 0.75rem !important;
  }
  .filament-topbar {
    padding: 0 0.875rem !important;
    height: 3.5rem !important;
  }
  .filament-card {
    padding: 1rem !important;
    border-radius: 0.5rem !important;
  }
  .filament-title {
    font-size: 1.25rem !important;
  }
  .stat-card {
    padding: 1rem !important;
  }
  .stat-value {
    font-size: 1.5rem !important;
  }

  /* Mobile Responsive Table to Stacked Cards (Zero Horizontal Scrolling) */
  .filament-table-wrapper {
    overflow-x: visible !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
  }
  .filament-table {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    border: none !important;
  }
  .filament-table thead {
    display: none !important;
  }
  .filament-table tbody {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.875rem !important;
    width: 100% !important;
  }
  .filament-table tbody tr {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    background-color: #ffffff !important;
    border: 1px solid var(--gray-200) !important;
    border-radius: 0.75rem !important;
    padding: 0.875rem 1rem !important;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05) !important;
    box-sizing: border-box !important;
  }
  .dark .filament-table tbody tr {
    background-color: var(--gray-800) !important;
    border-color: var(--gray-700) !important;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3) !important;
  }
  .filament-table tbody tr.empty-row {
    padding: 2.5rem 1rem !important;
    align-items: center !important;
    justify-content: center !important;
  }
  .filament-table tbody tr.empty-row td {
    display: block !important;
    border: none !important;
    padding: 0 !important;
    text-align: center !important;
  }
  .filament-table tbody tr.empty-row td::before {
    display: none !important;
  }
  .filament-table td {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 0.5rem 0 !important;
    border: none !important;
    border-bottom: 1px solid var(--gray-100) !important;
    text-align: right !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .dark .filament-table td {
    border-bottom-color: rgba(255, 255, 255, 0.06) !important;
  }
  .filament-table td::before {
    content: attr(data-label);
    font-size: 0.6875rem !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    color: var(--gray-400) !important;
    text-align: left !important;
    margin-right: 1rem !important;
    flex-shrink: 0 !important;
  }
  .dark .filament-table td::before {
    color: var(--gray-400) !important;
  }
  .filament-table td:not([data-label])::before,
  .filament-table td[data-label=""]::before {
    display: none !important;
  }
  .filament-table td.table-cell-actions {
    border-bottom: none !important;
    padding-top: 0.75rem !important;
    padding-bottom: 0.25rem !important;
    justify-content: flex-end !important;
  }
  .filament-table td.table-cell-actions::before {
    display: none !important;
  }
  .filament-table td.table-cell-checkbox {
    border-bottom: 1px dashed var(--gray-200) !important;
    padding-bottom: 0.5rem !important;
    margin-bottom: 0.25rem !important;
    justify-content: flex-start !important;
  }
  .dark .filament-table td.table-cell-checkbox {
    border-bottom-color: var(--gray-700) !important;
  }
  .filament-table td.table-cell-checkbox::before {
    display: none !important;
  }
  .filament-table td.table-cell-checkbox .table-checkbox-label {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    cursor: pointer !important;
  }
  .filament-table td.table-cell-checkbox .table-checkbox-text {
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    color: var(--gray-500) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
  }
  .filament-table td.drag-handle {
    display: none !important;
  }
}

/* Tablet Screens (641px - 1024px) */
@media (min-width: 641px) and (max-width: 1024px) {
  .grid-cols-3,
  .grid-cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 1.25rem !important;
  }
  .filament-content {
    padding: 1.5rem 1rem !important;
  }

  /* Tablet Responsive Table to 2-Column Card Grid (Zero Horizontal Scrolling) */
  .filament-table-wrapper {
    overflow-x: visible !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
  }
  .filament-table {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    border: none !important;
  }
  .filament-table thead {
    display: none !important;
  }
  .filament-table tbody {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 1rem !important;
    width: 100% !important;
  }
  .filament-table tbody tr {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    background-color: #ffffff !important;
    border: 1px solid var(--gray-200) !important;
    border-radius: 0.75rem !important;
    padding: 0.875rem 1rem !important;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05) !important;
    box-sizing: border-box !important;
  }
  .dark .filament-table tbody tr {
    background-color: var(--gray-800) !important;
    border-color: var(--gray-700) !important;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3) !important;
  }
  .filament-table tbody tr.empty-row {
    grid-column: span 2 / span 2 !important;
    padding: 2.5rem 1rem !important;
    align-items: center !important;
    justify-content: center !important;
  }
  .filament-table tbody tr.empty-row td {
    display: block !important;
    border: none !important;
    padding: 0 !important;
    text-align: center !important;
  }
  .filament-table tbody tr.empty-row td::before {
    display: none !important;
  }
  .filament-table td {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 0.5rem 0 !important;
    border: none !important;
    border-bottom: 1px solid var(--gray-100) !important;
    text-align: right !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .dark .filament-table td {
    border-bottom-color: rgba(255, 255, 255, 0.06) !important;
  }
  .filament-table td::before {
    content: attr(data-label);
    font-size: 0.6875rem !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    color: var(--gray-400) !important;
    text-align: left !important;
    margin-right: 1rem !important;
    flex-shrink: 0 !important;
  }
  .dark .filament-table td::before {
    color: var(--gray-400) !important;
  }
  .filament-table td:not([data-label])::before,
  .filament-table td[data-label=""]::before {
    display: none !important;
  }
  .filament-table td.table-cell-actions {
    border-bottom: none !important;
    padding-top: 0.75rem !important;
    padding-bottom: 0.25rem !important;
    justify-content: flex-end !important;
  }
  .filament-table td.table-cell-actions::before {
    display: none !important;
  }
  .filament-table td.table-cell-checkbox {
    border-bottom: 1px dashed var(--gray-200) !important;
    padding-bottom: 0.5rem !important;
    margin-bottom: 0.25rem !important;
    justify-content: flex-start !important;
  }
  .dark .filament-table td.table-cell-checkbox {
    border-bottom-color: var(--gray-700) !important;
  }
  .filament-table td.table-cell-checkbox::before {
    display: none !important;
  }
  .filament-table td.table-cell-checkbox .table-checkbox-label {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    cursor: pointer !important;
  }
  .filament-table td.table-cell-checkbox .table-checkbox-text {
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    color: var(--gray-500) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
  }
  .filament-table td.drag-handle {
    display: none !important;
  }
}

/* Tables (Desktop > 1024px Default) */
.filament-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  border: 1px solid var(--gray-200);
  border-radius: 0.75rem;
  background-color: #ffffff;
}

.dark .filament-table-wrapper {
  border-color: #1f2937;
  background-color: #111827;
}

.filament-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.875rem;
}

.filament-table th {
  background-color: var(--gray-50);
  color: var(--gray-600);
  font-weight: 600;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--gray-200);
}

.dark .filament-table th {
  background-color: #1f2937;
  color: #9ca3af;
  border-bottom-color: #374151;
}

.filament-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-800);
}

.dark .filament-table td {
  border-bottom-color: #1f2937;
  color: #e5e7eb;
}

.filament-table tr:hover td {
  background-color: var(--gray-50);
}

.dark .filament-table tr:hover td {
  background-color: #1a2234;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.badge-success { background-color: var(--success-100); color: var(--success-800); }
.badge-warning { background-color: var(--warning-100); color: var(--warning-800); }
.badge-danger { background-color: var(--danger-100); color: var(--danger-800); }
.badge-info { background-color: var(--info-100); color: var(--info-800); }
.badge-gray { background-color: var(--gray-100); color: var(--gray-800); }

.dark .badge-success { background-color: rgba(16, 185, 129, 0.2); color: var(--success-400); }
.dark .badge-warning { background-color: rgba(245, 158, 11, 0.2); color: var(--warning-400); }
.dark .badge-danger { background-color: rgba(239, 68, 68, 0.2); color: var(--danger-400); }
.dark .badge-info { background-color: rgba(14, 165, 233, 0.2); color: var(--info-400); }
.dark .badge-gray { background-color: var(--gray-800); color: var(--gray-300); }

/* Modals & Drawers */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.modal-content {
  background-color: #ffffff;
  border-radius: 0.75rem;
  max-width: 36rem;
  width: 90%;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  border: 1px solid var(--gray-200);
}

.dark .modal-content {
  background-color: #111827;
  border-color: #374151;
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dark .modal-header {
  border-bottom-color: #1f2937;
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  background-color: var(--gray-50);
  border-top: 1px solid var(--gray-200);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

.dark .modal-footer {
  background-color: #1f2937;
  border-top-color: #374151;
}

/* Toast Notifications */
.notifications-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 60;
  max-width: 24rem;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: 0.5rem;
  background-color: #ffffff;
  border: 1px solid var(--gray-200);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
}

.dark .toast {
  background-color: #1f2937;
  border-color: #374151;
}

/* Stats Widget Sparkline */
.stat-card {
  background-color: #ffffff;
  border: 1px solid var(--gray-200);
  border-radius: 0.75rem;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.dark .stat-card {
  background-color: #111827;
  border-color: #1f2937;
}

.stat-value {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--gray-900);
}

.dark .stat-value {
  color: #ffffff;
}

/* Real-Time Notification Drawer & Badge */
.badge-count {
  position: absolute;
  top: -0.375rem;
  right: -0.375rem;
  background-color: var(--primary-600);
  color: #ffffff;
  font-size: 0.6875rem;
  font-weight: 700;
  min-width: 1.125rem;
  height: 1.125rem;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.25rem;
  box-shadow: 0 0 0 2px #ffffff;
}

.dark .badge-count {
  box-shadow: 0 0 0 2px #1f2937;
}

.notifications-drawer-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
  z-index: 55;
  display: flex;
  justify-content: flex-end;
}

.notifications-drawer {
  width: 100%;
  max-width: 24rem;
  height: 100%;
  background-color: #ffffff;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  animation: slide-in-right 0.2s ease-out forwards;
}

.dark .notifications-drawer {
  background-color: #111827;
  border-left: 1px solid #374151;
}

@keyframes slide-in-right {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.notifications-drawer-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dark .notifications-drawer-header {
  border-bottom-color: #1f2937;
}

.notifications-drawer-list {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.notification-item {
  padding: 0.875rem 1rem;
  border-radius: 0.5rem;
  background-color: var(--gray-50);
  border: 1px solid var(--gray-200);
  position: relative;
  transition: all 0.15s ease;
}

.dark .notification-item {
  background-color: #1f2937;
  border-color: #374151;
}

.notification-item.unread {
  border-left: 4px solid var(--primary-500);
  background-color: #ffffff;
}

.dark .notification-item.unread {
  background-color: #1a2234;
}

.btn-xs {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  line-height: 1rem;
}

/* Right-to-Left (RTL) Localization Support */
[dir="rtl"] {
  direction: rtl;
  text-align: right;
}

[dir="rtl"] .filament-sidebar {
  border-right: none;
  border-left: 1px solid var(--gray-200);
}

.dark[dir="rtl"] .filament-sidebar,
[dir="rtl"] .dark .filament-sidebar {
  border-left-color: var(--gray-800);
}

[dir="rtl"] .filament-nav-item {
  flex-direction: row;
}

[dir="rtl"] .notifications-drawer-backdrop {
  justify-content: flex-start;
}

[dir="rtl"] .notifications-drawer {
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
  animation: slide-in-left 0.2s ease-out forwards;
}

.dark[dir="rtl"] .notifications-drawer,
[dir="rtl"] .dark .notifications-drawer {
  border-left: none;
  border-right: 1px solid #374151;
}

@keyframes slide-in-left {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}

[dir="rtl"] .notification-item.unread {
  border-left: 1px solid var(--gray-200);
  border-right: 4px solid var(--primary-500);
}

.dark[dir="rtl"] .notification-item.unread,
[dir="rtl"] .dark .notification-item.unread {
  border-left-color: #374151;
  border-right: 4px solid var(--primary-500);
}

[dir="rtl"] .filament-table th,
[dir="rtl"] .filament-table td {
  text-align: right;
}

/* Spotlight Command Palette Modal */
.spotlight-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.375rem 0.75rem;
  background-color: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 0.5rem;
  cursor: pointer;
  max-width: 20rem;
  width: 100%;
  transition: all 0.15s ease;
}

.spotlight-trigger:hover {
  background-color: #ffffff;
  border-color: var(--primary-400);
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
}

.dark .spotlight-trigger {
  background-color: #1e293b;
  border-color: #334155;
}

.dark .spotlight-trigger:hover {
  background-color: #0f172a;
  border-color: var(--primary-500);
}

.spotlight-trigger-kbd {
  font-family: var(--font-sans);
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  background: var(--gray-200);
  color: var(--gray-700);
  border: 1px solid var(--gray-300);
  line-height: 1;
}

.dark .spotlight-trigger-kbd {
  background: #334155;
  color: #cbd5e1;
  border-color: #475569;
}

.spotlight-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background-color: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 4rem 1rem 1rem 1rem;
  animation: spotlight-fade-in 0.15s ease-out;
}

@keyframes spotlight-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.spotlight-container {
  width: 100%;
  max-width: 42rem;
  background-color: #ffffff;
  border: 1px solid var(--gray-200);
  border-radius: 0.75rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: spotlight-scale-in 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes spotlight-scale-in {
  from { transform: scale(0.97) translateY(-8px); }
  to { transform: scale(1) translateY(0); }
}

.dark .spotlight-container {
  background-color: #111827;
  border-color: #1f2937;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
}

.spotlight-input-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--gray-200);
  background-color: #ffffff;
}

.dark .spotlight-input-wrapper {
  background-color: #111827;
  border-bottom-color: #1f2937;
}

.spotlight-search-icon {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--primary-600);
  flex-shrink: 0;
}

.spotlight-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 1.0625rem;
  color: var(--gray-900);
  font-family: inherit;
}

.dark .spotlight-input {
  color: #f9fafb;
}

.spotlight-clear-btn {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--gray-400);
  cursor: pointer;
  padding: 0 0.25rem;
  line-height: 1;
}

.spotlight-clear-btn:hover {
  color: var(--gray-600);
}

.spotlight-esc-pill {
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  background: var(--gray-100);
  color: var(--gray-500);
  border: 1px solid var(--gray-200);
  cursor: pointer;
}

.dark .spotlight-esc-pill {
  background: #1f2937;
  border-color: #374151;
  color: #9ca3af;
}

.spotlight-results {
  max-height: 22rem;
  overflow-y: auto;
  padding: 0.5rem 0;
}

.spotlight-group-header {
  padding: 0.5rem 1.25rem 0.25rem;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-400);
  display: flex;
  justify-content: space-between;
}

.spotlight-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 1.25rem;
  text-decoration: none;
  color: var(--gray-900);
  transition: all 0.1s ease;
  border-left: 3px solid transparent;
}

.dark .spotlight-result-item {
  color: #f1f5f9;
}

.spotlight-result-item:hover,
.spotlight-result-item.active {
  background-color: var(--primary-50);
  border-left-color: var(--primary-600);
}

.dark .spotlight-result-item:hover,
.dark .spotlight-result-item.active {
  background-color: #1e293b;
  border-left-color: var(--primary-500);
}

.spotlight-item-icon {
  font-size: 1.125rem;
  line-height: 1;
  flex-shrink: 0;
}

.spotlight-item-title {
  font-size: 0.875rem;
  font-weight: 500;
}

.spotlight-highlight {
  background: var(--primary-100);
  color: var(--primary-900);
  font-weight: 600;
  border-radius: 2px;
  padding: 0 1px;
}

.dark .spotlight-highlight {
  background: rgba(16, 185, 129, 0.25);
  color: var(--primary-300);
}

.spotlight-item-details {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-top: 0.25rem;
}

.spotlight-detail-tag {
  font-size: 0.6875rem;
  color: var(--gray-500);
  background: var(--gray-100);
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
}

.dark .spotlight-detail-tag {
  background: #1f2937;
  color: #94a3b8;
}

.spotlight-item-actions {
  display: flex;
  gap: 0.375rem;
}

.spotlight-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 1.25rem;
  border-top: 1px solid var(--gray-200);
  background-color: var(--gray-50);
  font-size: 0.75rem;
  color: var(--gray-500);
}

.dark .spotlight-footer {
  background-color: #0b1120;
  border-top-color: #1f2937;
  color: #64748b;
}

.spotlight-shortcuts {
  display: flex;
  gap: 0.75rem;
}

.spotlight-shortcuts kbd {
  font-size: 0.6875rem;
  padding: 0.125rem 0.25rem;
  background: #ffffff;
  border: 1px solid var(--gray-300);
  border-radius: 0.25rem;
}

.dark .spotlight-shortcuts kbd {
  background: #1f2937;
  border-color: #374151;
  color: #9ca3af;
}

/* ==========================================================================
   Advanced Table Features: Drag & Drop Reordering, Inline Edit, Toggles
   ========================================================================== */
.table-row-draggable {
  transition: background-color 0.15s ease;
}

.table-row-dragging {
  opacity: 0.45;
  background-color: var(--primary-50, #eef2ff) !important;
}

.dark .table-row-dragging {
  background-color: #1e1b4b !important;
}

.drag-handle {
  cursor: grab;
  user-select: none;
  font-size: 1.125rem;
  letter-spacing: -2px;
}

.drag-handle:active {
  cursor: grabbing;
}

.drag-handle:hover {
  color: var(--primary-600) !important;
}

.inline-edit-text:hover {
  color: var(--primary-600);
}

.cell-saved {
  box-shadow: 0 0 0 2px #10b981 !important;
  transition: box-shadow 0.2s ease;
}

.filament-toggle-switch:focus {
  outline: 2px solid var(--primary-600);
  outline-offset: 2px;
}



