/* UI layer (loaded last): calm white cards, a profile header, stat tiles with icon chips, step lists with clear
   actions, action banners, segmented tabs and friendly empty states. Used by the dashboards and portals, and it
   refines the cards, search bars and tabs everywhere. */
:root {
  --u-radius: 20px;
  --u-soft: color-mix(in srgb, var(--brand) 9%, #fff);
  --u-soft-2: color-mix(in srgb, var(--brand) 14%, #fff);
  --u-deep: color-mix(in srgb, var(--brand) 70%, #0b1f3f);
  --u-line: #e6ebf2;
  --u-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 12px 32px -18px rgba(15, 23, 42, .16);
}
body { background: #f4f6fa; }
.main::before { display: none; }

/* ---------- cards everywhere: white, rounded, soft ---------- */
.card, .kpi, .panel, .tile {
  background: #fff; backdrop-filter: none; -webkit-backdrop-filter: none;
  border: 1px solid var(--u-line); border-radius: var(--u-radius); box-shadow: var(--u-shadow);
}
.card { padding: 22px 24px; margin-bottom: 20px; }
.grid { gap: 20px; align-items: start; }
.kpi::before { display: none; }
.kpi { padding: 18px 20px; }
.kpi .label { color: #64748b; font-size: 12px; letter-spacing: .04em; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-bottom: 20px; }
.card > h2:first-child, .sec-h { font-size: 17px; font-weight: 700; color: #0f172a; letter-spacing: -.01em; }
.sec-h { margin: 0 0 14px; display: flex; align-items: center; gap: 10px; }
.page-head h1 { background: none; -webkit-background-clip: initial; background-clip: initial; color: #0f172a; }

/* ---------- search bars ---------- */
.search-trigger, .tb-search { border-radius: 14px; border: 1px solid var(--u-line); background: #f8fafc; box-shadow: none; }
.search-trigger:hover, .tb-search:focus-within { background: #fff; border-color: color-mix(in srgb, var(--brand) 45%, #fff);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 12%, transparent); }
.tb-search { padding: 6px 6px 6px 16px; }
.tb-search input { font-size: 15px; }
.tb-search .btn.primary { border-radius: 10px; }
.filters { background: #fff; border: 1px solid var(--u-line); border-radius: 16px; box-shadow: var(--u-shadow); padding: 14px 16px; }
.pill-select { background: #f8fafc; border-color: var(--u-line); }

/* ---------- segmented tabs ---------- */
.seg, .tabs-seg { display: inline-flex; gap: 4px; padding: 4px; background: #eef2f7; border-radius: 14px; flex-wrap: wrap; }
.seg a, .tabs-seg a { padding: 7px 14px; border-radius: 10px; font-size: 13.5px; font-weight: 600; color: #475569;
  text-decoration: none; border: 0; background: transparent; transition: background .15s, color .15s; }
.seg a:hover, .tabs-seg a:hover { color: #0f172a; text-decoration: none; }
.seg a.on, .tabs-seg a.on { background: #fff; color: var(--brand); box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }

/* ---------- profile header card ---------- */
.profile-card { display: flex; align-items: center; gap: 22px; padding: 26px 30px; margin-bottom: 26px; flex-wrap: wrap; }
.profile-card .avatar-xl { position: relative; flex: none; width: 84px; height: 84px; border-radius: 50%; display: grid;
  place-items: center; font-size: 30px; font-weight: 800; color: #fff; letter-spacing: .02em; overflow: hidden;
  background: linear-gradient(140deg, var(--brand), var(--u-deep)); box-shadow: 0 10px 24px -12px var(--brand); }
.profile-card .avatar-xl img { width: 100%; height: 100%; object-fit: cover; }
.profile-card .who { flex: 1; min-width: 240px; }
.profile-card .who .eyebrow { font-size: 12.5px; font-weight: 600; color: #64748b; letter-spacing: .02em; margin-bottom: 2px; }
.profile-card h1 { margin: 0 0 8px; font-size: 28px; font-weight: 800; letter-spacing: -.02em; color: #0f172a; }
.profile-card .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; color: #475569; font-size: 14px; }
.profile-card .meta span { display: inline-flex; align-items: center; gap: 7px; }
.profile-card .meta svg { width: 16px; height: 16px; color: var(--brand); }
.chip-ok, .chip-info, .chip-warn, .chip-bad { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px;
  border-radius: 99px; font-size: 13px; font-weight: 600; }
.chip-ok { background: #e8f7ee; color: #15803d; } .chip-info { background: var(--u-soft); color: var(--brand); }
.chip-warn { background: #fff4e0; color: #a35a00; } .chip-bad { background: #ffeceb; color: #b42318; }
.chip-ok svg, .chip-info svg, .chip-warn svg, .chip-bad svg { width: 15px; height: 15px; }
.profile-card .head-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-left: auto; }

/* ---------- two-column body: figures | next steps ---------- */
.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 24px; align-items: start; margin-bottom: 26px; }
.split > div > .sec-h { margin-top: 4px; }

/* stat tiles with an icon chip */
.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.stat-grid > :last-child:nth-child(odd) { grid-column: span 2; }
.stat { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 22px 16px 20px;
  background: #fff; border: 1px solid var(--u-line); border-radius: var(--u-radius); box-shadow: var(--u-shadow);
  color: inherit; text-decoration: none; transition: transform .15s, box-shadow .15s; }
a.stat:hover { transform: translateY(-2px); text-decoration: none; box-shadow: 0 18px 36px -20px rgba(15, 23, 42, .3); }
.stat .ic { width: 50px; height: 50px; border-radius: 15px; display: grid; place-items: center; background: var(--u-soft);
  color: var(--brand); margin-bottom: 6px; }
.stat .ic svg { width: 24px; height: 24px; }
.stat .ic.bad { background: #ffeceb; color: #b42318; } .stat .ic.ok { background: #e8f7ee; color: #15803d; }
.stat .ic.warn { background: #fff4e0; color: #a35a00; }
.stat .n { font-size: 28px; font-weight: 800; letter-spacing: -.02em; color: #0f172a; line-height: 1.1; }
.stat .n small { font-size: 14px; font-weight: 600; color: #64748b; }
.stat .l { font-size: 14px; font-weight: 600; color: #475569; }
.stat .h { font-size: 12.5px; color: #64748b; }
.stat .bar-mini { width: 70%; height: 6px; border-radius: 99px; background: #eef2f7; overflow: hidden; margin-top: 4px; }
.stat .bar-mini i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }

/* action banner */
.banner { display: flex; align-items: center; gap: 16px; padding: 20px 22px; margin-top: 18px; border-radius: var(--u-radius);
  color: #fff; text-decoration: none; background: linear-gradient(120deg, var(--u-deep), var(--brand));
  box-shadow: 0 16px 34px -18px var(--brand); transition: transform .15s, box-shadow .15s; }
.banner:hover { color: #fff; text-decoration: none; transform: translateY(-2px); box-shadow: 0 22px 40px -18px var(--brand); }
.banner .b-ic { flex: none; width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center;
  background: rgba(255, 255, 255, .14); }
.banner .b-ic svg { width: 24px; height: 24px; }
.banner b { display: block; font-size: 17px; margin-bottom: 3px; }
.banner span { font-size: 14px; opacity: .88; }
.banner .chev { margin-left: auto; width: 22px; height: 22px; flex: none; }

/* steps / to-do card */
.steps-card { padding: 26px 28px; }
.steps-card .sc-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.steps-card .sc-head h2 { margin: 0; font-size: 19px; font-weight: 750; color: var(--u-deep); display: flex; gap: 10px; align-items: center; }
.steps-card .sc-head h2 svg { width: 20px; height: 20px; }
.steps-card .sc-head .count { margin-left: auto; padding: 6px 14px; border-radius: 99px; background: #eef2f7; color: #334155;
  font-size: 13px; font-weight: 700; }
.steps-card .sc-head .count.bad { background: #ffeceb; color: #b42318; }
.progress { height: 10px; border-radius: 99px; background: #eef2f7; overflow: hidden; margin: 2px 0 14px; }
.progress i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--u-deep), var(--brand)); }
.steps-card .intro { color: #475569; font-size: 14.5px; margin: 0 0 8px; }
.step { display: flex; align-items: center; gap: 16px; padding: 14px 0; border-top: 1px solid #f0f3f7; color: inherit;
  text-decoration: none; }
.step:first-of-type { border-top: 0; }
a.step:hover { text-decoration: none; } a.step:hover .s-t { color: var(--brand); }
.step .s-ic { flex: none; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  background: var(--u-soft); color: var(--brand); }
.step .s-ic svg { width: 21px; height: 21px; }
.step .s-ic.bad { background: #ffeceb; color: #b42318; } .step .s-ic.ok { background: #e8f7ee; color: #15803d; }
.step .s-ic.warn { background: #fff4e0; color: #a35a00; } .step .s-ic.mute { background: #f1f4f8; color: #94a3b8; }
.step .s-body { flex: 1; min-width: 0; }
.step .s-t { font-weight: 700; color: #0f172a; font-size: 15.5px; line-height: 1.3; }
.step .s-s { color: #64748b; font-size: 13.5px; margin-top: 2px; }
.step .s-s .late { color: #b42318; font-weight: 600; }
.step .s-go { flex: none; padding: 9px 18px; border-radius: 99px; background: var(--u-deep); color: #fff; font-weight: 700;
  font-size: 13.5px; }
.step .s-go.soft { background: #eef2f7; color: #334155; }

/* empty state */
.empty-state { text-align: center; padding: 30px 16px 26px; color: #64748b; }
.empty-state .e-ic { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; margin: 0 auto 12px;
  background: #eef3fa; color: var(--brand); }
.empty-state .e-ic svg { width: 28px; height: 28px; }
.empty-state b { display: block; color: #0f172a; font-size: 15px; margin-bottom: 3px; }

/* section card with an icon heading (like "My requests") */
.sec-card { padding: 24px 26px; }
.sec-card .sc-top { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.sec-card .sc-top .t-ic { flex: none; width: 50px; height: 50px; border-radius: 15px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(140deg, var(--brand), var(--u-deep)); box-shadow: 0 10px 20px -12px var(--brand); }
.sec-card .sc-top .t-ic svg { width: 23px; height: 23px; }
.sec-card .sc-top h2 { margin: 0; font-size: 19px; font-weight: 750; color: #0f172a; }
.sec-card .sc-top p { margin: 2px 0 0; color: #64748b; font-size: 14px; }
.sec-card .sc-top .sc-tools { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* list rows inside cards */
.row-list > .li { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid #f0f3f7; }
.row-list > .li:first-child { border-top: 0; }
.row-list .li-ic { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: var(--u-soft); color: var(--brand); }
.row-list .li-ic svg { width: 19px; height: 19px; }
.row-list .li-b { flex: 1; min-width: 0; }
.row-list .li-b b { display: block; color: #0f172a; font-size: 14.5px; }
.row-list .li-b span { color: #64748b; font-size: 13px; }
.row-list .li-r { flex: none; text-align: right; font-weight: 700; color: #0f172a; display: flex; gap: 8px; align-items: center; }

/* period toolbar */
.period-bar { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; justify-content: space-between;
  margin-bottom: 22px; }
.period-bar form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.period-bar .input { min-height: 38px; padding: 6px 10px; border-radius: 10px; }
.period-bar .lbl { font-size: 13px; color: #64748b; font-weight: 600; }

/* building summary inside the landlord portal */
.bld { padding: 0; overflow: hidden; }
.bld > summary { list-style: none; display: flex; align-items: center; gap: 16px; padding: 18px 24px; cursor: pointer; }
.bld > summary::-webkit-details-marker { display: none; }
.bld > summary .b-ic { flex: none; width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center;
  background: var(--u-soft); color: var(--brand); }
.bld > summary .b-ic svg { width: 21px; height: 21px; }
.bld > summary .b-name { flex: 1; min-width: 0; }
.bld > summary .b-name b { display: block; font-size: 16px; color: #0f172a; }
.bld > summary .b-name span { font-size: 13px; color: #64748b; }
.bld > summary .b-amt { text-align: right; }
.bld > summary .b-amt b { display: block; font-size: 16px; color: #0f172a; }
.bld > summary .b-amt span { font-size: 12px; color: #64748b; }
.bld > summary::after { content: ""; width: 9px; height: 9px; border-right: 2px solid #94a3b8; border-bottom: 2px solid #94a3b8;
  transform: rotate(45deg); margin: -4px 4px 0 6px; transition: transform .15s; }
.bld[open] > summary::after { transform: rotate(-135deg); margin-top: 4px; }
.bld[open] > summary { border-bottom: 1px solid #f0f3f7; }
.bld .bld-body { padding: 18px 24px 22px; }
.occ-bar { width: 120px; height: 6px; border-radius: 99px; background: #eef2f7; overflow: hidden; display: inline-block;
  vertical-align: middle; margin-left: 8px; }
.occ-bar i { display: block; height: 100%; background: var(--brand); }
table.t.compare td:first-child { color: #475569; }
table.t.compare tr.total td { font-weight: 700; color: #0f172a; background: #f8fafc; }
.sub-tabs { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.sub-tabs details { flex: 1 1 100%; }
.sub-tabs summary { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 10px; background: #f1f5f9;
  font-weight: 600; font-size: 13.5px; color: #334155; list-style: none; }
.sub-tabs summary::-webkit-details-marker { display: none; }
.sub-tabs details[open] summary { background: var(--u-soft-2); color: var(--brand); }
.sub-tabs summary svg { width: 16px; height: 16px; }

/* portal header bar */
.portal-top { background: #fff; box-shadow: 0 1px 0 var(--u-line); color: #0f172a; }
.portal-top .brand b, .portal-top b { color: #0f172a; }
.portal-top span { color: #64748b; }
.portal-top a { color: #334155; }

@media (max-width: 980px) {
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .profile-card { padding: 20px; gap: 14px; }
  .profile-card .avatar-xl { width: 64px; height: 64px; font-size: 23px; }
  .profile-card h1 { font-size: 22px; }
  .profile-card .head-actions { margin-left: 0; width: 100%; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat .n { font-size: 22px; }
  .step .s-go { padding: 7px 12px; }
  .bld > summary { padding: 14px 16px; } .bld .bld-body { padding: 14px 16px; }
  .bld > summary .b-amt { display: none; }
}

/* fixes: icon sizes win over the generic .ico, banner text stays white, task lines stack, rows don't stretch */
.stat .ic .ico, .banner .b-ic .ico, .sec-card .t-ic .ico, .empty-state .e-ic .ico, .bld .b-ic .ico { width: 24px; height: 24px; }
.step .s-ic .ico, .row-list .li-ic .ico { width: 20px; height: 20px; }
.steps-card .sc-head h2 .ico, .profile-card .meta .ico { width: 17px; height: 17px; }
.banner, .banner *, .banner:hover * { color: #fff !important; }
.banner .chev { width: 22px; height: 22px; }
.step .s-t, .step .s-s { display: block; }
.dash .row, .dash .split { align-items: start; }
.period-bar form { flex-wrap: nowrap; }
.period-bar form .input { width: auto; min-width: 0; flex: none; }
@media (max-width: 640px) { .period-bar form { flex-wrap: wrap; } }

/* every tab row looks like the segmented tabs */
nav.tabs, div.tabs { display: inline-flex !important; flex-wrap: wrap; gap: 4px; padding: 4px; margin: 0 0 16px;
  background: #eef2f7; border: 0; border-radius: 14px; }
nav.tabs a, div.tabs a { padding: 7px 14px; border-radius: 10px; color: #475569; font-weight: 600; font-size: 13.5px;
  text-decoration: none; box-shadow: none; background: transparent; border: 0; }
nav.tabs a:hover, div.tabs a:hover { color: #0f172a; text-decoration: none; }
nav.tabs a.on, div.tabs a.on, div.tabs a.btn.primary { background: #fff; color: var(--brand); box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }

/* tenant balances: paid up / current (not yet due) / overdue */
.badge.s-current { background: var(--info-bg); color: var(--info); }
td.late, .stat .h .late { color: #b42318; font-weight: 600; }

/* the DFA's finance & admin figures: five across on wide screens */
.stat-grid.fin { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); margin-bottom: 8px; }
.stat-grid.fin > :last-child:nth-child(odd) { grid-column: auto; }
.stat-grid.fin .n { font-size: 24px; }

/* the finance & admin figures as coloured cards, one colour per figure */
.stat-grid.fin .stat { position: relative; border: 0; color: #fff; box-shadow: 0 14px 30px -18px rgba(15, 23, 42, .55); }
.stat-grid.fin .stat .ic { background: rgba(255, 255, 255, .18); color: #fff; }
.stat-grid.fin .stat .n, .stat-grid.fin .stat .n small { color: #fff; }
.stat-grid.fin .stat .l { color: rgba(255, 255, 255, .95); }
.stat-grid.fin .stat .h { color: rgba(255, 255, 255, .8); }
.stat-grid.fin .c-cash { background: linear-gradient(135deg, #10b981, #047857); }
.stat-grid.fin .c-alarm { background: linear-gradient(135deg, #f43f5e, #be123c); }
.stat-grid.fin .c-building { background: linear-gradient(135deg, #f59e0b, #c2410c); }
.stat-grid.fin .c-doc { background: linear-gradient(135deg, #a855f7, #6d28d9); }
.stat-grid.fin .c-check { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.stat-grid.fin .c-pie { background: linear-gradient(135deg, #14b8a6, #0f766e); }
.stat-grid.fin .c-spark { background: linear-gradient(135deg, #6366f1, #4338ca); }
.stat-grid.fin .c-bill { background: linear-gradient(135deg, #0ea5e9, #0369a1); }
.stat-grid.fin .c-key { background: linear-gradient(135deg, #ec4899, #be185d); }
.stat-grid.fin .c-badge { background: linear-gradient(135deg, #475569, #1e293b); }
/* status dot: red needs action, amber watch, green on track */
.stat-grid.fin .flag { position: absolute; top: 12px; right: 12px; width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .9); }
.stat-grid.fin .flag.bad { background: #ef4444; } .stat-grid.fin .flag.warn { background: #fbbf24; }
.stat-grid.fin .flag.ok { background: #22c55e; }

/* the property manager's cards: colours for the icons the finance cards do not use */
.stat-grid.fin .c-inbox { background: linear-gradient(135deg, #f43f5e, #9f1239); }
.stat-grid.fin .c-wrench { background: linear-gradient(135deg, #f97316, #b45309); }
.stat-grid.fin .c-receipt { background: linear-gradient(135deg, #0ea5e9, #0369a1); }
.stat-grid.fin .c-hourglass { background: linear-gradient(135deg, #8b5cf6, #5b21b6); }
.stat-grid.fin .c-calendar { background: linear-gradient(135deg, #14b8a6, #0f766e); }
.stat-grid.fin .c-handshake { background: linear-gradient(135deg, #6366f1, #3730a3); }
.stat-grid.fin .c-pen { background: linear-gradient(135deg, #475569, #1e293b); }
.stat-grid.fin .c-list { background: linear-gradient(135deg, #d97706, #92400e); }

/* lists: one-click views, late dates */
.list-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.list-tabs a { padding: 6px 14px; border-radius: 999px; border: 1px solid #e2e8f0; background: #fff; color: #334155;
  font-size: 13px; font-weight: 600; text-decoration: none; }
.list-tabs a:hover { border-color: #93c5fd; color: #1d4ed8; }
.list-tabs a.on { background: #1d4ed8; border-color: #1d4ed8; color: #fff; }

/* forms in sections */
.form-sec { border-top: 1px solid #eef2f7; padding-top: 18px; margin-top: 18px; }
.form-sec:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.form-sec > h2 { font-size: 15px; font-weight: 700; color: #0f172a; margin: 0 0 12px; }
.form-sec.fold > summary { cursor: pointer; font-size: 15px; font-weight: 700; color: #334155; margin-bottom: 12px; }
.form-sec > .help { margin: -6px 0 12px; }
.checklist .cl-item.cl-off { display: none; }
.checklist.cl-waiting .cl-box::before { content: "Choose the building first."; display: block; grid-column: 1 / -1;
  color: #64748b; font-size: 13px; padding: 4px 2px; }

/* "More" menus in page headers */
details.menu.more .menu-list { min-width: 200px; right: 0; left: auto; }
details.menu.more .menu-list a.danger { color: #dc2626; }
/* menu headings inside long sections */
.side .items .nav-h { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: rgba(255, 255, 255, .45); padding: 10px 12px 2px; }
.side .items .nav-h:first-child { padding-top: 2px; }
.nav-fly .nav-h { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: #94a3b8; padding: 8px 12px 2px; }
/* remove a document: quiet until hovered */
.icon-del { background: none; border: 0; padding: 4px; border-radius: 6px; color: #94a3b8; cursor: pointer;
  display: inline-grid; place-items: center; }
.icon-del:hover, .icon-del:focus-visible { color: #dc2626; background: #fef2f2; }
td.late, .late, table.t td.late, table.t tbody td.late { color: #dc2626 !important; font-weight: 600; }

/* the sticky top bar stays above the page header (z-index 20, polish.css) when the page scrolls under it */
.top { z-index: 40; }

/* dashboard: "Waiting for you" first; figures full width */
.waiting-first { margin-bottom: 22px; }
.dash .figures { margin-bottom: 26px; }
.dash .figures .stat-grid { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.dash .figures .stat-grid > :last-child:nth-child(odd) { grid-column: auto; }

/* tile colour follows its status (red needs action, amber watch, green on track, slate no status);
   every colour keeps white text at 4.5:1 or better */
.stat-grid.fin .stat.tone-bad { background: linear-gradient(135deg, #b91c1c, #7f1d1d); }
.stat-grid.fin .stat.tone-warn { background: linear-gradient(135deg, #b45309, #7c2d12); }
.stat-grid.fin .stat.tone-ok { background: linear-gradient(135deg, #047857, #064e3b); }
.stat-grid.fin .stat.tone-none { background: linear-gradient(135deg, #334155, #1e293b); }
.stat-grid.fin .stat .h { color: rgba(255, 255, 255, .92); }
.stat-grid.fin .flag { display: none; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 640px) {
  /* phone: two compact tiles a row, no icon, so the day's figures fit on one or two screens */
  .stat-grid.fin, .dash .figures .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-grid.fin .stat { padding: 12px 10px; gap: 2px; }
  .stat-grid.fin .stat .ic { display: none; }
  .stat-grid.fin .n { font-size: 20px; }
  .stat-grid.fin .stat .l { font-size: 12.5px; line-height: 1.25; }
  .stat-grid.fin .stat .h { font-size: 11.5px; line-height: 1.25; }
}

/* failed save: one summary at the top, each item jumps to its field */
.form-errors { border: 1px solid #fecaca; background: #fef2f2; color: #7f1d1d; border-radius: 12px; padding: 12px 16px;
  margin: 0 0 16px; outline: none; }
.form-errors b { display: block; margin-bottom: 4px; }
.form-errors ul { margin: 0; padding-left: 18px; }
.form-errors a { color: #991b1b; font-weight: 600; text-decoration: underline; }

/* a save bar under several cards (receipt, manual invoice) */
.form-bar.solo { margin: 16px 0 0; border: 1px solid #edf1f6; border-radius: 14px; box-shadow: 0 -8px 24px -18px rgba(15, 23, 42, .35); }
@media (max-width: 640px) { .form-bar.solo { margin: 12px -4px 0; } }
/* type-to-search above a long drop-down */
.ta-box { margin-bottom: 6px; }
select[data-typeahead][size]:not([size="0"]) { height: auto; padding: 4px; }
.ta-note:empty { display: none; }

/* manual invoice lines: numbers fit their boxes and line up on the right */
table.lines td.n-in .input { text-align: right; min-width: 84px; font-variant-numeric: tabular-nums; }
table.lines .line-total { color: #334155; }

/* reports page in groups */
.rep-group { margin-bottom: 24px; }
.rep-card { color: inherit; text-decoration: none; }
.rep-card:hover { text-decoration: none; box-shadow: 0 14px 30px -20px rgba(15, 23, 42, .35); }
.rep-card h3 { margin: 0 0 6px; font-size: 16px; font-weight: 700; color: var(--sec, var(--brand)); }

/* long settings page: jump links to each part; the page scrolls to a part below the sticky top bar */
nav.jump { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 12px; position: sticky; top: 64px; z-index: 12; }
nav.jump a { padding: 6px 12px; border-radius: 999px; background: #eef2f7; color: #334155; font-size: 13px; font-weight: 600;
  text-decoration: none; }
nav.jump a:hover { background: #e2e8f0; text-decoration: none; }
[id^="set-"] { scroll-margin-top: 130px; }
@media (max-width: 640px) { nav.jump { position: static; } }

/* dashboard header: a compact greeting, not a banner (the figures belong on the first screen) */
.dash .profile-card { padding: 14px 22px; gap: 14px; margin-bottom: 16px; }
.dash .profile-card .avatar-xl { width: 48px; height: 48px; font-size: 17px; box-shadow: none; }
.dash .profile-card h1 { font-size: 21px; margin: 0; }
.dash .profile-card .who .eyebrow { margin-bottom: 0; }
/* nothing waiting: a single line instead of a big empty card */
.caught-up { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 11px 16px; border-radius: 12px;
  background: #ecfdf3; border: 1px solid #c6f0d6; color: #14532d; font-size: 14px; text-decoration: none; }
.caught-up .ico { width: 18px; height: 18px; color: #15803d; flex: none; }
.caught-up span { color: #3f6b50; }
.caught-up:hover { border-color: #86d9a8; }
.waiting-first:has(.caught-up) { margin-bottom: 16px; }
.attn-mini { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.attn-mini .am-h { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #64748b; margin-right: 4px; }
.attn-mini .am { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; background: #fff7e6;
  border: 1px solid #f6dfae; color: #7a4b00; font-size: 13.5px; text-decoration: none; }
.attn-mini .am.bad { background: #fff1f0; border-color: #f7c9c5; color: #a3241a; }
.attn-mini .am .ico { width: 15px; height: 15px; }
.attn-mini .am:hover { filter: brightness(.97); }
@media (max-width: 640px) {
  .dash .profile-card { padding: 12px 14px; }
  .dash .profile-card .avatar-xl { width: 40px; height: 40px; font-size: 15px; }
  .dash .profile-card h1 { font-size: 18px; }
  .caught-up span { display: none; }
}
.split.one { grid-template-columns: 1fr; }
.split.one .stat-grid { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
