/* ALJ Creator Design System v1.1 */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700&display=swap');

@font-face {
  font-family: 'AppCustomFont';
  src: url('/assets/fQtw5exLIdT.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --primary: #dc2626;
  --primary-hover: #b91c1c;
  --primary-light: #fef2f2;
  --secondary: #18181b;
  --secondary-hover: #09090b;
  --accent: #ef4444;
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --success: #10b981;
  --success-light: #d1fae5;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --bg: #f4f4f5;
  --bg-card: #ffffff;
  --bg-nav: #ffffff;
  --bg-sidebar: #ffffff;
  --text: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
  --shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -1px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -2px rgba(0,0,0,.05);
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --font: 'AppCustomFont', 'Tajawal', system-ui, -apple-system, sans-serif;
  --transition: .15s ease;
}

[dir="rtl"] {
  --font: 'AppCustomFont', 'Tajawal', system-ui, -apple-system, sans-serif;
}

[data-theme="dark"] {
  --primary: #ef4444;
  --primary-hover: #dc2626;
  --primary-light: #7f1d1d;
  --bg: #0a0a0a;
  --bg-card: #121212;
  --bg-nav: #121212;
  --bg-sidebar: #121212;
  --text: #ffffff;
  --text-secondary: #a3a3a3;
  --text-muted: #737373;
  --border: #262626;
  --border-light: #1c1c1c;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.5);
  --shadow: 0 1px 3px rgba(0,0,0,.6);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.5);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.5);
}

*, *::before, *::after {
  box-sizing: border-box;
  font-family: inherit;
}

html { scroll-behavior: smooth; }

body, input, button, select, textarea, option, optgroup,
h1, h2, h3, h4, h5, h6,
.modal, .modal-title, .modal-header, .modal-body, .modal-footer, .modal-content, .modal-overlay,
.card, .card-header, .card-title, .stat-card,
.navbar, .sidebar, .dropdown-menu, .row-dropdown-menu, .badge, .btn, .form-input, .form-label,
div, span, p, a, label {
  font-family: var(--font);
}

code, pre, kbd, .font-mono, .CodeMirror, .ace_editor, .ace_editor *, .ace_gutter-cell, .ace_line, .ace_content, .ace_token, textarea.font-mono, input.font-mono, [dir="ltr"].font-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace !important;
}

.fa, .fas, .far, .fal, .fab, .fa-solid, .fa-regular, .fa-brands, [class*="fa-"] {
  font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands", "Font Awesome 6 Pro" !important;
}

body {
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Theme toggle */
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover {
  background: var(--border-light);
  color: var(--text);
}

.theme-toggle .sun-icon { display: none; }
.theme-toggle .moon-icon { display: block; }
[data-theme="dark"] .theme-toggle .sun-icon { display: block; }
[data-theme="dark"] .theme-toggle .moon-icon { display: none; }

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}

.card:hover { box-shadow: var(--shadow-md); }

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-body { padding: 20px; }

/* Stats card */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}

.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.stat-card .stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.stat-card .stat-value {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
}

.stat-card .stat-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.btn:disabled {
  opacity: .5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn svg {
  transition: transform 0.15s ease;
  flex-shrink: 0;
}

.btn:hover:not(:disabled) svg {
  transform: translateY(-0.5px);
}

.btn-primary {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #fff;
  border-color: rgba(239, 68, 68, 0.4);
  box-shadow: 0 2px 6px rgba(220, 38, 38, 0.25);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #f87171 0%, #b91c1c 100%);
  border-color: rgba(239, 68, 68, 0.6);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
  transform: translateY(-1px);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0) scale(.98);
  box-shadow: 0 1px 3px rgba(220, 38, 38, 0.2);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--border-light);
  border-color: var(--text-muted);
  color: var(--text);
  transform: translateY(-1px);
}

.btn-secondary:active:not(:disabled) {
  transform: translateY(0) scale(.98);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #fff;
  border-color: var(--danger);
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.2);
}

.btn-danger:hover:not(:disabled) {
  background: linear-gradient(135deg, #f87171 0%, #b91c1c 100%);
  border-color: var(--danger-hover);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
  transform: translateY(-1px);
}

.btn-danger:active:not(:disabled) {
  transform: translateY(0) scale(.98);
}

.btn-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  border-color: var(--success);
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.2);
}

.btn-success:hover:not(:disabled) {
  background: linear-gradient(135deg, #34d399 0%, #047857 100%);
  border-color: #059669;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
  transform: translateY(-1px);
}

.btn-success:active:not(:disabled) {
  transform: translateY(0) scale(.98);
}

.btn-warning {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #fff;
  border-color: var(--warning);
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.2);
}

.btn-warning:hover:not(:disabled) {
  background: linear-gradient(135deg, #fbbf24 0%, #b45309 100%);
  border-color: #d97706;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
  transform: translateY(-1px);
}

.btn-warning:active:not(:disabled) {
  transform: translateY(0) scale(.98);
}

.btn-xs {
  padding: 2px 7px;
  font-size: 11px;
  border-radius: 4px;
}

.btn-sm {
  padding: 3.5px 10px;
  font-size: 12px;
  border-radius: 5px;
}

.btn-lg {
  padding: 9px 20px;
  font-size: 14.5px;
  border-radius: var(--radius);
}

/* Forms */
.form-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--bg-card);
  transition: all var(--transition);
  outline: none;
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}

.form-input::placeholder { color: var(--text-muted); }

.form-input:disabled { opacity: .6; cursor: not-allowed; }

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .3px;
  text-transform: uppercase;
}

.badge-success { background: var(--success-light); color: #065f46; }
.badge-warning { background: var(--warning-light); color: #92400e; }
.badge-danger { background: #fef2f2; color: #991b1b; }
.badge-info { background: var(--primary-light); color: #4338ca; }
[data-theme="dark"] .badge-success { background: #064e3b; color: #6ee7b7; }
[data-theme="dark"] .badge-warning { background: #78350f; color: #fcd34d; }
[data-theme="dark"] .badge-danger { background: #7f1d1d; color: #fca5a5; }
[data-theme="dark"] .badge-info { background: #312e81; color: #a5b4fc; }

/* Alerts */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: var(--success-light); color: #065f46; border: 1px solid #a7f3d0; }
.alert-warning { background: var(--warning-light); color: #92400e; border: 1px solid #fde68a; }
.alert-info { background: var(--primary-light); color: #4338ca; border: 1px solid #c7d2fe; }
[data-theme="dark"] .alert-error { background: #450a0a; color: #fca5a5; border-color: #7f1d1d; }
[data-theme="dark"] .alert-success { background: #022c22; color: #6ee7b7; border-color: #064e3b; }
[data-theme="dark"] .alert-warning { background: #451a03; color: #fcd34d; border-color: #78350f; }
[data-theme="dark"] .alert-info { background: #1e1b4b; color: #a5b4fc; border-color: #312e81; }

/* Table */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table.wap-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.wap-table th {
  text-align: left;
  padding: 12px 16px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--border-light);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

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

.wap-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text);
}

.wap-table tr:hover td { background: var(--border-light); }

.hover-row {
  transition: background var(--transition);
}
.hover-row:hover {
  background: var(--border-light) !important;
}

/* Layout body - flex container wraps sidebar + main content */
.layout-body {
  display: flex;
  min-height: calc(100vh - 64px);
  margin-top: 64px;
}

/* Sidebar - desktop default: in-flow (not fixed) */
.sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 35;
  transition: opacity 0.3s ease;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  margin: 4px 12px;
  border-radius: var(--radius-lg);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.notif-badge {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  animation: notif-pulse 2s ease-in-out infinite;
  flex-shrink: 0;
}

[dir="rtl"] .notif-badge {
  margin-left: 0;
  margin-right: auto;
}

@keyframes notif-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.5); }
  50%       { box-shadow: 0 0 0 5px rgba(220, 38, 38, 0); }
}

.sidebar-link:hover {
  background: var(--border-light);
  color: var(--text);
  transform: translateX(4px);
}

[dir="rtl"] .sidebar-link:hover {
  transform: translateX(-4px);
}

.sidebar-link.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 4px;
  background: var(--primary);
  border-radius: 0 4px 4px 0;
}

[dir="rtl"] .sidebar-link.active::before {
  left: auto;
  right: 0;
  border-radius: 4px 0 0 4px;
}

.sidebar-link svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Navbar */
.navbar {
  background: var(--bg-nav);
  border-bottom: 1px solid var(--border);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: 64px;
}

.navbar-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 20px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-brand {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.navbar-user {
  font-size: 14px;
  color: var(--text-secondary);
}

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
}

.menu-toggle:hover { background: var(--border-light); }

/* File tree (desktop) / accordion (mobile) */
.file-tree-desktop { display: block; }
.file-tree-mobile { display: none; }

/* Main content area */
.main-content {
  flex: 1;
  padding: 24px;
  min-width: 0;
}

/* Sidebar divider */
.sidebar-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 8px 12px;
}

/* RTL utilities */
[dir="rtl"] .mr-2 { margin-left: .5rem !important; margin-right: 0 !important; }
[dir="rtl"] .ml-2 { margin-right: .5rem !important; margin-left: 0 !important; }
[dir="rtl"] .mr-3 { margin-left: .75rem !important; margin-right: 0 !important; }
[dir="rtl"] .ml-3 { margin-right: .75rem !important; margin-left: 0 !important; }
[dir="rtl"] .space-x-2 > * + * { margin-right: .5rem !important; margin-left: 0 !important; }
[dir="rtl"] .space-x-3 > * + * { margin-right: .75rem !important; margin-left: 0 !important; }
[dir="rtl"] .space-x-4 > * + * { margin-right: 1rem !important; margin-left: 0 !important; }
[dir="rtl"] .space-x-reverse { --tw-space-x-reverse: 1; }

/* Progress bar */
.progress-bar {
  height: 8px;
  background: var(--border-light);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width .4s ease;
  background: var(--primary);
}

/* Loading spinner */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* CodeMirror theme override for dark mode */
[data-theme="dark"] .CodeMirror {
  background: #1e293b !important;
  color: #e2e8f0 !important;
}

[data-theme="dark"] .CodeMirror-gutters {
  background: #0f172a !important;
  border-color: #334155 !important;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity .2s;
  pointer-events: none;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(.95);
  transition: transform .2s;
}

.modal-overlay.open .modal,
.modal-overlay.open .modal-content { transform: scale(1); }

.modal-content {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(.95);
  transition: transform .2s;
}

.modal-header {
  padding: 20px 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 20px;
  line-height: 1;
}

.modal-close:hover { background: var(--border-light); }

.modal-body { padding: 16px 24px 24px; }

/* Global Dark Theme Overrides for Modals & Dropdown Menus */
[data-theme="dark"] .modal,
[data-theme="dark"] .modal-content {
  background: #0d1117 !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: #ffffff !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8) !important;
}

[data-theme="dark"] .modal-header {
  border-bottom-color: rgba(255, 255, 255, 0.08) !important;
}

[data-theme="dark"] .modal-footer {
  border-top-color: rgba(255, 255, 255, 0.08) !important;
  background: rgba(255, 255, 255, 0.02) !important;
}

[data-theme="dark"] .modal input:not([type="checkbox"]):not([type="radio"]),
[data-theme="dark"] .modal select,
[data-theme="dark"] .modal textarea {
  background: rgba(0, 0, 0, 0.5) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
  color: #ffffff !important;
}

/* Row Dropdown Menus on Mobile */
.row-dropdown-menu {
  background: #161b22 !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.9) !important;
}

.row-dropdown-menu button {
  background: transparent !important;
  border: none !important;
  color: #e2e8f0 !important;
}

.row-dropdown-menu button:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  color: #ffffff !important;
}

/* Domain status indicators */
.domain-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.domain-status.active { background: var(--success-light); color: #065f46; }
.domain-status.pending { background: var(--warning-light); color: #92400e; }
.domain-status.failed { background: #fef2f2; color: #991b1b; }
.domain-status.disabled { background: var(--border-light); color: var(--text-muted); }

[data-theme="dark"] .domain-status.active { background: #064e3b; color: #6ee7b7; }
[data-theme="dark"] .domain-status.pending { background: #78350f; color: #fcd34d; }
[data-theme="dark"] .domain-status.failed { background: #450a0a; color: #fca5a5; }
[data-theme="dark"] .domain-status.disabled { background: #1e293b; color: #64748b; }

/* ===== RESPONSIVE ===== */

/* Mobile and Tablets: < 1024px */
@media (max-width: 1023px) {
  .menu-toggle { display: block; }
  .sidebar {
    position: fixed;
    top: 64px;
    left: 0;
    z-index: 40;
    height: calc(100vh - 64px);
    transform: translateX(-100%);
    width: 280px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-lg);
  }
  [dir="rtl"] .sidebar {
    left: auto;
    right: 0;
    transform: translateX(100%);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.open { display: block; }
  .file-tree-desktop { display: none; }
  .file-tree-mobile { display: block; }
  
  /* Additional adjustment for tablet screen paddings */
  .main-content {
    padding: 20px 16px;
  }
  
  .navbar-inner { padding: 0 16px; }
}

/* Extra small mobile adjustments: < 480px */
@media (max-width: 479px) {
  .navbar-inner { padding: 0 12px; }
  .navbar-brand { font-size: 17px; }
  .navbar-user { display: none; }
  .main-content {
    padding: 16px 12px;
  }
  .stat-card .stat-value { font-size: 20px; }
  .card-body { padding: 16px; }
  .modal { margin: 12px; }
}

/* Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.switch input { opacity: 0; width: 0; height: 0; }

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--border-color, #ccc);
  transition: .3s;
  border-radius: 24px;
}

.slider:before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  transition: .3s;
  border-radius: 50%;
}

.switch input:checked + .slider {
  background: var(--primary, #3b82f6);
}

.switch input:checked + .slider:before {
  transform: translateX(20px);
}

/* Laptop: 1024-1440px */
@media (min-width: 1024px) and (max-width: 1439px) {
  .layout-body { padding: 16px; gap: 16px; }
  .sidebar {
    width: 240px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin: 0;
  }
  .main-content { padding: 0; }
}

/* Large screens: > 1440px */
@media (min-width: 1440px) {
  .navbar-inner, .layout-body {
    max-width: 1440px;
    margin-left: auto;
    margin-right: auto;
  }
  .layout-body {
    margin-top: 64px;
    padding: 20px;
    gap: 20px;
  }
  .sidebar {
    width: 260px;
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    margin: 0;
  }
  .main-content { padding: 0; }
}

/* Universal Light Mode High Contrast Overrides */
[data-theme="light"] {
  --bg: #f4f4f5;
  --bg-card: #ffffff;
  --bg-nav: #ffffff;
  --bg-sidebar: #ffffff;
  --text: #1e293b;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --border: #e2e8f0;
}

[data-theme="light"] .text-white,
[data-theme="light"] .text-white\/70,
[data-theme="light"] .text-gray-300 {
  color: #1e293b !important;
}

[data-theme="light"] .bg-black\/40,
[data-theme="light"] .bg-white\/10,
[data-theme="light"] .bg-white\/5 {
  background-color: rgba(0, 0, 0, 0.05) !important;
  color: #1e293b !important;
}

[data-theme="light"] .border-white\/10,
[data-theme="light"] .border-white\/5 {
  border-color: rgba(0, 0, 0, 0.12) !important;
}

[data-theme="light"] .modal {
  background: #ffffff !important;
  color: #1e293b !important;
  border-color: rgba(0, 0, 0, 0.15) !important;
}

[data-theme="light"] .modal-title {
  color: #1e293b !important;
}

[data-theme="light"] .modal-close {
  color: #64748b !important;
}

[data-theme="light"] .modal-close:hover {
  color: #0f172a !important;
}

