/* ===========================================================================
   ALESTA FLEET PORTAL — design system
   ---------------------------------------------------------------------------
   Source of truth: alesta-portal-mockup.html (19.09.2026 tasarım önerisi).
   Every class is prefixed .ap-* and every element rule is scoped inside an
   .ap-* container, so this file can live next to Bootstrap 5.3 while the
   remaining pages are still being converted. Nothing here styles a bare
   <table>/<input>/<h1> globally.

   HOW TO USE (page authors):
     page order on EVERY screen is  heading → description → primary action →
     content.  That is exactly one .ap-heading block, then panels.

       <div class="ap-heading">
         <div>
           <h1>Ships</h1>
           <p>A single workspace for each vessel.</p>
         </div>
         <a class="ap-btn ap-primary" asp-page="/Admin/NewShip">Register ship</a>
       </div>

   Sections
     1. Tokens                 6. Tables
     2. Base / shell           7. Status chips + notices
     3. Sidebar + topbar       8. Forms
     4. Page heading + buttons 9. Detail / steps / empty / footer
     5. Metrics + panels      10. Responsive (760px, 440px)
   =========================================================================== */

/* ── 1. TOKENS ───────────────────────────────────────────────────────────── */
:root {
    /* Surfaces & ink */
    --ap-bg: #f3f6fa;
    --ap-panel: #ffffff;
    --ap-text: #162b42;
    --ap-muted: #61748a;
    --ap-line: #dce5ed;

    /* Brand accent (single blue/turquoise — review note "tek mavi vurgu") */
    --ap-accent: #087eab;
    --ap-accent-ink: #087eab;   /* accent used as text colour */
    --ap-soft: #e9f5fa;         /* accent wash (detail panel, active tab)   */

    /* Semantic status. Every colour ALWAYS ships with a text label. */
    --ap-good: #17694b;
    --ap-good-bg: #eaf7ef;
    --ap-warn: #85590a;
    --ap-warn-bg: #fff6df;
    --ap-bad: #8d1f26;
    --ap-bad-bg: #fdecec;

    /* Navy sidebar — same in light and dark, it is the brand base */
    --ap-nav-bg: #0c2941;
    --ap-nav-ink: #c7d8e7;
    --ap-nav-ink-strong: #ffffff;
    --ap-nav-label: #89a5bb;
    --ap-nav-hover: #153a55;
    --ap-nav-active: #174765;
    --ap-nav-line: #29475d;
    --ap-nav-dot: #79cbe6;

    /* Spacing scale */
    --ap-s1: 4px;
    --ap-s2: 7px;
    --ap-s3: 10px;
    --ap-s4: 14px;
    --ap-s5: 18px;
    --ap-s6: 20px;
    --ap-s7: 26px;
    --ap-s8: 34px;

    /* Radius */
    --ap-r-xs: 5px;
    --ap-r-sm: 7px;
    --ap-r: 9px;
    --ap-r-lg: 14px;

    /* Typography */
    --ap-font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    --ap-mono: Consolas, "SFMono-Regular", "Liberation Mono", monospace;
    --ap-fs-body: 14px;
    --ap-fs-sm: 12px;
    --ap-fs-xs: 11px;
    --ap-fs-micro: 10px;
    --ap-fs-h1: 26px;
    --ap-fs-h2: 15px;
    --ap-fs-metric: 28px;

    /* Shell */
    --ap-sidebar-w: 216px;
    --ap-focus: 0 0 0 2px var(--ap-panel), 0 0 0 4px var(--ap-accent);
}

/* Dark palette is READY but OPT-IN: add data-ap-theme="dark" to <html>.
   It stays off until every page has left Bootstrap's light-only markup,
   otherwise half-converted screens would mix white cards into a dark shell. */
:root[data-ap-theme="dark"] {
    --ap-bg: #101b29;
    --ap-panel: #172637;
    --ap-text: #e7eef6;
    --ap-muted: #a6b7c9;
    --ap-line: #304357;
    --ap-accent: #0b93c6;
    --ap-accent-ink: #7bd5f3;
    --ap-soft: #1a3d50;
    --ap-good: #8ed8b5;
    --ap-good-bg: #193c32;
    --ap-warn: #e8c57f;
    --ap-warn-bg: #40351f;
    --ap-bad: #f0a9a9;
    --ap-bad-bg: #3d2226;
    --ap-nav-bg: #0b2032;
    color-scheme: dark;
}

/* ── 2. BASE / SHELL ─────────────────────────────────────────────────────── */
body.ap-body {
    margin: 0;
    background: var(--ap-bg);
    color: var(--ap-text);
    font: var(--ap-fs-body)/1.5 var(--ap-font);
    -webkit-font-smoothing: antialiased;
}

body.ap-body *,
body.ap-body *::before,
body.ap-body *::after { box-sizing: border-box; }

/* Keyboard focus is always visible — never removed. */
body.ap-body :focus-visible {
    outline: 2px solid var(--ap-accent);
    outline-offset: 2px;
    border-radius: 3px;
}

.ap-sr {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.ap-muted { color: var(--ap-muted); }
.ap-mono { font-family: var(--ap-mono); }
.ap-nowrap { white-space: nowrap; }
.ap-strong { font-weight: 600; }
.ap-right { text-align: right; }

/* Action cluster: buttons/forms sitting side by side in a heading, a panel
   head, a table cell or an .ap-item row. */
.ap-actions { display: flex; align-items: center; gap: var(--ap-s2); flex-wrap: wrap; }
.ap-actions form { margin: 0; }

/* App shell: fixed nav column + fluid content column.
   minmax(0,1fr) is what keeps wide tables from pushing the PAGE sideways.
   align-content:start stops the grid from splitting spare height between the
   rows — without it a short page leaves a band of background under the nav. */
.ap-shell {
    display: grid;
    grid-template-columns: var(--ap-sidebar-w) minmax(0, 1fr);
    align-content: start;
    min-height: 100vh;
}

.ap-col {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.ap-main {
    padding: var(--ap-s7);
    min-width: 0;
    flex: 1;
}

/* ── 3. SIDEBAR + TOPBAR ─────────────────────────────────────────────────── */
.ap-sidebar {
    background: var(--ap-nav-bg);
    color: #d7e5f0;
    padding: 24px 14px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    /* Full-height, self-scrolling and pinned while the content column scrolls. */
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.ap-brandrow { display: flex; align-items: center; justify-content: space-between; gap: var(--ap-s3); }

.ap-brand {
    padding: 0 12px;
    font-size: 25px;
    font-weight: 600;
    letter-spacing: -1px;
    line-height: 1.1;
    color: #fff;
    text-decoration: none;
    display: block;
}
.ap-brand span { color: var(--ap-nav-dot); }
.ap-brand small {
    display: block;
    font-size: var(--ap-fs-micro);
    letter-spacing: 2px;
    color: #8ecde6;
    font-weight: 500;
}

/* Narrow-screen menu button; hidden on wide screens. */
.ap-navtoggle {
    display: none;
    align-items: center;
    gap: var(--ap-s2);
    border: 1px solid var(--ap-nav-line);
    background: transparent;
    color: #d7e5f0;
    border-radius: var(--ap-r-sm);
    padding: 8px 11px;
    font: 500 var(--ap-fs-sm)/1 var(--ap-font);
    cursor: pointer;
}
.ap-navtoggle:hover { background: var(--ap-nav-hover); }

.ap-navpanel {
    display: flex;
    flex-direction: column;
    gap: 24px;
    flex: 1;
    min-height: 0;
}

.ap-nav { display: grid; gap: 5px; align-content: start; }

.ap-navitem {
    display: flex;
    align-items: center;
    gap: var(--ap-s3);
    border: 0;
    background: transparent;
    color: var(--ap-nav-ink);
    text-align: left;
    text-decoration: none;
    border-radius: var(--ap-r-sm);
    padding: 11px 12px;
    font-size: var(--ap-fs-sm);
    line-height: 1.2;
}
.ap-navitem:hover { background: var(--ap-nav-hover); color: var(--ap-nav-ink-strong); }
.ap-navitem[aria-current="page"] { background: var(--ap-nav-active); color: var(--ap-nav-ink-strong); font-weight: 600; }
.ap-navitem .ap-count {
    margin-left: auto;
    background: var(--ap-warn-bg);
    color: var(--ap-warn);
    border-radius: 999px;
    font-size: var(--ap-fs-micro);
    font-weight: 600;
    padding: 2px 7px;
}

.ap-navlabel {
    padding: 6px 12px;
    font-size: var(--ap-fs-micro);
    letter-spacing: 1.4px;
    color: var(--ap-nav-label);
}

.ap-account {
    margin-top: auto;
    border-top: 1px solid var(--ap-nav-line);
    padding: var(--ap-s5) var(--ap-s3) 0;
    font-size: var(--ap-fs-sm);
    color: #e2edf5;
}
.ap-account span { display: block; color: #8eabc0; }
.ap-account a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: var(--ap-s3);
    color: #9fd6ee;
    text-decoration: none;
}
.ap-account a:hover { color: #fff; text-decoration: underline; }

/* Topbar: breadcrumb on the left, explicit UTC stamp on the right. */
.ap-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--ap-s3);
    padding: 15px var(--ap-s7);
    background: var(--ap-panel);
    border-bottom: 1px solid var(--ap-line);
    font-size: var(--ap-fs-sm);
    color: var(--ap-muted);
    flex-wrap: wrap;
}
.ap-topbar strong { color: var(--ap-text); font-weight: 500; }
.ap-topbar a { color: inherit; text-decoration: none; }
.ap-topbar a:hover { text-decoration: underline; }

/* ── 4. PAGE HEADING + BUTTONS + LINKS ───────────────────────────────────── */
.ap-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--ap-s4);
    flex-wrap: wrap;
    margin-bottom: var(--ap-s7);
}
.ap-heading h1 {
    font-size: var(--ap-fs-h1);
    line-height: 1.2;
    letter-spacing: -.7px;
    margin: 0 0 var(--ap-s2);
    font-weight: 600;
    color: var(--ap-text);
}
.ap-heading p { margin: 0; color: var(--ap-muted); font-size: var(--ap-fs-sm); }
.ap-heading .ap-actions { display: flex; gap: var(--ap-s3); flex-wrap: wrap; }

.ap-btn {
    border: 1px solid var(--ap-line);
    background: var(--ap-panel);
    color: var(--ap-text);
    padding: 9px 13px;
    border-radius: var(--ap-r-sm);
    display: inline-flex;
    align-items: center;
    gap: var(--ap-s2);
    white-space: nowrap;
    font: 500 var(--ap-fs-sm)/1.3 var(--ap-font);
    text-decoration: none;
    cursor: pointer;
}
.ap-btn:hover { border-color: var(--ap-accent); color: var(--ap-accent-ink); }
.ap-btn[disabled], .ap-btn.ap-disabled { opacity: .55; cursor: not-allowed; }

.ap-primary { background: var(--ap-accent); border-color: var(--ap-accent); color: #fff; }
.ap-primary:hover { background: #066a91; border-color: #066a91; color: #fff; }
:root[data-ap-theme="dark"] .ap-primary:hover { background: #0ba5de; border-color: #0ba5de; }

.ap-btn.ap-danger { color: var(--ap-bad); border-color: var(--ap-bad-bg); background: var(--ap-bad-bg); }
.ap-btn.ap-danger:hover { border-color: var(--ap-bad); color: var(--ap-bad); }
.ap-btn.ap-quiet { background: transparent; }
.ap-btn.ap-sm { padding: 6px 10px; font-size: var(--ap-fs-xs); }

.ap-link {
    border: 0;
    background: transparent;
    color: var(--ap-accent-ink);
    padding: 4px 0;
    font: 600 var(--ap-fs-sm)/1.4 var(--ap-font);
    text-decoration: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.ap-link:hover { text-decoration: underline; color: var(--ap-accent-ink); }

/* One icon family, vendored as an inline sprite (_Icons.cshtml) — no CDN.
   <svg class="ap-ico" aria-hidden="true"><use href="#i-ship"></use></svg> */
.ap-ico {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    vertical-align: -.18em;
}
.ap-ico.ap-ico-lg { width: 22px; height: 22px; }

/* ── 5. METRICS + PANELS ─────────────────────────────────────────────────── */
.ap-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: var(--ap-s6);
}
.ap-metric {
    padding: var(--ap-s5);
    background: var(--ap-panel);
    border: 1px solid var(--ap-line);
    border-radius: var(--ap-r);
    display: block;
    text-decoration: none;
    color: inherit;
}
a.ap-metric:hover { border-color: var(--ap-accent); }
.ap-metric span { display: block; font-size: var(--ap-fs-xs); color: var(--ap-muted); }
.ap-metric b { display: block; font-size: var(--ap-fs-metric); font-weight: 500; margin: var(--ap-s2) 0; line-height: 1.1; }
.ap-metric.ap-attention b { color: var(--ap-warn); }
.ap-metric.ap-attention { border-color: var(--ap-warn); }

.ap-panel {
    border: 1px solid var(--ap-line);
    border-radius: var(--ap-r);
    background: var(--ap-panel);
    margin-bottom: var(--ap-s5);
    overflow: hidden;
}
/* Subdued panel for secondary / administrative content. */
.ap-panel.ap-subdued { background: transparent; }
.ap-panel.ap-subdued > .ap-panelhead { background: transparent; }

.ap-panelhead {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--ap-s3);
    flex-wrap: wrap;
    padding: 17px 19px;
    border-bottom: 1px solid var(--ap-line);
}
.ap-panelhead h2,
.ap-panelhead .ap-h2 { font-size: var(--ap-fs-h2); margin: 0; font-weight: 600; color: var(--ap-text); }
.ap-panelhead p { margin: 2px 0 0; color: var(--ap-muted); font-size: var(--ap-fs-sm); }
.ap-panelhead .ap-actions { display: flex; gap: var(--ap-s2); flex-wrap: wrap; align-items: center; }

.ap-pad { padding: var(--ap-s6); }
.ap-pad > p { margin: 0 0 var(--ap-s3); color: var(--ap-muted); font-size: var(--ap-fs-sm); }
.ap-pad > p:last-child { margin-bottom: 0; }

/* Two equal columns that stack under 760px. */
.ap-split { display: grid; grid-template-columns: 1fr 1fr; gap: var(--ap-s5); }
.ap-split > * { min-width: 0; }

/* Key/value rows inside a panel body. */
.ap-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--ap-s4);
    padding: 13px 0;
    border-bottom: 1px solid var(--ap-line);
}
.ap-item:first-child { padding-top: 0; }
.ap-item:last-child { border-bottom: 0; padding-bottom: 0; }
.ap-item small { display: block; color: var(--ap-muted); font-size: var(--ap-fs-xs); }
.ap-item > div:first-child { min-width: 0; }
.ap-item .ap-itemvalue { font-size: var(--ap-fs-h2); font-weight: 500; white-space: nowrap; }

/* Application cards (Releases). */
.ap-apps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: var(--ap-s6); }
.ap-app { padding: var(--ap-s5); border: 1px solid var(--ap-line); border-radius: var(--ap-r); background: var(--ap-panel); }
.ap-app h2 { font-size: var(--ap-fs-h2); margin: 0; font-weight: 600; }
.ap-app p { margin: 0; color: var(--ap-muted); font-size: var(--ap-fs-sm); }
.ap-app b { display: block; font-size: 24px; font-weight: 500; margin: 12px 0; line-height: 1.1; }
.ap-app small { display: block; color: var(--ap-muted); font-size: var(--ap-fs-xs); margin-top: 8px; }

/* ── 6. TABLES ───────────────────────────────────────────────────────────── */
.ap-tablewrap { overflow-x: auto; }

.ap-table { width: 100%; border-collapse: collapse; font-size: var(--ap-fs-sm); }
.ap-table th {
    text-align: left;
    font-weight: 500;
    font-size: var(--ap-fs-micro);
    letter-spacing: .4px;
    text-transform: uppercase;
    color: var(--ap-muted);
    background: var(--ap-bg);
}
.ap-table td,
.ap-table th { padding: 14px 17px; border-bottom: 1px solid var(--ap-line); vertical-align: middle; }
.ap-table tbody tr:last-child td { border-bottom: 0; }
.ap-table td small { display: block; color: var(--ap-muted); font-size: var(--ap-fs-micro); margin-top: 3px; }
.ap-table tbody tr:hover td { background: color-mix(in srgb, var(--ap-bg) 55%, transparent); }
.ap-table .ap-right { text-align: right; }
.ap-table .ap-strong { font-weight: 600; }
/* Compact variant for long history tables. */
.ap-table.ap-compact td, .ap-table.ap-compact th { padding-top: 9px; padding-bottom: 9px; }

/* ── 7. STATUS CHIPS + NOTICES ───────────────────────────────────────────── */
/* A colour never stands alone — the chip always carries its own text label. */
.ap-status {
    display: inline-block;
    font-size: var(--ap-fs-xs);
    font-weight: 500;
    padding: 4px 8px;
    border-radius: var(--ap-r-xs);
    background: var(--ap-good-bg);
    color: var(--ap-good);
    white-space: nowrap;
}
.ap-status.ap-neutral { background: var(--ap-bg); color: var(--ap-muted); border: 1px solid var(--ap-line); }
.ap-status.ap-warn { background: var(--ap-warn-bg); color: var(--ap-warn); }
.ap-status.ap-bad { background: var(--ap-bad-bg); color: var(--ap-bad); }
.ap-status.ap-info { background: var(--ap-soft); color: var(--ap-accent-ink); }

.ap-notice {
    display: flex;
    align-items: center;
    gap: var(--ap-s3);
    background: var(--ap-good-bg);
    color: var(--ap-good);
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: var(--ap-s6);
    font-size: var(--ap-fs-sm);
}
.ap-notice.ap-warn { background: var(--ap-warn-bg); color: var(--ap-warn); }
.ap-notice.ap-bad { background: var(--ap-bad-bg); color: var(--ap-bad); }
.ap-notice.ap-info { background: var(--ap-soft); color: var(--ap-accent-ink); }

/* ── 8. FORMS + TOOLBARS + TABS ──────────────────────────────────────────── */
.ap-toolbar { display: flex; gap: var(--ap-s3); flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.ap-toolbar .ap-input { flex: 1; min-width: 160px; width: auto; }
.ap-toolbar select.ap-input { flex: 0 0 auto; width: auto; }

.ap-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: var(--ap-s5); }
.ap-tabs .ap-btn[aria-pressed="true"],
.ap-tabs .ap-btn.ap-current {
    background: var(--ap-soft);
    border-color: var(--ap-accent);
    color: var(--ap-accent-ink);
    font-weight: 600;
}

/* Two-column field grid; collapses to one column under 440px. */
.ap-form { display: grid; grid-template-columns: 1fr 1fr; gap: 17px; }
.ap-form.ap-one { grid-template-columns: 1fr; }
.ap-form .ap-wide { grid-column: 1 / -1; }

.ap-form label,
.ap-field label,
label.ap-field { display: block; font-size: var(--ap-fs-sm); color: var(--ap-text); font-weight: 500; }
.ap-form label small,
.ap-field small { display: block; font-weight: 400; color: var(--ap-muted); font-size: var(--ap-fs-xs); margin-top: 2px; }

.ap-input,
.ap-form input,
.ap-form select,
.ap-form textarea,
.ap-field input,
.ap-field select,
.ap-field textarea {
    min-width: 0;
    width: 100%;
    border: 1px solid var(--ap-line);
    border-radius: 6px;
    padding: 9px 12px;
    background: var(--ap-panel);
    color: var(--ap-text);
    font: var(--ap-fs-body)/1.4 var(--ap-font);
    margin-top: var(--ap-s2);
}
.ap-input[readonly], .ap-form input[readonly] { background: var(--ap-bg); color: var(--ap-muted); }
.ap-input:focus, .ap-form input:focus, .ap-form select:focus, .ap-form textarea:focus {
    border-color: var(--ap-accent);
}
.ap-form textarea, .ap-field textarea { min-height: 110px; resize: vertical; }

.ap-checkline { display: flex; align-items: center; gap: var(--ap-s2); font-size: var(--ap-fs-sm); }
.ap-checkline input { margin: 0; width: auto; accent-color: var(--ap-accent); }

/* ── 9. DETAIL / STEPS / EMPTY / FORM FOOTER / PAGE FOOTER ───────────────── */
.ap-detail {
    margin-top: var(--ap-s5);
    border-left: 3px solid var(--ap-accent);
    padding: var(--ap-s5);
    background: var(--ap-soft);
    border-radius: 6px;
}
.ap-detail h2 { font-size: var(--ap-fs-h2); margin: 0 0 12px; font-weight: 600; }
.ap-detail p { margin: 0 0 var(--ap-s3); font-size: var(--ap-fs-sm); }
.ap-detail p.ap-label { color: var(--ap-muted); margin-bottom: 2px; }

.ap-steps { display: flex; flex-wrap: wrap; gap: var(--ap-s3); margin-bottom: var(--ap-s6); list-style: none; padding: 0; }
.ap-steps span,
.ap-steps li {
    background: var(--ap-panel);
    border: 1px solid var(--ap-line);
    border-radius: var(--ap-r-sm);
    padding: 8px 13px;
    font-size: var(--ap-fs-sm);
    color: var(--ap-muted);
}
.ap-steps .ap-current { background: var(--ap-soft); color: var(--ap-accent-ink); border-color: var(--ap-accent); font-weight: 600; }
.ap-steps .ap-done { color: var(--ap-good); border-color: var(--ap-good-bg); background: var(--ap-good-bg); }

.ap-empty { text-align: center; padding: 60px 20px; }
.ap-empty .ap-ico { display: block; margin: 0 auto 16px; color: var(--ap-muted); width: 28px; height: 28px; }
.ap-empty h2 { font-size: var(--ap-fs-h2); margin: 0 0 6px; font-weight: 600; }
.ap-empty p { margin: 0; color: var(--ap-muted); font-size: var(--ap-fs-sm); }

/* Form footer: back/cancel on the left, the commit action on the right. */
.ap-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: var(--ap-s6);
    margin-top: var(--ap-s6);
    border-top: 1px solid var(--ap-line);
}
.ap-footer .ap-actions { display: flex; gap: var(--ap-s3); flex-wrap: wrap; }

/* Page footer (copyright strip at the bottom of the content column). */
.ap-pagefoot {
    padding: var(--ap-s4) var(--ap-s7) var(--ap-s7);
    color: var(--ap-muted);
    font-size: var(--ap-fs-xs);
    border-top: 1px solid var(--ap-line);
}
.ap-pagefoot a { color: var(--ap-accent-ink); }

/* ── AUTH / PUBLIC PAGES (centred card) ──────────────────────────────────── */
body.ap-authbody {
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    background: linear-gradient(160deg, #0a2540 0%, #103a5c 55%, #155e8a 100%);
    color: var(--ap-text);
    font: var(--ap-fs-body)/1.5 var(--ap-font);
}
body.ap-authbody.ap-bridge { background: linear-gradient(160deg, #061a2e 0%, #0a2540 55%, #0f3a5c 100%); }
body.ap-authbody *, body.ap-authbody *::before, body.ap-authbody *::after { box-sizing: border-box; }
body.ap-authbody :focus-visible { outline: 2px solid #6ec6ff; outline-offset: 2px; }

.ap-authcard {
    width: 100%;
    max-width: 420px;
    background: var(--ap-panel);
    border-radius: var(--ap-r-lg);
    box-shadow: 0 18px 50px rgba(2, 12, 27, .45);
    overflow: hidden;
}
.ap-authcard.ap-wide { max-width: 560px; }
.ap-authhead { background: var(--ap-nav-bg); color: #eaf3fb; padding: 24px 30px 20px; }
.ap-authhead img { display: block; height: 64px; width: auto; }
.ap-authhead .ap-sub { font-size: var(--ap-fs-sm); color: #9fb8cc; margin-top: 4px; letter-spacing: .04em; }
.ap-authhead .ap-tag {
    display: inline-block; margin-top: 8px; padding: 2px 10px;
    border: 1px solid #6ec6ff; border-radius: 999px;
    color: #6ec6ff; font-size: var(--ap-fs-micro); letter-spacing: .18em;
}
.ap-authbodyarea { padding: 26px 30px 28px; }
.ap-authbodyarea p { font-size: var(--ap-fs-sm); margin: 0 0 var(--ap-s4); }
.ap-authbodyarea .ap-field + .ap-field { margin-top: var(--ap-s5); }
.ap-authbodyarea .ap-btn { width: 100%; justify-content: center; padding: 11px 13px; font-size: var(--ap-fs-body); }
.ap-authsubmit { margin-top: 22px; }
.ap-steplist { margin: 0 0 var(--ap-s5); padding-left: 18px; color: var(--ap-muted); font-size: var(--ap-fs-sm); }
.ap-steplist li { margin-bottom: 4px; }
.ap-authfoot { text-align: center; font-size: var(--ap-fs-xs); color: #8aa2b5; padding: 0 30px 22px; }
.ap-authfoot a { color: var(--ap-accent-ink); }
.ap-authlink { display: block; text-align: center; margin-top: var(--ap-s5); font-size: var(--ap-fs-sm); color: var(--ap-muted); }

.ap-code {
    font-family: var(--ap-mono);
    font-size: 1.35rem;
    letter-spacing: .45em;
    text-align: center;
}
.ap-qr { text-align: center; margin: 6px 0 10px; }
.ap-qr img { width: 210px; height: 210px; border: 1px solid var(--ap-line); border-radius: var(--ap-r); }
.ap-manual {
    font-family: var(--ap-mono); font-size: .95rem; letter-spacing: .06em;
    background: var(--ap-bg); border: 1px dashed var(--ap-line); border-radius: 8px;
    padding: .55rem .8rem; text-align: center; margin-bottom: 1rem; word-break: break-all;
}

/* ── 10. RESPONSIVE ──────────────────────────────────────────────────────── */
/* ≤760px: the sidebar becomes a top strip; the nav wraps and can be collapsed
   with the Menu button. Without JavaScript the nav simply stays open — it
   wraps, so the page still never scrolls sideways. */
@media (max-width: 760px) {
    /* minmax(0,1fr), never plain 1fr: an auto minimum lets a wide table push the
       whole PAGE sideways instead of scrolling inside its own .ap-tablewrap. */
    /* auto + 1fr: the nav strip takes what it needs, the content column takes
       the rest so the page footer still sits at the bottom on short pages. */
    .ap-shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }

    .ap-sidebar {
        position: static;
        height: auto;
        padding: 14px 16px;
        gap: 14px;
    }
    .ap-brand { padding: 0; font-size: 21px; }
    .ap-brand small { display: inline; margin-left: 10px; font-size: 9px; }
    .ap-navtoggle { display: inline-flex; }

    .ap-navpanel { gap: 14px; }
    .ap-nav { display: flex; flex-wrap: wrap; gap: 4px; }
    .ap-navitem { padding: 8px 10px; font-size: var(--ap-fs-sm); }
    .ap-navlabel {
        width: 100%;
        padding: 6px 2px 0;
        font-size: 9px;
    }
    .ap-account { margin-top: 0; padding: 12px 2px 0; }

    /* Collapsed state, set by the layout's inline script on narrow screens. */
    html[data-ap-nav="closed"] .ap-navpanel { display: none; }

    .ap-main { padding: var(--ap-s6); }
    .ap-topbar { padding: 12px var(--ap-s6); }
    .ap-pagefoot { padding: var(--ap-s4) var(--ap-s6) var(--ap-s6); }

    .ap-metrics { grid-template-columns: 1fr 1fr; }
    .ap-apps { grid-template-columns: 1fr 1fr; }
    .ap-split { grid-template-columns: 1fr; }
    .ap-secondarycol { display: none; }
}

@media (max-width: 440px) {
    .ap-main { padding: 15px; }
    .ap-topbar { padding: 10px 15px; flex-wrap: wrap; }
    .ap-pagefoot { padding: 12px 15px 20px; }
    .ap-apps, .ap-form { grid-template-columns: 1fr; }
    .ap-table td, .ap-table th { padding: 10px; }
    .ap-metric { padding: 13px; }
    .ap-metrics { gap: 8px; }
    .ap-heading h1 { font-size: 22px; }
    .ap-item { flex-wrap: wrap; }
    .ap-authhead, .ap-authbodyarea, .ap-authfoot { padding-left: 20px; padding-right: 20px; }
}

@media print {
    .ap-sidebar, .ap-topbar, .ap-pagefoot, .ap-actions { display: none !important; }
    .ap-shell { grid-template-columns: 1fr; }
}

/* ══ ALESTA CENTRAL additions (05.10.2026) ═══════════════════════════════════════════════════
   Everything above is the shared Alesta web design system (copied from the Fleet Portal).
   Central-only pieces live below, prefixed .ac-  */
.ac-topright { display: inline-flex; align-items: center; gap: 14px; }
.ac-companypick { margin: 0; }
.ac-companypick .ap-input { padding: 4px 28px 4px 10px; font-size: var(--ap-fs-xs); width: auto; min-width: 180px; }

/* manifest grid: dense, spreadsheet-like, sticky header; the left edge of a row tells its state */
.ac-gridwrap { overflow: auto; max-height: calc(100vh - 300px); min-height: 280px; }
.ac-grid { width: 100%; border-collapse: collapse; font-size: var(--ap-fs-xs); }
.ac-grid th { position: sticky; top: 0; z-index: 1; background: var(--ap-bg); text-align: left; font-weight: 600; color: var(--ap-muted);
              padding: 8px 10px; border-bottom: 1px solid var(--ap-line); white-space: nowrap; font-size: var(--ap-fs-micro); letter-spacing: .04em; text-transform: uppercase; }
.ac-grid td { padding: 6px 10px; border-bottom: 1px solid var(--ap-line); vertical-align: top; white-space: nowrap; }
.ac-grid td.ac-wrap { white-space: normal; min-width: 230px; }
.ac-grid tbody tr:hover td { background: color-mix(in srgb, var(--ap-bg) 60%, transparent); }
.ac-grid tr.ac-newcabin td { border-top: 2px solid var(--ap-line); }
.ac-grid tr.ac-severe td:first-child { box-shadow: inset 3px 0 0 var(--ap-bad); }
.ac-grid tr.ac-warn td:first-child { box-shadow: inset 3px 0 0 var(--ap-warn); }
.ac-grid tr.ac-cancelled td { color: var(--ap-muted); }
.ac-grid tr.ac-cancelled td.ac-strike { text-decoration: line-through; }
.ac-num { font-variant-numeric: tabular-nums; }
.ac-miss { color: var(--ap-bad); font-weight: 600; }

.ac-tag { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: var(--ap-fs-micro); background: var(--ap-soft); color: var(--ap-accent-ink); margin: 0 3px 2px 0; white-space: nowrap; }
.ac-issue { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: var(--ap-fs-micro); background: var(--ap-warn-bg); color: var(--ap-warn); margin: 0 3px 2px 0; white-space: nowrap; }
.ac-issue.ac-sev { background: var(--ap-bad-bg); color: var(--ap-bad); }
.ac-ok { color: var(--ap-good); font-weight: 600; }
.ac-bad { color: var(--ap-bad); font-weight: 600; }

.ac-voyages { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.ac-voyage { display: block; padding: 16px 18px; border: 1px solid var(--ap-line); border-radius: var(--ap-r); background: var(--ap-panel); color: inherit; text-decoration: none; }
.ac-voyage:hover { border-color: var(--ap-accent); color: inherit; }
.ac-voyage h3 { margin: 0 0 2px; font-size: var(--ap-fs-h2); font-weight: 600; }
.ac-voyage .ac-sub { color: var(--ap-muted); font-size: var(--ap-fs-xs); margin-bottom: 12px; }
.ac-voyage dl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 10px; margin: 0; }
.ac-voyage dt { font-size: var(--ap-fs-micro); color: var(--ap-muted); text-transform: uppercase; letter-spacing: .04em; }
.ac-voyage dd { margin: 0; font-size: 18px; font-weight: 500; }
.ac-voyage.ac-past { opacity: .7; }
.ac-drop { border: 1.5px dashed var(--ap-line); border-radius: var(--ap-r); padding: 18px; background: var(--ap-bg); }
.ac-key { font-family: var(--ap-mono); font-size: var(--ap-fs-xs); word-break: break-all; }
.ac-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.ac-filters a { padding: 4px 11px; border: 1px solid var(--ap-line); border-radius: 999px; font-size: var(--ap-fs-xs); color: var(--ap-text); text-decoration: none; background: var(--ap-panel); }
.ac-filters a[aria-current="true"] { background: var(--ap-accent); border-color: var(--ap-accent); color: #fff; }

/* the sign-in page must not scroll: padding belongs inside the 100vh */
body.ap-authbody { box-sizing: border-box; }
