/* UX HUMANA visual system. Layout and business forms remain in app.css. */
:root {
    color-scheme: light;
    --bg: #f5f4ef; --surface: #fffefa; --surface-soft: #edf4f1;
    --surface-muted: #e6efeb; --text: #163b43; --muted: #526b73;
    --line: #d8e3de; --teal: #08717e; --teal-strong: #075b65;
    --teal-soft: #0a809014; --coral: #b83742; --coral-strong: #a53039;
    --coral-soft: #f1574712; --accent-teal-bg: #edf4f1; --accent-coral-bg: #fcf0e9;
    --input-bg: #f9faf7; --input-border: #c6d7d3; --ink: #163b43;
    --sidebar-bg: #fffefa; --sidebar-text: #163b43; --sidebar-muted: #526b73;
    --sidebar-line: #d8e3de; --shadow: 0 8px 30px #10313a08; --radius: 24px;
    --motion-duration: 260ms;
}
html[data-theme="dark"] {
    color-scheme: dark;
    --bg: #10292e; --surface: #17373e; --surface-soft: #1b4147;
    --surface-muted: #23494e; --text: #f1f7f6; --muted: #b2cccf;
    --line: #34545a; --teal: #75d2d5; --teal-strong: #a0e5e5;
    --teal-soft: #75d2d515; --coral: #ffb5a2; --coral-strong: #ffd0b6;
    --coral-soft: #ffb5a212; --accent-teal-bg: #1b4147; --accent-coral-bg: #383c3e;
    --input-bg: #123138; --input-border: #426169; --ink: #f1f7f6;
    --sidebar-bg: #17373e; --sidebar-text: #f1f7f6; --sidebar-muted: #b2cccf;
    --sidebar-line: #34545a; --shadow: 0 8px 30px #04191c18;
    --chart-grid: #a8d6d51f; --chart-axis: #b2cccf; --chart-value: #f1f7f6;
}
body { font-family: Inter, "Segoe UI", sans-serif; font-size: 15px; line-height: 1.5; }
h1, h2, h3, h4, .brand-copy, .metric-card strong, .estimate-output strong { font-family: Outfit, "Segoe UI", sans-serif; }
button, input, select, textarea { font: inherit; }
.color-rail { height: 5px; background: linear-gradient(90deg,#f15747,#f4b942,#2fbf8f,#0a8090,#ec4899); }
.app-shell { display: block; min-height: calc(100vh - 5px); padding-top: 24px; }
.app-header { display: flex; align-items: center; gap: 22px; max-width: 1320px; margin: 0 auto 20px; padding: 14px 22px; width: calc(100% - 48px); background: var(--surface); border: 1px solid var(--line); border-radius: 48px; box-shadow: var(--shadow); }
.brand { padding: 0; border: 0; border-radius: 0; background: none; gap: 16px; flex-shrink: 0; color: var(--text); }
.brand img { width: 140px; height: auto; padding: 5px; border-radius: 5px; background: #fffefa; }
.brand-copy { border-left: 1px solid var(--line); padding-left: 16px; }
.brand-copy strong { font-size: 1.2rem; font-weight: 600; }
.primary-nav { display: flex; align-items: center; justify-content: center; gap: 4px; margin-left: auto; }
.primary-nav .nav-link { font-size: .9rem; padding: 11px 14px; gap: 8px; }
.nav-link { color: var(--text); border-radius: 28px; font-weight: 500; }
.nav-link:hover { background: var(--surface-soft); transform: translateY(-2px); }
.nav-link.is-active { background: var(--teal-soft); color: var(--teal); box-shadow: none; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.theme-toggle, html[data-theme="dark"] .theme-toggle { padding: 5px; background: var(--surface); box-shadow: none; min-width: 44px; min-height: 44px; justify-content: center; }
.theme-toggle__icons { background: none; }
.mobile-nav-toggle, .mobile-nav-close { display: inline-flex; background: var(--surface-soft); min-height: 44px; border-color: var(--line); color: var(--text); border-radius: 24px; }
.mobile-nav-toggle { gap: 8px; padding: 10px 14px; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: min(88vw,360px); z-index: 80; overflow-y: auto; transform: translateX(calc(-100% - 18px)); transition: transform 300ms cubic-bezier(.2,.7,.2,1); padding: 22px; gap: 22px; box-shadow: 20px 0 70px #04191c22; }
.sidebar-mobile-head { display: flex; justify-content: flex-end; }
.sidebar .brand { margin-bottom: 8px; }
.sidebar .nav { display: grid; grid-template-columns: 1fr; gap: 7px; }
.sidebar .nav-label { font-weight: 500; }
.sidebar-user { background: var(--surface-soft); border-color: var(--line); }
.sidebar-footer { padding-top: 20px; }
.mobile-nav-backdrop { display: block; background: #061b2380; backdrop-filter: blur(4px); }
body.sidebar-open { overflow: hidden; }
body.sidebar-open .sidebar { transform: translateX(0); }
body.sidebar-open .mobile-nav-backdrop { opacity: 1; pointer-events: auto; }
.content { max-width: 1280px; margin: auto; padding: 18px 30px 30px; gap: 24px; align-content: start; }
.topbar { display: flex; align-items: center; gap: 20px; margin: 0 0 4px; }
.topbar h1 { margin: 6px 0 0; font-size: clamp(1.5rem,2.5vw,2rem); line-height: 1.2; letter-spacing: -.025em; }
.eyebrow { font-size: .72rem; letter-spacing: .09em; font-weight: 600; }
.dashboard-year { flex-wrap: nowrap; align-items: center; gap: 12px; color: var(--muted); }
.dashboard-year .select { width: auto; min-width: 104px; }
.hero-card { border-top-width: 1px; }
.dashboard-hero, html[data-theme="dark"] .dashboard-hero { position: relative; isolation: isolate; overflow: hidden; padding: 34px; border: 0; background: linear-gradient(120deg,#12373f,#16545a); color: #fffefa; }
.dashboard-hero:after { content: ""; position: absolute; z-index: -1; right: -45px; top: -125px; width: 410px; height: 410px; border: 1px solid #a9d8d126; border-radius: 50%; box-shadow: 0 0 0 45px #a9d8d109,0 0 0 90px #a9d8d106; pointer-events: none; }
.dashboard-hero .eyebrow { color: #bcdbd7; }
.dashboard-hero h2 { margin: 16px 0; font-size: clamp(1.9rem,3.6vw,3rem); font-weight: 600; line-height: 1.12; letter-spacing: -.03em; }
.dashboard-hero h2 span { color: #ffc0a6; }
.dashboard-intro { max-width: 570px; color: #d0e3e3; margin: 0 0 25px; }
.dashboard-metrics { gap: 24px; }
.dashboard-metrics .metric-card:nth-child(n) { background: var(--surface); border: 1px solid var(--line); padding: 26px; gap: 22px; overflow: visible; }
.metric-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); }
.metric-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: var(--teal-soft); color: var(--teal); flex-shrink: 0; }
.dashboard-metrics strong { font-size: clamp(2rem,3.5vw,3rem); font-weight: 600; font-variant-numeric: tabular-nums; margin: 6px 0 0; line-height: 1.25; overflow-wrap: anywhere; }
.metric-unit { font-family: Inter,sans-serif; font-size: 1rem; font-weight: 400; letter-spacing: 0; }
.dashboard-metrics small { font-size: .9rem; }
.metric-link { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; justify-self: start; font-weight: 500; }
.metric-link span { transition: transform var(--motion-duration); }
.metric-link:hover span { transform: translateX(5px); }
.panel, .info-card { border-top-width: 1px; }
.grid-two > .panel:nth-child(n), .card-grid > .info-card:nth-child(n) { border-top-color: var(--line); }
.button { min-height: 46px; border-radius: 28px; padding: 12px 20px; font-weight: 600; white-space: normal; text-align: center; transition: transform var(--motion-duration), box-shadow var(--motion-duration), background-color var(--motion-duration); }
.button-primary, .button-primary:hover { color: #fff; background: linear-gradient(110deg,#b83335,#b42b73 60%,#176b78); box-shadow: 0 7px 18px #101c2420; }
.button-primary:hover { transform: translateY(-3px); box-shadow: 0 12px 24px #101c2435; }
.button:active { transform: scale(.98); }
.button-secondary { background: var(--surface-soft); color: var(--text); border: 1px solid var(--line); }
.button-secondary:hover { background: var(--surface-muted); color: var(--text); }
.input, .select, .textarea { min-width: 0; transition: border-color var(--motion-duration), box-shadow var(--motion-duration); }
.field label, .field span { font-weight: 500; }
.input:focus, .select:focus, .textarea:focus { outline: 2px solid var(--teal); outline-offset: 2px; }
.data-table tbody tr { transition: background-color 180ms; }
.data-table tbody tr:hover { background: var(--surface-soft); }
.trip-editor { gap: 24px; }
.trip-address-row { display: grid; grid-template-columns: minmax(0,1fr) 46px minmax(0,1fr); gap: 12px; align-items: end; }
.trip-address-row .address-swap { padding: 0; width: 46px; height: 46px; margin-bottom: 16px; border-radius: 50%; }
.address-swap span { font-size: 1.4rem; transition: transform var(--motion-duration); }
.address-swap:hover span { transform: rotate(180deg); }
.trip-address-row .input { min-height: 49px; }
form[aria-busy="true"] button[type="submit"]::before, #compute-routes-btn:disabled::before { content: ""; width: 14px; height: 14px; flex-shrink: 0; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: road-spin 800ms linear infinite; }
@keyframes road-spin { to { transform: rotate(360deg); } }
.trip-return-card { background: var(--surface-soft); border-color: var(--line); }
.trip-estimate-panel { background: var(--surface-soft); }
.trip-save-actions .button-primary { flex-grow: 1; }
.route-option { transition: border-color var(--motion-duration), background-color var(--motion-duration), box-shadow var(--motion-duration); }
.route-option:hover { border-color: var(--teal); }
.route-map, .leaflet-container { background: var(--surface-soft); }
.route-map__placeholder { background: radial-gradient(circle at 85% 15%,var(--coral-soft),transparent 55%),var(--surface-soft); color: var(--muted); }
.action-card--primary { background: #b83742; color: #fff; }
.app-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; border-top: 1px solid var(--line); color: var(--muted); padding-top: 20px; margin-top: 6px; font-size: .83rem; }
.login-body { display: block; padding: 0; background: radial-gradient(ellipse at 15% 15%,#f1574712,transparent 55%),var(--bg); }
.login-shell { max-width: none; min-height: calc(100vh - 5px); display: grid; place-items: center; padding: 32px 20px; }
.login-card { width: min(100%,460px); padding: 36px; }
.login-brand { margin-bottom: 30px; }
.login-card h1 { font-weight: 600; letter-spacing: -.025em; }
.login-card .button { width: 100%; }
@keyframes road-enter { from { opacity: .25; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: no-preference) {
    .content > .hero-card, .content > .panel, .content > .trip-editor, .content > .grid-two, .content > .card-grid, .login-card { animation: road-enter 320ms cubic-bezier(.2,.7,.2,1) both; }
    .dashboard-metrics .metric-card { animation: road-enter 360ms cubic-bezier(.2,.7,.2,1) both; }
    .dashboard-metrics .metric-card:nth-child(2) { animation-delay: 65ms; }
    .message, .route-option { animation: road-enter 220ms ease both; }
    .dashboard-metrics .metric-card { transition: box-shadow var(--motion-duration), border-color var(--motion-duration); }
    .dashboard-metrics .metric-card:hover { box-shadow: 0 14px 32px #04191c16; border-color: var(--input-border); }
}
@media (max-width: 1100px) {
    .app-header { gap: 12px; padding: 13px 18px; }
    .primary-nav .nav-link { padding: 11px 10px; font-size: .82rem; }
    .primary-nav .ui-icon { display: none; }
    .brand img { width: 122px; }
    .brand, .header-actions { gap: 8px; }
    .brand-copy { padding-left: 10px; }
}
@media (max-width: 900px) {
    .app-header { flex-wrap: wrap; border-radius: 26px; }
    .header-actions { margin-left: auto; }
    .primary-nav { order: 3; width: 100%; margin: 0; justify-content: stretch; border-top: 1px solid var(--line); padding-top: 10px; }
    .primary-nav .nav-link { flex: 1; justify-content: center; }
    .primary-nav .ui-icon { display: block; }
    .topbar-main { width: auto; }
    .content { padding: 12px 24px 24px; }
}
@media (max-width: 640px) {
    .app-shell { padding-top: 14px; }
    .app-header { width: calc(100% - 28px); margin-bottom: 14px; padding: 13px; gap: 12px; }
    .brand img { width: 112px; }
    .brand-copy strong { font-size: 1rem; }
    .primary-nav .nav-link { font-size: .75rem; padding: 10px 4px; }
    .primary-nav .ui-icon { display: none; }
    .header-actions { gap: 4px; }
    .mobile-nav-toggle { padding: 10px; }
    .mobile-nav-toggle span { display: none; }
    .content { padding: 10px 14px 24px; gap: 18px; }
    .topbar { flex-wrap: wrap; gap: 14px; }
    .dashboard-year .select { padding: 9px 12px; }
    .dashboard-hero { padding: 26px 22px; }
    .dashboard-metrics { grid-template-columns: minmax(0,1fr); gap: 18px; }
    .dashboard-metrics .metric-card:nth-child(n) { padding: 22px; gap: 16px; }
    .panel { padding: 20px; }
    .input, .select, .textarea { font-size: 16px; }
    .trip-save-actions { gap: 18px; }
    .trip-address-row { grid-template-columns: minmax(0,1fr); gap: 0; }
    .trip-address-row .address-swap { justify-self: center; margin: 0 0 14px; }
    .login-card { padding: 26px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
