:root {
  color-scheme: light;
  --ink: #172033;
  --ink-soft: #526078;
  --canvas: #f3f5f8;
  --paper: #ffffff;
  --line: #dde2ea;
  --brand: #e97824;
  --brand-dark: #c75c13;
  --navy: #172033;
  --success: #1c8b67;
  --danger: #c64444;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 25% 20%, #34415b 0, var(--navy) 48%, #0e1420 100%); }
.login-card { width: min(430px, 100%); padding: 42px; background: rgba(255,255,255,.98); border-radius: 22px; box-shadow: 0 30px 80px rgba(0,0,0,.28); }
.login-card h1 { font-size: 38px; margin: 6px 0; letter-spacing: -.04em; }
.login-card form { margin-top: 28px; }
.brand-mark { width: 58px; height: 58px; border-radius: 16px; display: grid; place-items: center; color: white; background: var(--brand); font-weight: 800; letter-spacing: -.05em; box-shadow: 0 8px 24px rgba(233,120,36,.3); }
.brand-mark.small { width: 42px; height: 42px; border-radius: 12px; box-shadow: none; }
.eyebrow { margin: 0; font-size: 11px; font-weight: 800; letter-spacing: .16em; color: var(--brand); }
.muted { color: var(--ink-soft); line-height: 1.55; }
label { display: grid; gap: 7px; font-size: 13px; font-weight: 700; color: #39445a; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; color: var(--ink); background: #fff; outline: none; transition: .16s border, .16s box-shadow; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(233,120,36,.13); }
.button { border: 0; border-radius: 10px; padding: 11px 17px; font-weight: 750; }
.button.primary { background: var(--brand); color: white; }
.button.primary:hover { background: var(--brand-dark); }
.button.secondary { background: #edf0f5; color: var(--ink); }
.button.danger { background: #fff0f0; color: var(--danger); }
.button.wide { width: 100%; margin-top: 16px; }
.form-error { color: var(--danger); font-size: 13px; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 245px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 24px 17px; display: flex; flex-direction: column; background: var(--navy); color: white; }
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 28px; }
.sidebar-brand strong, .sidebar-brand span { display: block; }
.sidebar-brand span { margin-top: 2px; font-size: 11px; color: #9ea9bb; }
.sidebar nav { display: grid; gap: 5px; }
.nav-item { width: 100%; border: 0; border-radius: 10px; padding: 12px 14px; text-align: left; color: #b9c2d1; background: transparent; font-weight: 650; }
.nav-item:hover, .nav-item.active { color: white; background: rgba(255,255,255,.09); }
.nav-item.active { box-shadow: inset 3px 0 var(--brand); }
.nav-item.logout { margin-top: auto; }
main { min-width: 0; padding: 0 34px 44px; }
.topbar { min-height: 108px; display: flex; justify-content: space-between; align-items: center; gap: 20px; border-bottom: 1px solid var(--line); }
.topbar h2 { margin: 5px 0 0; font-size: 28px; letter-spacing: -.03em; }
.status-pill, .badge { display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; border-radius: 999px; font-size: 12px; font-weight: 750; }
.status-pill.good, .badge.good { background: #e6f5ef; color: var(--success); }
.badge.neutral { background: #edf0f5; color: #5f6a7e; }
.badge.warn { background: #fff2dd; color: #a65c12; }
.view { padding-top: 28px; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; }
.metric, .panel, .community-card { background: var(--paper); border: 1px solid var(--line); border-radius: 15px; box-shadow: 0 3px 12px rgba(23,32,51,.035); }
.metric { padding: 21px; }
.metric span { font-size: 12px; color: var(--ink-soft); font-weight: 700; }
.metric strong { display: block; margin-top: 9px; font-size: 30px; letter-spacing: -.04em; }
.section-heading { margin: 30px 0 14px; display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.section-heading h3 { margin: 0; font-size: 20px; }
.section-heading p { margin: 4px 0 0; color: var(--ink-soft); font-size: 13px; }
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.community-card { padding: 20px; text-align: left; transition: transform .16s, box-shadow .16s; }
button.community-card { width: 100%; color: inherit; }
.community-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(23,32,51,.08); }
.community-card h4 { margin: 8px 0 4px; font-size: 17px; }
.community-card p { margin: 0; color: var(--ink-soft); font-size: 13px; }
.card-stats { margin-top: 18px; padding-top: 15px; border-top: 1px solid var(--line); display: flex; gap: 17px; color: var(--ink-soft); font-size: 12px; }
.card-stats strong { color: var(--ink); }
.panel { overflow: hidden; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 16px; border-bottom: 1px solid var(--line); text-align: left; font-size: 13px; }
th { color: var(--ink-soft); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; background: #fafbfc; }
tr:last-child td { border-bottom: 0; }
.empty { padding: 34px; text-align: center; color: var(--ink-soft); }
.detail-header { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.detail-header h3 { margin: 5px 0; font-size: 24px; }
.detail-layout { display: grid; grid-template-columns: minmax(0,1fr) 330px; gap: 18px; align-items: start; }
.stack { display: grid; gap: 18px; }
.panel-heading { padding: 17px 18px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.panel-heading h4 { margin: 0; }
.inline-form { padding: 18px; display: grid; gap: 13px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.span-2 { grid-column: 1 / -1; }
dialog { width: min(620px, calc(100% - 30px)); border: 0; padding: 0; border-radius: 17px; box-shadow: 0 30px 90px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(11,16,26,.58); backdrop-filter: blur(3px); }
.dialog-form { padding: 25px; }
.dialog-heading { display: flex; justify-content: space-between; align-items: start; margin-bottom: 22px; }
.dialog-heading h3 { margin: 5px 0 0; font-size: 23px; }
.icon-button { border: 0; background: #edf0f5; width: 34px; height: 34px; border-radius: 50%; font-size: 22px; color: var(--ink-soft); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 23px; }
.secret-code { display: block; padding: 16px; background: #121a2a; color: #f7b47f; border-radius: 10px; word-break: break-all; user-select: all; }
.days { display: flex; flex-wrap: wrap; gap: 7px; }
.day-chip { display: flex; align-items: center; gap: 5px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; font-size: 12px; }
.day-chip input { width: auto; }
.toast { position: fixed; right: 24px; bottom: 24px; max-width: 360px; padding: 13px 17px; border-radius: 11px; background: var(--navy); color: white; box-shadow: 0 12px 35px rgba(0,0,0,.22); z-index: 20; }
@media (max-width: 980px) { .metrics { grid-template-columns: 1fr 1fr; } .card-grid { grid-template-columns: 1fr 1fr; } .detail-layout { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .app-shell { grid-template-columns: 1fr; } .sidebar { position: static; height: auto; padding: 14px; flex-direction: row; align-items: center; overflow-x: auto; } .sidebar-brand span, .sidebar nav { display: contents; } .sidebar-brand { padding: 0; } .sidebar-brand > div:last-child { display: none; } .nav-item { width: auto; white-space: nowrap; } .nav-item.logout { margin: 0 0 0 auto; } main { padding: 0 17px 32px; } .topbar { min-height: 88px; } .status-pill { display: none; } .metrics, .card-grid, .form-grid { grid-template-columns: 1fr; } .span-2 { grid-column: auto; } .login-card { padding: 29px; } }
