:root {
    --sidebar: #172033;
    --sidebar-soft: #22304a;
    --ink: #172033;
    --muted: #697386;
    --line: #dfe4ea;
    --panel: #ffffff;
    --bg: #f5f7fb;
    --accent: #0f766e;
    --warn: #c2410c;
}

body {
    background: var(--bg);
    color: var(--ink);
    font-size: 14px;
    letter-spacing: 0;
}

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

.sidebar {
    background: var(--sidebar);
    color: #fff;
    padding: 18px 14px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.brand {
    align-items: center;
    color: #fff;
    display: flex;
    font-weight: 700;
    gap: 10px;
    margin: 4px 6px 24px;
    text-decoration: none;
}

.brand-logo {
    display: block;
    height: 40px;
    max-width: 160px;
    object-fit: contain;
}

.brand-mark {
    align-items: center;
    background: #f59e0b;
    border-radius: 8px;
    color: #111827;
    display: inline-flex;
    height: 34px;
    justify-content: center;
    width: 34px;
}

.sidebar .nav-link {
    align-items: center;
    border-radius: 8px;
    color: #cbd5e1;
    display: flex;
    gap: 10px;
    margin-bottom: 4px;
    padding: 10px 12px;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background: var(--sidebar-soft);
    color: #fff;
}

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

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

.topbar h1 {
    font-size: 24px;
    line-height: 1.2;
    margin: 0;
}

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

.stat-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.stat-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    min-height: 104px;
    padding: 16px;
}

.stat-card .label {
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 10px;
}

.stat-card .value {
    font-size: 28px;
    font-weight: 700;
}

.table > :not(caption) > * > * {
    vertical-align: middle;
}

.badge-status {
    border-radius: 999px;
    font-weight: 600;
    padding: 6px 10px;
}

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

.html-editor {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    min-height: 420px;
    resize: vertical;
}

.preview-frame {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    min-height: 420px;
    overflow: auto;
    padding: 16px;
}

.editor-fullscreen {
    background: #fff;
    inset: 12px;
    position: fixed;
    z-index: 1055;
}

.editor-fullscreen .html-editor,
.editor-fullscreen .preview-frame {
    min-height: calc(100vh - 180px);
}

.auth-body {
    background: #eef2f7;
}

.auth-wrap {
    align-items: center;
    display: flex;
    min-height: 100vh;
    justify-content: center;
    padding: 20px;
}

.auth-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    max-width: 420px;
    padding: 28px;
    width: 100%;
}

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

    .sidebar {
        height: auto;
        position: static;
    }

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

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

    .main {
        padding: 16px;
    }
}
