﻿/* ============================================
   CUSTOM COLOR SYSTEM
   Main Color: #4bb9ec
   ============================================ */

:root {
  /* Primary Brand Color */
  --primary: #4bb9ec;
  --primary-dark: #3a9fd4;
  --primary-light: #6bc8f5;
  --primary-hover: #3a9fd4;
  --primary-rgb: 75, 185, 236;
  
  /* Primary with opacity (for backgrounds) */
  --primary-50: rgba(75, 185, 236, 0.05);
  --primary-100: rgba(75, 185, 236, 0.1);
  --primary-200: rgba(75, 185, 236, 0.2);
  --primary-300: rgba(75, 185, 236, 0.3);
  --primary-500: rgba(75, 185, 236, 0.5);
  --primary-700: rgba(75, 185, 236, 0.7);
  --primary-800: rgba(75, 185, 236, 0.8);
  --primary-900: rgba(75, 185, 236, 0.9);
  
  /* Text Colors */
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --text-tertiary: #9ca3af;
  --text-light: #d1d5db;
  --text-muted: #9ca3af;
  
  /* Background Colors */
  --bg-primary: #ffffff;
  --bg-secondary: #f9fafb;
  --bg-tertiary: #f3f4f6;
  --bg-dark: #1f2937;
  
  /* Border Colors */
  --border-light: #e5e7eb;
  --border-default: #d1d5db;
  --border-dark: #9ca3af;
  
  /* Hover States */
  --hover-bg: #f3f4f6;
  --hover-text: #374151;
  
  /* Additional Colors for Chart/Data Visualization */
  --chart-primary: #4bb9ec;
  --chart-accent: #8b5cf6;
  --chart-success: #10b981;
  --chart-warning: #f59e0b;
  --chart-danger: #ef4444;
  
  /* Shadow */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);

  /* Shared theme surfaces */
  --surface-strong: #ffffff;
  --surface-soft: #f9fafb;
  --surface-muted: #f3f4f6;
  --surface-overlay: rgba(255, 255, 255, 0.84);
  --surface-contrast: #111827;
  --text-inverse: #ffffff;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --success-50: #f0fdf4;
  --success-100: #bbf7d0;
  --success-700: #15803d;
  --danger-50: #fee2e2;
  --danger-100: #fecaca;
  --danger-700: #b91c1c;
  --warning-50: #fffbeb;
  --warning-100: #fde68a;
  --warning-700: #b45309;
  --info-50: #dbeafe;
  --info-700: #1d4ed8;
}

body[data-theme="dark"] {
  --text-primary: #e5eef8;
  --text-secondary: #b6c2d2;
  --text-tertiary: #8b9ab0;
  --text-light: #64748b;
  --text-muted: #8b9ab0;
  --bg-primary: #0f172a;
  --bg-secondary: #08111f;
  --bg-tertiary: #162033;
  --bg-dark: #020617;
  --border-light: #22314b;
  --border-default: #31415f;
  --border-dark: #4b5f84;
  --hover-bg: #1b2940;
  --hover-text: #f8fafc;
  --surface-strong: #111b2e;
  --surface-soft: #0f172a;
  --surface-muted: #162033;
  --surface-overlay: rgba(15, 23, 42, 0.88);
  --surface-contrast: #e2e8f0;
  --text-inverse: #f8fafc;
  --gray-50: #0f172a;
  --gray-100: #162033;
  --gray-200: #22314b;
  --gray-300: #31415f;
  --gray-400: #64748b;
  --gray-500: #8b9ab0;
  --gray-600: #b6c2d2;
  --gray-700: #d5deea;
  --gray-800: #e2e8f0;
  --gray-900: #f8fafc;
  --success-50: rgba(20, 83, 45, 0.28);
  --success-100: rgba(34, 197, 94, 0.22);
  --success-700: #86efac;
  --danger-50: rgba(127, 29, 29, 0.24);
  --danger-100: rgba(239, 68, 68, 0.22);
  --danger-700: #fca5a5;
  --warning-50: rgba(120, 53, 15, 0.3);
  --warning-100: rgba(245, 158, 11, 0.22);
  --warning-700: #fcd34d;
  --info-50: rgba(30, 64, 175, 0.24);
  --info-700: #93c5fd;
}

/* ============================================
   BASE STYLES
   ============================================ */

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

html, body {
  height: 100%;
}

body {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.theme-app-shell {
  background:
    radial-gradient(circle at top left, rgba(var(--primary-rgb), 0.12), transparent 28%),
    linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
}

/* ============================================
   EMAIL TEMPLATE PREVIEW (Raw HTML)
   ============================================ */

/* The app uses a global CSS reset (no default heading sizes). Re-introduce basic
   email-preview typography so tags like <h1> render as expected in Preview. */
#etPreviewWrap h1,
#etPreviewWrap h2,
#etPreviewWrap h3,
#etPreviewWrap h4,
#etPreviewWrap h5,
#etPreviewWrap h6 {
  font-weight: 700;
  line-height: 1.25;
  margin: 0.75rem 0 0.5rem;
}

#etPreviewWrap h1 { font-size: 1.75rem; }
#etPreviewWrap h2 { font-size: 1.5rem; }
#etPreviewWrap h3 { font-size: 1.25rem; }
#etPreviewWrap h4 { font-size: 1.125rem; }
#etPreviewWrap h5 { font-size: 1rem; }
#etPreviewWrap h6 { font-size: 0.95rem; }

#etPreviewWrap p {
  margin: 0.5rem 0;
  line-height: 1.55;
}

#etPreviewWrap ul,
#etPreviewWrap ol {
  margin: 0.5rem 0 0.5rem 1.25rem;
  line-height: 1.55;
}

#etPreviewWrap a {
  color: #2563eb;
  text-decoration: underline;
}

input.date-input {
  font-size: 14px;
}

.sidebar {
  transition: transform 0.3s ease;
}

.sidebar-closed {
  transform: translateX(-100%);
}

.sidebar-open {
  transform: translateX(0);
}

@media (max-width: 1023px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.sidebar-open {
    transform: translateX(0);
  }
}

/* ============================================
   MOVED FROM INDEX.PHP EMBEDDED STYLES
   ============================================ */

:root {
  --background: 60 9% 98%;
  --foreground: 24 10% 10%;
  --card: 0 0% 100%;
  --card-foreground: 24 10% 10%;
  --primary-hsl: 142 76% 36%;
  --primary-foreground: 0 0% 100%;
  --secondary: 60 5% 96%;
  --muted-foreground: 24 5% 64%;
  --border: 20 6% 90%;
  --ring: 142 76% 36%;
}

.fade-in {
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

body.db-picker-open::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.32);
  z-index: 9998;
}

.litepicker {
  z-index: 9999 !important;
}

body.db-picker-open .litepicker {
  position: fixed !important;
  left: 50% !important;
  top: 50% !important;
  transform: translate(-50%, -50%) !important;
}

body.db-picker-open .litepicker .container__main {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.18);
  padding: 10px;
}

body.db-picker-open .litepicker .month-item-header div,
body.db-picker-open .litepicker .month-item-weekdays-row > div {
  color: #374151;
  font-weight: 600;
}

body.db-picker-open .litepicker .month-item-weekdays-row > div {
  font-size: 12px;
  letter-spacing: 0.02em;
}

body.db-picker-open .litepicker .day-item {
  border-radius: 8px;
  transition: background-color 0.15s ease, color 0.15s ease;
  color: #111827;
}

body.db-picker-open .litepicker .day-item:hover {
  background-color: #f3f4f6;
}

body.db-picker-open .litepicker .day-item.is-today {
  color: #dc2626;
  font-weight: 700;
}

body.db-picker-open .litepicker .day-item.is-start-date,
body.db-picker-open .litepicker .day-item.is-end-date {
  background-color: #111827;
  color: #ffffff !important;
}

body.db-picker-open .litepicker .month-item-header .button-previous-month,
body.db-picker-open .litepicker .month-item-header .button-next-month {
  border-radius: 8px;
}

@media (max-width: 640px) {
  body.db-picker-open .litepicker .container__main {
    max-width: calc(100vw - 24px);
    padding: 8px;
  }
}

/* ============================================
   LITEPICKER DARK MODE
   ============================================ */
body[data-theme="dark"] .litepicker {
  --litepicker-container-months-background-color: #162033;
  --litepicker-container-months-box-shadow: 0 20px 45px rgba(0,0,0,0.5);
  --litepicker-month-header-color: #e5eef8;
  --litepicker-month-header-chevrons-color: #b6c2d2;
  --litepicker-month-weekday-color: #b6c2d2;
  --litepicker-day-color: #e5eef8;
  --litepicker-day-color-hover: #f8fafc;
  --litepicker-is-today-color: #f87171;
  --litepicker-is-in-range-color: #e5eef8;
  --litepicker-is-in-range-background-color: rgba(75,185,236,0.15);
  --litepicker-is-start-color: #fff;
  --litepicker-is-start-background-color: #4bb9ec;
  --litepicker-is-end-color: #fff;
  --litepicker-is-end-background-color: #4bb9ec;
  --litepicker-day-is-locked-color: #4b5f84;
}
body[data-theme="dark"] .litepicker .container__main {
  background: #162033 !important;
  border: 1px solid var(--border-default) !important;
  border-radius: 14px !important;
  box-shadow: 0 20px 45px rgba(0,0,0,0.5) !important;
}
body[data-theme="dark"] .litepicker .month-item-header div {
  color: #e5eef8 !important;
}
body[data-theme="dark"] .litepicker .month-item-header select {
  color: #e5eef8 !important;
  background: #1e293b !important;
  border: 1px solid var(--border-default) !important;
  border-radius: 6px !important;
}
body[data-theme="dark"] .litepicker .month-item-weekdays-row > div {
  color: #b6c2d2 !important;
}
.litepicker .day-item {
  color: #111827;
}
body[data-theme="dark"] .litepicker .day-item {
  color: #e5eef8 !important;
  border-radius: 8px !important;
}
body[data-theme="dark"] .litepicker .day-item:hover {
  background-color: var(--hover-bg) !important;
  color: #f8fafc !important;
}
body[data-theme="dark"] .litepicker .day-item.is-today {
  color: #f87171 !important;
  font-weight: 700;
}
body[data-theme="dark"] .litepicker .day-item.is-start-date,
body[data-theme="dark"] .litepicker .day-item.is-end-date {
  background-color: #4bb9ec !important;
  color: #fff !important;
}
body[data-theme="dark"] .litepicker .day-item.is-in-range {
  background-color: rgba(75,185,236,0.15) !important;
  color: #e5eef8 !important;
}
body[data-theme="dark"] .litepicker .day-item.is-locked {
  color: #4b5f84 !important;
}
body[data-theme="dark"] .litepicker .month-item-header .button-previous-month,
body[data-theme="dark"] .litepicker .month-item-header .button-next-month {
  border-radius: 8px !important;
  opacity: 0.8;
}
body[data-theme="dark"] .litepicker .month-item-header .button-previous-month:hover,
body[data-theme="dark"] .litepicker .month-item-header .button-next-month:hover {
  background-color: var(--border-default) !important;
  opacity: 1;
}
body[data-theme="dark"] .litepicker .month-item-header .button-previous-month > svg,
body[data-theme="dark"] .litepicker .month-item-header .button-next-month > svg {
  fill: #e5eef8 !important;
  stroke: #e5eef8 !important;
}

/* ============================================
   CHECKLIST HEADER (AJAX-SAFE)
   Ensures consistent layout even when Tailwind CDN
   hasn't generated responsive utility rules yet.
   ============================================ */

#checklistHeader {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
  #checklistHeader {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  #checklistHeader .checklist-date-controls {
    margin-left: auto;
    justify-content: flex-end;
    width: auto;
    flex: 0 0 auto;
  }

  #checklistHeader .checklist-date-wrap {
    width: auto;
  }

  #checklistDate {
    width: 11rem;
  }
}

#checklistHeader .checklist-date-wrap {
  position: relative;
  width: 100%;
}

#checklistHeader .checklist-date-input {
  width: 100%;
  padding-left: 1rem;
  padding-right: 2.5rem;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  background: #ffffff;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: #374151;
  text-align: left;
}

#checklistHeader .checklist-date-input:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.45);
  border-color: rgba(59, 130, 246, 0.75);
}

#checklistHeader .checklist-date-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  pointer-events: none;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 600;
}

p {
  color: var(--text-secondary);
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--primary-dark);
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

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

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

.btn-primary:active {
  opacity: 0.9;
}

.btn-secondary {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}

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

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

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

/* ============================================
   CARDS & CONTAINERS
   ============================================ */

.card {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: 0.5rem;
  padding: 1.5rem;
  transition: box-shadow 0.2s ease;
}

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

.card-header {
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 1rem;
  padding-bottom: 1rem;
}

/* ============================================
   INPUTS & FORM ELEMENTS
   ============================================ */

input, select, textarea {
  border: 1px solid var(--border-light);
  border-radius: 0.375rem;
  padding: 0.5rem 1rem;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  transition: all 0.2s ease;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-100);
}

input::placeholder {
  color: var(--text-tertiary);
}

/* Remove number-input spinners (financial amount fields) */
#surplusAmount,
#payments_received,
#rolling_12m_turnover {
  -moz-appearance: textfield;
  appearance: textfield;
}

#surplusAmount::-webkit-outer-spin-button,
#surplusAmount::-webkit-inner-spin-button,
#payments_received::-webkit-outer-spin-button,
#payments_received::-webkit-inner-spin-button,
#rolling_12m_turnover::-webkit-outer-spin-button,
#rolling_12m_turnover::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* ============================================
   PRIMARY COLOR UTILITIES
   ============================================ */

/* Text colors */
.text-primary {
  color: var(--primary);
}

.text-primary-hover:hover {
  color: var(--primary-dark);
}

/* Background colors */
.bg-primary {
  background-color: var(--primary);
}

.bg-primary-light {
  background-color: var(--primary-100);
}

.bg-primary-lighter {
  background-color: var(--primary-50);
}

/* Border colors */
.border-primary {
  border-color: var(--primary);
}

/* ============================================
   STATUS BADGES
   ============================================ */

.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
}

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

.badge-success {
  background-color: rgba(16, 185, 129, 0.1);
  color: #059669;
}

.badge-warning {
  background-color: rgba(245, 158, 11, 0.1);
  color: #d97706;
}

.badge-danger {
  background-color: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}

/* ===== Toast Alert Container ===== */
.toast-alert {
  position: fixed;
  top: 24px;
  right: 24px;
  padding: 10px 14px;
  border-radius: 18px;
  color: #fff;
  font-weight: 600;
  z-index: 9999;
  max-width: 360px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(6px);
  opacity: 0;
}

/* ===== Color Variants ===== */
.toast-success {
  background: var(--success-50);
  color: var(--success-700);
  border: 1px solid var(--success-100);
}

.toast-error {
  background: var(--danger-50);
  color: var(--danger-700);
  border: 1px solid var(--danger-100);
}

.toast-warning {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.toast-info {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

/* ===== Animations ===== */
@keyframes toastSlideIn {
  from { transform: translateX(120%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes toastSlideOut {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(120%); opacity: 0; }
}

@keyframes toastPulse {
  0% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4); }
  70% { box-shadow: 0 0 0 14px rgba(37, 99, 235, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}

.toast-show {
  animation: toastSlideIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275),
             toastPulse 1.2s ease-out;
  opacity: 1;
}

.toast-hide {
  animation: toastSlideOut 0.35s ease-in forwards;
}

/* ============================================
   PROGRESS BARS
   ============================================ */

.progress {
  width: 100%;
  height: 0.5rem;
  background-color: var(--border-light);
  border-radius: 9999px;
  overflow: hidden;
}

.progress-fill {
  background-color: var(--primary);
  height: 100%;
  border-radius: 9999px;
  transition: width 0.3s ease;
}

/* ============================================
   NAVIGATION
   ============================================ */

.sidebar-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
}

.nav-link:hover {
  background-color: var(--hover-bg);
  color: var(--text-primary);
}

.nav-link.active,
.nav-item-link.active {
  background-color: var(--primary);
  color: #ffffff;
}

.sidebar-group {
  border-radius: 0.75rem;
}

.nav-parent-toggle {
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-parent-toggle:hover,
.sidebar-group.open > .nav-parent-toggle {
  background-color: var(--hover-bg);
  color: var(--text-primary);
}

.nav-parent-toggle:focus-visible,
.nav-item-link:focus-visible {
  outline: 2px solid rgba(var(--primary-rgb), 0.35);
  outline-offset: 2px;
}

.submenu-arrow {
  font-size: 0.75rem;
  transition: transform 0.2s ease;
}

.sidebar-group.open > .nav-parent-toggle .submenu-arrow {
  transform: rotate(90deg);
}

.submenu-list {
  list-style: none;
  margin-top: 0.125rem;
  margin-left: 0.25rem;
  padding-left: 0.75rem;
  border-left: 1px solid var(--border-light);
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.25s ease, opacity 0.2s ease;
}

.sidebar-group.open > .submenu-list {
  max-height: 24rem;
  opacity: 1;
}

.nav-sub-link {
  padding-left: 1.25rem;
  margin-top: 0.125rem;
}

.sidebar-group.has-active-child > .nav-parent-toggle {
  background-color: var(--primary-50);
  color: var(--primary-dark);
  font-weight: 600;
}

/* ============================================
   LISTS & ACTIVITY INDICATORS
   ============================================ */

.activity-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background-color: var(--primary);
  display: inline-block;
  margin-top: 0.25rem;
}

.activity-dot-accent {
  background-color: var(--chart-accent);
}

/* ============================================
   TABLES
   ============================================ */

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background-color: var(--bg-tertiary);
}

th {
  padding: 0.75rem 1.5rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-light);
}

td {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
}

tbody tr:hover {
  background-color: var(--bg-secondary);
}

/* ============================================
   DROPDOWN & POPOVER
   ============================================ */

.dropdown {
  position: absolute;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: 0.5rem;
  box-shadow: var(--shadow-lg);
  z-index: 50;
}

.dropdown a, .dropdown button {
  display: block;
  width: 100%;
  padding: 0.5rem 1rem;
  text-align: left;
  color: var(--text-primary);
  transition: all 0.2s ease;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 0.875rem;
}

.dropdown a:hover, .dropdown button:hover {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}

/* ============================================
   ANIMATIONS
   ============================================ */

.fade-in {
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.hidden {
  display: none !important;
}

.flex {
  display: flex;
}

/* Stabilize technician filter bar */
.filter-tech-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

/* Stabilize database filter bar on initial render to prevent overlap */
.db-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
}

/* Specific min-widths for database top bar items to prevent collapse on load */
.db-filter-bar .filter-left { min-width: 260px; }
.db-filter-bar .filter-mid { min-width: 240px; }
.db-filter-bar .filter-right { min-width: 260px; }

/* Reports filter bar items (wrapper classes introduced in template) */
.filter-left { min-width: 260px; }
.filter-mid { min-width: 240px; }
.filter-right { min-width: 260px; }

.gap-2 {
  gap: 0.5rem;
}

.gap-3 {
  gap: 0.75rem;
}

.gap-4 {
  gap: 1rem;
}

.gap-6 {
  gap: 1.5rem;
}

.transition-colors {
  transition: color, background-color, border-color 0.2s ease;
}

.transition-shadow {
  transition: box-shadow 0.2s ease;
}

.rounded-lg {
  border-radius: 0.5rem;
}

.rounded-full {
  border-radius: 9999px;
}

.space-y-3 > * + * {
  margin-top: 0.75rem;
}

.space-y-4 > * + * {
  margin-top: 1rem;
}

.space-y-6 > * + * {
  margin-top: 1.5rem;
}

.w-full {
  width: 100%;
}

.h-2 {
  height: 0.5rem;
}

.h-8 {
  height: 2rem;
}

.h-12 {
  height: 3rem;
}

.w-2 {
  width: 0.5rem;
}

.w-8 {
  width: 2rem;
}

.w-12 {
  width: 3rem;
}

.mt-1 {
  margin-top: 0.25rem;
}

.mt-2 {
  margin-top: 0.5rem;
}

.mt-4 {
  margin-top: 1rem;
}

.mb-2 {
  margin-bottom: 0.5rem;
}

.mb-4 {
  margin-bottom: 1rem;
}

.mb-6 {
  margin-bottom: 1.5rem;
}

.pb-2 {
  padding-bottom: 0.5rem;
}

.pb-3 {
  padding-bottom: 0.75rem;
}

.pt-4 {
  padding-top: 1rem;
}

.px-3 {
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

.px-4 {
  padding-left: 1rem;
  padding-right: 1rem;
}

.py-1 {
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
}

.py-2 {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.text-xs {
  font-size: 0.75rem;
}

.text-sm {
  font-size: 0.875rem;
}

.text-lg {
  font-size: 1.125rem;
}

.text-2xl {
  font-size: 1.5rem;
}

.text-3xl {
  font-size: 1.875rem;
}

.text-gray-500 {
  color: var(--text-tertiary);
}

.text-gray-600 {
  color: var(--text-secondary);
}

.text-gray-900 {
  color: var(--text-primary);
}

.font-medium {
  font-weight: 500;
}

.font-semibold {
  font-weight: 600;
}

.font-bold {
  font-weight: 700;
}

.tracking-tight {
  letter-spacing: -0.02em;
}

.opacity-75 {
  opacity: 0.75;
}

.line-through {
  text-decoration: line-through;
}

.min-w-0 {
  min-width: 0;
}

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

@media (max-width: 768px) {
  .hidden-mobile {
    display: none;
  }
}

@media (min-width: 768px) {
  .hidden-desktop {
    display: none;
  }
}

/* ============================================
   CUSTOM COLOR CLASSES (co- prefix)
   ============================================ */

/* Primary Color Classes */
.co-bg-primary {
  background-color: var(--primary);
}

.co-bg-primary-dark {
  background-color: var(--primary-dark);
}

.co-bg-primary-light {
  background-color: var(--primary-100);
}

.co-bg-primary-50 {
  background-color: var(--primary-50);
}

.co-text-primary {
  color: var(--primary);
}

.co-text-primary-dark {
  color: var(--primary-dark);
}

.co-text-white {
  color: #ffffff;
}

.co-text-danger {
  color: #ef4444;
}

.co-border-primary-light {
  border-color: var(--primary-100);
}

.co-border-primary {
  border-color: var(--primary);
}

/* Accent/Secondary Colors */
.co-bg-accent {
  background-color: var(--chart-accent);
}

.co-bg-accent-light {
  background-color: rgba(139, 92, 246, 0.1);
}

.co-text-accent {
  color: var(--chart-accent);
}

/* Warning/Status Colors */
.co-bg-warning-light {
  background-color: rgba(245, 158, 11, 0.1);
}

.co-border-warning-light {
  border-color: rgba(245, 158, 11, 0.2);
}

.co-text-warning {
  color: #f59e0b;
}

/* Hover States with Color */
.co-hover-bg-primary-dark:hover {
  background-color: var(--primary-dark);
}

.co-hover-bg-primary-light:hover {
  background-color: var(--primary-100);
}

.co-hover-text-primary-dark:hover {
  color: var(--primary-dark);
}

.co-hover-text-primary:hover {
  color: var(--primary);
}

/* Focus States with Color */
.co-focus-ring-primary:focus {
  outline: none;
  box-shadow: 0 0 0 3px var(--primary-100);
  border-color: var(--primary);
}

/* Combined Classes for Common Patterns */
.co-button-primary {
  background-color: var(--primary);
  color: #ffffff;
  transition: all 0.2s ease;
}

.co-button-primary:hover {
  background-color: var(--primary-dark);
}

.co-badge-primary {
  background-color: var(--primary-100);
  color: var(--primary-dark);
}

/* ============================================
   MODERN UI ENHANCEMENTS
   ============================================ */

/* Larger modern radius */
.rounded-xl {
  border-radius: 0.75rem;
}

.rounded-2xl {
  border-radius: 1rem;
}

.theme-toggle {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
}

.theme-toggle-track {
  display: inline-flex;
  align-items: center;
  width: 3.5rem;
  height: 2rem;
  padding: 0.1875rem;
  border-radius: 9999px;
  background: var(--surface-muted);
  border: 1px solid var(--border-light);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.08);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.theme-toggle-thumb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 9999px;
  background: var(--surface-strong);
  color: var(--gray-700);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.18);
  transform: translateX(0);
  transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.theme-toggle.is-active .theme-toggle-track {
  background: rgba(var(--primary-rgb), 0.18);
  border-color: rgba(var(--primary-rgb), 0.4);
}

.theme-toggle.is-active .theme-toggle-thumb {
  transform: translateX(1.5rem);
  background: var(--primary);
  color: var(--text-inverse);
}

.theme-toggle:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

/* Premium card feel */
.card-modern {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.04);
  transition: all 0.25s ease;
}

.card-modern:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 40px rgba(var(--primary-rgb), 0.08);
}

/* Elevated primary button */
.btn-primary {
  background-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.3);
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  box-shadow: 0 6px 18px rgba(var(--primary-rgb), 0.4);
  transform: translateY(-1px);
}

/* Smooth transitions globally */
button,
.card,
input,
select,
textarea {
  transition: all 0.2s ease;
}

body[data-theme="dark"] .bg-white,
body[data-theme="dark"] .bg-white\/60,
body[data-theme="dark"] .bg-white\/70,
body[data-theme="dark"] .bg-white\/80,
body[data-theme="dark"] .bg-white\/90 {
  background-color: var(--surface-strong) !important;
}

body[data-theme="dark"] .bg-gray-50,
body[data-theme="dark"] .bg-gray-50\/80,
body[data-theme="dark"] .bg-gray-100,
body[data-theme="dark"] .bg-gray-100\/60,
body[data-theme="dark"] .bg-gray-100\/80,
body[data-theme="dark"] .bg-gray-200 {
  background-color: var(--surface-muted) !important;
}

body[data-theme="dark"] .text-gray-400 { color: var(--gray-400) !important; }
body[data-theme="dark"] .text-gray-500 { color: var(--gray-500) !important; }
body[data-theme="dark"] .text-gray-600 { color: var(--gray-600) !important; }
body[data-theme="dark"] .text-gray-700 { color: var(--gray-700) !important; }
body[data-theme="dark"] .text-gray-800 { color: var(--gray-800) !important; }
body[data-theme="dark"] .text-gray-900 { color: var(--gray-900) !important; }

body[data-theme="dark"] .border-gray-100,
body[data-theme="dark"] .border-gray-200,
body[data-theme="dark"] .border-gray-200\/70,
body[data-theme="dark"] .border-gray-200\/80,
body[data-theme="dark"] .border-gray-300,
body[data-theme="dark"] .ring-gray-100,
body[data-theme="dark"] .divide-gray-100 {
  border-color: var(--border-light) !important;
}

body[data-theme="dark"] .shadow-sm,
body[data-theme="dark"] .shadow-md,
body[data-theme="dark"] .shadow-lg,
body[data-theme="dark"] .shadow-xl {
  box-shadow: 0 4px 12px rgba(2, 6, 23, 0.3) !important;
}
body[data-theme="dark"] .shadow-gray-200\/50,
body[data-theme="dark"] .hover\:shadow-lg:hover {
  box-shadow: 0 4px 12px rgba(2, 6, 23, 0.3) !important;
}

body[data-theme="dark"] .hover\:bg-gray-50:hover,
body[data-theme="dark"] .hover\:bg-gray-100:hover,
body[data-theme="dark"] .hover\:bg-gray-200:hover {
  background-color: var(--hover-bg) !important;
}

body[data-theme="dark"] .hover\:text-gray-600:hover,
body[data-theme="dark"] .hover\:text-gray-700:hover,
body[data-theme="dark"] .hover\:text-gray-800:hover,
body[data-theme="dark"] .hover\:text-gray-900:hover,
body[data-theme="dark"] .hover\:text-black:hover {
  color: var(--hover-text) !important;
}

body[data-theme="dark"] .bg-black\/50 {
  background-color: rgba(2, 6, 23, 0.72) !important;
}

body[data-theme="dark"] .bg-gradient-to-br {
  background-image: linear-gradient(135deg, #0b1220 0%, #111b2e 50%, #1a2740 100%) !important;
}

body[data-theme="dark"] .from-blue-50,
body[data-theme="dark"] .via-white,
body[data-theme="dark"] .to-blue-100 {
  --tw-gradient-from: #0b1220 var(--tw-gradient-from-position) !important;
  --tw-gradient-to: rgb(11 18 32 / 0) var(--tw-gradient-to-position) !important;
  --tw-gradient-stops: var(--tw-gradient-from), #111b2e var(--tw-gradient-via-position), var(--tw-gradient-to) !important;
  --tw-gradient-to: #1a2740 var(--tw-gradient-to-position) !important;
}

body[data-theme="dark"] .co-text-white,
body[data-theme="dark"] .text-white {
  color: var(--text-inverse) !important;
}

/* ============================================
   TABLE HEADER (gradient override for dark mode)
   ============================================ */
body[data-theme="dark"] .co-table-head {
  background: var(--surface-muted) !important;
  background-image: none !important;
  border-color: var(--border-default) !important;
}
body[data-theme="dark"] .co-table-head th {
  color: var(--text-secondary) !important;
}

/* ============================================
   BULK ACTION DELETE BAR
   ============================================ */
body[data-theme="dark"] #dbBulkActionBar > div,
body[data-theme="dark"] #surplusBulkActionBar > div,
body[data-theme="dark"] #tlBulkActionBar > div {
  background: var(--bg-tertiary, #162033) !important;
  border-color: var(--border-default) !important;
  box-shadow: 0 8px 32px rgba(0,0,0,0.45), 0 2px 8px rgba(0,0,0,0.3) !important;
}
body[data-theme="dark"] #dbBulkActionBar .h-8.w-px,
body[data-theme="dark"] #surplusBulkActionBar .h-8.w-px,
body[data-theme="dark"] #tlBulkActionBar .h-8.w-px {
  background-color: var(--border-default) !important;
}
body[data-theme="dark"] #dbDeleteSelected,
body[data-theme="dark"] #surplusDeleteSelected,
body[data-theme="dark"] #tlDeleteSelected {
  background-color: var(--surface-strong) !important;
  border-color: var(--border-dark) !important;
}
body[data-theme="dark"] #dbClearSelection,
body[data-theme="dark"] #surplusClearSelection,
body[data-theme="dark"] #tlClearSelection {
  color: var(--text-secondary) !important;
}
body[data-theme="dark"] #dbClearSelection:hover,
body[data-theme="dark"] #surplusClearSelection:hover,
body[data-theme="dark"] #tlClearSelection:hover {
  color: var(--text-primary) !important;
}

/* ============================================
   NOTIFICATION PANEL
   ============================================ */
.notifications-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  width: 340px;
  max-width: calc(100vw - 16px);
  background: var(--surface, #fff);
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 4px 6px -2px rgba(0,0,0,0.06), 0 12px 32px -4px rgba(0,0,0,0.13);
  z-index: 50;
  overflow: hidden;
  flex-direction: column;
}

/* Visible state — specificity (0,2,0) beats .hidden (0,1,0) */
.notifications-panel:not(.hidden) {
  display: flex;
}

.notifications-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  border-bottom: 1px solid #f1f5f9;
  background: var(--surface, #fff);
  flex-shrink: 0;
  gap: 8px;
}

.notifications-panel-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.notifications-panel-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 11px;
  color: #64748b;
}

.notifications-panel-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-primary, #111827);
  letter-spacing: -0.01em;
}

.notifications-panel-clear {
  font-size: 0.72rem;
  font-weight: 500;
  color: #94a3b8;
  background: none;
  border: none;
  cursor: pointer;
  padding: 3px 6px;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}

.notifications-panel-clear:hover {
  background: #fee2e2;
  color: #dc2626;
}

.notifications-panel-list {
  overflow-y: auto;
  overflow-x: hidden;
  max-height: 340px;          /* fallback for older browsers */
  max-height: min(340px, 60vh); /* modern: never exceed 60% of viewport */
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
  flex: 1;
}

.notifications-panel-list::-webkit-scrollbar {
  width: 4px;
}
.notifications-panel-list::-webkit-scrollbar-track {
  background: transparent;
}
.notifications-panel-list::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.notification-empty {
  padding: 2rem 1.25rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-align: center;
}

.notification-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 11px 16px;
  border: none;
  border-bottom: 1px solid #f8fafc;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  transition: background-color 0.15s ease;
}

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

.notification-item.is-read {
  background-color: transparent;
}

.notification-item.is-unread {
  background-color: #fff8f8;
  border-left: 3px solid #f87171;
}

.notification-item:hover {
  background-color: #f8fafc;
}

.notification-item-message {
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.5;
  color: inherit;
  word-break: break-word;
}

.notification-item.is-unread .notification-item-message {
  color: #111827;
}

.notification-item-time {
  margin-top: 3px;
  font-size: 0.7rem;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
}

body[data-theme="dark"] .notifications-panel {
  background: var(--surface-elevated, #1e293b);
  border-color: rgba(255,255,255,0.1);
  box-shadow: 0 4px 6px -2px rgba(0,0,0,0.3), 0 12px 32px -4px rgba(0,0,0,0.4);
}
body[data-theme="dark"] .notifications-panel-header {
  background: var(--surface-elevated, #1e293b);
  border-color: rgba(255,255,255,0.07);
}
body[data-theme="dark"] .notifications-panel-icon {
  background: rgba(255,255,255,0.08);
  color: #94a3b8;
}
body[data-theme="dark"] .notifications-panel-clear {
  color: var(--text-secondary);
}
body[data-theme="dark"] .notifications-panel-clear:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}
body[data-theme="dark"] .notification-item.is-unread {
  background-color: rgba(248, 113, 113, 0.1);
  border-left-color: #f87171;
}
body[data-theme="dark"] .notification-item.is-unread .notification-item-message {
  color: var(--text-primary);
}
body[data-theme="dark"] .notification-item:hover {
  background-color: rgba(255,255,255,0.05);
}
body[data-theme="dark"] .notification-item {
  border-bottom-color: rgba(255,255,255,0.07);
}

/* Configuration page tabs */
body[data-theme="dark"] .config-tab-btn.bg-gray-100 {
  background-color: var(--surface-muted) !important;
  color: var(--text-secondary) !important;
}
body[data-theme="dark"] .config-tab-btn.bg-gray-100:hover {
  background-color: var(--border-default) !important;
  color: var(--text-primary) !important;
}
body[data-theme="dark"] .config-tab-btn.bg-gray-900 {
  background-color: var(--primary) !important;
  color: #fff !important;
}
body[data-theme="dark"] .config-tab-btn.bg-gray-900:hover {
  background-color: var(--primary-dark) !important;
  color: #fff !important;
}

/* Input table: first-row highlight */
body[data-theme="dark"] tr.bg-emerald-50,
body[data-theme="dark"] .bg-emerald-50 {
  background-color: rgba(5, 46, 22, 0.25) !important;
}
body[data-theme="dark"] tr.bg-emerald-50 td {
  color: var(--text-primary) !important;
}

/* ============================================
   REVIEWER TAG INPUT
   ============================================ */
.reviewer-tag-input {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  min-height: 42px;
  padding: 5px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  cursor: text;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.reviewer-tag-input:focus-within {
  border-color: var(--primary, #4bb9ec);
  box-shadow: 0 0 0 2px rgba(75, 185, 236, 0.18);
}
.reviewer-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 9px 3px 10px;
  background: rgba(75, 185, 236, 0.13);
  color: #0369a1;
  border-radius: 9999px;
  font-size: 0.775rem;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  user-select: none;
}
.reviewer-tag-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  min-width: 16px;
  border: none;
  background: none;
  cursor: pointer;
  color: #0369a1;
  padding: 0;
  font-size: 11px;
  opacity: 0.65;
  border-radius: 9999px;
  transition: opacity 0.15s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.reviewer-tag-remove:hover,
.reviewer-tag-remove:focus {
  opacity: 1;
  background: rgba(3, 105, 161, 0.15);
}
.reviewer-tag-field {
  flex: 1;
  min-width: 90px;
  border: none;
  outline: none;
  background: transparent;
  font-size: 0.855rem;
  color: var(--text-primary, #1f2937);
  padding: 3px 0;
  -webkit-appearance: none;
  appearance: none;
}
.reviewer-tag-field::placeholder {
  color: #9ca3af;
  font-size: 0.8rem;
}
.reviewer-tag-count {
  font-size: 0.72rem;
  color: #6b7280;
  white-space: nowrap;
  margin-left: 2px;
  flex-shrink: 0;
}

/* Checklist date navigation */
body[data-theme="dark"] #todayBtn span {
  background-color: var(--border-dark) !important;
  color: var(--text-primary) !important;
}
body[data-theme="dark"] #prevDay:hover span,
body[data-theme="dark"] #nextDay:hover span {
  background-color: var(--border-default) !important;
  color: var(--text-primary) !important;
}
body[data-theme="dark"] #prevDay span,
body[data-theme="dark"] #nextDay span {
  color: var(--text-secondary) !important;
}

body[data-theme="dark"] .reviewer-tag-input {
  background: var(--bg-tertiary) !important;
  border-color: var(--border-default) !important;
}
body[data-theme="dark"] .reviewer-tag-input:focus-within {
  border-color: var(--primary) !important;
}
body[data-theme="dark"] .reviewer-tag-field {
  color: var(--text-primary) !important;
  background: transparent !important;
}
body[data-theme="dark"] .reviewer-tag-field::placeholder {
  color: var(--text-tertiary) !important;
}
body[data-theme="dark"] .reviewer-tag {
  background: var(--border-default) !important;
  color: var(--text-primary) !important;
}

/* ============================================
   DATA ENTRY TABLE (technician turnover)
   ============================================ */
.entry-table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  /* pull the scroll container to the card edges so the scrollbar sits flush */
  margin-left: -1.5rem;
  margin-right: -1.5rem;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.entry-table {
  width: 100%;
  min-width: 800px;
  border-collapse: collapse;
}

.entry-table th {
  white-space: nowrap;
}

/* Fixed column widths */
.entry-table th:nth-child(1),
.entry-table td:nth-child(1) { width: 150px; } /* Date */
.entry-table th:nth-child(2),
.entry-table td:nth-child(2) { width: 200px; } /* Technician */
.entry-table th:nth-child(3),
.entry-table td:nth-child(3) { width: 160px; } /* Turnover */
.entry-table th:nth-child(4),
.entry-table td:nth-child(4) { width: 220px; } /* Google Review (Reviewers) */
.entry-table th:nth-child(5),
.entry-table td:nth-child(5) { width: 56px;  } /* Action */

/* ============================================
   EXECUTION GUIDE — QUILL EDITOR (modal)
   ============================================ */
#guideContentEditor {
  border-radius: 0.75rem;
  border: 1px solid #e5e7eb;
  overflow: hidden;
}
#guideContentEditor .ql-toolbar.ql-snow {
  border: none;
  border-bottom: 1px solid #e5e7eb;
  background: #f9fafb;
  padding: 8px 10px;
}
#guideContentEditor .ql-container.ql-snow {
  border: none;
  font-size: 0.9rem;
  font-family: inherit;
}
#guideContentEditor .ql-editor {
  min-height: 220px;
  line-height: 1.65;
  color: #374151;
}
#guideContentEditor .ql-editor.ql-blank::before {
  color: #9ca3af;
  font-style: normal;
}

/* ============================================
   EXECUTION GUIDE — RICH CONTENT (read view)
   ============================================ */
.guide-rich-content {
  font-size: 0.95rem;
  line-height: 1.75;
  color: #374151;
}
.guide-rich-content h1 {
  font-size: 1.6rem;
  font-weight: 700;
  color: #111827;
  margin: 1.25rem 0 0.5rem;
  line-height: 1.3;
}
.guide-rich-content h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: #111827;
  margin: 1.1rem 0 0.4rem;
  line-height: 1.35;
}
.guide-rich-content h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1f2937;
  margin: 1rem 0 0.35rem;
}
.guide-rich-content p {
  margin: 0 0 0.85rem;
}
.guide-rich-content strong { font-weight: 700; }
.guide-rich-content em { font-style: italic; }
.guide-rich-content u { text-decoration: underline; }
.guide-rich-content ul {
  list-style-type: disc;
  padding-left: 1.6rem;
  margin: 0.4rem 0 0.85rem;
}
.guide-rich-content ol {
  list-style-type: decimal;
  padding-left: 1.6rem;
  margin: 0.4rem 0 0.85rem;
}
.guide-rich-content li {
  margin-bottom: 0.3rem;
}
.guide-rich-content a {
  color: #2563eb;
  text-decoration: underline;
}
.guide-rich-content a:hover {
  color: #1d4ed8;
}
.guide-rich-content blockquote {
  border-left: 3px solid #e5e7eb;
  padding-left: 1rem;
  margin: 0.75rem 0;
  color: #6b7280;
  font-style: italic;
}

