/* ═══════════════════════════════════════════════════════════════
   OMS Smart Planning — Global Design System
   Cross-platform compatible (PC + Mobile + Tablet)
   WCAG AA compliant contrast ratios
   ═══════════════════════════════════════════════════════════════ */

/* ─── LIGHT MODE (Default) ────────────────────────────────────── */
:root {
  color-scheme: light;
  /* Backgrounds */
  --bg-main: #F1F5F9;
  /* Slate 100 — page background */
  --surface-main: #FFFFFF;
  /* White — cards, sidebars */
  --surface-muted: #F8FAFC;
  /* Slate 50 — inset areas */
  --surface-raised: #FFFFFF;
  /* Elevated elements */

  /* Text — always opposite of background */
  --text-primary: #1E293B;
  /* Slate 800 — main body text */
  --text-secondary: #64748B;
  /* Slate 500 — secondary/muted */
  --text-inverse: #FFFFFF;
  /* On dark backgrounds */

  /* Brand */
  --primary-brand: #2563EB;
  /* Blue 600 */
  --accent-brand: #3B82F6;
  /* Blue 500 */
  --primary-hover: #1D4ED8;
  /* Blue 700 */

  /* Borders */
  --border-main: #E2E8F0;
  /* Slate 200 */
  --border-muted: #F1F5F9;
  /* Subtle separator */

  /* Status Colors — vivid for quick scanning */
  --success: #059669;
  /* Emerald 600 */
  --success-bg: #ECFDF5;
  /* Emerald 50 */
  --warning: #D97706;
  /* Amber 600 */
  --warning-bg: #FFFBEB;
  /* Amber 50 */
  --danger: #DC2626;
  /* Red 600 */
  --danger-bg: #FEF2F2;
  /* Red 50 */
  --info: #0284C7;
  /* Sky 600 */
  --info-bg: #F0F9FF;
  /* Sky 50 */

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);

  /* Radius */
  --border-radius-sm: 6px;
  --border-radius-md: 8px;
  --border-radius-lg: 14px;

  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --transition-speed: 0.2s;

  /* ─── Backward-compatible aliases ─── */
  --primary-blue: #2563EB;
  --secondary-blue: #1D4ED8;
  --accent-blue: #3B82F6;
  --light-blue-bg: #F1F5F9;
  --white: #FFFFFF;
  --text-dark: #1E293B;
  --text-muted: #64748B;
  --success-green: #059669;
  --warning-orange: #D97706;
  --danger-red: #DC2626;
}

/* ─── DARK MODE ───────────────────────────────────────────────── */
body.dark-mode {
  color-scheme: dark;
  /* Backgrounds */
  --bg-main: #111827;
  /* Gray 900 */
  --surface-main: #1F2937;
  /* Gray 800 */
  --surface-muted: #374151;
  /* Gray 700 */
  --surface-raised: #374151;

  /* Text */
  --text-primary: #F9FAFB;
  /* Gray 50 — maximum readability */
  --text-secondary: #D1D5DB;
  /* Gray 300 */
  --text-inverse: #111827;

  /* Brand */
  --primary-brand: #60A5FA;
  /* Blue 400 */
  --accent-brand: #93C5FD;
  /* Blue 300 */
  --primary-hover: #3B82F6;

  /* Borders */
  --border-main: #4B5563;
  /* Gray 600 */
  --border-muted: #374151;

  /* Status Colors */
  --success: #34D399;
  --success-bg: rgba(52, 211, 153, 0.15);
  --warning: #FBBF24;
  --warning-bg: rgba(251, 191, 36, 0.15);
  --danger: #F87171;
  --danger-bg: rgba(248, 113, 113, 0.15);
  --info: #38BDF8;
  --info-bg: rgba(56, 189, 248, 0.15);

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.5);

  /* Backward-compatible aliases */
  --primary-blue: #60A5FA;
  --secondary-blue: #3B82F6;
  --accent-blue: #93C5FD;
  --light-blue-bg: rgba(59, 130, 246, 0.15);
  /* Tinted surface instead of flat gray */
  --white: #1F2937;
  /* Card background match */
  --text-dark: #F9FAFB;
  --text-muted: #D1D5DB;
  --success-green: #34D399;
  --warning-orange: #FBBF24;
  --danger-red: #F87171;
}


/* ═══════════════════════════════════════════════════════════════
   GLOBAL RESET & BASE
   ═══════════════════════════════════════════════════════════════ */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--transition-speed), color var(--transition-speed);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 600;
  color: var(--text-primary);
}

a {
  color: var(--primary-brand);
  text-decoration: none;
  transition: color var(--transition-speed);
}

a:hover {
  color: var(--accent-brand);
}


/* ═══════════════════════════════════════════════════════════════
   SIDEBAR & NAVIGATION
   ═══════════════════════════════════════════════════════════════ */

.sidebar {
  background-color: var(--surface-main);
  border-right: 1px solid var(--border-main);
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: background-color var(--transition-speed), border-color var(--transition-speed);
}

.nav-section {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 2rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.875rem;
  color: var(--text-secondary);
  border-radius: var(--border-radius-md);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all var(--transition-speed);
  position: relative;
}

.nav-link:hover {
  background-color: var(--surface-muted);
  color: var(--text-primary);
}

.nav-link.active {
  background-color: var(--info-bg);
  color: var(--primary-brand);
  font-weight: 600;
}

.nav-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  height: 60%;
  width: 3px;
  background-color: var(--primary-brand);
  border-radius: 0 4px 4px 0;
}

.nav-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-header {
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-main);
}

.switch-view-btn {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border-radius: var(--border-radius-md);
  background: var(--surface-muted);
  border: 1px solid var(--border-main);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  transition: all var(--transition-speed);
}

.switch-view-btn:hover {
  background: var(--border-main);
  color: var(--text-primary);
}


/* ─── Activity Log ──────────────────────────────────────────── */

.activity-section {
  border-top: 1px solid var(--border-main);
  padding-top: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.activity-title {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.875rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.activity-list {
  overflow-y: auto;
  padding-right: 4px;
}

.activity-item {
  padding: 0.75rem;
  border-radius: var(--border-radius-md);
  background: var(--surface-muted);
  margin-bottom: 0.5rem;
  border-left: 3px solid var(--primary-brand);
  transition: all var(--transition-speed);
}

.activity-item:hover {
  background: var(--surface-main);
  box-shadow: var(--shadow-sm);
}

.activity-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.2rem;
  font-size: 0.75rem;
}

.activity-user {
  font-weight: 700;
  color: var(--text-primary);
}

.activity-time {
  color: var(--text-secondary);
}

.activity-action {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary-brand);
  margin-bottom: 0.1rem;
}

.activity-detail {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


/* ═══════════════════════════════════════════════════════════════
   LAYOUT UTILITIES
   ═══════════════════════════════════════════════════════════════ */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.justify-end {
  justify-content: flex-end;
}

.gap-2 {
  gap: 0.5rem;
}

.gap-4 {
  gap: 1rem;
}

.gap-6 {
  gap: 1.5rem;
}


/* ═══════════════════════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════════════════════ */

.card {
  background-color: var(--surface-main);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  border: 1px solid var(--border-main);
  transition: transform var(--transition-speed), box-shadow var(--transition-speed),
    background-color var(--transition-speed), border-color var(--transition-speed);
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}


/* ═══════════════════════════════════════════════════════════════
   MULTI-SELECT
   ═══════════════════════════════════════════════════════════════ */

.multi-select-container {
  position: relative;
  user-select: none;
  width: 100%;
}

.multi-select-display {
  width: 100%;
  padding: 0.5rem 2.5rem 0.5rem 0.75rem;
  border: 1px solid var(--border-main);
  border-radius: var(--border-radius-md);
  background: var(--surface-main);
  color: var(--text-primary);
  min-height: 38px;
  cursor: pointer;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  align-items: center;
  font-size: 0.875rem;
  transition: border-color var(--transition-speed), box-shadow var(--transition-speed),
    background-color var(--transition-speed);
}

.multi-select-display:focus,
.multi-select-display:active {
  outline: none;
  border-color: var(--primary-brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.multi-select-display:after {
  content: '▼';
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.6rem;
  color: var(--text-secondary);
  pointer-events: none;
}

.multi-tag {
  background: var(--primary-brand);
  color: var(--text-inverse);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 1.2;
}

.multi-tag .remove {
  cursor: pointer;
  font-weight: bold;
  opacity: 0.8;
}

.multi-tag .remove:hover {
  opacity: 1;
}

.multi-options {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: var(--surface-main);
  border: 1px solid var(--border-main);
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 1100;
  max-height: 250px;
  overflow-y: auto;
  display: none;
}

.multi-options.open {
  display: block;
}

.multi-option {
  padding: 0.6rem 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: var(--text-primary);
  transition: background 0.1s;
}

.multi-option:hover {
  background: var(--surface-muted);
}

.multi-option input[type="checkbox"] {
  pointer-events: none;
  width: 14px;
  height: 14px;
}

.multi-group-label {
  padding: 0.5rem 1rem;
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-secondary);
  background: var(--surface-muted);
  border-bottom: 1px solid var(--border-main);
  margin-top: 0.5rem;
}


/* ═══════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius-md);
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all var(--transition-speed);
  font-size: 0.875rem;
  color: var(--text-primary);
}

.btn-primary {
  background-color: var(--primary-brand);
  color: var(--text-inverse);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
}

.btn-secondary {
  background-color: transparent;
  border: 1px solid var(--border-main);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background-color: var(--surface-muted);
}

/* Action Pills — styled like status badges */
.btn-pill {
  padding: 4px 12px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition-speed);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 60px;
}

.btn-pill-primary {
  background: var(--light-blue-bg);
  color: var(--primary-brand);
  border-color: var(--primary-brand);
}

.btn-pill-success {
  background: var(--success-bg);
  color: var(--success);
  border-color: var(--success);
}

.btn-pill-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: var(--danger);
}

.btn-pill-warning {
  background: var(--warning-bg);
  color: var(--warning);
  border-color: var(--warning);
}

.btn-pill:hover {
  opacity: 0.8 !important;
  transform: translateY(-1px);
}


/* ═══════════════════════════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════════════════════════ */

.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
  color: var(--text-primary);
}

.form-input,
.form-select,
select {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border-main);
  border-radius: var(--border-radius-md);
  font-size: 0.875rem;
  font-family: inherit;
  background-color: var(--surface-main);
  color: var(--text-primary);
  transition: border-color var(--transition-speed), box-shadow var(--transition-speed),
    background-color var(--transition-speed);
}

.form-input:focus,
.form-select:focus,
select:focus {
  outline: none;
  border-color: var(--primary-brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}


/* ═══════════════════════════════════════════════════════════════
   TABLES — readable in both modes
   ═══════════════════════════════════════════════════════════════ */

table {
  width: 100%;
  border-collapse: collapse;
  color: var(--text-primary);
}

table th {
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border-main);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.75rem;
}

table td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--border-main);
}

table tr:hover td {
  background: var(--surface-muted);
}


/* ═══════════════════════════════════════════════════════════════
   NAVBAR
   ═══════════════════════════════════════════════════════════════ */

.navbar {
  background-color: var(--surface-main);
  box-shadow: var(--shadow-sm);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-main);
  transition: background-color var(--transition-speed), border-color var(--transition-speed);
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  color: var(--primary-brand);
  font-size: 1.25rem;
}


/* ═══════════════════════════════════════════════════════════════
   UTILITIES
   ═══════════════════════════════════════════════════════════════ */

.text-muted {
  color: var(--text-secondary);
}

.text-sm {
  font-size: 0.875rem;
}

.text-lg {
  font-size: 1.125rem;
}

.font-bold {
  font-weight: 700;
}

.text-center {
  text-align: center;
}

.mt-4 {
  margin-top: 1rem;
}

.mb-4 {
  margin-bottom: 1rem;
}

.mb-6 {
  margin-bottom: 1.5rem;
}


/* ═══════════════════════════════════════════════════════════════
   STATUS BADGES — colored for quick recognition
   ═══════════════════════════════════════════════════════════════ */

.badge-success {
  background: var(--success-bg);
  color: var(--success);
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 99px;
  font-size: 0.75rem;
}

.badge-warning {
  background: var(--warning-bg);
  color: var(--warning);
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 99px;
  font-size: 0.75rem;
}

.badge-danger {
  background: var(--danger-bg);
  color: var(--danger);
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 99px;
  font-size: 0.75rem;
}

.badge-info {
  background: var(--info-bg);
  color: var(--info);
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 99px;
  font-size: 0.75rem;
}

/* ── Inline status badges (.bg-badge) ─────────────────────────────
   These always have bright solid backgrounds (orange, green, etc).
   Text must be dark for contrast in BOTH light and dark mode.      */
.bg-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #111827 !important;
  /* dark text regardless of theme */
  letter-spacing: 0.02em;
}

/* ── Taxing number pill (inline background:#F1F5F9 in table rows) ─
   In dark mode the bright chip is unreadable — swap to a dark chip.  */
body.dark-mode span[style*="background:#F1F5F9"],
body.dark-mode span[style*="background: #F1F5F9"] {
  background: #1e293b !important;
  color: #93c5fd !important;
  border: 1px solid #334155;
}


/* ═══════════════════════════════════════════════════════════════
   DARK MODE — Component-specific adjustments
   ═══════════════════════════════════════════════════════════════ */

body.dark-mode .ai-suggestion {
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.08) 0%, rgba(147, 197, 253, 0.08) 100%);
  border-color: var(--border-main);
}

body.dark-mode .suggestion-item {
  background: var(--surface-main);
  border-color: var(--border-main);
}

body.dark-mode .nav-link.active {
  background-color: rgba(96, 165, 250, 0.1);
}


/* ═══════════════════════════════════════════════════════════════
   THEME TOGGLE
   ═══════════════════════════════════════════════════════════════ */

.theme-toggle-btn {
  background: transparent;
  border: 1px solid var(--border-main);
  color: var(--text-primary);
  padding: 0.4rem 0.75rem;
  border-radius: var(--border-radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition-speed);
}

.theme-toggle-btn:hover {
  background: var(--surface-muted);
}


/* ═══════════════════════════════════════════════════════════════
   MOBILE RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */

.mobile-only {
  display: none !important;
}

.desktop-only {
  display: block !important;
}

@media (max-width: 768px) {
  .mobile-only {
    display: block !important;
  }

  .desktop-only {
    display: none !important;
  }

  .container {
    padding: 0 1rem;
  }

  .flex-mobile-col {
    flex-direction: column !important;
  }

  .navbar {
    padding: 0.75rem 1rem;
    position: sticky;
    top: 0;
    z-index: 1000;
  }

  .sidebar.active {
    left: 0;
  }

  .hamburger {
    display: flex !important;
    padding: 10px;
    margin-left: -10px;
    border-radius: var(--border-radius-md);
  }

  .hamburger:active {
    background: rgba(0, 0, 0, 0.08);
  }

  .sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1999;
    backdrop-filter: blur(4px);
  }

  .sidebar-overlay.active {
    display: block;
  }

  .main-content {
    margin-left: 0 !important;
    padding: 1rem !important;
    max-width: 100% !important;
  }

  .stats-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  .card {
    padding: 1rem !important;
    margin-bottom: 1rem !important;
  }

  .form-group-grid {
    grid-template-columns: 1fr !important;
  }

  .table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
    border: 1px solid var(--border-main);
    border-radius: var(--border-radius-md);
  }

  table {
    min-width: 800px;
  }

  .table-responsive th,
  .table-responsive td {
    white-space: nowrap;
  }

  .form-group-grid,
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr !important;
    gap: 0.5rem !important;
  }

  h1 {
    font-size: 1.5rem !important;
  }

  h2 {
    font-size: 1.25rem !important;
  }

  h3 {
    font-size: 1.1rem !important;
  }

  .btn {
    padding: 0.8rem 1.2rem;
    font-size: 1rem;
    width: 100%;
  }

  .btn-inline {
    width: auto !important;
  }

  .modal-content {
    width: 95% !important;
    margin: 10% auto !important;
    max-height: 90vh;
    overflow-y: auto;
  }
}


/* ═══════════════════════════════════════════════════════════════
   HAMBURGER ICON
   ═══════════════════════════════════════════════════════════════ */

.hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 2rem;
  height: 2rem;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 2001;
}

@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }
}

.hamburger span {
  width: 2rem;
  height: 0.25rem;
  background: var(--text-primary);
  border-radius: 10px;
  transition: all 0.3s linear;
  position: relative;
  transform-origin: 1px;
}


/* ═══════════════════════════════════════════════════════════════
   DATE RANGE PICKER
   ═══════════════════════════════════════════════════════════════ */

.date-range-container {
  position: relative;
  user-select: none;
  cursor: pointer;
}

.date-range-trigger {
  padding: 0.6rem 1rem;
  border: 1px solid var(--border-main);
  background: var(--surface-main);
  border-radius: var(--border-radius-md);
  font-size: 0.85rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 220px;
  transition: background-color var(--transition-speed), border-color var(--transition-speed), color var(--transition-speed);
}

.date-range-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 1000;
  background: var(--surface-main);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-main);
  padding: 1rem;
  margin-top: 0.5rem;
  display: none;
  width: 280px;
  color: var(--text-primary);
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.calendar-day-head {
  text-align: center;
  font-size: 0.7rem;
  color: var(--text-secondary);
  font-weight: bold;
  padding-bottom: 0.5rem;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-primary);
  transition: background 0.15s;
}

.calendar-day:hover:not(.empty) {
  background: var(--surface-muted);
}

.calendar-day.selected {
  background: var(--primary-brand) !important;
  color: var(--text-inverse) !important;
}

.calendar-day.in-range {
  background: var(--info-bg);
  border-radius: 0;
}

.calendar-day.empty {
  cursor: default;
}

.calendar-day.today {
  font-weight: bold;
  text-decoration: underline;
  color: var(--primary-brand);
}

.calendar-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--primary-brand);
  font-size: 1rem;
}

.calendar-btn:hover {
  background: var(--surface-muted);
}

/* ─── Table Controls (Standardized) ────────────────────────── */
.table-controls {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
  align-items: center;
  background: var(--surface-muted);
  padding: 0.85rem 1.25rem;
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--border-main);
  box-shadow: var(--shadow-sm);
}

.search-group {
  position: relative;
  flex: 1;
  min-width: 280px;
}

.search-input {
  width: 100%;
  padding: 0.65rem 1rem 0.65rem 2.5rem;
  border-radius: var(--border-radius-md);
  border: 1px solid var(--border-main);
  background: var(--surface-main);
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: border-color var(--transition-speed), box-shadow var(--transition-speed);
}

.search-input:focus {
  outline: none;
  border-color: var(--primary-brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  font-size: 1rem;
}

.filter-group {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.filter-select {
  padding: 0.65rem 1rem;
  border-radius: var(--border-radius-md);
  border: 1px solid var(--border-main);
  background: var(--surface-main);
  color: var(--text-primary);
  font-size: 0.875rem;
  cursor: pointer;
}

.filter-select:focus {
  outline: none;
  border-color: var(--primary-brand);
}

.sort-indicator {
  font-size: 0.75rem;
  margin-left: 4px;
  color: var(--primary-brand);
}