/* VertiServices — modern, mobile-first stylesheet */
@import url('../vendor/fontawesome/css/fontawesome.min.css');
@import url('../vendor/fontawesome/css/solid.min.css');
@import url('../vendor/fontawesome/css/brands.min.css');

/* Alpine.js — hide elements with x-cloak until Alpine boots, so users
 * never see the unhydrated template on first paint. */
[x-cloak] { display: none !important; }

:root {
  --verti-navy: #1B3A6B;
  --verti-navy-700: #14305A;
  --verti-navy-50: #EEF2F8;
  --tke-orange: #E85A2A;
  --tke-purple: #7A2E6B;
  --bg: #F4F6F9;
  --surface: #FFFFFF;
  --text: #1A2333;
  --muted: #6B7588;
  --border: #E2E6EE;
  --danger: #D94B4B;
  --success: #2E9E6B;
  --warning: #E0A93A;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(20,30,60,0.06);
  --shadow-md: 0 6px 24px rgba(20,30,60,0.08);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--verti-navy); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--verti-navy);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s, transform 0.05s, box-shadow 0.15s;
  white-space: nowrap;
}
.btn:hover { background: var(--verti-navy-700); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn.btn-block { width: 100%; padding: 12px; font-size: 15px; }
.btn.btn-ghost {
  background: transparent;
  color: var(--verti-navy);
  border-color: var(--border);
}
.btn.btn-ghost:hover { background: var(--verti-navy-50); }
.btn.btn-danger { background: var(--danger); }
.btn.btn-danger:hover { background: #B83C3C; }
.btn.btn-accent { background: var(--tke-orange); }
.btn.btn-accent:hover { background: #C9491E; }
.btn.btn-sm { padding: 6px 10px; font-size: 13px; }

/* ---------- Inputs ---------- */
.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--verti-navy);
  box-shadow: 0 0 0 3px rgba(27, 58, 107, 0.15);
}
.field .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ---------- Alerts ---------- */
.alert {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 12px;
}
.alert.error  { background: #FBE9E9; color: #8C2A2A; border: 1px solid #F2C9C9; }
.alert.success { background: #E5F4EC; color: #235E45; border: 1px solid #BFE2D0; }
.alert.warning { background: #FBF2DA; color: #6E5318; border: 1px solid #EFD89A; }

/* ---------- Login layout ---------- */
.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
}
.login-hero { display: none; }
.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow-md);
}
.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}
.brand-logo {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--verti-navy);
  color: #fff;
  display: grid; place-items: center;
  font-weight: 800; font-size: 22px;
  letter-spacing: 0.5px;
}
.brand-name { font-size: 20px; font-weight: 800; color: var(--verti-navy); }
.brand-sub  { font-size: 12px; color: var(--muted); }
.login-title { font-size: 22px; font-weight: 700; margin: 0 0 4px; }
.login-subtitle { color: var(--muted); margin: 0 0 22px; font-size: 14px; }
.login-foot { margin-top: 18px; font-size: 12px; color: var(--muted); text-align: center; }

@media (min-width: 880px) {
  .login-shell { grid-template-columns: 1.1fr 1fr; }
  .login-hero {
    display: flex;
    align-items: center;
    justify-content: center;
    background:
      radial-gradient(circle at 20% 20%, rgba(232,90,42,0.25), transparent 45%),
      radial-gradient(circle at 80% 80%, rgba(122,46,107,0.25), transparent 45%),
      linear-gradient(135deg, var(--verti-navy), var(--verti-navy-700));
    color: #fff;
    padding: 48px;
  }
  .hero-inner { max-width: 480px; }
  .hero-inner h1 { font-size: 36px; line-height: 1.15; margin: 0 0 12px; }
  .hero-inner p  { font-size: 16px; opacity: 0.85; }
  .hero-tag {
    display: inline-block; padding: 4px 10px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 999px; font-size: 12px; margin-bottom: 16px;
    letter-spacing: 0.4px; text-transform: uppercase;
  }
}

/* ---------- App shell ---------- */
.app {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
}
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky; top: 0; z-index: 10;
}
.topbar .brand-row { margin: 0; gap: 10px; align-items: center; }
.brand-program-name {
  /* Sprint 95: the title now lives in the normal flex flow as a
     flex:1 centered block between the logo and the right-side controls,
     so it can never overlap them (the old absolute+center could ride
     over the language switcher on mid widths). The flexible width
     absorbs the slack; text truncates with an ellipsis rather than
     pushing neighbours. */
  flex: 1 1 auto;
  min-width: 0;
  text-align: center;
  font-size: 24px; font-weight: 700;
  color: var(--verti-navy); letter-spacing: 0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}
/* Hide once the topbar gets crowded so it never squeezes the controls. */
@media (max-width: 1100px) { .brand-program-name { display: none; } }
.topbar .brand-logo-img {
  height: 32px;
  width: auto;
  max-width: 220px;
  display: block;
}
@media (max-width: 879px) {
  .topbar .brand-logo-img { height: 26px; max-width: 170px; }
}
/* The flexible title (.brand-program-name) absorbs the slack on wide
   screens, so the spacer only needs to grow once the title is hidden. */
.topbar .spacer { flex: 0 0 0; }
@media (max-width: 1100px) { .topbar .spacer { flex: 1; } }
.topbar .user-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 10px; border-radius: 999px;
  background: var(--verti-navy-50); color: var(--verti-navy);
  font-size: 13px; font-weight: 600;
  text-decoration: none;
  transition: background 0.15s;
}
.topbar a.user-chip:hover { background: #DDE5F1; text-decoration: none; }
.topbar .ai-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 999px; cursor: pointer;
  background: linear-gradient(120deg, #d65f1f 0%, #b8430f 100%);
  color: #fff; border: 0; font-size: 13px; font-weight: 700;
  margin-right: 8px;
  transition: filter 0.15s;
}
.topbar .ai-chip:hover { filter: brightness(1.08); }
.avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--verti-navy); color: #fff;
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
}
.menu-btn {
  border: 1px solid var(--border);
  background: #fff; border-radius: var(--radius-sm);
  padding: 6px 10px; cursor: pointer; font-size: 18px;
}
/* Sprint 124: the hamburger is now shown on desktop too, where it collapses
   / expands the pinned sidebar (it kept its mobile overlay role as well). */

.layout { display: grid; grid-template-columns: 1fr; min-height: 0; }
@media (min-width: 880px) { .layout { grid-template-columns: 240px 1fr; } }

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 16px 10px;
  display: none;
}
@media (min-width: 880px) {
  .sidebar {
    display: block;
    /* Pin the sidebar to the viewport on desktop so the nav stays
       reachable while the content area scrolls. top:56px lands it
       just under the global .topbar (sticky at top:0). The fixed
       height + overflow-y:auto let the nav itself scroll internally
       if more links are added than fit the viewport. align-self:start
       keeps the grid item its natural height (otherwise grid would
       stretch it and sticky would have nothing to slide against). */
    position: sticky;
    top: 56px;
    align-self: start;
    height: calc(100vh - 56px);
    overflow-y: auto;
  }
}
.sidebar.open { display: block; position: fixed; inset: 56px 0 0 0; z-index: 20; }

/* Sprint 124: desktop collapsible sidebar (default expanded). The #menuToggle
   in the topbar flips .sidebar-collapsed on .app; the state is persisted in
   localStorage so it survives page navigation. */
@media (min-width: 880px) {
  .app.sidebar-collapsed .layout { grid-template-columns: 1fr; }
  .app.sidebar-collapsed .sidebar { display: none; }
}

.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-weight: 600; font-size: 14px;
}
.nav a:hover { background: var(--verti-navy-50); text-decoration: none; }
.nav a.active { background: var(--verti-navy); color: #fff; }
.nav-section { font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px;
  color: var(--muted); padding: 10px 12px 4px; }
/* Sprint 138: collapsible nav sections (accordion). The heading is a
   full-width button with a chevron; its links live in .nav-group-body
   which is hidden when the group has .collapsed. */
button.nav-section.nav-toggle {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; background: none; border: 0; cursor: pointer;
  font: inherit; font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.6px; color: var(--muted); text-align: left;
}
button.nav-section.nav-toggle:hover { color: var(--verti-navy); }
.nav-chevron { font-size: 10px; transition: transform .15s ease; opacity: .7; }
.nav-group.collapsed .nav-chevron { transform: rotate(-90deg); }
.nav-group.collapsed .nav-group-body { display: none; }

main.content { padding: 20px 16px 40px; min-width: 0; }
@media (min-width: 880px) { main.content { padding: 28px 32px; } }

.page-header {
  display: flex; align-items: center; gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  /* Sprint 30: pin the page title + button row to the top of the
     content area on every page. top:56px lands it just under the
     global .topbar (sticky at top:0 / z-index:10). z-index:5 stacks
     below the topbar but above the page content. Solid bg so
     scrolling content doesn't bleed through. The negative margin +
     padding pair extends the bg upward to cover the gap the original
     20px content padding leaves -- otherwise a strip of background
     shows above the header when scrolled. */
  position: sticky;
  top: 56px;
  z-index: 5;
  background: var(--bg);
  padding: 10px 0;
  margin: -10px 0 12px;
}
.page-header h1 { margin: 0; font-size: 22px; }
.page-header .spacer { flex: 1; }

/* Per-column filter row in data tables -- used by Projects, Service
   Records (Sprint 30), and any future list page that wants Projects-
   style narrowing. Selects + text inputs share the same look so a
   "Filter…" field next to dropdowns stays visually consistent. */
table.data thead tr.col-filters th { background:#F3F5F9; padding:6px 8px; }
table.data thead tr.col-filters select,
table.data thead tr.col-filters input {
  width:100%; min-width:0; box-sizing:border-box;
  font-size:12px; padding:4px 6px;
  border:1px solid var(--border); border-radius:6px; background:#fff;
}

/* ---------- Card ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: 18px; }

/* ---------- Toolbar ---------- */
.toolbar {
  display: flex; gap: 10px; flex-wrap: wrap;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.toolbar .search,
.toolbar select {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  font: inherit;
}
.toolbar .search { flex: 1; min-width: 200px; }
.toolbar select  { min-width: 140px; }
.toolbar .search:focus,
.toolbar select:focus { outline: none; border-color: var(--verti-navy); }

/* ---------- Tables (responsive: cards on mobile) ---------- */
.table-wrap { overflow-x: auto; }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
table.data th, table.data td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
table.data th {
  font-size: 12px; text-transform: uppercase;
  letter-spacing: 0.4px; color: var(--muted);
  background: #FAFBFD;
}
table.data tbody tr:hover { background: #FBFCFE; }
/* Contract-end alerts: warn = ends within 30 days, danger = expired. */
table.data tbody tr.row-warn,
table.data tbody tr.row-warn:hover   { background: #FBF2DA; }
table.data tbody tr.row-danger,
table.data tbody tr.row-danger:hover { background: #FBE9E9; }
.actions-cell { display: flex; gap: 6px; flex-wrap: wrap; }

.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.3px; text-transform: uppercase;
}
.badge-admin      { background: #FCE3D9; color: #9C3712; }
.badge-manager    { background: #E7E0F2; color: #4F2D6F; }
.badge-technician { background: #DCEAF7; color: #214E7E; }
.badge-viewer     { background: #E8ECF2; color: #495568; }
.badge-status-on      { background: #D9F1E4; color: #1E6C49; }
.badge-status-off     { background: #F0E2E2; color: #7A2828; }
.badge-status-install { background: #DCEAF7; color: #1B3A6B; }
.badge-agreement-R { background: #DCEAF7; color: #214E7E; }
.badge-agreement-G { background: #FCE3D9; color: #9C3712; }
.badge-type-elevator     { background: #DCEAF7; color: #214E7E; }
.badge-type-escalator    { background: #E7E0F2; color: #4F2D6F; }
.badge-type-mww          { background: #FCE3D9; color: #9C3712; }
.badge-type-other        { background: #E8ECF2; color: #495568; }

/* Service-record work types */
.badge-work-maintenance         { background: #DCEAF7; color: #214E7E; }
.badge-work-maintenance_support { background: #E1ECF7; color: #2F5B85; }
.badge-work-fault               { background: #FBE9E9; color: #8C2A2A; }
.badge-work-fault_support       { background: #FCE3D9; color: #9C3712; }
.badge-work-correction          { background: #FBF2DA; color: #6E5318; }
.badge-work-part_replacement    { background: #E7E0F2; color: #4F2D6F; }
.badge-work-inspection          { background: #D9F1E4; color: #1E6C49; }
.badge-work-meeting             { background: #E8ECF2; color: #495568; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: none; align-items: center; justify-content: center;
  /* Sprint 90: bumped to 10000 so the help modal (and every other modal)
     overlays Leaflet, which paints internal panes up to z-index 700. The
     old value (50) left the ? help modal hidden under the map on map.html. */
  z-index: 10000; padding: 16px;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: #fff;
  border-radius: var(--radius);
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-md);
  /* Sprint 138: footer actions (Save / Close / Cancel) moved to the TOP
     of every modal so the user never has to scroll to reach them. The
     modal is a flex column — the title stays, the .modal-foot is ordered
     right under it (fixed), and the .modal-body scrolls underneath. */
  max-height: 90vh;
  display: flex; flex-direction: column; overflow: hidden;
}
.modal h2 {
  margin: 0;
  padding: 16px 20px;
  font-size: 18px;
  border-bottom: 1px solid var(--border);
  order: 0; flex: 0 0 auto;
}
.modal .modal-body {
  padding: 18px 20px;
  order: 1; flex: 1 1 auto; overflow-y: auto; min-height: 0;
}
.modal .modal-foot {
  padding: 12px 20px;
  display: flex; gap: 10px; justify-content: flex-end;
  border-bottom: 1px solid var(--border);
  order: 0; flex: 0 0 auto;
}

/* ---------- Toast ---------- */
.toasts {
  position: fixed; right: 16px; bottom: 16px; z-index: 100;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: #1F2A40; color: #fff;
  padding: 10px 14px; border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  font-size: 14px; max-width: 320px;
}
.toast.success { background: var(--success); }
.toast.error   { background: var(--danger); }

/* ---------- Empty state ---------- */
.empty {
  text-align: center; padding: 40px 16px; color: var(--muted);
}

/* ---------- Utilities ---------- */
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row .col { flex: 1; min-width: 180px; }
/* Sprint 138: inside a modal, let row columns shrink below 180px so 3-4
   fields stay on a single line instead of wrapping a field to the next
   row (the 180px floor above made narrow modals wrap). */
.modal .row .col { min-width: 0; }
.text-muted { color: var(--muted); }
.text-right { text-align: right; }
.mt-2 { margin-top: 14px; }
/* `display: revert` restores the user-agent default for the element type
   (table-cell for <th>/<td>, inline for <span>, etc.) — `display: initial`
   would force everything to `inline`, which broke the user list table. */
.hide-on-mobile { display: none; }
@media (min-width: 720px) { .hide-on-mobile { display: revert; } }

/* ---------- Inline filter bar (Reports / Raw Records) ---------- */
.filter-bar {
  display: flex; flex-wrap: wrap; gap: 8px;
  align-items: center;
}
.filter-bar .filter-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px;
  color: var(--muted); font-weight: 700;
  margin: 0 4px 0 4px;
}
.filter-bar input[type="date"],
.filter-bar input[type="text"],
.filter-bar select {
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  font: inherit;
}
.filter-bar input[type="date"]:focus,
.filter-bar select:focus { outline: none; border-color: var(--verti-navy); }
.filter-bar .btn,
.filter-bar .btn-sm {
  height: 36px;
  padding: 0 14px;
  font-size: 13px;
}
.filter-sep {
  width: 1px; align-self: stretch;
  background: var(--border);
  margin: 0 6px;
}

/* Icon-only buttons (Raw Records action column) */
.btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  cursor: pointer;
  font-size: 16px;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  color: var(--text);
}
.btn-icon:hover { background: var(--verti-navy-50); border-color: var(--verti-navy); }
.btn-icon.btn-icon-danger { color: var(--danger); }
.btn-icon.btn-icon-danger:hover { background: #FBE9E9; border-color: var(--danger); }
.btn-icon:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- Summary page ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--verti-navy);
}
.stat-card.accent::before { background: var(--tke-orange); }
.stat-card.purple::before { background: var(--tke-purple); }
.stat-card.green::before  { background: var(--success); }
.stat-card .stat-value {
  font-size: 30px; font-weight: 800; color: var(--text);
  line-height: 1.1; margin-bottom: 4px;
}
.stat-card .stat-label {
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--muted); font-weight: 600;
}
.stat-card .stat-sub {
  font-size: 12px; color: var(--muted); margin-top: 6px;
}

.breakdown-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 880px) {
  .breakdown-grid { grid-template-columns: repeat(2, 1fr); }
}

.breakdown {
  display: flex; flex-direction: column; gap: 8px;
}
.bar-row {
  display: grid;
  grid-template-columns: minmax(110px, 30%) 1fr 50px;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.bar-row .bar-label {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--text);
}
.bar-row .bar-track {
  background: var(--verti-navy-50);
  border-radius: 999px;
  height: 10px; overflow: hidden;
}
.bar-row .bar-fill {
  background: var(--verti-navy);
  height: 100%; border-radius: 999px;
  transition: width 0.4s ease;
}
.bar-row.accent .bar-fill { background: var(--tke-orange); }
.bar-row.purple .bar-fill { background: var(--tke-purple); }
.bar-row.green  .bar-fill { background: var(--success); }
.bar-row .bar-count {
  text-align: right; font-weight: 700; color: var(--text);
}

/* Spinner */
.spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- Map page ---------------- */
/* Sprint 124: the map fills the full width; the Coordinates / Missing
 * Coordinates panel is a collapsible drawer overlaying its right edge. */
.map-layout {
  position: relative;
  overflow: hidden;            /* clip the drawer when it slides off-right */
}
.map-canvas {
  height: calc(100vh - 180px);
  min-height: 420px;
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
}
.map-side {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 600;
  width: 320px;
  max-width: 86vw;
  max-height: calc(100% - 20px);
  display: flex;
  flex-direction: column;
  overflow: auto;
  transition: transform .25s ease, opacity .2s ease;
}
.map-side.collapsed {
  transform: translateX(calc(100% + 16px));
  opacity: 0;
  pointer-events: none;
}
/* Drawer handle: sits at the panel's left edge; when the panel is collapsed
 * it stays at the map's right edge (sibling combinator keys off .collapsed). */
.map-side-toggle {
  position: absolute;
  top: 10px;
  right: 338px;
  z-index: 601;
  width: 30px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--verti-navy);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: right .25s ease;
}
.map-side.collapsed ~ .map-side-toggle { right: 10px; }
@media (max-width: 880px) {
  .map-side { width: 300px; }
  .map-side-toggle { right: 318px; }
  .map-side.collapsed ~ .map-side-toggle { right: 10px; }
}

/* Sprint 124: header toolbar that carries the three map controls on the
 * title row (Pick user | Live tracking | GPS events). */
.map-headrow {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.map-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.map-tool {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 9px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.map-tool-check { cursor: pointer; }
.map-tool-check input { margin: 0; }
/* Sprint 161: drag-to-reposition visual cue. The marker the user armed
   via its popup's "Edit position" link gets .vpin-edit — an amber halo
   + grab cursor — so it's obvious which pin is the one being moved. */
.leaflet-marker-icon.vpin-edit { cursor: grab; }
.leaflet-marker-icon.vpin-edit.leaflet-marker-dragging { cursor: grabbing; }
.leaflet-marker-icon.vpin-edit .vpin {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #B45309, 0 2px 6px rgba(0,0,0,.25);
}
/* Sprint 164: the focused marker (clicked on the map, in the Coordinates
   list, or as a GPS event) gets a navy halo — distinct from the amber
   edit halo above. Works for both project pins (.vpin) and event dots
   (.vevent). */
.leaflet-marker-icon.marker-selected .vpin,
.leaflet-marker-icon.marker-selected .vevent {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #1B3A6B, 0 2px 8px rgba(27,58,107,.4);
}
.leaflet-marker-icon.marker-selected { z-index: 10000 !important; }
/* Sprint 164: GPS-events toolbar group — date input + no-location badge. */
#gpsTool { display: inline-flex; align-items: center; gap: 8px; }
.gps-noloc-badge {
  background: #FEF3C7; color: #92400E; border: 1px solid #FDE68A;
  font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px;
  white-space: nowrap;
}
/* Sprint 164: project + unit rows inside the GPS-event popup. */
.leaflet-popup-content .gps-pop-meta {
  margin: 6px 0; padding: 6px 0; border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border); font-size: 12px; line-height: 1.6;
}
.leaflet-popup-content .gps-pop-meta i { color: var(--verti-navy); margin-right: 4px; }
.map-edit-banner {
  position: fixed;
  top: 88px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1500;
  background: #FFF7ED;
  color: #7C2D12;
  border: 1px solid #FDBA74;
  border-radius: 999px;
  padding: 6px 14px 6px 12px;
  font-size: 13px;
  display: flex;
  gap: 10px;
  align-items: center;
  box-shadow: 0 6px 18px rgba(180,83,9,.18);
}
.map-edit-banner i { color: #B45309; }
.map-edit-banner .btn { padding: 2px 10px; }
/* Sprint 161: click-to-place. While armed, the whole Leaflet pane gets
   a crosshair cursor so the user knows the next click drops the pin. */
body.map-set-location .leaflet-container,
body.map-set-location .leaflet-grab,
body.map-set-location .leaflet-clickable { cursor: crosshair !important; }
.missing-list .set-loc-link {
  display: inline-block;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #B45309;
  text-decoration: none;
}
.missing-list .set-loc-link:hover { text-decoration: underline; }
.missing-list .set-loc-link i { margin-right: 3px; }
.map-tool-sel,
.map-tool-date {
  font-size: 13px;
  padding: 2px 4px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}
.map-tool .btn-sm { padding: 2px 8px; }
.map-side .missing-list {
  list-style: none; padding: 0; margin: 0;
}
.map-side .missing-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.map-side .missing-list li:last-child { border-bottom: 0; }
.map-side .missing-list a { color: var(--verti-navy); font-weight: 600; }
.map-side .missing-list .region { color: var(--muted); font-size: 12px; }

/* Marker popup contents */
.leaflet-popup-content {
  margin: 12px 14px;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text);
  max-width: 280px;
}
.leaflet-popup-content h3 {
  margin: 0 0 6px;
  font-size: 15px;
  color: var(--verti-navy);
}
.leaflet-popup-content .popup-region {
  color: var(--muted); font-size: 12px; margin-bottom: 8px;
}
.leaflet-popup-content .popup-notes { margin: 8px 0; }
.leaflet-popup-content .popup-notes p:first-child { margin-top: 0; }
.leaflet-popup-content .popup-notes p:last-child  { margin-bottom: 0; }
.leaflet-popup-content .popup-actions {
  margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border);
}
.leaflet-popup-content .popup-actions a {
  color: var(--verti-navy); font-weight: 600;
}
/* Sprint 161: popup actions collapsed to a row of compact icon buttons —
   tooltip carries the label so the popup stays small. */
.leaflet-popup-content .popup-icon-actions {
  display: flex; gap: 8px; align-items: center;
}
.leaflet-popup-content .popup-icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 6px;
  background: var(--verti-navy-50); color: var(--verti-navy);
  text-decoration: none; transition: background .12s, color .12s;
}
.leaflet-popup-content .popup-icon-btn:hover {
  background: var(--verti-navy); color: #fff;
}
.leaflet-popup-content .popup-icon-btn.popup-icon-danger {
  background: #FEE2E2; color: #B91C1C;
}
.leaflet-popup-content .popup-icon-btn.popup-icon-danger:hover {
  background: #B91C1C; color: #fff;
}

/* ---------------- Chart cards (Summary / Reports / Dashboard) ------- */
.chart-box {
  min-height: 300px;
}
.chart-box .empty { text-align: center; }
/* ApexCharts inherits the page font; keep its text on-brand. */
.apexcharts-tooltip {
  border: 1px solid var(--border) !important;
  box-shadow: var(--shadow-md) !important;
}
.apexcharts-tooltip-title {
  background: var(--verti-navy-50) !important;
  border-bottom: 1px solid var(--border) !important;
  font-weight: 600;
}

/* ============================================================== */
/* Mobile actions shell (Sprint 88) — four big buttons + scanner   */
/* ============================================================== */
.mobile-body { background: var(--verti-navy-50); margin: 0; }
.mobile-shell {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
  max-width: 480px; margin: 0 auto;
  padding: 14px 16px 24px;
  position: relative;
}
.mobile-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 12px; border-bottom: 1px solid var(--border);
}
.mobile-brand {
  display: flex; flex-direction: column; align-items: flex-start;
  gap: 4px; min-width: 0; flex: 1;
}
.mobile-brand-logo {
  /* Sprint 89: site-identical wide banner (519x85). Cap to 36px high and
     let width follow the original 6:1 aspect ratio.
     Sprint 89 follow-up: logo-navy.png is the site banner re-tinted to
     solid var(--verti-navy) on a transparent backdrop (see
     scripts/make-logo-navy.php) so it sits flush with the page tint and
     matches the tagline below it. No blend-mode trickery -- clean alpha. */
  height: 36px; width: auto; max-width: 100%;
  display: block;
}
.mobile-brand-tagline {
  /* Sprint 89 follow-up: subtitle under the wide banner so the user sees
     the spelled-out product name on the page (not just in the browser tab). */
  font-size: 15px; font-weight: 700;
  color: var(--verti-navy); letter-spacing: 0.2px;
}
/* Sprint 129: chip just hosts the round avatar now (the full name is
 * gone from the topbar — see mobile.html). The .avatar class handles the
 * round navy circle + initials, so this wrapper only needs to keep its
 * place in the topbar's flex row. */
.mobile-user-chip { flex-shrink: 0; display: flex; align-items: center; }

.mobile-prefill {
  display: flex; align-items: center; gap: 10px;
  margin: 14px 0 4px;
  padding: 10px 12px;
  background: #E5F4EC; color: #235E45;
  border: 1px solid #B7E1CC; border-radius: 10px;
}
.mobile-prefill > i { font-size: 20px; }
.mobile-prefill-text { flex: 1; min-width: 0; }
.mobile-prefill-title { font-weight: 700; font-size: 15px; }
.mobile-prefill-sub { font-size: 12px; color: var(--text-muted); }
.mobile-prefill-clear {
  background: none; border: 0; font-size: 22px;
  color: #235E45; cursor: pointer; line-height: 1; padding: 0 4px;
}

.mobile-actions {
  flex: 1; display: flex; flex-direction: column; gap: 14px;
  padding: 18px 0 0;
}
.mobile-action-btn {
  position: relative;
  background: #fff; border: 1px solid var(--border); border-radius: 14px;
  padding: 18px 18px 18px 22px;
  display: flex; align-items: center; gap: 16px;
  min-height: 78px;
  font: 600 18px/1.2 inherit; color: var(--verti-navy);
  text-align: left; cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  transition: transform .08s ease, box-shadow .15s ease;
}
.mobile-action-btn:active { transform: scale(0.985); box-shadow: 0 1px 1px rgba(0,0,0,0.06); }
.mobile-action-btn[disabled] { opacity: 0.5; cursor: progress; }
.mobile-action-icon { font-size: 28px; color: var(--verti-navy); width: 32px; text-align: center; }
.mobile-action-label { flex: 1; }
.mobile-action-scan {
  font-size: 22px; color: #E85A2A;
  background: #FFF4EE; border-radius: 8px; padding: 6px 8px;
}
/* Sprint 127: FORM badge (pen-to-square) — sits to the LEFT of the QR
 * badge on each data-entry button. Opens the matching APK form page on
 * tap; its handler stops propagation so the parent button's QR scan
 * does not fire. */
.mobile-action-form {
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 20px; color: var(--verti-navy);
  background: #DCE6F4; border-radius: 8px; padding: 6px 8px;
  cursor: pointer;
  margin-left: auto;
}
.mobile-action-form:active { transform: scale(0.95); }
.mobile-action-btn .mobile-action-form + .mobile-action-scan { margin-left: 6px; }
/* When the active-service card is on screen, S/F/P tiles are dimmed
 * but still tappable (we intercept the click to show a toast so the
 * user knows why). Photo, Map and Manual stay live. */
.mobile-action-btn.disabled-by-active { opacity: 0.45; }
.mobile-action-btn.disabled-by-active .mobile-action-icon,
.mobile-action-btn.disabled-by-active .mobile-action-label,
.mobile-action-btn.disabled-by-active .mobile-action-form,
.mobile-action-btn.disabled-by-active .mobile-action-scan {
  color: #9CA3AF !important; background: #F3F4F6 !important;
}
/* Sprint 127: notification bubbles in the mobile topbar (replacing the
 * brand logo + tagline). One per category — S/F/P — sized to be
 * thumb-friendly. Hidden via [hidden] until the user has unread items
 * in that category. */
/* Sprint 129 (revised): the V-shaped Verti mark on the far-left of the
 * mobile topbar — a navy rounded square with a white V, mirroring the APK
 * launcher icon.  Rendered as inline SVG inside this span, so size +
 * shrink-resist live here. */
.mobile-brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  flex-shrink: 0;
}
.mobile-brand-mark svg { width: 100%; height: 100%; display: block; }
/* Sprint 129: home FAB pinned to the bottom-right corner of every mobile
 * APK form page. One tap takes the user back to mobile.html. */
.mobile-home-fab {
  position: fixed; bottom: 18px; right: 18px;
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--verti-navy); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; text-decoration: none;
  box-shadow: 0 3px 8px rgba(0,0,0,0.25); z-index: 100;
}
.mobile-home-fab:active { transform: scale(0.95); }
/* Sprint 129: common form-page H1 — coloured swatch + bold title. */
.mobile-page-h1 {
  display: flex; align-items: center; gap: 10px;
  margin: 14px 0 10px;
}
.mobile-page-swatch { width: 4px; height: 22px; border-radius: 2px; }
.mobile-page-h1 h1 { font: 800 18px/1.1 inherit; color: #111827; margin: 0; }
/* Common select / input bits used inside the form pages. */
.mobile-field { margin-bottom: 12px; }
.mobile-field label { display: block; font-size: 11px; font-weight: 700;
  color: #374151; margin-bottom: 5px; }
.mobile-field select, .mobile-field input[type="text"],
.mobile-field input[type="date"], .mobile-field input[type="datetime-local"],
.mobile-field textarea {
  width: 100%; padding: 11px 12px; border: 1px solid var(--border);
  border-radius: 10px; font-size: 14px; background: #fff; box-sizing: border-box;
  font-family: inherit;
}
.mobile-field textarea { min-height: 80px; resize: vertical; }
/* Status filter chips row reused across list pages. */
.mobile-chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 12px; }
.mobile-chip {
  padding: 6px 12px; border-radius: 999px; font-size: 11px; font-weight: 700;
  background: #fff; color: #374151; border: 1px solid var(--border); cursor: pointer;
}
.mobile-chip.active { background: var(--verti-navy); color: #fff; border-color: var(--verti-navy); }
/* Card row used by the list-style pages (Service / Part / Fault open list). */
.mobile-card {
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; margin-bottom: 10px;
  display: flex; align-items: center; gap: 10px;
  border-left-width: 4px;
}
.mobile-card .body { flex: 1; min-width: 0; }
.mobile-card .title { font: 700 13px/1.2 inherit; color: #111827; }
.mobile-card .sub   { font: 500 11px/1.3 inherit; color: #6B7280; margin-top: 3px; }
.mobile-card .meta  { font: 600 10px/1 inherit; margin-top: 5px; }
.mobile-card.s-open    { border-left-color: #C0392B; }
.mobile-card.s-prog    { border-left-color: #FFB300; }
.mobile-card.s-done    { border-left-color: #2E7D32; }
.mobile-card.s-pending { border-left-color: #1B3A6B; }
.mobile-card .meta.s-open    { color: #991B1B; }
.mobile-card .meta.s-prog    { color: #B7791F; }
.mobile-card .meta.s-done    { color: #15803D; }
.mobile-card .meta.s-pending { color: #1E40AF; }
.mobile-card .card-action {
  width: 42px; height: 42px; border-radius: 10px; border: 0;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  font-size: 16px; flex-shrink: 0;
}
.mobile-card .card-action.start    { background: #FFB300; color: #fff; }
.mobile-card .card-action.complete { background: #16A34A; color: #fff; }
.mobile-card .card-action.view     { background: #fff; color: #374151; border: 1px solid var(--border); }
.mobile-topbar { gap: 10px; }
.mobile-notif-bubbles { display: flex; gap: 8px; align-items: center; flex: 1; }
.mobile-notif-bubble {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; height: 28px; padding: 0 8px;
  border: 0; border-radius: 999px;
  font: 800 11px/1 inherit; color: #fff;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,.18);
}
.mobile-notif-bubble[hidden] { display: none !important; }
.mobile-notif-bubble.s { background: var(--verti-navy); }
.mobile-notif-bubble.f { background: #C0392B; }
.mobile-notif-bubble.p { background: #6B21A8; }
/* Sprint 127: live "active operation" card. Lives between the topbar
 * and the action grid; visible only while the user has an in-progress
 * service (initially) or fault / part-replacement (later). The clock
 * ticks in JS (mobile-actions.js). */
.mobile-active-card {
  margin: 14px 0 0;
  padding: 14px 16px;
  background: #E6F4EA;
  border: 1.6px solid #2E7D32;
  border-radius: 14px;
  display: flex; flex-direction: column; gap: 6px;
}
.mobile-active-card[hidden] { display: none !important; }
.mobile-active-head {
  display: flex; align-items: center; justify-content: space-between;
}
.mobile-active-type {
  font-size: 11px; font-weight: 800; letter-spacing: 0.6px;
  color: #15803D;
}
.mobile-active-live {
  display: flex; align-items: center; gap: 5px;
  font-size: 9px; font-weight: 800; color: #15803D;
}
.mobile-active-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #10B981;
  animation: mActiveDotPulse 1.5s ease-in-out infinite;
}
@keyframes mActiveDotPulse { 0%,100% { opacity: .3; } 50% { opacity: 1; } }
.mobile-active-title { font-size: 14px; font-weight: 700; color: var(--verti-navy); }
.mobile-active-sub   { font-size: 11px; font-weight: 500; color: #475569; }
.mobile-active-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 4px;
}
.mobile-active-clock {
  font-family: ui-monospace, Menlo, Monaco, Consolas, monospace;
  font-size: 18px; font-weight: 800; color: #15803D;
}
.mobile-active-complete {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 10px;
  background: #2E7D32; color: #fff;
  border: 0; cursor: pointer;
  font-size: 13px; font-weight: 700;
}
.mobile-active-complete:active { transform: scale(.97); }
.mobile-active-complete[disabled] { opacity: 0.6; cursor: progress; }

/* Sprint 127: pages opened from the APK launcher (`?apk=1` -> body.is-apk)
 * strip the desktop chrome: the sidebar, the brand banner, the language
 * switcher, the help button and the hamburger all disappear; the content
 * grid drops to a single column; only the small notification chips and
 * the user/logout cluster remain in the topbar. The page-level scripts
 * keep working unchanged. */
@media (min-width: 0) {
  body.is-apk .sidebar,
  body.is-apk .menu-btn,
  body.is-apk .brand-row,
  body.is-apk .lang-switch,
  body.is-apk .brand-program-name,
  body.is-apk #helpBtn { display: none !important; }
  body.is-apk .layout { grid-template-columns: 1fr !important; }
  body.is-apk .topbar { padding: 6px 12px; gap: 6px; }
  body.is-apk main.content { padding: 12px 12px 24px; }
}
.mobile-manual { background: var(--verti-navy); color: #fff; border-color: var(--verti-navy); }
.mobile-manual .mobile-action-icon { color: #fff; }

.mobile-logout-btn {
  position: absolute; bottom: 18px; right: 18px;
  width: 44px; height: 44px; border-radius: 50%;
  background: #fff; border: 1px solid var(--border);
  color: var(--text-muted); cursor: pointer; font-size: 16px;
}

/* Make the [hidden] attribute decisively win over .mobile-prefill,
   .scan-overlay and .modal-backdrop, all of which set display:flex.
   Author single-class selectors otherwise out-rank the UA's [hidden]
   single-attr rule (same specificity, later in cascade) and the modal
   pops open on first render. */
.mobile-prefill[hidden],
#confirmModal[hidden] { display: none !important; }

/* Scanner overlay — fullscreen camera view with framed center */
.scan-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: #000; display: flex; align-items: center; justify-content: center;
}
.scan-overlay[hidden] { display: none !important; }
.scan-overlay video {
  width: 100%; height: 100%; object-fit: cover;
}
.scan-frame {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: min(70vw, 320px); height: min(70vw, 320px);
  border: 3px solid #FFF; border-radius: 16px;
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.45);
}
.scan-help {
  position: absolute; bottom: 14%; left: 0; right: 0;
  text-align: center; color: #fff; font-weight: 600; font-size: 15px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
  padding: 0 16px;
}
.scan-cancel {
  position: absolute; top: 14px; right: 14px;
  width: 44px; height: 44px; border-radius: 50%;
  border: 0; background: rgba(255,255,255,0.18); color: #fff;
  font-size: 28px; line-height: 1; cursor: pointer;
}

/* Sprint 123: branding line above the unit-barcode QR. Same font
 * character as the label lines below it (Arial, weight 700) — just a
 * slightly larger point size. One line (white-space:nowrap), solid
 * black, overflow:hidden as a hard backstop against an unexpected spill. */
.qr-url {
  width: 100%;
  margin: 0 auto 2px;
  text-align: center;
  font-weight: 700;
  font-size: 7pt;
  line-height: 1.2;
  color: #000;
  white-space: nowrap;
  overflow: hidden;
}


/* ===== Sprint 136: GPS Reports ===== */
.gpsr-filters {
  display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.gpsr-filters .pf { display: flex; flex-direction: column; gap: 4px; }
.gpsr-filters label { font-size: 12px; font-weight: 600; color: var(--muted); }
.gpsr-filters input, .gpsr-filters select {
  padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); font: inherit;
}
.gpsr-gran { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.gpsr-gran button {
  padding: 8px 14px; border: 0; background: #fff; cursor: pointer;
  font: inherit; font-weight: 700; font-size: 12px; color: var(--verti-navy);
}
.gpsr-gran button.active { background: var(--verti-navy); color: #fff; }

.gpsr-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; padding: 16px; }
.gpsr-kpi {
  position: relative; background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 14px; overflow: hidden;
}
.gpsr-kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--accent, #1B3A6B); }
.gpsr-kpi .k-label { font-size: 10px; font-weight: 700; letter-spacing: .5px; color: var(--muted); text-transform: uppercase; }
.gpsr-kpi .k-value { font-size: 22px; font-weight: 800; color: var(--text); margin-top: 4px; }
.gpsr-kpi .k-sub { font-size: 10px; color: var(--muted); margin-top: 2px; }

/* Timeline bands — Sprint 144 unified palette (shared with the live map
 * via Gps::liveStateFor: at_project=green, travel=blue, idle=red,
 * offline=grey, lunch=white pill with "LUNCH" label). */
.gpsr-timeline { position: relative; height: 30px; background: #F3F4F6; border-radius: 6px; overflow: hidden; }
.gpsr-band { position: absolute; top: 0; bottom: 0; }
.gpsr-band.at_project { background: #16A34A; }
.gpsr-band.travel     { background: #2563EB; }
.gpsr-band.idle       { background: #DC2626; }
.gpsr-band.offline    { background: #9CA3AF; }
.gpsr-band.lunch      { background: #FFFFFF; border-top:1px solid #9CA3AF; border-bottom:1px solid #9CA3AF;
  color:#28344A; font:800 9px/30px Arial, sans-serif; text-align:center; letter-spacing:.4px; overflow:hidden; }
.gpsr-band.lunch::before { content:'LUNCH'; }
.gpsr-band.off_clock  { background: #E5E7EB; }
.gpsr-axis { position: relative; height: 16px; margin-top: 2px; }
.gpsr-axis span { position: absolute; font-size: 9px; color: var(--muted); transform: translateX(-50%); }
.gpsr-legend { display: flex; gap: 14px; flex-wrap: wrap; margin: 10px 0; font-size: 11px; }
.gpsr-legend i { display: inline-block; width: 12px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: middle; }

/* Diverging balance bar */
.gpsr-bal { position: relative; height: 16px; }
.gpsr-bal .deficit { position: absolute; right: 50%; height: 16px; background: #DC2626; border-radius: 2px 0 0 2px; }
.gpsr-bal .overtime { position: absolute; left: 50%; height: 16px; background: #059669; border-radius: 0 2px 2px 0; }
.gpsr-bal .axis { position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: var(--muted); }

.gpsr-net-pos { color: #059669; font-weight: 800; }
.gpsr-net-neg { color: #DC2626; font-weight: 800; }
.gpsr-flag { color: #DC2626; font-weight: 700; }
.gpsr-bar { height: 12px; border-radius: 6px; background: #F3F4F6; overflow: hidden; }
.gpsr-bar > span { display: block; height: 100%; border-radius: 6px; }
