:root {
    color-scheme: light;
    --bg: #eef2f5;
    --panel: #ffffff;
    --ink: #172033;
    --muted: #657287;
    --line: #d9dee8;
    --brand: #14532d;
    --brand-dark: #0f3d22;
    --accent: #b45309;
    --danger: #b91c1c;
    --sidebar: #101826;
    --sidebar-muted: #9aa7b8;
    --sidebar-line: rgba(255, 255, 255, 0.1);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.5;
}

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

a:hover {
    text-decoration: underline;
}

.auth-shell,
.app-shell {
    min-height: 100vh;
}

.app-shell {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
}

.auth-shell {
    display: grid;
    place-items: center;
    padding: 24px;
}

.auth-card,
.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(23, 32, 51, 0.06);
}

.auth-card {
    width: min(420px, 100%);
    padding: 28px;
}

.auth-card:has(.policy-scroll) {
    width: min(760px, 100%);
}

.auth-support-line {
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 14px;
    margin: 22px 0 0;
    padding-top: 16px;
}

.policy-scroll {
    border: 1px solid var(--line);
    border-radius: 8px;
    max-height: 420px;
    margin: 18px 0;
    overflow: auto;
    padding: 16px;
}

.policy-scroll h2 {
    font-size: 18px;
    margin: 18px 0 8px;
}

.policy-scroll h2:first-child {
    margin-top: 0;
}

.policy-scroll p {
    color: var(--muted);
    line-height: 1.6;
}

.policy-text {
    color: var(--muted);
    line-height: 1.7;
    white-space: pre-wrap;
}

.checkbox-line {
    align-items: flex-start;
    display: flex;
    gap: 10px;
}

.checkbox-line input {
    margin-top: 4px;
    min-height: auto;
    width: auto;
}

.checkbox-field label {
    align-items: flex-start;
    display: flex;
    gap: 10px;
}

.checkbox-field input {
    margin-top: 4px;
    min-height: auto;
    width: auto;
}

.app-footer {
    align-items: center;
    border-top: 1px solid var(--line);
    color: var(--muted);
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 40px;
    padding: 22px;
}

.app-footer a {
    color: var(--muted);
    font-weight: 700;
}

.sidebar {
    background: var(--sidebar);
    color: #ffffff;
    min-height: 100vh;
    padding: 22px 16px;
    position: sticky;
    top: 0;
}

.main-area {
    min-width: 0;
}

.topbar {
    align-items: center;
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 16px;
    justify-content: space-between;
    min-height: 72px;
    padding: 14px clamp(18px, 3vw, 36px);
    position: sticky;
    top: 0;
    z-index: 20;
}

.topbar-label {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    margin: 0 0 2px;
    text-transform: uppercase;
}

.brand {
    align-items: center;
    border-bottom: 1px solid var(--sidebar-line);
    color: #ffffff;
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    padding: 0 4px 18px;
}

.brand:hover {
    text-decoration: none;
}

.brand-mark {
    align-items: center;
    background: linear-gradient(135deg, #1d4ed8, #14532d);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    display: inline-flex;
    height: 42px;
    justify-content: center;
    width: 42px;
}

.brand strong {
    display: block;
    font-size: 18px;
    font-weight: 700;
}

.brand small {
    color: var(--sidebar-muted);
    display: block;
    font-size: 12px;
    margin-top: 1px;
}

.side-nav {
    display: grid;
    gap: 5px;
}

.side-nav p {
    color: var(--sidebar-muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
    margin: 18px 10px 6px;
    text-transform: uppercase;
}

.side-nav a {
    border-radius: 8px;
    color: #dbe4ef;
    display: block;
    font-weight: 700;
    padding: 10px 12px;
}

.side-nav a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    text-decoration: none;
}

.side-nav a.active {
    background: #ffffff;
    color: var(--sidebar);
}

.top-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.top-actions a,
.top-actions button,
.button {
    align-items: center;
    background: #eef2f0;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--ink);
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    min-height: 38px;
    padding: 8px 12px;
}

.top-actions a:hover,
.top-actions button:hover,
.button:hover {
    text-decoration: none;
}

.button.primary {
    background: var(--brand);
    color: #ffffff;
}

.button.danger {
    background: var(--danger);
    color: #ffffff;
}

.content {
    margin: 0 auto;
    max-width: 1440px;
    padding: 28px clamp(18px, 3vw, 36px) 48px;
}

.content > h1:first-child {
    font-size: clamp(30px, 3vw, 44px);
    line-height: 1.05;
    margin-bottom: 6px;
}

.content > h1:first-child + .muted {
    font-size: 17px;
    margin-top: 0;
    max-width: 780px;
}

.grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
}

.panel {
    padding: 20px;
}

.support-access-panel {
    align-items: center;
    background: linear-gradient(135deg, #0f172a, #123d5c);
    border: 1px solid rgba(148, 163, 184, 0.38);
    border-radius: 10px;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.16);
    color: #ffffff;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: space-between;
    margin: 0 0 20px;
    padding: 16px 18px;
}

.support-access-panel strong {
    display: block;
    font-size: 18px;
    margin-bottom: 4px;
}

.support-access-panel span {
    color: #dbeafe;
}

.support-access-label {
    color: #93c5fd;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    margin: 0 0 4px;
    text-transform: uppercase;
}

.support-access-code-wrap {
    align-items: flex-end;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.support-access-code-wrap code {
    background: #ffffff;
    border-radius: 8px;
    color: #0f172a;
    font-size: 28px;
    font-weight: 900;
    letter-spacing: 0.18em;
    line-height: 1;
    padding: 10px 14px;
}

.panel h2,
.panel h3 {
    margin-top: 0;
}

.add-user-callout {
    align-items: center;
    display: flex;
    gap: 18px;
    justify-content: space-between;
    margin-bottom: 18px;
}

.add-user-callout h2 {
    margin-bottom: 6px;
}

.panel a:not(.button) {
    font-weight: 700;
}

.muted {
    color: var(--muted);
}

.form-field {
    display: grid;
    gap: 6px;
    margin-bottom: 16px;
}

label {
    font-weight: 700;
}

input,
select,
textarea {
    border: 1px solid var(--line);
    border-radius: 6px;
    font: inherit;
    min-height: 42px;
    padding: 9px 11px;
    width: 100%;
}

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

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 10px;
    text-align: left;
}

.map-canvas {
    background: #eef5f0;
    border: 1px solid var(--line);
    border-radius: 8px;
    min-height: 360px;
    overflow: hidden;
    position: relative;
}

.leaflet-map,
.live-map {
    min-height: 440px;
}

.leaflet-container {
    font: inherit;
}

.pf-marker {
    background: transparent;
    border: 0;
}

.pf-marker span {
    background: var(--accent);
    border: 3px solid #ffffff;
    border-radius: 999px;
    box-shadow: 0 4px 12px rgba(23, 32, 51, 0.28);
    display: block;
    height: 24px;
    width: 24px;
}

.pf-marker-officer span {
    background: var(--brand);
    height: 26px;
    width: 26px;
}

.pf-marker-dispatch span {
    background: var(--danger);
    border-radius: 4px;
}

.pf-marker-property span {
    background: #2563eb;
}

.pf-marker-officer-stale span {
    background: #6b7280;
}

.map-marker {
    background: var(--accent);
    border: 3px solid #ffffff;
    border-radius: 999px;
    box-shadow: 0 4px 12px rgba(23, 32, 51, 0.28);
    display: block;
    height: 22px;
    position: absolute;
    transform: translate(-50%, -50%);
    width: 22px;
}

.map-marker.officer {
    background: var(--brand);
    height: 26px;
    width: 26px;
}

.map-marker.dispatch {
    background: var(--danger);
    border-radius: 4px;
}

.map-marker.property {
    background: #2563eb;
}

.map-marker.stale {
    background: #6b7280;
}

.map-empty {
    left: 18px;
    position: absolute;
    top: 18px;
    z-index: 500;
}

.map-picker-panel {
    margin: 18px 0;
}

.map-picker-header {
    align-items: center;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 12px;
}

.map-picker-header h2 {
    margin-bottom: 4px;
}

.property-location-picker {
    min-height: 380px;
}

.compact-record,
.stacked-action {
    border-bottom: 1px solid var(--line);
    padding: 10px 0;
}

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

.inline-form select {
    min-width: 140px;
    width: auto;
}

.compact-record:last-child,
.stacked-action:last-child {
    border-bottom: 0;
}

.map-label {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 6px;
    left: 50%;
    padding: 8px 10px;
    position: absolute;
    top: calc(50% + 18px);
    transform: translateX(-50%);
}

.error {
    color: var(--danger);
    font-size: 14px;
}

.error-box {
    background: #fff1f2;
    border: 1px solid #fecdd3;
    border-radius: 6px;
    color: var(--danger);
    margin-bottom: 16px;
    padding: 10px 12px;
}

.status {
    background: #ecfdf3;
    border: 1px solid #b7e4c7;
    border-radius: 6px;
    margin-bottom: 16px;
    padding: 10px 12px;
}

.dispatch-alert {
    align-items: center;
    background: #fff7ed;
    border: 1px solid #fdba74;
    border-left: 6px solid #ea580c;
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(234, 88, 12, 0.14);
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 18px;
    padding: 16px 18px;
}

.dispatch-alert-active {
    animation: dispatchPulse 1s ease-in-out infinite;
}

.dispatch-alert-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.dispatch-alert[hidden] {
    display: none;
}

.dispatch-alert strong {
    color: #9a3412;
    font-size: 18px;
}

.dispatch-alert p {
    margin: 4px 0 0;
}

.panel-heading-row {
    align-items: start;
    display: flex;
    gap: 14px;
    justify-content: space-between;
}

.dispatch-call-record {
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-bottom: 10px;
    padding: 14px;
}

.dispatch-nearest {
    background: #f8fafc;
    box-shadow: none;
    margin: 16px 0;
}

.nearest-officer {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-bottom: 10px;
    padding: 12px 14px;
}

.nearest-officer-best {
    border-color: #86efac;
    border-left: 5px solid var(--brand);
}

.refresh-control {
    align-items: center;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 18px;
}

.refresh-control h2 {
    margin-bottom: 4px;
}

.retention-offer-panel {
    border-color: #86efac;
}

.retention-offer-copy {
    font-size: 20px;
    line-height: 1.6;
    max-width: 980px;
}

.retention-offer-copy strong {
    color: var(--brand);
}

.retention-choice-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.retention-choice {
    display: flex;
    flex-direction: column;
}

.retention-choice p {
    color: var(--muted);
}

.retention-button {
    font-size: 16px;
    font-weight: 700;
    justify-content: center;
    margin-top: auto;
    min-height: 52px;
    width: 100%;
}

@keyframes dispatchPulse {
    0%, 100% {
        box-shadow: 0 12px 32px rgba(234, 88, 12, 0.14);
    }

    50% {
        box-shadow: 0 12px 42px rgba(185, 28, 28, 0.42);
    }
}

@media (max-width: 1040px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        min-height: auto;
        padding: 16px;
        position: static;
    }

    .brand {
        margin-bottom: 12px;
        padding-bottom: 12px;
    }

    .side-nav {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .side-nav p {
        display: none;
    }

    .side-nav a {
        flex: 0 0 auto;
        white-space: nowrap;
    }
}

@media (max-width: 720px) {
    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .top-actions {
        width: 100%;
    }

    .content {
        padding-top: 20px;
    }

    .map-picker-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .dispatch-alert,
    .panel-heading-row,
    .refresh-control {
        align-items: flex-start;
        flex-direction: column;
    }

    .dispatch-alert-active {
        align-items: stretch;
        background: #7f1d1d;
        border: 0;
        border-radius: 0;
        color: #ffffff;
        inset: 0;
        justify-content: center;
        margin: 0;
        padding: 28px;
        position: fixed;
        text-align: center;
        z-index: 9999;
    }

    .dispatch-alert-active strong {
        color: #ffffff;
        display: block;
        font-size: clamp(34px, 11vw, 58px);
        line-height: 1;
        text-transform: uppercase;
    }

    .dispatch-alert-active p {
        font-size: 20px;
        margin: 18px auto 0;
        max-width: 520px;
    }

    .dispatch-alert-active .dispatch-alert-actions {
        display: grid;
        gap: 12px;
        margin-top: 28px;
    }

    .dispatch-alert-active .button {
        font-size: 20px;
        min-height: 58px;
        width: 100%;
    }
}

/* Patrol Forge console makeover */
:root {
    --bg: #f4f7fb;
    --panel: #ffffff;
    --ink: #111827;
    --muted: #64748b;
    --line: #d8e0eb;
    --brand: #0f6b4a;
    --brand-dark: #0a4934;
    --brand-soft: #e9f8f1;
    --accent: #0f75bc;
    --warning: #b45309;
    --danger: #b42318;
    --sidebar: #0b1220;
    --sidebar-2: #111c2f;
    --sidebar-muted: #9fb0c8;
    --sidebar-line: rgba(255, 255, 255, 0.09);
    --shadow-sm: 0 8px 22px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 18px 48px rgba(15, 23, 42, 0.10);
}

body {
    background:
        radial-gradient(circle at top left, rgba(15, 117, 188, 0.10), transparent 34rem),
        linear-gradient(180deg, #f8fbff 0%, var(--bg) 42%, #eef3f8 100%);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

.app-shell {
    grid-template-columns: 292px minmax(0, 1fr);
}

.sidebar {
    background:
        linear-gradient(180deg, rgba(15, 117, 188, 0.18), transparent 19rem),
        linear-gradient(180deg, var(--sidebar) 0%, var(--sidebar-2) 100%);
    border-right: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 12px 0 34px rgba(15, 23, 42, 0.10);
    overflow-y: auto;
    padding: 22px 14px;
}

.brand {
    border-bottom: 1px solid var(--sidebar-line);
    margin-bottom: 18px;
    padding: 0 8px 18px;
}

.brand-mark {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
    flex: 0 0 auto;
    height: 54px;
    overflow: hidden;
    width: 54px;
}

.brand-mark img {
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.brand-mark-fallback::before {
    content: "PF";
    align-items: center;
    background: linear-gradient(135deg, #0f75bc, #0f6b4a);
    color: #ffffff;
    display: flex;
    font-weight: 900;
    height: 100%;
    justify-content: center;
    width: 100%;
}

.brand strong {
    font-size: 18px;
    letter-spacing: 0;
}

.brand small {
    color: #b8c5d8;
    font-weight: 700;
}

.side-nav {
    gap: 4px;
}

.side-nav p {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    color: #8fa3bd;
    font-size: 11px;
    margin: 20px 12px 8px;
    padding-top: 14px;
}

.side-nav p:first-child {
    border-top: 0;
    margin-top: 0;
    padding-top: 0;
}

.side-nav a {
    align-items: center;
    border: 1px solid transparent;
    border-radius: 8px;
    color: #dce6f4;
    display: flex;
    font-size: 14px;
    gap: 10px;
    min-height: 40px;
    padding: 9px 12px;
    transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.side-nav a:hover {
    background: rgba(255, 255, 255, 0.075);
    border-color: rgba(255, 255, 255, 0.10);
    transform: translateX(2px);
}

.side-nav a.active {
    background: linear-gradient(135deg, #ffffff, #eaf6ff);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.14);
    color: #0b1220;
}

.main-area {
    background: transparent;
}

.topbar {
    backdrop-filter: blur(14px);
    background: rgba(255, 255, 255, 0.84);
    border-bottom: 1px solid rgba(216, 224, 235, 0.92);
    min-height: 78px;
    padding: 14px clamp(18px, 3vw, 38px);
}

.topbar-identity {
    min-width: 0;
}

.topbar-title-row {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.topbar-title-row strong {
    font-size: 18px;
}

.role-pill {
    background: var(--brand-soft);
    border: 1px solid #bdebd2;
    border-radius: 999px;
    color: var(--brand-dark);
    font-size: 12px;
    font-weight: 800;
    padding: 4px 9px;
    text-transform: capitalize;
}

.top-actions a,
.top-actions button,
.button {
    border: 1px solid #cfd8e5;
    border-radius: 8px;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
    font-weight: 800;
    justify-content: center;
    transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.top-actions a:hover,
.top-actions button:hover,
.button:hover {
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.button.primary {
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    border-color: transparent;
}

.button.danger {
    background: linear-gradient(135deg, #dc2626, var(--danger));
    border-color: transparent;
}

.content {
    max-width: 1540px;
    padding: 30px clamp(18px, 3vw, 42px) 54px;
}

.content-shell > h1:first-child,
.content > h1:first-child {
    color: #0f172a;
    font-size: clamp(28px, 2.35vw, 40px);
    letter-spacing: 0;
    line-height: 1.08;
    margin: 0 0 8px;
}

.content-shell > h1:first-child + .muted,
.content > h1:first-child + .muted {
    font-size: 16px;
    margin-bottom: 22px;
}

.grid {
    gap: 20px;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
}

.panel,
.auth-card {
    border: 1px solid rgba(203, 213, 225, 0.95);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.panel {
    padding: 22px;
    position: relative;
}

.panel::before {
    background: linear-gradient(90deg, rgba(15, 107, 74, 0.75), rgba(15, 117, 188, 0.70));
    border-radius: 8px 8px 0 0;
    content: "";
    height: 3px;
    inset: -1px -1px auto -1px;
    opacity: 0;
    position: absolute;
    transition: opacity 0.16s ease;
}

.panel:hover::before {
    opacity: 1;
}

.panel h2,
.panel h3 {
    color: #172033;
    letter-spacing: 0;
    line-height: 1.18;
}

.panel h2 {
    font-size: 20px;
}

.panel h3 {
    font-size: 17px;
}

.panel p:last-child,
.panel form:last-child,
.panel table:last-child {
    margin-bottom: 0;
}

.panel a:not(.button) {
    color: #0f6b4a;
    font-weight: 850;
}

.status,
.error-box {
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    font-weight: 700;
}

.status {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #065f46;
}

.error-box {
    background: #fff1f2;
    border-color: #fecdd3;
}

input,
select,
textarea {
    background: #ffffff;
    border-color: #cbd5e1;
    border-radius: 8px;
    color: var(--ink);
    min-height: 44px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #0f75bc;
    box-shadow: 0 0 0 3px rgba(15, 117, 188, 0.14);
    outline: none;
}

label {
    color: #223047;
    font-size: 13px;
}

table {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
}

th {
    background: #f1f5f9;
    color: #334155;
    font-size: 12px;
    text-transform: uppercase;
}

th,
td {
    border-bottom: 1px solid #e2e8f0;
    padding: 12px 14px;
}

tr:last-child td {
    border-bottom: 0;
}

.map-canvas,
.leaflet-map,
.live-map,
.property-location-picker {
    border-radius: 8px;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.05);
}

.dispatch-alert,
.dispatch-call-record,
.nearest-officer,
.map-label,
.policy-scroll {
    border-radius: 8px;
}

.add-user-callout,
.refresh-control,
.panel-heading-row {
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(203, 213, 225, 0.82);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    padding: 16px;
}

.inline-form {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px;
}

.app-footer {
    background: rgba(255, 255, 255, 0.72);
}

@media (max-width: 1040px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        border-right: 0;
        box-shadow: none;
    }

    .brand-mark {
        height: 48px;
        width: 48px;
    }

    .side-nav a:hover {
        transform: none;
    }
}

@media (max-width: 720px) {
    .content {
        padding: 18px 14px 36px;
    }

    .panel {
        padding: 18px;
    }

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

    .topbar {
        gap: 12px;
        min-height: auto;
    }

    .top-actions a,
    .top-actions button {
        flex: 1 1 auto;
    }

    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

/* Patrol Forge dashboard hero */
.console-hero {
    align-items: center;
    background:
        linear-gradient(135deg, rgba(11, 18, 32, 0.94), rgba(15, 107, 74, 0.88)),
        radial-gradient(circle at 92% 16%, rgba(15, 117, 188, 0.55), transparent 22rem);
    border: 1px solid rgba(15, 23, 42, 0.10);
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    color: #ffffff;
    display: flex;
    gap: 22px;
    justify-content: space-between;
    margin-bottom: 24px;
    min-height: 178px;
    overflow: hidden;
    padding: clamp(22px, 3vw, 34px);
    position: relative;
}

.console-hero::after {
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.16), transparent);
    content: "";
    height: 100%;
    position: absolute;
    right: 22%;
    top: 0;
    transform: skewX(-18deg);
    width: 70px;
}

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

.console-hero h1 {
    color: #ffffff;
    font-size: clamp(30px, 3vw, 48px);
    line-height: 1.02;
    margin: 0 0 10px;
}

.console-hero p {
    color: #dbeafe;
    font-size: 16px;
    margin: 0;
    max-width: 760px;
}

.eyebrow {
    color: #8be4bd !important;
    font-size: 12px !important;
    font-weight: 900;
    letter-spacing: 0;
    margin-bottom: 9px !important;
    text-transform: uppercase;
}

.hero-actions {
    align-items: stretch;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    min-width: min(330px, 100%);
}

.hero-actions .button {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.24);
    color: #ffffff;
    min-height: 44px;
}

.hero-actions .button.primary {
    background: #ffffff;
    color: #0b1220;
}

.action-grid .panel,
.metric-grid .panel {
    min-height: 172px;
}

.metric-grid .panel > p:not(.muted),
.action-grid .panel > p:not(.muted) {
    color: #0f172a;
    font-size: 28px;
    font-weight: 900;
    letter-spacing: 0;
    margin: 8px 0;
}

.metric-grid .panel h2,
.action-grid .panel h2 {
    align-items: center;
    display: flex;
    gap: 10px;
}

.metric-grid .panel h2::before,
.action-grid .panel h2::before {
    background: linear-gradient(135deg, var(--brand), var(--accent));
    border-radius: 999px;
    content: "";
    flex: 0 0 auto;
    height: 10px;
    width: 10px;
}

.admin-dashboard-hero {
    margin-bottom: 20px;
}

.dashboard-section {
    display: grid;
    gap: 16px;
    margin-top: 28px;
}

.dashboard-section-heading {
    align-items: flex-end;
    display: flex;
    gap: 16px;
    justify-content: space-between;
}

.dashboard-section-heading h2 {
    color: #0f172a;
    font-size: clamp(22px, 2vw, 30px);
    letter-spacing: 0;
    line-height: 1.1;
    margin: 0;
}

.dashboard-section-heading .eyebrow {
    margin-bottom: 6px !important;
}

.dashboard-section-heading > span {
    background: #e8f7ef;
    border: 1px solid #b7e4ca;
    border-radius: 999px;
    color: #0f6b4a;
    flex: 0 0 auto;
    font-size: 12px;
    font-weight: 900;
    padding: 7px 11px;
    text-transform: uppercase;
}

.dashboard-card-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
}

.dashboard-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 190px;
}

.dashboard-card-featured {
    background: linear-gradient(135deg, #ffffff, #f0fdf4);
    border-color: rgba(20, 83, 45, 0.26);
}

.dashboard-card.is-muted {
    background: #f8fafc;
}

.dashboard-card-kicker {
    color: #0f6b4a;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0;
    margin: 0;
    text-transform: uppercase;
}

.dashboard-card h3 {
    margin: 0;
}

.dashboard-card > .muted {
    margin: 0;
}

.dashboard-card-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 9px 14px;
    margin-top: auto;
}

.dashboard-card-actions a:not(.button) {
    display: inline-flex;
}

.dashboard-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.dashboard-metrics span {
    background: #f8fafc;
    border: 1px solid rgba(203, 213, 225, 0.9);
    border-radius: 8px;
    color: #475569;
    font-size: 13px;
    font-weight: 800;
    padding: 8px 10px;
}

.dashboard-metrics strong {
    color: #0f172a;
}

.client-hero {
    background:
        linear-gradient(135deg, rgba(15, 32, 56, 0.94), rgba(15, 117, 188, 0.84)),
        radial-gradient(circle at 88% 20%, rgba(15, 107, 74, 0.55), transparent 22rem);
}

@media (max-width: 820px) {
    .console-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .hero-actions {
        justify-content: flex-start;
        min-width: 0;
        width: 100%;
    }

    .hero-actions .button {
        flex: 1 1 160px;
    }

    .dashboard-section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .dashboard-section-heading > span {
        white-space: normal;
    }
}
