:root {
    --bg: #f5f3ee;
    --ink: #202225;
    --muted: #6d7178;
    --panel: #fffdfa;
    --line: #ded8ce;
    --accent: #0b6b61;
    --accent-2: #b8342b;
    --soft: #e9e2d6;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--bg);
    font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    border: 0;
    border-radius: 6px;
    padding: 9px 14px;
    background: var(--ink);
    color: #fff;
    cursor: pointer;
}

button:hover {
    background: var(--accent);
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    color: var(--ink);
    padding: 9px 10px;
}

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

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

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

th {
    color: var(--muted);
    font-weight: 600;
}

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

.sidebar {
    background: #25231f;
    color: #fff;
    padding: 22px 16px;
}

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

.brand small {
    display: block;
    color: #bbb5aa;
    margin-top: 2px;
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    font-weight: 800;
}

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

nav a {
    color: #ece6db;
    text-decoration: none;
    border-radius: 6px;
    padding: 10px 11px;
}

nav a:hover {
    background: rgba(255, 255, 255, .1);
}

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

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

.topbar h1,
.panel h2 {
    margin: 0;
}

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

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

.stat,
.panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.stat {
    display: grid;
    gap: 4px;
    padding: 16px;
}

.stat small,
.stat span {
    color: var(--muted);
}

.stat strong {
    font-size: 30px;
}

.panel {
    margin-bottom: 14px;
    padding: 16px;
    overflow-x: auto;
}

.panel-head {
    margin-bottom: 14px;
}

.grid-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(140px, 1fr)) auto;
    align-items: end;
    gap: 12px;
}

.wide {
    grid-column: span 2;
}

.inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 2px;
}

.inline button {
    padding: 7px 10px;
}

.actions {
    min-width: 330px;
}

.mini {
    width: 74px;
}

.pill {
    display: inline-block;
    border-radius: 999px;
    padding: 3px 8px;
    background: var(--soft);
    color: var(--ink);
}

.mono {
    font-family: Consolas, "Courier New", monospace;
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notice,
.error {
    border-radius: 6px;
    padding: 10px 12px;
    margin-bottom: 12px;
}

.notice {
    background: #dceee8;
    color: #164a3f;
}

.error {
    background: #f5d7d3;
    color: #741d16;
}

.codes {
    min-height: 180px;
    margin-top: 14px;
    font-family: Consolas, "Courier New", monospace;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 18px;
    background:
        linear-gradient(135deg, rgba(11, 107, 97, .16), transparent 32%),
        var(--bg);
}

.login-panel {
    width: min(420px, 100%);
    display: grid;
    gap: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    padding: 26px;
    box-shadow: 0 22px 70px rgba(39, 34, 27, .14);
}

.login-panel h1 {
    margin: 0 0 4px;
}

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

    .sidebar {
        position: static;
    }

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

    .wide {
        grid-column: auto;
    }
}
