:root {
    --bg: #f4efe6;
    --paper: rgba(255, 250, 242, 0.82);
    --ink: #17151f;
    --muted: #6b6477;
    --line: rgba(23, 21, 31, 0.1);
    --brand: #ff6f3c;
    --brand-2: #1146b8;
    --good: #136f63;
    --warn: #f59e0b;
    --bad: #b42318;
    --shadow: 0 16px 50px rgba(17, 17, 31, 0.1);
    --radius: 24px;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: Tahoma, "Segoe UI", sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at top right, rgba(255, 111, 60, 0.14), transparent 32%),
        radial-gradient(circle at bottom left, rgba(17, 70, 184, 0.14), transparent 28%),
        linear-gradient(160deg, #fffdf8 0%, var(--bg) 100%);
}
a { color: inherit; text-decoration: none; }
code { font-family: Consolas, monospace; font-size: 0.92rem; }

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

.sidebar {
    padding: 28px;
    background: linear-gradient(180deg, rgba(23, 21, 31, 0.95), rgba(30, 26, 48, 0.92));
    color: #fff8ef;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.brand,
.login-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand strong,
.login-brand strong {
    display: block;
    font-size: 1.05rem;
}

.brand span,
.login-brand span,
.sidebar-foot small {
    color: rgba(255, 248, 239, 0.65);
}

.brand-mark {
    width: 18px;
    height: 54px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--brand), #ffd166);
    box-shadow: 0 0 24px rgba(255, 111, 60, 0.4);
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nav a {
    padding: 14px 16px;
    border-radius: 16px;
    color: rgba(255, 248, 239, 0.8);
    background: rgba(255, 255, 255, 0.04);
    transition: 0.2s ease;
}

.nav a.active,
.nav a:hover {
    background: linear-gradient(90deg, rgba(255, 111, 60, 0.22), rgba(17, 70, 184, 0.22));
    color: #fff;
    transform: translateX(-3px);
}

.sidebar-foot {
    margin-top: auto;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
}

.main {
    padding: 32px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 18px;
    margin-bottom: 24px;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--brand-2);
    font-weight: 700;
    letter-spacing: 0.04em;
}

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 2rem; }

.chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255,255,255,0.7);
    border: 1px solid var(--line);
}

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

.metric-card,
.panel,
.login-card {
    background: var(--paper);
    border: 1px solid rgba(255,255,255,0.7);
    box-shadow: var(--shadow);
    border-radius: var(--radius);
    backdrop-filter: blur(18px);
}

.metric-card {
    padding: 20px;
}

.metric-card span {
    color: var(--muted);
    display: block;
    margin-bottom: 8px;
}

.metric-card strong {
    font-size: 1.9rem;
}

.metric-card.accent { background: linear-gradient(160deg, rgba(17,70,184,0.11), rgba(255,250,242,0.82)); }
.metric-card.gold { background: linear-gradient(160deg, rgba(245,158,11,0.14), rgba(255,250,242,0.82)); }
.metric-card.success { background: linear-gradient(160deg, rgba(19,111,99,0.14), rgba(255,250,242,0.82)); }
.metric-card.wide { grid-column: span 1; }

.grid {
    display: grid;
    gap: 18px;
}

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

.panel {
    padding: 22px;
}

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

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

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

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

th {
    font-size: 0.85rem;
    color: var(--muted);
    text-transform: uppercase;
}

.status {
    display: inline-flex;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(17, 70, 184, 0.1);
    color: var(--brand-2);
    font-size: 0.86rem;
}

.stack {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

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

label span {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 0.92rem;
}

input, textarea {
    width: 100%;
    padding: 13px 14px;
    border-radius: 16px;
    border: 1px solid rgba(23, 21, 31, 0.12);
    background: rgba(255, 255, 255, 0.72);
    font: inherit;
    color: inherit;
}

textarea {
    resize: vertical;
}

.toggle {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toggle input {
    width: 18px;
    height: 18px;
}

.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    border: none;
    border-radius: 16px;
    padding: 13px 18px;
    cursor: pointer;
    font: inherit;
    background: rgba(23, 21, 31, 0.08);
}

.btn.primary {
    color: white;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
}

.btn.ghost {
    background: transparent;
    border: 1px solid var(--line);
}

.btn.danger {
    color: var(--bad);
}

.alert {
    padding: 14px 18px;
    border-radius: 18px;
    margin-bottom: 18px;
}

.alert.success {
    background: rgba(19, 111, 99, 0.12);
    color: var(--good);
}

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

.detail-list {
    display: grid;
    gap: 12px;
}

.detail-list div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.subpanel {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.json-box {
    margin: 0;
    padding: 16px;
    overflow: auto;
    border-radius: 18px;
    background: rgba(23, 21, 31, 0.92);
    color: #f6f1ea;
    direction: ltr;
    text-align: left;
}

.actions-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.activity-item {
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}

.card-form {
    padding: 18px;
    border-radius: 20px;
    background: rgba(255,255,255,0.5);
    border: 1px solid var(--line);
}

.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

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

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

    .sidebar {
        padding-bottom: 12px;
    }

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

@media (max-width: 700px) {
    .main {
        padding: 18px;
    }

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