﻿html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

html,
body {
  font-family: var(--font-inter), ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
}

.tt-sidebar-transition {
  transition:
    width 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tt-no-scrollbar::-webkit-scrollbar {
  display: none;
}

.tt-no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

:root {
  color-scheme: light;
  --tt-brand: #004aad;
  --tt-brand-hover: #003d91;
  --tt-brand-strong: #003380;
  --tt-page: #f8fafc;
  --tt-fg: #0f172a;
  --tt-card: #ffffff;
  --tt-border: #e2e8f0;
  --tt-elevated: #f8fafc;
  --tt-elevated-hover: #f1f5f9;
  --tt-foot: #f8fafc;
  --tt-overlay: rgb(255 255 255 / 0.9);
  --tt-heading: #0f172a;
  --tt-toast: #ffffff;
  --tt-toast-border: #e2e8f0;
  --tt-shadow: 0 1px 3px rgb(15 23 42 / 0.06), 0 8px 24px -6px rgb(15 23 42 / 0.1);
  --tt-row-hover: rgb(241 245 249 / 0.95);
  --tt-divide: rgb(226 232 240 / 0.95);
  /* Page text (never use --tt-sidebar-muted outside the sidebar) */
  --tt-cell: #475569;
  --tt-muted: #64748b;
  --tt-subtle: #64748b;
  --tt-accent: #004aad;
  --tt-accent-hover: #003d91;
  --tt-accent-strong: #003380;
  --tt-accent-muted: rgb(0 74 173 / 0.08);
  --tt-accent-muted-fg: #004aad;
  --tt-selection-bg: rgb(0 74 173 / 0.2);
  --tt-selection-fg: #003380;
  --tt-chart-scheduled: #64748b;
  --tt-chart-dispatched: #0284c7;
  --tt-chart-completed: #16a34a;
  --tt-chart-line-disp: #004aad;
  --tt-chart-line-comp: #059669;
  --tt-chart-pct-low: #dc2626;
  --tt-chart-grid: #e2e8f0;
  --tt-chart-axis: #64748b;
  --tt-chart-label: #334155;
  --tt-sidebar: #004aad;
  --tt-sidebar-bg: #004aad;
  --tt-sidebar-fg: #ffffff;
  --tt-sidebar-muted: rgb(255 255 255 / 0.72);
  --tt-sidebar-border: rgb(255 255 255 / 0.14);
  --tt-sidebar-hover-bg: rgb(255 255 255 / 0.1);
  --tt-sidebar-active-bg: rgb(255 255 255 / 0.18);
  --tt-sidebar-active-fg: #ffffff;
  --tt-sidebar-chip-bg: rgb(255 255 255 / 0.12);
  --tt-sidebar-width: 17.5rem;
  --tt-success: #059669;
  --tt-success-hover: #047857;
  --tt-warning: #d97706;
  --tt-error: #dc2626;
  --tt-danger: #dc2626;
  --tt-danger-hover: #b91c1c;
  --tt-login-bg: #0f172a;
  /* Trip-type labels (summary + monthly tables) */
  --tt-trip-wellness-fg: #15803d;
  --tt-trip-wellness-icon: #16a34a;
  --tt-trip-wellness-border: rgb(34 197 94 / 0.38);
  --tt-trip-medical-fg: #1d4ed8;
  --tt-trip-medical-icon: #2563eb;
  --tt-trip-medical-border: rgb(59 130 246 / 0.38);
  --tt-trip-outside-fg: #7e22ce;
  --tt-trip-outside-icon: #9333ea;
  --tt-trip-outside-border: rgb(168 85 247 / 0.38);
  --tt-trip-manual-fg: #003380;
  --tt-trip-manual-icon: #004aad;
  --tt-trip-manual-border: rgb(0 74 173 / 0.35);
  --tt-trip-courtesy-fg: #be185d;
  --tt-trip-courtesy-icon: #db2777;
  --tt-trip-courtesy-border: rgb(236 72 153 / 0.38);
  --tt-trip-total-fg: #0f172a;
  --tt-trip-total-icon: #0f172a;
  --tt-trip-total-border: rgb(15 23 42 / 0.18);
  /* Metric + completion tones */
  --tt-metric-warn: #b45309;
  --tt-metric-good: #15803d;
  --tt-pct-good-fg: #166534;
  --tt-pct-good-bg: #dcfce7;
  --tt-pct-warn-fg: #854d0e;
  --tt-pct-warn-bg: #fef9c3;
  --tt-pct-bad-fg: #991b1b;
  --tt-pct-bad-bg: #fee2e2;
  --tt-pct-ok-fg: #047857;
  --tt-pct-ok-bg: rgb(52 211 153 / 0.16);
  --tt-pct-low-fg: #b91c1c;
  --tt-pct-low-bg: rgb(248 113 113 / 0.14);
  --tt-login-fg: #f8fafc;
  /* Typography scale (Inter) ? use across all pages */
  --tt-text-2xs: 0.625rem;
  --tt-text-xs: 0.75rem;
  --tt-text-sm: 0.875rem;
  --tt-text-lg: 1.125rem;
  --tt-text-xl: 1.25rem;
  --tt-text-stat: 1.25rem;
}

[data-theme="dark"] {
  color-scheme: dark;
  --tt-page: #09090b;
  --tt-fg: #fafafa;
  --tt-card: #18181b;
  --tt-border: #3f3f46;
  --tt-elevated: #27272a;
  --tt-elevated-hover: #3f3f46;
  --tt-foot: #18181b;
  --tt-overlay: rgb(9 9 11 / 0.88);
  --tt-heading: #fafafa;
  --tt-toast: #27272a;
  --tt-toast-border: #3f3f46;
  --tt-shadow: 0 1px 3px rgb(0 0 0 / 0.35), 0 8px 24px -6px rgb(0 0 0 / 0.45);
  --tt-row-hover: rgb(63 63 70 / 0.55);
  --tt-divide: rgb(63 63 70 / 0.95);
  --tt-cell: #d4d4d8;
  --tt-muted: #a1a1aa;
  --tt-subtle: #71717a;
  --tt-accent: #3b82f6;
  --tt-accent-hover: #2563eb;
  --tt-accent-strong: #1d4ed8;
  --tt-accent-muted: rgb(59 130 246 / 0.15);
  --tt-accent-muted-fg: #93c5fd;
  --tt-selection-bg: rgb(59 130 246 / 0.35);
  --tt-selection-fg: #dbeafe;
  --tt-chart-scheduled: #a1a1aa;
  --tt-chart-dispatched: #38bdf8;
  --tt-chart-completed: #4ade80;
  --tt-chart-line-disp: #60a5fa;
  --tt-chart-line-comp: #34d399;
  --tt-chart-pct-low: #f87171;
  --tt-chart-grid: #3f3f46;
  --tt-chart-axis: #a1a1aa;
  --tt-chart-label: #d4d4d8;
  --tt-success: #34d399;
  --tt-success-hover: #6ee7b7;
  --tt-warning: #fbbf24;
  --tt-error: #f87171;
  --tt-danger: #f87171;
  --tt-danger-hover: #fca5a5;
  --tt-trip-wellness-fg: #86efac;
  --tt-trip-wellness-icon: #4ade80;
  --tt-trip-wellness-border: rgb(74 222 128 / 0.35);
  --tt-trip-medical-fg: #93c5fd;
  --tt-trip-medical-icon: #60a5fa;
  --tt-trip-medical-border: rgb(96 165 250 / 0.35);
  --tt-trip-outside-fg: #d8b4fe;
  --tt-trip-outside-icon: #c084fc;
  --tt-trip-outside-border: rgb(192 132 252 / 0.35);
  --tt-trip-manual-fg: #93c5fd;
  --tt-trip-manual-icon: #60a5fa;
  --tt-trip-manual-border: rgb(96 165 250 / 0.35);
  --tt-trip-courtesy-fg: #f9a8d4;
  --tt-trip-courtesy-icon: #f472b6;
  --tt-trip-courtesy-border: rgb(244 114 182 / 0.35);
  --tt-trip-total-fg: #fafafa;
  --tt-trip-total-icon: #fafafa;
  --tt-trip-total-border: rgb(250 250 250 / 0.28);
  --tt-metric-warn: #fbbf24;
  --tt-metric-good: #4ade80;
  --tt-pct-good-fg: #86efac;
  --tt-pct-good-bg: rgb(22 101 52 / 0.45);
  --tt-pct-warn-fg: #fde047;
  --tt-pct-warn-bg: rgb(133 77 14 / 0.45);
  --tt-pct-bad-fg: #fecaca;
  --tt-pct-bad-bg: rgb(153 27 27 / 0.45);
  --tt-pct-ok-fg: #6ee7b7;
  --tt-pct-ok-bg: rgb(52 211 153 / 0.14);
  --tt-pct-low-fg: #fca5a5;
  --tt-pct-low-bg: rgb(248 113 113 / 0.12);
}

/* Smooth light/dark theme switch */
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.42s;
  animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none !important;
  }
}

html.tt-theme-transition,
html.tt-theme-transition body,
html.tt-theme-transition .tt-page-card,
html.tt-theme-transition .tt-section-panel,
html.tt-theme-transition .tt-sidebar,
html.tt-theme-transition .tt-workspace-header,
html.tt-theme-transition .tt-workspace-scroll,
html.tt-theme-transition .tt-rpt-card,
html.tt-theme-transition .tt-rpt-premium-hero,
html.tt-theme-transition .tt-input,
html.tt-theme-transition .tt-btn,
html.tt-theme-transition .tt-btn-ghost,
html.tt-theme-transition .tt-btn-primary,
html.tt-theme-transition .tt-report-order-btn,
html.tt-theme-transition .tt-compose-sheet,
html.tt-theme-transition .tt-compose-add__menu {
  transition:
    background-color 0.42s cubic-bezier(0.4, 0, 0.2, 1),
    color 0.42s cubic-bezier(0.4, 0, 0.2, 1),
    border-color 0.42s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.42s cubic-bezier(0.4, 0, 0.2, 1),
    fill 0.42s cubic-bezier(0.4, 0, 0.2, 1),
    stroke 0.42s cubic-bezier(0.4, 0, 0.2, 1);
}

