/* =========================================================================
   Crew Rostering — design tokens & components
   Signature element: the "flight strip", modelled on physical paper duty
   strips used in ops rooms before EFBs — a left colour tab + monospace
   time block. Used everywhere a duty appears.
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
    --ink: #17211f;
    --ink-soft: #4d5b58;
    --paper: #f6f7f5;
    --surface: #ffffff;
    --line: #dde3e1;
    --line-soft: #eef1f0;

    --brand: #0b5b62;
    --brand-dark: #073e43;
    --brand-tint: #e4f0ef;

    --amber: #b4720a;
    --amber-tint: #fbf1df;
    --red: #a6291f;
    --red-tint: #fbeae8;
    --green: #1e7a46;
    --green-tint: #e7f5ec;

    --radius: 10px;
    --radius-lg: 14px;
    --shadow-sm: 0 1px 2px rgba(23, 33, 31, 0.06);
    --shadow-md: 0 4px 16px rgba(23, 33, 31, 0.08);

    --font-display: 'Space Grotesk', 'Inter', sans-serif;
    --font-body: 'Inter', -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, monospace;

    --sidebar-w: 232px;
    --bottombar-h: 60px;
}

@media (prefers-reduced-motion: reduce) {
    * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

* { box-sizing: border-box; }

body {
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .h1, .h2, .h3, .h4, .navbar-brand-app {
    font-family: var(--font-display);
    letter-spacing: -0.01em;
    color: var(--ink);
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }

.mono, .fdp-time, td.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ---------- Login ---------- */
.login-body {
    background:
        radial-gradient(circle at 15% 20%, rgba(255,255,255,0.06), transparent 40%),
        linear-gradient(160deg, var(--brand-dark), var(--brand));
    font-family: var(--font-body);
}
.login-card { border: none; border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }
.brand-mark {
    width: 52px; height: 52px; border-radius: 12px;
    background: var(--brand); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-display); font-weight: 700; font-size: 1.1rem;
}

.btn-brand {
    background: var(--brand); border-color: var(--brand); color: #fff;
    font-weight: 600; border-radius: 8px;
}
.btn-brand:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }

/* ---------- App shell: sidebar (desktop) + bottom tabs (mobile) ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    background: var(--brand-dark);
    color: #dff0ee;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}
.sidebar-brand {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.05rem;
    color: #fff;
    padding: 1.25rem 1.25rem 1rem;
    display: flex; align-items: center; gap: .5rem;
}
.sidebar-nav { flex: 1; padding: .5rem .75rem; overflow-y: auto; }
.sidebar-nav a {
    display: flex; align-items: center; gap: .6rem;
    color: #bfe0dd;
    padding: .55rem .75rem;
    border-radius: 8px;
    font-size: .92rem;
    font-weight: 500;
    margin-bottom: 2px;
}
.sidebar-nav a:hover { background: rgba(255,255,255,0.06); color: #fff; }
.sidebar-nav a.active { background: rgba(255,255,255,0.12); color: #fff; }
.sidebar-nav .nav-divider { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: #7fa8a4; padding: 1rem .75rem .35rem; }
.sidebar-foot { padding: .9rem 1.1rem 1.1rem; border-top: 1px solid rgba(255,255,255,0.08); }

.topbar {
    display: none;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: .7rem 1rem;
    align-items: center;
    justify-content: space-between;
    position: sticky; top: 0; z-index: 20;
}

.bottom-tabs {
    display: none;
    position: fixed; bottom: 0; left: 0; right: 0;
    background: var(--surface);
    border-top: 1px solid var(--line);
    z-index: 30;
    padding-bottom: env(safe-area-inset-bottom);
}
.bottom-tabs .tabs-row { display: flex; justify-content: space-around; }
.bottom-tabs a {
    flex: 1; text-align: center; padding: .5rem .2rem .4rem;
    color: var(--ink-soft); font-size: .68rem; font-weight: 600;
}
.bottom-tabs a.active { color: var(--brand); }
.bottom-tabs .tab-icon { display: block; font-size: 1.15rem; line-height: 1; margin-bottom: 2px; }

.main-content { flex: 1; min-width: 0; }
.content-inner { padding: 1.5rem; max-width: 1180px; margin: 0 auto; }

@media (max-width: 900px) {
    .sidebar { display: none; }
    .topbar { display: flex; }
    .bottom-tabs { display: block; }
    .content-inner { padding: 1rem 1rem calc(var(--bottombar-h) + 1.5rem); }
}

.menu-btn {
    background: none; border: none; color: var(--ink);
    padding: .3rem; border-radius: 8px; line-height: 0;
}
.menu-btn:hover { background: var(--brand-tint); }

.mobile-menu-nav { padding: .5rem .75rem 1rem; }
.mobile-menu-nav a {
    display: flex; align-items: center; gap: .7rem;
    color: var(--ink); padding: .65rem .75rem;
    border-radius: 8px; font-weight: 500; font-size: .95rem;
}
.mobile-menu-nav a:hover, .mobile-menu-nav a.active { background: var(--brand-tint); color: var(--brand-dark); }
.mobile-menu-nav .nav-divider {
    font-size: .7rem; text-transform: uppercase; letter-spacing: .06em;
    color: var(--ink-soft); padding: 1rem .75rem .35rem;
}

/* ---------- Notification badge ---------- */
.badge-brand { background: var(--brand); }
.notif-dot {
    display: inline-block; width: 8px; height: 8px; border-radius: 50%;
    background: var(--amber); margin-left: 4px; vertical-align: middle;
}

/* ---------- Cards, tiles ---------- */
.card { border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: none; }
.card-header {
    background: var(--surface); border-bottom: 1px solid var(--line-soft);
    font-family: var(--font-display); font-weight: 600; font-size: .95rem;
}

.stat-tile {
    border-radius: var(--radius-lg); padding: 1rem 1.25rem; background: var(--surface); border: 1px solid var(--line);
}
.stat-tile .value { font-family: var(--font-mono); font-size: 1.7rem; font-weight: 600; color: var(--brand-dark); }
.stat-tile .label { font-size: .74rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .05em; margin-top: 2px; }

/* ---------- Status chips ---------- */
.chip {
    display: inline-flex; align-items: center; gap: .3rem;
    padding: .2rem .55rem; border-radius: 999px;
    font-size: .72rem; font-weight: 600; letter-spacing: .02em;
    border: 1px solid transparent;
}
.chip-ok { background: var(--green-tint); color: var(--green); }
.chip-warn { background: var(--amber-tint); color: var(--amber); }
.chip-fail { background: var(--red-tint); color: var(--red); }
.chip-neutral { background: var(--brand-tint); color: var(--brand-dark); }

.fdp-ok { color: var(--green); }
.fdp-warn { color: var(--amber); }
.fdp-fail { color: var(--red); }
.badge-role { background: var(--brand-tint); color: var(--brand-dark); font-weight: 600; }

/* ---------- Flight strip: the signature element ---------- */
.flight-strip {
    display: flex;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: .6rem;
    transition: box-shadow .15s ease, transform .15s ease;
}
.flight-strip:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.strip-tab { width: 6px; flex-shrink: 0; background: var(--brand); }
.flight-strip.tab-warn .strip-tab { background: var(--amber); }
.flight-strip.tab-fail .strip-tab { background: var(--red); }
.flight-strip.tab-ok .strip-tab { background: var(--green); }

.strip-body {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: .5rem 1rem;
    padding: .7rem .9rem;
    width: 100%;
}
.strip-main { display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; }
.strip-flightno { font-family: var(--font-mono); font-weight: 600; font-size: .95rem; }
.strip-route { color: var(--ink-soft); font-size: .88rem; }
.strip-times { font-family: var(--font-mono); font-size: .82rem; color: var(--ink-soft); white-space: nowrap; }
.strip-meta { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }

/* ---------- Tables ---------- */
.table { font-size: .9rem; }
.table thead th {
    font-family: var(--font-display); font-weight: 600; font-size: .74rem;
    text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft);
    border-bottom: 1px solid var(--line); background: transparent;
}
.table td { vertical-align: middle; border-color: var(--line-soft); }

.crew-avatar {
    width: 38px; height: 38px; border-radius: 50%;
    background: var(--brand-tint); color: var(--brand-dark);
    display: inline-flex; align-items: center; justify-content: center;
    font-family: var(--font-display); font-weight: 600; font-size: .85rem;
}

.ack-banner {
    background: var(--amber-tint); border: 1px solid #f0dcae; border-radius: var(--radius);
    padding: .9rem 1.1rem; margin-bottom: 1.25rem;
    display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem;
}

.empty-state {
    text-align: center; padding: 2.5rem 1rem; color: var(--ink-soft);
}
.empty-state .empty-icon { font-size: 1.8rem; margin-bottom: .5rem; }

@media (max-width: 576px) {
    .stat-tile .value { font-size: 1.35rem; }
    .strip-body { flex-direction: column; align-items: flex-start; }
}
