html[data-theme='light'], body[data-theme='light'] {
  color-scheme: light;
}

body[data-theme='light'] {
  background: linear-gradient(180deg, #f4f8ff 0%, #eef4ff 55%, #f9fbff 100%) !important;
  color: #16243b !important;
}

body[data-theme='light']::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 0% 0%, rgba(255,255,255,0.72) 0%, rgba(255,255,255,0.12) 48%, rgba(255,255,255,0) 100%);
  z-index: 0;
}

body[data-theme='light'] > * {
  position: relative;
  z-index: 1;
}

body[data-theme='light'] .app-header,
body[data-theme='light'] .sidebar,
body[data-theme='light'] .card,
body[data-theme='light'] .panel,
body[data-theme='light'] .cal-section,
body[data-theme='light'] .feature-card,
body[data-theme='light'] .demo-card,
body[data-theme='light'] .biz-card,
body[data-theme='light'] .booked-panel,
body[data-theme='light'] .side-pane,
body[data-theme='light'] .multi-bar,
body[data-theme='light'] .no-emp,
body[data-theme='light'] .booked-detail {
  background: rgba(255,255,255,0.9) !important;
  border-color: rgba(59,130,246,0.2) !important;
  box-shadow: 0 8px 30px rgba(30,64,175,0.08) !important;
}

body[data-theme='light'] .hero,
body[data-theme='light'] .demo-section,
body[data-theme='light'] [style*='url('] {
  background-blend-mode: lighten !important;
}

body[data-theme='light'] .hero::before,
body[data-theme='light'] .demo-section::before {
  background: rgba(255,255,255,0.45) !important;
}

body[data-theme='light'] h1,
body[data-theme='light'] h2,
body[data-theme='light'] h3,
body[data-theme='light'] h4,
body[data-theme='light'] .logo,
body[data-theme='light'] .nav-logo,
body[data-theme='light'] .section-title,
body[data-theme='light'] .pane-head h2,
body[data-theme='light'] .slot-label,
body[data-theme='light'] strong {
  color: #0f1f39 !important;
}

body[data-theme='light'] p,
body[data-theme='light'] span,
body[data-theme='light'] li,
body[data-theme='light'] .sub,
body[data-theme='light'] .page-sub,
body[data-theme='light'] .hint,
body[data-theme='light'] .meta,
body[data-theme='light'] .pane-info,
body[data-theme='light'] .slot-sub,
body[data-theme='light'] label,
body[data-theme='light'] .back {
  color: #30435f !important;
}

body[data-theme='light'] a,
body[data-theme='light'] .btn-ghost,
body[data-theme='light'] .book-link,
body[data-theme='light'] .slug-val,
body[data-theme='light'] .login-link {
  color: #1d4ed8 !important;
}

body[data-theme='light'] a:hover,
body[data-theme='light'] .btn-ghost:hover,
body[data-theme='light'] .login-link:hover {
  color: #1e3a8a !important;
}

body[data-theme='light'] input,
body[data-theme='light'] textarea,
body[data-theme='light'] select,
body[data-theme='light'] .slug-preview,
body[data-theme='light'] .hero-search-box {
  background: #ffffff !important;
  color: #0f1f39 !important;
  border-color: rgba(37,99,235,0.28) !important;
}

body[data-theme='light'] input::placeholder,
body[data-theme='light'] textarea::placeholder {
  color: #6b7f99 !important;
}

body[data-theme='light'] .btn,
body[data-theme='light'] .btn-primary,
body[data-theme='light'] .btn-book,
body[data-theme='light'] .hero-search-btn,
body[data-theme='light'] .btn-today,
body[data-theme='light'] .cal-btn {
  background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%) !important;
  color: #ffffff !important;
  border-color: transparent !important;
}

body[data-theme='light'] .btn-outline,
body[data-theme='light'] .btn-nav,
body[data-theme='light'] .mode-btn,
body[data-theme='light'] .btn-mini {
  background: #edf4ff !important;
  color: #1e3a8a !important;
  border-color: rgba(37,99,235,0.28) !important;
}

body[data-theme='light'] .btn-cancel,
body[data-theme='light'] .btn-mini.danger {
  background: #feecef !important;
  color: #b42318 !important;
  border-color: #fda4af !important;
}

body[data-theme='light'] .btn-unblock {
  background: #ecf3ff !important;
  color: #1d4ed8 !important;
  border-color: #93c5fd !important;
}

body[data-theme='light'] .btn-block,
body[data-theme='light'] .mb-block {
  background: #fff7e6 !important;
  color: #92400e !important;
  border-color: #fbbf24 !important;
}

body[data-theme='light'] .mb-unblock {
  background: #ecf3ff !important;
  color: #1e3a8a !important;
  border-color: #93c5fd !important;
}

body[data-theme='light'] .alert,
body[data-theme='light'] .alert-err {
  background: #fff1f2 !important;
  color: #b42318 !important;
  border-color: #fecdd3 !important;
}

body[data-theme='light'] .alert-ok {
  background: #ecfdf3 !important;
  color: #166534 !important;
  border-color: #86efac !important;
}

body[data-theme='light'] .slot.avail { background: #e8f0ff !important; }
body[data-theme='light'] .slot.avail:hover { background: #dbe7ff !important; }
body[data-theme='light'] .slot.blocked { background: #fff1d6 !important; border-left-color: #f59e0b !important; }
body[data-theme='light'] .slot.booked { background: #dbeafe !important; }

body[data-theme='light'] table,
body[data-theme='light'] th,
body[data-theme='light'] td,
body[data-theme='light'] .th-time,
body[data-theme='light'] .th-emp,
body[data-theme='light'] .td-time,
body[data-theme='light'] .time-col {
  border-color: rgba(59,130,246,0.2) !important;
  color: #334155 !important;
}

body[data-theme='light'] .hero,
body[data-theme='light'] .demo-section {
  position: relative;
}

body[data-theme='light'] .hero::after,
body[data-theme='light'] .demo-section::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,0.4), rgba(255,255,255,0.2));
}

body[data-theme='light'] .hero > *,
body[data-theme='light'] .demo-section > * {
  position: relative;
  z-index: 1;
}

/* Specific dark-surface overrides that require higher selector precision */
body[data-theme='light'] .stats .stat,
body[data-theme='light'] .appt-group,
body[data-theme='light'] .appt-group summary,
body[data-theme='light'] .appt-list,
body[data-theme='light'] .appt-card,
body[data-theme='light'] .edit-panel,
body[data-theme='light'] .cal-scroll,
body[data-theme='light'] .theme-row,
body[data-theme='light'] .client-code-item,
body[data-theme='light'] #toast {
  background: rgba(255,255,255,0.95) !important;
  border-color: rgba(59,130,246,0.22) !important;
}

body[data-theme='light'] .theme-switch {
  background: #e8f0ff !important;
  border-color: rgba(37,99,235,0.35) !important;
}

body[data-theme='light'] .theme-switch::after {
  background: #ffffff !important;
}

body[data-theme='light'] .theme-switch.on {
  background: linear-gradient(135deg, #3b82f6, #4f46e5) !important;
  border-color: #3b82f6 !important;
}

body[data-theme='light'] .stat .lbl,
body[data-theme='light'] .appt-contact,
body[data-theme='light'] .empty-appt,
body[data-theme='light'] .leg-item,
body[data-theme='light'] .mb-label,
body[data-theme='light'] .bp-text span,
body[data-theme='light'] .hint,
body[data-theme='light'] .e-label,
body[data-theme='light'] .pane-label {
  color: #4b607d !important;
}

body[data-theme='light'] .section-title,
body[data-theme='light'] .page-header h1,
body[data-theme='light'] .appt-name,
body[data-theme='light'] .appt-date-val,
body[data-theme='light'] .week-label,
body[data-theme='light'] .theme-meta strong,
body[data-theme='light'] .bp-text strong {
  color: #112744 !important;
}

/* Dashboard calendar first row/column (including inline-styled top-left cell) */
body[data-theme='light'] table.cal thead th,
body[data-theme='light'] table.cal thead th[style],
body[data-theme='light'] table.cal td.time-col,
body[data-theme='light'] table.cal td.time-col[style],
body[data-theme='light'] .th-time,
body[data-theme='light'] .th-emp,
body[data-theme='light'] .td-time {
  background: #edf4ff !important;
  color: #35527a !important;
  border-color: rgba(59,130,246,0.22) !important;
}

body[data-theme='light'] table.cal thead th.is-today .dnum {
  background: #2563eb !important;
  color: #ffffff !important;
}

body[data-theme='light'] table.cal td.slot,
body[data-theme='light'] table.cal td.slot .slot-inner,
body[data-theme='light'] .slot {
  border-color: rgba(59,130,246,0.18) !important;
}

body[data-theme='light'] td.slot.available .slot-inner {
  background: #e6efff !important;
  color: #1f3d67 !important;
}

body[data-theme='light'] td.slot.available:hover .slot-inner {
  background: #d7e7ff !important;
  color: #183154 !important;
}

body[data-theme='light'] td.slot.blocked .slot-inner {
  background: #fff2d8 !important;
  color: #8a4b08 !important;
}

body[data-theme='light'] td.slot.booked .slot-inner {
  background: #ffe5ea !important;
  color: #9f1239 !important;
}

body[data-theme='light'] td.slot.sun .slot-inner,
body[data-theme='light'] td.slot.past .slot-inner {
  background: #f8fbff !important;
}

/* Pending/confirmed/cancelled panes and badges */
body[data-theme='light'] .stat.pending,
body[data-theme='light'] .stat.confirmed,
body[data-theme='light'] .stat.cancelled {
  background: rgba(255,255,255,0.95) !important;
}

body[data-theme='light'] .badge-pending {
  background: #fff6db !important;
  color: #8a4b08 !important;
}

body[data-theme='light'] .badge-confirmed {
  background: #eafcf2 !important;
  color: #166534 !important;
}

body[data-theme='light'] .badge-cancelled {
  background: #ffecef !important;
  color: #b42318 !important;
}

body[data-theme='light'] .booked-panel {
  background: #fff3f5 !important;
  border-color: #fecdd3 !important;
}

body[data-theme='light'] .btn-confirm {
  background: #eafcf2 !important;
  color: #166534 !important;
  border: 1px solid #86efac !important;
}

body[data-theme='light'] .btn-edit {
  background: #e9f1ff !important;
  color: #1e3a8a !important;
  border: 1px solid #93c5fd !important;
}

body[data-theme='light'] .btn-cancel-appt {
  background: #ffecef !important;
  color: #b42318 !important;
  border-color: #fda4af !important;
}

/* Inline style fallbacks used by some templates/scripts */
body[data-theme='light'] [style*='background:#1a2744'],
body[data-theme='light'] [style*='background: #1a2744'],
body[data-theme='light'] [style*='background:#1e293b'],
body[data-theme='light'] [style*='background: #1e293b'],
body[data-theme='light'] [style*='background:#0f172a'],
body[data-theme='light'] [style*='background: #0f172a'] {
  background: #edf4ff !important;
}

body[data-theme='light'] [style*='border-right:1px solid rgba(99,102,241,0.12)'],
body[data-theme='light'] [style*='border-right: 1px solid rgba(99,102,241,0.12)'] {
  border-right: 1px solid rgba(59,130,246,0.22) !important;
}

body[data-theme='light'] [style*='color:#334155'],
body[data-theme='light'] [style*='color: #334155'],
body[data-theme='light'] [style*='color:#475569'],
body[data-theme='light'] [style*='color: #475569'] {
  color: #4b607d !important;
}

/* ── Universal card / list surfaces ─────────────────────────────────────── */
body[data-theme='light'] .form-card,
body[data-theme='light'] .svc-list,
body[data-theme='light'] .client-list,
body[data-theme='light'] .emp-list,
body[data-theme='light'] .table-wrap {
  background: #ffffff !important;
  border-color: rgba(59,130,246,0.2) !important;
}

body[data-theme='light'] .svc-row,
body[data-theme='light'] .client-row,
body[data-theme='light'] .client-main,
body[data-theme='light'] .emp-row {
  border-color: rgba(59,130,246,0.12) !important;
}

body[data-theme='light'] .svc-name,
body[data-theme='light'] .client-name,
body[data-theme='light'] .emp-name,
body[data-theme='light'] .biz-name {
  color: #112744 !important;
}

body[data-theme='light'] .svc-desc,
body[data-theme='light'] .client-meta,
body[data-theme='light'] .svc-duration,
body[data-theme='light'] .biz-email {
  color: #4b607d !important;
}

body[data-theme='light'] .client-avatar {
  background: #dbeafe !important;
  color: #1d4ed8 !important;
}

/* Edit form inside client rows */
body[data-theme='light'] .edit-form {
  background: #f4f8ff !important;
  border-top-color: rgba(59,130,246,0.15) !important;
}
body[data-theme='light'] .e-input {
  background: #ffffff !important;
  border-color: rgba(37,99,235,0.28) !important;
  color: #0f1f39 !important;
}

/* Admin table */
body[data-theme='light'] table th {
  background: #edf4ff !important;
  color: #35527a !important;
  border-color: rgba(59,130,246,0.18) !important;
}
body[data-theme='light'] table td {
  border-color: rgba(59,130,246,0.1) !important;
  color: #16243b !important;
}
body[data-theme='light'] tr:hover td {
  background: rgba(59,130,246,0.04) !important;
}
body[data-theme='light'] .slug-link { color: #2563eb !important; }

/* Booking page (public) */
body[data-theme='light'] .form-section,
body[data-theme='light'] .service-card,
body[data-theme='light'] .svc-card,
body[data-theme='light'] .book-form-card {
  background: #ffffff !important;
  border-color: rgba(59,130,246,0.2) !important;
}

/* Appointment pane on calendar.ejs (form-card inside appt-section) */
body[data-theme='light'] #appt-section .form-card,
body[data-theme='light'] .appt-section .form-card {
  background: #ffffff !important;
  border-color: rgba(59,130,246,0.2) !important;
}
body[data-theme='light'] .form-card h2 { color: #35527a !important; }
body[data-theme='light'] .form-card label { color: #35527a !important; }
body[data-theme='light'] .form-card input,
body[data-theme='light'] .form-card select,
body[data-theme='light'] .form-card textarea {
  background: #f8fbff !important;
  border-color: rgba(37,99,235,0.28) !important;
  color: #0f1f39 !important;
}

/* Slot badge / selected slot banners */
body[data-theme='light'] .slot-badge {
  background: #eef4ff !important;
  border-color: rgba(59,130,246,0.3) !important;
}
body[data-theme='light'] .slot-badge .slot-text strong { color: #1d4ed8 !important; }

/* Services page price-type toggle */
body[data-theme='light'] .price-toggle-wrap {
  background: #edf4ff !important;
  border-color: rgba(59,130,246,0.2) !important;
}
body[data-theme='light'] .price-toggle-opt { color: #35527a !important; }
body[data-theme='light'] .price-toggle-opt.active {
  background: #2563eb !important;
  color: #ffffff !important;
}

/* Cal-public toggle row */
body[data-theme='light'] .cal-toggle-row {
  background: #ffffff !important;
  border-color: rgba(59,130,246,0.24) !important;
}
body[data-theme='light'] .cal-toggle-meta strong { color: #112744 !important; }
body[data-theme='light'] .cal-toggle-meta span { color: #4b607d !important; }

/* Fix: body[data-theme='light'] > * applies position:relative which breaks position:fixed */
/* Explicitly restore fixed positioning for overlay elements */
body[data-theme='light'] .side-pane {
  position: fixed !important;
  top: 56px !important;
  z-index: 200 !important;
  background: #ffffff !important;
  border-left-color: rgba(59,130,246,0.28) !important;
}

body[data-theme='light'] .multi-bar {
  position: fixed !important;
  z-index: 300 !important;
  background: #ffffff !important;
  border-color: rgba(59,130,246,0.28) !important;
}

body[data-theme='light'] .toast,
body[data-theme='light'] #toast {
  position: fixed !important;
  z-index: 400 !important;
  background: #ffffff !important;
  border-color: rgba(59,130,246,0.28) !important;
  color: #1d4ed8 !important;
}

body[data-theme='light'] .pane-head h2,
body[data-theme='light'] .pane-info strong,
body[data-theme='light'] .booked-detail .name {
  color: #112744 !important;
}

body[data-theme='light'] .pane-head {
  border-bottom-color: rgba(59,130,246,0.2) !important;
}

body[data-theme='light'] .pane-body select,
body[data-theme='light'] .pane-body .pane-input,
body[data-theme='light'] .pane-body input {
  background: #f8fbff !important;
  border-color: rgba(37,99,235,0.28) !important;
  color: #0f1f39 !important;
}

body[data-theme='light'] .client-dropdown {
  position: absolute !important;
  background: #ffffff !important;
  border-color: rgba(59,130,246,0.28) !important;
  box-shadow: 0 8px 24px rgba(30,64,175,0.12) !important;
}

body[data-theme='light'] .client-opt:hover,
body[data-theme='light'] .client-opt.active {
  background: #e6efff !important;
}

body[data-theme='light'] .client-opt-meta {
  color: #4b607d !important;
}

body[data-theme='light'] .client-opt-add {
  color: #2563eb !important;
}
