:root {
    --bg: #f4f0e8;
    --panel: #ffffff;
    --ink: #151515;
    --muted: #6e6a62;
    --accent: #285e61;
    --line: #ddd5c8;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--bg);
}

a { color: var(--accent); text-decoration: none; font-weight: 700; }

.login-screen {
    display: grid;
    place-items: center;
    padding: 20px;
}

.login-card, .panel {
    width: min(100%, 520px);
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: 0 18px 50px rgba(20, 20, 20, .08);
}

.login-card h1, .admin-main h1, .panel h2 {
    margin: 0 0 22px;
    font-family: Georgia, "Times New Roman", serif;
}

.login-card p, .admin-header p {
    margin: 0 0 8px;
    color: var(--muted);
    text-transform: uppercase;
    font-size: 12px;
    font-weight: 900;
}

form { display: grid; gap: 16px; }
label { display: grid; gap: 8px; color: var(--muted); font-weight: 700; }
input, textarea {
    width: 100%;
    min-height: 46px;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    background: #fff;
}

textarea { resize: vertical; }

button {
    min-height: 48px;
    border: 0;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    font-weight: 900;
    cursor: pointer;
}

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

.alert { background: #ffe5e5; color: #7c2020; }
.success { background: #e5f5ea; color: #1f6c37; }

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 248px;
    display: grid;
    align-content: start;
    gap: 8px;
    padding: 24px;
    background: #111;
    color: #fff;
}

.sidebar strong {
    margin-bottom: 22px;
    font-size: 22px;
}

.sidebar a {
    color: rgba(255, 255, 255, .8);
    padding: 12px 10px;
    border-radius: 8px;
}

.sidebar a:hover { background: rgba(255, 255, 255, .08); color: #fff; }

.admin-main {
    margin-left: 248px;
    padding: 32px;
}

.admin-main.full {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 32px 0;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 26px;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

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

.metric {
    padding: 20px;
}

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

.metric strong {
    font-size: 40px;
}

.panel {
    width: 100%;
    margin-bottom: 18px;
}

.grid-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: end;
}

.stack-form { max-width: 820px; }

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

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

th { color: var(--muted); font-size: 13px; text-transform: uppercase; }
td a { margin-right: 12px; }

.back-link {
    display: inline-block;
    margin-bottom: 16px;
}

@media (max-width: 880px) {
    .sidebar {
        position: static;
        width: auto;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-main { margin-left: 0; padding: 18px; }
    .metric-grid, .grid-form { grid-template-columns: 1fr; }
}
