/* Counter Counter: calm glass theme. Mobile-first; media queries widen for tablets.

   The look: a soft teal-to-slate backdrop, with a few large frosted-glass surfaces (header, bottom
   navigation, cards) over it. Anything people have to read quickly (tables, forms, tiles, long
   lists) sits on a mostly opaque surface, and the KPI colour bubbles stay solid. Text and surface
   colours are chosen so that text keeps at least 4.5:1 contrast on the WORST part of the backdrop;
   tests/test_theme.py checks the tokens below. Blur is used on a handful of big surfaces only (it
   is costly on older tablets) and falls back to a nearly solid colour where unsupported. */

@font-face {
  font-family: "Inter";
  src: url("/static/vendor/fonts/inter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* ink */
  --text: #14262a;
  --muted: #445a5e;
  --primary: #1f7a6d;
  --primary-dark: #165c52;
  --primary-soft: rgba(31, 122, 109, 0.12);
  --danger: #b3261e;
  --danger-dark: #8c1d18;

  /* the backdrop: three gradient stops and two soft glows (see body and body::before) */
  --bg-a: #d6ece7;
  --bg-b: #e4edf2;
  --bg-c: #d3e0ea;
  --glow-teal: rgba(31, 122, 109, 0.16);
  --glow-blue: rgba(63, 105, 160, 0.14);

  /* glass: translucent white. "strong" is for anything with text to read. */
  --glass: rgba(255, 255, 255, 0.62);
  --glass-strong: rgba(255, 255, 255, 0.82);
  --glass-solid: rgba(255, 255, 255, 0.94);
  --glass-edge: rgba(255, 255, 255, 0.8);
  --solid: #f6faf9; /* fully opaque, for sticky table cells */
  --field: rgba(255, 255, 255, 0.92);
  --border: rgba(20, 60, 66, 0.14);
  --surface: var(--glass-strong);
  --blur: blur(18px) saturate(1.35);

  /* depth */
  --shadow-sm: 0 1px 2px rgba(18, 52, 58, 0.06), 0 4px 14px rgba(18, 52, 58, 0.07);
  --shadow: 0 2px 4px rgba(18, 52, 58, 0.06), 0 14px 36px rgba(18, 52, 58, 0.12);
  --highlight: inset 0 1px 0 rgba(255, 255, 255, 0.9);

  /* shape and space */
  --radius: 14px;
  --radius-lg: 22px;
  --nav-height: 64px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html { background: var(--bg-b); }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.5;
  color: var(--text);
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
  background: linear-gradient(160deg, var(--bg-a) 0%, var(--bg-b) 48%, var(--bg-c) 100%) fixed;
  padding-bottom: calc(var(--nav-height) + 40px);
}
/* two soft glows behind everything, to give the glass something to frost */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(60vmax 50vmax at 8% -6%, var(--glow-teal), transparent 70%),
    radial-gradient(55vmax 45vmax at 100% 100%, var(--glow-blue), transparent 70%);
}

h1, h2, h3 { letter-spacing: -0.018em; font-weight: 650; line-height: 1.2; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; }
a { color: var(--primary-dark); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid rgba(31, 122, 109, 0.7); outline-offset: 2px; border-radius: 6px; }

/* ---- the big glass surfaces: header, navigation, cards, charts ---- */
.app-header, .bottom-nav, .card, .chart-card, .toast {
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
}
.app-header, .bottom-nav { background: var(--glass); border: 1px solid var(--glass-edge); box-shadow: var(--shadow), var(--highlight); }
.card, .chart-card { background: var(--glass-strong); border: 1px solid var(--glass-edge); box-shadow: var(--shadow-sm), var(--highlight); }

/* Where the browser cannot blur, use a nearly solid colour so text stays readable. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .app-header, .bottom-nav { background: var(--glass-solid); }
  .card, .chart-card { background: var(--glass-solid); }
}

.app-header {
  position: sticky;
  top: 10px;
  z-index: 20;
  margin: 10px 12px 0;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-radius: var(--radius-lg);
}
.app-logo {
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(18, 52, 58, 0.28);
}
.home-logo { display: block; margin: 0 auto 12px; border-radius: 20px; box-shadow: var(--shadow); }
.app-name { margin: 0; font-size: 1.3rem; font-weight: 700; letter-spacing: -0.02em; }
.tagline { margin: 1px 0 0; font-size: 0.88rem; color: var(--muted); }

.app-main {
  max-width: 960px;
  margin: 0 auto;
  padding: 18px 16px;
}

.card {
  border-radius: var(--radius-lg);
  padding: 22px;
}
.card h2 { margin-top: 0; }

/* ---- buttons ---- */
.btn {
  display: inline-block;
  min-height: 48px; /* big tap target */
  padding: 12px 22px;
  background: linear-gradient(180deg, #218074 0%, var(--primary) 55%, #1a6c60 100%);
  color: #fff;
  border: 0;
  border-radius: var(--radius);
  text-decoration: none;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  letter-spacing: -0.003em;
  box-shadow: 0 1px 2px rgba(18, 52, 58, 0.2), 0 6px 14px rgba(31, 122, 109, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.28);
  transition: transform 140ms var(--ease), box-shadow 140ms var(--ease), background 140ms var(--ease);
}
.btn:hover { background: linear-gradient(180deg, #1f7a6d 0%, var(--primary-dark) 100%); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.98); box-shadow: 0 1px 2px rgba(18, 52, 58, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.2); }
.btn-block { display: block; width: 100%; }
.btn-secondary {
  background: var(--glass-strong);
  color: var(--primary-dark);
  border: 1.5px solid rgba(31, 122, 109, 0.5);
  box-shadow: var(--shadow-sm), var(--highlight);
}
.btn-secondary:hover { background: var(--solid); color: var(--primary-dark); border-color: var(--primary); }
.btn-danger { background: linear-gradient(180deg, #bd2f27 0%, var(--danger) 55%, #9d231c 100%); box-shadow: 0 1px 2px rgba(18, 52, 58, 0.2), 0 6px 14px rgba(179, 38, 30, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.25); }
.btn-danger:hover { background: linear-gradient(180deg, var(--danger) 0%, var(--danger-dark) 100%); }
.btn-small { min-height: 36px; padding: 6px 14px; margin-top: 8px; font-size: 0.95rem; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; }

/* ---- bottom navigation: a floating glass bar ---- */
.bottom-nav {
  position: fixed;
  bottom: 12px;
  left: 0;
  right: 0;
  width: calc(100% - 24px);
  max-width: 640px;
  margin: 0 auto;
  height: var(--nav-height);
  display: flex;
  gap: 4px;
  padding: 6px;
  border-radius: 26px;
  z-index: 30;
}
.nav-item {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: background 140ms var(--ease), color 140ms var(--ease);
}
.nav-item:hover { background: rgba(255, 255, 255, 0.6); color: var(--text); }
.nav-item.active { color: var(--primary-dark); background: var(--field); box-shadow: var(--shadow-sm), var(--highlight); }

.auth-card { max-width: 420px; margin: 24px auto; }

/* ---- forms ---- */
.field { display: block; margin-bottom: 16px; }
.field span { display: block; margin-bottom: 4px; font-weight: 600; }
.field input, .field select, .field textarea,
.date-form input, .date-form select,
.filter-field input, .filter-field select,
.search-row input[type="search"] {
  font: inherit;
  color: var(--text);
  background: var(--field);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 2px rgba(18, 52, 58, 0.06);
  transition: border-color 140ms var(--ease), box-shadow 140ms var(--ease);
}
.field input, .field select, .field textarea { width: 100%; min-height: 48px; padding: 10px 12px; }
.field textarea { min-height: 96px; }
.field input:focus, .field select:focus, .field textarea:focus,
.date-form input:focus, .filter-field input:focus, .filter-field select:focus, .search-row input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(31, 122, 109, 0.22);
}

.alert {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: rgba(253, 232, 232, 0.92);
  border: 1px solid rgba(179, 38, 30, 0.25);
  color: #7d1913;
}
.flash {
  padding: 12px 14px;
  border-radius: var(--radius);
  background: rgba(227, 244, 234, 0.92);
  border: 1px solid rgba(27, 94, 52, 0.22);
  color: #1b5e34;
}
.field-error { display: block; color: #8a1c1c; margin-top: 4px; }
.form-card { max-width: 560px; }
.site-footer { max-width: 420px; margin: 8px auto 24px; text-align: center; font-size: 0.9rem;
  color: var(--muted); }
.prose { max-width: 720px; margin: 24px auto; }
.prose h3 { margin-top: 1.4em; }
.prose li { margin-bottom: 0.4em; }
.muted { color: var(--muted); font-size: 0.9rem; }
.badge {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(20, 60, 66, 0.1);
  color: #43565a;
  vertical-align: middle;
}

.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.page-head h2 { margin: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.actions form { margin: 0; }
.store-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 12px; }
.store-row h3 { margin: 0 0 4px; }
.store-row p { margin: 0; }
.store-row.is-inactive { opacity: 0.72; }

.plain-list { list-style: none; margin: 8px 0 0; padding: 0; }
.plain-list li { padding: 2px 0; }
fieldset.field { border: 0; padding: 0; margin: 0 0 16px; }
.assign-row { border: 1px solid var(--glass-edge); background: var(--glass); border-radius: var(--radius); padding: 12px; margin-top: 10px; }
.perm-list { margin: 8px 0 0 28px; display: grid; gap: 4px; }
.check { display: flex; align-items: center; gap: 8px; min-height: 36px; }
.check input { width: 22px; height: 22px; accent-color: var(--primary); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--primary); }

@media (min-width: 768px) {
  .app-main { padding: 32px; }
  .app-header { margin: 14px auto 0; max-width: 936px; top: 14px; }
}
.footer-link { text-align: center; margin-top: 24px; }
.manager-banner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-bottom: 16px; border: 1.5px solid rgba(31, 122, 109, 0.55); }
.manager-banner h3 { margin: 0 0 4px; }

/* ---- staff: round photo (or initials) above the name ---- */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  flex: none;
  font-weight: 700;
  font-size: 1.15rem;
  color: #163b36;
  background: #d8ece8;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.85), var(--shadow-sm);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-large { width: 96px; height: 96px; font-size: 1.8rem; }
.avatar-xl { width: 112px; height: 112px; font-size: 2.2rem; }
.avatar-0 { background: #d8ece8; }
.avatar-1 { background: #dde6f3; }
.avatar-2 { background: #f1e4d6; }
.avatar-3 { background: #e6dff0; }
.avatar-4 { background: #e3eddc; }
.avatar-5 { background: #f3dede; }
.avatar-6 { background: #e9ecd3; }
.avatar-7 { background: #d9e8ee; }

.staff-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
}
/* tiles: translucent white, no blur (there can be many of them) */
.staff-card, .kpi-tap, .pick-body {
  background: var(--glass-strong);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--shadow-sm), var(--highlight);
}
.staff-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 18px 10px;
  border-radius: var(--radius-lg);
  text-align: center;
}
.staff-name { font-weight: 600; font-size: 1.05rem; overflow-wrap: anywhere; }

.staff-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; }
.staff-row-who { display: flex; align-items: center; gap: 14px; }
.staff-row h3 { margin: 0; }
.staff-row p { margin: 0; }
.staff-row.is-inactive { opacity: 0.72; }
.photo-current { display: flex; align-items: center; gap: 16px; margin: 8px 0; }
.label-text { display: block; margin-bottom: 4px; font-weight: 600; }

/* ---- KPIs: round colour-coded icons. The colour classes match app/kpis.py COLOURS by position.
   They stay solid (white text on each colour is checked at 4.5:1). ---- */
.kpi-colour-0 { background: #1f7a6d; } /* Teal */
.kpi-colour-1 { background: #2c6cb0; } /* Blue */
.kpi-colour-2 { background: #4f5fb5; } /* Indigo */
.kpi-colour-3 { background: #7a4fa8; } /* Purple */
.kpi-colour-4 { background: #a8457f; } /* Magenta */
.kpi-colour-5 { background: #c0392b; } /* Red */
.kpi-colour-6 { background: #b4531a; } /* Orange */
.kpi-colour-7 { background: #8a6400; } /* Gold */
.kpi-colour-8 { background: #4b7f2a; } /* Green */
.kpi-colour-9 { background: #2f7d4f; } /* Forest */
.kpi-colour-10 { background: #51606e; } /* Slate */
.kpi-colour-11 { background: #7a5238; } /* Brown */

.kpi-bubble {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  flex: none;
  color: #fff;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.38), inset 0 -3px 6px rgba(0, 0, 0, 0.12), 0 4px 10px rgba(18, 52, 58, 0.2);
}
.kpi-bubble svg { width: 58%; height: 58%; }
.kpi-bubble img { width: 100%; height: 100%; object-fit: cover; display: block; }
.kpi-bubble-lg { width: 80px; height: 80px; }
.kpi-letters { font-size: 1.3rem; }
.kpi-bubble-lg .kpi-letters { font-size: 1.7rem; }

.kpi-grid {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 18px 10px;
}
.kpi-item { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.kpi-label { font-size: 0.9rem; font-weight: 600; overflow-wrap: anywhere; }

.kpi-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; }
.kpi-row-who { display: flex; align-items: center; gap: 14px; }
.kpi-row h3 { margin: 0; }
.kpi-row.is-inactive { opacity: 0.72; }
.section-title { margin: 24px 0 0; color: var(--muted); font-weight: 600; }

.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.pick { position: relative; display: block; cursor: pointer; }
.pick input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatches .pick { width: 44px; height: 44px; }
.swatch { display: block; width: 44px; height: 44px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--border), var(--shadow-sm); transition: transform 140ms var(--ease); }
.pick:hover .swatch { transform: scale(1.06); }
.pick input:checked + .swatch { box-shadow: 0 0 0 3px var(--text); }
.pick input:focus-visible + .swatch, .pick input:focus-visible + .pick-body { outline: 3px solid var(--primary); outline-offset: 2px; }
.icon-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.pick-body {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-height: 84px; padding: 8px 4px; text-align: center;
  border-radius: var(--radius);
  color: var(--text);
  transition: background 140ms var(--ease), box-shadow 140ms var(--ease);
}
.pick:hover .pick-body { background: var(--solid); }
.pick-body svg { width: 30px; height: 30px; }
.pick-letters { font-size: 1.3rem; font-weight: 700; line-height: 30px; }
.pick-name { font-size: 0.72rem; line-height: 1.1; color: var(--muted); }
.pick input:checked + .pick-body { border-color: var(--primary); background: #e3f1ee; box-shadow: 0 0 0 2px var(--primary); }

/* ---- logging screen: tap a name, then tap a KPI ---- */
.staff-link { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; color: inherit; text-decoration: none; }
.staff-card:has(.staff-link) { padding: 0; }
.staff-link { padding: 18px 10px; border-radius: var(--radius-lg); transition: background 140ms var(--ease), transform 140ms var(--ease); }
.staff-link:hover { background: rgba(31, 122, 109, 0.08); }
.staff-link:active { background: rgba(31, 122, 109, 0.14); transform: scale(0.98); }
.staff-link:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }

.log-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.log-who { display: flex; align-items: center; gap: 14px; }
.log-who h2 { margin: 0; }
.kpi-bubble-xl { width: 96px; height: 96px; }
.kpi-bubble-xl .kpi-letters { font-size: 2rem; }
.kpi-grid-tap { grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 14px; margin-top: 16px; }
.kpi-grid-tap .kpi-item { display: block; }
.kpi-tap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 140px;
  padding: 14px 6px;
  font: inherit;
  color: var(--text);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: transform 140ms var(--ease), box-shadow 140ms var(--ease), background 140ms var(--ease);
}
.kpi-tap:hover { box-shadow: var(--shadow), var(--highlight); transform: translateY(-2px); }
.kpi-tap:active { background: #e3f1ee; transform: scale(0.97); box-shadow: var(--shadow-sm), var(--highlight); }
.kpi-tap:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.kpi-count {
  position: absolute;
  top: 6px;
  right: 10px;
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 15px;
  background: var(--text);
  color: #fff;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
body.busy .kpi-tap { pointer-events: none; } /* Undo stays tappable */

.toast {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(var(--nav-height) + 28px);
  z-index: 40;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  max-width: 560px;
  margin: 0 auto;
  padding: 12px 16px;
  background: rgba(20, 38, 42, 0.92);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 30px rgba(10, 30, 34, 0.35);
  animation: toast-life 10s forwards; /* keep in step with UNDO_WINDOW in app/routes/logging.py */
}
.toast-text { font-weight: 600; }
.toast form { margin: 0; }
@keyframes toast-life {
  0%, 92% { opacity: 1; visibility: visible; }
  100% { opacity: 0; visibility: hidden; }
}

/* ---- dashboards: hero number, date navigation, charts and tables ---- */
.hero-figure { display: flex; align-items: baseline; gap: 12px; margin: 8px 0 20px; }
.hero-number { font-size: 3.6rem; font-weight: 650; letter-spacing: -0.03em; line-height: 1; color: var(--text); font-variant-numeric: tabular-nums; }
.hero-label { color: var(--muted); font-size: 1.05rem; }
.date-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0 4px; }
.date-nav .btn-small { margin-top: 0; }
.date-form { display: flex; align-items: center; gap: 8px; margin: 0; }
.date-form input, .date-form select { min-height: 40px; padding: 6px 10px; }
.date-heading { font-size: 1.15rem; font-weight: 600; margin: 12px 0 0; }

.chart-card { border-radius: var(--radius-lg); padding: 20px 18px; margin-top: 16px; }
.chart-card h3 { margin: 0 0 12px; }
.chart-wrap { position: relative; width: 100%; }
.table-twin { margin-top: 12px; }
.table-twin summary { cursor: pointer; color: var(--primary-dark); font-weight: 600; min-height: 32px; }

.data-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.data-table th, .data-table td { padding: 10px 10px; border-bottom: 1px solid rgba(20, 60, 66, 0.1); text-align: left; vertical-align: middle; }
.data-table thead th { color: var(--muted); font-weight: 600; font-size: 0.8rem; letter-spacing: 0.04em; text-transform: uppercase; }
.data-table tbody th { font-weight: 600; }
.data-table tbody tr { transition: background 120ms var(--ease); }
.data-table tbody tr:hover { background: rgba(31, 122, 109, 0.06); }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table .zero { color: var(--muted); opacity: 0.6; }
.data-table .total { font-weight: 700; }
.data-table tfoot th, .data-table tfoot td { border-top: 2px solid rgba(20, 60, 66, 0.18); border-bottom: 0; font-weight: 700; }
.data-table tbody th .avatar, .data-table tbody th .kpi-bubble { margin-right: 8px; vertical-align: middle; }
.avatar-sm { width: 32px; height: 32px; font-size: 0.8rem; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85); }
.kpi-bubble-sm { width: 32px; height: 32px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 2px 5px rgba(18, 52, 58, 0.18); }
.kpi-bubble-sm .kpi-letters { font-size: 0.85rem; }

.matrix-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.matrix th:first-child, .matrix td:first-child { position: sticky; left: 0; background: var(--solid); z-index: 1; }
.matrix thead th:not(:first-child) { min-width: 84px; }

/* ---- detailed reports: filters, quick ranges, tables, paging ---- */
.filter-bar { margin-top: 10px; }
.filter-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.filter-field { display: flex; flex-direction: column; gap: 4px; font-size: 0.85rem; color: var(--muted); font-weight: 600; }
.filter-field input, .filter-field select { min-height: 40px; padding: 6px 10px; }
.filter-row .btn-small { margin-top: 0; }
.quick-ranges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip {
  display: inline-block; padding: 6px 14px; border: 1px solid var(--glass-edge); border-radius: 999px;
  background: var(--glass-strong); color: var(--primary-dark); text-decoration: none; font-weight: 600; font-size: 0.9rem;
  box-shadow: var(--shadow-sm), var(--highlight);
  transition: background 140ms var(--ease), transform 140ms var(--ease);
}
.chip:hover { background: var(--solid); transform: translateY(-1px); }
.chip.is-current { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(31, 122, 109, 0.3); }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; max-height: 480px; }
.entries-table td, .entries-table th { white-space: nowrap; }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 14px; }

/* ---- corrections ---- */
.bulk-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-top: 14px; }
.bulk-bar .grow { flex: 1 1 240px; }
.bulk-bar .btn-small { margin-top: 0; }
.entries-table tr.is-removed td, .entries-table tr.is-removed th { opacity: 0.6; }
.entries-table input[type="checkbox"] { width: 20px; height: 20px; }

/* ---- search box above a long list (stores, managers) ---- */
.search-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0 6px; }
.search-row input[type="search"] { flex: 1 1 240px; min-height: 44px; padding: 8px 14px; border-radius: 999px; }
.search-row .btn-small { margin-top: 0; }
.bulk-form .perm-list { margin-left: 0; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* ---- people who prefer less movement ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
  .btn:hover, .kpi-tap:hover, .chip:hover { transform: none; }
}

/* "Take a photo" button next to the staff photo field (photo_camera.js shows it on touch devices) */
.camera-btn { margin: 8px 8px 0 0; }
.camera-btn[hidden] { display: none; }
