/* =====================================================================
   KRACO Sales App — Mobile-first styles
   ---------------------------------------------------------------------
   Vanilla CSS, no build step. Mobile-first: rules below the breakpoints
   apply to phones, then media queries scale up to tablet/desktop.

   Brand:
     --brand-red  #E61E2A   primary CTAs, headers, accents
     --gold       #B08B3C   highlights, badges (matches Contracts)
   ===================================================================== */

:root {
  /* Palette */
  --brand-red: #E61E2A;
  --brand-red-dark: #B81620;
  --gold: #B08B3C;
  --gold-soft: #fff8e1;

  /* Surfaces */
  --bg: #f0f2f5;
  --card-bg: #ffffff;
  --border: #dce0e8;
  --border-soft: #eaecf0;

  /* Text */
  --ink: #1a1a1a;
  --ink-soft: #444;
  --muted: #666;
  --muted-soft: #888;

  /* Semantic */
  --ok: #1b7a3a;
  --ok-bg: #eaf6ec;
  --warn: #8a5a00;
  --warn-bg: #fff8e1;
  --err: #a01020;
  --err-bg: #fdeaec;
  --info: #1a55a8;
  --info-bg: #e9f0fb;

  /* Sizing */
  --radius: 8px;
  --radius-sm: 4px;
  --topbar-h: 56px;
  --bottom-nav-h: 64px;
  --touch: 44px;

  /* Type */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  /* Don't let pull-to-refresh interfere with our own scrolling */
  overscroll-behavior-y: contain;
}

body {
  min-height: 100vh;
  /* Reserve space for the fixed top bar (incl. iOS safe-area) and bottom nav */
  padding-top: calc(var(--topbar-h) + env(safe-area-inset-top, 0px));
  padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px));
}

a {
  color: var(--info);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

h1, h2, h3 { margin: 0; font-weight: 600; }
p { margin: 0 0 12px 0; }
p:last-child { margin-bottom: 0; }

code {
  font-family: var(--mono);
  background: var(--border-soft);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  font-size: 0.92em;
}

/* ---------------------------------------------------------------------
   Top bar — fixed, full width, brand identity
   ------------------------------------------------------------------- */

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-h);
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px 0 16px;
  z-index: 100;
  padding-top: env(safe-area-inset-top, 0px);
  height: calc(var(--topbar-h) + env(safe-area-inset-top, 0px));
}
.topbar__left,
.topbar__right {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  min-width: 0;
}
.topbar__right { justify-content: flex-end; position: relative; gap: 4px; }
.topbar__logo { height: 24px; width: auto; display: block; }
.topbar__center {
  flex: 0 0 auto;
  text-align: center;
  font-weight: 500;
  font-size: 17px;
  color: #3A3A3C;
  letter-spacing: 0.2px;
  white-space: nowrap;
  text-decoration: none;
}
.topbar__center:hover { color: #1f1f21; text-decoration: none; }
.topbar__center:active { opacity: 0.7; }
.topbar__center .brand-my { color: var(--gold); font-weight: 700; }
.topbar__center .brand-kraco { color: var(--brand-red); font-weight: 700; }
.topbar__user {
  font-size: 12px;
  color: var(--ink-soft);
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar__menu-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--ink-soft);
  cursor: pointer;
  border-radius: var(--radius-sm);
}
.topbar__menu-btn:hover { background: var(--bg); }

/* Dropdown menu (refresh / logout) */
.app-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 4px;
  min-width: 200px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 6px 20px rgba(0,0,0,0.14);
  z-index: 110;
  overflow: hidden;
}
.app-menu__user {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-soft);
}
.app-menu__name { font-weight: 600; font-size: 14px; color: var(--ink); }
.app-menu__email { font-size: 12px; color: var(--muted); margin-top: 2px; word-break: break-all; }
.app-menu__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  font-size: 14px;
  color: var(--ink);
  text-decoration: none;
  min-height: var(--touch);
}
.app-menu__item:hover { background: var(--bg); text-decoration: none; }
.app-menu__item--danger { color: var(--err); }

/* ---------------------------------------------------------------------
   Content area — single column on mobile, centered card on desktop
   ------------------------------------------------------------------- */

.content {
  padding: 16px;
  max-width: 560px;
  margin: 0 auto;
}

/* ---------------------------------------------------------------------
   Flash messages
   ------------------------------------------------------------------- */

.flash-stack {
  padding: 10px 16px 0 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 560px;
  margin: 0 auto;
}
.flash {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  width: 100%;
  transition: opacity 0.4s ease;
}
.flash--dismissing { opacity: 0; }
.flash--success { background: var(--ok-bg);   color: var(--ok);   border-left: 3px solid var(--ok); }
.flash--error   { background: var(--err-bg);  color: var(--err);  border-left: 3px solid var(--err); }
.flash--info    { background: var(--info-bg); color: var(--info); border-left: 3px solid var(--info); }
.flash--warning { background: var(--warn-bg); color: var(--warn); border-left: 3px solid var(--gold); }

/* ---------------------------------------------------------------------
   Card — the main content container
   ------------------------------------------------------------------- */

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 14px;
  overflow: hidden;
}
.card__head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card__title {
  font-size: 16px;
  color: var(--ink);
  margin: 0;
}
.card__body-text {
  padding: 12px 16px 0 16px;
  color: var(--ink-soft);
  font-size: 14px;
}
.card--welcome .card__head {
  background: linear-gradient(135deg, #fff 0%, var(--gold-soft) 100%);
}

/* ---------------------------------------------------------------------
   Badge
   ------------------------------------------------------------------- */

.badge {
  display: inline-block;
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.badge--gold {
  background: var(--gold-soft);
  color: var(--warn);
  border: 1px solid var(--gold);
}

/* ---------------------------------------------------------------------
   Key/value list (dl)
   ------------------------------------------------------------------- */

.kv {
  margin: 0;
  padding: 12px 16px 16px 16px;
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 6px 12px;
  font-size: 14px;
}
.kv dt {
  color: var(--muted);
}
.kv dd {
  margin: 0;
  color: var(--ink);
  word-break: break-word;
}

/* ---------------------------------------------------------------------
   Empty state — shown where data will eventually go
   ------------------------------------------------------------------- */

.empty-state {
  padding: 32px 16px;
  text-align: center;
  color: var(--muted);
}
.empty-state__icon {
  color: var(--muted-soft);
  margin-bottom: 12px;
}
.empty-state__text {
  font-size: 14px;
  color: var(--ink-soft);
  margin: 0 0 6px 0;
}
.empty-state__hint {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}

/* ---------------------------------------------------------------------
   Check list — system status bullets
   ------------------------------------------------------------------- */

.check-list {
  list-style: none;
  margin: 0;
  padding: 8px 16px 12px 16px;
  font-size: 14px;
}
.check-list__item {
  padding: 6px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.check-list__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--ok-bg);
  color: var(--ok);
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

/* ---------------------------------------------------------------------
   Buttons
   ------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--touch);
  padding: 10px 18px;
  background: var(--brand-red);
  color: #fff;
  text-decoration: none;
  border: 1px solid var(--brand-red);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: background-color 0.15s;
}
.btn:hover { background: var(--brand-red-dark); border-color: var(--brand-red-dark); text-decoration: none; }
.btn:active { transform: translateY(1px); }

.btn--secondary {
  background: var(--card-bg);
  color: var(--ink);
  border: 1px solid var(--border);
}
.btn--secondary:hover { background: var(--bg); }

.action-row {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 4px;
}

/* ---------------------------------------------------------------------
   Bottom navigation — primary nav for mobile users
   ------------------------------------------------------------------- */

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: stretch;
  z-index: 100;
}

.bottom-nav__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-decoration: none;
  color: var(--muted);
  font-size: 11px;
  padding: 6px 4px;
  min-height: var(--touch);
}
.bottom-nav__item:hover {
  color: var(--ink);
  text-decoration: none;
}
.bottom-nav__item--active {
  color: var(--brand-red);
}
.bottom-nav__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.bottom-nav__label {
  font-weight: 500;
}

/* ---------------------------------------------------------------------
   Error pages (standalone, no layout)
   ------------------------------------------------------------------- */

.error-body {
  margin: 0;
  padding: 24px 16px;
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
}
.error-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 24px;
  max-width: 420px;
  width: 100%;
  text-align: center;
}
.error-card__code {
  font-size: 48px;
  font-weight: 700;
  color: var(--brand-red);
  line-height: 1;
  margin-bottom: 8px;
}
.error-card__title {
  font-size: 18px;
  color: var(--ink);
  margin: 0 0 12px 0;
}
.error-card__text {
  color: var(--ink-soft);
  margin: 0 0 12px 0;
}
.error-card__hint {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 20px 0;
}

/* ---------------------------------------------------------------------
   Desktop adaptations (tablet and up)
   ------------------------------------------------------------------- */

@media (min-width: 768px) {
  body {
    background: var(--bg);
  }
  .content {
    padding: 24px 16px;
  }
}

/* =====================================================================
   Stage B.1 — daily task list
   ===================================================================== */

/* ---- Date navigation header ---------------------------------------- */
.date-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  padding: 6px;
}
.date-nav__arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--touch);
  height: var(--touch);
  font-size: 28px;
  line-height: 1;
  color: var(--brand-red);
  text-decoration: none;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.date-nav__arrow:hover { background: var(--bg); text-decoration: none; }
.date-nav__current { text-align: center; flex: 1; }
.date-nav__weekday {
  font-size: 12px;
  color: var(--muted);
  text-transform: capitalize;
}
.date-nav__date {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}
.date-nav__today-row {
  text-align: center;
  margin: -4px 0 12px 0;
}
.date-nav__today-link {
  font-size: 13px;
  color: var(--info);
}

/* ---- Task list ----------------------------------------------------- */
.task-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
/* Container styling moved to .task-row-wrap (B.2); the row itself is now
   an inner flex anchor. Layout-only rule kept here for the inner element. */
.task-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.task-row__time {
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
  min-width: 52px;
  font-variant-numeric: tabular-nums;
  padding-top: 1px;
  line-height: 1.25;
}
.task-row__time-end {
  display: block;
  font-weight: 500;
  font-size: 12px;
  color: var(--muted);
}
.task-row__body {
  flex: 1;
  min-width: 0;
}
.task-row__type {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.task-row__meta {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.task-row__status {
  flex-shrink: 0;
  padding-top: 1px;
  text-align: right;
}
.task-row__actual {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---- Status badge -------------------------------------------------- */
.status-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 10px;
  white-space: nowrap;
}
.status-badge--planned     { background: var(--info-bg); color: var(--info); }
.status-badge--in-progress { background: var(--warn-bg); color: var(--warn); }
.status-badge--completed   { background: var(--ok-bg);   color: var(--ok); }
.status-badge--cancelled   { background: #f1f1f1;        color: var(--muted); }

/* ---- Inline tag (e.g. ad-hoc marker) ------------------------------- */
.tag {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.tag--adhoc {
  background: var(--gold-soft);
  color: var(--warn);
  border: 1px solid var(--gold);
}
.tag--late {
  background: #FCEBEB;
  color: #A32D2D;
  border: 1px solid #E2A0A0;
}

/* ---- Floating action button (FAB) ---------------------------------- */
.fab {
  position: fixed;
  right: 18px;
  bottom: calc(var(--bottom-nav-h) + 16px + env(safe-area-inset-bottom, 0px));
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--brand-red);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(230, 30, 42, 0.4);
  z-index: 90;
  text-decoration: none;
}
.fab:hover { background: var(--brand-red-dark); text-decoration: none; }
.fab:active { transform: translateY(1px); }

/* ---- "Under construction" placeholder (B.1 new-task page) ---------- */
.placeholder-build {
  padding: 32px 16px;
  text-align: center;
  color: var(--muted);
}
.placeholder-build__icon { color: var(--gold); margin-bottom: 12px; }
.placeholder-build__text {
  font-size: 14px;
  color: var(--ink-soft);
  margin: 0 0 6px 0;
}
.placeholder-build__hint {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}

/* =====================================================================
   Stage B.2 — forms, task detail, confirm boxes
   ===================================================================== */

/* ---- Form fields --------------------------------------------------- */
.form__body { padding: 14px 16px 16px 16px; }
.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field__label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 5px;
}
.field__control {
  width: 100%;
  min-height: var(--touch);
  padding: 10px 12px;
  font-size: 15px;
  font-family: inherit;
  color: var(--ink);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  -webkit-appearance: none;
  appearance: none;
}
select.field__control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23666' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
select.field__control[size] { background-image: none; padding-right: 12px; }
textarea.field__control { min-height: 72px; resize: vertical; }
.field__control:focus {
  outline: none;
  border-color: var(--brand-red);
  box-shadow: 0 0 0 2px rgba(230, 30, 42, 0.12);
}
.field__control--mt { margin-top: 6px; }
.field__error {
  color: var(--err);
  font-size: 12px;
  margin-top: 4px;
}
.field-row {
  display: flex;
  gap: 12px;
}
.field-row .field { flex: 1; }

/* ---- Danger buttons + muted/danger text links --------------------- */
.btn--danger {
  background: var(--err);
  border-color: var(--err);
  color: #fff;
}
.btn--danger:hover { background: #861019; border-color: #861019; }

.action-row--spread {
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
}
.link-muted { color: var(--muted); font-size: 14px; }
.link-danger {
  background: none;
  border: none;
  color: var(--err);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  padding: 8px 4px;
}

/* ---- Confirm boxes (cancel / delete) ------------------------------- */
.confirm-box { border-color: var(--border); margin-top: 12px; }
.confirm-box__text {
  padding: 0;
  color: var(--ink-soft);
  font-size: 14px;
}

/* ---- Tappable task rows (home list) -------------------------------- */
.task-row-wrap { list-style: none; }
a.task-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  width: 100%;
}
a.task-row:hover { text-decoration: none; background: var(--bg); }
.task-row-wrap {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.task-row-wrap:active { background: var(--bg); }

/* =====================================================================
   Stage B.3 — field execution (GPS, open/close, in-progress, ad-hoc)
   ===================================================================== */

/* ---- "Go" action button (open / close / register) ------------------ */
.btn--go {
  background: var(--ok);
  border-color: var(--ok);
  color: #fff;
}
.btn--go:hover { background: #15622f; border-color: #15622f; }
.btn--go:disabled { opacity: 0.6; cursor: default; }

/* ---- GPS status line ---------------------------------------------- */
.gps-status {
  margin-top: 10px;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--ink-soft);
}
.gps-status--busy { background: var(--info-bg); color: var(--info); }
.gps-status--ok   { background: var(--ok-bg);   color: var(--ok); }
.gps-status--warn { background: var(--warn-bg); color: var(--warn); }

/* ---- GPS coordinates shown on the detail page --------------------- */
.gps-coord { font-size: 13px; color: var(--muted); white-space: nowrap; }
.gps-coord--missing { color: var(--warn); font-style: italic; }

/* ---- In-progress card with live timer ----------------------------- */
.inprogress-card {
  text-align: center;
  padding: 16px;
  border-color: var(--gold);
  background: linear-gradient(135deg, #fff 0%, var(--warn-bg) 100%);
}
.inprogress-card__head {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--warn);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.inprogress-timer {
  font-size: 40px;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  margin-top: 6px;
  letter-spacing: 1px;
}
.pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--brand-red);
  display: inline-block;
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.4; transform: scale(0.7); }
}

/* ---- Ad-hoc hint + secondary FAB ---------------------------------- */
.adhoc-hint {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 14px 0;
}
.fab--adhoc {
  position: fixed;
  right: 18px;
  bottom: calc(var(--bottom-nav-h) + 16px + 56px + 12px + env(safe-area-inset-bottom, 0px));
  width: auto;
  height: 44px;
  border-radius: 22px;
  padding: 0 16px;
  gap: 6px;
  background: var(--gold);
  box-shadow: 0 3px 10px rgba(176, 139, 60, 0.4);
  font-size: 13px;
  font-weight: 600;
}
.fab--adhoc:hover { background: #9a7833; }
.fab--adhoc__label { white-space: nowrap; }

/* =====================================================================
   Stage B.3.1 — overlap conflict banner
   ===================================================================== */
.conflict-banner {
  background: var(--err-bg);
  border: 1px solid var(--err);
  border-left: 4px solid var(--err);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 14px;
}
.conflict-banner__title {
  font-weight: 700;
  color: var(--err);
  font-size: 14px;
  margin-bottom: 4px;
}
.conflict-banner__text {
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 8px;
}
.conflict-banner__link {
  font-size: 13px;
  font-weight: 600;
  color: var(--err);
}

/* =====================================================================
   Stage B.4 — week view + plan view
   ===================================================================== */

.task-list--compact { gap: 6px; }

/* ---- Week view: per-day blocks ------------------------------------ */
.week-day {
  margin-bottom: 14px;
}
.week-day__head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 4px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 8px;
}
.week-day--today .week-day__head {
  border-bottom-color: var(--brand-red);
}
.week-day__weekday {
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
  text-transform: capitalize;
}
.week-day--today .week-day__weekday { color: var(--brand-red); }
.week-day__date {
  font-size: 12px;
  color: var(--muted);
  flex: 1;
}
.week-day__add {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg);
  color: var(--brand-red);
  font-size: 20px;
  line-height: 26px;
  text-align: center;
  text-decoration: none;
  flex-shrink: 0;
}
.week-day__add:hover { background: var(--border-soft); text-decoration: none; }
.week-day__empty {
  color: var(--muted-soft);
  font-size: 13px;
  padding: 2px 4px 8px;
}

/* ---- Plan view: date-grouped agenda ------------------------------- */
.plan-head { margin-bottom: 12px; }
.plan-head__title { font-size: 18px; color: var(--ink); }
.plan-head__sub { font-size: 13px; color: var(--muted); margin: 2px 0 0 0; }

.plan-group { margin-bottom: 16px; }
.plan-group__date {
  font-weight: 700;
  font-size: 13px;
  color: var(--brand-red);
  text-transform: capitalize;
  padding: 4px 4px 8px;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 8px;
}

/* =====================================================================
   Stage B.6 — month calendar grid
   ===================================================================== */
.cal {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.cal__head {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.cal__wd {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  padding: 8px 0;
}
.cal__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}
.cal__cell {
  position: relative;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 4px;
  border-right: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  text-decoration: none;
  color: var(--ink);
  background: var(--card-bg);
}
.cal__cell:nth-child(7n) { border-right: none; }
.cal__cell:hover { background: var(--bg); text-decoration: none; }
.cal__cell--out { background: #fafbfc; }
.cal__cell--out .cal__day { color: var(--muted-soft); }
.cal__day {
  font-size: 13px;
  font-weight: 600;
}
.cal__cell--today {
  background: var(--gold-soft);
}
.cal__cell--today .cal__day {
  background: var(--gold);
  color: #fff;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cal__count {
  position: absolute;
  left: 4px;
  bottom: 4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--brand-red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cal__hint {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  margin: 10px 0 0 0;
}

/* =====================================================================
   Stage B.6 — bare layout + login screen
   ===================================================================== */
.bare-body {
  background: var(--bg);
  min-height: 100vh;        /* fallback for old browsers */
  min-height: 100dvh;       /* dynamic viewport: no phantom space under mobile toolbars */
  margin: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;  /* body is the single full-height, centering context */
}
.bare-main {
  max-width: 420px;
  width: 100%;
  margin: 0 auto;
  padding: calc(24px + env(safe-area-inset-top, 0px)) 20px calc(24px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-sizing: border-box;
}

.login {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.login__brand {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.login__logo {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--card-bg);
}
.login__title {
  font-size: 22px;
  font-weight: 700;
  color: var(--brand-red);
  letter-spacing: 0.3px;
  margin-top: 4px;
}
.login__sub {
  font-size: 15px;
  color: var(--muted);
}
.login__form {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.04);
}
/* Mobile-native inputs: 16px prevents iOS zoom-on-focus; large tap targets. */
.login .field__control {
  font-size: 16px;
  min-height: 50px;
  border-radius: 12px;
  padding: 12px 14px;
}
.login .field__control:focus {
  outline: none;
  border-color: var(--brand-red);
  box-shadow: 0 0 0 3px rgba(230, 30, 42, 0.14);
}
.login .field__label {
  font-size: 13px;
  font-weight: 600;
}
.login__btn {
  width: 100%;
  min-height: 52px;
  margin-top: 6px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 12px;
}
.login__btn:active { transform: translateY(1px); }
/* c9_101 — "Mbaj mend këtë pajisje": a big touch target, the whole row taps. */
.login__remember {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 14px; font-weight: 600; cursor: pointer; min-height: 32px;
}
.login__remember input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--brand-red); flex: 0 0 20px; }
.login__remember small { display: block; font-weight: 400; font-size: 12px; color: var(--muted); margin-top: 2px; }

/* c9_101 — Pajisjet e mia */
.dev-wrap { max-width: 640px; margin: 0 auto; }
.dev-lead { color: var(--muted); font-size: 13px; margin: 0 0 14px; line-height: 1.5; }
.dev-list { background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; margin-bottom: 14px; }
.dev-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--border); }
.dev-item:first-child { border-top: 0; }
.dev-item__icon { width: 36px; height: 36px; border-radius: 10px; background: var(--bg, #f0f2f5); display: flex; align-items: center; justify-content: center; flex: 0 0 36px; color: var(--muted); }
.dev-item__main { flex: 1; min-width: 0; }
.dev-item__name { font-weight: 650; font-size: 14.5px; }
.dev-item__meta { font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.4; }
.dev-tag { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: #e6f4ec; color: #0a7d3f; margin-left: 6px; vertical-align: 1px; }
.dev-item form { margin: 0; }
.dev-btn { font: inherit; font-size: 13px; font-weight: 600; min-height: 36px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--border); background: var(--card-bg); color: var(--err, #c0271c); cursor: pointer; }
.dev-actions { display: flex; flex-direction: column; gap: 8px; }
.dev-actions .btn { width: 100%; min-height: 46px; }
.dev-empty { padding: 22px 14px; text-align: center; color: var(--muted); font-size: 14px; }
.login__error {
  background: var(--err-bg);
  color: var(--err);
  border: 1px solid var(--err);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 14px;
  text-align: center;
}
/* c9_51 — the way out when the password is gone. Quiet, but a real touch
   target: a field user locked out at 8am on a phone must be able to hit it
   without zooming, so it keeps the 44px minimum even though it reads as a
   secondary link. */
/* c9_56 — promoted from a text link to an outlined button.
   As a bare link under a big red Hyr it read as fine print, which is the
   wrong weight for the one control a locked-out field user needs. It stays
   SECONDARY to Hyr — outline, not fill — so it never competes with the
   normal path. */
.login__forgot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  font-size: 15px;
  font-weight: 600;
  color: var(--brand-red);
  background: var(--card-bg);
  border: 1.5px solid var(--brand-red);
  border-radius: 12px;
  text-decoration: none;
  box-sizing: border-box;
}
.login__forgot svg { flex: 0 0 auto; }
.login__forgot:hover { background: rgba(230, 30, 42, 0.06); }
.login__forgot:active { transform: translateY(1px); }

.login__foot {
  text-align: center;
  font-size: 12px;
  color: var(--muted-soft);
  margin-top: 4px;
}

/* =====================================================================
   Stage B.8 — planning reminders (banner, bell, notifications list)
   ===================================================================== */

/* ---- Notification bell in the header ------------------------------ */
.topbar__bell {
  position: relative;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  border-radius: var(--radius-sm);
  text-decoration: none;
}
.topbar__bell:hover { background: var(--bg); }
.topbar__bell-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--brand-red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  box-sizing: border-box;
}

/* ---- Reminder banner (day view) ----------------------------------- */
.reminder-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
  border-radius: var(--radius);
  text-decoration: none;
  border: 1px solid var(--gold);
  background: linear-gradient(135deg, #fffdf8 0%, var(--gold-soft) 100%);
  color: var(--ink);
}
.reminder-banner:hover { text-decoration: none; }
.reminder-banner--plan_month {
  border-color: var(--brand-red);
  background: linear-gradient(135deg, #fff8f8 0%, #fdecec 100%);
}
.reminder-banner__icon {
  flex-shrink: 0;
  color: var(--gold);
  display: flex;
}
.reminder-banner--plan_month .reminder-banner__icon { color: var(--brand-red); }
.reminder-banner__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.reminder-banner__title { font-weight: 700; font-size: 14px; }
.reminder-banner__body { font-size: 12px; color: var(--ink-soft); }
.reminder-banner__arrow { flex-shrink: 0; font-size: 22px; color: var(--muted); }

/* ---- Notifications list ------------------------------------------- */
.notif-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.notif {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.notif--unread { border-left: 3px solid var(--brand-red); background: #fffafa; }
.notif__link { display: flex; gap: 12px; padding: 12px 14px; text-decoration: none; color: inherit; }
.notif__link:hover { text-decoration: none; }
.notif__icon { flex-shrink: 0; color: var(--gold); }
.notif--unread .notif__icon { color: var(--brand-red); }
.notif__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.notif__title { font-weight: 600; font-size: 14px; }
.notif__text { font-size: 13px; color: var(--ink-soft); }
.notif__time { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* =====================================================================
   Stage C.1 — platform shell + module launcher
   ===================================================================== */

/* Shell content has no bottom-nav, so it can use full height padding. */
.content--shell { padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }

.launcher { max-width: 760px; margin: 0 auto; }
.launcher__head { margin-bottom: 18px; }
.launcher__greeting { font-size: 20px; font-weight: 700; color: var(--ink); margin: 0; }
.launcher__sub { font-size: 14px; color: var(--muted); margin: 4px 0 0 0; }
.profile-card { display: flex; align-items: center; gap: 14px; background: var(--card-bg, #fff); border: 1px solid var(--border, #e4e3de); border-radius: 14px; padding: 14px 16px; margin: 4px 0 16px; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.profile-card__avatar { position: relative; overflow: hidden; width: 48px; height: 48px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: var(--brand-red, #E61E2A); color: #fff; font-weight: 700; font-size: 17px; letter-spacing: .5px; }
.profile-card__photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.profile-card__body { min-width: 0; }
.profile-card__name { font-size: 17px; font-weight: 700; color: var(--ink, #1f2328); line-height: 1.2; }
.profile-card__title { font-size: 13px; color: var(--muted, #6b7076); margin-top: 2px; }
.profile-card--link { text-decoration: none; color: inherit; cursor: pointer; transition: background .12s, box-shadow .12s; }
.profile-card--link:hover { background: var(--surface-1, #faf9f7); box-shadow: 0 2px 8px rgba(0,0,0,.07); }
.profile-card--link:active { transform: translateY(1px); }
.profile-card__chev { margin-left: auto; color: var(--muted-soft, #b7bbbf); font-size: 26px; line-height: 1; padding-left: 8px; }

/* Responsive module grid: 2 cols on phones, more on wider screens. */
.module-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (min-width: 600px) { .module-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .module-grid { grid-template-columns: repeat(4, 1fr); } }

.module-card {
  --accent: var(--brand-red);
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 14px;
  border-radius: var(--radius);
  background: var(--card-bg);
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--ink);
  min-height: 132px;
  position: relative;
  transition: transform 0.06s ease, box-shadow 0.12s ease;
}
.module-card:hover { text-decoration: none; box-shadow: 0 4px 14px rgba(0,0,0,0.08); }
.module-card:active { transform: scale(0.98); }
.module-card__icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: var(--accent);
  margin-bottom: 4px;
}
.module-card__label { font-size: 15px; font-weight: 700; }
.module-card__desc { font-size: 12px; color: var(--muted); line-height: 1.35; }

.module-card--soon {
  background: var(--bg);
  border-style: dashed;
  cursor: default;
}
.module-card--soon .module-card__icon { background: var(--muted-soft); }
.module-card--soon .module-card__label,
.module-card--soon .module-card__desc { color: var(--muted); }
.module-card__badge {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--muted);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2px 6px;
}

/* Super-user entry to the Management Portal */
.portal-entry {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
  color: #fff;
  text-decoration: none;
}
.portal-entry:hover { text-decoration: none; opacity: 0.95; }
.portal-entry__icon { color: var(--gold); flex-shrink: 0; }
.portal-entry__text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.portal-entry__label { font-weight: 700; font-size: 15px; }
.portal-entry__desc { font-size: 12px; color: #c9c9c9; }
.portal-entry__arrow { font-size: 22px; color: var(--gold); }

/* =====================================================================
   Stage C.2 — Management Portal (responsive, desktop-leaning)
   ===================================================================== */
.portal-body {
  margin: 0;
  /* The base body reserves padding for the mobile app's FIXED top/bottom
     bars. The portal uses a STICKY topbar and no bottom nav, so cancel that
     reserved space — otherwise the grey body background shows as an empty
     strip above the header. */
  padding-top: 0;
  padding-bottom: 0;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
}

/* Top bar */
.portal-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  padding: 10px 18px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.portal-topbar__brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.portal-topbar__title { font-weight: 500; font-size: 16px; color: #3A3A3C; }
.portal-topbar__right { display: flex; align-items: center; gap: 16px; }
.portal-topbar__back { font-size: 13px; color: var(--muted); text-decoration: none; }
.portal-topbar__back:hover { color: var(--ink); }
.portal-topbar__user { font-size: 13px; color: var(--ink-soft); }
.portal-topbar__logout { font-size: 13px; color: var(--brand-red); text-decoration: none; }

/* Shell: sidebar + content */
.portal-shell { display: flex; min-height: calc(100vh - 56px); }
.portal-sidebar {
  flex: 0 0 230px;
  background: var(--card-bg);
  border-right: 1px solid var(--border);
  padding: 14px 10px;
}
.portal-nav { display: flex; flex-direction: column; gap: 2px; }
.portal-nav__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 14px;
}
.portal-nav__item:hover { background: var(--bg); color: var(--ink); }
.portal-nav__item--active { background: #fdecec; color: var(--brand-red); font-weight: 500; }
.portal-nav__icon { display: flex; flex-shrink: 0; }
.portal-nav__item--admin { margin-top: 8px; border-top: 1px solid var(--border); padding-top: 14px; }

.portal-content { flex: 1; padding: 22px 26px; max-width: 1100px; }

/* Page headings */
.portal-page { }
.portal-h1 { font-size: 22px; font-weight: 600; color: var(--ink); margin: 0 0 4px; }
.portal-lead { font-size: 14px; color: var(--muted); margin: 0 0 20px; }
.portal-muted { color: var(--muted); font-size: 14px; }

/* Module cards on the landing */
.portal-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.portal-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--ink);
  transition: box-shadow 0.12s ease;
}
.portal-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,0.08); }
.portal-card__icon {
  width: 42px; height: 42px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  background: #fdecec; color: var(--brand-red); margin-bottom: 4px;
}
.portal-card__label { font-size: 15px; font-weight: 600; }
.portal-card__desc { font-size: 12px; color: var(--muted); line-height: 1.4; }

/* Access matrix table */
.matrix-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card-bg); }
.matrix { border-collapse: collapse; width: 100%; min-width: 520px; }
.matrix th, .matrix td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); font-size: 13px; }
.matrix__corner { background: var(--bg); font-weight: 500; color: var(--muted); white-space: nowrap; }
.matrix__modhead { background: var(--bg); font-weight: 500; white-space: nowrap; }
.matrix__inactive { display: inline-block; margin-left: 6px; font-size: 10px; color: var(--muted); border: 1px solid var(--border); border-radius: 6px; padding: 0 4px; }
.matrix__rolehead { font-weight: 500; white-space: nowrap; background: var(--card-bg); position: sticky; left: 0; }
.matrix__cell { text-align: center; }
.matrix__select { font-size: 13px; padding: 5px 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--card-bg); }
.matrix__select--manage { border-color: #1D7D5B; color: #0F6E56; }
.matrix__select--view   { border-color: var(--gold); color: var(--warn); }
.matrix__select--none   { color: var(--muted); }

.action-row { margin-top: 18px; display: flex; gap: 10px; }

/* Responsive: stack sidebar above content on phones */
@media (max-width: 720px) {
  .portal-shell { flex-direction: column; }
  .portal-sidebar { flex: none; width: auto; border-right: none; border-bottom: 1px solid var(--border); padding: 8px; }
  .portal-nav { flex-direction: row; flex-wrap: wrap; }
  .portal-nav__item { flex: 0 0 auto; }
  .portal-nav__item--admin { margin-top: 0; border-top: none; padding-top: 10px; }
  .portal-content { padding: 16px; }
}

/* =====================================================================
   Stage C.4 — activity-setup config module
   ===================================================================== */
.cfg-typelist { margin-bottom: 20px; }
.cfg-link { color: var(--brand-red); text-decoration: none; font-weight: 500; }
.cfg-link:hover { text-decoration: underline; }
.cfg-code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; color: var(--muted); }
.cfg-back { display: inline-block; margin-bottom: 10px; color: var(--muted); text-decoration: none; font-size: 13px; }
.cfg-back:hover { color: var(--ink); }

.cfg-section { margin-bottom: 16px; }
.cfg-subhead { font-size: 14px; font-weight: 600; margin: 16px 0 10px; color: var(--ink); }
.cfg-muted { color: var(--muted); font-size: 13px; }

.cfg-form .cfg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  align-items: end;
}
.field--check { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.field--check input { width: auto; }

.cfg-checks { display: flex; flex-wrap: wrap; gap: 10px 18px; margin: 6px 0; }
.cfg-check { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.cfg-check input { width: auto; }
.cfg-check-group { flex-basis: 100%; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border); display: flex; flex-wrap: wrap; gap: 10px 18px; }
.cfg-check-grouplabel { flex-basis: 100%; font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.cfg-check--future { color: #8A6D1F; }

.cfg-fieldtable { margin-bottom: 16px; }
.cfg-addfield { border-top: 1px solid var(--border); margin-top: 12px; padding-top: 12px; }

.pill { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 10px; }
.pill--on { background: #e6f4ee; color: #0F6E56; }
.pill--off { background: var(--bg); color: var(--muted); border: 1px solid var(--border); }

.link-danger { background: none; border: none; color: var(--brand-red); cursor: pointer; font-size: 13px; padding: 0; text-decoration: underline; }

/* C.5.1 — empty-list note for guarded selects (client/RM) */
.field__note { font-size: 13px; color: var(--muted); padding: 8px 0; font-style: italic; }

/* C.5.1 — 24h time picker (hour:minute selects) */
.time-pick { display: flex; align-items: center; gap: 6px; }
.time-pick__h, .time-pick__m { flex: 1; min-width: 0; text-align: center; }
.time-pick__sep { font-weight: 700; color: var(--ink-soft); }

/* =====================================================================
   Stage C.6 — reporting dashboard
   ===================================================================== */
.rep-head { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.rep-monthnav { display: flex; align-items: center; gap: 10px; background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 6px 10px; }
.rep-monthnav__arrow { font-size: 22px; line-height: 1; color: var(--brand-red); text-decoration: none; padding: 0 6px; }
.rep-monthnav__label { font-weight: 600; min-width: 120px; text-align: center; }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 8px; margin-bottom: 10px; }
.kpi-grid--sm { grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); }
.kpi { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 11px 12px; border-left-width: 3px; }
.kpi__value { font-size: 22px; font-weight: 700; line-height: 1.1; }
.kpi__label { font-size: 12px; font-weight: 600; color: var(--ink-soft); margin-top: 3px; }
.kpi__hint { font-size: 10px; color: var(--muted); margin-top: 2px; }
.kpi--good { border-left-color: #1D7D5B; } .kpi--good .kpi__value { color: #0F6E56; }
.kpi--mid  { border-left-color: var(--gold); } .kpi--mid .kpi__value { color: #8A6D1F; }
.kpi--low  { border-left-color: var(--brand-red); } .kpi--low .kpi__value { color: var(--brand-red); }
.kpi--neutral { border-left-color: var(--border); }

.minicard { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 6px; text-align: center; }
.minicard__n { display: block; font-size: 17px; font-weight: 700; }
.minicard__l { display: block; font-size: 10px; color: var(--muted); margin-top: 1px; line-height: 1.2; }

.rep-section { margin-bottom: 16px; }
.bars { display: flex; flex-direction: column; gap: 12px; }
.bars__row { display: flex; align-items: center; gap: 10px; }
.bars__label { flex: 0 0 120px; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bars__track { flex: 1; position: relative; height: 22px; background: var(--bg); border-radius: 11px; overflow: hidden; }
.bars__fill { position: absolute; inset: 0 auto 0 0; height: 100%; background: #f3c9cc; border-radius: 9px; overflow: hidden; }
.bars__done { position: absolute; inset: 0 auto 0 0; height: 100%; background: var(--brand-red); border-radius: 9px; }
.bars__num { flex: 0 0 auto; font-size: 13px; font-weight: 600; min-width: 56px; text-align: right; }
.bars__sub { font-weight: 400; color: var(--muted); font-size: 11px; }
.bars__legend { display: flex; gap: 16px; margin-top: 12px; font-size: 12px; color: var(--muted); }
.bars__legenditem { display: flex; align-items: center; gap: 6px; }
.bars__swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.bars__swatch--total { background: #f3c9cc; }
.bars__swatch--done { background: var(--brand-red); }

.rep-foot { font-size: 12px; color: var(--muted); font-style: italic; margin-top: 16px; }

/* C.6.1 — Ecuria tab (mobile reporting) */
.rep-monthnav--mobile { width: 100%; justify-content: center; margin: 0 0 14px; box-sizing: border-box; }

/* C.6.2 — busy vs free hours */
.bf-summary { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 14px; }
.bf-stat { flex: 1; min-width: 70px; text-align: center; }
.bf-stat__n { display: block; font-size: 20px; font-weight: 700; }
.bf-stat__l { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }

.bf-days { display: flex; align-items: flex-end; gap: 3px; overflow-x: auto; padding-bottom: 2px; }
.bf-days--wide { gap: 5px; }
.bf-day { flex: 1 0 16px; min-width: 16px; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.bf-day__track { width: 100%; max-width: 20px; height: 56px; background: var(--bg); border: 1px solid var(--border); border-radius: 4px; display: flex; align-items: flex-end; overflow: hidden; }
.bf-day__bar { width: 100%; background: var(--brand-red); border-radius: 0 0 3px 3px; min-height: 0; transition: height 0.2s ease; }
.bf-day--free .bf-day__track { border-style: dashed; }
.bf-day--off .bf-day__track { background: repeating-linear-gradient(45deg, #f0f0f2, #f0f0f2 3px, transparent 3px, transparent 6px); border-color: transparent; }
.bf-day__n { font-size: 9px; color: var(--muted); }
.bf-day--off .bf-day__n { opacity: 0.5; }
.bf-note { font-size: 11px; color: var(--muted); margin-top: 10px; }
.bf-legend { display: flex; gap: 14px; margin-top: 10px; font-size: 11px; color: var(--muted); flex-wrap: wrap; }
.bf-legend__item { display: flex; align-items: center; gap: 5px; }
.bf-legend__sw { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.bf-legend__sw--busy { background: var(--brand-red); }
.bf-legend__sw--free { background: var(--bg); border: 1px dashed var(--border); }
.bf-legend__sw--off { background: repeating-linear-gradient(45deg, #f0f0f2, #f0f0f2 3px, transparent 3px, transparent 6px); }
.bf-day__track { position: relative; }
.bf-day__seg { position: absolute; left: 0; right: 0; transition: height 0.2s ease; }
.bf-day__seg--busy { bottom: 0; background: var(--brand-red); border-radius: 0 0 3px 3px; }
.bf-day__seg--travel { background: var(--gold); }
.bf-legend__sw--travel { background: var(--gold); }
.bf-stat__n--gold { color: var(--gold); }
.bf-day__pct { font-size: 9px; font-weight: 700; line-height: 1; height: 10px; color: var(--ink-soft); }
.bf-day__pct--zero { color: var(--muted); font-weight: 400; opacity: 0.5; }
.bf-day--future .bf-day__track { background: var(--bg); border-style: dotted; opacity: 0.55; }

/* C.6.3 — GPS drift flag */
.tag--gps-flag { background: #fdecec; color: var(--brand-red); border: 1px solid #f3c9cc; }
.tag--time { background: #e8eef9; color: #2f5da8; border: 1px solid #cddcf3; }   /* c9_141 mbyllur pas 4 orësh / sipas daljes */
.bf-flag { font-size: 12px; color: var(--brand-red); margin-top: 6px; font-weight: 600; }

/* =====================================================================
   Stage C.7 — management reporting (roster)
   ===================================================================== */
.rep-filter { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.rep-chip { font-size: 13px; padding: 5px 12px; border: 1px solid var(--border); border-radius: 16px; text-decoration: none; color: var(--ink-soft); background: var(--card-bg); }
.rep-chip:hover { border-color: var(--brand-red); color: var(--brand-red); }
.rep-chip--on { background: var(--brand-red); color: #fff; border-color: var(--brand-red); }

.roster { width: 100%; }
.roster th, .roster td { padding: 7px 6px; font-size: 12px; }
.roster__spark-th { white-space: nowrap; }
.roster__row { cursor: pointer; }
.roster__row:hover { background: #fdf3f3; }
.roster__name { font-weight: 600; white-space: nowrap; }
.roster__num { text-align: right; white-space: nowrap; }
.roster__th { cursor: pointer; user-select: none; white-space: nowrap; }
.roster__th:hover { color: var(--brand-red); }
.roster__th::after { content: '⇅'; font-size: 9px; opacity: 0.35; margin-left: 5px; }
.roster__th.srt--asc::after { content: '↑'; opacity: 1; color: var(--brand-red); }
.roster__th.srt--desc::after { content: '↓'; opacity: 1; color: var(--brand-red); }
.role-pill { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 9px; background: var(--bg); border: 1px solid var(--border); color: var(--ink-soft); }
.roster__flag { display: inline-block; min-width: 20px; padding: 1px 6px; border-radius: 9px; background: #fdecec; color: var(--brand-red); font-weight: 700; font-size: 12px; }
.roster__sub { display: block; font-size: 10.5px; color: var(--text-muted, #6b7280); font-weight: 500; white-space: nowrap; margin-top: 2px; }   /* c9_141 */
.roster__acts { text-align: right; white-space: nowrap; }
.roster__spark-cell { padding: 4px 6px; white-space: nowrap; vertical-align: middle; }
.roster__spark { display: block; }
.roster__spark-lbl { fill: #4b5058; font-size: 8px; font-weight: 600; font-family: inherit; }
.roster__spark-lbl0 { fill: #c9ccd0; font-size: 8px; font-family: inherit; }
.roster__spark-empty { color: var(--muted, #9aa0a6); }
.roster__actlink { color: var(--brand-red); font-size: 13px; text-decoration: none; white-space: nowrap; }
.roster__actlink:hover { text-decoration: underline; }

.pctcell { display: inline-block; min-width: 44px; padding: 2px 8px; border-radius: 9px; font-weight: 700; font-size: 12px; text-align: center; }
.pctcell--good { background: #e6f4ee; color: #0F6E56; }
.pctcell--mid  { background: #fbf3e3; color: #8A6D1F; }
.pctcell--low  { background: #fdecec; color: var(--brand-red); }
.pctcell--neutral { background: var(--bg); color: var(--muted); }

/* C.7.1 — anomalies (fraud review) section */
.anom__sub { font-size: 12px; font-weight: 400; color: var(--muted); }
.anom__intro { font-size: 12px; color: var(--muted); margin: 0 0 12px; }
.anom__list { display: flex; flex-direction: column; gap: 8px; }
.anom__row { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border: 1px solid var(--border); border-left: 3px solid var(--brand-red); border-radius: var(--radius-sm); text-decoration: none; color: var(--ink); background: #fffafa; }
.anom__row:hover { background: #fdecec; }
.anom__main { display: flex; align-items: center; gap: 10px; }
.anom__type { font-weight: 600; font-size: 14px; }
.anom__date { font-size: 12px; color: var(--muted); }
.anom__flags { display: flex; flex-wrap: wrap; gap: 6px; }
.anom__flag { font-size: 11px; font-weight: 600; color: var(--brand-red); background: #fdecec; border: 1px solid #f3c9cc; border-radius: 8px; padding: 2px 8px; }

/* C.7.2 — add-reason form */
.cfg-addreason { border-top: 1px dashed var(--border); margin-top: 14px; padding-top: 12px; }
.btn--ghost { background: var(--card-bg); color: var(--brand-red); border: 1px solid var(--brand-red); }
.btn--ghost:hover { background: #fdecec; }

/* =====================================================================
   Stage C.8 — activity tree builder + cascading picker
   ===================================================================== */
.cfg-treelink { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }

.tree-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.tree-hint { font-size: 12px; color: var(--muted); }
.tree-hint--err { color: var(--brand-red); font-weight: 600; }

.tlist { list-style: none; margin: 0; padding: 0 0 0 18px; }
.tlist--root { padding-left: 0; }
.tlist--empty { min-height: 8px; }
.tlist--over { background: #fdf3f3; border-radius: var(--radius-sm); outline: 1px dashed var(--gold); }
.tnode { margin: 4px 0; }
.tnode__row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.tnode__row--off { opacity: 0.55; }
.tnode--dragging > .tnode__row { outline: 2px solid var(--brand-red); opacity: 0.7; }
.tnode__grip { cursor: grab; color: var(--muted); font-size: 12px; user-select: none; }
.tnode__label { font-weight: 600; }
.tnode__meta { font-size: 11px; color: var(--muted); }
.tnode__actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.tnode__del { display: inline; margin: 0; }
.tnode__btn { font-size: 12px; padding: 3px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--card-bg); color: var(--ink-soft); cursor: pointer; }
.tnode__btn:hover { border-color: var(--brand-red); color: var(--brand-red); }
.tnode__btn--danger { color: var(--brand-red); border-color: #f3c9cc; }

.tmodal { position: fixed; inset: 0; background: rgba(0,0,0,0.4); display: flex; align-items: center; justify-content: center; z-index: 200; }
.tmodal[hidden] { display: none; }
.tmodal__box { background: var(--card-bg); border-radius: var(--radius); padding: 20px; width: min(440px, 92vw); }
.tmodal__title { margin: 0 0 14px; font-size: 17px; }
.tmodal .field { margin-bottom: 12px; }
.tmodal .cfg-check { margin-bottom: 10px; }

/* C.8.4 — tree builder button controls (replaces drag-drop) */
.tinl { display: inline; margin: 0; }
.tnode__lvl { font-size: 10px; font-weight: 700; color: var(--muted); background: var(--bg); border-radius: 4px; padding: 1px 5px; }
.tnode__req { font-size: 10px; color: var(--gold); font-weight: 600; }
.tnode__off { font-size: 10px; color: var(--muted); font-style: italic; }
.tnode__arrow { font-weight: 700; min-width: 26px; }
.tnode__btn:disabled { opacity: 0.35; cursor: default; }
.tmodal[hidden] { display: none !important; }

/* C.8.5 — arrow links (GET) replace arrow form-buttons */
a.tnode__btn { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.tnode__btn--off { opacity: 0.3; pointer-events: none; cursor: default; }

/* C.8.9 — tree collapse/expand toggles */
.tnode__toggle { width: 22px; height: 22px; flex: 0 0 22px; border: none; background: transparent; cursor: pointer; font-size: 12px; color: var(--ink-soft); padding: 0; line-height: 1; display: inline-flex; align-items: center; justify-content: center; border-radius: 4px; }
.tnode__toggle:hover { background: var(--bg); color: var(--brand-red); }
.tnode__toggle--leaf { cursor: default; }
.tnode__toggle--leaf:hover { background: transparent; }

/* C.8.13 — activity-setup note replacing the removed add-type form */
.cfg-note { margin-top: 14px; padding: 10px 12px; background: var(--bg); border-radius: var(--radius-sm); font-size: 13px; }
.cfg-note a { color: var(--brand-red); font-weight: 600; }

/* Phase 1 — movement history map */
.mv-maplink { display:inline-block; margin-left:12px; font-size:13px; color:var(--brand-red); font-weight:600; }
.mv-totals { display:flex; gap:10px; flex-wrap:wrap; margin:12px 0; }
.mv-tile { background:var(--card-bg); border:1px solid var(--border); border-radius:var(--radius-sm); padding:10px 14px; min-width:120px; }
.mv-tile__v { display:block; font-size:18px; font-weight:700; color:var(--ink); }
.mv-tile__l { display:block; font-size:11px; color:var(--muted); margin-top:2px; }
.mv-mapcard { padding:0; overflow:hidden; }
.mv-map { width:100%; height:420px; }
.mv-pin span { display:flex; align-items:center; justify-content:center; width:26px; height:26px; background:var(--brand-red); color:#fff; border-radius:50% 50% 50% 0; transform:rotate(-45deg); font-size:12px; font-weight:700; border:2px solid #fff; box-shadow:0 1px 4px rgba(0,0,0,.3); }
.mv-pin span { transform:none; border-radius:50%; }
.mv-timeline { list-style:none; margin:0; padding:0; }
.mv-stop { display:flex; gap:10px; padding:8px 0; align-items:flex-start; }
.mv-stop__seq { flex:0 0 26px; height:26px; width:26px; display:flex; align-items:center; justify-content:center; background:var(--brand-red); color:#fff; border-radius:50%; font-size:12px; font-weight:700; }
.mv-stop__head { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.mv-stop__time { font-size:12px; color:var(--muted); }
.mv-stop__meta { font-size:12px; color:var(--ink-soft); margin-top:2px; }
.mv-nogps { color:var(--gold); }
.mv-badge--live { font-size:10px; background:#E8F5E9; color:#2E7D32; padding:1px 6px; border-radius:4px; font-weight:600; }
.mv-gap { display:flex; gap:8px; align-items:center; padding:4px 0 4px 36px; font-size:12px; color:var(--muted); }
.mv-gap--travel { color:#1565C0; }
.mv-gap--rest { color:var(--muted); }
.mv-gap--flag { color:var(--brand-red); font-weight:600; }
.mv-flag { color:var(--brand-red); font-weight:600; }
.mv-src { color:var(--muted); font-size:11px; }
.mv-note { font-size:11px; color:var(--muted); margin-top:10px; font-style:italic; }
.mv-tile--gold .mv-tile__v { color:var(--gold); }
.mv-maphint { font-size:11px; color:var(--muted); padding:6px 14px; margin:0; border-top:1px solid var(--border-soft); }
/* Per-leg drive/idle colours (shared by map labels + timeline). */
.mv-leg__drive { color:var(--gold); font-weight:600; }
.mv-leg__idle  { color:var(--muted); }
/* Midpoint label pill on the map. */
.mv-leglabel { background:none !important; border:none !important; }
.mv-leglabel__in { display:inline-block; white-space:nowrap; transform:translate(-50%,-50%);
  background:#fff; border:1px solid var(--border); border-radius:999px; padding:2px 8px;
  font-size:11px; line-height:1.5; box-shadow:0 1px 3px rgba(0,0,0,.18); }
/* Richer timeline records. */
.mv-stop__title { font-size:14px; color:var(--ink); }
.mv-stop__sub { font-size:12px; color:var(--ink-soft); margin-top:1px; }
.mv-stop__chips { display:flex; flex-wrap:wrap; gap:6px; margin-top:6px; }
.mv-chip { font-size:11px; color:var(--ink-soft); background:var(--bg); border:1px solid var(--border-soft);
  border-radius:999px; padding:1px 8px; }
.mv-chip--dur { font-weight:600; }
.mv-chip--code { font-family:ui-monospace,Menlo,Consolas,monospace; }
.mv-chip--warn { color:var(--brand-red); border-color:var(--brand-red); }
.mv-tag { font-size:10px; font-weight:700; letter-spacing:.02em; text-transform:uppercase;
  border-radius:999px; padding:1px 8px; }
.mv-tag--live  { background:#E7F3E8; color:#2E7D32; }
.mv-tag--adhoc { background:#FDECEC; color:var(--brand-red); }
.mv-tag--late  { background:#FBF3E2; color:#8A6D1F; }
.mv-stop__notes { font-size:12px; color:var(--ink-soft); font-style:italic; margin-top:6px;
  padding-left:10px; border-left:2px solid var(--border); }
/* Map popups (movement + live). */
.mvpop { font-size:12px; line-height:1.5; }
.mvpop__t { font-size:13px; color:var(--ink); }
.mvpop__sub { color:var(--ink-soft); margin-bottom:4px; }
.mvpop__r { color:var(--ink-soft); }
.mvpop__r--warn { color:var(--brand-red); }
.mvpop__notes { font-style:italic; color:var(--ink-soft); margin-top:4px;
  padding-left:8px; border-left:2px solid var(--border); }
.mvpop__tag { display:inline-block; margin:4px 4px 0 0; font-size:10px; font-weight:700;
  text-transform:uppercase; border-radius:999px; padding:1px 7px; }
.mvpop__tag--adhoc { background:#FDECEC; color:var(--brand-red); }
.mvpop__tag--late  { background:#FBF3E2; color:#8A6D1F; }
.mvpop__tag--live  { background:#E7F3E8; color:#2E7D32; }

/* Phase 2 — live status board */
.lv-link { color:var(--brand-red); font-weight:600; }
.lv-legend { display:flex; gap:16px; flex-wrap:wrap; align-items:center; font-size:12px; color:var(--ink-soft); margin:10px 0; }
.lv-dot { display:inline-block; width:12px; height:12px; border-radius:50%; margin-right:4px; vertical-align:middle; border:2px solid #fff; box-shadow:0 0 0 1px var(--border); }
.lv-dot--active { background:#2E7D32; }
.lv-dot--recent { background:#1565C0; }
.lv-dot--idle   { background:var(--gold); }
.lv-dot--none   { background:#9E9E9E; }
.lv-list { list-style:none; margin:0; padding:0; }
.lv-item { display:flex; gap:10px; align-items:flex-start; padding:10px 0; border-bottom:1px solid var(--border); }
.lv-item:last-child { border-bottom:none; }
.lv-item .lv-dot { margin-top:4px; }
.lv-item__head { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.lv-item__status { font-size:13px; color:var(--ink-soft); }
.lv-inferred { font-size:10px; color:var(--gold); font-style:italic; }
.lv-item__meta { font-size:12px; color:var(--muted); margin-top:2px; }

/* Phase 3 — anomaly review */
.rv-pill { display:inline-block; min-width:22px; padding:1px 7px; border-radius:10px; font-size:12px; font-weight:700; text-align:center; }
.rv-pill--high { background:#FDECEA; color:#C62828; }
.rv-pill--med  { background:#FFF4E5; color:#B08B3C; }
.rv-pill--low  { background:#ECEFF1; color:#546E7A; }
.anom__hint { font-size:12px; color:var(--ink-soft); font-style:italic; }
.anom__row--high   { border-left:3px solid #C62828; }
.anom__row--medium { border-left:3px solid var(--gold); }
.anom__row--low    { border-left:3px solid #B0BEC5; }

/* movement map — inline date picker in the day nav */
.mv-datepick { border:1px solid var(--border); border-radius:var(--radius-sm); padding:5px 8px; font:inherit; font-size:14px; color:var(--ink); background:var(--card-bg); cursor:pointer; }
.mv-datepick:focus { outline:2px solid var(--brand-red); outline-offset:1px; }

/* tree builder — header actions group (export + back) */
.rep-head__actions { display:flex; gap:12px; align-items:center; }

/* ==== Segmented control (duration) ================================== */
.seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.seg__item { position: relative; margin: 0; }
.seg__item input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.seg__btn {
  display: flex; align-items: center; justify-content: center;
  min-height: var(--touch); border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 15px; color: var(--ink);
  background: var(--card-bg); transition: all .12s; user-select: none;
}
.seg__item input:checked + .seg__btn {
  border-color: var(--brand-red); background: #fdecec; color: var(--brand-red);
  font-weight: 700; box-shadow: inset 0 0 0 1px var(--brand-red);
}
.seg__item input:focus-visible + .seg__btn { outline: 2px solid var(--brand-red); outline-offset: 2px; }

/* ==== Rich client picker =========================================== */
.clientpick__search { position: relative; display: flex; align-items: center; }
.clientpick__ic { position: absolute; left: 12px; color: var(--muted-soft); display: flex; pointer-events: none; }
.clientpick__input {
  width: 100%; min-height: 48px; padding: 0 40px; font-size: 16px;
  color: var(--ink); background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); -webkit-appearance: none; appearance: none;
}
.clientpick__input:focus { outline: none; border-color: var(--brand-red); box-shadow: 0 0 0 2px rgba(230,30,42,0.12); }
.clientpick__clear {
  position: absolute; right: 8px; width: 30px; height: 30px; border: none;
  background: transparent; font-size: 22px; line-height: 1; color: var(--muted-soft);
  cursor: pointer; border-radius: 50%;
}
.clientpick__clear:hover { background: var(--border-soft); }
.clientpick__list {
  list-style: none; margin: 10px 0 0; padding: 0; max-height: 340px; overflow-y: auto;
  border: 1px solid var(--border); border-radius: var(--radius-sm); -webkit-overflow-scrolling: touch;
}
.clientpick__row {
  display: flex; align-items: flex-start; gap: 12px; padding: 15px 14px;
  border-bottom: 1px solid var(--border-soft); cursor: pointer;
}
.clientpick__row:last-child { border-bottom: none; }
.clientpick__row:active { background: var(--border-soft); }
.clientpick__row.is-selected { background: #fdecec; }
.clientpick__ini {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 10px;
  background: var(--border-soft); color: var(--muted);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px;
}
.clientpick__row.is-selected .clientpick__ini { background: #fff; color: var(--brand-red); box-shadow: inset 0 0 0 1px var(--brand-red); }
.clientpick__body { flex: 1 1 auto; min-width: 0; }
.clientpick__name { display: block; font-size: 15px; font-weight: 600; color: var(--ink); line-height: 1.35; }
.clientpick__trade { font-weight: 400; color: var(--muted); font-size: 13px; }
.clientpick__meta { display: block; font-size: 13px; color: var(--muted); line-height: 1.4; margin-top: 3px; }
.clientpick__meta svg { vertical-align: -1px; opacity: .8; }
.clientpick__code { flex: 0 0 auto; margin-top: 2px; font-size: 11px; color: var(--muted); background: var(--border-soft); border-radius: 20px; padding: 2px 8px; white-space: nowrap; }
.clientpick__row.is-selected .clientpick__code { color: var(--brand-red); background: #fff; }
.clientpick__check { flex: 0 0 auto; color: var(--brand-red); display: none; }
.clientpick__row.is-selected .clientpick__check { display: flex; align-items: center; }
.clientpick__row.is-selected .clientpick__check::before { content: '✓'; font-weight: 700; font-size: 16px; line-height: 1; }
.clientpick__empty { padding: 14px; text-align: center; color: var(--muted); font-size: 14px; }
.clientpick__note { padding: 12px 14px; color: var(--muted); font-size: 13px; }
.clientpick--error .clientpick__input { border-color: var(--brand-red); box-shadow: 0 0 0 2px rgba(230,30,42,0.12); }
.clientpick--error .clientpick__list { border-color: var(--brand-red); }
.field__req { color: var(--brand-red); }

/* Prominent primary action on the activity forms */
.action-row > .btn { flex: 1; }
.action-row > .btn[type="submit"], .action-row > .btn--go { min-height: 50px; font-size: 16px; }

/* ==== Activity forms: larger touch-friendly controls =============== */
.actform select.field__control,
.actform input.field__control {
  min-height: 52px; font-size: 16px; border-radius: 12px; padding: 12px 14px;
}
.actform select.field__control {
  padding-right: 42px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-position: right 15px center;
}

/* ==== Date: horizontal day strip =================================== */
.dstrip { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 6px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.dstrip::-webkit-scrollbar { display: none; }
.dchip {
  flex: 0 0 auto; width: 58px; min-height: 64px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px; padding: 6px 0;
  border: 1px solid var(--border); border-radius: 14px; background: var(--card-bg);
  cursor: pointer; position: relative; font-family: inherit;
}
.dchip:active { background: var(--border-soft); }
.dchip__wd { font-size: 11px; color: var(--muted); }
.dchip__d { font-size: 18px; font-weight: 700; color: var(--ink); line-height: 1; }
.dchip.is-selected { border-color: var(--brand-red); background: #fdecec; }
.dchip.is-selected .dchip__wd, .dchip.is-selected .dchip__d { color: var(--brand-red); }
.dchip--more { color: var(--muted); }
.dchip--more .dchip__d { display: flex; align-items: center; justify-content: center; }
.dchip--more input[type="date"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.dstrip__picked { font-size: 13px; color: var(--brand-red); font-weight: 600; margin-top: 4px; }

/* ==== Time: hour select + segmented minutes ======================== */
.time-pick { display: flex; align-items: center; gap: 8px; }
.time-pick__h { flex: 0 0 84px; text-align: center; }
.time-pick__sep { font-weight: 700; color: var(--muted); font-size: 18px; }
.time-pick__min { flex: 1 1 auto; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.time-pick__min .seg__btn { min-height: 48px; font-size: 15px; }

/* ==== Time: scrollable hour strip + minute segments ================ */
.hstrip { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 6px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.hstrip::-webkit-scrollbar { display: none; }
.hchip {
  flex: 0 0 auto; min-width: 48px; min-height: 48px; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-soft); border-radius: 12px; background: var(--card-bg);
  font-size: 16px; font-weight: 600; color: var(--ink-soft); cursor: pointer; font-family: inherit;
}
.hchip:active { background: var(--border-soft); }
.hchip.is-selected { border-color: var(--brand-red); background: var(--brand-red); color: #fff; }

/* Digital readout + secondary minute chips */
.timepick__readout {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: fit-content; margin: 0 auto 14px; padding: 10px 22px;
  background: #f2f3f6; color: var(--ink); border: 1px solid var(--border-soft); border-radius: 14px;
  font-size: 32px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 3px;
}
.timepick__colon { color: var(--muted); margin: 0; letter-spacing: 0; }
.timepick__icon { color: var(--gold); flex: 0 0 auto; }
.mstrip { display: flex; gap: 8px; margin-top: 10px; }
.mchip__item { position: relative; margin: 0; }
.mchip__item input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.mchip {
  display: flex; align-items: center; justify-content: center; min-width: 52px; height: 36px; padding: 0 10px;
  border: 1px solid var(--border); border-radius: 10px; font-size: 13px; color: var(--muted); background: var(--card-bg);
}
.mchip__item input:checked + .mchip { background: var(--brand-red); border-color: var(--brand-red); color: #fff; font-weight: 700; }
.mchip__item input:focus-visible + .mchip { outline: 2px solid var(--brand-red); outline-offset: 2px; }

/* ==== My Kraco lockup (login / forced-password) ==================== */
/* c9_56 — the logo was stretched 34% wide.
   `width:210px` + `max-height:130px` are contradictory on a 665x550 image:
   the fixed width wins, the height clamps, and the artwork squashes. With
   BOTH axes auto and only maxima set, the browser scales proportionally and
   picks the smaller fit (157x130 here). object-fit is the backstop so no
   future constraint can distort it again. */
.login__lockup {
  display: block;
  width: auto; height: auto;
  max-width: min(210px, 62%);
  max-height: 130px;
  object-fit: contain;
  margin: 0 auto 6px;
}

/* Short viewports (small laptops, landscape phones, keyboard open):
   tighten everything so the login fits without scrolling. */
@media (max-height: 720px) {
  .bare-main { padding-top: calc(14px + env(safe-area-inset-top, 0px)); padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px)); gap: 8px; }
  .login { gap: 12px; }
  .login__lockup { max-height: 92px; margin-bottom: 2px; }
  .login__sub { font-size: 14px; }
  .login__form { padding: 16px 16px; gap: 12px; }
  .login .field__control { min-height: 46px; }
  .login__btn { min-height: 48px; margin-top: 2px; }
}
@media (max-height: 560px) {
  .login__lockup { max-height: 62px; }
  .login__form { gap: 10px; }
}

/* ==== App status / diagnostics page ================================ */
.stat-page { padding: 8px 0 24px; }
.stat-h1 { font-size: 20px; font-weight: 700; color: var(--ink); margin: 8px 0 4px; }
.stat-lead { font-size: 13px; color: var(--muted); margin: 0 0 14px; line-height: 1.5; }
.stat-card { margin-bottom: 14px; }
.stat-card__title { font-size: 12px; font-weight: 700; color: var(--ink-soft); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .3px; }
.stat-app { display: flex; align-items: center; gap: 12px; padding-bottom: 12px; margin-bottom: 10px; border-bottom: 1px solid var(--border-soft); }
.stat-app__name { font-size: 17px; font-weight: 700; color: var(--ink); }
.stat-app__ver { font-size: 13px; color: var(--muted); }
.stat-kv { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; padding: 4px 0; color: var(--muted); }
.stat-kv b { color: var(--ink); font-weight: 600; text-align: right; }
.stat-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border-soft); }
.stat-row:last-of-type { border-bottom: none; }
.stat-row__label { font-size: 15px; font-weight: 600; color: var(--ink); }
.stat-row__hint { font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.4; }
.stat-badge { flex: 0 0 auto; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 20px; white-space: nowrap; }
.stat-badge--ok { background: #e6f7ec; color: #1a7f42; }
.stat-badge--bad { background: #fdecec; color: var(--brand-red); }
.stat-badge--warn { background: #fff4e0; color: #a86b00; }
.stat-badge--unknown { background: var(--border-soft); color: var(--muted); }
.stat-actions { display: flex; gap: 10px; margin-top: 14px; }
.stat-actions .btn { flex: 1; }
.stat-copied { margin-top: 10px; font-size: 13px; color: #1a7f42; font-weight: 600; }
.stat-tech summary { font-size: 14px; font-weight: 600; color: var(--ink); cursor: pointer; }
.stat-tech[open] summary { margin-bottom: 8px; }
.stat-offline { background: #fff4e0; color: #a86b00; border-radius: 10px; padding: 10px 12px; font-size: 13px; line-height: 1.45; margin-bottom: 14px; }

/* --- Kontrata embed (Contracts app in an iframe inside the shell) --- */
/* Fixed overlay so it fills the whole area below the top bar, ignoring the
   shell's content padding/max-width. bottom:0 tracks the real viewport bottom
   (handles mobile browser chrome better than 100vh). */
.embed { position: fixed; z-index: 1;
  top: calc(var(--topbar-h) + env(safe-area-inset-top, 0px));
  left: 0; right: 0; bottom: 0;
  display: flex; flex-direction: column; background: var(--bg); }
.embed__bar { display: flex; align-items: center; gap: 12px; padding: 8px 12px;
  background: var(--card-bg); border-bottom: 1px solid var(--border); flex: 0 0 auto; }
.embed__back { color: var(--brand-red); text-decoration: none; font-size: 14px; white-space: nowrap; }
.embed__title { font-weight: 700; color: var(--ink); }
.embed__ext { margin-left: auto; color: var(--gold); text-decoration: none; font-size: 13px; white-space: nowrap; }
.embed__frame { flex: 1 1 auto; width: 100%; height: 100%; border: 0; background: #fff; display: block; }

/* --- External-apps admin + external launcher tile --- */
.module-card__ext { font-size: 12px; color: var(--muted); }
.btn--ghost { background: transparent; color: var(--brand-red); box-shadow: inset 0 0 0 1px var(--border); }
.ea-url { font-size: 12px; color: var(--ink-soft); word-break: break-all; max-width: 260px; }
.ea-q { color: var(--gold); }
.ea-on { color: #2E7D32; font-weight: 600; }
.ea-off { color: var(--muted); }
.ea-actions { white-space: nowrap; }
.ea-link { background: none; border: 0; padding: 0 6px; color: var(--brand-red); cursor: pointer;
  font-size: 13px; text-decoration: none; font-family: inherit; }
.ea-link--danger { color: #B00020; }
.ea-form { display: flex; flex-direction: column; gap: 14px; max-width: 560px; }
.ea-form__actions { display: flex; gap: 12px; align-items: center; margin-top: 8px; }
.field--row { display: flex; gap: 16px; }
.field--row > div { flex: 1; }
.field__control--sm { max-width: 140px; }
.field__check { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; color: var(--ink-soft); }
.field__check input { margin-top: 2px; }
.portal-admin-tools { margin-top: 20px; display: flex; flex-direction: column; gap: 8px; }
.portal-admin-tools__link { color: var(--ink-soft); text-decoration: none; font-size: 14px;
  padding: 10px 14px; background: var(--card-bg); border: 1px solid var(--border-soft); border-radius: var(--radius); }
.portal-admin-tools__link:hover { color: var(--brand-red); }


.field__note code { background: var(--bg); padding: 1px 4px; border-radius: 4px; font-size: 11px; }

/* --- Auto-closed activity (forgotten stop) --- */
.auto-closed-note { display: inline-block; font-size: 12.5px; color: var(--ink-soft);
  background: #fff8ec; border: 1px solid #f0e2c4; border-radius: var(--radius-sm); padding: 6px 9px; line-height: 1.4; }
.reminder-banner--open_activity { border-left: 3px solid var(--gold); }
.reminder-banner--open_activity .reminder-banner__icon { color: var(--gold); }

/* --- Ongoing-activity banner (one open at a time; don't-forget-to-close) --- */
.ongoing-bar { position: sticky; top: calc(var(--topbar-h) + env(safe-area-inset-top, 0px)); z-index: 20;
  display: flex; align-items: center; gap: 10px; padding: 11px 14px;
  background: var(--brand-red); color: #fff; text-decoration: none;
  font-weight: 700; font-size: 14px; box-shadow: 0 2px 6px rgba(0,0,0,.15); }
.ongoing-bar:hover { text-decoration: none; }
.ongoing-bar__dot { width: 10px; height: 10px; border-radius: 50%; background: #fff;
  flex: 0 0 auto; animation: ongoing-pulse 1.4s ease-in-out infinite; }
.ongoing-bar__text { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ongoing-bar__cta { flex: 0 0 auto; opacity: .95; }
@keyframes ongoing-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .3; transform: scale(.7); } }

/* --- Activity result (migration 21) --------------------------------------
   Three explained cards on the close form, and a pill for the stored value
   on the detail page and in reporting. Colours come from the existing
   semantic tokens (--ok / --err / --warn), not from new hex values, so the
   result states sit inside the app's palette rather than beside it. */

.field__hint { color: var(--muted); font-size: 12px; margin: 4px 0 0; }
.field__hint--err { color: var(--err); }

.res-choice { display: flex; flex-direction: column; gap: 8px; }

.res-card {
  position: relative;           /* anchors the visually-hidden radio below */
  display: flex; align-items: center; gap: 12px;
  padding: 12px; min-height: 66px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color .12s ease, background-color .12s ease;
}
/* The radio stays in the DOM for keyboard and screen-reader users, and is
   what :has() below keys off — it is never display:none. */
.res-card__radio { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }

.res-card__icon {
  flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: #f1f2f4; color: var(--muted-soft);
}
.res-card__text  { flex: 1 1 auto; min-width: 0; }
.res-card__title { display: block; font-size: 14.5px; font-weight: 700; color: var(--ink); }
.res-card__desc  { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.35; }
.res-card__mark {
  flex: 0 0 auto; width: 20px; height: 20px; border-radius: 50%;
  border: 1.5px solid var(--border); background: #fff;
}

/* Selected state, per result. :has() carries the visual state; the
   :focus-visible ring is separate so keyboard users always see focus. */
.res-card:has(.res-card__radio:checked) { border-width: 2px; padding: 11px; }
.res-card:has(.res-card__radio:focus-visible) { box-shadow: 0 0 0 2px rgba(230, 30, 42, 0.18); }

.res-card--ok:has(.res-card__radio:checked)   { border-color: var(--ok);  background: var(--ok-bg); }
.res-card--bad:has(.res-card__radio:checked)  { border-color: var(--err); background: var(--err-bg); }
.res-card--cont:has(.res-card__radio:checked) { border-color: var(--gold); background: var(--gold-soft); }

.res-card--ok:has(.res-card__radio:checked)   .res-card__icon { background: var(--ok);  color: #fff; }
.res-card--bad:has(.res-card__radio:checked)  .res-card__icon { background: var(--err); color: #fff; }
.res-card--cont:has(.res-card__radio:checked) .res-card__icon { background: var(--gold); color: #fff; }

.res-card--ok:has(.res-card__radio:checked)   .res-card__title { color: var(--ok); }
.res-card--bad:has(.res-card__radio:checked)  .res-card__title { color: var(--err); }
.res-card--cont:has(.res-card__radio:checked) .res-card__title { color: var(--warn); }

.res-card--ok:has(.res-card__radio:checked)   .res-card__mark { border: 6px solid var(--ok); }
.res-card--bad:has(.res-card__radio:checked)  .res-card__mark { border: 6px solid var(--err); }
.res-card--cont:has(.res-card__radio:checked) .res-card__mark { border: 6px solid var(--gold); }

/* Fallback for engines without :has() — keeps the choice usable (the radio
   dot shows through) even if the card tinting does not apply. */
@supports not selector(:has(*)) {
  .res-card__radio { position: static; opacity: 1; width: 18px; height: 18px; pointer-events: auto; }
  .res-card__mark  { display: none; }
}

/* Follow-up panel, shown only for "Vijon" (hidden by the view's script) */
.res-followup {
  background: var(--gold-soft);
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 14px;
}
.res-followup__head { font-size: 13px; font-weight: 700; color: var(--warn); margin-bottom: 8px; }
.res-followup__note { font-size: 11.5px; color: var(--warn); margin: 8px 0 0; line-height: 1.35; }
.res-followup .field { margin-bottom: 0; }

.res-followup-open { border-left: 3px solid var(--gold); }

/* Stored result pill — detail page, reporting rows, exports */
.res-pill {
  display: inline-block;
  font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: 10px;
  white-space: nowrap;
}
.res-pill--ok   { background: var(--ok-bg);   color: var(--ok); }
.res-pill--bad  { background: var(--err-bg);  color: var(--err); }
.res-pill--cont { background: var(--gold-soft); color: var(--warn); border: 1px solid var(--gold); }
.res-pill--none { background: #f1f1f1; color: var(--muted); }

/* Small qualifier after a field label, e.g. "Përshkrimi * — çfarë do të bëhet" */
.field__label-note { font-weight: 400; color: var(--muted-soft); }

/* --- Reporting: expandable activity row (c9_26) --------------------------
   The row was a link to the activity page; it is now a <details> that opens
   the full record in place, so a manager can review a week without leaving
   the list. No JavaScript involved — <summary> handles the toggle, keyboard
   and screen-reader semantics. */

.task-det { border: 0; }
.task-row--det {
  cursor: pointer;
  list-style: none;                 /* hide the default marker (Firefox) */
  display: flex; align-items: center; gap: 12px;
}
.task-row--det::-webkit-details-marker { display: none; }   /* Safari */
.task-row--det::marker { content: ''; }
.task-det[open] > .task-row--det { border-bottom: 1px solid var(--border-soft); }

.task-det__chev { flex: 0 0 auto; color: var(--muted-soft); transition: transform .15s ease; }
.task-det[open] .task-det__chev { transform: rotate(180deg); }

.task-det__body {
  padding: 14px;
  background: #fbfbfa;
  border-top: 0;
}

/* Field grid. auto-fit keeps it multi-column on the desktop portal and
   single-column on a phone without a media query. */
.det-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px 18px;
  margin: 0 0 14px;
}
.det-cell dt {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--muted-soft); margin-bottom: 2px;
}
.det-cell dd { margin: 0; font-size: 13px; font-weight: 600; color: var(--ink); }
.det-sub  { font-weight: 400; color: var(--muted); }
.det-none { color: var(--muted-soft); font-style: italic; font-weight: 400; }

/* Recovered close text (c9_87).
   Deliberately NOT styled like a normal note. This is text the user wrote
   and the app refused to accept — it is evidence of work, not a record of
   it, and reading it as the activity's official result would be wrong. The
   warning ground and the left rule are the app's existing "treat with care"
   vocabulary (.flash--warning, .tag--late), reused rather than invented. */
.det-draft {
  margin-top: 6px;
  padding: 8px 10px;
  background: var(--warn-bg);
  border-left: 3px solid var(--gold);
  border-radius: 0 4px 4px 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 400;
  font-style: normal;
  white-space: pre-wrap;   /* it was typed in a textarea; keep the line breaks */
  word-break: break-word;
}

/* Text handed back into the close form after a refusal. One line, quiet —
   the restored paragraph is already visible in the field above it. */
.draft-back { color: var(--warn); }

.det-texts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}
.det-text {
  background: var(--card-bg);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 10px 12px;
}
.det-text dt {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--muted-soft); margin-bottom: 4px;
}
.det-text p { margin: 0; font-size: 13px; line-height: 1.45; color: var(--ink-soft); }

.det-anom {
  background: var(--card-bg);
  border: 1px solid #E2A0A0;
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 12px;
}
.det-anom__head { font-size: 12.5px; font-weight: 700; color: var(--err); margin-bottom: 8px; }
.det-anom__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.det-anom__tags .tag { text-transform: none; font-size: 11px; padding: 3px 8px; }

.det-foot { display: flex; justify-content: flex-end; }

/* Anomaly count badge on the collapsed row */
.tag--anom {
  background: var(--err-bg);
  color: var(--err);
  border: 1px solid #E2A0A0;
  text-transform: none;
}

/* ── c9_27 · GPS close block ─────────────────────────────────────────── */
/* The standing rule, shown before the user tries — a refusal after the
   fact teaches nothing the first time. */
.gps-rule {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 9px 11px; margin-bottom: 12px;
  background: var(--info-bg); border: 1px solid #c9dcf5; border-radius: var(--radius);
  font-size: 12.5px; line-height: 1.45; color: var(--info);
}
.gps-rule__ic { flex: 0 0 16px; margin-top: 1px; }
.gps-rule__prev {
  margin: -6px 0 12px; font-size: 12px; color: var(--err);
}
/* The refusal itself reuses .gps-status, which gps.js already drives.
   --err is the state that did not previously exist there. */
.gps-status--err {
  color: var(--err); background: var(--err-bg);
  border: 1px solid #f0c2c8; border-radius: var(--radius);
  padding: 9px 11px; font-size: 12.5px; line-height: 1.45;
}

/* Super User force-close, on the reporting drill-down. Styled as a
   deliberately unattractive last resort — it must not read as a normal
   action sitting next to the others. */
.forceclose { margin-top: 10px; border-top: 1px dashed var(--border); padding-top: 10px; }
.forceclose__lbl {
  display: block; font-size: 11.5px; font-weight: 600;
  color: var(--muted); margin-bottom: 5px;
}
.forceclose__row { display: flex; gap: 6px; align-items: stretch; }
.forceclose__row input[type="text"] {
  flex: 1; min-width: 0; padding: 7px 9px; font-size: 12.5px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.forceclose__btn {
  flex: 0 0 auto; padding: 7px 12px; font-size: 12.5px; font-weight: 600;
  color: var(--err); background: #fff;
  border: 1px solid var(--err); border-radius: var(--radius-sm); cursor: pointer;
}
.forceclose__btn:hover { background: var(--err-bg); }
.forceclose__note { margin: 6px 0 0; font-size: 11px; color: var(--muted); }

/* ── c9_32 · the follow-up chain ─────────────────────────────────────── */
/* The card that used to hold "✓ Ndjekja u krye" now holds a link to the
   successor activity. Styled as navigation, never as a button — the whole
   bug was a destructive action dressed as the obvious next tap. */
.fu-link {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 10px;
  align-items: center; text-decoration: none; color: inherit;
  padding: 11px 12px; margin-top: 4px;
  background: #fff; border: 1px solid var(--gold); border-radius: var(--radius);
}
.fu-link:hover { background: var(--gold-soft); }
.fu-link__lbl {
  grid-column: 1; font-size: 10.5px; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; color: var(--gold);
}
.fu-link__title { grid-column: 1; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.fu-link__meta  { grid-column: 1; font-size: 12px; color: var(--muted); }
.fu-link__go    { grid-column: 2; grid-row: 1 / span 3; font-size: 20px; color: var(--gold); }
.res-followup-open--done { border-color: var(--ok); }
.res-followup-open--done .fu-link { border-color: var(--ok); }
.res-followup-open--done .fu-link__lbl,
.res-followup-open--done .fu-link__go { color: var(--ok); }

.fu-back { color: var(--gold); text-decoration: none; font-weight: 600; }
.fu-back:hover { text-decoration: underline; }

/* "Ndjekje" marker on list and report rows */
.tag--followup { background: var(--gold-soft); color: var(--gold); border: 1px solid var(--gold); }

/* =====================================================================
   Kategoritë — the "what is being achieved" axis (c9_35)
   Mobile-first: this is read on a phone every morning. The desktop gets
   the same component on a wider column rather than a different layout.
   ===================================================================== */

.cat-axis { display: flex; gap: 8px; margin: 0 0 14px; }
.cat-axis__tab {
  flex: 1; text-align: center; padding: 9px 10px; border-radius: 20px;
  border: 1px solid var(--border); background: var(--card-bg);
  color: var(--muted); font-size: 13px; font-weight: 500; text-decoration: none;
  min-height: var(--touch); display: flex; align-items: center; justify-content: center;
}
.cat-axis__tab--on {
  background: var(--brand-red); border-color: var(--brand-red);
  color: #fff; font-weight: 600;
}

.cat-strip {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--border-soft); border: 1px solid var(--border-soft);
  border-radius: var(--radius); overflow: hidden; margin-bottom: 14px;
}
.cat-strip > div { background: var(--card-bg); padding: 10px 4px; text-align: center; }
.cat-strip__n {
  display: block; font-family: var(--mono); font-weight: 600; font-size: 17px;
  font-variant-numeric: tabular-nums; color: var(--ink);
}
.cat-strip__k {
  display: block; font-size: 10px; color: var(--muted-soft);
  text-transform: uppercase; letter-spacing: .05em; margin-top: 2px;
}

.cat-note {
  background: var(--warn-bg); border: 1px solid var(--gold);
  border-radius: var(--radius); padding: 10px 12px; margin: 0 0 14px;
  font-size: 12.5px; line-height: 1.55; color: var(--ink-soft);
}
.cat-empty, .cat-hint { font-size: 12.5px; color: var(--muted); text-align: center; padding: 14px 0 0; margin: 0; }
.cat-empty { padding: 26px 0; }

.cat-tree { border-top: 1px solid var(--border-soft); }
.cat-node { border-bottom: 1px solid var(--border-soft); }
.cat-node > summary::-webkit-details-marker { display: none; }
.cat-node > summary { list-style: none; cursor: pointer; }

.cat-row {
  display: grid; grid-template-columns: 1fr auto; gap: 3px 10px;
  align-items: center; padding: 11px 2px; min-height: var(--touch);
}
.cat-row:focus-visible { outline: 2px solid var(--brand-red); outline-offset: -2px; border-radius: var(--radius-sm); }
.cat-row__label { display: flex; align-items: center; gap: 7px; min-width: 0; }
.cat-row__tw {
  color: var(--muted-soft); font-size: 12px; flex: none; width: 9px;
  transition: transform .18s ease; display: inline-block;
}
details[open] > .cat-row .cat-row__tw { transform: rotate(90deg); }
.cat-row__name {
  font-size: 14px; font-weight: 500; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cat-row__figs { display: flex; align-items: center; gap: 8px; flex: none; }
.cat-row__n {
  font-family: var(--mono); font-weight: 600; font-size: 14px;
  font-variant-numeric: tabular-nums; color: var(--ink);
}
/* Capped, not full-bleed. On a wide column the largest sibling's bar spans
   the whole card and reads as a heading rule rather than a quantity — the
   softer fill helped on a phone but not on desktop. A bar has to be short
   enough to be seen as a measurement. */
.cat-row__bar {
  grid-column: 1 / -1; height: 3px; background: var(--border);
  border-radius: 2px; overflow: hidden; max-width: 260px;
}
/* Translucent, not solid brand red. At full width — which the largest
   sibling always is — a solid red bar reads as a heading rule rather than a
   quantity, and it competes with the GPS warnings for the only loud colour
   on the page. Proportion is the job here, not emphasis. */
.cat-row__bar i { display: block; height: 100%; background: rgba(230, 30, 42, .38); border-radius: 2px; }
.cat-row__sub { grid-column: 1 / -1; font-size: 11px; color: var(--muted-soft); }
.cat-fu  { color: var(--gold); font-weight: 600; }
.cat-gps { color: var(--brand-red); font-weight: 600; }

/* Success chip. --thin and --none are deliberately quiet: they report
   absence of data, and must not read as a bad score. */
.cat-chip {
  font-family: var(--mono); font-size: 11px; font-weight: 600;
  padding: 2px 7px; border-radius: 10px; min-width: 42px; text-align: center;
  font-variant-numeric: tabular-nums;
}
.cat-chip--hi   { background: var(--ok-bg);   color: var(--ok); }
.cat-chip--mid  { background: var(--warn-bg); color: var(--warn); }
.cat-chip--lo   { background: var(--err-bg);  color: var(--err); }
.cat-chip--thin { background: var(--bg); color: var(--muted); border: 1px solid var(--border); }
.cat-chip--none { background: var(--bg); color: var(--muted-soft); border: 1px solid var(--border-soft); }

.cat-kids { padding-left: 14px; border-left: 2px solid var(--border-soft); margin-left: 5px; }
.cat-kids .cat-node { border-bottom: 0; border-top: 1px solid var(--border-soft); }
.cat-kids .cat-row__name { font-size: 13px; }
.cat-kids .cat-row__n { font-size: 13px; }
.cat-kids .cat-kids .cat-row__name { font-size: 12.5px; color: var(--ink-soft); }

@media (min-width: 760px) {
  .cat-strip__n { font-size: 20px; }
  .cat-row__name { font-size: 15px; }
}

/* Two-axis navigation on the team roster (c9_35).
   These were three caption-sized links inside a <p> subtitle, which is why
   nobody found them. Grouped by the question they answer and sized as real
   navigation. */
.rep-axis { display: flex; flex-wrap: wrap; gap: 10px 18px; margin: 4px 0 14px; }
.rep-axis__group { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.rep-axis__lab {
  font-size: 10px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--muted-soft); font-weight: 600; margin-right: 2px;
}
.rep-axis__link {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 12px; border-radius: 20px; border: 1px solid var(--border);
  background: var(--card-bg); color: var(--ink-soft);
  font-size: 12.5px; font-weight: 500; text-decoration: none;
}
.rep-axis__link:hover { border-color: var(--brand-red); color: var(--brand-red); }
.rep-axis__link--new { border-color: var(--brand-red); color: var(--brand-red); font-weight: 600; }
@media (max-width: 560px) {
  .rep-axis { flex-direction: column; gap: 8px; }
  .rep-axis__link { min-height: 38px; }
}

/* =====================================================================
   Lista — day separators, actual-time-first, category path (c9_36)
   ===================================================================== */

/* The actual start is now the big number. Same size and weight the planned
   time used to have, so nothing about the row's rhythm changes — only which
   fact occupies the position the eye lands on first. */
.task-row__actual-main {
  display: block; font-weight: 700; font-size: 15px; color: var(--ink);
  font-variant-numeric: tabular-nums; line-height: 1.25;
}
/* An activity that never ran has no actual time, so the planned one leads.
   Muted, so a glance down the column still separates what happened from what
   was only intended. */
.task-row__actual-main--plan { color: var(--muted); font-weight: 600; }
.task-row__actual-end {
  display: block; font-weight: 500; font-size: 12px; color: var(--muted);
  font-variant-numeric: tabular-nums; line-height: 1.2;
}
.task-row__plan-ref {
  display: block; font-size: 10.5px; color: var(--muted-soft);
  font-variant-numeric: tabular-nums; margin-top: 2px; white-space: nowrap;
}

/* Category path. Gold, matching how the path already reads on the activity
   detail page, so the same fact looks the same in both places. */
.task-row__cat {
  font-size: 12px; color: var(--gold); font-weight: 500; margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Count of activities in a day group. */
.week-day__n {
  display: inline-block; margin-left: 7px; padding: 1px 7px;
  border-radius: 10px; background: var(--bg); color: var(--muted);
  font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums;
}

.task-row__time { min-width: 58px; }

/* Cut toggle on the outcome axis (c9_37) — by category, or by person. */
.cat-cut { display: flex; gap: 0; margin: 0 0 12px; border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; }
.cat-cut__seg {
  flex: 1; text-align: center; padding: 9px 8px; font-size: 12.5px; font-weight: 500;
  color: var(--muted); background: var(--card-bg); text-decoration: none;
  min-height: var(--touch); display: flex; align-items: center; justify-content: center;
}
.cat-cut__seg + .cat-cut__seg { border-left: 1px solid var(--border); }
.cat-cut__seg--on { background: var(--ink); color: var(--card-bg); font-weight: 600; }

/* A person row is the same object as a category row, so it keeps the same
   grid, bar and chip — only the leading mark differs. */
.cat-row--person { text-decoration: none; color: inherit; }
.cat-row--person:hover .cat-row__name { color: var(--brand-red); }
.cat-person__av {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  background: var(--bg); border: 1px solid var(--border);
  display: grid; place-items: center;
  font-size: 10px; font-weight: 700; color: var(--muted); letter-spacing: .02em;
}
.cat-row__go { color: var(--muted-soft); font-size: 15px; line-height: 1; flex: none; margin-left: 2px; }
.cat-row--person:hover .cat-row__go { color: var(--brand-red); }

/* Map, joined to the family of views (c9_38) */
.rep-chip--map { border-color: var(--gold); }
.rep-chip--map.rep-chip--on { background: var(--gold); border-color: var(--gold); color: #fff; }

/* The day heading is the way into that day's map. Quiet until wanted —
   it sits on every day group, so it must not compete with the date itself. */
.week-day__head { display: flex; align-items: baseline; gap: 8px; }
.week-day__map {
  margin-left: auto; font-size: 11px; text-decoration: none;
  color: var(--muted-soft); white-space: nowrap;
  padding: 3px 8px; border-radius: 12px; border: 1px solid transparent;
}
.week-day__map:hover { color: var(--brand-red); border-color: var(--border); }
@media (max-width: 560px) { .week-day__map { padding: 5px 8px; } }

/* Team view switcher (c9_39) — same chips as the person pages, team scope. */
.team-nav { margin: 8px 0 12px; }
.rep-secondary { font-size: 12px; color: var(--muted-soft); margin: 0 0 10px; }
.rep-secondary .lv-link { color: var(--muted); }
.rep-secondary .lv-link:hover { color: var(--brand-red); }

/* =====================================================================
   Reporting row — mobile legibility (c9_40)
   =====================================================================
   THE PROBLEM. The row is three inline columns: time | body | status,
   and the status column is `flex-shrink: 0` because a pill must never be
   cut in half. On a 360 px phone the result pill and the status badge
   together hold ~150 px, the time column 58 px, the chevron and gaps
   ~40 px — which leaves the body about 130 px. Everything the reader
   actually came for lives in that 130 px, so "Aktivitete Individuale RM -
   Virtual Office" wrapped across four lines and every client name
   truncated to "Jetnor Gj…". The row was wide; the content was not.

   THE FIX. Below 560 px the row becomes a grid and the pills drop to
   their own line under the body. Time and chevron span both rows, so the
   row still reads as one object and the chevron still sits where the
   thumb expects it. The body goes from ~130 px to ~265 px — roughly
   double — which is the difference between a name being readable and
   being a hint.

   Why not shrink the pills instead: they are already at 11 px. The space
   was not being wasted, it was being spent on the wrong axis. Stacking
   costs one line of height per row and buys back every character.
   ===================================================================== */

@media (max-width: 560px) {

  /* 28 px of the row's width was horizontal padding. On a 360 px phone that
     is a tenth of the screen spent on air next to text that is being
     ellipsed — the card still reads as a card at 11 px. */
  .task-list .task-row-wrap { padding: 10px 11px; }

  .task-row--det {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "time body chev"
      "time meta chev";
    align-items: start;
    column-gap: 10px;
    row-gap: 3px;
  }
  .task-row__time   { grid-area: time; }
  .task-row__body   { grid-area: body; }
  .task-row__status { grid-area: meta; text-align: left; padding-top: 1px; }
  .task-det__chev   { grid-area: chev; align-self: center; }

  /* The pills now share a line rather than a corner, so they need to wrap
     as a group instead of overflowing the grid column. */
  .task-row__status {
    display: flex; flex-wrap: wrap; align-items: center; gap: 5px;
  }

  /* The title may wrap; it must not be clipped. Two lines is the practical
     ceiling for the longest category names in use ("Aktivitete Individuale
     RM - Virtual Office"), and the full label is always one tap away in the
     expanded panel. */
  .task-row__type {
    font-size: 14.5px;
    line-height: 1.3;
    gap: 5px;
  }

  /* Category path and client name: two lines each instead of one line with
     an ellipsis. A truncated client name identifies nobody, and these are
     the two fields a manager scans a week for. */
  .task-row__cat,
  .task-row__meta {
    white-space: normal;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    line-height: 1.3;
  }
  .task-row__meta { font-size: 12.5px; }

  /* The time column holds "plan. 08:58" at its widest. Fixing the width
     rather than letting it size to content keeps every row's body starting
     at the same x — a ragged left edge is what made the old list feel
     unreadable even where the text fitted. */
  .task-row__time { min-width: 56px; }
  .task-row__plan-ref { font-size: 10px; }
}

/* Tags sit on the title line and are uppercase, so at 10 px with letter
   spacing "E PAPLANIFIKUAR" is 105 px of a 265 px line. Sentence case at the
   same size reads as a qualifier rather than a second heading, and gives the
   title back about a third of that width. Applied at every width: the tag
   was never meant to outweigh the activity it qualifies. */
.task-row__type .tag {
  text-transform: none;
  letter-spacing: 0;
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}

/* =====================================================================
   Raporte hub — today's pulse, and the roster as cards on a phone (c9_42)
   =====================================================================
   /portal/reporting is where a manager lands, and until now it rendered the
   same eleven-column table at every width. On the phone the CEO actually
   reads it on, that is a horizontal scroll opening on rows of zeros.

   Three additions, all display-only — no number is computed differently:
     1. a Sot strip, from the bar-chart series already loaded;
     2. a note stating how many idle rows are hidden, with the way back;
     3. the same roster as cards below 720px, the table above it.
   ===================================================================== */

/* ---- Today's pulse -------------------------------------------------- */
.rep-today {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px;
  margin: 0 0 12px; padding: 10px 14px;
  background: var(--card-bg); border: 1px solid var(--border);
  border-left: 3px solid var(--brand-red);
  border-radius: var(--radius);
}
.rep-today__lab {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--muted-soft); margin-right: 2px;
}
.rep-today__n {
  font-size: 19px; font-weight: 700; color: var(--ink);
  font-variant-numeric: tabular-nums; line-height: 1;
}
.rep-today__unit { font-size: 12.5px; color: var(--muted); }
.rep-today__sep  { color: var(--border); margin: 0 2px; }

/* ---- "N hidden" note ------------------------------------------------ */
.rep-hidden-note {
  font-size: 12px; color: var(--muted-soft); margin: 0 0 12px;
}

/* ---- Roster cards ---------------------------------------------------
   Hidden by default: the table is the canonical rendering and stays the
   one that loads on desktop. The card list takes over only where the
   table cannot fit. */
.roster-cards { display: none; }

@media (max-width: 720px) {
  .roster-cards { display: flex; flex-direction: column; gap: 8px; list-style: none;
                  margin: 0; padding: 0; }
  /* Scoped to the roster's own wrapper: .matrix-wrap is also the access and
     external-apps tables, which still need to scroll rather than vanish. */
  .matrix-wrap--roster { display: none; }

  .roster-card {
    background: var(--card-bg); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden;
  }
  /* The whole card is the link to the person; the Aktivitetet link sits
     outside it rather than nested, because an <a> inside an <a> is invalid
     and browsers resolve it by dropping one of them. */
  .roster-card__hit {
    display: block; padding: 11px 12px 9px; text-decoration: none; color: inherit;
  }
  .roster-card__hit:active { background: var(--bg); }

  .roster-card__top {
    display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  }
  .roster-card__name {
    font-size: 14.5px; font-weight: 600; color: var(--ink);
    min-width: 0; overflow-wrap: anywhere;
  }

  .roster-card__stats {
    display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px;
  }
  .rc-stat { font-size: 12px; color: var(--muted); white-space: nowrap; }
  .rc-stat strong {
    font-size: 13.5px; font-weight: 700; color: var(--ink);
    font-variant-numeric: tabular-nums;
  }
  .rc-stat .pctcell { font-size: 12px; }

  .roster-card__spark { margin-top: 7px; line-height: 0; }

  .roster-card__acts {
    display: flex; align-items: center;
    padding: 8px 12px; border-top: 1px solid var(--border-soft);
    font-size: 12.5px; font-weight: 600; color: var(--brand-red);
    text-decoration: none; min-height: var(--touch);
  }
  .roster-card__acts:active { background: var(--bg); }

  /* The page heading block stacks; the month arrows should not sit beside a
     wrapped title fighting it for the line. */
  .rep-head { display: block; }
  .rep-head .rep-monthnav { margin-top: 10px; }
}

/* =====================================================================
   Embed mode — the portal inside the My Kraco tab shell (c9_43)
   =====================================================================
   Set by ?embed=1 server-side, or by the inline <head> script whenever the
   page is in a frame. See the long note at the top of layouts/portal.php for
   why it is both and not a session flag.

   display:none rather than visibility or an offscreen trick: the hidden
   navigation must also leave the tab order and the accessibility tree. A
   screen-reader user inside the tab should not walk into a second, invisible
   copy of the app's menu.
   ===================================================================== */

.is-embed .portal-topbar,
.is-embed .portal-sidebar { display: none; }

/* The shell's min-height subtracts the 56px topbar that is no longer there,
   and the outer tab already supplies the page's own scroll frame. */
.is-embed .portal-shell { min-height: 0; }

/* Without the sidebar the content is the whole width. The desktop max-width
   stays — a roster table stretched across a 1400px monitor is not easier to
   read for being wider — but the top padding comes down, because the tab
   shell's own title bar is directly above it and two stacked gutters read as
   a gap rather than as breathing room. */
.is-embed .portal-content { padding-top: 12px; }

@media (max-width: 720px) {
  .is-embed .portal-content { padding: 10px 12px 18px; }
}

/* =====================================================================
   Embedded tab + ongoing-activity bar (c9_44)
   =====================================================================
   .embed is position:fixed at top:56px (under the topbar) with z-index 1.
   .ongoing-bar is position:sticky at the SAME 56px with z-index 20. Both
   claim the same forty pixels, and the red bar wins — burying the embedded
   tab's own "‹ Modulet / Hap në skedë të re" strip. The links stay in the
   DOM and even stay clickable by script, but nobody can see or reach them,
   so an RM with an activity open is stuck inside the tab.

   The fix is to start the fixed layer below the bar instead of under it.
   That needs the bar's height as a number, so the height is DECLARED rather
   than measured: .ongoing-bar is pinned to --ongoing-h with border-box, which
   is the height it already computes to (11px padding, one 14px line, 11px
   padding = 43px). Its label is nowrap + ellipsis and cannot reflow, so a
   fixed height clips nothing — it just makes the offset below true by
   construction rather than by hoping the two stay in step.
   ===================================================================== */

/* c9_48 — generalised. Two banners can now sit under the header, so the
   layers below them offset by a SUM rather than by a rule per combination.
   Each banner contributes its height only while its body class is present,
   so the same calc() is correct with none, either or both. */
:root {
  --ongoing-h: 43px;   /* the bar's own height */
  --imp-h:     40px;
  --stack-ongoing: 0px;  /* what it contributes to the stack */
  --stack-imp:     0px;
}
.has-ongoing { --stack-ongoing: var(--ongoing-h); }
.has-imp     { --stack-imp:     var(--imp-h); }

.ongoing-bar { height: var(--ongoing-h); box-sizing: border-box; }
/* The impersonation bar is above it, so the ongoing bar starts below that. */
.ongoing-bar { top: calc(var(--topbar-h) + env(safe-area-inset-top, 0px) + var(--stack-imp)); }

.embed {
  top: calc(var(--topbar-h) + env(safe-area-inset-top, 0px)
            + var(--stack-imp) + var(--stack-ongoing));
}

/* =====================================================================
   Roster cards — tighter (c9_45)
   =====================================================================
   The c9_42 cards were ~187px each, so a phone showed three of twelve
   people. Most of that height was not information:

     44px  "Aktivitetet ›" on a full-width row of its own
     19px  a second stats line, because four stats never fit on one
      6px  chart taller than it needs to be
      3px  padding

   None of it is deleted — the link and the numbers are all still there,
   just not each claiming its own band. 187px becomes 111px, the same for
   every card whether or not it shows "përfunduar", so six people fit where
   three did — which is what turns the roster from a scroll into a glance.
   ===================================================================== */

@media (max-width: 720px) {

  .roster-card { position: relative; }          /* anchors the acts link */

  .roster-card__hit { padding: 9px 12px 8px; }

  /* One stats line now that "përfunduar" only appears when it differs.
     Slightly tighter tracking so the three remaining stats clear 310px. */
  .roster-card__stats { gap: 3px 9px; margin-top: 5px; }
  .rc-stat            { font-size: 11.5px; }
  .rc-stat strong     { font-size: 13px; }
  .rc-stat .pctcell   { font-size: 11.5px; min-width: 38px; padding: 1px 6px; }

  /* The hours carry no label on a phone: "54h 46min" sitting between an
     activity count and an occupancy percentage cannot be read as anything
     but time worked, and the word "punë" was costing a wrap on every card
     that also had to show "përfunduar". The desktop table still says Orë. */
  .rc-stat--hrs strong { font-size: 13px; }

  /* The exception, when it appears, should read as one. */
  .rc-stat--warn strong { color: var(--brand-red); }

  .roster-card__spark { margin-top: 5px; }

  /* Bottom-right, over the empty half of the chart row. Height comes from
     the chart beside it (~39px), which is a smaller target than the 44px
     rule wants — acceptable only because the whole card is itself a much
     larger target for the person page, and this is the secondary of the
     two destinations. */
  .roster-card__acts {
    position: absolute; right: 8px; bottom: 6px;
    padding: 8px 6px; min-height: 0;
    border-top: 0; background: none;
    font-size: 12.5px; font-weight: 600; color: var(--brand-red);
    text-decoration: none; white-space: nowrap;
  }
  .roster-card__acts:active { color: var(--ink); }
}

/* =====================================================================
   Kategoritë — visual pass (c9_46)
   =====================================================================
   The page was readable but it was built of loose stripes: a name line, a
   short floating bar, a faint sub-line, then a divider — four horizontal
   marks per row, none of them aligned to the others, repeated fifteen
   times down a phone screen. Nothing here changes a number; it changes
   how many separate things the eye has to resolve per row.
   ===================================================================== */

/* --- The proportion bar IS the divider now --------------------------
   It used to be a 260px stub sitting between the name and the sub-line,
   which is why every row read as three bands. Moved last in the DOM and
   stretched to the full row, it costs no height at all: the grey track is
   the line that was already separating rows, and the red fill is the
   share. A quantity you can compare down a column, out of a mark that was
   being drawn anyway. */
.cat-node { border-bottom: 0; }
.cat-row  { padding: 10px 2px 0; gap: 3px 10px; }
.cat-row__bar {
  grid-column: 1 / -1; max-width: none;
  height: 3px; margin-top: 7px;
  background: var(--border-soft); border-radius: 0;
}
.cat-row__bar i { border-radius: 0 2px 2px 0; }
.cat-kids .cat-row__bar { height: 2px; }

/* --- Sub-line: readable rather than merely present ------------------ */
.cat-row__sub { font-size: 11.5px; color: var(--muted); }

/* --- Twisty --------------------------------------------------------- */
.cat-row__tw { width: 11px; font-size: 13px; text-align: center; }
.cat-row__tw--leaf { visibility: hidden; }
details[open] > .cat-row .cat-row__name { color: var(--brand-red); }

/* --- "no result" marker: a dash, not an empty pill ------------------ */
.cat-chip--none {
  background: none; border: 0; color: var(--muted-soft);
  font-size: 14px; letter-spacing: .05em;
}

/* --- KPI strip ------------------------------------------------------ */
.cat-strip > div   { padding: 12px 3px; }
.cat-strip__n      { font-size: 21px; line-height: 1.1; }
/* "ME REZULTAT" wrapped to two lines and made its tile taller than the
   other three. Tighter tracking keeps every label on one line at 357px. */
.cat-strip__k      { font-size: 9.5px; letter-spacing: .03em; white-space: nowrap; }
/* A zero is a fact, not a headline. Left at full weight it drew the eye
   first on a strip where 81 and 69% are the numbers that matter. */
.cat-strip__n--zero { color: var(--muted-soft); font-weight: 500; }

/* --- Coverage caveat, collapsed ------------------------------------- */
.cat-note { padding: 0; margin: 0 0 14px; }
/* Block, not flex. As a flex row the "pse?" link took margin-left:auto and
   broke the sentence across two lines on a phone — "Vetëm 16%" stranded
   above the rest of its own clause. One flowing line with a hanging icon
   reads as the sentence it is, and the link simply ends it. */
.cat-note__sum {
  display: block; position: relative;
  padding: 9px 12px 9px 34px; cursor: pointer; list-style: none;
  font-size: 12.5px; line-height: 1.45; color: var(--ink-soft);
}
.cat-note__sum::-webkit-details-marker { display: none; }
.cat-note__ico {
  position: absolute; left: 12px; top: 10px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--gold); color: #fff;
  font-size: 11px; font-weight: 700; line-height: 16px; text-align: center;
}
.cat-note__more {
  margin-left: 6px; color: var(--gold); font-weight: 600;
  text-decoration: underline; white-space: nowrap;
}
.cat-note[open] .cat-note__more { text-decoration: none; opacity: .5; }
.cat-note__body {
  margin: 0; padding: 0 12px 11px 34px;
  font-size: 12.5px; line-height: 1.55; color: var(--ink-soft);
}

/* Children separated by their own bar as well — the inherited border-top
   would sit 2px above it and draw the same boundary twice. */
.cat-kids .cat-node { border-top: 0; }

/* =====================================================================
   Kategoritë — the bar tells the outcome story (c9_47)
   =====================================================================
   c9_46 made the bar the row's divider, which fixed the loose-stripes
   problem but exposed an older one: the length was a share of the biggest
   SIBLING, so every group's leader drew a full-width mark regardless of
   size. On the team page "Vizitë klienti" (300), "Listime të reja" (118)
   and "Alkoole" (85) all rendered identically at 100%.

   Two changes, both in the markup as well as here:
     LENGTH is now the share of the PARENT — 100% only when the node really
     is all of its parent, so the bars compare.
     COLOUR is the outcome mix: success / fail / continues / no result.

   The bar is 6px rather than 3px because four segments need to be told
   apart; it is still the divider, so the extra pixels cost no layout.
   ===================================================================== */

.cat-row__bar {
  height: 6px;
  background: var(--border-soft);
  display: flex;                   /* the fill is a child now, not ::before */
}
.cat-bar__fill { display: flex; height: 100%; min-width: 2px; }

/* Scoped under .cat-row__bar on purpose. The c9_35 rule `.cat-row__bar i`
   sets a translucent red on ANY <i> in the bar, and at (0,1,1) it outranks a
   bare `.cat-seg--ok` (0,1,0) however far down the file it sits — the first
   build of this came out uniformly pink for exactly that reason. Matching
   its specificity is the fix; deleting it would strand the old single-fill
   markup if any page still renders it. */
.cat-seg { display: block; height: 100%; }
.cat-row__bar .cat-seg--ok   { background: #2E7D32; }          /* sukses */
.cat-row__bar .cat-seg--bad  { background: var(--brand-red); } /* pa sukses */
.cat-row__bar .cat-seg--cont { background: var(--gold); }      /* vijon */
/* No result recorded. Deliberately a grey, not a colour: it is an absence
   of information, and must never read as a bad score. It is also the
   majority of the data today, so a loud colour here would drown the page. */
.cat-row__bar .cat-seg--none { background: #c8ccd2; }
/* The fill's own children carry the colour; the wrapper must not repeat the
   old translucent red underneath them. */
.cat-row__bar .cat-bar__fill { background: none; border-radius: 0; }

.cat-kids .cat-row__bar { height: 4px; }

/* ---- Legend --------------------------------------------------------- */
.cat-legend {
  display: flex; flex-wrap: wrap; gap: 4px 12px;
  margin: 0 0 6px; font-size: 11px; color: var(--muted);
}
.cat-legend__i { display: inline-flex; align-items: center; gap: 5px; }
.cat-legend__i .cat-seg {
  width: 14px; height: 6px; border-radius: 1px; flex: none;
}
.cat-legend .cat-seg--ok   { background: #2E7D32; }
.cat-legend .cat-seg--bad  { background: var(--brand-red); }
.cat-legend .cat-seg--cont { background: var(--gold); }
.cat-legend .cat-seg--none { background: #c8ccd2; }
.cat-legend__len { color: var(--muted-soft); font-style: italic; }


/* =====================================================================
   Impersonation bar — "Po shikon si …" (c9_48)
   =====================================================================
   Writes are allowed while impersonating, so the single most important
   thing this feature does visually is make it impossible to forget whose
   identity is holding the keyboard. Sticky directly under the header, on
   every screen, in all three layouts, with the way out inside it.

   Deliberately NOT brand red. Red in this app already means "activity in
   progress" and "GPS anomaly"; a third red band would dilute all three.
   Near-black with an amber rule reads as a system state rather than an
   alert, and cannot be confused with the ongoing-activity bar sitting
   directly beneath it.
   ===================================================================== */
.imp-bar {
  position: sticky;
  top: calc(var(--topbar-h) + env(safe-area-inset-top, 0px));
  z-index: 30;                    /* above .ongoing-bar (20) and .embed (1) */
  height: var(--imp-h);
  box-sizing: border-box;
  display: flex; align-items: center; gap: 9px;
  padding: 0 12px;
  background: #24262b;
  color: #fff;
  border-bottom: 2px solid var(--gold);
  font-size: 13px;
}
.imp-bar__eye  { flex: none; font-size: 14px; opacity: .85; }
.imp-bar__txt  {
  flex: 1 1 auto; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.imp-bar__txt strong { font-weight: 700; }
.imp-bar__role {
  font-size: 10px; text-transform: uppercase; letter-spacing: .05em;
  opacity: .6; margin-left: 4px;
}
.imp-bar__form { flex: none; margin: 0; }
.imp-bar__stop {
  font: inherit; font-weight: 700; cursor: pointer;
  background: var(--gold); color: #24262b; border: 0;
  border-radius: 14px; padding: 5px 12px; white-space: nowrap;
}
.imp-bar__stop:hover { background: #c9a04a; }

/* The portal layout hides its own chrome in embed mode — but never this.
   An identity warning that disappears inside an iframe is the one place it
   would matter most, since the tab shell gives no clue either. */
.is-embed .imp-bar { display: flex; }

/* Entry point on a person's report. */
.imp-start { display: inline; margin: 0; }
.imp-start__btn {
  font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer;
  background: none; border: 1px solid var(--border); border-radius: 14px;
  padding: 5px 11px; color: var(--ink-soft);
}
.imp-start__btn:hover { border-color: var(--gold); color: var(--gold); }

/* =====================================================================
   "Shiko si …" — the user picker (c9_48b)
   ===================================================================== */
.imp-page { padding-bottom: 28px; }

.imp-search { display: flex; gap: 8px; margin: 0 0 14px; }
.imp-search__input {
  flex: 1 1 auto; min-width: 0;
  font: inherit; font-size: 15px;      /* 15px+ or iOS zooms the page on focus */
  padding: 10px 12px; min-height: var(--touch);
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--card-bg); color: var(--ink);
}
.imp-search__input:focus { outline: 2px solid var(--brand-red); outline-offset: 1px; }
.imp-search__btn { flex: none; min-height: var(--touch); }

.imp-count { font-size: 12px; color: var(--muted); margin: 0 0 8px; }

.imp-list { list-style: none; margin: 0; padding: 0;
            display: flex; flex-direction: column; gap: 6px; }
.imp-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 9px 11px;
}
.imp-row__who  { flex: 1 1 auto; min-width: 0; }
.imp-row__name {
  display: block; font-size: 14.5px; font-weight: 600; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.imp-row__meta {
  display: block; font-size: 11.5px; color: var(--muted); margin-top: 1px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.imp-row__form { flex: none; margin: 0; }
.imp-row__btn {
  font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer;
  background: var(--card-bg); color: var(--ink-soft);
  border: 1px solid var(--border); border-radius: 16px;
  padding: 8px 12px; min-height: 36px; white-space: nowrap;
}
.imp-row__btn:hover  { border-color: var(--gold); color: var(--gold); }
.imp-row__btn:active { background: var(--bg); }

.imp-note {
  font-size: 11.5px; color: var(--muted-soft); line-height: 1.5; margin: 8px 0 0;
}
.imp-note--foot { margin-top: 16px; text-align: center; }

/* The impersonation notice on the layout-less error pages (c9_48b). */
.error-card__imp {
  margin: 14px 0 10px; padding: 9px 12px;
  background: #24262b; color: #fff; border-radius: var(--radius-sm);
  font-size: 12.5px; line-height: 1.45;
}

/* ---------------------------------------------------------------------
   Client names (c9_50) — the registered subject beside the trade name
   ---------------------------------------------------------------------
   Two names for one shop. The trade name is the label; the subject name
   is provenance — needed to tie a stop back to Contracts, but never the
   thing being read. So it is quieter in every context and it is dropped
   entirely when it would only repeat the line above it.
   ------------------------------------------------------------------- */
.cli-alt {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.35;
  word-break: break-word;
}
.cli-alt__k {
  text-transform: uppercase;
  letter-spacing: .04em;
  font-size: 10.5px;
  opacity: .75;
  margin-right: 3px;
}
/* Inside a one-line list row: same line, dimmer, and free to be clipped by
   the row's own ellipsis — the trade name must never lose characters to
   make room for a name that is only there for cross-referencing. */
.cli-alt--inline {
  display: inline;
  margin-top: 0;
  font-size: inherit;
  opacity: .62;
}
.cli-alt--inline::before { content: ' · '; opacity: .8; }

/* ---------------------------------------------------------------------
   Change password (c9_54)
   ---------------------------------------------------------------------
   `.card` carries no padding of its own — every child brings its own, the
   way .card__head and .kv do. Without this the labels sit flush against
   the card's border while the inputs span the full width, which reads as
   a broken page rather than a tight one.
   ------------------------------------------------------------------- */
.pwd-lead {
  margin: 0;
  padding: 12px 16px 0;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--muted);
}
.pwd-form { padding: 14px 16px 18px; }
.pwd-form .field { margin-bottom: 14px; }
.pwd-form .action-row { margin-top: 18px; }

/* ---------------------------------------------------------------------
   iOS "add to home screen" hint (c9_56)
   ---------------------------------------------------------------------
   Sits in the page flow, not fixed: it must never cover the app the way a
   floating banner would, and it disappears for good on the first dismiss.
   Gold rather than brand red — this is a suggestion, and red in this app
   already means "attention required".
   ------------------------------------------------------------------- */
/* `display:flex` on an author rule BEATS the browser's own
   `[hidden] { display:none }`, so without this line the banner shows for
   everyone on every platform — Android, desktop, and after dismissal —
   which is precisely the opposite of a one-time iOS hint. Caught by the
   render test, not by reading the code. */
.a2hs[hidden] { display: none !important; }
.a2hs {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 10px 12px 0;
  padding: 11px 12px;
  background: #fdf6e7;
  border: 1px solid rgba(176, 139, 60, .35);
  border-radius: var(--radius-sm);
  color: #6b5320;
}
.a2hs__icon { flex: 0 0 auto; color: var(--gold); margin-top: 1px; }
.a2hs__txt { flex: 1 1 auto; font-size: 13px; line-height: 1.45; }
.a2hs__txt strong { display: block; font-size: 13.5px; color: #5a4518; margin-bottom: 1px; }
.a2hs__txt b { font-weight: 600; }
.a2hs__x {
  flex: 0 0 auto;
  background: none; border: 0; padding: 0 2px;
  font-size: 22px; line-height: 1;
  color: #a08a5c; cursor: pointer;
  min-width: 32px; min-height: 32px;
}
.a2hs__x:active { opacity: .6; }

/* ═══════════════════════════════════════════════════════════════════════
   MiniMap + GPS confirmation (c9_58)

   The map is tiles positioned absolutely by assets/js/minimap.js — no map
   library, because this renders at check-in time on a field phone and a CDN
   that is slow or unreachable would leave a grey box exactly when the map is
   the point. `overflow:hidden` on the box is what crops the tile grid.

   .minimap__fallback sits underneath the tiles and shows through only when
   minimap.js marks the box --noTiles, so a map that cannot load degrades to a
   readable line instead of an empty rectangle.
   ═══════════════════════════════════════════════════════════════════════ */
.minimap {
  position: relative;
  overflow: hidden;
  background: #e8eaed;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.minimap--sheet  { height: 46vh; min-height: 220px; max-height: 360px; }
.minimap--inline { height: 190px; margin: 8px 0 6px; }

.minimap__tiles { position: absolute; inset: 0; }
.minimap__tile  { position: absolute; width: 256px; height: 256px; user-select: none; }

/* Only visible when the tiles failed — see minimap--noTiles below. */
.minimap__fallback {
  position: absolute; inset: 0;
  display: none;
  /* Top-aligned: the pins and the line between them are still drawn without
     tiles, and centred text would sit right on top of them. */
  align-items: flex-start; justify-content: center;
  padding: 10px 12px; text-align: center;
  font-size: 13px; color: var(--muted);
}
.minimap--noTiles .minimap__tiles { display: none; }
.minimap--noTiles .minimap__fallback { display: flex; }
/* No tiles drawn, so nothing to credit — and the badge would sit on an
   otherwise empty box looking like a failed element. */
.minimap--noTiles .minimap__osm { display: none; }

.minimap__link line { stroke: #d32f2f; stroke-width: 2; stroke-dasharray: 5 4; }
.minimap__link { position: absolute; inset: 0; pointer-events: none; }

.minimap__ring {
  position: absolute;
  border-radius: 50%;
  background: rgba(230, 30, 42, .13);
  border: 1px solid rgba(230, 30, 42, .45);
  pointer-events: none;
}
.minimap__pin {
  position: absolute;
  width: 16px; height: 16px;
  margin: -8px 0 0 -8px;              /* centre on the coordinate */
  border-radius: 50%;
  border: 2.5px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .45);
  pointer-events: none;
}
.minimap__pin--now   { background: var(--brand-red); }
.minimap__pin--try   { background: var(--brand-red); }
.minimap__pin--start { background: #1976d2; }

.minimap__zoom {
  position: absolute; top: 8px; right: 8px;
  display: flex; flex-direction: column; gap: 4px;
}
.minimap__zbtn {
  width: 34px; height: 34px;          /* touch target, not a desktop control */
  border: 1px solid var(--border); border-radius: 8px;
  background: rgba(255, 255, 255, .95);
  font-size: 19px; line-height: 1; color: var(--ink);
  cursor: pointer;
}
.minimap__zbtn:active { background: #eee; }

.minimap__osm {
  position: absolute; left: 0; bottom: 0;
  padding: 1px 6px;
  font-size: 10px; color: #555;
  background: rgba(255, 255, 255, .8);
  border-radius: 0 6px 0 0;
}

/* ---- the confirmation sheet ---------------------------------------- */
/* Shown only when the fix is suspect (see gps.js). Full-screen on purpose:
   the whole question is "look at this", and a small dialog over a form
   invites dismissal without looking. */
.sheet {
  position: fixed; inset: 0; z-index: 1200;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(0, 0, 0, .55);
}
.sheet[hidden] { display: none !important; }   /* beats the flex above */
body.is-sheetOpen { overflow: hidden; }

.sheet__panel {
  width: 100%; max-width: 560px;
  max-height: 94vh; overflow-y: auto;
  padding: 14px 16px calc(16px + env(safe-area-inset-bottom));
  background: var(--card-bg, #fff);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -6px 24px rgba(0, 0, 0, .3);
}
.sheet__head { display: flex; align-items: center; gap: 10px; }
.sheet__title { flex: 1; margin: 0; font-size: 18px; color: var(--ink); }
.sheet__x {
  background: none; border: 0; padding: 0;
  font-size: 26px; line-height: 1; color: var(--muted); cursor: pointer;
  min-width: 36px; min-height: 36px;
}
.sheet__why {
  margin: 8px 0 10px;
  padding: 8px 10px;
  font-size: 13.5px; color: #8a5a00;
  background: #fff6e0; border-left: 3px solid var(--gold);
  border-radius: 0 6px 6px 0;
}
.sheet__facts {
  margin: 8px 0 0;
  font-size: 12.5px; color: var(--muted);
  font-variant-numeric: tabular-nums;
  word-break: break-word;
}
.sheet__hint { margin: 8px 0 14px; font-size: 13px; color: var(--ink-soft); }
.sheet__actions { display: flex; flex-direction: column; gap: 8px; }
.sheet__actions .btn { width: 100%; }
/* Confirm sits BELOW "try again": the cheaper, more often correct action is
   the one the thumb reaches first. */
.sheet__actions .btn--go { order: 2; }
.sheet__actions .btn--ghost { order: 1; }

/* ---- the refused-close map on the activity page --------------------- */
.gps-refused {
  margin: 10px 0 12px;
  padding: 10px 12px;
  background: #fff5f5;
  border: 1px solid #f3c9c9;
  border-radius: 10px;
}
.gps-refused__lead { margin: 0 0 4px; font-size: 13.5px; color: var(--ink-soft); }
.gps-refused__key {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px;
  margin: 4px 0 6px; font-size: 12.5px; color: var(--muted);
}
.gps-refused__dot {
  display: inline-block; width: 10px; height: 10px;
  margin-right: 4px; border-radius: 50%; vertical-align: -1px;
}
.gps-refused__dot--start { background: #1976d2; }
.gps-refused__dot--try   { background: var(--brand-red); }
.gps-refused__hint { margin: 0; font-size: 13px; color: var(--ink-soft); }

/* ---- /gps-check diagnostic (c9_59) ---------------------------------- */
.gpsx-verdict {
  margin: 0 0 8px;
  padding: 9px 11px;
  font-size: 14px; font-weight: 600;
  border-radius: 8px;
  border-left: 3px solid transparent;
}
.gpsx-verdict--ok   { background: #eaf6ec; color: #1b5e20; border-left-color: #2e7d32; }
.gpsx-verdict--warn { background: #fff6e0; color: #8a5a00; border-left-color: var(--gold); }

.gpsx-list { margin: 6px 0 0; padding-left: 20px; }
.gpsx-row {
  padding: 3px 0;
  font-size: 12.5px; color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  word-break: break-word;
}
/* The reading the app would actually submit — the one that matters when
   reading a screenshot of this screen. */
.gpsx-row--held { color: var(--brand-red); font-weight: 600; }
.stat-more { margin: 8px 0 0; font-size: 13.5px; }
.stat-more a { color: var(--brand-red); text-decoration: none; font-weight: 600; }

/* ---- GPS progress bar (c9_60) ---------------------------------------
   The wait is ~10 s on a real handset and the status text only changed when
   a reading arrived — so it sat still for nine seconds beside a disabled
   button. gps.js now drives this from a 200 ms timer instead, so something
   moves whatever the device is doing. */
.gps-status__txt { display: block; }
.gps-status__bar {
  display: block;
  height: 4px;
  margin-top: 7px;
  border-radius: 2px;
  background: rgba(0, 0, 0, .10);
  overflow: hidden;
}
.gps-status__fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 2px;
  background: currentColor;          /* inherits the --busy / --warn colour */
  opacity: .75;
  transition: width .2s linear;      /* matches the ticker, so it glides */
}

/* =====================================================================
   Navigation preloader (c9_77) — see assets/js/preloader.js
   The wait this covers is between the click and the first byte, which on a
   BI screen is dominated by the warehouse round trip. Nothing renders for
   the first 180ms, so fast pages stay visually still.
   ===================================================================== */
.kx-bar {
  position: fixed; top: 0; left: 0; height: 3px; width: 0;
  background: var(--brand-red, #E61E2A);
  box-shadow: 0 0 8px rgba(230, 30, 42, .55);
  z-index: 2000;              /* above the fixed topbar, which is 100 */
  opacity: 0; transition: width .14s linear, opacity .2s ease;
  pointer-events: none;
}
.kx-bar--on { opacity: 1; }

.kx-slow {
  position: fixed; left: 50%; transform: translateX(-50%) translateY(-6px);
  top: calc(var(--topbar-h, 56px) + 10px);
  background: rgba(26, 26, 26, .92); color: #fff;
  font-size: .82rem; padding: 7px 14px; border-radius: 16px;
  z-index: 2000; opacity: 0; pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}
.kx-slow--on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Skeleton blocks, for the few screens that render then fetch. */
.kx-skel {
  background: linear-gradient(90deg, #e9ecf1 25%, #f3f5f8 37%, #e9ecf1 63%);
  background-size: 400% 100%;
  animation: kx-shimmer 1.4s ease-in-out infinite;
  border-radius: var(--radius-sm, 4px);
  color: transparent !important;
}
.kx-skel--line { height: 12px; margin: 6px 0; }
.kx-skel--title { height: 22px; width: 45%; margin: 8px 0 12px; }
.kx-skel--card { height: 84px; margin-bottom: 10px; border-radius: var(--radius, 8px); }
@keyframes kx-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* A vestibular trigger for some people, and pointless on a slow device. */
@media (prefers-reduced-motion: reduce) {
  .kx-bar { transition: opacity .2s ease; }
  .kx-skel { animation: none; }
}

/* c9_92 — unread count on a launcher tile (Komunikimi). Additive only. */
.module-card__count {
  position: absolute; top: 10px; right: 10px;
  min-width: 22px; height: 22px; padding: 0 7px; border-radius: 99px;
  background: var(--brand-red, #E61E2A); color: #fff;
  font-size: 12px; font-weight: 700; line-height: 22px; text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,.18);
}

/* ---------------------------------------------------------------------
   c9_97 — notifications (assets/js/push.js)
   --------------------------------------------------------------------- */
.app-menu__state { margin-left: auto; font-size: 12px; color: var(--muted); }
.app-menu__state.is-on { color: #0a7d3f; font-weight: 600; }
.mkp-card {
  position: fixed; left: 12px; right: 12px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 1150;
  max-width: 460px; margin: 0 auto; display: flex; align-items: center; gap: 12px;
  background: #fff; border: 1px solid var(--border); border-left: 4px solid var(--gold);
  border-radius: 12px; padding: 12px 10px 12px 14px; box-shadow: 0 8px 28px rgba(0,0,0,.16);
}
.mkp-card__t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; line-height: 1.4; color: var(--ink); }
.mkp-card__t b { font-size: 14.5px; }
.mkp-card__ok { border: 0; background: var(--brand-red); color: #fff; font-weight: 700; font-size: 15px; border-radius: 10px; padding: 10px 20px; min-height: 44px; cursor: pointer; }
.mkp-card__ok:disabled { opacity: .6; }
.mkp-card__x { border: 0; background: none; color: var(--muted); font-size: 22px; line-height: 1; padding: 4px 6px; align-self: flex-start; cursor: pointer; }
.mkp-sheet { position: fixed; inset: 0; z-index: 1160; background: rgba(15,18,25,.45); display: flex; align-items: flex-end; justify-content: center; }
@media (min-width: 700px) { .mkp-sheet { align-items: center; } }
.mkp-sheet__box { background: #fff; width: 100%; max-width: 440px; border-radius: 16px 16px 0 0; padding-bottom: env(safe-area-inset-bottom, 0px); }
@media (min-width: 700px) { .mkp-sheet__box { border-radius: 16px; } }
.mkp-sheet__head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--border-soft); font-size: 16px; }
.mkp-sheet__x { border: 0; background: none; font-size: 24px; line-height: 1; cursor: pointer; color: var(--muted); }
.mkp-sheet__body { padding: 14px 16px 18px; font-size: 14px; line-height: 1.45; color: var(--ink); }
.mkp-sheet__body p { margin: 0 0 10px; }
.mkp-btn { display: block; width: 100%; margin-top: 8px; border: 0; background: var(--brand-red); color: #fff; font-weight: 700; font-size: 15px; border-radius: 10px; padding: 12px; min-height: 44px; cursor: pointer; }
.mkp-btn--ghost { background: var(--bg); color: var(--ink); }
.mkp-btn:disabled { opacity: .6; }
.mkp-btn + p { margin-top: 14px; color: var(--muted); font-size: 13px; }
.mkp-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #1d2433; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; z-index: 1170; max-width: 90vw; box-shadow: 0 4px 16px rgba(0,0,0,.2); }
.mkp-toast[hidden] { display: none; }

/* c9_98 — Mesazhet / Kujtesat switches in ⋮ → Njoftimet */
.mkp-pref { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border-soft); cursor: pointer; }
.mkp-pref__t { flex: 1; display: flex; flex-direction: column; }
.mkp-pref__t small { color: var(--muted); font-size: 12.5px; }
.mkp-pref input { appearance: none; -webkit-appearance: none; width: 44px; height: 26px; border-radius: 13px; background: #c9ced8; position: relative; cursor: pointer; flex: 0 0 auto; transition: background .15s; }
.mkp-pref input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.mkp-pref input:checked { background: #0a7d3f; }
.mkp-pref input:checked::after { left: 21px; }
.mkp-pref + .mkp-btn { margin-top: 14px; }

/* ------------------------------------------------------------------
   c9_118 — compact launcher (Elvis, 14 Oct, mockup option C): same
   layout as before — icon on top, name, description — but ~8 tiles fit
   on a phone screen instead of ~5. Scoped to .launcher so module cards
   elsewhere keep their size.
   ------------------------------------------------------------------ */
.launcher .profile-card { gap: 10px; padding: 8px 12px; margin: 0 0 10px; border-radius: 12px; }
.launcher .profile-card__avatar { width: 36px; height: 36px; font-size: 13px; }
.launcher .profile-card__name { font-size: 15px; }
.launcher .profile-card__title { font-size: 12px; margin-top: 1px; }
.launcher .profile-card__chev { font-size: 22px; }
.launcher .module-grid { gap: 10px; }
.launcher .module-card { gap: 2px; padding: 11px 12px 12px; min-height: 0; border-radius: 14px; }
.launcher .module-card__icon { width: 38px; height: 38px; border-radius: 11px; margin-bottom: 6px; }
.launcher .module-card__icon svg { width: 22px; height: 22px; }
.launcher .module-card__label { font-size: 14.5px; line-height: 1.2; }
.launcher .module-card__desc { font-size: 11.5px; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.launcher .module-card__badge { top: 8px; right: 8px; }
.launcher .portal-entry { margin-top: 10px; }

/* c9_124 — device approval: a neutral notice on the login form, and the
   waiting page shown while IT approves a new device. */
.login__notice {
  background: #eef7f1; color: #0a5c30; border: 1px solid #b9dcc6;
  border-radius: var(--radius-sm); padding: 10px 12px; font-size: 14px; text-align: center;
}
.dp { max-width: 420px; margin: 0 auto; padding: 8px 4px 24px; text-align: center; }
.dp__icon { width: 64px; height: 64px; border-radius: 50%; background: #fdecec; display: flex;
  align-items: center; justify-content: center; margin: 8px auto 14px; }
.dp__icon--ok { background: #e6f4ec; } .dp__icon--no { background: #f1f2f4; }
.dp h1 { font-size: 1.2rem; margin: 0 0 8px; line-height: 1.3; }
.dp__lead { font-size: 14px; color: var(--muted); margin: 0 0 16px; line-height: 1.45; }
.dp__code { font: 800 2.1rem/1 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .2em;
  background: var(--card-bg, #fff); border: 2px dashed var(--gold, #B08B3C); border-radius: 14px;
  padding: 16px 0 16px .2em; margin: 0 0 10px; user-select: all; }
.dp__wait { font-size: 13px; color: var(--muted); min-height: 1.4em; }
.dp__spin { display: inline-block; width: 11px; height: 11px; border: 2px solid #cfd3da;
  border-top-color: var(--brand-red, #E61E2A); border-radius: 50%; margin-right: 6px; vertical-align: -1px;
  animation: dpspin 1s linear infinite; }
@keyframes dpspin { to { transform: rotate(360deg); } }
.dp__dev { background: var(--card-bg, #fff); border: 1px solid var(--border); border-radius: 12px;
  padding: 10px 12px; text-align: left; font-size: 13px; margin: 16px 0; }
.dp__dev b { display: block; font-size: 14px; }
.dp__dev small { color: var(--muted); }
.dp__actions { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.dp__actions form { margin: 0; }
.dp__actions .btn, .dp__btn2 { width: 100%; min-height: 46px; }
.dp__btn2 { font: inherit; font-weight: 600; font-size: 15px; border-radius: var(--radius-sm, 10px);
  border: 1px solid var(--border); background: var(--card-bg, #fff); color: var(--ink, #16191f); cursor: pointer; }
.dp__btn2--quiet { color: var(--muted); }
.dp__msg { font-size: 14px; border-radius: var(--radius-sm, 10px); padding: 10px 12px; margin: 0 0 12px; }
.dp__msg--ok { background: #eef7f1; color: #0a5c30; }
.dp__msg--warn { background: #fff4e0; color: #8a4b00; }

/* c9_125 — reassurance under the code, and what "Tërhiq kërkesën" really does. */
.dp__hint { font-size: 12px; color: var(--muted); margin: 6px 0 0; line-height: 1.45; }

/* ---- c9_127: roster depth + unit groups -------------------------------- */
.rep-depth { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 12px; }
.rep-grp { margin: 0 0 14px; }
.rep-grp > summary { list-style: none; }
.rep-grp > summary::-webkit-details-marker { display: none; }
.rep-grp__head {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  cursor: pointer; padding: 8px 2px; border-bottom: 2px solid var(--gold, #B08B3C);
  margin-bottom: 8px;
}
.rep-grp__head::before { content: "▾"; color: var(--gold, #B08B3C); font-size: 13px; }
.rep-grp:not([open]) > .rep-grp__head::before { content: "▸"; }
.rep-grp__name { font-weight: 700; font-size: 15px; color: var(--ink, #1a1a1a); }
.rep-grp__meta { font-size: 12.5px; color: var(--ink-soft, #5b6270); }
.roster__grp th { background: #faf6ec; text-align: left; padding: 0; border-top: 2px solid var(--gold, #B08B3C); }
.roster__grp-btn {
  all: unset; box-sizing: border-box; display: flex; gap: 10px; align-items: baseline;
  width: 100%; padding: 9px 12px; cursor: pointer;
}
.roster__grp-btn::before { content: "▾"; color: var(--gold, #B08B3C); font-size: 12px; }
.roster__grp-btn[aria-expanded="false"]::before { content: "▸"; }
.roster__grp-btn:focus-visible { outline: 2px solid var(--gold, #B08B3C); outline-offset: -2px; }
.roster__grp-body.is-collapsed .roster__row { display: none; }

/* c9_127: the portal inside OUR OWN shell. The shell above already shows the
   "Po shikon si" bar, so the frame's copy was a second identical bar. Only
   for a same-origin parent: framed anywhere else (or cross-origin) the frame
   keeps its own bar, per the c9_48 rule that an identity warning must never
   vanish inside an iframe. */
.is-embed-mk .imp-bar { display: none; }
/* The phone groups wrap the card lists; on desktop the table carries its own
   group rows, so the phone groups must vanish with the cards. */
.rep-grp { display: none; }
@media (max-width: 720px) { .rep-grp { display: block; } }

/* c9_128 — HR status on the roster (same red as HR's PEZULLUAR badge). */
.susp-pill { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .03em;
  text-transform: uppercase; color: #b4232c; background: #fde8e9; border-radius: 10px; padding: 2px 8px; }
