/* New Hope DMS – design system */
:root {
  --bg: #f5f4f0;
  --surface: #ffffff;
  --surface-2: #faf9f6;
  --line: #e7e4dc;
  --line-2: #efede7;
  --ink: #1d2730;
  --ink-2: #4b5761;
  --ink-3: #7b858e;
  --brand: #1f5c63;
  --brand-2: #2a7a80;
  --brand-soft: #e5f0ef;
  --accent: #c8963e;
  --red: #c4423a;   --red-soft: #fbeceb;
  --amber: #b9750d; --amber-soft: #fdf3e1;
  --blue: #2f66c4;  --blue-soft: #e9f0fb;
  --green: #2d8a5f; --green-soft: #e5f4ec;
  --purple: #7351b8; --purple-soft: #f0ebfa;
  --grey-soft: #eef0f1;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(20, 30, 40, .04), 0 2px 8px rgba(20, 30, 40, .04);
  --shadow-lg: 0 10px 40px rgba(20, 30, 40, .18);
  --sidebar: 236px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.5 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 24px; font-weight: 650; }
h2 { font-size: 17px; font-weight: 620; }
h3 { font-size: 15px; font-weight: 600; }
.muted { color: var(--ink-3); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- layout */
.app { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar); background: #17363b; color: #d9e6e6; position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; z-index: 20; }
.brand { display: flex; align-items: center; gap: 10px; padding: 20px 18px 18px; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, #3b9a92, #c8963e); display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 15px; }
.brand-name { font-weight: 650; color: #fff; font-size: 15px; line-height: 1.15; }
.brand-sub { font-size: 11.5px; color: #8fb0b0; }
.nav { padding: 6px 10px; flex: 1; overflow: auto; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 8px; color: #c4d6d6; font-weight: 500; margin-bottom: 2px; }
.nav a:hover { background: rgba(255,255,255,.06); text-decoration: none; color: #fff; }
.nav a.active { background: rgba(255,255,255,.12); color: #fff; }
.nav a svg { width: 18px; height: 18px; flex: none; opacity: .9; }
.nav .badge { margin-left: auto; background: #c8963e; color: #fff; border-radius: 10px; font-size: 11px; padding: 0 7px; font-weight: 600; }
.nav-sep { height: 1px; background: rgba(255,255,255,.08); margin: 10px 8px; }
.side-foot { padding: 12px 16px 16px; border-top: 1px solid rgba(255,255,255,.08); font-size: 12.5px; }
.side-foot .who { color: #fff; font-weight: 550; }
.conn { display: inline-flex; align-items: center; gap: 6px; color: #9dbaba; font-size: 12px; }
.conn i { width: 8px; height: 8px; border-radius: 50%; background: #9aa; display: inline-block; }
.conn.live i { background: #4cd38a; box-shadow: 0 0 0 3px rgba(76,211,138,.18); }
.conn.demo i { background: #e2b04a; }
.conn.error i, .conn.offline i { background: #e66; }
.main { margin-left: var(--sidebar); flex: 1; min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 10; background: rgba(245,244,240,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); padding: 12px 28px; display: flex; align-items: center; gap: 14px; }
.topbar .search { flex: 1; max-width: 420px; position: relative; }
.topbar .search input { width: 100%; padding: 8px 12px 8px 34px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.topbar .search svg { position: absolute; left: 10px; top: 9px; width: 16px; height: 16px; color: var(--ink-3); }
.search-results { position: absolute; top: 40px; left: 0; right: 0; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); max-height: 380px; overflow: auto; z-index: 50; }
.search-results a { display: block; padding: 9px 14px; color: var(--ink); border-bottom: 1px solid var(--line-2); }
.search-results a:hover { background: var(--surface-2); text-decoration: none; }
.page { padding: 24px 28px 60px; max-width: 1400px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; color: var(--ink-2); }
.demo-banner { background: #fff6df; border-bottom: 1px solid #f0dca8; color: #7a5a12; padding: 8px 28px; font-size: 13px; }
.mobile-bar { display: none; }

/* ---------- cards / grid */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 15px 18px 10px; }
.card-b { padding: 4px 18px 16px; }
.card-b.flush { padding: 0; }
.grid { display: grid; gap: 16px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); }
.stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); cursor: pointer; transition: border-color .15s, transform .15s; }
.stat:hover { border-color: #cfd9d8; transform: translateY(-1px); }
.stat .lbl { font-size: 12px; color: var(--ink-3); font-weight: 550; text-transform: uppercase; letter-spacing: .04em; }
.stat .val { font-size: 26px; font-weight: 680; margin-top: 4px; letter-spacing: -.02em; }
.stat .sub { font-size: 12px; color: var(--ink-3); }
.stat.red .val { color: var(--red); } .stat.amber .val { color: var(--amber); } .stat.green .val { color: var(--green); } .stat.purple .val { color: var(--purple); }

/* ---------- chips */
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 560; white-space: nowrap; background: var(--grey-soft); color: var(--ink-2); line-height: 1.6; }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.chip.plain::before { display: none; }
.chip.red, .chip.overdue { background: var(--red-soft); color: var(--red); }
.chip.amber, .chip.due-soon { background: var(--amber-soft); color: var(--amber); }
.chip.blue, .chip.upcoming { background: var(--blue-soft); color: var(--blue); }
.chip.green, .chip.completed { background: var(--green-soft); color: var(--green); }
.chip.purple { background: var(--purple-soft); color: var(--purple); }
.chip.teal { background: var(--brand-soft); color: var(--brand); }

/* ---------- buttons & forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 14px; border-radius: 9px; border: 1px solid var(--line); background: #fff; font-weight: 560; cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s; color: var(--ink); }
.btn:hover { background: var(--surface-2); border-color: #d6d2c8; text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: #184a50; }
.btn.success { background: var(--green); border-color: var(--green); color: #fff; }
.btn.danger { color: var(--red); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: rgba(0,0,0,.04); }
.btn.sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn.lg { padding: 12px 18px; font-size: 15px; }
.btn svg { width: 16px; height: 16px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
label.f { display: block; margin-bottom: 12px; }
label.f > span { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; }
label.f small { display: block; color: var(--ink-3); font-size: 12px; margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], input[type=url], input[type=search], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid #dcd8ce; border-radius: 9px; background: #fff; outline: none; transition: border-color .12s, box-shadow .12s; }
input:focus, select:focus, textarea:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(42,122,128,.15); }
textarea { min-height: 80px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-grid .full { grid-column: 1 / -1; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filters select, .filters input { width: auto; min-width: 140px; padding: 7px 10px; font-size: 13.5px; }
.filters input[type=search] { min-width: 220px; }
.seg { display: inline-flex; background: #ebe8e1; border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; font-weight: 560; cursor: pointer; color: var(--ink-2); font-size: 13.5px; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.seg button .n { font-size: 11.5px; color: var(--ink-3); margin-left: 4px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 10px 14px; cursor: pointer; font-weight: 560; color: var(--ink-3); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.on { color: var(--brand); border-bottom-color: var(--brand); }

/* ---------- tables */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: #fbfaf7; }
.tbl .title { font-weight: 580; color: var(--ink); }
.tbl .sub { font-size: 12.5px; color: var(--ink-3); }
.check { width: 22px; height: 22px; border-radius: 7px; border: 2px solid #c9c4b8; background: #fff; display: inline-grid; place-items: center; cursor: pointer; transition: all .12s; flex: none; padding: 0; }
.check:hover { border-color: var(--green); }
.check.on { background: var(--green); border-color: var(--green); color: #fff; }
.check svg { width: 14px; height: 14px; }

/* ---------- lists */
.list-item { display: flex; gap: 12px; align-items: center; padding: 11px 18px; border-top: 1px solid var(--line-2); cursor: pointer; }
.list-item:hover { background: #fbfaf7; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .t { font-weight: 570; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .s { font-size: 12.5px; color: var(--ink-3); }
.date-badge { width: 46px; flex: none; text-align: center; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line); padding: 3px 0; line-height: 1.15; }
.date-badge b { display: block; font-size: 17px; }
.date-badge span { font-size: 10.5px; text-transform: uppercase; color: var(--ink-3); font-weight: 600; letter-spacing: .04em; }
.date-badge.overdue { background: var(--red-soft); border-color: #f2cfcc; color: var(--red); }
.date-badge.due-soon { background: var(--amber-soft); border-color: #f2dfb8; color: var(--amber); }
.date-badge.completed { background: var(--green-soft); border-color: #c9e8d6; color: var(--green); }
.att { display: flex; gap: 10px; align-items: flex-start; padding: 10px 18px; border-top: 1px solid var(--line-2); cursor: pointer; }
.att:hover { background: #fbfaf7; }
.att .dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 6px; flex: none; }
.att .dot.high { background: var(--red); } .att .dot.medium { background: var(--amber); } .att .dot.low { background: #a8b1b8; }
.empty { padding: 26px 18px; text-align: center; color: var(--ink-3); }
.empty b { display: block; color: var(--ink-2); font-size: 15px; margin-bottom: 2px; }

/* ---------- progress */
.prog { height: 8px; background: #eceae4; border-radius: 99px; overflow: hidden; position: relative; min-width: 60px; }
.prog > i { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: var(--brand-2); }
.prog > i.green { background: var(--green); } .prog > i.amber { background: #d99a2b; } .prog > i.red { background: var(--red); } .prog > i.grey { background: #b9bfc4; }
.prog > b { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink); opacity: .45; border-radius: 2px; }
.kpi-row { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.6fr) 110px 120px auto; gap: 14px; align-items: center; padding: 12px 18px; border-top: 1px solid var(--line-2); }
.kpi-row .t { font-weight: 570; }
.kpi-row .s { font-size: 12.5px; color: var(--ink-3); }
.kpi-nums { font-size: 12.5px; color: var(--ink-2); margin-top: 4px; display: flex; justify-content: space-between; gap: 6px; }

/* ---------- donor */
.donor-head { display: flex; gap: 18px; align-items: flex-start; margin-bottom: 18px; flex-wrap: wrap; }
.avatar { width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; font-weight: 700; font-size: 20px; color: #fff; flex: none; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; font-size: 13.5px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.donor-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.dcard { padding: 16px 18px; cursor: pointer; transition: border-color .15s, transform .15s; }
.dcard:hover { border-color: #c8d6d4; transform: translateY(-1px); }

/* ---------- calendar */
.cal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.cal-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.cal-title { font-size: 20px; font-weight: 650; min-width: 190px; }
.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; }
.month .dow { padding: 8px 10px; font-size: 11.5px; font-weight: 650; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; background: var(--surface-2); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.day { min-height: 112px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 6px; position: relative; cursor: default; }
.day.out { background: #faf9f6; }
.day.out .dn { color: #b9b4a8; }
.day.today .dn { background: var(--brand); color: #fff; }
.day.sel { box-shadow: inset 0 0 0 2px var(--brand-2); }
.dn { display: inline-grid; place-items: center; min-width: 24px; height: 24px; border-radius: 12px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); padding: 0 4px; }
.ev { display: block; font-size: 12px; line-height: 1.3; padding: 3px 6px; border-radius: 6px; margin-top: 3px; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-left: 3px solid; font-weight: 550; }
.ev:hover { filter: brightness(.96); }
.ev.overdue { background: var(--red-soft); color: #93302a; border-color: var(--red); }
.ev.due-soon { background: var(--amber-soft); color: #87560a; border-color: #d99a2b; }
.ev.upcoming { background: var(--blue-soft); color: #244f99; border-color: var(--blue); }
.ev.completed { background: var(--green-soft); color: #22694a; border-color: var(--green); text-decoration: line-through; text-decoration-color: rgba(34,105,74,.4); }
.ev.agreement { background: var(--purple-soft); color: #5a3e94; border-color: var(--purple); }
.ev .d { font-weight: 700; }
.more { font-size: 11.5px; color: var(--ink-3); margin-top: 3px; cursor: pointer; font-weight: 600; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.week .wd { background: #fff; border: 1px solid var(--line); border-radius: 10px; min-height: 300px; padding: 10px; }
.week .wd.today { border-color: var(--brand-2); box-shadow: 0 0 0 2px rgba(42,122,128,.15); }
.week .wd h4 { font-size: 12px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; }
.week .wd .big { font-size: 22px; font-weight: 680; margin-bottom: 6px; }
.week .ev { white-space: normal; padding: 6px 8px; }
.year { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.ym { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; cursor: pointer; }
.ym:hover { border-color: #c8d6d4; }
.ym h4 { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 8px; }
.ym .mini { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; font-size: 10.5px; text-align: center; color: var(--ink-3); }
.ym .mini i { font-style: normal; height: 20px; display: grid; place-items: center; border-radius: 5px; }
.ym .mini i.has { color: #fff; font-weight: 700; }
.ym .mini i.has.overdue { background: var(--red); } .ym .mini i.has.due-soon { background: #d99a2b; } .ym .mini i.has.upcoming { background: var(--blue); } .ym .mini i.has.completed { background: var(--green); } .ym .mini i.has.agreement { background: var(--purple); }
.ym .cnt { font-size: 12px; color: var(--ink-3); margin-top: 8px; }
.horizon { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 0 18px 14px; }
.horizon button { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 9px 4px; cursor: pointer; text-align: center; }
.horizon button.on { border-color: var(--brand-2); background: var(--brand-soft); }
.horizon b { display: block; font-size: 20px; }
.horizon span { font-size: 11.5px; color: var(--ink-3); }

/* ---------- modal / drawer */
.overlay { position: fixed; inset: 0; background: rgba(20, 30, 36, .38); z-index: 100; display: flex; justify-content: flex-end; animation: fade .15s; }
.overlay.center { justify-content: center; align-items: center; padding: 20px; }
@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(30px); opacity: .4; } }
@keyframes pop { from { transform: scale(.97); opacity: .4; } }
.drawer { width: min(560px, 100%); height: 100%; background: #fff; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slide .18s; }
.modal { width: min(640px, 100%); max-height: calc(100vh - 40px); background: #fff; border-radius: 16px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: pop .15s; }
.modal.sm { width: min(440px, 100%); }
.m-head { padding: 18px 22px 12px; display: flex; gap: 12px; align-items: flex-start; border-bottom: 1px solid var(--line-2); }
.m-head .grow { flex: 1; min-width: 0; }
.m-body { padding: 18px 22px; overflow: auto; flex: 1; }
.m-foot { padding: 14px 22px; border-top: 1px solid var(--line-2); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.x { border: 0; background: none; cursor: pointer; padding: 6px; border-radius: 8px; color: var(--ink-3); }
.x:hover { background: var(--grey-soft); }
.section-t { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 650; margin: 18px 0 8px; }
.status-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.status-pick button { border: 1.5px solid var(--line); background: #fff; border-radius: 10px; padding: 10px 6px; cursor: pointer; font-weight: 600; color: var(--ink-2); }
.status-pick button.on.ns { border-color: #9aa3ab; background: var(--grey-soft); color: var(--ink); }
.status-pick button.on.ip { border-color: var(--blue); background: var(--blue-soft); color: var(--blue); }
.status-pick button.on.sb { border-color: var(--green); background: var(--green-soft); color: var(--green); }
.callout { border-radius: 10px; padding: 11px 14px; font-size: 13.5px; background: var(--surface-2); border: 1px solid var(--line); }
.callout.red { background: var(--red-soft); border-color: #f2cfcc; color: #8e2f29; }
.callout.amber { background: var(--amber-soft); border-color: #f2dfb8; color: #7d520b; }
.callout.green { background: var(--green-soft); border-color: #c9e8d6; color: #22694a; }
.callout.blue { background: var(--blue-soft); border-color: #cddcf5; color: #244f99; }

/* ---------- toast */
.toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: #1d2a30; color: #fff; padding: 11px 16px; border-radius: 11px; box-shadow: var(--shadow-lg); display: flex; gap: 14px; align-items: center; font-weight: 500; animation: pop .15s; max-width: 92vw; }
.toast.err { background: #8e2f29; }
.toast button { background: none; border: 0; color: #8fe0c0; font-weight: 650; cursor: pointer; }

/* ---------- login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(1200px 600px at 10% -10%, #d8ebe8, transparent), radial-gradient(900px 500px at 110% 110%, #f3e3c4, transparent), var(--bg); }
.login .box { width: min(420px, 100%); background: #fff; border-radius: 20px; box-shadow: var(--shadow-lg); padding: 34px 32px 28px; }
.login .brand-mark { width: 52px; height: 52px; border-radius: 14px; font-size: 22px; margin-bottom: 16px; }
.login h1 { font-size: 22px; }
.login p { color: var(--ink-2); margin: 6px 0 22px; }

/* ---------- help */
.help h3 { margin: 22px 0 6px; }
.help p, .help li { color: var(--ink-2); max-width: 760px; }
.help kbd { background: var(--grey-soft); border-radius: 5px; padding: 1px 6px; font-size: 12.5px; border: 1px solid var(--line); }

/* ---------- responsive */
@media (max-width: 1200px) {
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cal-layout { grid-template-columns: 1fr; }
  .year { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .g-main, .g-2, .g-3 { grid-template-columns: 1fr; }
  .kpi-row { grid-template-columns: 1fr 1fr; }
  .kpi-row > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .sidebar { display: none; }
  .main { margin-left: 0; padding-bottom: 70px; }
  .topbar { padding: 10px 14px; }
  .page { padding: 16px 14px 40px; }
  .demo-banner { padding: 8px 14px; }
  h1 { font-size: 21px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat .val { font-size: 22px; }
  .mobile-bar { display: flex; position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid var(--line); z-index: 30; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .mobile-bar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px; color: var(--ink-3); padding: 4px 0; font-weight: 550; }
  .mobile-bar a svg { width: 22px; height: 22px; }
  .mobile-bar a.active { color: var(--brand); }
  .mobile-bar a:hover { text-decoration: none; }
  .day { min-height: 64px; padding: 3px; }
  .day .ev { font-size: 0; padding: 0; height: 6px; border-left: 0; border-radius: 3px; margin-top: 2px; }
  .day .more { font-size: 10px; }
  .week { grid-template-columns: 1fr; }
  .week .wd { min-height: 0; }
  .year { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; gap: 0; }
  .kv dt { margin-top: 8px; font-size: 12px; }
  .tbl .hide-m { display: none; }
  .filters select, .filters input, .filters input[type=search] { min-width: 0; flex: 1 1 140px; }
  .drawer { width: 100%; }
  .overlay.center { padding: 0; align-items: flex-end; }
  .modal, .modal.sm { width: 100%; border-radius: 16px 16px 0 0; max-height: 92vh; }
  .topbar .hide-m { display: none; }
}
@media print {
  .sidebar, .topbar, .mobile-bar, .demo-banner, .btn { display: none !important; }
  .main { margin: 0; }
}
.filters input[type=checkbox] { min-width: 0; width: auto; flex: none; }
.filters select { max-width: 280px; }
.filters label { white-space: nowrap; }
.topbar .search { flex: 3; }
