:root {
    --bg: #f5f7fb;
    --panel: #ffffff;
    --text: #1f2937;
    --muted: #6b7280;
    --line: #e5e7eb;
    --primary: #1f6feb;
    --primary-dark: #185bc1;
    --danger: #dc2626;
    --success-bg: #ecfdf5;
    --success-text: #047857;
    --danger-bg: #fef2f2;
    --danger-text: #b91c1c;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Arial, Helvetica, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--primary); text-decoration: none; }
code { background: #eef2ff; padding: 0.1rem 0.35rem; border-radius: 0.35rem; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; background: #111827; color: white; padding: 0.9rem 1.2rem; }
.topbar a { color: white; }
.brand { font-weight: 700; }
.topbar nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0.9rem; }
.user-pill { color: #d1d5db; font-size: 0.9rem; }
.container { width: min(1180px, calc(100% - 2rem)); margin: 1.2rem auto 3rem; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 1rem; padding: 1.25rem; box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06); margin-bottom: 1rem; }
.narrow { max-width: 460px; margin: 3rem auto; }
.hero h1, .card h1 { margin-top: 0; }
.muted { color: var(--muted); }
.grid.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.tile { display: block; background: white; border: 1px solid var(--line); border-radius: 1rem; padding: 1.4rem; box-shadow: 0 10px 22px rgba(15, 23, 42, 0.05); }
.tile strong { display: block; color: var(--text); font-size: 1.2rem; margin-bottom: 0.4rem; }
.tile span { color: var(--muted); }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; align-items: end; }
.two-cols { grid-template-columns: 1fr 1fr; }
label { display: grid; gap: 0.35rem; font-weight: 600; margin-bottom: 0.9rem; }
input, select { width: 100%; padding: 0.7rem 0.75rem; border: 1px solid #cbd5e1; border-radius: 0.55rem; font: inherit; background: white; }
input:focus, select:focus { outline: 3px solid rgba(31, 111, 235, 0.15); border-color: var(--primary); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem; border: 1px solid var(--line); background: #fff; color: var(--text); border-radius: 0.55rem; padding: 0.68rem 0.9rem; cursor: pointer; font-weight: 700; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: white; }
.btn.primary:hover { background: var(--primary-dark); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: white; }
.btn.small { padding: 0.45rem 0.65rem; font-size: 0.9rem; }
.icon-btn { border: 0; background: transparent; font-size: 1.8rem; cursor: pointer; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.85rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: #f8fafc; font-size: 0.9rem; text-transform: uppercase; color: #475569; }
.badge { display: inline-block; padding: 0.2rem 0.5rem; border-radius: 999px; background: #eef2ff; color: #3730a3; font-size: 0.82rem; font-weight: 700; }
.badge.danger { background: var(--danger-bg); color: var(--danger-text); }
.count-pill { display: inline-flex; min-width: 2.2rem; justify-content: center; padding: 0.25rem 0.7rem; border-radius: 999px; background: #eff6ff; color: #1d4ed8; font-weight: 800; }
.alert { border-radius: 0.7rem; padding: 0.8rem 1rem; margin-bottom: 1rem; border: 1px solid transparent; }
.alert-success { background: var(--success-bg); color: var(--success-text); border-color: #bbf7d0; }
.alert-danger { background: var(--danger-bg); color: var(--danger-text); border-color: #fecaca; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.6); display: none; align-items: center; justify-content: center; padding: 1rem; z-index: 100; }
.modal-backdrop.is-open { display: flex; }
.modal { width: min(560px, 100%); background: white; border-radius: 1rem; padding: 1.2rem; box-shadow: 0 20px 50px rgba(0,0,0,0.2); }
.modal-header, .modal-actions { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.modal-header { margin-bottom: 0.8rem; }
.modal-actions { justify-content: flex-end; margin-top: 1rem; }
@media (max-width: 720px) {
    .topbar, .section-title { align-items: flex-start; flex-direction: column; }
    .two-cols { grid-template-columns: 1fr; }
}
