:root {
    --bg: #f5f6f8;
    --panel: #ffffff;
    --border: #d9dde3;
    --text: #1f2937;
    --muted: #6b7280;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --danger: #dc2626;
    --ok: #16a34a;
    --warn: #d97706;
    --radius: 6px;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.4;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
    background: #111827;
    color: #f9fafb;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}
.topbar .brand a { color: #f9fafb; font-weight: 700; font-size: 1.1rem; }
.nav { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.nav a { color: #cbd5e1; }
.nav a:hover { color: #fff; text-decoration: none; }
.nav .who { color: #9ca3af; font-size: 0.9rem; }
.nav .logout { color: #fca5a5; }

.container {
    max-width: 1100px;
    margin: 1.5rem auto;
    padding: 0 1.5rem;
}

.footer {
    text-align: center;
    color: var(--muted);
    padding: 2rem 1rem;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
}

h1, h2, h3 { margin-top: 0; }

.flash {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    border: 1px solid transparent;
}
.flash-info { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.flash-success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.flash-error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }

form .field { margin-bottom: 1rem; }
form label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}
form input[type=text],
form input[type=email],
form input[type=password],
form input[type=number],
form textarea,
form select {
    width: 100%;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    background: #fff;
    color: var(--text);
}
form textarea { min-height: 5rem; resize: vertical; }
form .hint { color: var(--muted); font-size: 0.8rem; margin-top: 0.25rem; }

.btn {
    display: inline-block;
    padding: 0.55rem 1rem;
    border: 0;
    border-radius: var(--radius);
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.95rem;
}
.btn:hover { background: var(--accent-hover); text-decoration: none; color: #fff; }
.btn-secondary { background: #e5e7eb; color: var(--text); }
.btn-secondary:hover { background: #d1d5db; color: var(--text); }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #b91c1c; }
.btn-sm { padding: 0.3rem 0.6rem; font-size: 0.85rem; }

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
}
th, td {
    padding: 0.6rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
    vertical-align: top;
}
th { background: #f9fafb; font-weight: 600; }
tr:last-child td { border-bottom: 0; }
td.actions { white-space: nowrap; }
td.actions a, td.actions form { display: inline-block; margin-right: 0.25rem; }
td.actions form { margin: 0; }

.page-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.auth-wrap {
    max-width: 380px;
    margin: 4rem auto;
}
.auth-wrap h1 { text-align: center; }

.muted { color: var(--muted); }
code.mono {
    font-family: ui-monospace, Menlo, Consolas, monospace;
    background: #f3f4f6;
    padding: 0.1rem 0.3rem;
    border-radius: 4px;
    font-size: 0.85em;
}
