/* Almodesk web portal. Desktop first: a sidebar, a wide content area, tables for records and two-column
   screens for master and detail; it collapses to one column on a phone. Flat solid colours, a 4 px spacing
   grid, 48 px touch targets. */
:root {
  --navy: #000f66;
  --navy-hover: #0a1a80;
  --navy-deep: #00094a;
  --accent: #d92d2d;
  --ink: #0f172a;
  --muted: #475569;
  --line: #d9e0ea;
  --line-strong: #b8c3d3;
  --surface: #ffffff;
  --page: #f3f5fa;
  --soft: #eef2ff;
  --danger: #b91c1c;
  --danger-bg: #fef2f2;
  --ok: #15803d;
  --ok-bg: #f0fdf4;
  --warn: #92400e;
  --warn-bg: #fffbeb;
  --radius: 12px;
  --side: 256px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
}
h1 { font-size: 30px; line-height: 1.2; margin: 0 0 8px; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 18px; line-height: 1.3; margin: 0 0 8px; font-weight: 700; }
h3 { font-size: 16px; margin: 24px 0 4px; }
p { margin: 0 0 16px; color: var(--muted); }
a { color: var(--navy); }
button, input, select { font: inherit; }
:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.brand { font-weight: 700; letter-spacing: 0.04em; color: var(--navy); font-size: 22px; }
.brand span { color: var(--accent); }

/* ---------------------------------------------------------------- sign in: a split screen */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.auth-art { background: var(--navy); color: #fff; padding: 64px 72px; display: flex; flex-direction: column; justify-content: space-between; gap: 48px; }
.auth-art .brand { color: #fff; font-size: 26px; }
.auth-art .brand span { color: #ff6b6b; }
.auth-art h2 { font-size: 40px; line-height: 1.15; margin: 0 0 24px; letter-spacing: -0.02em; color: #fff; max-width: 560px; }
.auth-art p { color: #c7d0f5; font-size: 18px; max-width: 520px; }
.auth-points { list-style: none; margin: 32px 0 0; padding: 0; display: grid; gap: 16px; max-width: 520px; }
.auth-points li { display: flex; gap: 16px; align-items: flex-start; color: #fff; font-size: 17px; }
.auth-points svg { flex-shrink: 0; width: 24px; height: 24px; margin-top: 2px; stroke: #ff9a9a; }
.auth-art small { color: #9aa6e0; font-size: 14px; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 48px 32px; background: var(--surface); }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h1 { font-size: 32px; margin-bottom: 8px; }
.auth-card > p { font-size: 17px; margin-bottom: 8px; }
.auth-card .brand { display: none; margin-bottom: 32px; }

/* fields: the label always sits above the input */
.field { margin: 20px 0 0; }
.field label { display: block; font-size: 15px; font-weight: 500; margin-bottom: 8px; }
.field input, .field select {
  width: 100%; min-height: 48px; padding: 8px 16px; color: var(--ink);
  background: #fff; border: 1px solid var(--line-strong); border-radius: 10px;
}
.field input:hover, .field select:hover { border-color: var(--navy); }
.field input[aria-invalid="true"], .field select[aria-invalid="true"] { border-color: var(--danger); }
.field input[readonly] { background: var(--page); color: var(--muted); }
.field .hint { font-size: 14px; color: var(--muted); margin: 8px 0 0; }
.field .err { font-size: 14px; color: var(--danger); margin: 8px 0 0; }
.pw { position: relative; }
.pw input { padding-right: 72px; }
.pw button {
  position: absolute; top: 0; right: 0; min-width: 64px; height: 48px; border: 0; background: transparent;
  color: var(--navy); cursor: pointer; border-radius: 10px; font-size: 14px; font-weight: 500;
}
.pw button:hover { text-decoration: underline; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; max-width: 100%;
  padding: 8px 24px; border-radius: 10px; border: 1px solid transparent; font-weight: 600; cursor: pointer;
  text-align: center; text-decoration: none; transition: background-color 0.2s, border-color 0.2s, transform 0.1s;
}
.btn:active { transform: scale(0.98); }
.btn[disabled] { opacity: 0.4; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover:not([disabled]) { background: var(--navy-hover); }
.btn-secondary { background: #fff; color: var(--navy); border-color: var(--line-strong); }
.btn-secondary:hover:not([disabled]) { border-color: var(--navy); background: var(--soft); }
.btn-block { width: 100%; margin-top: 28px; }
.btn-sm { min-height: 40px; padding: 4px 16px; font-size: 14px; }
.link-btn { background: none; border: 0; padding: 12px 0; min-height: 48px; color: var(--navy); font-weight: 500; cursor: pointer; text-decoration: underline; }
.spin { width: 16px; height: 16px; border: 2px solid rgba(255, 255, 255, 0.4); border-top-color: #fff; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* messages */
.note { border-radius: 10px; padding: 12px 16px; font-size: 15px; margin: 16px 0 0; border: 1px solid; }
.note.error { color: var(--danger); background: var(--danger-bg); border-color: #fecaca; }
.note.ok { color: var(--ok); background: var(--ok-bg); border-color: #bbf7d0; }
.note.warn { color: var(--warn); background: var(--warn-bg); border-color: #fde68a; }
.note.info { color: var(--navy); background: var(--soft); border-color: #c7d2fe; }

/* ---------------------------------------------------------------- the app: sidebar + content */
.app { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--navy); color: #fff; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side-brand { padding: 28px 28px 24px; }
.side-brand .brand { color: #fff; font-size: 22px; }
.side-brand .brand span { color: #ff6b6b; }
.side-nav { display: grid; gap: 4px; padding: 8px 16px; }
.side-nav a { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 16px; border-radius: 10px; color: #d6ddfa; text-decoration: none; font-weight: 500; position: relative; transition: background-color 0.2s, color 0.2s; }
.side-nav a:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.side-nav a[aria-current="page"] { background: rgba(255, 255, 255, 0.14); color: #fff; font-weight: 700; }
.side-nav a[aria-current="page"]::before { content: ""; position: absolute; left: -16px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: #ff6b6b; }
.side-nav svg { width: 22px; height: 22px; flex-shrink: 0; stroke: currentColor; }
.side-foot { margin-top: auto; padding: 24px 28px; font-size: 13px; color: #9aa6e0; }
.content { min-width: 0; display: flex; flex-direction: column; }
.top { background: var(--surface); border-bottom: 1px solid var(--line); min-height: 72px; padding: 12px 40px; display: flex; align-items: center; justify-content: space-between; gap: 24px; position: sticky; top: 0; z-index: 5; }
.top-org { min-width: 0; font-weight: 700; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-org small { display: block; font-weight: 400; font-size: 13px; color: var(--muted); }
.top-user { display: flex; align-items: center; gap: 16px; min-width: 0; }
.chip { display: flex; align-items: center; gap: 12px; min-width: 0; }
.chip .mini { width: 40px; height: 40px; border-radius: 50%; background: var(--soft); color: var(--navy); display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; object-fit: cover; }
.chip-text { min-width: 0; line-height: 1.3; }
.chip-text strong { display: block; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 280px; }
.chip-text small { display: block; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 280px; }
.top .btn { flex-shrink: 0; }
.main { width: 100%; max-width: 1280px; margin: 0 auto; padding: 40px 40px 80px; }
.page-head { margin-bottom: 32px; max-width: 760px; }
.page-head p { font-size: 17px; margin: 0; }

/* cards and layouts */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.card + .card, .card + section { margin-top: 24px; }
.card h2 { margin-bottom: 4px; }
.card > h2 + p, .card > h2 + .muted { margin-top: 0; }
.cols { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); }
.cols > .card, .cols > * { margin-top: 0 !important; }
.two { display: grid; gap: 24px; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; margin-top: 24px; }
.two > .card { margin-top: 0 !important; }
.split { display: grid; gap: 28px; grid-template-columns: 380px minmax(0, 1fr); align-items: start; }
.split > * { min-width: 0; }
.att-grid { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); align-items: start; }
.att-grid > * { min-width: 0; }
.grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); margin-top: 0; }
.tile { display: flex; flex-direction: column; gap: 4px; }
.tile .ico { width: 48px; height: 48px; border-radius: 12px; background: var(--soft); color: var(--navy); display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.tile .ico svg { width: 24px; height: 24px; stroke: currentColor; }
.tile.hot .ico { background: var(--danger-bg); color: var(--danger); }
.tile p { flex: 1; }
.tile .btn { align-self: flex-start; }
.badge { display: inline-block; padding: 0 12px; line-height: 28px; border-radius: 14px; background: var(--soft); color: var(--navy); font-size: 14px; font-weight: 600; white-space: nowrap; }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.kv { display: grid; grid-template-columns: 200px 1fr; gap: 0; margin: 8px 0 0; }
.kv dt, .kv dd { padding: 14px 0; border-bottom: 1px solid var(--line); margin: 0; }
.kv dt { color: var(--muted); font-size: 15px; }
.kv dd { overflow-wrap: anywhere; }
.kv dt:last-of-type, .kv dd:last-of-type { border-bottom: 0; }
.avatar { width: 112px; height: 112px; border-radius: 50%; background: var(--soft); color: var(--navy); display: flex; align-items: center; justify-content: center; font-size: 40px; font-weight: 700; object-fit: cover; flex-shrink: 0; }
.profile-side { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.profile-side h2 { font-size: 22px; margin: 8px 0 0; overflow-wrap: anywhere; }
.profile-side .actions { justify-content: center; margin-top: 12px; }
.form-narrow { max-width: 520px; }
.list-plain { margin: 8px 0 0; padding-left: 20px; color: var(--muted); }
.list-plain li { margin-bottom: 4px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.loading { padding: 64px 16px; text-align: center; color: var(--muted); }
.hint { font-size: 14px; color: var(--muted); margin: 12px 0 0; }
.lbl { display: block; font-size: 14px; color: var(--muted); }
.val { font-weight: 600; overflow-wrap: anywhere; }
.val.big { font-size: 30px; line-height: 1.2; }
.today-times { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 20px 0 0; padding: 20px; background: var(--page); border-radius: 10px; }

/* segmented filters */
.seg { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.seg-btn { min-height: 44px; padding: 0 20px; border-radius: 22px; border: 1px solid var(--line-strong); background: #fff; color: var(--ink); font-weight: 500; cursor: pointer; transition: background-color 0.2s, color 0.2s, border-color 0.2s; }
.seg-btn:hover { border-color: var(--navy); }
.seg-btn[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px 24px; margin-top: 8px; }
.toolbar .field { margin: 0; min-width: 240px; }
.toolbar .seg { margin: 0; }
.dates { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-end; margin-top: 8px; }
.dates[hidden] { display: none; }
.dates .field { margin: 0; }

/* tables: real tables on a desktop; each row becomes a card on a phone */
.tbl-wrap { position: relative; margin-top: 20px; border: 1px solid var(--line); border-radius: 10px; overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 15px; }
.tbl th { text-align: left; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); background: #f8fafc; padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: #f8fafc; }
.tbl .num { white-space: nowrap; font-variant-numeric: tabular-nums; }
.tbl .where { max-width: 340px; font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.tbl .name { font-weight: 600; }
.tbl .sub { white-space: normal; display: block; font-size: 13px; color: var(--muted); font-weight: 400; overflow-wrap: anywhere; }
.thumb { padding: 0; border: 1px solid var(--line); border-radius: 10px; background: none; width: 48px; height: 48px; overflow: hidden; cursor: pointer; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb:hover { border-color: var(--navy); }
.where-in { display: block; }

/* dialogs */
.modal-back { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.6); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.modal { background: var(--surface); border-radius: var(--radius); padding: 28px; width: 100%; max-width: 720px; max-height: 100%; overflow: auto; }
.modal-video, .modal-photo { display: block; width: 100%; max-height: 70vh; object-fit: contain; border-radius: 10px; background: #0f172a; transform: scaleX(-1); }
.modal-photo { transform: none; }
.modal-photo[hidden], .modal-video[hidden] { display: none; }
.modal-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 16px; }

/* lists, confirmations, maps */
.rows { list-style: none; margin: 16px 0 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.rows li { display: flex; gap: 16px; align-items: center; justify-content: space-between; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; background: #fff; }
.rows-main { min-width: 0; display: grid; gap: 4px; overflow-wrap: anywhere; }
.rows li .btn { flex-shrink: 0; }
.rows.plain { margin-top: 12px; }
.rows-side { display: grid; gap: 8px; justify-items: end; flex-shrink: 0; max-width: 100%; }
.check { display: flex; gap: 12px; align-items: flex-start; margin-top: 20px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--page); cursor: pointer; }
.check input { width: 24px; height: 24px; margin: 2px 0 0; flex-shrink: 0; accent-color: var(--navy); }
.confirm { margin-top: 16px; border: 1px solid #fde68a; background: var(--warn-bg); border-radius: 10px; padding: 16px; }
.confirm p { margin: 4px 0 0; color: var(--warn); }
.confirm .actions { margin-top: 12px; }
.map { height: 460px; border-radius: 10px; border: 1px solid var(--line); margin-top: 16px; z-index: 0; }
.map[hidden], .map-empty[hidden] { display: none; }
.remark { width: 100%; min-height: 40px; padding: 4px 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: #fff; }
.facts { list-style: none; margin: 0 0 16px; padding: 0; display: flex; gap: 8px 24px; flex-wrap: wrap; color: var(--muted); font-size: 15px; }
.facts li { overflow-wrap: anywhere; }
.cam-video { margin-top: 16px; }
.cam-video .modal-photo { transform: none; }
.guardian-form .btn, .limit-form .btn { margin-top: 16px; }
.alert-detail h3 { margin-top: 0; font-size: 20px; }

/* the register */
.reg-bar { display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: flex-end; }
.reg-bar .field { margin: 0; }
.stats { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.stat { background: var(--page); border-radius: 10px; padding: 12px 20px; min-width: 120px; }
.stat b { display: block; font-size: 24px; line-height: 1.2; }
.stat span { font-size: 13px; color: var(--muted); }
.stat.good b { color: var(--ok); }
.stat.bad b { color: var(--danger); }
.stat.leave b { color: var(--warn); }
.seg-sm .seg-btn { min-height: 36px; padding: 0 14px; font-size: 14px; }
.tbl .st { display: flex; gap: 6px; flex-wrap: nowrap; }
.tbl .st .seg-btn { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 18px; }

/* the parent portal */
.kid-head { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin-bottom: 8px; }
.kid-head .avatar { width: 72px; height: 72px; font-size: 28px; }
.kid-head h2 { font-size: 24px; margin: 0 0 8px; }
.journey { border: 1px solid var(--line); border-radius: 10px; padding: 20px; background: var(--page); margin: 0 0 24px; }
.bar { height: 12px; border-radius: 6px; background: #fff; overflow: hidden; margin: 12px 0 8px; }
.bar span { display: block; height: 100%; background: var(--ok); border-radius: 6px; transition: width 0.3s; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.steps li { display: flex; gap: 16px; align-items: flex-start; }
.steps li > div { min-width: 0; overflow-wrap: anywhere; }
.tick { width: 32px; height: 32px; flex-shrink: 0; border-radius: 50%; border: 2px solid var(--line-strong); display: inline-flex; align-items: center; justify-content: center; color: var(--muted); font-weight: 700; }
.steps li.done .tick { background: var(--ok); border-color: var(--ok); color: #fff; }
.kid-two { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 32px; align-items: start; margin-top: 24px; }
.kid-two > * { min-width: 0; }
.cal-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 0; }
.cal-nav .btn { width: 48px; padding: 0; font-size: 24px; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
.cal-h { text-align: center; font-size: 13px; font-weight: 700; color: var(--muted); padding: 4px 0; }
.cal-d { min-height: 64px; border-radius: 10px; border: 1px solid var(--line); background: #fff; padding: 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: pointer; color: var(--ink); }
.cal-d span { font-size: 15px; line-height: 1.2; }
.cal-d b { font-size: 13px; line-height: 1.2; min-height: 16px; }
.cal-d.present { background: var(--ok-bg); border-color: #86efac; color: var(--ok); }
.cal-d.absent { background: var(--danger-bg); border-color: #fca5a5; color: var(--danger); }
.cal-d.weekend, .cal-d.upcoming { background: var(--page); color: var(--muted); }
.cal-d:hover { border-color: var(--navy); }
.legend b { display: inline-block; min-width: 16px; }

/* ---------------------------------------------------------------- smaller screens */
@media (max-width: 1100px) {
  :root { --side: 224px; }
  .main { padding: 32px 24px 64px; }
  .top { padding: 12px 24px; }
  .tbl th, .tbl td { padding-left: 12px; padding-right: 12px; }
  .side-brand { padding: 24px 20px 16px; }
  .split { grid-template-columns: 1fr; }
  .two { grid-template-columns: 1fr; }
  .kid-two { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .auth-card .brand { display: block; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { min-width: 0; position: static; height: auto; flex-direction: row; align-items: center; overflow: visible; }
  .side-brand { padding: 12px 16px; }
  .side-nav { display: flex; gap: 4px; padding: 4px 8px; overflow-x: auto; flex: 1; min-width: 0; }
  .side-nav a { white-space: nowrap; min-height: 48px; }
  .side-nav a[aria-current="page"]::before { display: none; }
  .side-foot { display: none; }
  .top { padding: 8px 16px; position: static; }
  .main { padding: 24px 16px 64px; }
  .chip-text strong, .chip-text small { max-width: 160px; }
}
@media (max-width: 720px) {
  .side { flex-direction: column; align-items: stretch; }
  .tbl thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100%; }
  .tbl-wrap { border: 0; overflow: visible; }
  .tbl tr { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 12px; padding: 12px 16px; background: #fff; }
  .tbl td { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 0; text-align: right; }
  .tbl td::before { content: attr(data-label); color: var(--muted); font-size: 13px; text-align: left; flex-shrink: 0; }
  .tbl td.cell-main { display: block; text-align: left; font-weight: 600; padding-top: 0; }
  .tbl td.cell-main::before { display: none; }
  .tbl .where { max-width: none; }
  .tbl .st { flex-wrap: wrap; justify-content: flex-end; }
}
@media (max-width: 560px) {
  .chip-text { display: none; }
  .top { gap: 12px; }
  .top-org { flex: 1; }
  .kv { grid-template-columns: 1fr; }
  .kv dt { border-bottom: 0; padding-bottom: 0; }
  .rows li { flex-direction: column; align-items: stretch; }
  .rows-side { justify-items: stretch; }
  h1 { font-size: 26px; }
  .card { padding: 20px; }
  .map { height: 320px; }
  .auth-main { padding: 32px 16px; }
}
@media print {
  .side, .top, .no-print, .seg, .dates, .field, .toolbar, .today, #today { display: none !important; }
  .app { display: block; }
  body { background: #fff; }
  .main { padding: 0; max-width: none; }
  .card { border: 0; padding: 0; }
  .tbl tr { break-inside: avoid; }
}
@media (prefers-reduced-motion: reduce) {
  .btn, .spin, .seg-btn, .bar span, .side-nav a { transition: none; animation: none; }
}

/* a table cell holding a value and, under it, a small line of detail (a time and its place) */
.cell-v { display: grid; gap: 2px; min-width: 0; }
.cell-v b { font-weight: 600; }
@media (max-width: 720px) { .cell-v { text-align: right; } }

/* a column of stacked cards beside another column */
.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; min-width: 0; align-content: start; }
.stack > .card { margin-top: 0 !important; }
.empty-state { padding: 48px 24px; text-align: center; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: 10px; margin-top: 16px; background: var(--page); }
.reg-bar .field select, .reg-bar .field input { min-width: 220px; }
.roster .remark { min-width: 200px; }

/* forms with many fields: two columns on a wide screen */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
.form-grid > .field { min-width: 0; }
.form-pair { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
.child-form { max-width: 880px; }
.side-actions { display: grid; gap: 12px; }
.side-actions strong { margin-bottom: 4px; }
.kid-head + .field { max-width: 320px; }
@media (max-width: 720px) { .form-grid, .form-pair { grid-template-columns: 1fr; } }
.grid > .card, .split > .card, .att-grid > .card, .att-grid > div > .card { margin-top: 0 !important; }

/* today's check-in card: one wide strip above the history */
.card.today { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 40px; }
.today h2 { margin: 0; }
.today .today-times { margin: 0; gap: 48px; padding: 16px 24px; }
.today .btn-block { width: auto; margin: 0 0 0 auto; min-width: 220px; }
.today .note, .today .hint, .today #confirm-out { flex-basis: 100%; margin: 0; }
.today #today-msg:empty { display: none; }
.today #today-msg { flex-basis: 100%; }
@media (max-width: 720px) { .today .btn-block { width: 100%; margin: 0; } .today .today-times { width: 100%; } }
.rows-main .badge { white-space: normal; justify-self: start; line-height: 1.4; padding: 4px 12px; }
.split > .stack { align-self: stretch; }
.split > .stack > #alert-card, .split > .stack > #b-card { position: sticky; top: 96px; }
@media (max-width: 1100px) { .split > .stack > #alert-card, .split > .stack > #b-card { position: static; } }
