:root {
    color-scheme: light;
    --bg: #eef2f6;
    --sidebar: #111827;
    --sidebar-soft: #1f2937;
    --surface: #ffffff;
    --surface-soft: #f7f9fc;
    --text: #17202a;
    --muted: #667085;
    --line: #d9e0ea;
    --primary: #0f766e;
    --primary-dark: #115e59;
    --accent: #b45309;
    --danger: #b42318;
    --success: #067647;
    --shadow: 0 18px 42px rgba(16, 24, 40, 0.08);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

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

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

.sidebar {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    gap: 22px;
    height: 100vh;
    padding: 22px;
    background: var(--sidebar);
    color: #fff;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 54px;
    color: #fff;
    text-decoration: none;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 8px;
    background: var(--primary);
    font-size: 15px;
    font-weight: 900;
}

.brand strong,
.brand small {
    display: block;
}

.brand strong {
    font-size: 18px;
    line-height: 1.1;
}

.brand small {
    margin-top: 3px;
    color: #a7b0c0;
    font-size: 12px;
    font-weight: 700;
}

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

.side-nav a {
    display: grid;
    gap: 2px;
    padding: 12px 14px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: #d7dde8;
    text-decoration: none;
}

.side-nav a:hover,
.side-nav a.active {
    border-color: rgba(255, 255, 255, 0.1);
    background: var(--sidebar-soft);
    color: #fff;
}

.side-nav span {
    font-weight: 900;
}

.side-nav small {
    color: #9aa4b2;
    font-size: 12px;
}

.sidebar-card {
    margin-top: auto;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-card span,
.sidebar-card p {
    color: #a7b0c0;
}

.sidebar-card span {
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.sidebar-card strong {
    display: block;
    margin-top: 4px;
    color: #fff;
    font-size: 22px;
}

.sidebar-card p {
    margin: 8px 0 0;
    font-size: 13px;
}

.content-shell {
    min-width: 0;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 30px clamp(18px, 4vw, 48px);
    background: linear-gradient(135deg, #14342d 0%, #1f2937 100%);
    color: #fff;
}

.top-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.eyebrow {
    margin: 0 0 6px;
    color: #b8c7c2;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

h1,
h2 {
    margin: 0;
    letter-spacing: 0;
}

h1 {
    font-size: clamp(28px, 4vw, 44px);
    line-height: 1.06;
}

h2 {
    font-size: 20px;
}

.hero-copy {
    max-width: 680px;
    margin: 10px 0 0;
    color: #d9e3df;
    font-size: 15px;
}

.page {
    width: min(1360px, calc(100% - 36px));
    margin: 22px auto 48px;
}

.alert {
    margin-bottom: 18px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-left: 5px solid var(--primary);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow);
    font-weight: 800;
}

.alert.error {
    border-left-color: var(--danger);
}

.stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.stats article,
.panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.stats article {
    position: relative;
    overflow: hidden;
    padding: 18px;
}

.stats article::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: var(--primary);
}

.stats span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.stats strong {
    display: block;
    margin-top: 6px;
    font-size: 30px;
    line-height: 1;
}

.stats .small-stat {
    font-size: 17px;
    line-height: 1.25;
    word-break: break-word;
}

.grid {
    display: grid;
    gap: 18px;
    margin-bottom: 18px;
}

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

.panel {
    margin-bottom: 18px;
    padding: 20px;
}

.panel-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.panel > h2 {
    margin-bottom: 14px;
}

.form {
    display: grid;
    gap: 14px;
}

.compact-form {
    grid-template-columns: 1fr auto;
    align-items: end;
}

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

label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

input,
select,
textarea {
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    color: var(--text);
    font: inherit;
}

textarea {
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    outline: 3px solid rgba(15, 118, 110, 0.18);
    border-color: var(--primary);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 16px;
    border: 0;
    border-radius: 6px;
    background: var(--primary);
    color: #fff;
    font: inherit;
    font-weight: 900;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}

.button:hover {
    background: var(--primary-dark);
}

.button.secondary {
    background: var(--accent);
}

.button.ghost {
    border: 1px solid rgba(255, 255, 255, 0.32);
    background: transparent;
}

.button.ghost:hover {
    background: rgba(255, 255, 255, 0.1);
}

.button.light {
    background: #fff;
    color: #17202a;
}

.button.light:hover {
    background: #e9eef5;
}

.small-link,
.link-button {
    border: 0;
    background: transparent;
    color: var(--primary-dark);
    font: inherit;
    font-weight: 900;
    text-decoration: none;
    cursor: pointer;
}

.small-link:hover,
.link-button:hover {
    text-decoration: underline;
}

.location-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.tag {
    display: inline-grid;
    gap: 2px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
    font-weight: 900;
}

.tag.main {
    border-color: rgba(15, 118, 110, 0.35);
    background: rgba(15, 118, 110, 0.1);
}

.tag small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

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

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

th {
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

td {
    font-size: 14px;
}

.number {
    text-align: right;
}

.empty {
    color: var(--muted);
    text-align: center;
}

.status {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
}

.status.active {
    background: rgba(6, 118, 71, 0.12);
    color: var(--success);
}

.status.archived {
    background: rgba(180, 35, 24, 0.1);
    color: var(--danger);
}

.actions {
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
}

.actions form {
    margin: 0;
}

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

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

    .side-nav {
        grid-template-columns: repeat(6, minmax(120px, 1fr));
        overflow-x: auto;
    }

    .sidebar-card {
        display: none;
    }
}

@media (max-width: 900px) {
    .stats,
    .grid.two {
        grid-template-columns: 1fr;
    }

    .compact-form,
    .inline-fields {
        grid-template-columns: 1fr;
    }

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

    .top-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 560px) {
    .page {
        width: min(100% - 20px, 1360px);
    }

    .panel {
        padding: 16px;
    }

    .stats article {
        padding: 16px;
    }

    .side-nav {
        grid-template-columns: repeat(6, 132px);
    }

    .top-actions,
    .top-actions .button {
        width: 100%;
    }
}
