:root {
    --bg: #f5f7fb;
    --panel: #ffffff;
    --ink: #172033;
    --muted: #6d7587;
    --line: #dce2ea;
    --brand: #134ebf;
    --brand-dark: #0b347f;
    --danger: #b42318;
    --success: #0f7b44;
    --radius: 8px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    color: var(--ink);
    background: var(--bg);
    font-family: Arial, Helvetica, sans-serif;
}

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

.auth-page, .public-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: linear-gradient(135deg, #0b347f 0%, #111827 100%);
}

.login-card, .public-card {
    width: min(440px, 100%);
    background: var(--panel);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .28);
}

.brand-mark {
    width: 76px;
    height: 76px;
    margin: 0 auto 14px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #101827;
    color: #fff;
    font-weight: 800;
    font-size: 24px;
}

h1, h2, h3 { margin: 0 0 12px; }
p { color: var(--muted); line-height: 1.5; }

.layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 244px 1fr;
}

.sidebar {
    padding: 24px;
    background: #111827;
    color: #fff;
}

.sidebar a {
    display: block;
    margin: 12px 0;
    color: #dbe8ff;
}

.content { padding: 28px; }

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

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

.grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

label {
    display: block;
    margin: 12px 0 6px;
    font-size: 13px;
    font-weight: 700;
    color: #344054;
}

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

input[type="checkbox"] {
    width: auto;
    min-height: 0;
    margin-right: 6px;
}

button, .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 16px;
    border: 0;
    border-radius: 6px;
    background: var(--brand);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

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

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

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

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

.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.badge.ok { background: #dcfae6; color: var(--success); }
.badge.off { background: #fee4e2; color: var(--danger); }

.flash {
    margin-bottom: 16px;
    padding: 12px;
    border-radius: 6px;
    background: #eaf2ff;
    color: #0b347f;
}

.flash.error {
    background: #fee4e2;
    color: var(--danger);
}

.public-card {
    text-align: center;
    background: rgba(255, 255, 255, .92);
}

.public-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 56px;
    margin: 12px 0;
    border: 2px solid #5b1d37;
    border-radius: 8px;
    color: #5b1d37;
    font-weight: 800;
    background: rgba(255, 255, 255, .38);
}

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

@media (max-width: 760px) {
    .layout { grid-template-columns: 1fr; }
    .sidebar { position: static; }
    .grid { grid-template-columns: 1fr; }
    .topbar { align-items: flex-start; flex-direction: column; }
    .content { padding: 18px; }
}
