:root {
    --bg: #0d0d0f;
    --panel: #171719;
    --panel-2: #202023;
    --ink: #f5f0e6;
    --muted: #b7ad99;
    --line: #3a3327;
    --brand: #050505;
    --brand-2: #c9a227;
    --gold-soft: #f2d675;
    --accent: #c9a227;
    --danger: #b42318;
    --ok: #2f9e44;
    font-family: Georgia, "Times New Roman", serif;
}

* {
    box-sizing: border-box;
}

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

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

.shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 260px 1fr;
}

.sidebar {
    background: #050505;
    color: var(--ink);
    border-right: 1px solid #2f2617;
    padding: 22px 16px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
}

.brand-mark,
.login-logo {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: linear-gradient(135deg, #f2d675, #a97716);
    color: #0b0b0c;
    font-weight: 800;
}

.brand strong {
    display: block;
    font-size: 19px;
}

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

.nav {
    display: grid;
    gap: 6px;
}

.nav a {
    padding: 11px 12px;
    border-radius: 7px;
    color: #d8ceb8;
    font-weight: 700;
}

.nav a:hover,
.nav a.active {
    background: #201a10;
    color: var(--gold-soft);
}

.content {
    min-width: 0;
    padding: 24px;
}

.topbar {
    min-height: 54px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

.topbar strong {
    display: block;
}

.topbar span {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 13px;
    text-transform: capitalize;
}

.logout {
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 9px 13px;
    background: #111113;
    color: var(--gold-soft);
    font-weight: 700;
}

.page-title {
    margin-bottom: 20px;
}

.page-title h1 {
    margin: 0 0 6px;
    font-size: 30px;
    letter-spacing: 0;
}

.page-title p {
    margin: 0;
    color: var(--muted);
}

.metrics {
    display: grid;
    grid-template-columns: 220px minmax(260px, 1fr);
    gap: 16px;
    margin-bottom: 18px;
}

.metric,
.panel,
.login-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.32);
}

.metric {
    padding: 20px;
}

.metric span {
    display: block;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.metric strong {
    display: block;
    margin-top: 10px;
    font-size: 30px;
    line-height: 1.2;
}

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

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

.panel-head h2 {
    margin: 0;
    font-size: 18px;
}

.panel-head span,
.upload-panel p {
    color: var(--muted);
    font-size: 13px;
}

.table-scroll {
    overflow-x: auto;
}

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

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

th {
    color: var(--gold-soft);
    font-size: 12px;
    text-transform: uppercase;
}

.badge {
    display: inline-block;
    border-radius: 999px;
    background: #251f12;
    color: var(--gold-soft);
    padding: 4px 9px;
    font-size: 12px;
    font-weight: 800;
}

.form {
    display: grid;
    gap: 14px;
    max-width: 520px;
}

.form label {
    display: grid;
    gap: 6px;
    font-size: 14px;
    font-weight: 800;
    color: var(--gold-soft);
}

input,
select,
button {
    min-height: 40px;
    border-radius: 7px;
    font: inherit;
}

input,
select {
    width: 100%;
    border: 1px solid var(--line);
    padding: 8px 10px;
    background: #101012;
    color: var(--ink);
}

button {
    border: 0;
    background: linear-gradient(135deg, #f2d675, #b88918);
    color: #101012;
    padding: 0 16px;
    font-weight: 800;
    cursor: pointer;
}

.button-light {
    background: #2b2b2f;
    color: var(--ink);
}

.button-link {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    border-radius: 7px;
    background: linear-gradient(135deg, #f2d675, #b88918);
    color: #101012;
    padding: 0 14px;
    font-weight: 800;
    cursor: pointer;
}

.actions {
    display: flex;
    gap: 8px;
}

.alert {
    border-radius: 7px;
    margin-bottom: 16px;
    padding: 12px 14px;
    font-weight: 800;
}

.alert.error {
    background: #2b1110;
    color: #ffb4aa;
    border: 1px solid #7a271a;
}

.alert.ok {
    background: #102315;
    color: #9ae6b4;
    border: 1px solid #246b3a;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 22px;
    background: radial-gradient(circle at 25% 20%, #2a2112 0, #0d0d0f 42%, #050505 100%);
}

.login-card {
    width: min(100%, 430px);
    padding: 30px;
}

.login-card h1 {
    margin: 18px 0 6px;
    font-size: 30px;
}

.login-card p {
    margin: 0 0 20px;
    color: var(--muted);
}

.login-help {
    display: grid;
    gap: 6px;
    margin-top: 18px;
    color: var(--muted);
    font-size: 13px;
}

.upload-panel {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) minmax(260px, 520px);
    gap: 20px;
    align-items: start;
}

.upload-panel h2 {
    margin: 0 0 6px;
}

.panel-head p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 13px;
}

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

.details div {
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 12px;
    background: var(--panel-2);
}

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

.details strong {
    display: block;
    margin-top: 6px;
    min-height: 18px;
}

.debug {
    color: var(--muted);
    word-break: break-word;
}

.edit-callout {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: #111113;
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-top: -2px;
    margin-bottom: 18px;
    padding: 16px 18px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
}

.edit-callout strong {
    color: var(--gold-soft);
    font-size: 17px;
}

.modal-toggle {
    position: fixed;
    opacity: 0;
    pointer-events: none;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-toggle:checked + .modal {
    display: flex;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    cursor: pointer;
}

.modal-card {
    position: relative;
    z-index: 1;
    width: min(100%, 620px);
    max-height: 92vh;
    overflow: auto;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
    padding: 20px;
}

.modal-close {
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 9px 12px;
    color: var(--gold-soft);
    font-weight: 800;
    cursor: pointer;
}

.edit-form {
    max-width: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.edit-form button {
    grid-column: 1 / -1;
}

@media (max-width: 860px) {
    .shell,
    .metrics,
    .upload-panel,
    .details {
        grid-template-columns: 1fr;
    }

    .sidebar {
        padding-bottom: 12px;
    }

    .content {
        padding: 18px;
    }

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

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