:root {
    --bg: #f4f7fb;
    --panel: #ffffff;
    --line: #dce3ec;
    --text: #172033;
    --muted: #667085;
    --accent: #1769aa;
    --accent-dark: #0f4f83;
    --danger: #b42318;
    --success-bg: #ecfdf3;
    --success-text: #027a48;
    --error-bg: #fef3f2;
    --error-text: #b42318;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: Arial, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--accent); }
.shell { max-width: 1180px; margin: 0 auto; padding: 24px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 22px; }
.brand { font-weight: 800; font-size: 20px; }
.nav { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.nav a, .button, button { border: 0; border-radius: 7px; padding: 10px 14px; font: inherit; cursor: pointer; background: var(--accent); color: #fff; text-decoration: none; display: inline-block; }
.nav a.secondary, .button.secondary { background: #eef3f8; color: var(--text); border: 1px solid var(--line); }
button:hover, .button:hover, .nav a:hover { filter: brightness(.96); }
.logout-form { margin: 0; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 20px; margin-bottom: 18px; }
h1, h2 { margin-top: 0; }
.muted { color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.wide { grid-column: 1 / -1; }
label { display: block; font-weight: 700; margin-bottom: 6px; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 7px; padding: 10px 11px; font: inherit; background: #fff; }
textarea { min-height: 120px; resize: vertical; }
.actions { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; }
.danger { background: transparent; color: var(--danger); border: 1px solid #f0b9b5; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px 9px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: 13px; }
.flash { border-radius: 7px; padding: 11px 13px; margin-bottom: 14px; }
.flash.success { background: var(--success-bg); color: var(--success-text); }
.flash.error { background: var(--error-bg); color: var(--error-text); }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 18px; }
.card h3 { margin-top: 0; }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-box { width: min(420px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 26px; box-shadow: 0 16px 45px rgba(16, 24, 40, .08); }
.login-box button { width: 100%; margin-top: 8px; }
.hidden { display: none; }
.desc { max-width: 430px; white-space: pre-wrap; }

@media (max-width: 760px) {
    .shell { padding: 14px; }
    .topbar { align-items: flex-start; flex-direction: column; }
    .grid, .cards { grid-template-columns: 1fr; }
    .wide { grid-column: auto; }
    table, thead, tbody, th, td, tr { display: block; }
    thead { display: none; }
    tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
    td { border-bottom: 0; padding: 5px 0; }
}
