:root {
    --bg: #eef3f7;
    --bg-accent: #dbe7ef;
    --surface: rgba(255, 255, 255, 0.94);
    --surface-strong: #ffffff;
    --surface-soft: #f5f8fb;
    --sidebar: #13323f;
    --sidebar-soft: #1d4555;
    --text: #162532;
    --muted: #617281;
    --muted-strong: #40515f;
    --line: rgba(22, 37, 50, 0.12);
    --line-strong: rgba(22, 37, 50, 0.18);
    --accent: #0f766e;
    --accent-strong: #0b5c56;
    --accent-soft: rgba(15, 118, 110, 0.12);
    --info-soft: rgba(14, 116, 144, 0.12);
    --warning-soft: rgba(180, 83, 9, 0.12);
    --danger: #b42318;
    --danger-soft: rgba(180, 35, 24, 0.12);
    --success: #13795b;
    --success-soft: rgba(19, 121, 91, 0.12);
    --shadow-lg: 0 24px 48px rgba(16, 38, 51, 0.12);
    --shadow-md: 0 14px 32px rgba(16, 38, 51, 0.08);
    --radius-xl: 28px;
    --radius-lg: 22px;
    --radius-md: 16px;
    --radius-sm: 12px;
}

* {
    box-sizing: border-box;
}

html {
    color-scheme: light;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    font-family: "IBM Plex Sans", "Avenir Next", "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(15, 118, 110, 0.1), transparent 30%),
        radial-gradient(circle at top right, rgba(14, 116, 144, 0.08), transparent 28%),
        linear-gradient(180deg, #f9fbfc 0%, var(--bg) 100%);
}

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

img,
video {
    display: block;
    max-width: 100%;
}

h1,
h2,
h3 {
    margin: 0;
    line-height: 1.15;
}

p {
    margin: 0;
    line-height: 1.6;
}

.auth-layout {
    display: flex;
    flex-direction: column;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    padding: 1rem 1.5rem;
    background: rgba(248, 251, 253, 0.88);
    border-bottom: 1px solid rgba(22, 37, 50, 0.08);
    backdrop-filter: blur(18px);
}

.topbar-brand,
.topbar-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    gap: 0.9rem;
}

.brand-mark__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 18px;
    background: linear-gradient(135deg, #0f766e, #0d5d78);
    color: #fff;
    font-weight: 700;
    letter-spacing: 0.08em;
    box-shadow: var(--shadow-md);
}

.brand-copy {
    display: grid;
    gap: 0.15rem;
}

.brand-copy strong {
    font-size: 1rem;
    letter-spacing: -0.02em;
}

.brand-copy span {
    color: var(--muted);
    font-size: 0.92rem;
}

.identity-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.65rem 0.85rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(22, 37, 50, 0.09);
}

.identity-card strong {
    display: block;
    font-size: 0.95rem;
}

.app-shell {
    display: grid;
    grid-template-columns: 290px minmax(0, 1fr);
    min-height: calc(100vh - 82px);
}

.auth-layout .app-shell {
    display: block;
}

.sidebar {
    padding: 1.4rem;
}

.sidebar-panel {
    position: sticky;
    top: 5.5rem;
    display: grid;
    gap: 1rem;
    padding: 1.15rem;
    background: linear-gradient(180deg, var(--sidebar) 0%, #183b4b 100%);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    color: #f6fbfc;
}

.sidebar-label {
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.75rem;
    color: rgba(246, 251, 252, 0.68);
}

.sidebar-nav {
    display: grid;
    gap: 0.75rem;
}

.nav-link {
    display: grid;
    gap: 0.12rem;
    padding: 0.9rem 1rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid transparent;
    transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
}

.nav-link:hover,
.nav-link:focus-visible {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.14);
}

.nav-link.active {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.08));
    border-color: rgba(255, 255, 255, 0.16);
}

.nav-link__eyebrow {
    font-size: 0.74rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(246, 251, 252, 0.68);
}

.content {
    padding: 1.4rem 1.4rem 2rem 0;
}

.content-inner {
    display: grid;
    gap: 1.25rem;
    min-width: 0;
}

.hero,
.panel,
.card {
    background: var(--surface);
    border: 1px solid rgba(22, 37, 50, 0.08);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
}

.hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1.5rem;
    padding: 1.7rem 1.8rem;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.97), rgba(245, 248, 251, 0.95)),
        var(--surface);
}

.hero-copy,
.hero-actions,
.section-header,
.inline-actions,
.filters,
.form-grid,
.form-actions,
.split-content,
.metric-grid,
.module-grid {
    display: flex;
    gap: 1rem;
}

.hero-copy {
    flex-direction: column;
    max-width: 720px;
}

.hero-actions,
.inline-actions {
    flex-wrap: wrap;
    align-items: center;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent);
}

.page-title {
    font-size: clamp(2rem, 2vw + 1.25rem, 2.75rem);
    letter-spacing: -0.04em;
}

.muted,
.field-note,
.table-hint,
.detail-meta,
.empty-state p {
    color: var(--muted);
}

.lead {
    max-width: 64ch;
    color: var(--muted-strong);
}

.metric-grid,
.module-grid {
    flex-wrap: wrap;
}

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

.metric-card,
.module-card,
.detail-card,
.empty-state,
.login-panel {
    padding: 1.35rem;
    border-radius: var(--radius-lg);
    background: var(--surface-strong);
    border: 1px solid rgba(22, 37, 50, 0.08);
    box-shadow: var(--shadow-md);
}

.metric-card strong {
    display: block;
    margin-top: 0.55rem;
    font-size: 1.45rem;
    letter-spacing: -0.04em;
}

.metric-card p,
.module-card p {
    margin-top: 0.4rem;
}

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

.module-card {
    display: grid;
    gap: 0.9rem;
}

.module-card__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.module-card__footer span {
    color: var(--muted);
    font-size: 0.92rem;
}

.card,
.panel {
    padding: 1.35rem;
}

.compact-panel {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.panel-head,
.section-header,
.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.section-header {
    margin-bottom: 1.2rem;
}

.panel-head {
    margin-bottom: 1rem;
}

.panel-head h2,
.section-header h2 {
    font-size: 1.15rem;
}

.stack {
    display: grid;
    gap: 1rem;
}

.stack-lg {
    gap: 1.35rem;
}

.split-content,
.form-grid,
.filters {
    flex-wrap: wrap;
}

.split-content > *,
.filters label,
.form-grid label {
    flex: 1 1 220px;
}

.narrow {
    max-width: 560px;
}

.auth-layout .content {
    padding: 2.25rem 1.5rem 3rem;
}

.auth-layout .content-inner {
    min-height: calc(100vh - 180px);
    place-content: center;
}

.login-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, 430px);
    gap: 1.4rem;
    align-items: stretch;
}

.login-showcase {
    padding: 2rem;
    border-radius: var(--radius-xl);
    background:
        linear-gradient(145deg, rgba(19, 50, 63, 0.96), rgba(15, 118, 110, 0.9)),
        var(--sidebar);
    color: #f4fafb;
    box-shadow: var(--shadow-lg);
}

.login-showcase .eyebrow,
.login-showcase .muted {
    color: rgba(244, 250, 251, 0.74);
}

.login-highlights {
    display: grid;
    gap: 0.9rem;
    margin-top: 1.5rem;
}

.login-highlight {
    padding: 0.95rem 1rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.login-panel {
    padding: 1.8rem;
}

.login-panel h1 {
    font-size: 2rem;
    letter-spacing: -0.04em;
}

.button,
button,
input[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 44px;
    padding: 0.78rem 1.15rem;
    border-radius: 999px;
    border: 1px solid transparent;
    background: linear-gradient(180deg, var(--accent), var(--accent-strong));
    color: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 12px 20px rgba(15, 118, 110, 0.18);
    transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.button:hover,
button:hover,
input[type="submit"]:hover,
.button:focus-visible,
button:focus-visible,
input[type="submit"]:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 16px 24px rgba(15, 118, 110, 0.22);
}

.button-secondary {
    background: rgba(255, 255, 255, 0.88);
    color: var(--text);
    border-color: rgba(22, 37, 50, 0.1);
    box-shadow: none;
}

.button-subtle {
    background: transparent;
    color: var(--muted-strong);
    border-color: rgba(22, 37, 50, 0.1);
    box-shadow: none;
}

.button-danger {
    background: linear-gradient(180deg, #d92d20, #b42318);
    box-shadow: 0 12px 20px rgba(180, 35, 24, 0.16);
}

.button-small {
    min-height: 36px;
    padding: 0.45rem 0.85rem;
    font-size: 0.9rem;
}

.text-link {
    color: var(--accent);
    font-weight: 600;
}

.danger-link {
    color: var(--danger);
}

.view-switcher {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.view-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.7rem 1rem;
    border-radius: 999px;
    background: var(--surface-soft);
    border: 1px solid rgba(22, 37, 50, 0.08);
    color: var(--muted-strong);
    font-weight: 600;
}

.view-pill.active {
    background: var(--accent-soft);
    color: var(--accent-strong);
    border-color: rgba(15, 118, 110, 0.18);
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    width: fit-content;
    padding: 0.35rem 0.72rem;
    border-radius: 999px;
    background: rgba(22, 37, 50, 0.08);
    color: var(--muted-strong);
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: capitalize;
}

.badge-admin,
.badge-success {
    background: var(--success-soft);
    color: var(--success);
}

.badge-public,
.badge-info,
.badge-published,
.badge-open {
    background: var(--info-soft);
    color: #0d6981;
}

.badge-road-banned,
.badge-warning,
.badge-reviewed {
    background: var(--warning-soft);
    color: #9a5308;
}

.badge-road-speeding,
.badge-draft,
.badge-closed {
    background: rgba(124, 58, 237, 0.1);
    color: #6d28d9;
}

.badge-danger {
    background: var(--danger-soft);
    color: var(--danger);
}

.alert {
    padding: 0.9rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
}

.alert-error {
    background: var(--danger-soft);
    color: var(--danger);
    border-color: rgba(180, 35, 24, 0.16);
}

label {
    display: grid;
    gap: 0.45rem;
    font-size: 0.95rem;
    font-weight: 600;
}

input,
textarea,
select {
    width: 100%;
    padding: 0.82rem 0.95rem;
    border-radius: 14px;
    border: 1px solid rgba(22, 37, 50, 0.12);
    background: #fff;
    color: var(--text);
    font: inherit;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}

input:focus,
textarea:focus,
select:focus {
    outline: 0;
    border-color: rgba(15, 118, 110, 0.42);
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

textarea {
    min-height: 138px;
    resize: vertical;
}

.field-error {
    color: var(--danger);
    font-size: 0.88rem;
}

.field-note {
    font-size: 0.88rem;
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.checkbox-inline {
    align-self: end;
}

.checkbox input {
    width: auto;
    min-width: 18px;
    margin: 0;
}

.table-wrap {
    overflow-x: auto;
    border-radius: 20px;
    border: 1px solid rgba(22, 37, 50, 0.06);
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: rgba(255, 255, 255, 0.75);
}

thead th {
    position: sticky;
    top: 0;
    background: #f8fbfd;
    color: var(--muted);
    font-size: 0.77rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
}

th,
td {
    padding: 1rem 0.9rem;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid rgba(22, 37, 50, 0.06);
}

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

.clickable-row {
    cursor: pointer;
    transition: background 120ms ease, transform 120ms ease;
}

.clickable-row:hover,
.clickable-row:focus-within {
    background: rgba(15, 118, 110, 0.05);
}

.clickable-row td:first-child {
    position: relative;
}

.clickable-row td:first-child::before {
    content: "";
    position: absolute;
    left: 0;
    top: 18px;
    bottom: 18px;
    width: 3px;
    border-radius: 999px;
    background: transparent;
    transition: background 120ms ease;
}

.clickable-row:hover td:first-child::before,
.clickable-row:focus-within td:first-child::before {
    background: var(--accent);
}

.row-title {
    display: grid;
    gap: 0.3rem;
}

.row-title strong {
    font-size: 0.98rem;
}

.row-subtitle {
    font-size: 0.87rem;
    color: var(--muted);
}

.actions,
.row-actions {
    white-space: nowrap;
}

.row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.row-action {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    border: 1px solid rgba(22, 37, 50, 0.1);
    background: #fff;
    color: var(--muted-strong);
    font-size: 0.88rem;
    font-weight: 600;
}

.row-action:hover,
.row-action:focus-visible {
    border-color: rgba(15, 118, 110, 0.2);
    color: var(--accent-strong);
}

.row-action-danger:hover,
.row-action-danger:focus-visible {
    border-color: rgba(180, 35, 24, 0.22);
    color: var(--danger);
}

.filter-actions {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
}

.detail-shell {
    display: grid;
    gap: 1.1rem;
}

.detail-overview {
    display: grid;
    gap: 1rem;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.9rem;
}

.detail-card dt {
    margin-bottom: 0.45rem;
    color: var(--muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.detail-card dd {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.detail-section {
    display: grid;
    gap: 0.75rem;
}

.detail-section h2 {
    font-size: 1.05rem;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    align-items: center;
}

.evidence-block {
    padding-top: 1rem;
    border-top: 1px solid rgba(22, 37, 50, 0.08);
}

.media-preview {
    max-width: min(100%, 760px);
    border-radius: 22px;
    border: 1px solid rgba(22, 37, 50, 0.08);
    background: #0d1822;
    box-shadow: var(--shadow-md);
}

.rich-content {
    white-space: pre-wrap;
    color: var(--muted-strong);
    line-height: 1.7;
}

.empty-state {
    display: grid;
    gap: 0.55rem;
    place-items: start;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 248, 251, 0.94));
}

.empty-state strong {
    font-size: 1.05rem;
}

code {
    display: inline-block;
    padding: 0.1rem 0.35rem;
    border-radius: 8px;
    background: rgba(22, 37, 50, 0.08);
    font-family: "IBM Plex Mono", "SFMono-Regular", monospace;
    font-size: 0.92em;
}

.danger-card {
    border-color: rgba(180, 35, 24, 0.14);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(252, 244, 244, 0.98));
}

.is-hidden {
    display: none;
}

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

    .sidebar {
        padding: 0 1.4rem;
    }

    .sidebar-panel {
        position: static;
    }

    .content {
        padding: 0 1.4rem 2rem;
    }

    .topbar {
        flex-direction: column;
        align-items: stretch;
    }

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

@media (max-width: 840px) {
    .hero,
    .section-header,
    .form-actions,
    .filters,
    .form-grid,
    .split-content,
    .login-shell {
        flex-direction: column;
        align-items: stretch;
    }

    .hero-actions,
    .filter-actions {
        width: 100%;
    }

    .topbar-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .identity-card {
        border-radius: 18px;
    }

    .content,
    .sidebar,
    .topbar {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}
