:root {
    --bg: #f5f7fb;
    --panel: #ffffff;
    --text: #1f2937;
    --muted: #64748b;
    --line: #dbe3ef;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --danger: #dc2626;
    --success: #0f766e;
    --sidebar: #182235;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, "Microsoft YaHei", sans-serif;
    font-size: 14px;
}

a {
    color: var(--primary);
    text-decoration: none;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 220px;
    background: var(--sidebar);
    color: #fff;
    padding: 18px 14px;
    display: flex;
    flex-direction: column;
}

.brand {
    font-size: 18px;
    font-weight: 700;
    padding: 8px 10px 18px;
}

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

.sidebar nav a {
    color: #dbeafe;
    padding: 10px 12px;
    border-radius: 6px;
}

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

.session {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    color: #cbd5e1;
    padding: 12px 10px 4px;
}

.session a {
    color: #fca5a5;
}

.main {
    margin-left: 220px;
    padding: 24px;
}

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

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
    box-shadow: 0 6px 18px rgba(30, 41, 59, .06);
}

.auth-card {
    width: min(420px, 100%);
}

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

.page-head h1,
.auth-card h1 {
    margin: 0;
    font-size: 22px;
}

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

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

.form-row {
    display: grid;
    gap: 6px;
    margin-bottom: 12px;
}

label {
    color: var(--muted);
    font-size: 13px;
}

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

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

.actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.button,
button {
    border: 0;
    border-radius: 6px;
    padding: 9px 13px;
    background: var(--primary);
    color: #fff;
    font: inherit;
    cursor: pointer;
}

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

.button.secondary {
    background: #475569;
}

.button.danger,
button.danger {
    background: var(--danger);
}

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

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

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

th {
    color: #334155;
    background: #f8fafc;
    font-weight: 700;
}

.badge {
    display: inline-flex;
    border-radius: 999px;
    padding: 3px 8px;
    font-size: 12px;
    background: #e2e8f0;
    color: #334155;
}

.badge.red {
    background: #fee2e2;
    color: #991b1b;
}

.badge.green {
    background: #ccfbf1;
    color: #115e59;
}

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

.alert.success {
    background: #ccfbf1;
    color: var(--success);
}

.alert.error {
    background: #fee2e2;
    color: #991b1b;
}

.pagination {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 14px;
}

.split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

@media (max-width: 900px) {
    .sidebar {
        position: static;
        width: auto;
    }

    .main {
        margin-left: 0;
    }

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