:root {
    --ink: #17212b;
    --muted: #66717d;
    --line: #dce3e9;
    --paper: #ffffff;
    --canvas: #f4f7f8;
    --brand: #096b68;
    --brand-dark: #064d4b;
    --accent: #e9b949;
    --danger: #b42318;
    --shadow: 0 18px 50px rgba(27, 48, 56, .10);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); }
a { color: var(--brand); text-decoration: none; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); letter-spacing: -.04em; margin-bottom: .5rem; }
h2 { letter-spacing: -.025em; }
p { color: var(--muted); line-height: 1.6; }
button, input, textarea, select { font: inherit; }
label { display: grid; gap: .45rem; font-weight: 650; color: #35414c; }
input, textarea, select { width: 100%; border: 1px solid #cbd5dc; border-radius: 10px; padding: .78rem .9rem; background: #fff; color: var(--ink); transition: border .2s, box-shadow .2s; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(9, 107, 104, .13); }
textarea { resize: vertical; }
small { display: block; color: var(--muted); font-weight: 450; line-height: 1.4; }
.button { display: inline-flex; justify-content: center; align-items: center; border: 0; border-radius: 10px; background: var(--brand); color: #fff; padding: .78rem 1.2rem; font-weight: 750; cursor: pointer; transition: .2s; }
.button:hover { background: var(--brand-dark); transform: translateY(-1px); }
.button-secondary { background: #e3efef; color: var(--brand-dark); }
.button-wide { width: 100%; padding: .95rem; }
.eyebrow { margin-bottom: .35rem; color: var(--brand); font-size: .76rem; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 5px 20px rgba(27, 48, 56, .04); }
.alert { margin-bottom: 1.25rem; border-radius: 11px; padding: .9rem 1rem; line-height: 1.5; }
.alert ul { margin: .4rem 0 0; padding-left: 1.25rem; }
.alert-success { color: #11613c; background: #dcf6e9; border: 1px solid #b6e7cf; }
.alert-error { color: #852019; background: #fff0ee; border: 1px solid #f2c5bf; }
.admin-body { min-height: 100vh; padding-left: 255px; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 255px; padding: 1.4rem; background: #102f35; color: #fff; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: .8rem; color: #fff; font-size: 1.15rem; font-weight: 800; padding: .3rem .5rem 1.6rem; }
.brand img { width: 38px; height: 38px; object-fit: contain; background: #fff; border-radius: 8px; }
.sidebar nav { display: grid; gap: .25rem; }
.sidebar nav a { color: #d9e8e9; padding: .72rem .8rem; border-radius: 8px; font-weight: 620; }
.sidebar nav a:hover { color: #fff; background: rgba(255, 255, 255, .09); }
.sidebar-user { margin-top: auto; border-top: 1px solid rgba(255,255,255,.16); padding: 1rem .5rem 0; display: flex; justify-content: space-between; gap: .5rem; font-size: .88rem; }
.link-button { border: 0; background: none; padding: 0; color: inherit; cursor: pointer; }
.sidebar .link-button { color: #9dc8c7; }
.content { max-width: 1500px; padding: 2.2rem clamp(1.2rem, 4vw, 3.5rem); }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.6rem; }
.page-heading p:last-child { margin-bottom: 0; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.25rem; }
.stat { padding: 1.4rem; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.stat span { color: var(--muted); font-size: .88rem; font-weight: 650; }
.stat strong { display: block; margin-top: .5rem; color: var(--brand-dark); font-size: 2rem; }
.action-panel { padding: 1.6rem; display: flex; justify-content: space-between; align-items: center; }
.action-panel p { margin: 0; }
.search { display: flex; gap: .7rem; margin-bottom: 1rem; max-width: 680px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .95rem 1rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--muted); background: #f9fbfb; font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; }
tr:last-child td { border-bottom: 0; }
td small { margin-top: .2rem; }
.actions { display: flex; align-items: center; gap: .8rem; white-space: nowrap; }
.danger { color: var(--danger); }
.badge { display: inline-block; border-radius: 999px; padding: .3rem .65rem; font-size: .76rem; font-weight: 750; white-space: nowrap; }
.badge-ok { background: #dcf6e9; color: #11613c; }
.badge-muted { background: #e9edf0; color: #5f6972; }
.badge-warn { background: #fff0d1; color: #795700; }
.empty { padding: 2.5rem; text-align: center; color: var(--muted); }
.form-panel { padding: clamp(1.2rem, 3vw, 2rem); display: grid; gap: 1.25rem; max-width: 900px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.full { grid-column: 1 / -1; }
fieldset { margin: 0; padding: 1rem; border: 1px solid var(--line); border-radius: 12px; }
legend { padding: 0 .4rem; font-weight: 750; }
.check-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .65rem; }
.check { display: flex; align-items: center; gap: .55rem; font-weight: 550; }
.check input, .consent input, .choice-card input { width: auto; accent-color: var(--brand); }
.form-actions { display: flex; align-items: center; gap: 1rem; }
.split-layout { display: grid; grid-template-columns: minmax(300px, .8fr) minmax(400px, 1.2fr); gap: 1.25rem; align-items: start; }
.group-list { overflow: hidden; }
.group-list > h2 { padding: 1.3rem 1.4rem 0; }
.group-list article { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.15rem 1.3rem; border-bottom: 1px solid var(--line); }
.group-list article:last-child { border: 0; }
.group-list h3, .group-list p { margin-bottom: .2rem; }
.recipient-list { max-height: 310px; overflow: auto; display: grid; grid-template-columns: repeat(2, 1fr); gap: .65rem; }
.recipient-list .check { align-items: flex-start; padding: .65rem; background: #f6f9f9; border-radius: 8px; }
.message-meter { display: flex; gap: 1.5rem; color: var(--muted); font-size: .88rem; }
.message-cell { min-width: 280px; max-width: 500px; white-space: pre-wrap; }
.pagination { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem 0; color: var(--muted); }
.pagination div { display: flex; gap: .6rem; }
.detail-message { color: var(--ink); white-space: pre-wrap; font-size: 1.05rem; }
.detail-meta { display: flex; flex-wrap: wrap; gap: .8rem 1.5rem; color: var(--muted); font-size: .88rem; }
.input-suffix { display: flex; align-items: center; border: 1px solid #cbd5dc; border-radius: 10px; overflow: hidden; background: #eef3f4; }
.input-suffix input { border: 0; border-radius: 0; }
.input-suffix span { padding: 0 .8rem; color: var(--muted); white-space: nowrap; }
.auth-body, .public-body { min-height: 100vh; background: radial-gradient(circle at 10% 0%, #d8efec, transparent 35%), linear-gradient(140deg, #f7faf9, #edf3f4); padding: 2rem 1rem; }
.auth-body { display: grid; place-items: center; }
.auth-card { width: min(440px, 100%); background: #fff; padding: clamp(1.5rem, 5vw, 2.5rem); border-radius: 20px; box-shadow: var(--shadow); }
.auth-card form { display: grid; gap: 1.15rem; }
.auth-brand, .public-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 2rem; }
.auth-brand img, .public-header img { width: 68px; height: 68px; object-fit: contain; }
.auth-brand h1, .auth-brand p, .public-header h1, .public-header p { margin-bottom: 0; }
.logo-mark { width: 54px; height: 54px; border-radius: 14px; display: inline-grid; place-items: center; background: var(--brand); color: #fff; font-size: 1.7rem; font-weight: 850; flex: none; }
.text-link.center { display: block; text-align: center; margin-top: 1.4rem; }
.public-shell { width: min(760px, 100%); margin: auto; }
.public-header { padding: .5rem; }
.public-intro { padding: 2rem 2.1rem 1rem; background: #103a3e; border-radius: 20px 20px 0 0; color: #fff; }
.public-intro h2 { font-size: clamp(1.5rem, 4vw, 2.2rem); }
.public-intro p { color: #c7e0df; }
.public-form { display: grid; gap: 1.5rem; background: #fff; padding: clamp(1.3rem, 5vw, 2.2rem); border-radius: 0 0 20px 20px; box-shadow: var(--shadow); }
.optional { color: var(--muted); font-weight: 450; font-size: .8rem; }
.public-groups { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.choice-card { display: flex; gap: .7rem; align-items: flex-start; padding: .85rem; border: 1px solid var(--line); border-radius: 10px; }
.choice-card small { margin-top: .2rem; }
.consent { display: flex; align-items: flex-start; gap: .7rem; padding: 1rem; background: #f4f8f8; border-radius: 10px; font-size: .83rem; font-weight: 500; line-height: 1.5; }
.consent input { margin-top: .2rem; }
.public-shell footer { padding: 1.5rem; text-align: center; color: var(--muted); font-size: .82rem; }
.success-card { padding: 3rem 2rem; background: #fff; border-radius: 20px; text-align: center; box-shadow: var(--shadow); }
.success-card > span { display: inline-grid; place-items: center; width: 70px; height: 70px; margin-bottom: 1rem; border-radius: 50%; background: #dcf6e9; color: #11613c; font-size: 2rem; font-weight: 850; }
.center { text-align: center; }
@media (max-width: 900px) {
    .admin-body { padding-left: 0; padding-bottom: 68px; }
    .sidebar { inset: auto 0 0; width: auto; height: 68px; padding: .5rem; flex-direction: row; z-index: 10; overflow-x: auto; }
    .sidebar .brand, .sidebar-user { display: none; }
    .sidebar nav { display: flex; align-items: center; width: max-content; }
    .sidebar nav a { white-space: nowrap; font-size: .82rem; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .split-layout { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
    .content { padding: 1.3rem 1rem; }
    .page-heading, .action-panel { align-items: flex-start; flex-direction: column; }
    .form-grid, .check-grid, .recipient-list, .public-groups { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .stat { padding: 1rem; }
    .stat strong { font-size: 1.55rem; }
    .search { flex-direction: column; }
}
