:root {
    --ink: #121b25;
    --ink-2: #1b2733;
    --muted: #66717d;
    --paper: #f3f5f7;
    --panel: #ffffff;
    --line: #dfe5eb;
    --red: #e1322b;
    --red-dark: #bb251f;
    --green: #137f73;
    --green-soft: #dff1ee;
    --yellow: #f5bc2e;
    --blue: #2d6cdf;
    --white: #ffffff;
    --shadow: 0 22px 70px rgba(18, 27, 37, 0.12);
    --soft-shadow: 0 16px 42px rgba(18, 27, 37, 0.08);
    font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
select {
    cursor: pointer;
}

.admin-login-page {
    min-height: 100svh;
    background:
        radial-gradient(circle at top left, rgba(225, 50, 43, 0.32), transparent 30%),
        linear-gradient(135deg, #0f1822, #1b2733 58%, #111922);
    color: var(--white);
}

.admin-login-shell {
    align-items: center;
    display: grid;
    gap: clamp(30px, 7vw, 90px);
    grid-template-columns: minmax(0, 1fr) minmax(320px, 440px);
    min-height: 100svh;
    padding: clamp(24px, 6vw, 70px);
}

.admin-login-copy span,
.admin-login-card p,
.section-kicker,
.admin-hero p,
.panel-heading p {
    color: var(--red);
    font-size: 0.78rem;
    font-weight: 950;
    letter-spacing: 0;
    margin: 0 0 10px;
    text-transform: uppercase;
}

.admin-login-copy h1,
.admin-hero h1 {
    font-size: clamp(3rem, 9vw, 6rem);
    line-height: 0.92;
    margin: 0 0 18px;
}

.admin-login-copy p {
    color: rgba(255, 255, 255, 0.72);
    line-height: 1.75;
    max-width: 620px;
}

.admin-login-copy a {
    color: var(--yellow);
    font-weight: 900;
}

.admin-login-card {
    background: var(--panel);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 12px;
    box-shadow: var(--shadow);
    color: var(--ink);
    display: grid;
    gap: 18px;
    padding: clamp(24px, 5vw, 38px);
}

.admin-login-card h2,
.panel-heading h2,
.admin-control-strip h2 {
    font-size: clamp(1.7rem, 4vw, 2.5rem);
    line-height: 1.05;
    margin: 0;
}

.admin-login-card label,
.shipment-update-card label {
    color: var(--ink);
    display: grid;
    font-size: 0.84rem;
    font-weight: 900;
    gap: 8px;
}

.admin-login-card input,
.shipment-update-card input,
.shipment-update-card select,
.shipment-update-card textarea,
.message-card select {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfaf7;
    color: var(--ink);
    min-height: 44px;
    outline: 0;
    padding: 10px 12px;
    transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
    width: 100%;
}

.admin-login-card input:focus,
.shipment-update-card input:focus,
.shipment-update-card select:focus,
.shipment-update-card textarea:focus,
.message-card select:focus {
    background: var(--white);
    border-color: rgba(225, 50, 43, 0.45);
    box-shadow: 0 0 0 4px rgba(225, 50, 43, 0.1);
}

.admin-login-card span {
    color: var(--red);
    font-weight: 800;
}

.admin-check {
    align-items: center;
    display: flex !important;
    gap: 10px !important;
}

.admin-check input {
    min-height: 0;
    width: auto;
}

.admin-login-card button,
.admin-actions button,
.shipment-update-card button,
.message-card button {
    border: 0;
    border-radius: 8px;
    background: var(--red);
    box-shadow: 0 14px 28px rgba(225, 50, 43, 0.22);
    color: var(--white);
    cursor: pointer;
    font-weight: 950;
    min-height: 44px;
    padding: 10px 16px;
    transition: background 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.admin-login-card button:hover,
.admin-actions button:hover,
.shipment-update-card button:hover,
.message-card button:hover {
    background: var(--red-dark);
    box-shadow: 0 18px 34px rgba(225, 50, 43, 0.28);
    transform: translateY(-1px);
}

.admin-dashboard-page {
    background:
        linear-gradient(180deg, #eef2f5, #f7f8fa 42%, #eef1f4),
        var(--paper);
    min-height: 100svh;
}

.admin-topbar {
    align-items: center;
    backdrop-filter: blur(18px);
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid rgba(18, 27, 37, 0.1);
    display: grid;
    gap: 18px;
    grid-template-columns: auto auto;
    justify-content: space-between;
    padding: 12px max(18px, calc((100vw - 1240px) / 2));
    position: sticky;
    top: 0;
    z-index: 20;
}

.admin-brand,
.admin-nav,
.admin-actions {
    display: flex;
}

.admin-brand {
    align-items: center;
    gap: 12px;
    min-width: 210px;
}

.admin-brand img {
    border-radius: 12px;
    box-shadow: 0 12px 26px rgba(18, 27, 37, 0.12);
    height: 46px;
    width: 46px;
}

.admin-brand strong,
.admin-brand small {
    display: block;
    line-height: 1.1;
}

.admin-brand strong {
    font-size: 1.02rem;
    font-weight: 950;
}

.admin-brand small {
    color: var(--muted);
    font-weight: 700;
}

.admin-nav {
    display: grid;
    gap: 8px;
}

.admin-nav a {
    align-items: center;
    border: 1px solid transparent;
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.68);
    display: flex;
    justify-content: space-between;
    min-height: 58px;
    padding: 12px;
}

.admin-nav a span,
.admin-nav a small {
    display: block;
}

.admin-nav a span {
    color: var(--white);
    font-weight: 950;
}

.admin-nav a small {
    color: rgba(255, 255, 255, 0.48);
    font-size: 0.76rem;
    font-weight: 850;
}

.admin-nav a.is-active,
.admin-nav a:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(245, 188, 46, 0.28);
    box-shadow: inset 4px 0 0 var(--yellow);
    color: var(--white);
}

.admin-actions {
    align-items: center;
    gap: 10px;
    justify-content: flex-end;
}

.ghost-action {
    border: 1px solid rgba(18, 27, 37, 0.1);
    border-radius: 8px;
    color: var(--ink);
    font-weight: 950;
    min-height: 44px;
    padding: 11px 14px;
}

.admin-layout {
    align-items: start;
    display: grid;
    gap: 24px;
    grid-template-columns: 280px minmax(0, 1fr);
    margin-inline: auto;
    padding: 24px 18px 76px;
    width: min(100%, 1340px);
}

.admin-sidebar {
    background:
        linear-gradient(180deg, rgba(27, 39, 51, 0.98), rgba(18, 27, 37, 0.98)),
        var(--ink);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    box-shadow: var(--shadow);
    color: var(--white);
    display: grid;
    gap: 16px;
    min-height: calc(100svh - 118px);
    padding: 16px;
    position: sticky;
    top: 92px;
}

.sidebar-card {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 14px;
    display: grid;
    gap: 8px;
    padding: 16px;
}

.sidebar-card .section-kicker {
    color: var(--yellow);
    margin-bottom: 0;
}

.sidebar-card strong {
    font-size: 1.25rem;
    line-height: 1.1;
}

.sidebar-card p {
    color: rgba(255, 255, 255, 0.62);
    line-height: 1.55;
    margin: 0;
}

.sidebar-mini {
    align-self: end;
}

.sidebar-mini .switch-control {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
    color: var(--white);
    justify-content: flex-start;
    white-space: normal;
}

.admin-shell {
    display: grid;
    gap: 24px;
    min-width: 0;
}

.admin-flash {
    background: var(--green);
    border-radius: 10px;
    box-shadow: var(--soft-shadow);
    color: var(--white);
    font-weight: 900;
    padding: 14px 16px;
}

.admin-hero {
    background:
        linear-gradient(135deg, rgba(18, 27, 37, 0.96), rgba(27, 39, 51, 0.94)),
        var(--ink);
    border-radius: 18px;
    box-shadow: var(--shadow);
    color: var(--white);
    display: grid;
    gap: 26px;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
    overflow: hidden;
    padding: clamp(28px, 5vw, 54px);
    position: relative;
}

.admin-hero::after {
    background:
        linear-gradient(90deg, transparent, rgba(245, 188, 46, 0.2)),
        repeating-linear-gradient(135deg, transparent 0 18px, rgba(255, 255, 255, 0.04) 18px 19px);
    content: "";
    inset: 0;
    pointer-events: none;
    position: absolute;
}

.admin-hero > * {
    position: relative;
    z-index: 1;
}

.admin-hero p {
    color: var(--yellow);
}

.hero-copy span {
    color: rgba(255, 255, 255, 0.72);
    display: block;
    font-size: 1.05rem;
    line-height: 1.7;
    max-width: 720px;
}

.hero-console {
    align-self: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 14px;
    display: grid;
    gap: 12px;
    padding: 18px;
}

.hero-console div:not(.console-badges) {
    align-items: center;
    display: flex;
    justify-content: space-between;
}

.hero-console span {
    color: rgba(255, 255, 255, 0.66);
    font-size: 0.82rem;
    font-weight: 900;
    text-transform: uppercase;
}

.hero-console strong {
    font-size: 1.05rem;
}

.console-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.console-badges span {
    background: rgba(245, 188, 46, 0.16);
    border: 1px solid rgba(245, 188, 46, 0.26);
    border-radius: 999px;
    color: var(--yellow);
    padding: 8px 10px;
}

.admin-stats {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat-card {
    background: var(--panel);
    border: 1px solid rgba(18, 27, 37, 0.08);
    border-radius: 14px;
    box-shadow: var(--soft-shadow);
    overflow: hidden;
    padding: 20px;
    position: relative;
}

.stat-card::before {
    border-radius: 999px;
    content: "";
    height: 9px;
    left: 20px;
    position: absolute;
    right: 20px;
    top: 0;
}

.tone-red::before { background: var(--red); }
.tone-green::before { background: var(--green); }
.tone-yellow::before { background: var(--yellow); }
.tone-ink::before { background: var(--ink); }

.stat-card span {
    color: var(--muted);
    display: block;
    font-size: 0.78rem;
    font-weight: 950;
    margin-top: 8px;
    text-transform: uppercase;
}

.stat-card strong {
    display: block;
    font-size: clamp(2.2rem, 5vw, 3.4rem);
    line-height: 1;
    margin: 18px 0 8px;
}

.stat-card p {
    color: var(--muted);
    font-weight: 750;
    margin: 0;
}

.admin-control-strip,
.admin-tabs,
.tab-panel {
    background: var(--panel);
    border: 1px solid rgba(18, 27, 37, 0.08);
    border-radius: 16px;
    box-shadow: var(--soft-shadow);
}

.admin-control-strip {
    align-items: center;
    display: grid;
    gap: 16px;
    grid-template-columns: minmax(0, 1fr) repeat(3, auto);
    padding: 20px;
}

.switch-control {
    align-items: center;
    background: #f4f6f8;
    border: 1px solid rgba(18, 27, 37, 0.08);
    border-radius: 999px;
    color: var(--ink);
    display: flex;
    font-size: 0.88rem;
    font-weight: 950;
    gap: 10px;
    padding: 8px 12px 8px 8px;
    white-space: nowrap;
}

.switch-control input {
    height: 1px;
    opacity: 0;
    position: absolute;
    width: 1px;
}

.switch-control span {
    background: #cfd7de;
    border-radius: 999px;
    height: 24px;
    position: relative;
    transition: background 180ms ease;
    width: 44px;
}

.switch-control span::after {
    background: var(--white);
    border-radius: 999px;
    box-shadow: 0 4px 10px rgba(18, 27, 37, 0.2);
    content: "";
    height: 18px;
    left: 3px;
    position: absolute;
    top: 3px;
    transition: transform 180ms ease;
    width: 18px;
}

.switch-control input:checked + span {
    background: var(--green);
}

.switch-control input:checked + span::after {
    transform: translateX(20px);
}

.admin-tabs {
    display: grid;
    gap: 0;
    overflow: hidden;
}

.tab-list {
    background: #edf1f4;
    border-bottom: 1px solid rgba(18, 27, 37, 0.08);
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 12px;
}

.tab-list button {
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    font-weight: 950;
    padding: 11px 16px;
    white-space: nowrap;
}

.tab-list button.is-active,
.tab-list button:hover {
    background: var(--ink);
    color: var(--white);
}

.tab-panel {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    display: none;
    padding: 24px;
}

.tab-panel.is-active {
    display: block;
}

.panel-heading {
    align-items: center;
    display: flex;
    gap: 18px;
    justify-content: space-between;
    margin-bottom: 20px;
}

.panel-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.panel-summary span,
.tracking-chip,
.request-list strong {
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 950;
    padding: 8px 10px;
    text-transform: uppercase;
}

.panel-summary span {
    background: var(--green-soft);
    color: var(--green);
}

.panel-action-button {
    background: var(--red);
    border: 0;
    border-radius: 8px;
    color: var(--white);
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 950;
    min-height: 38px;
    padding: 9px 13px;
}

.table-action-button {
    background: #f6fbff;
    border: 1px solid #2271b1;
    border-radius: 6px;
    color: #0a64a0;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 900;
    min-height: 32px;
    padding: 7px 10px;
}

.shipment-board {
    display: grid;
    gap: 16px;
}

.shipment-card {
    background:
        linear-gradient(90deg, rgba(19, 127, 115, 0.06), transparent 35%),
        #fbfcfd;
    border: 1px solid var(--line);
    border-radius: 14px;
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
    padding: 16px;
}

.shipment-main {
    display: grid;
    gap: 13px;
    min-width: 0;
    padding: 8px;
}

.tracking-chip {
    background: rgba(225, 50, 43, 0.1);
    color: var(--red);
    justify-self: start;
}

.shipment-main h3,
.request-list h3,
.message-card h3 {
    font-size: clamp(1.2rem, 2.4vw, 1.65rem);
    line-height: 1.12;
    margin: 0;
}

.shipment-meta {
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    font-weight: 800;
    gap: 10px;
}

.shipment-meta span {
    background: var(--white);
    border: 1px solid rgba(18, 27, 37, 0.08);
    border-radius: 999px;
    padding: 7px 10px;
}

.timeline-preview {
    align-items: center;
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    max-width: 420px;
}

.timeline-preview i {
    background: #cfd8df;
    border-radius: 999px;
    display: block;
    height: 8px;
}

.timeline-preview i.is-filled {
    background: var(--green);
}

.event-preview {
    background: var(--white);
    border: 1px solid rgba(18, 27, 37, 0.08);
    border-radius: 12px;
    padding: 14px;
}

.event-preview span,
.message-head span,
.request-list span {
    color: var(--green);
    display: block;
    font-size: 0.76rem;
    font-weight: 950;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.event-preview strong {
    display: block;
}

.event-preview p {
    color: var(--muted);
    line-height: 1.6;
    margin: 6px 0 0;
}

.shipment-update-card {
    background: var(--white);
    border: 1px solid rgba(18, 27, 37, 0.1);
    border-radius: 12px;
    box-shadow: 0 14px 32px rgba(18, 27, 37, 0.07);
    display: grid;
    gap: 10px;
    padding: 14px;
}

.shipment-update-card textarea {
    min-height: 74px;
    resize: vertical;
}

.request-list,
.message-grid {
    display: grid;
    gap: 14px;
}

.request-list article {
    align-items: center;
    background: #fbfcfd;
    border: 1px solid var(--line);
    border-radius: 12px;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    padding: 16px;
}

.request-list p,
.message-card p {
    color: var(--muted);
    line-height: 1.65;
    margin: 8px 0 0;
}

.request-list strong {
    background: var(--green-soft);
    color: var(--green);
    flex: 0 0 auto;
}

.message-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.message-card {
    background: #fbfcfd;
    border: 1px solid var(--line);
    border-radius: 12px;
    display: grid;
    gap: 14px;
    padding: 16px;
}

.message-head {
    align-items: start;
    display: flex;
    gap: 14px;
    justify-content: space-between;
}

.message-head a {
    color: var(--red);
    font-size: 0.9rem;
    font-weight: 900;
    overflow-wrap: anywhere;
}

.message-card form {
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(0, 1fr) auto;
}

.subscriber-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.subscriber-grid span {
    background: #fbfaf6;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    font-weight: 900;
    padding: 10px 12px;
}

.empty-state {
    background: #fbfcfd;
    border: 1px dashed #cbd4dc;
    border-radius: 12px;
    color: var(--muted);
    font-weight: 850;
    padding: 18px;
}

@media (max-width: 980px) {
    .admin-topbar {
        grid-template-columns: 1fr;
    }

    .admin-layout {
        grid-template-columns: 1fr;
        padding-top: 18px;
    }

    .admin-sidebar {
        min-height: 0;
        position: static;
    }

    .admin-nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-actions {
        justify-content: space-between;
    }

    .admin-hero,
    .shipment-card,
    .message-grid,
    .admin-control-strip {
        grid-template-columns: 1fr;
    }

    .admin-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .admin-login-shell,
    .admin-stats {
        grid-template-columns: 1fr;
    }

    .admin-layout {
        padding-inline: 12px;
    }

    .admin-nav {
        grid-template-columns: 1fr;
    }

    .admin-hero,
    .tab-panel {
        padding: 18px;
    }

    .admin-login-copy h1,
    .admin-hero h1 {
        font-size: clamp(2.4rem, 14vw, 4rem);
    }

    .panel-heading,
    .request-list article,
    .message-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .message-card form {
        grid-template-columns: 1fr;
    }
}

/* SaaS-style admin shell */
.admin-dashboard-page {
    background: #eef2f6;
}

body.admin-modal-open {
    overflow: hidden;
}

.admin-dashboard-page .admin-layout {
    align-items: stretch;
    gap: 0;
    grid-template-columns: 300px minmax(0, 1fr);
    margin: 0;
    min-height: 100svh;
    padding: 0;
    width: 100%;
}

.admin-dashboard-page .admin-sidebar {
    background: #111a2c;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    gap: 24px;
    min-height: 100svh;
    padding: 24px;
    position: sticky;
    top: 0;
}

.admin-dashboard-page .admin-brand {
    background: transparent;
    color: var(--white);
    min-width: 0;
    padding: 0 0 10px;
}

.admin-dashboard-page .admin-brand img {
    border-radius: 14px;
    height: 48px;
    width: 48px;
}

.admin-dashboard-page .admin-brand strong {
    color: var(--white);
    font-size: 1.1rem;
}

.admin-dashboard-page .admin-brand small {
    color: #96a4b8;
}

.admin-dashboard-page .admin-nav {
    display: grid;
    gap: 12px;
}

.admin-dashboard-page .admin-nav a {
    align-items: center;
    border: 0;
    border-radius: 12px;
    color: #c8d2e1;
    display: flex;
    gap: 0;
    justify-content: initial;
    min-height: 58px;
    padding: 12px 18px;
}

.admin-dashboard-page .admin-nav a::after {
    content: none;
}

.admin-dashboard-page .admin-nav a.has-submenu::after {
    color: #c8d2e1;
    content: ">";
    font-size: 1.4rem;
    line-height: 1;
}

.admin-dashboard-page .admin-nav a span {
    color: inherit;
    font-size: 1.05rem;
}

.admin-dashboard-page .admin-nav a small {
    display: none;
}

.admin-dashboard-page .admin-nav a.is-active,
.admin-dashboard-page .admin-nav a:hover {
    background: #2a3448;
    box-shadow: none;
    color: var(--white);
}

.admin-dashboard-page .sidebar-mini {
    background: #1b263a;
    border: 1px solid rgba(255, 255, 255, 0.08);
    margin-top: auto;
}

.admin-dashboard-page .admin-shell {
    background: #f3f6fa;
    gap: 14px;
    min-height: 100svh;
    padding: 0 36px 72px;
}

.admin-dashboard-page .admin-topbar {
    background: var(--white);
    border-bottom: 1px solid #dde4ed;
    display: flex;
    justify-content: space-between;
    margin: 0 -36px;
    padding: 24px 36px;
    position: static;
    z-index: 12;
}

.admin-page-title h1 {
    font-size: clamp(2rem, 4vw, 2.8rem);
    font-weight: 650;
    letter-spacing: 0;
    line-height: 1;
    margin: 0 0 8px;
}

.admin-page-title p {
    color: #626d79;
    font-size: 1.1rem;
    margin: 0;
}

.admin-profile-menu {
    align-items: center;
    background: #d7dce3;
    border-radius: 8px;
    display: grid;
    gap: 10px;
    grid-template-columns: 42px minmax(110px, 1fr) auto;
    min-width: 230px;
    padding: 6px 10px 6px 6px;
}

.admin-profile-menu img {
    background: var(--white);
    border-radius: 8px;
    height: 42px;
    width: 42px;
}

.admin-profile-menu strong,
.admin-profile-menu small {
    display: block;
    line-height: 1.1;
}

.admin-profile-menu strong {
    font-size: 1.05rem;
    font-weight: 950;
}

.admin-profile-menu small {
    color: #5d6c82;
}

.admin-profile-menu button {
    background: transparent;
    border: 0;
    color: #111a2c;
    font-size: 0.78rem;
    font-weight: 950;
    padding: 4px;
}

.admin-dashboard-page .admin-hero {
    background:
        linear-gradient(112deg, #0f2138 0%, #103d50 58%, #216c59 100%);
    border-radius: 8px;
    box-shadow: 0 22px 50px rgba(16, 33, 56, 0.18);
    grid-template-columns: minmax(0, 1fr) 480px;
    margin-top: 0;
    padding: 44px;
}

.admin-dashboard-page .admin-hero::after {
    display: none;
}

.admin-dashboard-page .admin-hero p {
    color: #ffe978;
    font-size: 0.9rem;
    margin-bottom: 18px;
}

.admin-dashboard-page .admin-hero h1 {
    font-size: clamp(3.2rem, 7vw, 5.4rem);
    line-height: 0.95;
    margin-bottom: 20px;
}

.admin-dashboard-page .hero-copy span {
    color: rgba(255, 255, 255, 0.82);
    font-size: 1.2rem;
    max-width: 760px;
}

.hero-actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 26px;
}

.hero-actions-row a,
.hero-actions-row button {
    align-items: center;
    border-radius: 8px;
    display: inline-flex;
    font-weight: 850;
    min-height: 48px;
    padding: 12px 18px;
}

.hero-actions-row a {
    background: var(--white);
    color: #111a2c;
}

.hero-actions-row button {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.85);
    color: var(--white);
}

.admin-dashboard-page .hero-console {
    background: rgba(255, 255, 255, 0.13);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 10px;
    gap: 16px;
    padding: 24px;
}

.console-metric {
    background: rgba(16, 33, 56, 0.5);
    border-radius: 8px;
    display: grid !important;
    gap: 12px;
    padding: 24px;
}

.console-metric span {
    color: #c7d3de;
    font-size: 0.95rem;
    font-weight: 950;
}

.console-metric strong {
    color: var(--white);
    font-size: 2rem;
    line-height: 1;
}

.admin-dashboard-page .admin-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.admin-dashboard-page .stat-card,
.admin-dashboard-page .admin-control-strip,
.admin-dashboard-page .admin-tabs {
    border-radius: 8px;
    box-shadow: 0 14px 34px rgba(17, 26, 44, 0.08);
}

@media (max-width: 1120px) {
    .admin-dashboard-page .admin-layout {
        grid-template-columns: 240px minmax(0, 1fr);
    }

    .admin-dashboard-page .admin-sidebar {
        padding: 18px;
    }

    .admin-dashboard-page .admin-hero {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 820px) {
    .admin-dashboard-page .admin-layout {
        grid-template-columns: 1fr;
    }

    .admin-dashboard-page .admin-sidebar {
        min-height: 0;
        position: static;
    }

    .admin-dashboard-page .admin-nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-dashboard-page .admin-shell {
        padding: 0 18px 56px;
    }

    .admin-dashboard-page .admin-topbar {
        align-items: flex-start;
        flex-direction: column;
        margin: 0 -18px;
        padding: 20px 18px;
    }

    .admin-dashboard-page .admin-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Compact logistics dashboard, reference-style */
.admin-dashboard-page {
    background: #f4f7fb;
    color: #17212b;
}

.admin-dashboard-page .admin-layout {
    grid-template-columns: 198px minmax(0, 1fr);
}

.admin-dashboard-page .admin-sidebar {
    background: linear-gradient(180deg, #07315d 0%, #062747 100%);
    padding: 14px 10px;
}

.admin-dashboard-page .admin-brand {
    gap: 9px;
    margin-bottom: 12px;
}

.admin-dashboard-page .admin-brand img {
    border-radius: 8px;
    height: 34px;
    width: 34px;
}

.admin-dashboard-page .admin-brand strong {
    font-size: 0.86rem;
}

.admin-dashboard-page .admin-brand small {
    font-size: 0.68rem;
}

.admin-dashboard-page .admin-nav {
    gap: 3px;
}

.admin-dashboard-page .admin-nav a {
    border-radius: 6px;
    min-height: 36px;
    padding: 8px 10px;
}

.admin-dashboard-page .admin-nav a span {
    font-size: 0.78rem;
    font-weight: 800;
}

.admin-dashboard-page .admin-nav a.is-active,
.admin-dashboard-page .admin-nav a:hover {
    background: #2d74ff;
}

.admin-dashboard-page .sidebar-mini {
    border-radius: 8px;
    margin-top: auto;
    padding: 12px;
}

.admin-dashboard-page .sidebar-mini strong {
    font-size: 0.95rem;
}

.admin-dashboard-page .sidebar-mini p {
    font-size: 0.72rem;
}

.admin-dashboard-page .admin-shell {
    gap: 14px;
    padding: 0 18px 28px;
}

.admin-dashboard-page .admin-topbar {
    align-items: center;
    border-bottom: 1px solid #dfe7f1;
    margin: 0 -18px;
    min-height: 58px;
    padding: 10px 18px;
}

.admin-page-title h1 {
    font-size: 1.15rem;
    font-weight: 850;
    margin-bottom: 2px;
}

.admin-page-title p {
    font-size: 0.76rem;
}

.admin-search {
    flex: 1 1 360px;
    max-width: 520px;
}

.admin-search input {
    background: #f7f9fc;
    border: 1px solid #dfe7f1;
    border-radius: 8px;
    min-height: 38px;
    padding: 8px 12px;
    width: 100%;
}

.admin-profile-menu {
    grid-template-columns: 30px minmax(100px, 1fr) auto;
    min-width: 190px;
    padding: 5px 8px 5px 5px;
}

.admin-profile-menu img {
    height: 30px;
    width: 30px;
}

.admin-profile-menu strong {
    font-size: 0.78rem;
}

.admin-profile-menu small,
.admin-profile-menu button {
    font-size: 0.68rem;
}

#dashboard-panel .admin-hero {
    display: none;
}

.admin-dashboard-page .admin-tabs {
    background: transparent;
    border: 0;
    box-shadow: none;
}

.admin-dashboard-page .tab-list {
    display: none;
}

.admin-dashboard-page .tab-panel {
    background: transparent;
    padding: 0;
}

#dashboard-panel.is-active {
    gap: 14px;
}

.control-center-stats {
    grid-template-columns: repeat(6, minmax(120px, 1fr)) !important;
}

.control-center-stats .stat-card {
    border-radius: 8px;
    min-height: 86px;
    padding: 12px 13px;
}

.control-center-stats .stat-card strong {
    font-size: 1.28rem;
}

.control-center-stats .stat-card p {
    font-size: 0.68rem;
}

.dashboard-widget-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: 1.2fr 0.85fr 0.95fr;
}

.dashboard-widget {
    background: #fff;
    border: 1px solid #dfe7f1;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(20, 37, 63, 0.05);
    padding: 14px;
}

.wide-widget {
    grid-column: span 1;
}

.widget-heading {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.widget-heading h3 {
    font-size: 0.9rem;
    margin: 0;
}

.widget-heading span {
    color: #2d74ff;
    font-size: 0.68rem;
    font-weight: 800;
}

.mini-chart {
    align-items: end;
    display: flex;
    gap: 10px;
    height: 160px;
    padding: 10px 4px 0;
}

.mini-chart i {
    background: linear-gradient(180deg, #2d74ff, #55c88a);
    border-radius: 999px 999px 0 0;
    flex: 1;
}

.status-donut {
    align-items: center;
    background: conic-gradient(#55c88a 0 55%, #2d74ff 55% 82%, #ffb84d 82% 94%, #ff5b6e 94% 100%);
    border-radius: 50%;
    display: grid;
    height: 128px;
    justify-items: center;
    margin: 0 auto 12px;
    place-content: center;
    position: relative;
    width: 128px;
}

.status-donut::after {
    background: #fff;
    border-radius: 50%;
    content: "";
    height: 76px;
    position: absolute;
    width: 76px;
}

.status-donut strong,
.status-donut span {
    position: relative;
    z-index: 1;
}

.status-donut strong {
    font-size: 1.05rem;
}

.status-donut span {
    color: var(--muted);
    font-size: 0.68rem;
}

.widget-list p,
.compact-shipment-list p {
    align-items: center;
    border-top: 1px solid #edf1f5;
    display: flex;
    justify-content: space-between;
    margin: 0;
    padding: 8px 0;
}

.widget-list span,
.compact-shipment-list span,
.mini-table td {
    color: var(--muted);
    font-size: 0.76rem;
}

.compact-shipment-list strong {
    color: #17212b;
    font-size: 0.76rem;
}

.mini-table {
    width: 100%;
}

.mini-table td {
    border-top: 1px solid #edf1f5;
    padding: 9px 0;
}

.mini-table td:last-child {
    color: #17212b;
    font-weight: 900;
    text-align: right;
}

.quick-actions {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.quick-actions button {
    background: #fff;
    border: 1px solid #dfe7f1;
    border-radius: 8px;
    color: #1f3654;
    font-size: 0.74rem;
    font-weight: 850;
    min-height: 42px;
    padding: 8px;
}

#dashboard-panel .panel-heading {
    margin-bottom: 0;
}

#dashboard-panel .logistics-module-grid {
    display: none;
}

.admin-dashboard-page .shipment-table,
.admin-dashboard-page .module-table {
    background: #fff;
}

@media (max-width: 1180px) {
    .control-center-stats {
        grid-template-columns: repeat(3, minmax(120px, 1fr)) !important;
    }

    .dashboard-widget-grid {
        grid-template-columns: 1fr 1fr;
    }

    .quick-actions {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    .admin-dashboard-page .admin-layout {
        grid-template-columns: 1fr;
    }

    .control-center-stats,
    .dashboard-widget-grid,
    .quick-actions {
        grid-template-columns: 1fr !important;
    }

    .admin-track-form > div {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .admin-dashboard-page .admin-nav,
    .admin-dashboard-page .admin-stats {
        grid-template-columns: 1fr;
    }

    .admin-dashboard-page .admin-hero {
        padding: 24px;
    }

    .admin-dashboard-page .admin-hero h1 {
        font-size: 3rem;
    }

    .admin-profile-menu {
        width: 100%;
    }
}

/* Organization pass for the SaaS admin shell */
.admin-dashboard-page .admin-layout {
    grid-template-columns: 280px minmax(0, 1fr);
}

.admin-dashboard-page .admin-sidebar {
    align-content: start;
    grid-template-rows: auto auto 1fr;
    height: 100svh;
    min-height: 100svh;
    overflow-y: auto;
    padding: 22px 20px;
}

.admin-dashboard-page .admin-brand {
    margin-bottom: 10px;
}

.admin-dashboard-page .admin-nav {
    align-content: start;
    gap: 8px;
}

.admin-dashboard-page .admin-nav a {
    min-height: 52px;
    padding: 10px 18px;
}

.admin-dashboard-page .admin-nav a span {
    font-size: 0.98rem;
}

.admin-dashboard-page .sidebar-mini {
    align-self: end;
    margin-top: 24px;
}

.admin-dashboard-page .admin-shell {
    padding: 0 28px 64px;
}

.admin-dashboard-page .admin-topbar {
    margin: 0 -28px;
    min-height: 92px;
    padding: 22px 28px;
}

.admin-page-title h1 {
    font-size: clamp(2rem, 3vw, 2.55rem);
    font-weight: 750;
}

.admin-profile-menu {
    min-width: 260px;
}

.admin-dashboard-page .admin-hero {
    align-items: center;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 410px);
    min-height: 390px;
    padding: 38px 44px;
}

.admin-dashboard-page .admin-hero h1 {
    font-size: clamp(3rem, 5vw, 4.5rem);
    max-width: 700px;
}

.admin-dashboard-page .hero-copy span {
    font-size: 1.08rem;
    line-height: 1.7;
    max-width: 680px;
}

.admin-dashboard-page .hero-console {
    padding: 18px;
}

.console-metric {
    min-height: 96px;
    padding: 20px;
}

.console-metric strong {
    font-size: 1.8rem;
}

.admin-dashboard-page .admin-stats {
    gap: 18px;
}

.admin-dashboard-page .stat-card {
    min-height: 132px;
    padding: 22px;
}

.admin-dashboard-page .stat-card strong {
    font-size: clamp(2.15rem, 3.2vw, 2.85rem);
    margin-top: 14px;
}

.admin-dashboard-page .admin-control-strip {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 22px 24px;
}

.admin-dashboard-page .admin-control-strip > div:first-child {
    flex: 1 1 250px;
    max-width: 300px;
}

.admin-dashboard-page .admin-control-strip h2 {
    font-size: clamp(1.55rem, 2vw, 1.95rem);
    line-height: 1.08;
}

.admin-dashboard-page .admin-control-strip .switch-control {
    flex: 0 0 auto;
    font-size: 0.78rem;
    min-height: 40px;
    padding: 7px 10px 7px 7px;
    justify-self: start;
}

.admin-dashboard-page .admin-control-strip .switch-control span {
    height: 22px;
    width: 40px;
}

.admin-dashboard-page .admin-control-strip .switch-control span::after {
    height: 16px;
    width: 16px;
}

.admin-dashboard-page .admin-control-strip .switch-control input:checked + span::after {
    transform: translateX(18px);
}

.admin-dashboard-page .compact-settings {
    box-shadow: none;
    justify-content: flex-start;
    margin-top: 8px;
}

.admin-dashboard-page .tab-list {
    padding: 14px 18px;
}

.admin-dashboard-page .tab-panel {
    padding: 28px;
}

.admin-dashboard-page .shipment-card {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
    padding: 22px;
}

.shipment-list-tools {
    border-bottom: 1px solid var(--line);
    display: grid;
    gap: 12px;
    margin: 0 -28px 0;
    padding: 0 28px 18px;
}

.shipment-filter-row,
.shipment-search-row {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.shipment-bulk-dialog {
    background: #ffffff;
    border: 1px solid #d4e0eb;
    border-radius: 14px;
    box-shadow: 0 24px 80px rgb(10 28 48 / 28%);
    color: #172b43;
    max-height: min(90vh, 760px);
    max-width: 900px;
    overflow: auto;
    padding: 0;
    width: min(92vw, 900px);
}

.shipment-bulk-dialog::backdrop {
    background: rgb(8 24 42 / 54%);
    backdrop-filter: blur(2px);
}

.shipment-bulk-form:not([hidden]) {
    align-items: end;
    background: #f8fbfd;
    display: grid;
    gap: 16px;
    grid-template-columns: minmax(0, 1.1fr) minmax(270px, .9fr);
    padding: 22px;
}

.shipment-bulk-heading {
    align-items: flex-start;
    display: flex;
    gap: 16px;
    justify-content: space-between;
}

.shipment-bulk-heading h3 {
    color: #102a43;
    font-size: 1.25rem;
    margin: 0 0 5px;
}

.shipment-bulk-close {
    align-items: center;
    background: transparent;
    border: 0;
    color: #52677d;
    cursor: pointer;
    display: flex;
    font-size: 1.75rem;
    height: 36px;
    justify-content: center;
    line-height: 1;
    padding: 0;
    width: 36px;
}

.shipment-bulk-selection {
    color: #006f63;
    font-size: 0.82rem;
    font-weight: 850;
}

.shipment-bulk-fields {
    border: 0;
    display: grid;
    gap: 8px;
    grid-column: 1 / -1;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 0;
    padding: 0;
}

.shipment-bulk-fields[hidden] {
    display: none !important;
}

.shipment-bulk-fields label {
    color: #52677d;
    display: grid;
    font-size: 0.78rem;
    font-weight: 750;
    gap: 4px;
}

.shipment-bulk-error {
    color: #b42318;
    grid-column: 1 / -1;
    margin: 0;
}

.shipment-bulk-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.shipment-bulk-form button[type="submit"],
.shipment-bulk-cancel {
    border: 1px solid #2271b1;
    border-radius: 6px;
    background: #f6fbff;
    color: #0a64a0;
    cursor: pointer;
    font-weight: 850;
    min-height: 36px;
    padding: 7px 12px;
}

.shipment-bulk-cancel {
    background: #ffffff;
    border-color: #cad8e5;
    color: #52677d;
}

.shipment-table tbody tr.is-selected {
    background: #edf7f5;
}

.shipment-search-row {
    justify-content: flex-end;
}

.shipment-search-form {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.shipment-search-form input {
    max-width: 260px;
    min-width: 190px;
    width: 26vw;
}

.shipment-list-tools select,
.shipment-list-tools input,
.shipment-list-tools button,
.shipment-inline-update select,
.shipment-inline-update input,
.shipment-inline-update button {
    border: 1px solid #c8d2dc;
    border-radius: 3px;
    background: var(--white);
    color: #243141;
    min-height: 34px;
    padding: 7px 10px;
}

.shipment-list-tools button,
.shipment-inline-update button {
    border-color: #2271b1;
    background: #f6fbff;
    color: #0a64a0;
    font-weight: 800;
}

.shipment-search-row span {
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 800;
    margin-right: auto;
}

.shipment-table-wrap {
    overflow-x: auto;
}

.shipment-table {
    border-collapse: collapse;
    min-width: 1120px;
    width: 100%;
}

.shipment-table th,
.shipment-table td {
    border-bottom: 1px solid #d8e0e7;
    padding: 12px 10px;
    text-align: left;
    vertical-align: top;
}

.shipment-table th {
    background: #f8fafc;
    color: #33506d;
    font-size: 0.78rem;
    font-weight: 850;
}

.shipment-table tbody tr:nth-child(4n + 1),
.shipment-table tbody tr:nth-child(4n + 2) {
    background: #fbfcfd;
}

.shipment-table tbody tr:nth-child(4n + 3),
.shipment-table tbody tr:nth-child(4n + 4) {
    background: #f4f6f8;
}

.shipment-table td {
    color: #3c4a58;
    font-size: 0.84rem;
    line-height: 1.45;
}

.shipment-table small {
    color: var(--muted);
    display: block;
    margin-top: 5px;
}

.shipment-id-link {
    color: #006ba8;
    font-weight: 900;
}

.shipment-status {
    color: #394a59;
    font-weight: 850;
}

.shipment-actions {
    display: block;
    min-width: 120px;
}

.shipment-action-menu {
    position: relative;
}

.shipment-action-menu > summary {
    align-items: center;
    background: #f6fbff;
    border: 1px solid #2271b1;
    border-radius: 6px;
    color: #0a64a0;
    cursor: pointer;
    display: flex;
    font-size: 0.8rem;
    font-weight: 850;
    justify-content: space-between;
    list-style: none;
    min-height: 36px;
    padding: 7px 10px;
}

.shipment-action-menu > summary::-webkit-details-marker {
    display: none;
}

.shipment-action-menu > summary::after {
    content: '⌄';
    font-size: 1rem;
    margin-left: 12px;
}

.shipment-action-options {
    background: #fff;
    border: 1px solid #c9d8e6;
    border-radius: 8px;
    box-shadow: 0 12px 28px rgb(18 48 78 / 18%);
    display: grid;
    gap: 3px;
    min-width: 150px;
    padding: 6px;
    position: absolute;
    right: 0;
    top: calc(100% + 5px);
    z-index: 20;
}

.shipment-action-options > button,
.shipment-action-options > a,
.shipment-action-options > form > button {
    background: transparent;
    border: 0;
    border-radius: 5px;
    color: #17324d;
    cursor: pointer;
    display: block;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 750;
    padding: 9px 10px;
    text-align: left;
    text-decoration: none;
    width: 100%;
}

.shipment-action-options > button:hover,
.shipment-action-options > a:hover,
.shipment-action-options > form > button:hover {
    background: #edf6fb;
}

.shipment-action-options > form > button.is-danger {
    color: #b42318;
}

.admin-pagination {
    color: #52677d;
    display: grid;
    font-size: 0.9rem;
    gap: 12px;
    margin: 16px 0 24px;
}

.management-grid > .admin-pagination {
    grid-column: 1 / -1;
}

.email-list-card > .admin-pagination {
    margin-bottom: 0;
}

.admin-pagination-tools,
.admin-pagination-navigation,
.admin-pagination-sizes,
.admin-pagination-load-more,
.admin-pagination-links {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: space-between;
}

.admin-pagination-tools {
    justify-content: flex-start;
}

.admin-pagination-sizes {
    border: 1px solid #d4e0eb;
    border-radius: 9px;
    gap: 0;
    overflow: hidden;
}

.admin-pagination-sizes button {
    background: #f8fafc;
    border: 0;
    border-right: 1px solid #d4e0eb;
    color: #1d2939;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
    min-height: 40px;
    min-width: 58px;
    padding: 8px 12px;
}

.admin-pagination-sizes button:last-child {
    border-right: 0;
}

.admin-pagination-sizes button.is-active {
    background: #fff;
    box-shadow: inset 0 -3px #008675;
    color: #008675;
}

.admin-pagination-load-more span {
    font-size: 0.8rem;
    font-weight: 700;
}

.admin-pagination-load-more button,
.admin-pagination-links a,
.admin-pagination-links span {
    background: #fff;
    border: 1px solid #d4e0eb;
    border-radius: 8px;
    color: #006f63;
    display: inline-flex;
    font: inherit;
    font-weight: 750;
    justify-content: center;
    min-height: 38px;
    padding: 8px 13px;
    text-decoration: none;
}

.admin-pagination-load-more button {
    background: #f1f3f5;
    border-color: #f1f3f5;
    color: #142333;
    cursor: pointer;
}

.admin-pagination-navigation {
    background: #f8fafc;
    border: 1px solid #d4e0eb;
    border-radius: 10px;
    min-height: 66px;
    padding: 10px 14px;
}

.admin-pagination-navigation p {
    margin: 0;
}

.admin-pagination-links {
    justify-content: flex-end;
}

.admin-pagination-links .admin-pagination-current {
    color: #006f63;
}

.admin-pagination-links .is-disabled {
    color: #98a9b9;
}

@media (max-width: 640px) {
    .admin-pagination-navigation {
        align-items: flex-start;
        flex-direction: column;
    }

    .admin-pagination-links {
        justify-content: flex-start;
        width: 100%;
    }

    .shipment-bulk-form:not([hidden]) {
        align-items: stretch;
        padding: 16px;
    }

    .shipment-bulk-fields {
        grid-template-columns: 1fr;
    }

    .shipment-bulk-fields > * {
        grid-column: 1 / -1;
    }
}
}

.shipment-update-row td {
    padding-bottom: 18px;
    padding-top: 0;
}

.shipment-inline-update {
    align-items: center;
    display: grid;
    gap: 8px;
    grid-template-columns: 160px 1fr 1fr 1.3fr auto;
}

#dashboard-panel {
    display: none;
}

#dashboard-panel.is-active {
    display: grid;
    gap: 18px;
}

.control-center-stats {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)) !important;
    gap: 12px !important;
}

.control-center-stats .stat-card {
    min-height: 96px;
    padding: 14px 16px;
}

.control-center-stats .stat-card::before {
    height: 5px;
    left: 16px;
    right: 16px;
}

.control-center-stats .stat-card span {
    font-size: 0.7rem;
}

.control-center-stats .stat-card strong {
    font-size: clamp(1.45rem, 2.2vw, 2rem);
    margin: 10px 0 4px;
}

.control-center-stats .stat-card p {
    font-size: 0.78rem;
}

.logistics-module-grid,
.management-grid,
.report-grid {
    display: grid;
    gap: 14px;
}

.logistics-module-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.logistics-module-grid button,
.management-grid article,
.report-grid article {
    background: #fbfcfd;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    padding: 18px;
    text-align: left;
}

.logistics-module-grid button {
    cursor: pointer;
    display: grid;
    gap: 10px;
    min-height: 150px;
    transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.logistics-module-grid button:hover {
    border-color: rgba(19, 127, 115, 0.28);
    box-shadow: 0 14px 34px rgba(17, 26, 44, 0.08);
    transform: translateY(-2px);
}

.logistics-module-grid strong,
.management-grid h3 {
    font-size: 1.05rem;
    line-height: 1.2;
}

.logistics-module-grid span,
.management-grid p,
.management-grid small {
    color: var(--muted);
    line-height: 1.6;
}

.management-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.management-grid article {
    display: grid;
    gap: 8px;
}

.management-grid article > span {
    color: var(--green);
    font-size: 0.76rem;
    font-weight: 950;
    text-transform: uppercase;
}

.management-grid h3,
.management-grid p {
    margin: 0;
}

.module-table {
    border-collapse: collapse;
    width: 100%;
}

.module-table th,
.module-table td {
    border-bottom: 1px solid var(--line);
    padding: 13px 12px;
    text-align: left;
}

.module-table th {
    background: #f8fafc;
    color: #33506d;
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.module-table td {
    color: #3c4a58;
}

.module-table td small {
    color: var(--muted);
    display: block;
    font-size: 0.72rem;
    margin-top: 4px;
}

.admin-section-table {
    margin-top: 18px;
}

.admin-subheading {
    margin-bottom: 0;
    margin-top: 28px;
}

.admin-track-form {
    background: #fbfcfd;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: grid;
    gap: 10px;
    margin-bottom: 18px;
    padding: 16px;
}

.admin-track-form label {
    color: var(--ink);
    font-size: 0.78rem;
    font-weight: 950;
    text-transform: uppercase;
}

.admin-track-form > div {
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(0, 1fr) auto;
}

.admin-track-form input {
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    min-height: 44px;
    padding: 10px 12px;
}

.admin-track-form button {
    background: var(--red);
    border: 0;
    border-radius: 8px;
    color: var(--white);
    cursor: pointer;
    font-weight: 950;
    min-height: 44px;
    padding: 10px 16px;
}

.report-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.report-grid article {
    font-weight: 900;
    min-height: 82px;
}

.report-card-link {
    background: #fbfcfd;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    display: grid;
    gap: 10px;
    min-height: 108px;
    padding: 18px;
    text-decoration: none;
    transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.report-card-link:hover {
    border-color: rgba(19, 127, 115, 0.32);
    box-shadow: 0 16px 34px rgba(17, 26, 44, 0.1);
    transform: translateY(-2px);
}

.report-card-link strong {
    font-size: 1.05rem;
    line-height: 1.25;
}

.report-card-link span {
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1.5;
}

.admin-modal {
    align-items: center;
    display: grid;
    inset: 0;
    opacity: 0;
    padding: 24px;
    pointer-events: none;
    position: fixed;
    transition: opacity 180ms ease;
    visibility: hidden;
    z-index: 100;
}

.admin-modal.is-open {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
}

.admin-modal-backdrop {
    background: rgba(17, 26, 44, 0.68);
    inset: 0;
    position: absolute;
}

.admin-modal-panel {
    background: var(--white);
    border-radius: 10px;
    box-shadow: 0 28px 90px rgba(17, 26, 44, 0.28);
    justify-self: center;
    max-height: min(820px, calc(100svh - 48px));
    max-width: 880px;
    overflow-y: auto;
    padding: 26px;
    position: relative;
    width: min(100%, 880px);
}

.admin-modal-panel h2 {
    font-size: clamp(1.7rem, 3vw, 2.3rem);
    margin: 0 0 18px;
}

.admin-modal-close {
    background: #eef2f6;
    border: 0;
    border-radius: 8px;
    color: var(--ink);
    font-size: 1.5rem;
    font-weight: 900;
    height: 40px;
    position: absolute;
    right: 18px;
    top: 18px;
    width: 40px;
}

.admin-create-form {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-create-form label {
    color: var(--ink);
    display: grid;
    font-size: 0.82rem;
    font-weight: 900;
    gap: 7px;
}

.admin-create-form input,
.admin-create-form select,
.admin-create-form textarea {
    border: 1px solid var(--line);
    border-radius: 8px;
    min-height: 44px;
    padding: 10px 12px;
}

.admin-create-form textarea {
    resize: vertical;
}

.admin-create-form .full-span {
    grid-column: 1 / -1;
}

.admin-create-form .form-switch-row {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.admin-create-form button {
    background: var(--red);
    border: 0;
    border-radius: 8px;
    color: var(--white);
    font-weight: 950;
    min-height: 48px;
    padding: 12px 16px;
}

@media (max-width: 1180px) {
    .admin-dashboard-page .admin-hero {
        grid-template-columns: 1fr;
    }

    .admin-dashboard-page .hero-console {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .shipment-inline-update {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .logistics-module-grid,
    .report-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 980px) {
    .admin-dashboard-page .admin-control-strip > div:first-child {
        max-width: none;
    }
}

@media (max-width: 820px) {
    .admin-dashboard-page .admin-layout {
        grid-template-columns: 1fr;
    }

    .admin-dashboard-page .admin-sidebar {
        height: auto;
        min-height: 0;
    }

    .admin-dashboard-page .admin-shell {
        padding: 0 16px 52px;
    }

    .admin-dashboard-page .admin-topbar {
        margin: 0 -16px;
    }

    .shipment-list-tools {
        margin-inline: -28px;
    }

    .shipment-search-row {
        justify-content: flex-start;
    }

    .control-center-stats,
    .logistics-module-grid,
    .management-grid,
    .report-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Final compact control-center overrides */
.admin-dashboard-page .admin-layout {
    grid-template-columns: 198px minmax(0, 1fr) !important;
}

.admin-dashboard-page .admin-sidebar {
    padding: 14px 10px !important;
}

.admin-dashboard-page .admin-shell {
    padding: 0 18px 28px !important;
}

.admin-dashboard-page .admin-topbar {
    margin: 0 -18px !important;
    min-height: 58px !important;
    padding: 10px 18px !important;
}

.admin-page-title h1 {
    font-size: 1.15rem !important;
}

.admin-dashboard-page .admin-brand img {
    height: 34px !important;
    width: 34px !important;
}

.admin-dashboard-page .admin-brand strong {
    font-size: 0.86rem !important;
}

.admin-dashboard-page .admin-brand small {
    font-size: 0.68rem !important;
}

.admin-dashboard-page .admin-nav a {
    min-height: 36px !important;
    padding: 8px 10px !important;
}

.admin-dashboard-page .admin-nav a span {
    font-size: 0.78rem !important;
}

#dashboard-panel .admin-hero {
    display: none !important;
}

.control-center-stats {
    gap: 12px !important;
    grid-template-columns: repeat(6, minmax(120px, 1fr)) !important;
}

.control-center-stats .stat-card {
    min-height: 86px !important;
    padding: 12px 13px !important;
}

.control-center-stats .stat-card strong {
    font-size: 1.28rem !important;
}

.control-center-stats .stat-card p {
    font-size: 0.68rem !important;
}

@media (max-width: 1180px) {
    .admin-dashboard-page .admin-layout {
        grid-template-columns: 198px minmax(0, 1fr) !important;
    }
}

@media (max-width: 820px) {
    .admin-dashboard-page .admin-layout {
        grid-template-columns: 1fr !important;
    }

    .control-center-stats {
        grid-template-columns: 1fr !important;
    }
}

/* Shipment board fit-to-screen pass */
.admin-dashboard-page .panel-heading h2 {
    font-size: clamp(1.45rem, 2vw, 2rem) !important;
}

#shipments-panel .panel-heading {
    margin-bottom: 8px;
}

#shipments-panel {
    padding-top: 10px !important;
}

#shipments-panel .panel-heading p {
    margin: 0;
}

#shipments-panel .shipment-list-tools {
    gap: 10px;
    margin: 0 0 0;
    padding: 0 0 12px;
}

#shipments-panel .shipment-filter-row,
#shipments-panel .shipment-search-row {
    gap: 8px;
}

#shipments-panel .shipment-list-tools select,
#shipments-panel .shipment-list-tools input,
#shipments-panel .shipment-list-tools button {
    font-size: 0.82rem;
    min-height: 36px;
    padding: 7px 9px;
}

#shipments-panel .shipment-search-form input {
    max-width: 260px;
}

#shipments-panel .shipment-table-wrap {
    overflow: visible;
    width: 100%;
}

#shipments-panel .shipment-table {
    min-width: 0;
    table-layout: fixed;
    width: 100%;
}

#shipments-panel .shipment-table th,
#shipments-panel .shipment-table td {
    font-size: 0.72rem;
    line-height: 1.35;
    padding: 8px 7px;
    overflow-wrap: anywhere;
}

#shipments-panel .shipment-table th:nth-child(1),
#shipments-panel .shipment-table td:nth-child(1) {
    width: 32px;
}

#shipments-panel .shipment-table th:nth-child(2),
#shipments-panel .shipment-table td:nth-child(2) {
    width: 13%;
}

#shipments-panel .shipment-table th:nth-child(3),
#shipments-panel .shipment-table td:nth-child(3) {
    width: 13%;
}

#shipments-panel .shipment-table th:nth-child(4),
#shipments-panel .shipment-table td:nth-child(4) {
    width: 10%;
}

#shipments-panel .shipment-table th:nth-child(5),
#shipments-panel .shipment-table td:nth-child(5),
#shipments-panel .shipment-table th:nth-child(6),
#shipments-panel .shipment-table td:nth-child(6) {
    width: 12%;
}

#shipments-panel .shipment-table th:nth-child(7),
#shipments-panel .shipment-table td:nth-child(7) {
    width: 11%;
}

#shipments-panel .shipment-table th:nth-child(8),
#shipments-panel .shipment-table td:nth-child(8) {
    width: 82px;
}

#shipments-panel .shipment-table th:nth-child(9),
#shipments-panel .shipment-table td:nth-child(9) {
    width: 90px;
}

#shipments-panel .shipment-table th:nth-child(10),
#shipments-panel .shipment-table td:nth-child(10) {
    width: 132px;
}

#shipments-panel .shipment-id-link {
    font-size: 0.78rem;
}

#shipments-panel .shipment-actions {
    min-width: 0;
}

#shipments-panel .shipment-inline-update {
    gap: 7px;
    grid-template-columns: 140px 1fr 1fr 1fr auto;
}

#shipments-panel .shipment-inline-update select,
#shipments-panel .shipment-inline-update input,
#shipments-panel .shipment-inline-update button {
    font-size: 0.74rem;
    min-height: 34px;
    padding: 7px 9px;
}

/* Dashboard quick actions alignment pass */
.admin-dashboard-page .quick-actions {
    align-items: stretch;
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

.admin-dashboard-page .quick-actions button {
    align-items: center;
    display: inline-flex;
    justify-content: center;
    line-height: 1.18;
    min-height: 46px;
    padding: 10px 12px;
    text-align: center;
    white-space: normal;
    width: 100%;
}

.admin-dashboard-page .quick-actions button:last-child:nth-child(odd) {
    grid-column: 1 / -1;
}

@media (max-width: 980px) {
    .admin-dashboard-page .quick-actions {
        grid-template-columns: 1fr !important;
    }
}

.admin-report-page {
    background: #eef2f6;
    color: var(--ink);
    margin: 0;
}

.report-document {
    display: grid;
    gap: 22px;
    margin: 0 auto;
    max-width: 1120px;
    padding: 28px;
}

.report-document-head {
    align-items: center;
    display: flex;
    justify-content: space-between;
}

.report-document-head a {
    align-items: center;
    color: var(--ink);
    display: inline-flex;
    font-weight: 950;
    gap: 10px;
    text-decoration: none;
}

.report-document-head img {
    height: 42px;
    width: 42px;
}

.report-document-head button {
    background: var(--red);
    border: 0;
    border-radius: 8px;
    color: var(--white);
    cursor: pointer;
    font-weight: 950;
    min-height: 42px;
    padding: 10px 14px;
}

.report-title-block,
.report-table-card,
.report-summary-grid article {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 18px 44px rgba(17, 26, 44, 0.06);
}

.report-title-block {
    padding: 26px;
}

.report-title-block p {
    color: var(--red);
    font-weight: 950;
    margin: 0 0 8px;
    text-transform: uppercase;
}

.report-title-block h1 {
    font-size: clamp(2rem, 4vw, 3.2rem);
    line-height: 1;
    margin: 0 0 12px;
}

.report-title-block span {
    color: var(--muted);
}

.report-summary-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.report-summary-grid article {
    padding: 18px;
}

.report-summary-grid span {
    color: var(--muted);
    display: block;
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.report-summary-grid strong {
    display: block;
    font-size: 1.8rem;
    margin-top: 8px;
}

.logistics-module-grid a {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--ink);
    display: block;
    padding: 18px;
    text-decoration: none;
}

.logistics-module-grid a strong,
.logistics-module-grid a span {
    display: block;
}

.logistics-module-grid a span {
    color: var(--muted);
    margin-top: 8px;
}

.email-center-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(320px, 0.85fr) minmax(0, 1.15fr);
}

.email-compose-card,
.email-list-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 18px 44px rgba(17, 26, 44, 0.06);
    padding: 20px;
}

.email-compose-card h2,
.email-list-card h2 {
    margin: 0 0 16px;
}

.email-message-card {
    border-top: 1px solid var(--line);
    padding: 16px 0;
}

.email-message-card:first-of-type {
    border-top: 0;
}

.email-message-card span,
.email-message-card small {
    color: var(--muted);
    display: block;
    font-size: 0.82rem;
}

.email-message-card h3 {
    margin: 6px 0;
}

.email-message-card p {
    color: var(--muted);
    line-height: 1.6;
    margin: 10px 0 0;
}

.email-settings-link {
    background: var(--red);
    border-radius: 8px;
    color: #fff;
    font-weight: 950;
    padding: 10px 14px;
    text-decoration: none;
}

@media (max-width: 900px) {
    .email-center-grid {
        grid-template-columns: 1fr;
    }
}

.report-table-card {
    overflow-x: auto;
    padding: 18px;
}

@media print {
    .admin-report-page {
        background: #fff;
    }

    .report-document {
        max-width: none;
        padding: 0;
    }

    .report-document-head button {
        display: none;
    }

    .report-title-block,
    .report-table-card,
    .report-summary-grid article {
        box-shadow: none;
    }
}

@media (max-width: 760px) {
    .report-document {
        padding: 14px;
    }

    .report-document-head,
    .report-summary-grid {
        grid-template-columns: 1fr;
    }

    .report-document-head {
        align-items: stretch;
        display: grid;
        gap: 12px;
    }
}
:is(#create-shipment-modal, #edit-shipment-modal) .admin-modal-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
    border-radius: 16px;
}

.shipment-create-header {
    background: #103553;
    border-left: 5px solid var(--red);
    padding: 17px 66px 17px 22px;
}

:is(#create-shipment-modal, #edit-shipment-modal) h2 {
    color: white;
    font-size: clamp(1.25rem, 3vw, 1.65rem);
    margin: 0;
}

:is(#create-shipment-modal, #edit-shipment-modal) .admin-modal-close {
    top: 10px;
    right: 12px;
    background: #284c68;
    color: white;
}

:is(#create-shipment-modal, #edit-shipment-modal) form {
    display: flex;
    flex-direction: column;
    min-height: 0;
    gap: 0;
}

.shipment-create-body {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    overflow-y: auto;
    padding: 18px 22px;
    background: #f4f7fa;
}

.shipment-create-body fieldset {
    min-width: 0;
    margin: 0;
    padding: 10px 14px 14px;
    display: grid;
    gap: 10px;
    border: 1px solid #d7e1ea;
    border-radius: 10px;
    background: white;
}

.shipment-create-body legend {
    padding: 0 6px;
    color: #183e5a;
    font-weight: 750;
}

.shipment-create-body .shipment-delivery-details {
    grid-column: 1 / -1;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
}

.shipment-create-body fieldset:last-child {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

:is(#create-shipment-modal, #edit-shipment-modal) label { font-weight: 650; gap: 4px; }
:is(#create-shipment-modal, #edit-shipment-modal) :is(input, textarea) { width: 100%; min-width: 0; min-height: 38px; padding: 7px 10px; }
:is(#create-shipment-modal, #edit-shipment-modal) :focus-visible { outline: 2px solid #2566ac; outline-offset: 2px; }

.shipment-create-footer {
    display: flex;
    justify-content: flex-end;
    flex-shrink: 0;
    gap: 8px;
    padding: 10px 22px;
    border-top: 1px solid #d7e1ea;
}

:is(#create-shipment-modal, #edit-shipment-modal) footer button { min-height: 38px; padding: 8px 15px; }
:is(#create-shipment-modal, #edit-shipment-modal) footer button[type="button"] { background: #eef2f6; color: #31475d; }

@media (max-width: 620px) {
    .shipment-create-body { grid-template-columns: 1fr; padding: 12px; }
    .shipment-create-body fieldset:last-child { grid-template-columns: 1fr; }
}


/* Shipment register */
#shipments-panel {
    background: white;
    border: 1px solid #dbe4ed;
    border-radius: 14px;
    box-shadow: 0 6px 24px rgb(17 46 69 / 6%);
    padding: 0 !important;
    min-width: 0;
}
#shipments-panel .panel-heading {
    background: linear-gradient(110deg, #103553, #174760);
    border-radius: 13px 13px 0 0;
    padding: 12px 18px;
    margin: 0;
    flex-wrap: wrap;
    gap: 10px;
}
#shipments-panel .panel-heading h2 {
    font-size: 1.12rem !important;
    color: white;
    letter-spacing: -.02em;
}
#shipments-panel .panel-summary { align-items: center; }
#shipments-panel .panel-summary span {
    background: #244e61;
    color: #e3f8f4;
    border: 1px solid #497081;
    padding: 4px 9px;
    text-transform: none;
}
#shipments-panel .shipment-list-tools {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px;
    margin: 0;
    padding: 12px 16px;
}
#shipments-panel .shipment-filter-row :is(input,select) { border-radius: 7px; }
#shipments-panel .shipment-filter-row {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(170px, 230px) minmax(180px, 230px) auto;
    align-items: center;
    width: 100%;
}
#shipments-panel .shipment-filter-row > .shipment-search-form {
    min-width: 0;
    width: 100%;
}
#shipments-panel .shipment-search-form input {
    max-width: none;
    min-width: 0;
    width: 100%;
}
#shipments-panel .shipment-filter-row > select {
    max-width: none;
    min-width: 0;
    width: 100%;
}
#shipments-panel .shipment-filter-row > .shipment-search-row {
    margin-left: 8px;
    white-space: nowrap;
}
#shipments-panel .shipment-search-row { color: #52687b; font-size: .8rem; }
#shipments-panel .shipment-table th { background: #edf3f7; color: #40596c; }
#shipments-panel .shipment-table td { vertical-align: middle; }
#shipments-panel .shipment-table tbody tr { background: white; }
#shipments-panel .shipment-table tbody tr:nth-child(even) { background: #f9fbfc; }
#shipments-panel .shipment-table tbody tr.is-selected { background: #e5f5f1; }
#shipments-panel .shipment-status {
    display: inline-block;
    padding: 4px 8px;
    background: #e8f2f7;
    color: #20516a;
    border-radius: 9px;
    line-height: 1.25;
}
#shipments-panel .admin-pagination { margin: 0; padding: 12px 16px; }
#shipments-panel .admin-pagination-navigation { padding: 8px 12px; }
#shipments-panel .shipment-action-menu > summary { border-color: #b9d0de; }

/* Shipment list: balanced columns after moving driver assignment into the details. */
#shipments-panel .shipment-table-wrap {
    overflow-x: auto;
    width: 100%;
}

#shipments-panel .shipment-table {
    min-width: 1200px;
    table-layout: fixed;
    width: 100%;
}

#shipments-panel .shipment-table th,
#shipments-panel .shipment-table td {
    box-sizing: border-box;
    overflow-wrap: anywhere;
    vertical-align: middle;
}

#shipments-panel .shipment-table th { text-align: left; }
#shipments-panel .shipment-table th:first-child,
#shipments-panel .shipment-table td:first-child { text-align: center; width: 38px; }
#shipments-panel .shipment-table th:nth-child(2),
#shipments-panel .shipment-table td:nth-child(2) { width: 16%; }
#shipments-panel .shipment-table th:nth-child(3),
#shipments-panel .shipment-table td:nth-child(3) { width: 12%; }
#shipments-panel .shipment-table th:nth-child(4),
#shipments-panel .shipment-table td:nth-child(4),
#shipments-panel .shipment-table th:nth-child(5),
#shipments-panel .shipment-table td:nth-child(5) { width: 14%; }
#shipments-panel .shipment-table th:nth-child(6),
#shipments-panel .shipment-table td:nth-child(6) { width: 16%; }
#shipments-panel .shipment-table th:nth-child(7),
#shipments-panel .shipment-table td:nth-child(7) { width: 90px; }
#shipments-panel .shipment-table th:nth-child(8),
#shipments-panel .shipment-table td:nth-child(8) { width: 100px; }
#shipments-panel .shipment-table th:nth-child(9),
#shipments-panel .shipment-table td:nth-child(9) { width: 132px; }
#shipments-panel .shipment-table td[data-label] { line-height: 1.45; }
#shipments-panel .shipment-table td:last-child { white-space: nowrap; }

@media (max-width: 950px) {
    #shipments-panel .shipment-table-wrap { overflow: visible; }
    #shipments-panel .shipment-table,
    #shipments-panel .shipment-table :is(thead, tbody, thead tr) { display: block; min-width: 0; }
    #shipments-panel .shipment-table thead th:not(:first-child) {
        position: absolute;
        width: 1px;
        height: 1px;
        clip-path: inset(50%);
        overflow: hidden;
    }
    #shipments-panel .shipment-table thead th:first-child {
        display: flex;
        align-items: center;
        gap: 8px;
        width: auto;
        text-align: left;
    }
    #shipments-panel .shipment-table thead th:first-child::after { content: 'Select all on this page'; }
    #shipments-panel .shipment-table tbody tr {
        position: relative;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
        gap: 4px 12px;
        padding: 14px 12px;
        border-bottom: 1px solid #dbe4ed;
    }
    #shipments-panel .shipment-table tbody td:nth-child(n) {
        min-width: 0;
        width: auto;
        border: 0;
        padding: 6px;
        text-align: left;
    }
    #shipments-panel .shipment-table tbody td:first-child {
        position: absolute;
        top: 14px;
        left: 8px;
        width: auto;
        padding: 6px 0;
    }
    #shipments-panel .shipment-table tbody td:nth-child(2) {
        grid-column: 1 / -1;
        padding-left: 34px;
    }
    #shipments-panel .shipment-table tbody td[data-label]:nth-child(odd) { grid-column: 1; }
    #shipments-panel .shipment-table tbody td[data-label]:nth-child(even) { grid-column: 2; }
    #shipments-panel .shipment-table td[data-label]::before {
        display: block;
        margin-bottom: 3px;
        color: #52687b;
        content: attr(data-label);
        font-size: .72rem;
        font-weight: 750;
    }
    #shipments-panel .shipment-table tbody td:last-child:not([colspan]) { grid-column: 1 / -1; grid-row: auto; }
    #shipments-panel .shipment-table td[colspan] { grid-column: 1 / -1; }
}

/* Final width rules: keep table columns inside the panel and contain action buttons. */
#shipments-panel .shipment-table-wrap { max-width: 100%; overflow-x: auto; }
#shipments-panel .shipment-table { border-collapse: collapse; max-width: 100%; min-width: 0; table-layout: fixed; width: 100%; }
#shipments-panel .shipment-table :is(th, td) { box-sizing: border-box; min-width: 0; overflow-wrap: anywhere; }
#shipments-panel .shipment-table :is(th:first-child, td:first-child) { width: 3%; }
#shipments-panel .shipment-table :is(th:nth-child(2), td:nth-child(2)) { width: 18%; }
#shipments-panel .shipment-table :is(th:nth-child(3), td:nth-child(3)) { width: 11%; }
#shipments-panel .shipment-table :is(th:nth-child(4), td:nth-child(4)) { width: 13%; }
#shipments-panel .shipment-table :is(th:nth-child(5), td:nth-child(5)) { width: 14%; }
#shipments-panel .shipment-table :is(th:nth-child(6), td:nth-child(6)) { width: 16%; }
#shipments-panel .shipment-table :is(th:nth-child(7), td:nth-child(7)) { width: 8%; }
#shipments-panel .shipment-table :is(th:nth-child(8), td:nth-child(8)) { width: 9%; }
#shipments-panel .shipment-table :is(th:nth-child(9), td:nth-child(9)) { width: 8%; }
#shipments-panel .shipment-table td:last-child { padding-left: 5px; padding-right: 5px; white-space: normal; }
#shipments-panel .shipment-actions,
#shipments-panel .shipment-action-menu { box-sizing: border-box; min-width: 0; max-width: 100%; width: 100%; }
#shipments-panel .shipment-action-menu > summary { box-sizing: border-box; font-size: .68rem; gap: 3px; justify-content: center; max-width: 100%; min-width: 0; overflow: hidden; padding: 5px 3px; white-space: nowrap; width: 100%; }

.customer-directory-table-wrap { max-width: 100%; overflow: visible; }
.customer-directory-table { border-collapse: collapse; max-width: 100%; min-width: 0; table-layout: fixed; width: 100%; }
.customer-directory-table :is(th, td) { box-sizing: border-box; min-width: 0; overflow-wrap: anywhere; }
.customer-directory-table :is(th:nth-child(1), td:nth-child(1)) { text-align: center; width: 4%; }
.customer-directory-table :is(th:nth-child(2), td:nth-child(2)) { width: 22%; }
.customer-directory-table :is(th:nth-child(3), td:nth-child(3)) { width: 20%; }
.customer-directory-table :is(th:nth-child(4), td:nth-child(4)) { width: 17%; }
.customer-directory-table :is(th:nth-child(5), td:nth-child(5)) { width: 18%; }
.customer-directory-table :is(th:nth-child(6), td:nth-child(6)) { width: 11%; }
.customer-directory-table :is(th:nth-child(7), td:nth-child(7)) { padding-left: 5px; padding-right: 5px; width: 8%; }
.customer-action-menu,
.customer-directory-table td:last-child details { box-sizing: border-box; min-width: 0; max-width: 100%; width: 100%; }
.customer-action-menu > summary { box-sizing: border-box; font-size: .68rem; gap: 3px; justify-content: center; max-width: 100%; min-width: 0; overflow: hidden; padding: 5px 3px; white-space: nowrap; width: 100%; }
@media (max-width: 1000px) {
    .customer-directory-table-wrap { overflow-x: auto; }
    .customer-directory-table { min-width: 1080px; }
}

/* Keep both management tables inside the workspace and make their action controls compact. */
#shipments-panel .shipment-table-wrap { overflow-x: auto; width: 100%; }
#shipments-panel .shipment-table { min-width: 0; table-layout: fixed; width: 100%; }
#shipments-panel .shipment-table :is(th, td) { box-sizing: border-box; min-width: 0; overflow-wrap: anywhere; }
#shipments-panel .shipment-table :is(th:first-child, td:first-child) { width: 3%; }
#shipments-panel .shipment-table :is(th:nth-child(2), td:nth-child(2)) { width: 18%; }
#shipments-panel .shipment-table :is(th:nth-child(3), td:nth-child(3)) { width: 11%; }
#shipments-panel .shipment-table :is(th:nth-child(4), td:nth-child(4)) { width: 13%; }
#shipments-panel .shipment-table :is(th:nth-child(5), td:nth-child(5)) { width: 14%; }
#shipments-panel .shipment-table :is(th:nth-child(6), td:nth-child(6)) { width: 16%; }
#shipments-panel .shipment-table :is(th:nth-child(7), td:nth-child(7)) { width: 8%; }
#shipments-panel .shipment-table :is(th:nth-child(8), td:nth-child(8)) { width: 9%; }
#shipments-panel .shipment-table :is(th:nth-child(9), td:nth-child(9)) { width: 8%; }
#shipments-panel .shipment-actions,
#shipments-panel .shipment-action-menu { min-width: 0; width: 100%; }
#shipments-panel .shipment-action-menu > summary { box-sizing: border-box; font-size: .74rem; gap: 5px; justify-content: center; min-width: 0; padding: 6px 5px; width: 100%; }
#shipments-panel .shipment-table td:last-child { white-space: normal; }

.customer-directory-table-wrap { overflow: visible; width: 100%; }
.customer-directory-table { min-width: 0; table-layout: fixed; width: 100%; }
.customer-directory-table :is(th, td) { box-sizing: border-box; min-width: 0; overflow-wrap: anywhere; }
.customer-directory-table :is(th:nth-child(1), td:nth-child(1)) { text-align: center; width: 4%; }
.customer-directory-table :is(th:nth-child(2), td:nth-child(2)) { width: 22%; }
.customer-directory-table :is(th:nth-child(3), td:nth-child(3)) { width: 20%; }
.customer-directory-table :is(th:nth-child(4), td:nth-child(4)) { width: 17%; }
.customer-directory-table :is(th:nth-child(5), td:nth-child(5)) { width: 18%; }
.customer-directory-table :is(th:nth-child(6), td:nth-child(6)) { width: 11%; }
.customer-directory-table :is(th:nth-child(7), td:nth-child(7)) { width: 8%; }
.customer-action-menu { min-width: 0; width: 100%; }
.customer-action-menu > summary { box-sizing: border-box; font-size: .76rem; gap: 5px; justify-content: center; min-width: 0; padding: 6px 5px; width: 100%; }
@media (max-width: 1000px) {
    .customer-directory-table-wrap { overflow-x: auto; }
    .customer-directory-table { min-width: 1080px; }
}

@media (max-width: 950px) {
    #shipments-panel .shipment-table thead th:not(:first-child) {
        position: absolute;
        width: 1px;
        height: 1px;
        clip-path: inset(50%);
        overflow: hidden;
    }
    #shipments-panel .shipment-table thead th:first-child { width: auto; display: flex; align-items: center; gap: 8px; }
    #shipments-panel .shipment-table thead th:first-child::after { content: 'Select all on this page'; }
    #shipments-panel .shipment-table,
    #shipments-panel .shipment-table :is(thead,tbody,thead tr) { display: block; }
    #shipments-panel .shipment-table tbody tr {
        display: grid;
        grid-template-columns: auto 1fr 1fr;
        align-items: start;
        padding: 10px;
        border-bottom: 1px solid #dbe4ed;
    }
    #shipments-panel .shipment-table tbody td:nth-child(n) {
        width: auto;
        border: 0;
        padding: 5px;
    }
    #shipments-panel .shipment-table td:nth-child(2),
    #shipments-panel .shipment-table td[data-label]:nth-child(odd) { grid-column: 2; }
    #shipments-panel .shipment-table td[data-label]::before { content: attr(data-label); display: block; color: #52687b; font-size: .72rem; }
    #shipments-panel .shipment-table td:last-child:not([colspan]) { grid-column: 3; grid-row: 1; }
    #shipments-panel .shipment-table td[colspan] { grid-column: 1 / -1; }
}

/* Bulk shipment dialog */
#shipment-bulk-dialog {
    width: min(640px, calc(100% - 24px));
    border: 0;
    border-radius: 16px;
}
#shipment-bulk-form:not([hidden]) {
    padding: 0;
    gap: 0;
    background: white;
}
#shipment-bulk-dialog .shipment-bulk-heading {
    padding: 16px 20px;
    align-items: center;
    background: linear-gradient(110deg, #103553, #174760);
    border-left: 5px solid var(--red);
}
#shipment-bulk-dialog h3 { margin: 0 0 4px; color: white; }
#shipment-bulk-dialog .shipment-bulk-selection { color: #c2eee7; font-weight: 600; }
#shipments-panel #shipment-bulk-dialog .shipment-bulk-close {
    background: #284f67;
    color: white;
    border: 0;
    border-radius: 8px;
    font-size: 1.3rem;
}
#shipment-bulk-dialog .shipment-bulk-action-label {
    margin: 16px 20px 5px;
    color: #334c60;
    font-size: .82rem;
    font-weight: 700;
}
#shipment-bulk-dialog [data-bulk-action] {
    margin: 0 20px 16px;
    width: calc(100% - 40px);
}
#shipment-bulk-dialog .shipment-bulk-fields {
    min-width: 0;
    margin: 0 20px 18px;
    padding: 14px;
    border: 1px solid #dae4ec;
    background: #f4f7fa;
    border-radius: 10px;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
#shipment-bulk-dialog .shipment-bulk-fields label:only-child { grid-column: 1 / -1; }
#shipments-panel #shipment-bulk-dialog :is(input, select) {
    min-width: 0;
    border-radius: 7px;
    font-weight: 500;
}
#shipment-bulk-dialog .shipment-bulk-footer {
    padding: 12px 20px;
    border-top: 1px solid #dce5ed;
    background: #f8fafc;
    position: sticky;
    bottom: 0;
}
#shipments-panel #shipment-bulk-dialog .shipment-bulk-footer button {
    border-radius: 8px;
    padding-inline: 14px;
    background: white;
    border-color: #c7d5e1;
    color: #344e62;
}
#shipments-panel #shipment-bulk-dialog button[type="submit"] {
    background: #153f59;
    border-color: #153f59;
    color: white;
}
#shipment-bulk-dialog :focus-visible { outline: 2px solid #3987cb; outline-offset: 2px; }
@media (max-width: 640px) {
    #shipment-bulk-dialog .shipment-bulk-fields { grid-template-columns: 1fr; }
}

/* Operations dashboard header */
.admin-dashboard-page .operations-header {
    display: flex;
    flex-flow: row wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 20px;
    background: linear-gradient(105deg, #fff 45%, #eff5f8);
    border-bottom: 1px solid #d4e1e9;
}
.operations-header .admin-page-title {
    border-left: 3px solid var(--red);
    padding-left: 12px;
}
.operations-header .admin-page-title h1 {
    color: #103553;
    letter-spacing: -.025em;
    line-height: 1.2;
    margin: 0 0 3px;
}
.operations-header .admin-page-title p { margin: 0; color: #526779; }
.operations-header .admin-profile-menu {
    grid-template-columns: 32px minmax(0, 1fr) auto;
    min-width: 0;
    width: auto;
    max-width: 100%;
    gap: 10px;
    padding: 5px 6px 5px 9px;
    background: white;
    border: 1px solid #d5e2e9;
    border-radius: 12px;
}
.operations-header .admin-profile-menu strong { color: #173b54; overflow-wrap: anywhere; }
.operations-header .admin-profile-menu small { margin-top: 3px; }
.operations-header .admin-profile-menu button {
    padding: 8px 12px;
    color: #173b54;
    background: #edf3f6;
    border-radius: 7px;
    font-weight: 700;
}
.operations-header .admin-profile-menu button:hover { background: #dce9f0; }
.operations-header .admin-profile-menu button:focus-visible { outline: 2px solid #286fa6; outline-offset: 2px; }
@media (max-width: 560px) {
    .operations-header .admin-profile-menu { width: 100%; }
}
.admin-dashboard-page #dashboard-panel.is-active {
    display: grid;
    gap: 20px;
    padding: 22px 28px 36px;
}

#dashboard-panel .admin-hero {
    display: grid !important;
    align-items: stretch;
    gap: 28px;
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    padding: clamp(24px, 4vw, 42px);
    border-radius: 16px;
    background: linear-gradient(120deg, #102b45, #104856 65%, #0d7775);
    box-shadow: 0 18px 40px rgb(18 52 74 / 14%);
}
#dashboard-panel .hero-copy h1 { font-size: clamp(2.4rem, 4vw, 4rem); line-height: 1.04; margin-bottom: 12px; }
#dashboard-panel .hero-copy > span { max-width: 620px; font-size: 1.02rem; line-height: 1.65; }
#dashboard-panel .hero-actions-row { margin-top: 22px; }
#dashboard-panel .hero-console { display: grid; align-content: stretch; gap: 10px; padding: 12px; border-radius: 12px; }
#dashboard-panel .console-metric { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-content: center; border-radius: 9px; background: rgb(8 35 54 / 58%); padding: 13px 16px; }
#dashboard-panel .console-metric span { grid-column: 1; font-size: .7rem; color: #c7e0e9; }
#dashboard-panel .console-metric strong { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-size: 1.8rem; color: white; }
#dashboard-panel .control-center-stats { grid-template-columns: repeat(6, minmax(0, 1fr)) !important; gap: 12px !important; }
#dashboard-panel .stat-card { min-width: 0; min-height: 110px !important; border: 1px solid #dce6ee; border-radius: 12px; padding: 16px !important; box-shadow: 0 8px 24px rgb(20 46 68 / 5%); }
#dashboard-panel .stat-card::before { left: 16px; right: 16px; border-radius: 8px; }
#dashboard-panel .stat-card span { font-size: .68rem; letter-spacing: .04em; }
#dashboard-panel .stat-card strong { font-size: clamp(1.2rem, 2vw, 1.8rem) !important; margin: 10px 0 3px !important; }
#dashboard-panel .stat-card p { font-size: .72rem; }
#dashboard-panel .dashboard-widget-grid { grid-template-columns: minmax(0, 1.25fr) minmax(220px, .8fr) minmax(230px, .9fr); gap: 16px; }
#dashboard-panel .dashboard-widget { border-color: #dce6ee; border-radius: 13px; padding: 18px; box-shadow: 0 8px 25px rgb(20 46 68 / 5%); }
#dashboard-panel .widget-heading { margin-bottom: 16px; }
#dashboard-panel .widget-heading h3 { color: #173b54; font-size: .95rem; }
#dashboard-panel .widget-heading span { color: #718398; }
#dashboard-panel .mini-chart { height: 150px; border-bottom: 1px solid #e4ebf0; background: repeating-linear-gradient(to bottom, transparent 0 36px, #edf2f5 37px); }
#dashboard-panel .mini-chart i { background: linear-gradient(180deg, #3281f6, #21a98e); }
#dashboard-panel .status-donut { background: conic-gradient(#25ae89 0 55%, #337cf0 55% 82%, #f2b648 82% 94%, #e4545c 94% 100%); }
#dashboard-panel .compact-shipment-list p { padding: 12px 0; }
#dashboard-panel .compact-shipment-list strong { color: #1767aa; }
#dashboard-panel .compact-shipment-list span { border-radius: 999px; padding: 4px 8px; background: #e8f4f1; color: #16715f; }
#dashboard-panel > .panel-heading { margin: 0; }
#dashboard-panel > .panel-heading h2 { color: #173b54; font-size: 1.2rem !important; }
@media (max-width: 1120px) {
    #dashboard-panel .control-center-stats { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
    #dashboard-panel .dashboard-widget-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
    .admin-dashboard-page #dashboard-panel { padding: 14px; gap: 14px; }
    #dashboard-panel .admin-hero { grid-template-columns: 1fr; padding: 22px; }
    #dashboard-panel .control-center-stats { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    #dashboard-panel .dashboard-widget-grid { grid-template-columns: 1fr; }
    #dashboard-panel .dashboard-widget.wide-widget { grid-column: auto; }
}

.account-dropdown { position: relative; cursor: pointer; }
.account-dropdown > summary { list-style: none; cursor: pointer; }
.account-dropdown > summary::-webkit-details-marker { display: none; }
.account-dropdown-caret { color: #416077; font-size: 1rem; }
.account-dropdown-menu { position: absolute; right: 0; top: calc(100% + 10px); z-index: 50; display: grid; min-width: 210px; padding: 6px; background: white; border: 1px solid #d7e2e9; border-radius: 10px; box-shadow: 0 14px 32px rgb(17 46 69 / 18%); }
.account-dropdown-menu :is(a, button) { display: block; width: 100%; padding: 10px 12px; text-align: left; text-decoration: none; color: #173b54; background: white; border: 0; border-radius: 7px; font: inherit; cursor: pointer; }
.account-dropdown-menu :is(a, button):hover { background: #eef5f8; }
.account-dropdown-menu form { border-top: 1px solid #e5edf2; margin-top: 5px; padding-top: 5px; }
.account-dropdown {
    display: flex !important;
    align-items: center;
    gap: 10px;
    width: 300px !important;
    min-width: 260px !important;
    max-width: 100%;
    padding: 8px 12px !important;
    background: #fff;
    border: 1px solid #d5e2e9;
    border-radius: 12px;
}
.account-dropdown > img { flex: 0 0 34px; height: 34px; width: 34px; object-fit: contain; }
.account-dropdown > summary { flex: 1 1 auto; min-width: 0; display: block; overflow: hidden; }
.account-dropdown > summary strong,
.account-dropdown > summary small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-dropdown > summary strong { color: #173b54; font-size: .82rem; }
.account-dropdown > summary small { margin-top: 3px; color: #657b8c; }
.account-dropdown-caret { flex: 0 0 auto; }
.account-dropdown-menu { width: 100%; }
@media (max-width: 560px) { .account-dropdown { width: 100% !important; } }
#dashboard-panel .admin-hero {
    align-items: center !important;
    min-height: 0 !important;
}
#dashboard-panel .hero-console {
    align-content: center !important;
    align-self: center !important;
    grid-auto-rows: minmax(72px, auto);
    gap: 9px !important;
    max-height: none;
}
#dashboard-panel .console-metric {
    align-self: center;
    min-height: 72px !important;
    padding: 12px 15px !important;
}
@media (max-width: 720px) {
    #dashboard-panel .hero-console { grid-auto-rows: minmax(64px, auto); }
    #dashboard-panel .console-metric { min-height: 64px !important; }
}
.account-dropdown { position: relative; width: 290px; max-width: 100%; flex: 0 0 290px; }
.account-dropdown-trigger { display: grid; grid-template-columns: 34px minmax(0, 1fr) 18px; align-items: center; gap: 10px; width: 100%; min-width: 0; padding: 8px 11px; text-align: left; cursor: pointer; background: #fff; border: 1px solid #d5e2e9; border-radius: 12px; color: #173b54; }
.account-dropdown-trigger img { width: 34px; height: 34px; object-fit: contain; }
.account-dropdown-trigger > span:nth-child(2) { min-width: 0; }
.account-dropdown-trigger strong, .account-dropdown-trigger small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-dropdown-trigger strong { font-size: .82rem; }
.account-dropdown-trigger small { margin-top: 3px; color: #657b8c; }
.account-dropdown-caret { text-align: center; transition: transform .16s ease; }
.account-dropdown-trigger[aria-expanded="true"] .account-dropdown-caret { transform: rotate(180deg); }
.account-dropdown-menu[hidden] { display: none !important; }
.account-dropdown-menu { position: absolute; z-index: 100; top: calc(100% + 8px); right: 0; display: grid; width: 100%; min-width: 210px; padding: 6px; background: #fff; border: 1px solid #d7e2e9; border-radius: 10px; box-shadow: 0 14px 32px rgb(17 46 69 / 18%); }
@media (max-width: 560px) { .account-dropdown { width: 100%; flex-basis: 100%; } }
#dashboard-panel .admin-hero {
    grid-template-columns: minmax(0, 1fr) minmax(320px, .92fr) !important;
    align-items: center !important;
    min-height: 560px !important;
    padding: 44px 48px !important;
}
#dashboard-panel .hero-copy { max-width: 650px; }
#dashboard-panel .hero-copy h1 { max-width: 600px; }
#dashboard-panel .hero-console {
    display: grid !important;
    align-content: center !important;
    align-self: stretch !important;
    grid-auto-rows: minmax(112px, auto) !important;
    gap: 12px !important;
    padding: 16px !important;
}
#dashboard-panel .console-metric {
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: auto auto auto !important;
    align-content: center !important;
    justify-items: start !important;
    gap: 4px !important;
    min-height: 0 !important;
    padding: 16px 18px !important;
}
#dashboard-panel .console-metric span,
#dashboard-panel .console-metric strong,
#dashboard-panel .console-metric small {
    grid-column: 1 !important;
    grid-row: auto !important;
    align-self: auto !important;
}
#dashboard-panel .console-metric span { font-size: .72rem !important; }
#dashboard-panel .console-metric strong { font-size: 1.75rem !important; line-height: 1.1; }
#dashboard-panel .console-metric small { color: #d4e7ed; font-size: .8rem; font-weight: 600; }
@media (max-width: 900px) {
    #dashboard-panel .admin-hero { grid-template-columns: 1fr !important; min-height: 0 !important; padding: 28px !important; }
    #dashboard-panel .hero-console { grid-auto-rows: minmax(96px, auto) !important; }
}
@media (max-width: 560px) {
    #dashboard-panel .admin-hero { padding: 22px !important; }
    #dashboard-panel .hero-copy h1 { font-size: 2.5rem; }
    #dashboard-panel .hero-console { padding: 10px !important; }
}
#dashboard-panel .admin-hero {
    min-height: 460px !important;
    padding: 34px 40px !important;
    gap: 24px;
}
#dashboard-panel .hero-copy h1 { font-size: clamp(2.25rem, 3.5vw, 3.45rem) !important; }
#dashboard-panel .hero-copy > span { font-size: .96rem; line-height: 1.55; }
#dashboard-panel .hero-console {
    grid-auto-rows: minmax(96px, auto) !important;
    padding: 12px !important;
}
#dashboard-panel .console-metric { padding: 12px 15px !important; }
#dashboard-panel .console-metric strong { font-size: 1.55rem !important; }
@media (max-width: 900px) {
    #dashboard-panel .admin-hero { min-height: 0 !important; padding: 26px !important; }
}
.account-dropdown { position: relative; z-index: 30; width: 290px; flex: 0 0 290px; }
.account-dropdown > .account-dropdown-trigger {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 18px;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 11px;
    cursor: pointer;
    list-style: none;
    color: #173b54;
    background: #fff;
    border: 1px solid #d5e2e9;
    border-radius: 12px;
}
.account-dropdown > .account-dropdown-trigger { font: inherit; }
.account-dropdown-trigger img { width: 34px; height: 34px; object-fit: contain; }
.account-dropdown-trigger > span:nth-child(2) { min-width: 0; }
.account-dropdown-trigger strong, .account-dropdown-trigger small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-dropdown-trigger strong { font-size: .82rem; }
.account-dropdown-trigger small { margin-top: 3px; color: #657b8c; }
.account-dropdown-caret { text-align: center; transition: transform .16s ease; }
.account-dropdown-trigger[aria-expanded="true"] .account-dropdown-caret { transform: rotate(180deg); }
.account-dropdown-menu[hidden] { display: none !important; }
.account-dropdown-menu { z-index: 200; }
.admin-dashboard-page .operations-header { position: relative; z-index: 25; overflow: visible; }
@media (max-width: 560px) { .account-dropdown { width: 100%; flex-basis: 100%; } }

/* Compact account menu: login identifier and profile avatar only. */
.account-dropdown {
    width: 220px !important;
    min-width: 0 !important;
    flex: 0 0 220px;
}
.account-dropdown > .account-dropdown-trigger {
    grid-template-columns: 34px minmax(0, 1fr) 14px;
    gap: 8px;
    padding: 7px 9px;
}
.account-avatar,
.account-avatar svg {
    display: block;
    height: 34px;
    width: 34px;
}
.account-avatar { border-radius: 50%; overflow: hidden; }
.account-dropdown-trigger strong { font-size: .76rem; }
.admin-topbar-site-link {
    align-items: center;
    background: #edf3f6;
    border: 1px solid #d5e2e9;
    border-radius: 9px;
    color: #173b54;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: .82rem;
    font-weight: 800;
    justify-content: center;
    min-height: 40px;
    padding: 0 13px;
    text-decoration: none;
    white-space: nowrap;
}
.admin-topbar-site-link:hover { background: #dce9f0; }
.admin-topbar-site-link:focus-visible { outline: 2px solid #286fa6; outline-offset: 2px; }
.account-page-card {
    width: min(34rem, calc(100% - 2rem));
    margin: clamp(1rem, 6vh, 4rem) auto;
    border: 1px solid #d5e2e9;
    border-radius: 14px;
    background: white;
    overflow: hidden;
    box-shadow: 0 10px 30px rgb(17 46 69 / 9%);
}
.account-page-card > header { padding: 18px 24px; background: linear-gradient(110deg, #11334c, #16575d); color: white; }
.account-page-card header a { color: #d2e9e9; font-size: .85rem; }
.account-page-card h1 { margin: 10px 0 0; font-size: 1.65rem; color: white; }
.account-page-body { padding: 20px 24px; }
.account-page-body dl { margin: 0 0 18px; }
.account-page-body dl > div { display: grid; grid-template-columns: 5em minmax(0, 1fr); align-items: baseline; padding: 12px 0; border-bottom: 1px solid #e0e9ed; }
.account-page-body dt { color: #526879; font-size: .84rem; }
.account-page-body dd { margin: 0; overflow-wrap: anywhere; font-weight: 600; }
.account-password-link { display: inline-block; background: #15585e; color: white; padding: 10px 16px; border-radius: 7px; font-weight: 650; }
.account-page-card a:focus-visible { outline: 3px solid #51acba; outline-offset: 3px; }
.profile-image-form { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; align-items: center; gap: 14px; margin: 0 0 18px; padding: 14px; border: 1px solid #dce7ec; border-radius: 10px; background: #f7fafb; }
.profile-image-preview { display: grid; place-items: center; width: 64px; height: 64px; overflow: hidden; border-radius: 50%; background: #e7f0f5; color: #174760; font-size: 1.6rem; font-weight: 700; }
.profile-image-preview img { width: 100%; height: 100%; object-fit: cover; }
.profile-image-form label { display: grid; gap: 5px; color: #526879; font-size: .84rem; font-weight: 650; }
.profile-image-form input[type="file"] { min-width: 0; font-size: .8rem; }
.profile-image-form small { color: #708396; font-weight: 400; }
.profile-image-form button { border: 0; border-radius: 7px; padding: 10px 13px; background: #15585e; color: white; font-weight: 700; cursor: pointer; }
.account-form-errors { margin-bottom: 12px; color: #b42318; }
.account-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 560px) { .profile-image-form { grid-template-columns: 64px minmax(0, 1fr); } .profile-image-form button { grid-column: 1 / -1; } }
.account-dropdown-menu-heading {
    padding: 7px 12px 3px;
    color: #718597;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}
#account-dropdown-menu {
    padding: 8px;
    border-radius: 13px;
    border-top: 3px solid #218279;
    box-shadow: 0 12px 30px rgb(18 49 69 / 15%);
    max-height: min(70dvh, 32rem);
    overflow-y: auto;
    overscroll-behavior: contain;
}
#account-dropdown-menu .account-dropdown-menu-heading {
    color: #36706d;
    padding: 6px 10px 3px;
    font-size: .65rem;
}
#account-dropdown-menu :is(a, button) {
    padding: 6px 10px;
    font-size: .88rem;
    line-height: 1.35;
    font-weight: 550;
}
#account-dropdown-menu :is(a, button):is(:hover, :focus-visible) {
    background: #eaf5f3;
    color: #125f59;
}
#account-dropdown-menu form button { color: #a43535; }
#account-dropdown-menu form button:is(:hover, :focus-visible) { background: #fff1f0; }
.account-dropdown-divider {
    height: 1px;
    margin: 4px 2px;
    background: #e5ebf0;
}
@media (max-width: 560px) {
    .account-dropdown { width: 100% !important; flex-basis: 100%; }
}

#customer-wallet-overview-modal .wallet-overview-panel {
    max-width: 860px;
    overflow: auto;
    padding: 0;
    width: min(100%, 860px);
}
.wallet-overview-header {
    align-items: flex-start;
    background: #f7fafc;
    border-bottom: 1px solid #dce6ed;
    display: flex;
    justify-content: space-between;
    padding: 10px 28px;
    position: relative;
}
.wallet-overview-header h2 { color: #111d2d; margin: 0; }
.wallet-overview-header .admin-modal-close { position: static; flex: 0 0 42px; }
.wallet-overview-content { display: grid; gap: 18px; padding: 24px 28px 28px; }
.wallet-overview-balance {
    align-items: center;
    background: linear-gradient(115deg, #052433, #00695f);
    border-radius: 16px;
    color: white;
    display: flex;
    gap: 18px;
    justify-content: space-between;
    padding: 24px 28px;
}
.wallet-overview-balance span { color: #bfe9e8; display: block; font-size: .78rem; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.wallet-overview-balance strong { display: block; font-size: clamp(1.8rem, 4vw, 2.5rem); margin-top: 8px; }
.wallet-overview-balance button {
    background: white;
    border: 0;
    border-radius: 10px;
    color: #00665e;
    cursor: pointer;
    flex: 0 0 auto;
    font: inherit;
    font-weight: 850;
    padding: 13px 17px;
}
.wallet-overview-stats { display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.wallet-overview-stats article { background: #f4f7fa; border: 1px solid #e1e8ee; border-radius: 12px; padding: 15px 17px; }
.wallet-overview-stats span { color: #63798d; display: block; font-size: .78rem; font-weight: 750; }
.wallet-overview-stats strong { color: #102b42; display: block; font-size: 1.12rem; margin-top: 5px; }
.wallet-overview-activity { border: 1px solid #e0e8ee; border-radius: 13px; overflow: hidden; }
.wallet-overview-activity-heading { align-items: center; background: #f7fafc; display: flex; justify-content: space-between; padding: 14px 17px; }
.wallet-overview-activity-heading h3 { color: #18374d; font-size: 1rem; margin: 0; }
.wallet-overview-activity-heading a { color: #087f76; font-size: .83rem; font-weight: 800; text-decoration: none; }

.customer-directory-filters {
    align-items: end;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 18px 0;
    padding: 16px;
}
.customer-directory-filters label { color: var(--ink); display: grid; flex: 1 1 150px; font-size: .82rem; font-weight: 800; gap: 6px; }
.customer-directory-filters .customer-directory-search { flex: 2 1 290px; }
.customer-directory-filters input,
.customer-directory-filters select { background: #fff; border: 1px solid #cbd8e4; border-radius: 8px; color: var(--ink); font: inherit; min-height: 42px; padding: 8px 11px; width: 100%; }
.customer-directory-filters > button,
.customer-directory-filters > a { align-items: center; background: #153f59; border: 1px solid #153f59; border-radius: 8px; color: #fff; cursor: pointer; display: inline-flex; font: inherit; font-weight: 800; justify-content: center; min-height: 42px; padding: 8px 14px; text-decoration: none; }
.customer-directory-filters > a { background: #fff; color: #153f59; }
.customer-directory-table-wrap { overflow: visible; }
.customer-directory-table { min-width: 1080px; table-layout: fixed; width: 100%; }
.customer-directory-table th,
.customer-directory-table td { overflow-wrap: normal; vertical-align: middle; }
.customer-directory-table th { vertical-align: middle; }
.customer-directory-table th:nth-child(1), .customer-directory-table td:nth-child(1) { text-align: center; width: 4%; }
.customer-directory-table th:nth-child(2), .customer-directory-table td:nth-child(2) { width: 24%; }
.customer-directory-table th:nth-child(3), .customer-directory-table td:nth-child(3) { width: 18%; }
.customer-directory-table th:nth-child(4), .customer-directory-table td:nth-child(4) { width: 16%; }
.customer-directory-table th:nth-child(5), .customer-directory-table td:nth-child(5) { width: 17%; }
.customer-directory-table th:nth-child(6), .customer-directory-table td:nth-child(6) { width: 10%; }
.customer-directory-table th:nth-child(7), .customer-directory-table td:nth-child(7) { width: 11%; }
.customer-directory-table td:nth-child(2) { overflow-wrap: anywhere; }
.customer-directory-table td:nth-child(3),
.customer-directory-table td:nth-child(4),
.customer-directory-table td:nth-child(5) { overflow-wrap: anywhere; }
.customer-directory-table input[type="checkbox"] { accent-color: #287bff; cursor: pointer; height: 18px; width: 18px; }
.customer-directory-table tr.is-selected { background: #e6f6f1; }
.customer-directory-table td strong,
.customer-directory-table td small { display: block; }
.customer-directory-table td small { color: var(--muted); margin-top: 4px; }
.customer-source-pill { background: #e5f3f1; border-radius: 999px; color: #087f76; display: inline-block; font-size: .76rem; font-weight: 850; padding: 5px 9px; white-space: nowrap; }
.customer-directory-empty { color: var(--muted); padding: 28px !important; text-align: center; }
.customer-action-menu { position: relative; }
.customer-action-menu > summary { align-items: center; background: #f7fafc; border: 1px solid #b9d0de; border-radius: 8px; color: #12547b; cursor: pointer; display: flex; font-weight: 850; gap: 14px; justify-content: space-between; list-style: none; min-width: 105px; padding: 9px 11px; }
.customer-action-menu > summary::-webkit-details-marker { display: none; }
.customer-action-menu-items { background: #fff; border: 1px solid var(--line); border-radius: 9px; box-shadow: 0 12px 28px #102b4228; display: grid; min-width: 145px; padding: 5px; position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; }
.customer-action-menu-items button { background: transparent; border: 0; border-radius: 6px; color: #17364a; cursor: pointer; font: inherit; padding: 9px 10px; text-align: left; width: 100%; }
.customer-action-menu-items button:hover { background: #eff5f8; }
.customer-action-menu-items form { margin: 0; }
.customer-action-menu-items form button { color: #bb302b; }
#drivers-panel .customer-action-menu-items,
#pricing-panel .customer-action-menu-items { top: auto; bottom: calc(100% + 4px); }
#drivers-panel .module-table-scroll,
#pricing-panel .module-table-scroll { overflow: visible; }
#tracking-panel .tracking-list { grid-template-columns: minmax(0, 1fr); }
#tracking-panel .tracking-list .tracking-record-card {
    align-items: center;
    gap: 18px;
    grid-template-columns: minmax(150px, 1fr) minmax(120px, .8fr) minmax(240px, 1.5fr) auto;
    min-height: 82px;
    padding: 13px 18px;
}
#tracking-panel .tracking-record-id,
#tracking-panel .tracking-record-status { display: grid; gap: 5px; min-width: 0; }
#tracking-panel .tracking-record-id > span,
#tracking-panel .tracking-record-status > span,
#tracking-panel .tracking-record-meta p > span { color: #657b8f; font-size: .7rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
#tracking-panel .tracking-record-id > strong,
#tracking-panel .tracking-record-status > strong,
#tracking-panel .tracking-record-meta p > strong { color: #173e52; overflow-wrap: anywhere; }
#tracking-panel .tracking-record-meta { align-items: center; display: flex; gap: 20px; justify-content: space-between; min-width: 0; }
#tracking-panel .tracking-record-meta p { display: grid; gap: 5px; margin: 0; min-width: 0; }
#tracking-panel .tracking-record-card .tracking-detail-link { white-space: nowrap; }
#record-view-modal .customer-view-details { gap: 8px 24px; margin: 0; padding: 18px 24px 24px; }
#customer-view-modal .customer-view-details { gap: 8px 24px; margin: 0; padding: 18px 24px 24px; }
@media (max-width: 1000px) {
    #tracking-panel .tracking-list .tracking-record-card { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    #tracking-panel .tracking-record-meta { grid-column: 1 / -1; justify-content: flex-start; }
    #tracking-panel .tracking-record-card .tracking-detail-link { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
    #tracking-panel .tracking-list .tracking-record-card { grid-template-columns: minmax(0, 1fr); gap: 10px; }
    #tracking-panel .tracking-record-meta { align-items: flex-start; flex-direction: column; gap: 10px; grid-column: auto; }
    #tracking-panel .tracking-record-card .tracking-detail-link { grid-column: auto; }
}
@media (max-width: 1000px) {
    #drivers-panel .module-table-scroll,
    #pricing-panel .module-table-scroll { overflow-x: auto; }
}
.customer-view-details { display: grid; gap: 4px 20px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 22px; }
.customer-view-details p { border-bottom: 1px solid #e1e8ee; margin: 0; padding: 11px 0; }
.customer-view-details strong,
.customer-view-details span { display: block; }
.customer-view-details strong { color: #657b8f; font-size: .78rem; }
.customer-view-details span { color: #17364a; margin-top: 4px; overflow-wrap: anywhere; }
@media (max-width: 640px) { .customer-view-details { grid-template-columns: 1fr; } }
@media (max-width: 1000px) {
    .customer-directory-table-wrap { overflow-x: auto; }
    .customer-directory-table { min-width: 1080px; }
}

.customer-bulk-dialog {
    border: 0;
    border-radius: 16px;
    box-shadow: 0 24px 70px #102b4240;
    margin: auto;
    max-height: min(90vh, 620px);
    padding: 0;
    width: min(560px, calc(100% - 24px));
}
.customer-bulk-dialog::backdrop { background: #102239aa; }
.customer-bulk-form:not([hidden]) { background: #fff; display: grid; gap: 12px; padding: 0 20px 18px; }
.customer-bulk-heading { align-items: center; background: linear-gradient(110deg, #103553, #17615e); color: #fff; display: flex; justify-content: space-between; margin: 0 -20px; padding: 16px 20px; }
.customer-bulk-heading h3 { color: #fff; margin: 0 0 4px; }
.customer-bulk-heading span { color: #c2eee7; font-size: .88rem; }
.customer-bulk-heading button { background: #ffffff20; border: 0; border-radius: 8px; color: #fff; cursor: pointer; font-size: 1.4rem; height: 40px; width: 40px; }
.customer-bulk-form > label { color: var(--ink); font-weight: 800; }
.customer-bulk-form > select { background: #fff; border: 1px solid #cbd8e4; border-radius: 8px; color: var(--ink); min-height: 44px; padding: 8px 11px; width: 100%; }
.customer-bulk-form > p { color: var(--muted); font-size: .9rem; margin: 0; }
.customer-bulk-footer { border-top: 1px solid #dce5ed; display: flex; gap: 10px; justify-content: flex-end; margin: 4px -20px -18px; padding: 14px 20px; }
.customer-bulk-footer button { background: #fff; border: 1px solid #c7d5e1; border-radius: 8px; color: #344e62; cursor: pointer; font: inherit; font-weight: 750; padding: 10px 14px; }
.customer-bulk-footer button[type="submit"] { background: #153f59; border-color: #153f59; color: #fff; }

#customer-wallet-overview-modal .wallet-overview-header .admin-modal-close {
    align-items: center;
    background: #eef2f6;
    border: 1px solid #d7e1e9;
    color: #405b73;
    cursor: pointer;
    display: inline-flex;
    flex: 0 0 42px;
    font-size: 1.35rem;
    height: 42px;
    justify-content: center;
    line-height: 1;
    padding: 0;
    position: static;
    width: 42px;
}
#customer-wallet-overview-modal .wallet-overview-header .admin-modal-close:hover { background: #e2eaf0; color: #17364a; }
.wallet-overview-tabs {
    background: #eff4f8;
    border-radius: 13px;
    display: grid;
    gap: 5px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 5px;
}
.wallet-overview-tabs button,
.wallet-history-tabs button {
    background: transparent;
    border: 0;
    border-radius: 9px;
    color: #61778f;
    cursor: pointer;
    font: inherit;
    font-weight: 850;
    min-height: 48px;
    padding: 10px 14px;
}
.wallet-overview-tabs button[aria-selected="true"],
.wallet-history-tabs button[aria-selected="true"] {
    background: #fff;
    box-shadow: 0 2px 7px #162d4218;
    color: #087f76;
}
.wallet-overview-tab-panel { display: grid; gap: 16px; min-width: 0; }
.wallet-overview-notice { align-items: flex-start; border: 1px solid; border-radius: 13px; display: grid; gap: 6px; padding: 18px; }
.wallet-overview-notice strong { font-size: 1rem; }
.wallet-overview-notice span { line-height: 1.5; }
.wallet-overview-notice-info { background: #effcff; border-color: #9de9f1; color: #15506a; }
.wallet-overview-notice-warning { background: #fff9e9; border-color: #f5d476; color: #78450b; }
.wallet-overview-account { background: #ecfbf4; border: 1px solid #a8f0cd; border-radius: 13px; color: #075b44; display: grid; gap: 7px; padding: 20px; }
.wallet-overview-account > span { font-size: .75rem; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.wallet-overview-account > strong { color: #60778d; }
.wallet-overview-account > b { color: #111d2d; font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: .03em; }
.wallet-overview-account > small { font-size: .9rem; }
.wallet-history-tabs { align-items: center; background: #eff4f8; border-radius: 10px; display: inline-flex; gap: 4px; justify-self: start; padding: 4px; }
.wallet-history-tabs button { min-height: 38px; padding: 8px 13px; }
.wallet-history-tabs button span { background: #e1e8ef; border-radius: 999px; display: inline-block; font-size: .72rem; margin-left: 5px; padding: 2px 6px; }
.wallet-history-list { border: 1px solid #e0e8ee; border-radius: 12px; overflow: hidden; }
.wallet-history-list article { align-items: center; border-bottom: 1px solid #e4ebf0; display: flex; gap: 16px; justify-content: space-between; padding: 14px 16px; }
.wallet-history-list article:last-child { border-bottom: 0; }
.wallet-history-list article div strong,
.wallet-history-list article div span { display: block; }
.wallet-history-list article div span { color: #60778d; font-size: .85rem; margin-top: 4px; }
.wallet-overview-tab-panel[hidden],
.wallet-history-list[hidden] { display: none !important; }
@media (max-width: 640px) {
    .wallet-overview-tabs button { min-height: 42px; padding: 8px 5px; }
    .wallet-history-list article { align-items: flex-start; }
}
.wallet-overview-activity article { align-items: center; border-top: 1px solid #edf1f4; display: flex; gap: 16px; justify-content: space-between; padding: 12px 17px; }
.wallet-overview-activity article div strong,
.wallet-overview-activity article div span { display: block; }
.wallet-overview-activity article div strong { color: #1a3348; font-size: .9rem; }
.wallet-overview-activity article div span { color: #708297; font-size: .78rem; margin-top: 3px; }
.wallet-overview-activity article > strong { color: #143c52; white-space: nowrap; }
.wallet-overview-empty { color: #687d90; margin: 0; padding: 18px; }
@media (max-width: 640px) {
    .wallet-overview-header { padding: 10px 18px; }
    .wallet-overview-content { padding: 18px; }
    .wallet-overview-balance { align-items: flex-start; flex-direction: column; padding: 20px; }
    .wallet-overview-stats { grid-template-columns: 1fr; }
}

/* Closed dialogs must never leave an invisible layer over the application. */
.admin-dashboard-page .admin-modal:not(.is-open) { display: none; }
.admin-dashboard-page dialog:not([open]) { display: none; }

/* Report hub */
.reports-heading {
    align-items: end;
    display: flex;
    gap: 24px;
    justify-content: space-between;
    margin: 0 0 22px;
}
.reports-heading > div > p { color: #e9322b; font-size: .78rem; font-weight: 900; letter-spacing: .08em; margin: 0 0 8px; text-transform: uppercase; }
.reports-heading h2 { color: var(--ink); font-size: clamp(1.6rem, 2.2vw, 2.1rem); margin: 0 0 7px; }
.reports-heading > div > span { color: var(--muted); }
.reports-search { flex: 0 1 320px; }
.reports-search input { background: white; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); min-height: 46px; padding: 0 14px; width: 100%; }
.reports-search input:focus { border-color: #168b80; outline: 3px solid rgba(22, 139, 128, .13); }
.reports-overview { display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 28px; }
.reports-overview article { background: linear-gradient(135deg, #fff, #f8fbfc); border: 1px solid var(--line); border-radius: 12px; display: grid; gap: 5px; min-height: 82px; padding: 16px 18px; }
.reports-overview strong { color: #123c53; font-size: 1.08rem; }
.reports-overview span { color: var(--muted); font-size: .8rem; }
.report-group { margin: 0 0 30px; }
.report-group-heading { align-items: center; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; margin-bottom: 14px; padding-bottom: 10px; }
.report-group-heading h3 { color: #17394f; font-size: 1.1rem; margin: 0; }
.report-group-heading > span { background: #e9f2f5; border-radius: 999px; color: #537084; font-size: .75rem; font-weight: 800; padding: 5px 10px; }
.report-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.report-card-link { align-content: start; background: #fff; border-radius: 12px; box-shadow: 0 5px 18px rgba(17, 42, 58, .035); gap: 9px; min-height: 178px; padding: 18px; }
.report-card-link:hover { border-color: rgba(19, 127, 115, .4); box-shadow: 0 12px 28px rgba(17, 42, 58, .09); }
.report-card-category { color: #087f76 !important; font-size: .68rem !important; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.report-card-link strong { font-size: 1.03rem; }
.report-card-link .report-card-description { min-height: 42px; }
.report-card-link .report-card-action { align-self: end; color: #087f76; font-size: .78rem; font-weight: 850; margin-top: 4px; }
.report-card-action span { font-size: 1.05rem; margin-left: 4px; }
.reports-empty { background: #fff; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); padding: 24px; text-align: center; }
@media (max-width: 1100px) { .report-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) {
    .reports-heading { align-items: stretch; flex-direction: column; gap: 14px; }
    .reports-search { flex-basis: auto; }
    .reports-overview { grid-template-columns: 1fr; }
    .report-grid { grid-template-columns: 1fr; }
    .report-card-link { min-height: 150px; }
}

/* Operational directories and their forms */
.admin-dashboard-page .admin-shell { align-content: start; min-width: 0; }
.operations-module { min-width: 0; }
.operations-module > .panel-heading:first-child {
    background: linear-gradient(105deg, #12334c, #16575d);
    border-radius: 14px;
    color: white;
    padding: clamp(16px, 2vw, 26px);
    gap: 16px;
    flex-wrap: wrap;
}
.operations-module > .panel-heading:first-child h2 { color: white; margin: 0; }
.operations-module > .panel-heading:first-child p { color: #c5e9e5; letter-spacing: .08em; font-size: .68rem; margin: 0 0 5px; }
.operations-module > .panel-heading:first-child .panel-summary { flex-wrap: wrap; gap: 7px; }
.operations-module > .panel-heading:first-child .panel-summary span {
    color: #e4f4f2;
    background: #ffffff18;
    border: 1px solid #ffffff38;
    padding: 5px 9px;
    font-weight: 650;
}
.operations-module .management-grid { gap: 14px; margin-block: 14px; }
.operations-module .management-grid article,
.operations-module .admin-track-form,
.operations-module .admin-create-form,
.module-table-scroll {
    background: white;
    border: 1px solid #d7e3ea;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgb(24 53 72 / 5%);
}
.operations-module .management-grid article { padding: 18px; border-top: 3px solid #43948c; align-content: start; }
.operations-module .management-grid article > span { font-size: .7rem; letter-spacing: .06em; color: #286b68; }
.operations-module .management-grid article p,
.operations-module .management-grid article small { font-size: .86rem; line-height: 1.5; color: #526879; }
.operations-module .management-grid article .table-action-button,
.tracking-detail-link { justify-self: start; width: fit-content; }
.tracking-detail-link { background: transparent; border: 0; color: #166b73; cursor: pointer; font: inherit; font-weight: 650; padding: 0; text-align: left; }
.tracking-modal-content { max-height: min(68vh, 620px); overflow-y: auto; padding: 20px 22px; }
.tracking-modal-message { color: #526879; margin: 0; }
.tracking-modal-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px 20px;
    padding: 14px 16px;
    border-radius: 10px;
    background: #f2f7f8;
}
.tracking-modal-summary > div { min-width: 0; }
.tracking-modal-summary > div:nth-child(3) span {
    width: fit-content;
    max-width: 100%;
    background: #deeeef;
    color: #17585d;
    border-radius: 6px;
    padding: 2px 8px;
    font-weight: 650;
}
.tracking-modal-summary strong,
.tracking-modal-summary span { display: block; overflow-wrap: anywhere; }
.tracking-modal-summary strong { color: #657b8f; font-size: .78rem; }
.tracking-modal-summary span { color: #17364a; margin-top: 4px; }
.tracking-modal-timeline-title { color: #173e52; margin: 20px 0 10px; }
.tracking-modal-timeline { border-left: 2px solid #cde5e1; display: grid; gap: 0; margin-left: 7px; padding-left: 18px; }
.tracking-modal-timeline article { border-bottom: 1px solid #e1e8ee; padding: 10px 0 14px; position: relative; }
.tracking-modal-timeline article::before { background: #168277; border: 3px solid white; border-radius: 50%; content: ""; height: 10px; left: -25px; position: absolute; top: 14px; width: 10px; }
.tracking-modal-timeline time,
.tracking-modal-timeline span { color: #657b8f; font-size: .8rem; }
.tracking-modal-timeline h4 { color: #17364a; margin: 5px 0; }
.tracking-modal-timeline p { color: #526879; margin: 4px 0; }
#tracking-detail-modal .admin-modal-panel > h2 { padding-block: 14px; }
.tracking-modal-timeline article:first-child::before { box-shadow: 0 0 0 2px #91c9c1; }
.tracking-modal-timeline article { overflow-wrap: anywhere; }
@media (max-width: 640px) {
    .tracking-modal-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .tracking-modal-content { padding: 14px; }
}
.operations-module .admin-create-form { padding: 18px; margin-block: 14px; }
.settings-title { grid-column: 1 / -1; margin: 0; color: #173e52; font-size: 1rem; }
.module-table-scroll { overflow-x: auto; margin-block: 16px; }
.operations-module .module-table-scroll table { margin: 0; min-width: 620px; width: 100%; }
.operations-module .module-table th { font-size: .69rem; letter-spacing: .055em; color: #4b6779; background: #eff5f7; }
.operations-module .module-table td { font-size: .87rem; font-variant-numeric: tabular-nums; }
.operations-module .empty-state { padding: 24px 16px; font-size: .9rem; font-weight: 500; text-align: center; }
#payments-panel > .panel-heading:first-child + .management-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
}
.operations-dialog .admin-modal-panel { width: min(100%, 760px); padding: 0; border-radius: 14px; }
.operations-dialog .admin-modal-panel > .section-kicker { display: none; }
.operations-dialog .admin-modal-panel > h2 {
    padding: 20px 62px 20px 22px;
    margin: 0;
    color: white;
    font-size: clamp(1.25rem, 2vw, 1.65rem);
    background: linear-gradient(105deg, #12334c, #16575d);
}
.operations-dialog .admin-modal-close { top: 12px; right: 14px; width: 36px; height: 36px; background: #ffffff20; color: white; }
.operations-dialog .admin-create-form { padding: 20px; gap: 14px; }
:is(.operations-module, .operations-dialog) .admin-create-form label { color: #354f61; font-size: .82rem; font-weight: 650; min-width: 0; }
:is(.operations-module, .operations-dialog) .admin-create-form :is(input:not([type=checkbox]), select, textarea) {
    min-width: 0;
    background: #fbfdfe;
    color: #19384b;
    font-size: .9rem;
    font-weight: 450;
    padding: 9px 11px;
    border: 1px solid #bcced8;
    border-radius: 7px;
}
:is(.operations-module, .operations-dialog) :focus-visible { outline: 3px solid #378bbb; outline-offset: 2px; }
:is(.operations-module, .operations-dialog) .admin-create-form > button[type=submit] {
    justify-self: end;
    width: fit-content;
    padding: 10px 17px;
    background: #146b69;
    color: white;
}
@media (max-width: 680px) {
    .operations-module .panel-summary { justify-content: flex-start; }
    :is(.operations-module, .operations-dialog) .admin-create-form,
    .operations-module .management-grid { grid-template-columns: minmax(0, 1fr); }
    .operations-dialog { padding: 10px; }
    .operations-module .admin-track-form > div { display: grid; grid-template-columns: 1fr; }
}

/* Dashboard sidebar */
.admin-dashboard-page .admin-sidebar {
    gap: 14px;
    scrollbar-width: thin;
    scrollbar-color: #55738e #0a2c49;
    background: linear-gradient(165deg, #113957, #092942 65%);
}
.admin-sidebar .admin-brand {
    margin-bottom: 0;
    padding-bottom: 14px;
    border-bottom: 1px solid #ffffff26;
}
.admin-dashboard-page .admin-sidebar .admin-nav { gap: 4px; }
.admin-dashboard-page .admin-sidebar .admin-nav a {
    gap: 11px;
    border-radius: 8px;
    color: #dae6f1;
}
.admin-sidebar .admin-nav svg {
    width: 18px;
    height: 18px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.admin-dashboard-page .admin-sidebar .admin-nav a span { font-weight: 650; }
.admin-dashboard-page .admin-sidebar .admin-nav a:hover { background: #214962; color: white; }
.admin-dashboard-page .admin-sidebar .admin-nav a.is-active {
    background: #1c5272;
    color: white;
    box-shadow: inset 3px 0 #70dbce;
}
.admin-sidebar a:focus-visible { outline: 2px solid #95eee3; outline-offset: 2px; }
.admin-dashboard-page .admin-sidebar .sidebar-mini { margin: 0; background: #ffffff09; border-color: #ffffff25; }
.sidebar-counts { margin: 0; display: grid; gap: 8px; }
.sidebar-counts div { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.sidebar-counts dt { color: #c6d9e7; font-size: .76rem; }
.sidebar-counts dd { margin: 0; color: white; font-weight: 700; font-variant-numeric: tabular-nums; }
.report-banner { display:flex; align-items:center; justify-content:space-between; gap:1rem; flex-wrap:wrap; padding:clamp(1rem,3vw,2rem); background:linear-gradient(110deg,#11334c,#14595c); border-radius:14px; }
.report-banner h2 { color:white; margin:0; font-size:1.65rem; }
.report-banner input { width:min(100%,19rem); padding:.65rem .9rem; border:1px solid #ccdade; border-radius:8px; background:white; color:#143647; }
.report-switch { display:inline-flex; flex-wrap:wrap; padding:4px; gap:4px; background:#e4edf0; border-radius:10px; margin:1.25rem 0; }
.report-switch button { border:0; background:transparent; color:#354f60; font-weight:650; padding:.5rem .85rem; border-radius:7px; cursor:pointer; }
.report-switch button[aria-pressed=true] { background:#15585e; color:white; }
.report-switch small { margin-left:.3rem; opacity:.9; }
#reports-panel .report-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,22rem),1fr)); gap:.65rem; }
#reports-panel .report-card-link { display:grid; grid-template-columns:minmax(0,1fr) auto; align-content:center; gap:.3rem 1rem; padding:1rem; min-height:0; }
#reports-panel .report-card-description { grid-column:1; min-height:0; }
#reports-panel .report-card-action { grid-column:2; grid-row:1 / 3; align-self:center; margin:0; border-radius:50%; background:#e8f4f1; padding:.3rem .55rem; }
#reports-panel .report-card-action span { margin:0; }
#reports-panel [hidden] { display:none; }

/* Final shipment table layout overrides. */
#shipments-panel .shipment-table-wrap { overflow-x: auto; width: 100%; }
#shipments-panel .shipment-table { min-width: 1200px; table-layout: fixed; width: 100%; }
#shipments-panel .shipment-table :is(th, td) { box-sizing: border-box; overflow-wrap: anywhere; vertical-align: middle; }
#shipments-panel .shipment-table th { text-align: left; }
#shipments-panel .shipment-table :is(th:first-child, td:first-child) { text-align: center; width: 38px; }
#shipments-panel .shipment-table :is(th:nth-child(2), td:nth-child(2)) { width: 16%; }
#shipments-panel .shipment-table :is(th:nth-child(3), td:nth-child(3)) { width: 12%; }
#shipments-panel .shipment-table :is(th:nth-child(4), td:nth-child(4), th:nth-child(5), td:nth-child(5)) { width: 14%; }
#shipments-panel .shipment-table :is(th:nth-child(6), td:nth-child(6)) { width: 16%; }
#shipments-panel .shipment-table :is(th:nth-child(7), td:nth-child(7)) { width: 90px; }
#shipments-panel .shipment-table :is(th:nth-child(8), td:nth-child(8)) { width: 100px; }
#shipments-panel .shipment-table :is(th:nth-child(9), td:nth-child(9)) { width: 132px; }
#shipments-panel .shipment-table td:last-child { white-space: nowrap; }

@media (max-width: 950px) {
    #shipments-panel .shipment-table-wrap { overflow: visible; }
    #shipments-panel .shipment-table,
    #shipments-panel .shipment-table :is(thead, tbody, thead tr) { display: block; min-width: 0; }
    #shipments-panel .shipment-table thead th:not(:first-child) { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
    #shipments-panel .shipment-table thead th:first-child { display: flex; align-items: center; gap: 8px; width: auto; text-align: left; }
    #shipments-panel .shipment-table thead th:first-child::after { content: 'Select all on this page'; }
    #shipments-panel .shipment-table tbody tr {
        position: relative;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
        gap: 4px 12px;
        padding: 14px 12px;
        border-bottom: 1px solid #dbe4ed;
    }
    #shipments-panel .shipment-table tbody td:nth-child(n) { min-width: 0; width: auto; border: 0; padding: 6px; text-align: left; }
    #shipments-panel .shipment-table tbody td:first-child { position: absolute; top: 14px; left: 8px; width: auto; padding: 6px 0; }
    #shipments-panel .shipment-table tbody td:nth-child(2) { grid-column: 1 / -1; padding-left: 34px; }
    #shipments-panel .shipment-table tbody td[data-label]:nth-child(odd) { grid-column: 1; }
    #shipments-panel .shipment-table tbody td[data-label]:nth-child(even) { grid-column: 2; }
    #shipments-panel .shipment-table td[data-label]::before { display: block; margin-bottom: 3px; color: #52687b; content: attr(data-label); font-size: .72rem; font-weight: 750; }
    #shipments-panel .shipment-table tbody td:last-child:not([colspan]) { grid-column: 1 / -1; grid-row: auto; }
    #shipments-panel .shipment-table td[colspan] { grid-column: 1 / -1; }
}

/* Authoritative table sizing overrides (last in file so legacy rules cannot widen the tables). */
#shipments-panel .shipment-table-wrap { max-width: 100%; overflow-x: auto; }
#shipments-panel .shipment-table { border-collapse: collapse; max-width: 100%; min-width: 0; table-layout: fixed; width: 100%; }
#shipments-panel .shipment-table :is(th, td) { box-sizing: border-box; min-width: 0; overflow-wrap: anywhere; }
#shipments-panel .shipment-table :is(th:first-child, td:first-child) { width: 3%; }
#shipments-panel .shipment-table :is(th:nth-child(2), td:nth-child(2)) { width: 18%; }
#shipments-panel .shipment-table :is(th:nth-child(3), td:nth-child(3)) { width: 11%; }
#shipments-panel .shipment-table :is(th:nth-child(4), td:nth-child(4)) { width: 13%; }
#shipments-panel .shipment-table :is(th:nth-child(5), td:nth-child(5)) { width: 14%; }
#shipments-panel .shipment-table :is(th:nth-child(6), td:nth-child(6)) { width: 16%; }
#shipments-panel .shipment-table :is(th:nth-child(7), td:nth-child(7)) { width: 8%; }
#shipments-panel .shipment-table :is(th:nth-child(8), td:nth-child(8)) { width: 9%; }
#shipments-panel .shipment-table :is(th:nth-child(9), td:nth-child(9)) { width: 8%; }
#shipments-panel .shipment-table td:last-child { padding-left: 5px; padding-right: 5px; white-space: normal; }
#shipments-panel .shipment-actions, #shipments-panel .shipment-action-menu { box-sizing: border-box; min-width: 0; max-width: 100%; width: 100%; }
#shipments-panel .shipment-action-menu > summary { box-sizing: border-box; font-size: .68rem; gap: 3px; justify-content: center; max-width: 100%; min-width: 0; overflow: hidden; padding: 5px 3px; white-space: nowrap; width: 100%; }
.customer-directory-table-wrap { max-width: 100%; overflow: visible; }
.customer-directory-table { border-collapse: collapse; max-width: 100%; min-width: 0; table-layout: fixed; width: 100%; }
.customer-directory-table :is(th, td) { box-sizing: border-box; min-width: 0; overflow-wrap: anywhere; }
.customer-directory-table :is(th:nth-child(1), td:nth-child(1)) { text-align: center; width: 4%; }
.customer-directory-table :is(th:nth-child(2), td:nth-child(2)) { width: 22%; }
.customer-directory-table :is(th:nth-child(3), td:nth-child(3)) { width: 20%; }
.customer-directory-table :is(th:nth-child(4), td:nth-child(4)) { width: 17%; }
.customer-directory-table :is(th:nth-child(5), td:nth-child(5)) { width: 18%; }
.customer-directory-table :is(th:nth-child(6), td:nth-child(6)) { width: 11%; }
.customer-directory-table :is(th:nth-child(7), td:nth-child(7)) { padding-left: 5px; padding-right: 5px; width: 8%; }
.customer-action-menu, .customer-directory-table td:last-child details { box-sizing: border-box; min-width: 0; max-width: 100%; width: 100%; }
.customer-action-menu > summary { box-sizing: border-box; font-size: .68rem; gap: 3px; justify-content: center; max-width: 100%; min-width: 0; overflow: hidden; padding: 5px 3px; white-space: nowrap; width: 100%; }
@media (max-width: 1000px) { .customer-directory-table-wrap { overflow-x: auto; } .customer-directory-table { min-width: 1080px; } }
