/* Sync2VA Pulse — same family look as Sync2Time (navy, metallic blue, orange; DM Sans + Fraunces) */
:root {
  --ink: #182331;
  --muted: #6d7684;
  --line: #dde5ee;
  --bg: #f6f8fb;
  --paper: #ffffff;
  --navy: #142030;
  --navy-2: #22324a;
  --blue: #1d6fbb;
  --blue-soft: #e6f0fa;
  --orange: #f28c28;
  --orange-soft: #fff1e3;
  --green: #22875f;
  --green-soft: #e3f4ec;
  --red: #c9472f;
  --red-soft: #fbe9e5;
  --amber: #a5670b;
  --amber-soft: #fdf2dc;
  --grey-soft: #eef1f4;
  --radius: 12px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 'DM Sans', system-ui, sans-serif; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-family: Fraunces, Georgia, serif; font-size: 32px; letter-spacing: -1px; line-height: 1.15; margin-bottom: 4px; }
h2 { font-size: 17px; letter-spacing: -.2px; margin-bottom: 8px; }
.icon { flex: none; vertical-align: -3px; }
.mono { font-family: 'DM Mono', ui-monospace, monospace; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.eyebrow { font-size: 11px; letter-spacing: 1.1px; font-weight: 700; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }
.hint { font-size: 13px; color: var(--muted); margin: -4px 0 14px; }
.due { color: var(--red); }
.over { color: var(--blue); }

/* Sidebar */
.sidebar { position: fixed; inset: 0 auto 0 0; width: 240px; background: var(--navy); color: #e9eef5; padding: 26px 16px 18px; display: flex; flex-direction: column; z-index: 20; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 9px; font-size: 22px; font-weight: 700; color: #fff; letter-spacing: -.6px; padding: 0 10px; margin-bottom: 30px; }
.brand:hover { text-decoration: none; }
.brand small { font-size: 11px; font-weight: 600; color: #8ea0b6; letter-spacing: .5px; margin-left: 2px; }
.brand-mark { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: linear-gradient(135deg, #f07d24, #ffc37a); color: var(--navy); font: 600 19px Fraunces, serif; }
.sidebar nav { display: grid; gap: 3px; }
.nav-item { display: flex; align-items: center; gap: 12px; color: #a9b6c6; padding: 10px 12px; border-radius: 8px; font-weight: 500; border: 0; background: none; width: 100%; font: inherit; font-weight: 500; cursor: pointer; text-align: left; }
.nav-item:hover { color: #fff; background: var(--navy-2); text-decoration: none; }
.nav-item.active { color: #fff; background: var(--navy-2); box-shadow: inset 3px 0 0 var(--orange); }
.nav-item.small { font-size: 13px; padding: 8px 12px; }
.nav-label { font-size: 10px; letter-spacing: 1.2px; text-transform: uppercase; color: #6f8197; font-weight: 700; padding: 16px 12px 6px; }
.sidebar-bottom { margin-top: auto; padding-top: 18px; border-top: 1px solid #253348; }
.profile { display: flex; align-items: center; gap: 10px; padding: 6px 10px 10px; }
.profile b, .profile small { display: block; }
.profile b { font-size: 13px; color: #fff; }
.profile small { font-size: 11px; color: #8ea0b6; }
.avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: #f6c896; color: #5a2c06; font-weight: 700; font-size: 11px; flex: none; }
.topbar { display: none; }

.main { margin-left: 240px; max-width: 1240px; padding: 36px 44px 64px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p.muted { margin: 4px 0 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.back { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--muted); margin-bottom: 6px; }

/* Cards & stats */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 18px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.table-card > .card-head { padding: 16px 20px 6px; margin: 0; }
.card-head h2 { margin: 0; }
.table-card { padding: 0; overflow: hidden; }
.table-card > .empty { padding: 20px 22px; }
.form-card { max-width: 860px; }
.narrow { max-width: 440px; margin: 0 auto; }
.narrow-left { max-width: 480px; }
.note { background: var(--orange-soft); border-color: #f6d7b5; }
.meet { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 18px; }
.meet a { font-weight: 600; word-break: break-all; }
.empty { color: var(--muted); margin: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.stat span { font-size: 12px; font-weight: 600; color: var(--muted); }
.stat b { font-size: 26px; letter-spacing: -.5px; line-height: 1.15; }
.stat b.mono { font-size: 22px; }
.stat.accent { border-color: #b9d4ef; background: linear-gradient(180deg, #f3f8fd, #fff); }
.stat small { font-size: 12px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.getting-started ol { margin: 0; padding-left: 20px; line-height: 1.9; }

/* Tables */
.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 11px; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); font-weight: 700; background: #fafbfd; border-bottom: 1px solid var(--line); padding: 10px 14px; white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid #edf1f5; vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fbfcfe; }
.table .num { text-align: right; white-space: nowrap; }
.table.compact td { padding: 7px 12px; }
.table tr.dropped td { color: #9aa3ae; }
.table tr.dropped a { color: #8796a8; }
.table tr.voided td { color: #9aa3ae; text-decoration: line-through; text-decoration-color: #c4cbd3; }
.table tr.voided .pill, .table tr.voided .row-actions { text-decoration: none; }
.row-actions { text-align: right; min-width: 120px; }
.row-actions .btn { margin: 2px 0 2px 4px; }
.table td a b, .table td b.code { white-space: nowrap; }
.table td.details { max-width: 420px; word-break: break-word; color: var(--muted); }
.pick { white-space: nowrap; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.pager-links { display: flex; align-items: center; gap: 10px; }

/* Pills */
.pill { display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 30px; white-space: nowrap; background: var(--grey-soft); color: #586271; vertical-align: 2px; }
h1 .pill { font-family: 'DM Sans', sans-serif; letter-spacing: 0; vertical-align: 6px; }
.pill-ongoing, .pill-paid, .pill-enrolled { background: var(--green-soft); color: var(--green); }
.pill-upcoming, .pill-overpaid { background: var(--blue-soft); color: var(--blue); }
.pill-partial { background: var(--amber-soft); color: var(--amber); }
.pill-unpaid, .pill-cancelled, .pill-dropped { background: var(--red-soft); color: var(--red); }
.pill-completed { background: var(--grey-soft); color: #586271; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; border: 1px solid var(--line); background: var(--paper); color: var(--ink); border-radius: 8px; padding: 9px 14px; font: 600 14px 'DM Sans', sans-serif; cursor: pointer; line-height: 1.2; }
.btn:hover { text-decoration: none; border-color: #c3cfdc; }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primary:hover { background: #185f9f; border-color: #185f9f; }
.btn-ghost { background: transparent; }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-block { width: 100%; justify-content: center; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* Forms */
.form label { display: block; font-size: 13px; font-weight: 700; color: #4b5563; margin-bottom: 14px; }
.form label small { font-weight: 400; color: var(--muted); }
.form input:not([type=checkbox]):not([type=radio]), .form select, .form textarea, .filters input, .filters select {
  display: block; width: 100%; margin-top: 6px; padding: 10px 11px; border: 1px solid #cfd9e4; border-radius: 8px; background: #fff; color: var(--ink); font: 14px 'DM Sans', sans-serif;
}
.form input:focus, .form select:focus, .form textarea:focus, .filters input:focus, .filters select:focus { outline: 2px solid #9cc3ea; outline-offset: 0; border-color: var(--blue); }
.form .check, .check { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--ink); font-size: 14px; }
.check input { width: 16px; height: 16px; margin: 0; accent-color: var(--blue); }
.check.danger { color: var(--red); }
.form fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px 4px; margin: 0 0 14px; }
.form legend { font-size: 13px; font-weight: 700; color: #4b5563; padding: 0 4px; }
.checks { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.checks .check { margin-bottom: 8px; }
.row-2, .row-3 { display: grid; gap: 0 14px; }
.row-2 { grid-template-columns: 1fr 1fr; }
.row-3 { grid-template-columns: 1fr 1fr 1fr; }
.map-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 14px; }
.field-error { display: block; color: var(--red); font-weight: 500; font-size: 12px; margin-top: 5px; }
.form-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.form-actions.separated { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }

.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.filters input, .filters select { margin-top: 0; width: auto; padding: 8px 10px; }
.filters .search { display: flex; align-items: center; gap: 6px; background: #fff; border: 1px solid #cfd9e4; border-radius: 8px; padding: 0 10px; flex: 1 1 260px; color: var(--muted); }
.filters .search input { border: 0; outline: 0; padding: 8px 0; width: 100%; }
.filters .inline { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }

/* Flash */
.flash { border-radius: 10px; padding: 11px 14px; margin-bottom: 16px; font-size: 14px; border: 1px solid; }
.flash-success { background: var(--green-soft); border-color: #bfe3d0; color: #155c40; }
.flash-error { background: var(--red-soft); border-color: #f1c7bd; color: #8d2c1a; }
.flash-info { background: var(--blue-soft); border-color: #c4dbf1; color: #174d7e; }

/* Misc */
.history { list-style: none; padding: 0; margin: 0; }
.history li { padding: 6px 0; border-bottom: 1px solid #edf1f5; font-size: 14px; }
.history li:last-child { border-bottom: 0; }
.checklist { list-style: none; padding: 0; margin: 0 0 10px; }
.checklist li { padding: 5px 0; }
.checklist li span:first-child { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; font-size: 12px; font-weight: 700; margin-right: 6px; }
.checklist .ok span:first-child { background: var(--green-soft); color: var(--green); }
.checklist .warn span:first-child { background: var(--amber-soft); color: var(--amber); }
.temp-password { border-color: #f6d7b5; background: var(--orange-soft); }
.big { font-size: 24px; letter-spacing: 1px; margin: 0; }
.batch-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-bottom: 16px; }
.batch-card { color: var(--ink); margin: 0; transition: border-color .15s, box-shadow .15s; }
.batch-card:hover { text-decoration: none; border-color: #b9d4ef; box-shadow: 0 4px 16px rgba(20, 32, 48, .06); }
.batch-card h2 { font-size: 20px; margin: 10px 0 2px; }
.batch-card p { margin: 0 0 4px; }
.batch-card-top { display: flex; justify-content: space-between; align-items: center; }
.debug { white-space: pre-wrap; background: #fff4f2; padding: 10px; border-radius: 8px; font-size: 12px; }

/* Plain pages (sign in, setup, errors) */
body.plain { min-height: 100vh; background: radial-gradient(1200px 600px at 10% -10%, #dfeaf6, transparent), var(--bg); }
.plain-main { max-width: 480px; margin: 0 auto; padding: 8vh 16px 40px; }
.plain-brand { display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 700; font-size: 18px; margin-bottom: 22px; }
.login-card h1, .narrow h1 { font-size: 28px; }
.error-card { text-align: left; }

@media (max-width: 1100px) {
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .topbar { display: flex; position: sticky; top: 0; z-index: 30; align-items: center; justify-content: space-between; background: var(--navy); padding: 10px 16px; }
  .topbar .brand { margin: 0; padding: 0; font-size: 19px; }
  .menu-btn { background: none; border: 0; color: #fff; padding: 6px; cursor: pointer; }
  .sidebar { transform: translateX(-100%); transition: transform .2s; top: 52px; width: 260px; visibility: hidden; }
  .sidebar > .brand { display: none; }
  body.nav-open .sidebar { transform: none; visibility: visible; box-shadow: 8px 0 24px rgba(0, 0, 0, .2); }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat b { font-size: 22px; }
  .stat b.mono { font-size: 17px; }
  .main { margin-left: 0; padding: 22px 16px 48px; }
  h1 { font-size: 26px; }
  .row-2, .row-3 { grid-template-columns: 1fr; }
  .page-head { align-items: flex-start; }
  .card { padding: 16px; }
  .table-card { padding: 0; }
  .filters > * { flex: 1 1 140px; }
}
