/* ---------- Base ---------- */
* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #1f2937;
    background: #f3f4f6;
}

.container {
    max-width: 760px;
    margin: 40px auto;
    padding: 0 20px;
}

h1 {
    font-size: 1.8rem;
    line-height: 1.3;
    margin: 0 0 16px;
    color: #111827;
}

/* ---------- Intro ---------- */
.intro {
    background: #fff;
    border-radius: 12px;
    padding: 28px 32px;
    margin-bottom: 24px;
    border-top: 5px solid #2563eb;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.intro p { margin: 0 0 10px; color: #4b5563; }
.intro p:last-child { margin-bottom: 0; }

/* ---------- Questions ---------- */
.question {
    background: #fff;
    border-radius: 12px;
    padding: 24px 32px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

.q-title {
    display: block;
    font-weight: 600;
    font-size: 1.1rem;
    color: #111827;
    margin-bottom: 6px;
}

.q-body {
    margin: 0 0 14px;
    color: #4b5563;
}

.optional { font-weight: 400; color: #6b7280; font-size: .9rem; }
.required { color: #dc2626; }

input[type="text"],
textarea {
    width: 100%;
    padding: 10px 12px;
    font: inherit;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fafafa;
    transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 120px; }

input[type="text"]:focus,
textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,.15);
    background: #fff;
}

.choice {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    margin-bottom: 8px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}
.choice:hover { background: #f9fafb; border-color: #d1d5db; }
.choice input { accent-color: #2563eb; width: 18px; height: 18px; margin: 0; }

/* ---------- Button ---------- */
button {
    display: inline-block;
    padding: 12px 32px;
    font: inherit;
    font-weight: 600;
    color: #fff;
    background: #2563eb;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background .15s;
}
button:hover { background: #1d4ed8; }

.survey button { margin: 8px 0 40px; }

/* ---------- Messages ---------- */
.errors {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-left: 5px solid #dc2626;
    color: #991b1b;
    border-radius: 8px;
    padding: 14px 20px;
    margin-bottom: 20px;
}
.errors p { margin: 4px 0; }

.notice {
    background: #fff;
    border-radius: 12px;
    padding: 32px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

/* ---------- Honeypot (hidden from humans) ---------- */
.hp {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ---------- Mobile ---------- */
@media (max-width: 600px) {
    .container { margin: 20px auto; }
    .intro, .question { padding: 20px; }
    h1 { font-size: 1.5rem; }
}
/* ---------- Login ---------- */
.login { max-width: 420px; margin-top: 80px; }

input[type="password"] {
    width: 100%;
    padding: 10px 12px;
    font: inherit;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fafafa;
}
input[type="password"]:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,.15);
    background: #fff;
}
/* ---------- Dashboard ---------- */
.dash { max-width: 1100px; }

.topbar {
    background: #111827;
    color: #fff;
}
.topbar-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.topbar a { color: #93c5fd; text-decoration: none; margin-left: 14px; }
.topbar a:hover { text-decoration: underline; }
.topbar .muted { color: #9ca3af; margin-left: 14px; }

.kpis {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}
.kpi {
    background: #fff;
    border-radius: 12px;
    padding: 18px 22px;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.kpi-label { font-size: .85rem; color: #6b7280; }
.kpi-value { font-size: 2rem; font-weight: 700; color: #111827; line-height: 1.2; margin-top: 4px; }
.kpi-sub   { font-size: .85rem; color: #6b7280; }

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.card {
    background: #fff;
    border-radius: 12px;
    padding: 22px 26px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.grid-2 .card { margin-bottom: 0; }
.card h2 { font-size: 1.1rem; margin: 0 0 4px; color: #111827; }
.card h3 { font-size: 1rem; margin: 16px 0 6px; }

.chart-box { position: relative; height: 240px; margin-top: 12px; }

.muted { color: #6b7280; }
.small { font-size: .875rem; margin: 0 0 8px; }

.badge {
    display: inline-block;
    min-width: 24px;
    padding: 1px 8px;
    font-size: .8rem;
    font-weight: 600;
    text-align: center;
    color: #1e40af;
    background: #dbeafe;
    border-radius: 999px;
    vertical-align: middle;
}

.names { margin: 0; padding-left: 20px; }
.names li { margin: 2px 0; }

.table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.table th, .table td { padding: 8px 6px; border-bottom: 1px solid #f0f1f3; text-align: left; }
.table th { font-size: .85rem; color: #6b7280; font-weight: 600; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }

.filters {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.filters select,
.filters input[type="text"] {
    padding: 9px 12px;
    font: inherit;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fafafa;
    width: auto;
}
.filters input[type="text"] { flex: 1; min-width: 200px; }
.filters button { padding: 9px 22px; }

.answer {
    border-top: 1px solid #f0f1f3;
    padding: 14px 0;
}
.answer:first-of-type { margin-top: 10px; }
.answer-meta { font-size: .875rem; margin-bottom: 4px; }
.answer-text { white-space: normal; }
.anon { color: #6b7280; font-style: italic; }

@media (max-width: 800px) {
    .kpis   { grid-template-columns: repeat(2, 1fr); }
    .grid-2 { grid-template-columns: 1fr; }
}
