/* Dashboard Release A (2026-10-10, docs/dashboard_redesign.md): the navy sidebar on every page, the dashboard's
   clock box and time-zone map card, and the brief's light/dark tokens (as --db-*, so the rest of the CRM keeps
   its own colours: "light mode unchanged"). Loaded after app.css. */

:root {
    /* speed-and-look (2026-10-22): aliases of core/css/tokens.css -- one set of colours for light and dark */
    --db-bg: var(--c-bg);
    --db-surface: var(--c-surface);
    --db-inset: var(--c-surface-2);
    --db-border: var(--c-border);
    --db-text: var(--c-text);
    --db-muted: var(--c-muted);
    --db-link: var(--c-info-solid);
    --db-sidebar: var(--c-sidebar);   /* personalisation: per theme (Cloud's is light) */
    --db-card-shadow: var(--shadow);
    --db-light-card: var(--c-hero);
    --db-light-card-text: var(--c-on-hero);
    --db-clock-muted: var(--c-hero-muted);
    --db-clock-track: var(--c-hero-track);
    --db-clock-btn-border: var(--c-hero-line);
    --db-tab-off: var(--c-tab-off);
    --db-row-selected: var(--c-selected);
    --db-notif-unread: var(--c-surface-2);
    --db-accent: var(--c-bad-solid);
    --db-ok: var(--c-ok); --db-warn: var(--c-warn); --db-bad: var(--c-bad); --db-info: var(--c-info);
    --db-pill-ok-bg: var(--c-ok-bg); --db-pill-ok: var(--c-ok);
    --db-pill-warn-bg: var(--c-warn-bg); --db-pill-warn: var(--c-warn);
    --db-pill-bad-bg: var(--c-bad-bg); --db-pill-bad: var(--c-bad);
    --db-pill-info-bg: var(--c-info-bg); --db-pill-info: var(--c-info);
    --db-pill-grey-bg: var(--c-neutral-bg); --db-pill-grey: var(--c-neutral);
    /* fixed brand colours (both modes) */
    --db-green: var(--c-green); --db-amber: var(--c-amber); --db-red: var(--c-red); --db-navy: var(--c-navy);
    --sidebar-width: 228px;
    --db-map-h: 300px;      /* dashboard-fit: the map card's height from 1100px wide -- 240px below 860px high (see the end) */
}

/* ---------- the sidebar: its colours come with the theme (navy, green, dark or Cloud's light blue) ---------- */
.sidebar { background: var(--db-sidebar); border-right: 0; color: var(--c-nav-text); }
.sidebar-brand { flex-direction: column; align-items: flex-start; gap: 6px; padding: 18px 16px 14px;
    border-bottom: 1px solid var(--c-nav-line); color: var(--c-nav-strong); }
.sidebar-brand-row { display: flex; align-items: center; gap: 8px; }
.sidebar .sidebar-brand-logo { max-height: 56px; max-width: 150px; }
.sidebar-brand-tag { font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
    color: var(--c-nav-tag); line-height: 1; }
.sidebar-link { color: var(--c-nav-text); font-size: 14px; padding: 6px 8px; gap: 10px; border-radius: var(--radius); }
.sidebar-link:hover { background: var(--c-nav-hover); color: var(--c-nav-strong); }
.sidebar-link .icon { width: 32px; height: 32px; border-radius: var(--radius); display: inline-flex; align-items: center;
    justify-content: center; background: var(--c-nav-hover); }
.sidebar-link .icon svg { width: 20px; height: 20px; }
.sidebar-link.active { background: var(--c-nav-active); color: var(--c-nav-strong); font-weight: 600; }
.sidebar-link.active .icon { background: var(--db-red); color: var(--c-on-dark); }
.sidebar-count { background: var(--db-red); color: var(--c-on-dark); }
.sidebar-foot { border-top: 1px solid var(--c-nav-line); padding: 10px 12px; display: flex; flex-direction: column; gap: 10px; }
/* dashboard-fit (owner, 2026-11-08): the logo block on one line (mark + name, small) and a slim bottom -- Collapse and a
   small sun / moon on one row; the person's name and role live only in the top-right initials menu */
.sidebar-brand--one-line { flex-direction: row; align-items: center; gap: 0; padding: 12px 14px; }
.sidebar-brand--one-line .sidebar-brand-row { min-width: 0; gap: 8px; }
.sidebar .sidebar-brand--one-line .sidebar-brand-logo { max-height: 24px; max-width: 32px; flex: none; }
.sidebar-brand--one-line .sidebar-brand-mark { width: 24px; height: 24px; font-size: 11px; flex: none; }
.sidebar-brand--one-line .sidebar-brand-name { font-size: 13px; font-weight: 700; line-height: 1.2; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.sidebar-foot--slim { flex-direction: row; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px; }
.sidebar-foot--slim .sidebar-collapse-btn { flex: 1 1 auto; border-top: 0; margin: 0; }
.sidebar-mode-btn { flex: none; width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--c-nav-line-strong); border-radius: var(--radius); background: transparent; color: var(--c-nav-text);
    cursor: pointer; font-size: 15px; line-height: 1; padding: 0; }
.sidebar-mode-btn:hover { background: var(--c-nav-hover); color: var(--c-nav-strong); }
.sidebar-mode-btn:focus-visible { outline: 2px solid var(--c-nav-focus); outline-offset: 2px; }
body.sidebar-collapsed .sidebar-foot--slim { flex-direction: column; }
.sidebar-theme-btn { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 8px; border: 1px solid var(--c-nav-line-strong);
    border-radius: var(--radius); background: transparent; color: var(--c-nav-text); font-size: 13px; cursor: pointer; }
.sidebar-theme-btn:hover { background: var(--c-nav-hover); color: var(--c-nav-strong); }
.sidebar-user { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sidebar-user .avatar-circle { flex-shrink: 0; }
.sidebar-user-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.sidebar-user-name { color: var(--c-nav-strong); font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user-role { color: var(--c-nav-muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-collapse-btn { color: var(--c-nav-muted); border-top: 1px solid var(--c-nav-line); }
.sidebar-collapse-btn:hover { background: var(--c-nav-hover); color: var(--c-nav-strong); }
body.sidebar-collapsed .sidebar-brand { align-items: center; }
body.sidebar-collapsed .sidebar-brand-tag,
body.sidebar-collapsed .sidebar-user-text,
body.sidebar-collapsed .sidebar-theme-btn .sidebar-link-label { display: none; }
body.sidebar-collapsed .sidebar-theme-btn { justify-content: center; }
body.sidebar-collapsed .sidebar-link .icon { width: 32px; }
.sidebar a:focus-visible, .sidebar button:focus-visible { outline: 2px solid var(--c-nav-focus); outline-offset: 2px; }
/* dashboard-fit (2026-10-11): only the menu scrolls; the logo stays at the top and the theme switch, the user block
   and Collapse stay at the bottom. Needed below 900px high (1366x768 clipped the Owner's menu, the longest) and
   applied at every height, since the Owner's menu also overran a 1080px-high window. */
.sidebar { overflow: hidden; }
.sidebar-brand, .sidebar-foot, .sidebar-collapse-btn { flex: none; }
.sidebar-nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }

/* ---------- dashboard cards ---------- */
.db-card { background: var(--db-surface); color: var(--db-text); border-radius: var(--radius); box-shadow: var(--db-card-shadow);
    padding: 14px 16px; transition: transform .15s ease; }
.db-card:hover { transform: translateY(-1px); }
.db-pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.db-pill.ok { background: var(--db-pill-ok-bg); color: var(--db-pill-ok); }
.db-pill.warn { background: var(--db-pill-warn-bg); color: var(--db-pill-warn); }
.db-pill.bad { background: var(--db-pill-bad-bg); color: var(--db-pill-bad); }
.db-pill.info { background: var(--db-pill-info-bg); color: var(--db-pill-info); }
.db-pill.grey { background: var(--db-pill-grey-bg); color: var(--db-pill-grey); }
@keyframes db-fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.db-fade { animation: db-fade .35s ease both; }
@media (prefers-reduced-motion: reduce) { .db-fade { animation: none; } .db-card:hover { transform: none; } }

/* ---------- clock box ---------- */
.db-clock { background: var(--db-light-card); color: var(--db-light-card-text); }
.db-clock-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; }
.db-clock-shift { color: var(--db-clock-muted); font-weight: 600; }
.db-clock-status { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.db-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--db-clock-muted); }
.db-clock[data-state="in"] .db-dot { background: var(--c-live); }
.db-clock[data-state="break"] .db-dot { background: var(--db-amber); }
.db-clock-main { display: flex; align-items: baseline; flex-wrap: wrap; column-gap: 8px; margin: 8px 0 2px; }
.db-clock-timer { font-size: 38px; font-weight: 700; letter-spacing: 0.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.db-clock-sub { font-size: 12px; color: var(--db-clock-muted); }
.db-clock-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 12px 0 10px; font-size: 12px; }
.db-clock-facts dt { color: var(--db-clock-muted); font-weight: 500; }
.db-clock-facts dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.db-clock-track { height: 6px; border-radius: 999px; background: var(--db-clock-track); overflow: hidden; }
.db-clock-track > span { display: block; height: 100%; background: var(--c-live); border-radius: 999px; }
.db-clock[data-state="break"] .db-clock-track > span { background: var(--db-amber); }
.db-clock-goal { display: flex; justify-content: space-between; font-size: 12px; color: var(--db-clock-muted); margin-top: 4px; }
.db-clock-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.db-clock-btns form { margin: 0; }
.db-clock-btn { width: 100%; min-height: 38px; border-radius: var(--radius); font-weight: 700; font-size: 14px; cursor: pointer;
    border: 1px solid var(--db-clock-btn-border); background: transparent; color: inherit; }
.db-clock-btn:disabled { opacity: .45; cursor: not-allowed; }
.db-clock-btn.is-break { background: var(--db-amber); border-color: var(--db-amber); color: var(--c-on-light); }
.db-clock-btn.is-in { background: var(--db-green); border-color: var(--db-green); color: var(--c-on-dark); }
.db-clock-btn.is-out { background: var(--db-red); border-color: var(--db-red); color: var(--c-on-dark); }
.db-clock-btn:focus-visible { outline: 2px solid var(--c-nav-focus); outline-offset: 2px; }
.db-clock { position: relative; }
.db-punches { margin-top: 14px; border-top: 1px solid var(--db-clock-btn-border); padding-top: 10px; }
.db-punches-more { display: none; font-size: 12px; font-weight: 600; color: inherit; }
.db-punches h3 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.db-punches h3 .db-clock-link { margin: 0; text-transform: none; letter-spacing: 0; font-size: 12px; color: var(--db-light-card-text); }
.db-punches h3 { font-size: 12px; font-weight: 700; margin: 0 0 6px; color: var(--db-clock-muted); text-transform: uppercase; letter-spacing: .06em; }
.db-punches ol { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.db-punches li { display: grid; grid-template-columns: 52px 1fr; gap: 6px; padding: 3px 0; }
.db-punches time { font-variant-numeric: tabular-nums; font-weight: 700; }
.db-punches small { color: var(--db-clock-muted); }
.db-clock-link { display: inline-block; margin-top: 10px; font-size: 13px; font-weight: 600; color: inherit; }
.db-clock-link:hover { color: inherit; text-decoration: underline; }

/* ---------- time-zone map (dashboard-fit: maps left, the side column under the dashboard's right column) ---------- */
.db-tz { grid-area: map; min-width: 0; scroll-margin-top: 72px; display: grid; grid-template-columns: minmax(0, 1fr) var(--db-col-r);
    column-gap: 0; }
.db-tz-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding-right: 16px; }
.db-tz-head { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-bottom: 6px; }
.db-tz-title { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--db-muted); margin: 0; }
.db-tz-title span { text-transform: none; letter-spacing: 0; font-weight: 600; }
.db-tz-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.db-tz-chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; background: var(--db-inset);
    font-size: 12px; font-weight: 600; color: var(--db-text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.db-tz-chip i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.db-tz-body { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; align-items: stretch; flex: 1 1 auto; min-height: 0; }
.db-tz-map { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.db-tz-map svg { width: 100%; height: auto; display: block; }
.db-tz-map path { stroke: var(--db-surface); stroke-width: 1; cursor: pointer; transition: filter .1s; }
.db-tz-map path.is-hover { filter: brightness(0.78); }
.db-tz-map-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.db-tz-side { display: flex; flex-direction: column; gap: 8px; min-width: 0; min-height: 0; border-left: 1px solid var(--db-border);
    padding-left: 14px; }
.db-tz-hover { background: var(--db-light-card); color: var(--db-light-card-text); border-radius: var(--radius); padding: 10px 12px; }
.db-tz-k { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--db-clock-muted); margin-bottom: 2px; }
.db-tz-k--muted { color: var(--db-muted); margin: 2px 0 0; }
.db-tz-panel { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; }
.db-tz-panel > * { grid-column: 1 / -1; }
.db-tz-panel > .db-tz-panel-time { grid-column: 1; }
.db-tz-panel > .db-tz-badge { grid-column: 2; grid-row: 2; justify-self: start; margin-top: 0; }
.db-tz-panel-name { font-weight: 700; font-size: 15px; }
.db-tz-panel-time { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.15; }
.db-tz-panel-sub { font-size: 12px; color: var(--db-clock-muted); }
.db-tz-panel-note { font-size: 12px; margin-top: 4px; color: var(--db-clock-muted); }
.db-tz-countries { display: flex; flex-direction: column; gap: 6px; min-height: 0; }
.db-tz-country { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; column-gap: 10px; align-items: center;
    padding: 6px 10px; border-radius: var(--radius); border: 1px solid var(--db-border); background: var(--db-surface); }
.db-tz-cc { width: 30px; height: 30px; border-radius: var(--radius); background: var(--db-pill-info-bg); color: var(--db-pill-info); font-size: 11px;
    font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.db-tz-country-head { min-width: 0; display: flex; flex-direction: column; font-size: 12px; line-height: 1.3; }
.db-tz-country-head b { color: var(--db-text); font-size: 13px; }
.db-tz-country-head span { color: var(--db-muted); }
.db-tz-country-end { text-align: right; }
.db-tz-country-time { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--db-text); white-space: nowrap; line-height: 1.2; }
.db-tz-country .db-tz-badge { margin-top: 2px; white-space: nowrap; }
.db-tz-tip { position: fixed; z-index: 1000; pointer-events: none; background: var(--c-navy); color: var(--c-on-dark); border-radius: var(--radius);
    padding: 10px 12px; box-shadow: var(--shadow-pop); min-width: 190px; max-width: 260px; font-size: 12px; }
.db-tz-tip[hidden] { display: none; }
.db-tz-tip b { display: block; font-size: 13px; }
.db-tz-tip .t { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; }
.db-tz-tip .n { color: var(--c-on-navy-muted); margin-top: 4px; }
.db-tz-badge { display: inline-block; margin-top: 6px; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.db-tz-badge.good { background: var(--c-ok-bg); color: var(--c-ok); }
.db-tz-badge.borderline { background: var(--c-warn-bg); color: var(--c-warn); }
.db-tz-badge.night { background: var(--c-neutral-bg); color: var(--c-neutral); }
.db-tz-credit { flex: none; line-height: 14px; margin: 4px 0 0; font-size: 10px; color: var(--db-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.db-tz-credit:hover { white-space: normal; }
@media (max-width: 1099.98px) {
    .db-tz { grid-template-columns: minmax(0, 1fr); row-gap: 12px; }
    .db-tz-main { padding-right: 0; }
    .db-tz-side { border-left: 0; padding-left: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
    .db-tz-credit { white-space: normal; }
}
@media (max-width: 900px) { .db-tz-body { display: none; } }

/* ---------- Release B: the role dashboard (dashboard/_role.html) ---------- */
/* top bar on the dashboard: the greeting is the page title, the role's buttons sit after the bell (reference) */
.topbar-title:has(.tb-greet) { display: flex; flex-direction: column; line-height: 1.2; }
.tb-greet { font-size: 17px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.tb-date { font-size: 12px; font-weight: 500; color: var(--text-muted); }
.db-actions { display: flex; flex-wrap: nowrap; gap: 8px; align-items: center; flex: none; }
.topbar:has(.db-actions) .topbar-search { max-width: 380px; min-width: 220px; }
.db-exec-filter select { min-height: 34px; max-width: 190px; border-radius: var(--radius); border: 1px solid var(--db-border); background: var(--db-inset); color: var(--db-text); padding: 0 10px; font-size: 13px; }
.db-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 34px; padding: 0 14px; border-radius: var(--radius);
    border: 1px solid var(--db-border); background: var(--db-surface); color: var(--db-text); font-weight: 600; font-size: 13px; text-decoration: none; cursor: pointer; white-space: nowrap; }
.db-btn:hover { text-decoration: none; filter: brightness(0.97); color: var(--db-text); }
.db-btn--primary { background: var(--db-light-card); color: var(--db-light-card-text); border-color: var(--db-light-card); }
.db-btn--primary:hover { color: var(--db-light-card-text); }
.db-btn--light { background: var(--db-light-card-text); color: var(--db-light-card); border-color: transparent; }
.db-btn--light:hover { color: var(--db-light-card); }
.db-btn--ok { background: var(--db-green); color: var(--c-on-dark); border-color: var(--db-green); min-height: 30px; padding: 0 10px; font-size: 12px; }
.db-btn--bad { background: var(--db-red); color: var(--c-on-dark); border-color: var(--db-red); min-height: 30px; padding: 0 10px; font-size: 12px; }
.db-btn--ok:hover, .db-btn--bad:hover { color: var(--c-on-dark); }
.db-btn:focus-visible, .db-tab:focus-visible, .db-row:focus-visible, .db-tile:focus-visible, .db-chip:focus-visible { outline: 2px solid var(--db-link); outline-offset: 2px; }
/* "More": the earlier dashboard, whole, in a panel under the top-bar button */
.db-more { position: relative; }
.db-more > summary { list-style: none; }
.db-more > summary::-webkit-details-marker { display: none; }
.db-more[open] > summary { background: var(--db-inset); }
.db-more-panel { position: absolute; right: 0; top: calc(100% + 10px); z-index: 40; width: min(960px, calc(100vw - 32px));
    max-height: 70vh; overflow-y: auto; border: 1px solid var(--db-border); font-weight: 400; }
.db-more-panel:hover { transform: none; }

/* dashboard-fit (2026-10-10): ONE grid, the same slots in the same places for every role (_role.html). Columns
   as in the owner's reference: left and right the same width, the centre takes the rest. */
:root { --db-col-l: clamp(260px, 20vw, 320px); --db-col-r: clamp(260px, 20vw, 320px); --db-gap: 12px; }
.db-grid { display: grid; gap: var(--db-gap); grid-template-columns: var(--db-col-l) minmax(0, 1fr) var(--db-col-r);
    grid-template-areas: "left tiles tiles" "left list side" "left low next" "map map map"; }
.db-left { grid-area: left; display: flex; flex-direction: column; gap: var(--db-gap); min-width: 0; }
.db-tiles { grid-area: tiles; }
.db-list { grid-area: list; min-width: 0; }
.db-selected { grid-area: side; min-width: 0; }
.db-low { grid-area: low; min-width: 0; }
.db-next { grid-area: next; min-width: 0; }
.db-card-h { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; margin: 0 0 8px; color: var(--db-muted); }
.db-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--db-gap); }
.db-tile { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "label label" "value value" "note note";
    align-content: center; column-gap: 8px; padding: 10px 14px; border-radius: var(--radius); background: var(--db-surface);
    box-shadow: var(--db-card-shadow); border-top: 3px solid var(--db-info); color: var(--db-text); text-decoration: none; min-width: 0; overflow: hidden; }
.db-tile:hover { text-decoration: none; color: var(--db-text); transform: translateY(-1px); }
.db-tile--ok { border-top-color: var(--db-ok); } .db-tile--warn { border-top-color: var(--db-amber); }
.db-tile--bad { border-top-color: var(--db-accent); } .db-tile--info { border-top-color: var(--db-link); }
.db-tile--empty { border-top-color: var(--db-border); }
.db-tile-label { grid-area: label; font-size: 12px; color: var(--db-muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 18px; }
.db-tile:has(.db-spark) .db-tile-label { padding-right: 0; }
.db-tile-value { grid-area: value; font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.15; }
.db-tile-note { grid-area: note; font-size: 11px; color: var(--db-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 16px; }
.db-spark { width: 64px; height: 22px; position: absolute; right: 14px; top: 30px; }
.db-tile--ok .db-spark { color: var(--db-ok); } .db-tile--warn .db-spark { color: var(--db-amber); }
.db-tile--bad .db-spark { color: var(--db-accent); } .db-tile--info .db-spark { color: var(--db-link); }
.db-tile:has(.db-spark) .db-tile-value { padding-right: 70px; }
.db-list-head { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; min-width: 0; }
.db-list-head .db-exec-filter select { min-height: 30px; max-width: 120px; font-size: 12px; padding: 0 6px; }
.db-list-link { flex: none; font-size: 12px; font-weight: 600; color: var(--db-link); white-space: nowrap; }
.db-list-link:hover { color: var(--db-link); }
.db-tabs { display: flex; flex-wrap: wrap; gap: 4px; background: var(--db-inset); padding: 3px; border-radius: var(--radius); flex: 1 1 auto; min-width: 0; }
.db-tab { border: 0; background: var(--db-tab-off); color: var(--db-text); font-weight: 600; font-size: 13px; padding: 5px 11px; border-radius: var(--radius); cursor: pointer; }
.db-tab[aria-selected="true"] { background: var(--db-light-card); color: var(--db-light-card-text); }
.db-tab-n { font-variant-numeric: tabular-nums; opacity: .8; font-size: 11px; }
.db-rows { list-style: none; margin: 0; padding: 0; }
.db-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 5px 6px;
    border-bottom: 1px solid var(--db-border); cursor: pointer; border-radius: var(--radius); }
.db-row:last-child { border-bottom: 0; }
.db-row:hover { background: var(--db-row-selected); }
.db-row.is-selected { background: var(--db-row-selected); box-shadow: inset 3px 0 0 var(--db-link); }
/* 2026-10-22 readability: list text 14px, secondary 12px (was 13 / 11) */
.db-row-main { min-width: 0; font-size: 14px; line-height: 1.35; color: var(--db-text); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.db-row-main b { font-weight: 600; }
.db-row-main small, .db-owner { color: var(--db-muted); font-size: 12px; }
/* My Work Today: Overdue / Today / Upcoming headings inside the one list */
.db-group { list-style: none; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--db-muted);
    padding: 8px 6px 4px; border-bottom: 1px solid var(--db-border); }
.db-group--overdue { color: var(--db-bad); }
.db-row-time { font-size: 12px; line-height: 1.3; color: var(--db-muted); text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.db-row-forms { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.db-row-forms form { display: flex; gap: 6px; margin: 0; }
.db-row-forms input[type=text] { min-height: 30px; border-radius: var(--radius); border: 1px solid var(--db-border); background: var(--db-inset); color: var(--db-text); padding: 0 8px; font-size: 12px; width: 140px; }
.db-av { width: 28px; height: 28px; border-radius: 50%; background: var(--db-pill-info-bg); color: var(--db-pill-info); display: inline-flex;
    align-items: center; justify-content: center; font-weight: 700; font-size: 11px; }
.db-empty { color: var(--db-muted); font-size: 14px; margin: 6px 0; }
.db-sel-name { font-weight: 700; margin: 0 0 6px; }
.db-sel-facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; font-size: 13px; margin: 0 0 12px; }
.db-sel-facts dt { color: var(--db-muted); font-weight: 500; } .db-sel-facts dd { margin: 0; }
/* Quick actions as a list of rows with a chevron (reference) */
.db-chips { display: flex; flex-direction: column; gap: 6px; }
.db-chip { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px; border-radius: var(--radius); border: 1px solid var(--db-border);
    background: var(--db-surface); color: var(--db-text); font-size: 13px; font-weight: 600; text-decoration: none; }
.db-chip span { color: var(--db-muted); font-weight: 700; }
.db-chip:hover { color: var(--db-text); text-decoration: none; background: var(--db-row-selected); }
/* the weekly chart and the breakdown share one card (reference) */
.db-low { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: stretch; }
.db-stack { border-left: 1px solid var(--db-border); padding-left: 16px; min-width: 0; }
.db-chart { min-width: 0; }
.db-bars { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; height: 150px; }
.db-bar { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; justify-items: center; row-gap: 3px; height: 100%; }
.db-bar-track { width: 24px; border-radius: 999px; background: var(--db-inset); display: flex; align-items: flex-end; overflow: hidden; min-height: 0; }
.db-bar-fill { width: 100%; border-radius: 999px; background: var(--db-link); height: 0; transition: height .5s ease; }
.db-bar.is-future .db-bar-track { opacity: .5; }
.db-bar b { order: -1; font-size: 11px; line-height: 14px; font-variant-numeric: tabular-nums; color: var(--db-text); }
.db-bar small { font-size: 11px; line-height: 13px; color: var(--db-muted); }
.db-next { background: var(--db-light-card); color: var(--db-light-card-text); }
.db-next .db-card-h { color: var(--db-clock-muted); }
.db-next-line { font-weight: 700; font-size: 15px; margin: 0 0 4px; }
.db-next-time { font-size: 12px; margin: 0 0 10px; font-variant-numeric: tabular-nums; }
.db-next-time small { color: var(--db-clock-muted); }
.db-next-btn { width: 100%; }
.db-week-list { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.db-week-list li { display: grid; grid-template-columns: minmax(0, 1fr) 56px 28px; gap: 8px; align-items: center; padding: 4px 0;
    border-bottom: 1px solid var(--db-border); line-height: 1.3; }
.db-week-list li:last-child { border-bottom: 0; }
.db-week-list li > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-week-list b { font-variant-numeric: tabular-nums; text-align: right; }
.db-week-bar { display: block; height: 5px; border-radius: 999px; background: var(--db-inset); overflow: hidden; }
.db-week-bar > i { display: block; height: 100%; background: var(--db-link); border-radius: 999px; }
.db-stackbar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--db-inset); gap: 2px; }
.db-stackbar span { display: block; height: 100%; }
/* the breakdown legend as rows with the count on the right (reference) */
.db-legend { list-style: none; display: flex; flex-direction: column; gap: 2px; margin: 8px 0 0; padding: 0; font-size: 12px; color: var(--db-muted); }
.db-legend li { display: flex; align-items: center; }
.db-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; flex: none; }
.db-legend b { color: var(--db-text); margin-left: auto; font-variant-numeric: tabular-nums; }

/* below 1100px: the stacked layout, normal page scrolling; the top bar takes the actions on a second row */
@media (max-width: 1099.98px) {
    .db-grid { grid-template-columns: 300px minmax(0, 1fr); align-items: start;
        grid-template-areas: "left tiles" "left list" "left side" "left low" "left next" "map map"; }
    .db-low { grid-template-columns: minmax(0, 1fr); }
    .db-stack { border-left: 0; padding-left: 0; }
    .db-rows { max-height: 420px; overflow-y: auto; }
    .topbar:has(.db-actions) { flex-wrap: wrap; height: auto; min-height: var(--topbar-height); padding-top: 8px; padding-bottom: 8px; row-gap: 8px; position: static; }
    .db-actions { order: 10; flex: 1 1 100%; flex-wrap: wrap; justify-content: flex-end; }
}
@media (max-width: 900px) {
    .db-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "left" "tiles" "list" "side" "low" "next" "map"; }
    .db-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) { .db-more[open] { flex-basis: 100%; } .db-more-panel { position: static; width: auto; max-height: none; margin-top: 6px; } }

/* from 1100px: one screen high, no page scroll. The map card has one fixed height per screen-height breakpoint
   (--db-map-h: 300px from 860px high, 240px below), identical for every role; the rows above share the rest. The
   clock box has a fixed height that holds its whole content (punches capped at two lines + "N more"), so it never
   scrolls; the list, This week, Quick actions / Next up and the breakdown legend scroll inside their own card. */
@media (min-width: 1100px) {
    :root { --db-tiles-h: 86px; --db-clock-h: 286px; --db-gap: 12px; }
    html:has(.db-page), html:has(.db-page) body { height: 100%; }
    .main-col:has(.db-page) { height: 100vh; min-height: 0; }
    /* the top bar and footer keep their own height; only the dashboard gives way (else the bar shrank by role) */
    .main-col:has(.db-page) > .topbar, .main-col:has(.db-page) > .app-footer { flex: none; }
    .main-col:has(.db-page) > .app-footer { padding-top: 4px; padding-bottom: 4px; }
    .content:has(.db-page) { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; padding-top: var(--db-gap); padding-bottom: var(--db-gap); }
    /* dashboard-fit (owner, 2026-11-08, the 10 Oct rule again): one screen, no vertical scroll at 1920x1080 and
       1366x768 -- the map keeps its fixed height and is always fully visible; the cards above share what is left and
       scroll inside themselves (the list, This week, the side cards, the legend). This replaces 2026-10-22's floor
       (tiles + 520px + map), which made the whole dashboard scroll on a laptop and pushed the map off the screen. */
    .content:has(.db-page) { overflow: hidden; }
    .db-page { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
    .db-grid { flex: 1 1 auto; height: 0; min-height: 0; grid-template-rows: var(--db-tiles-h) minmax(0, 1.6fr) minmax(0, 1fr) var(--db-map-h); }
    .db-left { overflow: hidden; }
    .db-list, .db-low, .db-chart, .db-stack { overflow: hidden; }
    .db-grid .db-card { padding: 12px 14px; }
    .db-scroll { min-height: 0; overflow-y: auto; }
    .db-left { min-height: 0; }
    .db-clock { flex: none; height: var(--db-clock-h); overflow: hidden; display: flex; flex-direction: column; padding-top: 8px; padding-bottom: 8px; }
    .db-clock-main { margin: 4px 0 0; }
    .db-clock-timer { font-size: 30px; }
    .db-clock-facts { margin: 4px 0 6px; }
    .db-clock-facts dd, .db-clock-facts dt { line-height: 1.2; }
    /* the progress bar and its goal on one line */
    .db-clock-progress { display: flex; align-items: center; gap: 8px; }
    .db-clock-track { flex: 1 1 auto; }
    .db-clock-goal { margin: 0; gap: 4px; white-space: nowrap; }
    .db-punches li { line-height: 17px; }
    .db-punches-more { line-height: 17px; }
    .db-clock-btns { margin-top: 8px; }
    .db-clock-btn { min-height: 30px; }
    .db-punches { margin-top: 6px; padding-top: 5px; }
    .db-punches h3 { margin-bottom: 0; line-height: 16px; }
    .db-punches li { padding: 1px 0; }
    .db-punches li br { display: none; }
    .db-punches li small::before { content: " · "; }
    .db-punches li span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .db-punch-extra { display: none !important; }
    .db-punches-more { display: inline-block; }
    .db-week { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; }
    .db-week-list { flex: 1 1 auto; }
    .db-tile { height: var(--db-tiles-h); padding-top: 8px; padding-bottom: 8px; }
    .db-tile-value { font-size: 26px; line-height: 30px; }
    .db-list { display: flex; flex-direction: column; min-height: 0; }
    .db-list-head { flex: none; }
    .db-tabs { flex-wrap: nowrap; overflow-x: auto; }
    .db-tab { padding: 5px 7px; white-space: nowrap; }
    .db-tabs { gap: 2px; }
    .db-panel { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
    .db-panel[hidden] { display: none; }
    .db-rows { flex: 1 1 auto; }
    .db-selected, .db-next { min-height: 0; overflow-y: auto; }
    .db-low { min-height: 0; }
    .db-chart, .db-stack { min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
    .db-bars { flex: 1 1 auto; min-height: 0; height: auto; }
    .db-legend { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
    .db-tz { height: var(--db-map-h); min-height: 0; }
    .db-tz-main, .db-tz-side { min-height: 0; overflow: hidden; }
    .db-tz-map svg { flex: 1 1 auto; min-height: 0; height: 100%; }
    .db-tz-countries { flex: 1 1 auto; justify-content: space-between; }
    .db-tz-side { gap: 6px; }
    .db-tz-k { line-height: 12px; }
    .db-tz-country { flex: 1 1 0; min-height: 0; padding-top: 3px; padding-bottom: 3px; }
}
/* short screens (below 860px high, e.g. 1366x768): smaller map, compact tiles, tighter spacing -- the work area
   keeps 3 list rows, 4 of the 5 This week rows, the whole clock box and chart bars of 48px or more */
@media (min-width: 1100px) and (max-height: 859.98px) {
    :root { --db-map-h: 240px; --db-tiles-h: 64px; --db-gap: 8px; }
    .db-grid .db-card { padding: 10px 12px; }
    .db-tile { padding: 6px 12px; grid-template-areas: "label label" "value note"; }
    .db-tile-value { font-size: 24px; }
    .db-tile-note { align-self: center; }
    .db-spark { top: auto; bottom: 9px; height: 18px; }
    .db-tile:has(.db-spark) .db-tile-value { padding-right: 0; }
    .db-tile:has(.db-spark) .db-tile-note { padding-right: 72px; }
    .db-card-h { margin-bottom: 6px; }
    .db-week-list li { padding: 2px 0; }
    .db-tz-head { gap: 4px; margin-bottom: 4px; }
    .db-tz-title { line-height: 13px; white-space: nowrap; }
    .db-tz-title span { display: none; }
    .db-tz-chips { flex-wrap: nowrap; gap: 4px; }
    .db-tz-chip { padding: 2px 7px; }
    .db-tz-hover { padding: 4px 10px; }
    .db-tz-panel-time { font-size: 18px; }
    .db-tz-panel-sub { font-size: 11px; line-height: 14px; }
    .db-tz-panel .db-tz-badge { margin-top: 2px; }
    .db-tz-side { gap: 4px; }
    .db-tz-cc { width: 22px; height: 22px; font-size: 10px; border-radius: var(--radius); }
    .db-tz-country { grid-template-columns: 22px minmax(0, 1fr) auto; padding: 0 8px; column-gap: 8px; }
    .db-tz-country-head { line-height: 1.15; }
    .db-tz-country-head b { font-size: 12px; }
    .db-tz-country-time { font-size: 13px; line-height: 1.1; }
    .db-tz-country .db-tz-badge { font-size: 10px; padding: 0 6px; }
    .db-tz-panel-name { font-size: 13px; }
    .db-tz-k--muted { margin: 0; }
    .db-tz-country .db-tz-badge { margin-top: 0; }
}
@media (max-width: 480px) { .db-row { grid-template-columns: 28px minmax(0, 1fr); } .db-row-time, .db-row .db-pill { grid-column: 2; text-align: left; justify-self: start; } }

/* dashboard-fit (owner, 2026-11-08): attendance isn't tracked for this person -- one compact line in the clock slot
   (Owner / Admin / HR: the team's figures and a link), so This week gets the room */
.db-att-mini { flex: none; padding: 10px 14px; }
.db-att-mini-line { margin: 0; font-size: 13px; line-height: 1.45; color: var(--db-text); }
.db-att-mini-k { font-weight: 700; }
.db-att-mini-link { white-space: nowrap; margin-left: 4px; }
