/* Brand palette: matched to the Merlin Group logo — navy primary (#17529e, sampled
   directly from the logo artwork) with the logo's gold/red/green accent stripe colors carried
   into the warn/bad/good semantic colors so the whole app reads as one consistent brand rather
   than a generic default theme. Every color below was contrast-checked at 4.5:1+ against white
   (WCAG AA for normal text) before being picked — see the "Team review an earlier release" README note if
   you ever need to retune these; they're the only place brand color lives in the whole app. */
:root {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --border: #dfe4e7;
  --text: #1c2226;
  --text-2: #5b6770;
  --accent: #17529e;
  --accent-dark: #0d3a73;
  --accent-bg: #e8f0fb;
  --good: #1f7a4d; --good-bg: #e5f4ec;
  --warn: #96650a; --warn-bg: #fdf1d8;
  --bad: #b83430;  --bad-bg: #fce8e7;
  --info: #2358a6; --info-bg: #e7eefa;
  --muted: #6b7480; --muted-bg: #eceff1;
  --accent-text: var(--accent);   /* Text/link ink: equals --accent in light, a lightened tint in dark */
  --input-bg: #ffffff;
  --surface-2: #f4f6f8; --bg-alt: #f7f7f7; --bg-2: #fafafa; --color-bg-subtle: #f6f7f9;
  --ink: #1b2430;
  --bad-solid: var(--bad);         /* filled red (badge / danger button) that carries white text */
  --btn-secondary-bg: #ffffff;
  --radius: 8px;
  color-scheme: light;
}

/* Dark theme. Chosen per device under My Profile (Light / Dark / Match my device) and kept in
   the browser; includes/header.php sets data-theme on <html> before first paint. Everything on the
   page reads colour from the tokens above, so this block re-declares the tokens and nothing else.
   --accent / --accent-dark stay the configured brand colour (buttons, top bar); only the tinted
   backgrounds and the text-ink are derived from it so a custom brand colour still reads on dark. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e1319;
  --surface: #161c25;
  --border: #2a3340;
  --text: #e5e9ee;
  --text-2: #9aa6b4;
  --accent-text: #8db8f2;
  --accent-text: color-mix(in srgb, var(--accent) 45%, #ffffff);
  --accent-bg: #16253a;
  --accent-bg: color-mix(in srgb, var(--accent) 24%, var(--surface));
  --good: #4cc38a;  --good-bg: #13301f;
  --warn: #e3ac45;  --warn-bg: #352a0e;
  --bad: #f07a74;   --bad-bg: #3b1917;
  --info: #7ab0f2;  --info-bg: #15263e;
  --muted: #8f9aa8; --muted-bg: #222b36;
  --input-bg: #0f151c;
  --surface-2: #1b232d; --bg-alt: #1b232d; --bg-2: #1b232d; --color-bg-subtle: #1b232d;
  --ink: #e5e9ee;
  --bad-solid: #c0403b;
  --btn-secondary-bg: #1c2430;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: "Segoe UI", -apple-system, Arial, sans-serif;
  font-size: 14.5px; line-height: 1.5;
}
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Notifications.php list. */
.notif-list { display: flex; flex-direction: column; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.notif-item { background: var(--surface); padding: 12px 16px; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.notif-item.notif-unread { background: var(--info-bg); }
.notif-title { font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.notif-body { min-width: 0; }
.page { max-width: 1200px; margin: 0 auto; padding: 24px 20px 60px; }

/* ---------------------------------------------------------------------
   Mobile / tablet pass — every page in this app is used
   from a phone or tablet by employees and vendors (only admins are assumed
   to be at a desk), so this isn't an afterthought breakpoint: it collapses
   the topbar nav into a proper toggled menu, gives touch targets more room,
   and lets the existing auto-fit grid/flex layouts (card-grid, form-row,
   table-wrap) do what they were already built to do at narrower widths.
   --------------------------------------------------------------------- */
@media (max-width: 640px) {
  body { font-size: 15px; }
  .page { padding: 16px 12px 48px; }
  .card { padding: 14px; }
  h1 { font-size: 19px; }
  .btn, .btn-secondary, .btn-danger { padding: 10px 16px; font-size: 14px; } /* bigger tap target than the desktop default */
  .btn-sm { padding: 7px 12px; font-size: 13px; }
  th, td { padding: 8px; font-size: 13px; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar .actions, .toolbar > a, .toolbar > div { width: 100%; }
  .tabs { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .tabs a { white-space: nowrap; }
  .center-page, .login-wrap { margin-top: 20px; margin-bottom: 20px; max-width: 100%; }
  .card-grid { grid-template-columns: 1fr; } /* one stat/card per row reads better than a cramped 2-up on a phone */
  .form-row { grid-template-columns: 1fr; }

  /* Switch the Tickets and Assets list tables to a stacked "card"
     layout at phone width instead of the default sideways-scrolling table (the .table-wrap
     overflow-x:auto above still handles every OTHER table in the app unchanged). Opt-in via the
     .card-on-mobile class on .table-wrap (added only to tickets.php and assets.php's list tables,
     the two pages named), so no Setup master-list table's mobile behaviour changes.
     Each <td> that should show a label on the card carries data-label="Column Name" (rendered via
     the ::before content trick below); the checkbox column's <td> has no data-label and is simply
     hidden on mobile — a per-row checkbox is awkward to use in a stacked card anyway, and today's
     bulk-action bar already requires selecting on desktop first. */
  .table-wrap.card-on-mobile { overflow-x: visible; border: none; }
  .table-wrap.card-on-mobile table thead { display: none; }
  .table-wrap.card-on-mobile table,
  .table-wrap.card-on-mobile table tbody,
  .table-wrap.card-on-mobile table tr,
  .table-wrap.card-on-mobile table td {
    display: block; width: 100%;
  }
  .table-wrap.card-on-mobile table tr {
    border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 10px;
    padding: 10px 12px; background: var(--surface);
  }
  .table-wrap.card-on-mobile table tr:hover { background: var(--surface); } /* the row-hover tint above is a desktop-only affordance; a "hover" state means nothing on a touch card */
  .table-wrap.card-on-mobile table tbody tr:nth-child(even) td { background: transparent; } /* zebra striping likewise reads as a table convention, not a card one */
  .table-wrap.card-on-mobile table td {
    border: none; padding: 4px 0; display: flex; justify-content: space-between; align-items: baseline;
    gap: 12px; text-align: right; font-size: 13.5px;
  }
  .table-wrap.card-on-mobile table td[data-label]::before {
    content: attr(data-label); font-weight: 600; color: var(--text-2); text-align: left; flex-shrink: 0;
  }
  .table-wrap.card-on-mobile table td:not([data-label]) { display: none; }
}

img { max-width: 100%; height: auto; }

h1 { font-size: 21px; margin: 0 0 4px; }
h2 { font-size: 17px; margin: 28px 0 10px; }
.subtitle { color: var(--text-2); font-size: 13.5px; margin: 0 0 20px; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; margin-bottom: 18px;
  box-shadow: 0 1px 2px rgba(20,26,32,.04); /* an earlier release pass: a hint of lift so cards read as
    distinct surfaces on the page background instead of a flat outline — subtle enough to stay out
    of the way, not a redesign of the existing card look. */
}
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
/* Help.php's changelog entries: each highlight gets a divider except the
   last one in its card, since a rich (location/type-tagged) highlight now spans a couple of lines. */
.card ul li:last-child { border-bottom: none !important; margin-bottom: 0 !important; padding-bottom: 0 !important; }

.stat-tile {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; border-left: 3px solid var(--border); transition: box-shadow .15s ease;
}
.stat-tile:hover { box-shadow: 0 2px 8px rgba(20,26,32,.06); }
.stat-tile .num { font-size: 26px; font-weight: 700; line-height: 1.15; }
.stat-tile .label { color: var(--text-2); font-size: 12.5px; text-transform: uppercase; letter-spacing: .03em; margin-top: 2px; }
.stat-tile.tone-warn { border-left-color: var(--warn); }
.stat-tile.tone-bad { border-left-color: var(--bad); }
.stat-tile.tone-good { border-left-color: var(--good); }
.stat-tile.tone-warn .num { color: var(--warn); }
.stat-tile.tone-bad .num { color: var(--bad); }
.stat-tile.tone-good .num { color: var(--good); }
/* Dashboard stat tiles are now clickable drill-downs (<a>, not <div>) — reset
   the link defaults so they still look exactly like the plain stat tiles they always were. */
a.stat-tile { display: block; text-decoration: none; color: inherit; cursor: pointer; }
a.stat-tile:hover { box-shadow: 0 2px 8px rgba(20,26,32,.06); border-left-width: 4px; }

/* Dashboard date-range selector, next to the "IT Work Reports" heading. */
.dash-range-form select, .dash-range-form input[type="date"] {
  padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text-1); font-size: 13px;
}

table { width: 100%; border-collapse: collapse; background: var(--surface); }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; font-size: 13.5px; }
th { background: var(--muted-bg); font-weight: 600; color: var(--text-2); font-size: 12.5px; text-transform: uppercase; letter-spacing: .02em; }
tbody tr { transition: background-color .12s ease; }
tbody tr:nth-child(even) td { background: rgba(107,116,128,.028); } /* faint zebra striping — readability on longer lists (assets, tickets) without competing with the existing hover tint below */
tr:hover td { background: var(--accent-bg); } /* Was a fixed #fafcfc; now reads from the
  same brand-color-driven token item 6 introduced, so a custom brand color also shows up in the
  hover tint instead of looking disconnected from it. */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.table-wrap table { border: none; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; transition: background-color .12s ease, color .12s ease; }
.badge-good { background: var(--good-bg); color: var(--good); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-bad  { background: var(--bad-bg); color: var(--bad); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-muted{ background: var(--muted-bg); color: var(--muted); }

/* SFDC-style ticket status stepper (ticket_view.php). Each step is a chevron
   made from a skewed pseudo-element, classic breadcrumb/path trick — no images, no JS. */
.ticket-path { display: flex; align-items: stretch; flex-wrap: wrap; gap: 0 3px; margin: 2px 0 18px; }
.ticket-path .step {
  position: relative;
  padding: 7px 16px 7px 20px;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  background: var(--muted-bg);
  color: var(--text-2);
}
.ticket-path .step:first-child { padding-left: 14px; border-radius: var(--radius) 0 0 var(--radius); }
.ticket-path .step::after {
  content: ''; position: absolute; right: -8px; top: 0; width: 16px; height: 100%;
  background: inherit; transform: skewX(-18deg); z-index: 1;
}
.ticket-path .step > span { position: relative; z-index: 2; }
.ticket-path .step.is-done { background: var(--good-bg); color: var(--good); }
.ticket-path .step.is-current { background: var(--accent); color: #fff; }
.ticket-path .step.is-closed-pill {
  margin-left: 10px; border-radius: var(--radius); background: var(--muted-bg); color: var(--muted);
}
.ticket-path .step.is-closed-pill::after { display: none; }
.ticket-path .step.is-closed-pill.is-closed-active { background: var(--muted); color: #fff; }

.alert { padding: 11px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: 13.5px; }
.alert-success { background: var(--good-bg); color: var(--good); }
.alert-error { background: var(--bad-bg); color: var(--bad); }
.alert-warning { background: var(--warn-bg); color: var(--warn); }
.alert-info { background: var(--info-bg); color: var(--info); }

form .field { margin-bottom: 14px; }
form label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; color: var(--text-2); }
input[type=text], input[type=password], input[type=email], input[type=number],
input[type=date], input[type=time], input[type=file], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 14px; font-family: inherit; background: var(--input-bg); color: var(--text);
}
textarea { min-height: 70px; resize: vertical; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
/* A long wrapped label used to squeeze the checkbox into a tiny dot on a phone (a flex
   child shrinks by default). The box now keeps a fixed, tappable size and the label wraps beside it,
   top-aligned so a multi-line label doesn't float the box to its middle. */
.checkbox-row { display: flex; align-items: flex-start; gap: 10px; }
.checkbox-row input[type="checkbox"], .checkbox-row input[type="radio"] { flex: 0 0 auto; width: 18px; height: 18px; min-width: 18px; margin: 2px 0 0; accent-color: var(--accent); }
.checkbox-row label { flex: 1 1 auto; min-width: 0; line-height: 1.4; }
.checkbox-list { display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow-y: auto; border: 1px solid var(--border); border-radius: 6px; padding: 10px; }
.checkbox-list .checkbox-row { font-size: 13.5px; }

/* Visually grouped sections on long forms (asset_new.php / asset_edit.php): each
   logical group of fields (What was purchased / Purchase details / Location & condition / etc.)
   gets its own bordered, numbered panel instead of just a bare <h2> on an otherwise flat page —
   the fields inside still use the existing .form-row grid unchanged. */
.form-section {
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--muted-bg);
  padding: 16px 18px 4px; margin-bottom: 18px;
}
.form-section-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 14px; }
.form-section-num {
  flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%; background: var(--accent);
  color: #fff; font-size: 12.5px; font-weight: 700; display: flex; align-items: center;
  justify-content: center; margin-top: 1px;
}
.form-section-head h2 { margin: 0; font-size: 15.5px; }
.form-section-head .subtitle { margin: 2px 0 0; }
.form-section .form-row, .form-section > .field { background: var(--surface); border-radius: 6px; padding: 12px 14px 2px; border: 1px solid var(--border); }

/* an earlier release pass — field-picker groups (asset_export.php's column chooser, and any other
   "tick which fields" checkbox set): a defined group card with a hover tint per option, instead
   of bare labels floating on the page, so a long list of checkboxes reads as one cohesive picker. */
.field-picker-group {
  border: 1px solid var(--border); border-radius: 6px; padding: 12px 14px; background: var(--bg);
}
.field-picker-group > label { text-transform: uppercase; font-size: 12px; letter-spacing: .03em; color: var(--text-2); }
.field-picker-option {
  display: inline-flex; align-items: center; gap: 6px; font-weight: normal; width: auto;
  padding: 3px 8px; border-radius: 5px; transition: background-color .1s ease;
}
.field-picker-option:hover { background: var(--muted-bg); }

/* Visual feedback matching the server-side uppercase normalization in up() — what's stored
   is always uppercase, so what you see while typing should match. Password fields are
   explicitly excluded: uppercasing a credential's display would be actively misleading. */
input[type="text"], input[type="email"], input[type="search"], input:not([type]), textarea {
  text-transform: uppercase;
}
input[type="password"] { text-transform: none; }

.btn, .btn-secondary, .btn-danger {
  transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease, transform .05s ease;
}
.btn {
  display: inline-block; padding: 8px 16px; border-radius: 6px; border: 1px solid var(--accent);
  background: var(--accent); color: #fff; font-size: 13.5px; font-weight: 600; cursor: pointer;
}
.btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); text-decoration: none; }
.btn:active, .btn-secondary:active, .btn-danger:active { transform: translateY(1px); }
.btn-secondary { background: var(--btn-secondary-bg); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--muted-bg); border-color: #c7cdd2; }
.btn-danger { background: var(--bad-solid); border-color: var(--bad-solid); }
.btn-danger:hover { background: #9a2a27; border-color: #9a2a27; }
.btn-sm { padding: 4px 10px; font-size: 12.5px; }
.btn:focus-visible, .btn-secondary:focus-visible, .btn-danger:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; /* consistent, visible keyboard-focus ring across the app */
}
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
/* .actions rows mix real buttons/links with plain informational text (e.g.
   asset_view.php's "Currently issued — use Revoke below" note). Without an explicit align-items,
   flex's default (stretch) let that text sit top-aligned in a taller box while buttons stayed
   vertically centered — the row LOOKED like its items weren't on the same line even though they
   technically were. Explicit center fixes every .actions row app-wide, not just this one page. */
.actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* No flex-wrap here meant the Setup tabs row (15 links on setup_categories.php
   and friends) simply ran off the right edge on any normal desktop width instead of wrapping —
   flex's default is nowrap. Wrapping onto a second/third line reads far better than either an
   overflowing row or a horizontal scrollbar for a list this long; the max-width:640px override
   below switches back to a horizontal-scroll strip, which suits a phone-width tab bar better. */
.tabs { display: flex; flex-wrap: wrap; gap: 4px 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.tabs a { padding: 8px 14px; font-size: 13.5px; color: var(--text-2); border-bottom: 2px solid transparent; }
.tabs a.active { color: var(--accent-text); border-bottom-color: var(--accent); font-weight: 600; }

/* Searchable picker list — a
   clear left-border + tint + checkmark on the selected row, so it's obvious at a glance what's
   selected vs. just hovered, instead of the previous barely-there background-only highlight. */
.picker-list { max-height: 240px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.picker-option {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; cursor: pointer; border-bottom: 1px solid var(--border);
  border-left: 3px solid transparent; transition: background-color .1s ease, border-left-color .1s ease;
}
.picker-option:last-child { border-bottom: none; }
.picker-option:hover { background: var(--muted-bg); }
.picker-option.is-selected { background: var(--accent-bg); border-left-color: var(--accent); }
.picker-option .picker-main { line-height: 1.4; }
.picker-option .picker-main { color: var(--text); }
.picker-option .picker-check { color: var(--accent-text); font-weight: 700; font-size: 15px; visibility: hidden; flex-shrink: 0; }
.picker-option.is-selected .picker-check { visibility: visible; }
.picker-selected-label { margin: 8px 0 0; font-size: 13.5px; color: var(--text-2); }
.picker-selected-label.has-selection { color: var(--accent-text); font-weight: 600; }

/* The shared "link a ticket to continue" popup used by every asset action
   (Issue / Tag / Untag / Revoke). A native <dialog> — no JS modal library needed — styled to
   match the app's existing .card look, with its own dimmed ::backdrop. */
.ticket-link-dialog {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px;
  width: min(520px, 92vw); box-shadow: 0 16px 40px rgba(13,58,115,.16); color: var(--text);
}
.ticket-link-dialog::backdrop { background: rgba(20,26,32,.45); }
.ticket-link-dialog #ticketLinkSearch { margin-bottom: 8px; }
.ticket-link-dialog .dialog-actions {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 16px; flex-wrap: wrap; gap: 10px;
}
.ticket-link-dialog .form-row { display: flex; flex-direction: column; gap: 8px; margin: 14px 0 0; }
.ticket-link-dialog #ticketLinkSelectedLabel { padding: 8px 10px; border-radius: 6px; background: var(--muted-bg); }
.ticket-link-dialog #ticketLinkSelectedLabel.has-selection { background: var(--accent-bg); }

/* Small inline edit icon next to a read-only Details row (currently just the
   Employee row on ticket_view.php) that opens a .ticket-link-dialog-style popup picker instead of
   a permanently-open form. Reuses the same native-<dialog> look as .ticket-link-dialog above. */
.btn-icon-edit {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; margin-left: 6px; padding: 0;
  border: 1px solid var(--border); border-radius: 5px; background: var(--muted-bg);
  color: var(--accent-text); font-size: 12px; line-height: 1; cursor: pointer; vertical-align: middle;
}
.btn-icon-edit:hover { background: var(--accent-bg); }

.checklist-item { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.checklist-item .step-no { width: 22px; color: var(--text-2); font-size: 12.5px; }
.login-wrap { max-width: 360px; margin: 80px auto; }
.login-wrap .card { padding: 28px 26px; }
.mono { font-family: Consolas, monospace; font-size: 13px; }
.text-muted { color: var(--text-2); }
.center-page { max-width: 480px; margin: 60px auto; text-align: center; }
.dev-credit { max-width: 1200px; margin: -20px auto 20px; padding: 0 20px 20px; text-align: center; font-size: 12px; color: var(--text-2); }

/* Honeypot field (login.php and any other public form that adds one) — positioned
   off-screen rather than display:none, since some bots skip fields hidden that way but still
   fill in ones that are merely moved out of the visible viewport. Real visitors never see or
   tab into it (tabindex="-1" on the input itself). */
.hp-field { position: absolute; left: -9999px; top: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Site-wide "please wait" overlay, shown automatically while any real POST form
   (asset/ticket saves, OTP send, bulk import upload, etc.) is submitting — see the submit
   handler in app.js. Covers the gap between clicking a button and the next page actually
   loading, so a slow save or a multi-second file upload doesn't look like the site froze. */
.loading-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(28, 34, 38, 0.45);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.15s ease;
}
.loading-overlay.is-active { opacity: 1; pointer-events: auto; }
.loading-overlay .loading-box {
  background: var(--surface); border-radius: var(--radius);
  padding: 22px 28px; display: flex; align-items: center; gap: 14px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
}
.loading-overlay .spinner {
  width: 24px; height: 24px; flex-shrink: 0;
  border: 3px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.7s linear infinite;
}
.loading-overlay .loading-text { color: var(--text); font-size: 14.5px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .loading-overlay .spinner { animation-duration: 1.6s; }
}

/* .picker-option rows (the "type to search, click to pick" widgets used for
   dependent-tagging, ticket-linking, and the employee/asset pickers) are plain divs with no
   native keyboard support of their own — each one now carries tabindex="0" in its markup (or
   has it added by app.js for the ticket-link dialog) so Tab actually reaches them, and this
   gives that keyboard focus the same visible ring as every other focusable control. */
.picker-option:focus-visible {
  outline: 2px solid var(--accent); outline-offset: -2px;
}

/* Real pagination on Assets (assets.php) — Prev/Next + numbered pages, styled like
   the existing .tabs links so it doesn't need any new visual language. */
.pagination { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 14px 0; }
.pagination a, .pagination span.current, .pagination span.ellipsis {
  display: inline-block; min-width: 30px; text-align: center; padding: 6px 10px;
  border: 1px solid var(--border); border-radius: 6px; font-size: 13px;
}
.pagination a { color: var(--text); background: var(--surface); }
.pagination a:hover { background: var(--muted-bg); text-decoration: none; }
.pagination span.current { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }
.pagination span.ellipsis { border: none; color: var(--text-2); padding: 6px 2px; }
.pagination-summary { color: var(--text-2); font-size: 13px; margin: 14px 0 6px; }

/* IT Operations Command Center dashboard charts. Hand-rolled inline SVG, no
   charting library (see includes/charts.php for why) — these classes are what give the raw
   <svg> markup those functions emit its actual look. */
.dash-grid { stroke: var(--border); stroke-width: 1; }
.dash-axis-label { fill: var(--text-2); font-size: 10px; }
.dash-line { stroke-width: 2.5; }
.dash-line-created { stroke: var(--accent); }
.dash-line-resolved { stroke: var(--good); }
.dash-dot { stroke: var(--surface); stroke-width: 1.5; }
.dash-dot-created { fill: var(--accent); }
.dash-dot-resolved { fill: var(--good); }
.dash-chart-legend { display: flex; gap: 18px; font-size: 12.5px; color: var(--text-2); margin: 4px 0 10px; }
.dash-chart-legend .dash-swatch { margin-right: 5px; }

.dash-donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.dash-legend { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.dash-legend li { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.dash-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
/* Clickable donut wedges/legend rows (svg_donut_chart's optional 'link'). */
.dash-donut a { cursor: pointer; }
.dash-donut a path { transition: opacity .12s ease; }
.dash-donut a:hover path, .dash-donut a:focus path { opacity: .8; }
.dash-legend-link { display: inline-flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; border-radius: 4px; margin: -3px -4px; padding: 3px 4px; }
.dash-legend-link:hover, .dash-legend-link:focus { background: var(--muted-bg); text-decoration: none; }

.dash-hbars { display: flex; flex-direction: column; gap: 10px; }
.dash-hbar-row { display: grid; grid-template-columns: 130px 1fr auto; align-items: center; gap: 10px; }
.dash-hbar-label { font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-hbar-track { background: var(--muted-bg); border-radius: 6px; height: 14px; overflow: hidden; }
.dash-hbar-fill { display: block; height: 100%; border-radius: 6px 0 0 6px; }
.dash-hbar-value { font-size: 12.5px; color: var(--text-2); min-width: 34px; text-align: right; }

.dash-insights { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.dash-insights li { padding: 10px 12px; border-radius: var(--radius); border-left: 3px solid var(--border); font-size: 13.5px; }
.dash-insights li.sev-bad  { background: var(--bad-bg);  border-left-color: var(--bad);  color: var(--bad); }
.dash-insights li.sev-warn { background: var(--warn-bg); border-left-color: var(--warn); color: var(--warn); }
.dash-insights li.sev-info { background: var(--info-bg); border-left-color: var(--info); color: var(--info); }
.dash-insights li.sev-good { background: var(--good-bg); border-left-color: var(--good); color: var(--good); }

.dash-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 860px) { .dash-grid-2 { grid-template-columns: 1fr; } }

/* Page-size selector shared by assets.php and tickets.php pagination. now a
   <form> element (was a <span> with an inline onchange handler) — inline-flex renders the same
   either way, no change needed here. */
.page-size-select { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); }
.page-size-select select { padding: 4px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; }

/* Unified single-line pagination bar (pagination_bar in includes/functions.php):
   summary + per-page selector + page links side by side in one bordered strip with dividers,
   instead of a bare paragraph stacked above a separate <nav> (which forced two lines even on a
   wide screen). Wraps to multiple lines only when the viewport is genuinely too narrow. */
.pager-bar { display: flex; align-items: center; flex-wrap: wrap; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); margin: 14px 0; }
.pager-seg { display: flex; align-items: center; gap: 8px; padding: 8px 14px; font-size: 13px; color: var(--text-2); border-left: 1px solid var(--border); }
.pager-seg:first-child { border-left: none; }
.pager-summary { flex: 1 1 auto; min-width: 160px; }
/* "Show [ ] per page" was wrapping onto 3 lines (Show / the
   select / "per page") whenever this segment's row got narrow, since the form's text nodes and
   the <select> had nothing keeping them together. flex-shrink:0 stops the segment itself from
   being squeezed, and the inline-flex form (nowrap by default) keeps "Show", the dropdown, and
   "per page" on one line no matter the width — wrapping to its own full-width row inside
   .pager-bar on a narrow screen is fine; wrapping internally is what this fixes. */
.pager-size { flex-shrink: 0; white-space: nowrap; }
.pager-size form { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.pager-size select { padding: 4px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; }
.pager-nav { flex-wrap: wrap; }

/* Profile.php redesign. The old page put Details/Certifications/Leave in a
   3-up .card-grid (auto-fit, minmax(220px,1fr)) — fine for small stat tiles, but each of those
   three held a full form or table, so on a normal screen width every column was squeezed down to
   ~220px and content clipped/overflowed. Fixed with a real social-profile-style header (cover
   strip + overlapping avatar + identity/rating) followed by the same three sections stacked
   full-width — no more forcing them into side-by-side columns. */
.profile-header { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: var(--surface); margin-bottom: 16px; }
.profile-cover {
  height: 84px;
  background: linear-gradient(120deg, var(--accent-dark), var(--accent) 70%);
  position: relative;
}
/* R51.1 — position + z-index: the cover strip is a positioned box, so it was painted OVER the avatar and cut off the
   top of the profile photo. The identity row now sits above the cover, so the whole round photo shows. */
.profile-identity { display: flex; align-items: flex-end; gap: 16px; padding: 0 20px 16px; margin-top: -40px; position: relative; z-index: 1; }
.profile-avatar {
  width: 88px; height: 88px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
  border: 4px solid var(--surface); background: var(--accent-bg); color: var(--accent-dark);
  display: flex; align-items: center; justify-content: center; font-size: 30px; font-weight: 700;
}
.profile-identity-text { padding-top: 44px; min-width: 0; }
.profile-identity-text h1 { margin: 0 0 2px; font-size: 20px; }
.profile-identity-text .profile-role { color: var(--text-2); font-size: 13.5px; margin: 0 0 6px; }
.profile-rating-inline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13.5px; }
.profile-rating-inline .stars-good { color: var(--warn); }
.profile-rating-inline .stars-empty { color: var(--border); }
.profile-stack { display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 560px) {
  .profile-identity { flex-direction: column; align-items: flex-start; gap: 10px; }
  .profile-identity-text { padding-top: 0; }
}
.pager-nav .pagination { margin: 0; }

/* Show/hide (eye) toggle + a live strength meter for password fields, starting
   with change_password.php. The toggle needs its input's type flipped to "text" to reveal the
   value — but the app-wide rule a few lines up (search this file for "text-transform: uppercase")
   uppercases the ON-SCREEN text of every input[type="text"] to visually match the server-side up()
   normalization, and a password is deliberately exempted from that (input[type="password"] {
   text-transform: none; }). Flip a password field to type="text" without accounting for this and
   the reveal would show a case-garbled password that isn't what's actually stored — actively
   misleading for the one feature whose whole job is showing the real value. The two selectors
   below win on specificity (an added class beats a bare attribute selector) regardless of the
   toggle's current type, so a revealed password's case always matches what's really in the field. */
.password-field-wrap { position: relative; }
.password-field-wrap input[type="password"],
.password-field-wrap input[type="text"] {
  width: 100%; padding-right: 58px; text-transform: none;
}
.password-toggle-btn {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--accent-text); font-size: 12px; font-weight: 600;
  cursor: pointer; padding: 5px 8px; border-radius: 4px;
}
.password-toggle-btn:hover { background: var(--muted-bg); text-decoration: underline; }

.password-strength-bar { height: 6px; border-radius: 3px; background: var(--border); overflow: hidden; margin-top: 7px; }
.password-strength-fill { height: 100%; width: 0; background: var(--bad); transition: width .15s ease, background-color .15s ease; }
.password-strength-fill.tone-weak { background: var(--bad); }
.password-strength-fill.tone-fair { background: var(--warn); }
.password-strength-fill.tone-strong { background: var(--good); }
.password-strength-label { font-size: 11.5px; color: var(--text-2); margin-top: 4px; }
.password-strength-label.tone-weak { color: var(--bad); }
.password-strength-label.tone-fair { color: var(--warn); }
.password-strength-label.tone-strong { color: var(--good); }

/* ---------------------------------------------------------------------
   Travel / Site-Visit Claims. Built phone-first: big touch fields (16px text so phones do
   not zoom on focus), full-width buttons in the visit form, stacked cards for visit rows.
   --------------------------------------------------------------------- */
.tv-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.tv-month { display: flex; gap: 6px; align-items: center; }
.tv-month-form { margin: 0; }
.tv-month input[type="month"] { min-height: 38px; }
.tv-tiles { margin-bottom: 14px; }
.tv-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.tv-form { max-width: 760px; }
.tv-form input[type="text"], .tv-form input[type="date"], .tv-form input[type="time"], .tv-form select, .tv-form input[type="file"] { min-height: 44px; font-size: 16px; width: 100%; box-sizing: border-box; }
.tv-form input[type="text"] { text-transform: none; }
.tv-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.tv-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--accent-bg); border: 1px solid var(--border); border-radius: 999px; padding: 4px 6px 4px 10px; font-size: 13px; }
.tv-chip-x { border: none; background: none; font-size: 18px; line-height: 1; cursor: pointer; color: var(--text-2); padding: 2px 6px; }
.tv-warnings .alert { margin: 0 0 8px; }
.tv-save-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.tv-trip { margin-bottom: 10px; }
.tv-trip.is-rejected { opacity: .65; }
.tv-trip-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 14px; margin-bottom: 4px; }
.tv-trip-route { font-weight: 600; }
.tv-trip-purpose, .tv-trip-ticket, .tv-trip-detail, .tv-trip-receipts, .tv-trip-flags { margin-top: 5px; font-size: 13.5px; }
.tv-decide { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.tv-decide input[type="text"] { flex: 1 1 220px; min-height: 38px; }
.tv-review-bar { margin-bottom: 12px; }
.tv-legs { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }
.tv-leg { display: grid; grid-template-columns: 56px 1fr 1fr 150px 110px auto; gap: 8px; align-items: center; border: 1px solid var(--border); border-radius: 8px; padding: 10px; }
.tv-leg-no { font-weight: 600; font-size: 13px; color: var(--text-2); align-self: center; }
.tv-leg-foot { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; margin-bottom: 12px; }
.tv-leg-sum { font-weight: 600; font-variant-numeric: tabular-nums; }
.tv-leg-line { font-size: 13px; margin-top: 2px; }
.tv-leg-x { min-height: 38px; }
@media (max-width: 640px) {
  .tv-form .btn, .tv-actions .btn, .tv-save-row .btn { flex: 1 1 100%; text-align: center; min-height: 46px; }
  .tv-decide .btn { flex: 1 1 30%; min-height: 44px; }
  .tv-toolbar .actions .btn { flex: 1 1 auto; }
  .tv-leg { grid-template-columns: 1fr 1fr; }
  .tv-leg-no { grid-column: 1 / -1; }
  .tv-leg > :nth-child(2), .tv-leg > :nth-child(3) { grid-column: 1 / -1; }
  .tv-leg-x { grid-column: 1 / -1; }
}

/* QR basket bar + "in basket" tag */
.qrb-chip { position: relative; flex-shrink: 0; }
.qrb-chip[hidden] { display: none; }
.qrb-chip-btn { background: var(--accent-bg); color: var(--accent-text); border: 1px solid transparent; border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.qrb-chip-btn:hover { border-color: var(--accent); }
.qrb-chip-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.qrb-badge { background: var(--accent); color: #fff; border-radius: 999px; min-width: 20px; padding: 0 6px; text-align: center; font-size: 12px; line-height: 20px; }
.qrb-pop { position: absolute; right: 0; top: calc(100% + 10px); z-index: 60; background: var(--surface, #fff); color: var(--ink, #1b2430); border: 1px solid var(--border, #d8dee4); border-radius: 10px; padding: 12px 14px; box-shadow: 0 8px 24px rgba(0,0,0,.2); min-width: 250px; }
.qrb-pop[hidden] { display: none; }
.qrb-pop .qrb-count { font-weight: 600; font-size: 13.5px; margin-bottom: 10px; }
.qrb-pop-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.qrb-tag { display: block; margin: 3px 0 0; font-size: 10px; line-height: 1.2; padding: 1px 6px; border-radius: 999px; background: var(--accent-bg, #e8eef5); color: var(--accent, #17529e); white-space: nowrap; width: max-content; }
.qrb-msg { font-size: 13px; color: var(--accent, #17529e); margin-left: 6px; }
@media (max-width: 860px) { .qrb-chip { margin-left: 0; } .qrb-chip-btn { padding: 5px 10px; } .qrb-chip-word { display: none; } }
@media print { .qrb-chip { display: none !important; } }

/* Decided visits collapse to one line on the approval page */
.tv-redecide { margin-top: 8px; }
.tv-redecide > summary { cursor: pointer; font-weight: 600; font-size: 13.5px; list-style: none; padding: 6px 0; }
.tv-redecide > summary::-webkit-details-marker { display: none; }
.tv-redecide .tv-redecide-link { color: var(--accent, #17529e); text-decoration: underline; font-weight: 500; }
.tv-final-bar { margin-bottom: 12px; }

/* Duplicate-receipt warnings and the super-admin's "remove this visit" */
.tv-rcpt-alert { margin-top: 8px; padding: 8px 10px; border-radius: 6px; font-size: 13px; background: var(--bad-bg); color: var(--bad); }
.tv-rcpt-alert.is-similar { background: var(--warn-bg); color: var(--warn); }
.tv-rcpt-alert a { margin-left: 6px; text-decoration: underline; color: inherit; }
.tv-remove { margin-top: 10px; }
.tv-remove > summary { cursor: pointer; font-size: 13px; color: var(--bad); }
.tv-rcpt-badge { display: inline-block; margin-top: 3px; }

/* Original-email popup (ticket_view.php, assets/js/eml_viewer.js). A native <dialog>; full-screen on phones. */
.eml-dialog { border: 1px solid var(--border); border-radius: var(--radius); padding: 0; width: min(880px, 94vw); height: min(86vh, 900px); max-height: 94vh; box-shadow: 0 18px 48px rgba(13,58,115,.22); color: var(--text); background: var(--surface); overflow: hidden; }
.eml-dialog[open] { display: flex; flex-direction: column; }
.eml-dialog::backdrop { background: rgba(20,26,32,.5); }
.eml-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 14px 18px 8px; border-bottom: 1px solid var(--border); }
.eml-kicker { display: block; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-2); }
.eml-head h3 { margin: 2px 0 0; font-size: 18px; line-height: 1.3; overflow-wrap: anywhere; }
.eml-x { border: 0; background: transparent; font-size: 28px; line-height: 1; cursor: pointer; color: var(--text-2); padding: 0 4px; }
.eml-x:hover { color: var(--text); }
.eml-meta { padding: 8px 18px 4px; font-size: 13.5px; max-height: 26vh; overflow: auto; }
.eml-row { display: flex; gap: 10px; padding: 2px 0; }
.eml-row > span { flex: 0 0 64px; color: var(--text-2); }
.eml-row > div { overflow-wrap: anywhere; min-width: 0; }
.eml-err { color: var(--bad, #b3261e); margin: 6px 0; }
.eml-atts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 6px 18px; }
.eml-atts[hidden] { display: none; }
.eml-atts-label { font-size: 12px; color: var(--text-2); }
.eml-chip { display: inline-flex; gap: 6px; align-items: center; padding: 3px 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--muted-bg); color: var(--accent-text); text-decoration: none; font-size: 13px; max-width: 100%; overflow-wrap: anywhere; }
.eml-chip small { color: var(--text-2); }
.eml-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 8px 18px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); font-size: 13px; background: var(--muted-bg); }
.eml-seg { display: inline-flex; border: 1px solid var(--border); border-radius: 7px; overflow: hidden; }
.eml-seg button { border: 0; background: var(--surface); color: var(--text); padding: 4px 12px; cursor: pointer; font: inherit; }
.eml-seg button.is-on { background: var(--accent); color: #fff; }
.eml-imgnote[hidden] { display: none; }
.eml-link { border: 0; background: none; color: var(--accent-text); text-decoration: underline; cursor: pointer; font: inherit; padding: 0; }
.eml-dl { margin-left: auto; color: var(--accent-text); }
.eml-frame { flex: 1 1 auto; width: 100%; min-height: 200px; border: 0; background: #fff; }
.eml-lock { overflow: hidden; }
@media (max-width: 640px) {
  .eml-dialog { width: 100vw; max-width: 100vw; height: 100vh; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; border: 0; }
  .eml-row { flex-direction: column; gap: 0; } .eml-row > span { flex: none; font-size: 12px; }
  .eml-dl { margin-left: 0; }
}

/* "master information" confirmation cards (Add Asset item type, Issue, Tag pickers). */
.master-card-slot { margin-top: 10px; }
.master-card { border: 1px solid var(--border); border-left: 4px solid var(--accent); background: var(--accent-bg); border-radius: 8px; padding: 10px 14px; }
.mc-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.mc-title { font-weight: 700; color: var(--text); overflow-wrap: anywhere; }
.mc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 4px 20px; }
.mc-row { display: flex; gap: 10px; font-size: 13.5px; padding: 3px 0; border-bottom: 1px dashed var(--border); }
.mc-k { flex: 0 0 120px; color: var(--text-2); }
.mc-v { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; color: var(--text); }
.mc-note { margin: 8px 0 0; font-size: 12.5px; color: var(--text-2); }
.mc-loading { margin: 0; font-size: 13px; color: var(--text-2); }
.master-card + form.card, .master-card { margin-bottom: 14px; }
.master-card-slot .master-card { margin-bottom: 0; }
@media (max-width: 520px) { .mc-k { flex-basis: 96px; } }

/* =====================================================================================================
   Travel redesign ("tw-" = travel workspace). Plain list views, a 4-step progress line,
   one receipt box per journey row, decision buttons per entry. Colours come only from the tokens above
   so the dark theme works unchanged.
   ===================================================================================================== */
.tw-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 10px 16px; margin-bottom: 14px; }
.tw-head h1 { margin: 0; }
.tw-head .subtitle { margin: 4px 0 0; }
.tw-head-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.tw-flow { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; padding: 0; list-style: none; counter-reset: twflow; }
.tw-flow li { counter-increment: twflow; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 5px 12px 5px 6px; }
.tw-flow li::before { content: counter(twflow); display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--accent-bg); color: var(--accent-text); font-weight: 700; font-size: 11.5px; }
.tw-flow li.is-done { color: var(--good); border-color: var(--good-bg); }
.tw-flow li.is-done::before { content: "✓"; background: var(--good-bg); color: var(--good); }
.tw-flow li.is-now { color: var(--text); font-weight: 600; border-color: var(--accent); }
.tw-flow li.is-now::before { background: var(--accent); color: #fff; }
.tw-flow li.is-warn { color: var(--warn); border-color: var(--warn); font-weight: 600; }
.tw-flow li.is-warn::before { content: "!"; background: var(--warn-bg); color: var(--warn); }
.tw-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 16px; }
.tw-sum { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; display: block; color: inherit; text-decoration: none; }
a.tw-sum:hover { border-color: var(--accent); }
.tw-sum .n { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tw-sum .l { font-size: 12.5px; color: var(--text-2); }
.tw-sum.is-warn { border-left: 3px solid var(--warn); }
.tw-sum.is-good { border-left: 3px solid var(--good); }
.tw-sum.is-info { border-left: 3px solid var(--accent); }
.tw-scope { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--surface); }
.tw-scope a { padding: 7px 14px; font-size: 13px; color: var(--text-2); border-right: 1px solid var(--border); text-decoration: none; }
.tw-scope a:last-child { border-right: none; }
.tw-scope a.active { background: var(--accent); color: #fff; font-weight: 600; }
.tw-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin: 0 0 12px; }
.tw-filters .field { margin: 0; min-width: 130px; }
.tw-filters label { font-size: 12px; }
.tw-filters input, .tw-filters select { min-height: 36px; }
.tw-filters .grow { flex: 1 1 180px; }
.tw-bar { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.tw-table td { vertical-align: top; }
.tw-table .num, .tw-table th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tw-table .route { font-weight: 600; }
.tw-table .sub { font-size: 12.5px; color: var(--text-2); margin-top: 2px; }
.tw-table tr.is-dim td { opacity: .6; }
.tw-table tfoot th { text-align: right; }
.tw-progress { display: flex; flex-wrap: wrap; gap: 4px; }
.tw-empty { text-align: center; padding: 28px 16px; color: var(--text-2); }
.tw-empty strong { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }
.tw-help { margin: 0 0 16px; }
.tw-help > summary { cursor: pointer; font-size: 13px; color: var(--accent-text); }
.tw-help ol { margin: 8px 0 0; padding-left: 20px; font-size: 13.5px; color: var(--text-2); }
.tw-help ol li { margin-bottom: 4px; }
/* entry form: one card per journey row, receipt box inside the row */
.tw-journeys { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }
.tw-journey { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: var(--surface); }
.tw-journey-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.tw-journey-no { font-weight: 700; font-size: 13px; color: var(--text-2); }
.tw-journey-grid { display: grid; grid-template-columns: 1fr 1fr 160px 120px; gap: 8px; }
.tw-journey-rcpt { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border); display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 13px; }
.tw-journey-rcpt input[type="file"] { min-height: 0 !important; font-size: 13px !important; width: auto !important; max-width: 100%; }
.tw-journey-rcpt .need { color: var(--warn); font-weight: 600; }
.tw-journey-rcpt .have { color: var(--good); font-weight: 600; }
.tw-rfile { display: inline-flex; align-items: center; gap: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 2px 4px 2px 8px; }
.tw-rfile button { border: none; background: none; color: var(--bad); cursor: pointer; font-size: 15px; line-height: 1; padding: 2px 4px; }
.tw-x { border: none; background: none; color: var(--text-2); cursor: pointer; font-size: 13px; text-decoration: underline; }
.tw-total { font-weight: 700; font-variant-numeric: tabular-nums; }
/* claim page */
.tw-claim-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 16px; align-items: flex-start; margin-bottom: 12px; }
.tw-claim-head h1 { margin: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tw-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13.5px; color: var(--text-2); margin-top: 4px; }
.tw-meta b { color: var(--text); font-weight: 600; }
.tw-callout { border-radius: var(--radius); padding: 12px 14px; margin-bottom: 14px; border: 1px solid var(--border); background: var(--surface); display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; }
.tw-callout.is-info { border-left: 4px solid var(--accent); }
.tw-callout.is-warn { border-left: 4px solid var(--warn); background: var(--warn-bg); }
.tw-callout.is-good { border-left: 4px solid var(--good); background: var(--good-bg); }
.tw-callout .msg { flex: 1 1 320px; font-size: 14px; }
.tw-callout .msg strong { display: block; margin-bottom: 2px; }
.tw-callout form { margin: 0; }
.tw-day { margin-bottom: 14px; }
.tw-day-head { font-weight: 700; font-size: 13.5px; color: var(--text-2); margin: 0 0 6px; display: flex; justify-content: space-between; }
.tw-entry { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 8px; }
.tw-entry.st-approved { border-left: 4px solid var(--good); }
.tw-entry.st-rejected { border-left: 4px solid var(--bad); }
.tw-entry.st-returned, .tw-entry.st-queried { border-left: 4px solid var(--warn); }
.tw-entry.st-pending { border-left: 4px solid var(--accent); }
.tw-entry-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; align-items: baseline; }
.tw-entry-top .amt { font-weight: 700; font-variant-numeric: tabular-nums; }
.tw-entry-legs { margin: 6px 0 0; padding: 0; list-style: none; font-size: 13px; }
.tw-entry-legs li { display: flex; flex-wrap: wrap; gap: 4px 10px; padding: 3px 0; border-top: 1px dotted var(--border); }
.tw-entry-legs li:first-child { border-top: none; }
.tw-entry-legs .lfare { margin-left: auto; font-variant-numeric: tabular-nums; }
.tw-entry-legs a { font-size: 12.5px; }
.tw-entry-note { font-size: 13px; margin-top: 6px; }
.tw-entry-note.is-hod { padding: 6px 10px; border-radius: 6px; background: var(--warn-bg); color: var(--warn); }
.tw-entry-note.is-hod.is-bad { background: var(--bad-bg); color: var(--bad); }
.tw-decide { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.tw-decide input[type="text"] { flex: 1 1 220px; min-height: 36px; }
.tw-decide .btn-good { background: var(--good); border-color: var(--good); color: #fff; }
.tw-hist { font-size: 13px; }
.tw-hist summary { cursor: pointer; font-weight: 600; margin-bottom: 8px; }
.tw-kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; font-size: 14px; }
.tw-kv dt { color: var(--text-2); }
.tw-kv dd { margin: 0; }
@media (max-width: 640px) {
  .tw-journey-grid { grid-template-columns: 1fr 1fr; }
  .tw-journey-grid > :nth-child(1), .tw-journey-grid > :nth-child(2) { grid-column: 1 / -1; }
  .tw-head-actions .btn, .tw-callout .btn { flex: 1 1 auto; text-align: center; }
  .tw-decide .btn { flex: 1 1 30%; min-height: 42px; }
  .tw-kv { grid-template-columns: 1fr; }
  .tw-scope { width: 100%; } .tw-scope a { flex: 1; text-align: center; }
}
@media print { .tw-head-actions, .tw-filters, .tw-scope, .tw-decide, .tw-help { display: none !important; } }
.tw-claim-head h1 .mono { font-size: 22px; }


/* =====================================================================================================
   R52 — NEW LOOK: the frame around every page.
   Desktop ("Look A"): a white menu down the left (narrow icons-only version on request or on tablets), a light
   header with greeting, Light/Dark switch, Help, bell and your name menu. Phones: an app-style header (page title +
   bell + photo) and a bottom bar — Home · two main modules · big "+" · More.
   Colour theme (Indigo / Ocean / Lime / Brand colour) is picked in Setup > App Settings and set on <html
   data-palette>; Light/Dark stays a per-person choice. Font: Inter, stored with the app (assets/fonts, OFL licence).
   ===================================================================================================== */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/inter-400.woff") format("woff"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/inter-500.woff") format("woff"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/inter-600.woff") format("woff"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/inter-700.woff") format("woff"); }

:root { --radius: 10px; --sb-w: 240px; --sb-rail: 76px; --bb-h: 64px; --ab-h: 64px; }

/* Colour themes — page background, lines and text greys. The accent itself comes from includes/header.php. */
:root[data-palette="indigo"]:not([data-theme="dark"]) { --bg: #f5f6fa; --border: #e4e6ec; --text: #111827; --text-2: #565f70; --muted-bg: #eff1f5; --surface-2: #f7f8fb; --ink: #111827; }
:root[data-palette="ocean"]:not([data-theme="dark"])  { --bg: #eef4f8; --border: #dbe5ec; --text: #0f2433; --text-2: #4b5c69; --muted-bg: #e9f0f5; --surface-2: #f4f8fb; --ink: #0f2433; }
:root[data-palette="lime"]:not([data-theme="dark"])   { --bg: #f4f5f1; --border: #e1e4da; --text: #161a12; --text-2: #545b4c; --muted-bg: #eceee7; --surface-2: #f7f8f4; --ink: #161a12; }
:root[data-palette="indigo"][data-theme="dark"] { --bg: #0f1117; --surface: #171a23; --border: #272c3a; --surface-2: #1d2130; --input-bg: #11141c; --muted-bg: #20242f; --btn-secondary-bg: #1d2130; }
:root[data-palette="ocean"][data-theme="dark"]  { --bg: #0b1620; --surface: #112230; --border: #1f3446; --surface-2: #152a3a; --input-bg: #0d1b27; --muted-bg: #182c3c; --btn-secondary-bg: #152a3a; }
:root[data-palette="lime"][data-theme="dark"]   { --bg: #0f1115; --surface: #1a1d24; --border: #2a2f38; --surface-2: #20242c; --input-bg: #13161b; --muted-bg: #23272f; --btn-secondary-bg: #20242c; --accent-text: #a3e635; }

body { font-family: "Inter", "Segoe UI", -apple-system, system-ui, Arial, sans-serif; -webkit-font-smoothing: antialiased; }
.btn-link { color: var(--accent-text); text-decoration: underline; } /* was white (meant for the old navy bar) — "Reset" / "Cancel" links on the page were invisible */
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--surface); color: var(--text); padding: 8px 14px; border-radius: 8px; }
.skip-link:focus { left: 8px; }

/* Cards and controls: same structure, softer finish. */
.card { border-radius: 12px; box-shadow: 0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.03); }
.stat-tile, .tw-sum { border-radius: 12px; }
.btn, .btn-secondary, .btn-danger { border-radius: 8px; }
input[type=text], input[type=password], input[type=email], input[type=number], input[type=date], input[type=time], input[type=file], select, textarea { border-radius: 8px; }
.table-wrap { border-radius: 12px; background: var(--surface); }

/* ---- Frame ---- */
.shell { display: flex; min-height: 100vh; min-height: 100dvh; }
.shell-plain { display: block; }
.shell-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.page { max-width: 1280px; width: 100%; margin: 0 auto; padding: 8px 28px 60px; overflow-wrap: break-word; } /* a very long word (a file path, an AD path) wraps instead of pushing the page wider than the phone */
.no-shell .page { padding-top: 24px; }
.dev-credit { max-width: 1280px; margin: -24px auto 24px; padding: 0 28px; }
.ui-ico { flex: 0 0 auto; display: block; }
.avatar-initials { background: var(--accent-bg) !important; color: var(--accent-text) !important; } /* was white, made for the old navy bar */

/* Left menu */
.sidebar {
  position: sticky; top: 0; height: 100vh; height: 100dvh; width: var(--sb-w); flex: 0 0 auto;
  display: flex; flex-direction: column; gap: 4px; padding: 16px 12px 12px; overflow-y: auto; overflow-x: hidden;
  background: var(--surface); border-right: 1px solid var(--border); z-index: 40;
}
.sb-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; color: var(--text); text-decoration: none; min-width: 0; }
.sb-brand:hover { text-decoration: none; }
.sb-logo { display: flex; align-items: center; flex: 0 0 auto; max-width: 120px; }
.sb-logo img { width: auto; max-width: 120px; display: block; }
.sb-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: #fff; font-weight: 700; font-size: 17px; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.sb-name { font-weight: 700; font-size: 15px; line-height: 1.2; letter-spacing: -.01em; min-width: 0; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
/* R52.1 — with a logo, the app name was squeezed beside it and cut to "IT Suppor…". The name now sits on its own
   line under the logo, full width, and wraps instead of being cut. */
.sb-brand.has-logo { flex-direction: column; align-items: flex-start; gap: 6px; }
.sb-brand.has-logo .sb-logo { max-width: 100%; }
.sb-brand.has-logo .sb-logo img { max-width: 100%; }
.sb-brand.has-logo .sb-name { display: block; overflow: visible; font-size: 14px; color: var(--text-2); font-weight: 600; }
:root[data-sidebar="rail"] .sb-brand.has-logo .sb-name { display: none; }
@media (min-width: 861px) and (max-width: 1100px) { .sb-brand.has-logo .sb-name { display: none; } }
.sb-warn { display: flex; gap: 6px; align-items: center; margin: 0 4px 8px; padding: 6px 10px; border-radius: 8px; background: var(--bad-bg); color: var(--bad); font-size: 12px; font-weight: 600; }
.sb-new {
  display: flex; align-items: center; justify-content: center; gap: 8px; height: 42px; margin: 0 4px 10px;
  border: 0; border-radius: 10px; background: var(--accent); color: #fff; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 30%, transparent);
}
.sb-new:hover { background: var(--accent-dark); }
.sb-new:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.sb-nav { display: flex; flex-direction: column; gap: 2px; }
.sb-item {
  position: relative; display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 12px; border-radius: 10px;
  color: var(--text-2); font: inherit; font-size: 14px; font-weight: 500; text-decoration: none; background: none; border: 0; cursor: pointer; width: 100%; text-align: left;
}
.sb-item:hover { background: var(--muted-bg); color: var(--text); text-decoration: none; }
.sb-item.is-active { background: var(--accent-bg); color: var(--accent-text); font-weight: 600; }
.sb-item.is-active::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.sb-item[hidden] { display: none; }
.sb-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-count { margin-left: auto; background: var(--bad-solid); color: #fff; font-size: 11px; font-weight: 700; line-height: 1; border-radius: 999px; padding: 3px 7px; }
.sb-foot { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 2px; }

/* Narrow (icons only) menu: chosen with "Narrow menu", and always on tablets */
:root[data-sidebar="rail"] .sidebar { width: var(--sb-rail); padding-left: 10px; padding-right: 10px; }
:root[data-sidebar="rail"] .sb-label, :root[data-sidebar="rail"] .sb-name { display: none; }
:root[data-sidebar="rail"] .sb-brand, :root[data-sidebar="rail"] .sb-brand.has-logo { align-items: center; justify-content: center; padding-left: 0; padding-right: 0; }
:root[data-sidebar="rail"] .sb-logo { max-width: 52px; } :root[data-sidebar="rail"] .sb-logo img { max-width: 52px; }
:root[data-sidebar="rail"] .sb-item, :root[data-sidebar="rail"] .sb-new { justify-content: center; padding: 0; }
:root[data-sidebar="rail"] .sb-item.is-active::before { left: -10px; }
:root[data-sidebar="rail"] .sb-count { position: absolute; top: 3px; right: 4px; padding: 2px 5px; font-size: 10px; }
:root[data-sidebar="rail"] .sb-warn { justify-content: center; padding: 6px 0; }
@media (min-width: 861px) and (max-width: 1100px) {
  .sidebar { width: var(--sb-rail); padding-left: 10px; padding-right: 10px; }
  .sb-label, .sb-name, .sb-collapse { display: none; }
  .sb-brand, .sb-brand.has-logo { align-items: center; justify-content: center; padding-left: 0; padding-right: 0; }
  .sb-logo { max-width: 52px; } .sb-logo img { max-width: 52px; }
  .sb-item, .sb-new { justify-content: center; padding: 0; }
  .sb-item.is-active::before { left: -10px; }
  .sb-count { position: absolute; top: 3px; right: 4px; padding: 2px 5px; font-size: 10px; }
}

/* Header bar */
.appbar {
  position: sticky; top: 0; z-index: 50; min-height: var(--ab-h); display: flex; align-items: center; gap: 16px; padding: 10px 28px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px);
}
.ab-left { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; line-height: 1.25; }
.ab-greet { font-size: 16px; font-weight: 700; letter-spacing: -.01em; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ab-date { font-size: 12.5px; color: var(--text-2); }
.ab-title { display: none; }
.ab-right { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.ab-icon {
  position: relative; width: 40px; height: 40px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-2); background: transparent; border: 0; cursor: pointer; text-decoration: none;
}
.ab-icon:hover { background: var(--muted-bg); color: var(--text); text-decoration: none; }
.ab-icon.is-active { color: var(--accent-text); background: var(--accent-bg); }
.ab-icon:focus-visible, .ab-user-btn:focus-visible, .bb-item:focus-visible, .bb-fab:focus-visible, .sb-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ico-sun { display: none; } .theme-word-light { display: none; }
:root[data-theme="dark"] .ico-moon, :root[data-theme="dark"] .theme-word-dark { display: none; }
:root[data-theme="dark"] .ico-sun, :root[data-theme="dark"] .theme-word-light { display: inline; }
.notif-badge {
  background: var(--bad-solid); color: #fff; font-size: 10.5px; font-weight: 700; line-height: 1;
  border-radius: 999px; padding: 2px 5px; min-width: 16px; text-align: center; position: absolute; top: 4px; right: 3px;
  box-shadow: 0 0 0 2px var(--surface);
}
.ab-user { position: relative; margin-left: 6px; }
.ab-user-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 8px 0 4px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer;
}
.ab-user-btn:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.ab-user-name { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ab-chev { color: var(--text-2); }

/* Small menus (name menu, desktop "New" chooser) and phone sheets (the "+" chooser, More) */
.ui-pop {
  position: absolute; z-index: 70; background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: 0 16px 40px rgba(16,24,40,.18); padding: 6px;
}
.ui-pop[hidden], .ui-backdrop[hidden] { display: none; }
.ui-pop a, .ui-pop button[role="menuitem"] {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--text); text-decoration: none;
  background: none; border: 0; font: inherit; font-size: 14px; cursor: pointer; width: 100%; text-align: left;
}
.ui-pop a:hover, .ui-pop a:focus-visible, .ui-pop button[role="menuitem"]:hover, .ui-pop button[role="menuitem"]:focus-visible { background: var(--accent-bg); outline: none; text-decoration: none; }
.ui-pop a[hidden] { display: none; }
.ui-pop-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px 12px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.ui-pop-head span, .more-user span { display: flex; flex-direction: column; min-width: 0; }
.ui-pop-head small { color: var(--text-2); font-size: 12px; overflow: hidden; text-overflow: ellipsis; text-transform: lowercase; }
.ui-pop-title { padding: 8px 12px 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-2); font-weight: 600; }
.ab-user-menu { right: 0; top: calc(100% + 8px); width: 270px; }
.new-menu { position: fixed; width: 310px; }
.new-menu a strong { display: block; font-size: 14.5px; }
.new-menu a small { display: block; font-size: 12.5px; color: var(--text-2); }
.new-ico { flex: 0 0 42px; height: 42px; border-radius: 12px; background: var(--accent-bg); color: var(--accent-text); display: flex; align-items: center; justify-content: center; }
.ui-sheet-grip { display: none; }
.more-menu { display: none; }
.ui-backdrop { position: fixed; inset: 0; z-index: 65; background: rgba(10,14,22,.42); }

/* ---- Phones (860 px and narrower) ---- */
.bottombar { display: none; }
@media (max-width: 860px) {
  .sidebar { display: none; }
  .shell-main { overflow-x: clip; } /* safety net: one over-wide item must not widen the whole phone page (that pushed the bottom bar off screen); wide tables keep their own sideways scroll */
  .appbar {
    position: sticky; min-height: 0; padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 8px 16px; gap: 8px;
    background: var(--surface); border-bottom: 1px solid var(--border); -webkit-backdrop-filter: none; backdrop-filter: none;
  }
  .ab-greet, .ab-date, .ab-help, .ab-theme, .ab-user-name, .ab-chev { display: none; }
  .ab-title { display: block; font-size: 18px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ab-user { margin-left: 2px; }
  .ab-user-btn { height: 40px; padding: 0 2px; border: 0; background: none; }
  .page { padding: 14px 12px calc(var(--bb-h) + 36px + env(safe-area-inset-bottom, 0px)); }
  .dev-credit { margin: calc(-1 * (var(--bb-h) + 24px)) auto calc(var(--bb-h) + 24px + env(safe-area-inset-bottom, 0px)); padding: 0 12px; }

  .bottombar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
    align-items: stretch; height: calc(var(--bb-h) + env(safe-area-inset-bottom, 0px)); padding: 0 4px env(safe-area-inset-bottom, 0px);
    background: var(--surface); border-top: 1px solid var(--border); box-shadow: 0 -4px 16px rgba(16,24,40,.06);
  }
  .bb-item {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 0;
    color: var(--text-2); font: inherit; font-size: 11.5px; font-weight: 600; text-decoration: none; background: none; border: 0; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .bb-item > span:not(.notif-badge):not(.bb-dot) { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .bb-item:hover { text-decoration: none; color: var(--text); }
  .bb-item.is-active { color: var(--accent-text); }
  .bb-item.is-active .ui-ico { stroke-width: 2.2; }
  .bb-item .notif-badge { top: 6px; right: calc(50% - 22px); }
  .bb-dot { position: absolute; top: 9px; right: calc(50% - 14px); width: 9px; height: 9px; border-radius: 50%; background: var(--bad-solid); box-shadow: 0 0 0 2px var(--surface); }
  .bb-dot[hidden] { display: none; }
  .bb-fab-wrap { display: flex; align-items: flex-start; justify-content: center; }
  .bb-fab {
    margin-top: -20px; width: 58px; height: 58px; border-radius: 50%; border: 4px solid var(--surface); background: var(--accent); color: #fff;
    display: flex; align-items: center; justify-content: center; cursor: pointer; -webkit-tap-highlight-color: transparent;
    box-shadow: 0 8px 18px color-mix(in srgb, var(--accent) 45%, transparent); transition: transform .15s ease;
  }
  .bb-fab:active { transform: scale(.95); }
  .bb-fab[aria-expanded="true"] .ui-ico { transform: rotate(45deg); }
  .bb-fab .ui-ico { transition: transform .15s ease; }

  .ui-sheet {
    position: fixed; left: 0; right: 0; bottom: calc(var(--bb-h) + env(safe-area-inset-bottom, 0px)); top: auto; width: auto; max-height: 74vh; max-height: 74dvh; overflow-y: auto;
    border-radius: 20px 20px 0 0; border: 0; padding: 6px 12px 14px; z-index: 70; box-shadow: 0 -10px 30px rgba(16,24,40,.18);
    animation: ui-sheet-up .2s ease-out;
  }
  .ui-sheet-grip { display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--border); margin: 6px auto 8px; }
  .more-menu:not([hidden]) { display: block; }
  .more-user { display: flex; align-items: center; gap: 12px; padding: 6px 8px 14px; border-bottom: 1px solid var(--border); margin-bottom: 10px; }
  .more-user strong { font-size: 15px; }
  .more-user a { display: inline; padding: 0; font-size: 13px; color: var(--accent-text); width: auto; }
  .more-user a:hover { background: none; text-decoration: underline; }
  .more-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .more-grid > a, .more-grid > button[role="menuitem"] {
    position: relative; flex-direction: column; justify-content: center; gap: 6px; min-height: 84px; padding: 10px 6px; text-align: center;
    background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; font-size: 13px; font-weight: 600;
  }
  .more-grid > a.is-active { background: var(--accent-bg); color: var(--accent-text); border-color: transparent; }
  .more-grid .notif-badge { top: 8px; right: 10px; }
  .ab-user-menu { position: fixed; right: 10px; top: calc(56px + env(safe-area-inset-top, 0px)); }
  body.ui-sheet-open { overflow: hidden; }
  body.ui-sheet-open .bottombar { z-index: 69; box-shadow: none; } /* the bar stays usable above the shade: the "+" turns into × and closes */
}
@keyframes ui-sheet-up { from { transform: translateY(24px); opacity: .4; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ui-sheet { animation: none; } .bb-fab, .bb-fab .ui-ico { transition: none; } }

@media print {
  .sidebar, .appbar, .bottombar, .ui-pop, .ui-backdrop, .skip-link, .dev-credit { display: none !important; }
  .shell { display: block; } .page { max-width: none; padding: 0; }
  body { background: #fff; }
}

/* R52 — Setup > App Settings: colour theme picker */
.palette-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.palette-opt { display: block; margin: 0; font-weight: 400; color: var(--text); cursor: pointer; }
.palette-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.palette-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: 12px; background: var(--surface); transition: border-color .12s ease, box-shadow .12s ease; }
.palette-card strong { display: block; font-size: 14px; }
.palette-card small { display: block; font-size: 12.5px; color: var(--text-2); }
.palette-swatch { flex: 0 0 34px; height: 34px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.palette-opt input:checked + .palette-card { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.palette-opt input:focus-visible + .palette-card { outline: 2px solid var(--accent); outline-offset: 2px; }

/* =====================================================================================================
   R53 — TICKETS new look: page head, "needs attention" strip, chips (Open / Today / Done / All / Non-assigned),
   search + folding Filters, status pills, due time, the table on computers and cards on phones, the ticket page.
   ===================================================================================================== */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Page head: title + actions on one line */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; margin: 6px 0 16px; }
.page-head h1 { font-size: 24px; font-weight: 700; letter-spacing: -.02em; margin: 0 0 2px; }
.page-head .subtitle { margin: 0; }
.page-head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.page-head-actions form { margin: 0; }
.page-head-actions .btn, .page-head-actions .btn-secondary { display: inline-flex; align-items: center; gap: 6px; }

/* Status pill: a coloured dot + words */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.35; white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: 0 0 auto; }
.pill-open     { background: var(--accent-bg); color: var(--accent-text); }
.pill-progress { background: var(--info-bg); color: var(--info); }
.pill-wait     { background: var(--warn-bg); color: var(--warn); }
.pill-watch    { background: color-mix(in srgb, #8b5cf6 14%, var(--surface)); color: #6d28d9; }
:root[data-theme="dark"] .pill-watch { color: #c4b5fd; }
.pill-done     { background: var(--good-bg); color: var(--good); }
.pill-closed   { background: var(--muted-bg); color: var(--muted); }

/* Due time */
.due { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.due .ui-ico { flex: 0 0 auto; }
.due-left { font-weight: 600; }
.due-line .due-left::before { content: "·"; margin-right: 5px; color: var(--text-2); font-weight: 400; }
.due-stack { display: inline-grid; grid-template-columns: auto auto; column-gap: 5px; row-gap: 1px; align-items: center; }
.due-stack .due-left { grid-column: 2; font-size: 11.5px; }
.due-bad  { color: var(--bad); }  .due-bad .due-when { color: var(--text); }
.due-warn { color: var(--warn); } .due-warn .due-when { color: var(--text); }
.due-ok   { color: var(--good); } .due-ok .due-when { color: var(--text); }
.due-done, .due-none { color: var(--text-2); font-weight: 500; }
.due-line.due-bad { background: var(--bad-bg); padding: 3px 8px; border-radius: 999px; }
.due-line.due-warn { background: var(--warn-bg); padding: 3px 8px; border-radius: 999px; }
.due-line.due-bad .due-when, .due-line.due-warn .due-when { color: inherit; }

/* "Needs attention" strip */
.kpi-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin-bottom: 16px; }
.kpi {
  display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border);
  color: var(--text); text-decoration: none; position: relative; transition: border-color .12s ease, box-shadow .12s ease;
}
.kpi:hover { text-decoration: none; border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); box-shadow: 0 2px 8px rgba(16,24,40,.06); }
.kpi .num { font-size: 22px; font-weight: 700; line-height: 1.1; letter-spacing: -.01em; }
.kpi .label { font-size: 12px; color: var(--text-2); font-weight: 500; white-space: nowrap; }
.kpi.tone-bad .num { color: var(--bad); } .kpi.tone-warn .num { color: var(--warn); }
.kpi.is-on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }

/* Chips */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-size: 13.5px; font-weight: 600; text-decoration: none; white-space: nowrap;
}
.chip:hover { text-decoration: none; border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.chip-n { display: inline-block; min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--muted-bg); color: var(--text-2); font-size: 12px; font-weight: 700; text-align: center; line-height: 1.5; }
.chip.is-on { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip.is-on .chip-n { background: rgba(255,255,255,.22); color: #fff; }
.chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Search + Filters */
.tk-search { margin-bottom: 12px; }
.tk-search-row { display: flex; gap: 8px; }
.tk-search-box {
  flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 0 12px; height: 42px; margin: 0;
  background: var(--input-bg); border: 1px solid var(--border); border-radius: 10px; color: var(--text-2); font-weight: 400; cursor: text;
}
.tk-search-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.tk-search-box input { flex: 1 1 auto; min-width: 0; border: 0 !important; outline: none; background: transparent; padding: 0; height: 40px; font: inherit; font-size: 14.5px; color: var(--text); box-shadow: none !important; text-transform: uppercase; } /* R56.3 — capitals, like every other box */
.tk-search-box input::placeholder { text-transform: uppercase; }
.tk-search-row .btn { height: 42px; }
.tk-filters { margin-top: 8px; }
.tk-filters > summary {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer; list-style: none; padding: 6px 10px; border-radius: 8px;
  font-size: 13.5px; font-weight: 600; color: var(--text-2); user-select: none;
}
.tk-filters > summary::-webkit-details-marker { display: none; }
.tk-filters > summary:hover { background: var(--muted-bg); color: var(--text); }
.tk-filters[open] > summary { color: var(--accent-text); }
.tk-filter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; padding: 14px; margin-top: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.tk-filter-grid .field { margin: 0; }
.tk-emp-field { position: relative; grid-column: span 2; }
.tk-filter-actions { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.tk-active-filter { margin: 0 0 12px; font-size: 13.5px; color: var(--text-2); }
.tk-active-filter a { margin-left: 6px; }

/* Bulk bar */
.tk-bulk { display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap; margin-bottom: 10px; }
.tk-bulk-all { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; margin: 0; font-weight: 500; }
.tk-bulk-hint { font-size: 12.5px; color: var(--text-2); }

/* Table (computers) */
.tk-table table td { vertical-align: middle; }
.tk-row { cursor: pointer; }
.tk-col-cb { width: 36px; }
.tk-col-ticket { min-width: 260px; max-width: 420px; }
.tk-no { font-size: 12.5px; color: var(--text-2); font-weight: 600; letter-spacing: .01em; }
a.tk-no:hover { color: var(--accent-text); }
.tk-subj { font-weight: 600; color: var(--text); margin-top: 2px; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tk-sub { font-size: 12px; color: var(--text-2); margin-top: 2px; }

/* Cards (phones) */
.tk-cards { display: none; list-style: none; margin: 0; padding: 0; }
.tk-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 36px 16px; color: var(--text-2); }
.tk-empty strong { color: var(--text); font-size: 15px; }
.tk-ini { width: 24px; height: 24px; border-radius: 50%; background: var(--accent-bg); color: var(--accent-text); font-size: 10.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }

@media (max-width: 860px) {
  .tk-head h1 { display: none; }          /* the phone header already says "Tickets" */
  .tk-head { margin-top: 0; margin-bottom: 12px; }
  .page-head-actions .tk-new-btn { display: none; }   /* the big "+" in the bottom bar does this */
  .tk-head .subtitle.is-default { display: none; }
  .page-head-actions:empty { display: none; }
  .kpi-strip { display: flex; overflow-x: auto; gap: 8px; margin: 0 -12px 12px; padding: 2px 12px 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .kpi-strip::-webkit-scrollbar { display: none; }
  .kpi { flex: 0 0 auto; min-width: 112px; padding: 8px 12px; }
  .kpi .num { font-size: 19px; }
  .chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -12px 10px; padding: 2px 12px 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: 0 0 auto; }
  .tk-search-row .btn { padding-left: 14px; padding-right: 14px; }
  .tk-filter-grid { grid-template-columns: 1fr 1fr; }
  .tk-emp-field { grid-column: 1 / -1; }
  .tk-bulk-hint { display: none; }
  .tk-table { display: none; }
  .tk-cards { display: flex; flex-direction: column; gap: 10px; }
  .tk-card {
    display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
    color: var(--text); text-decoration: none; box-shadow: 0 1px 2px rgba(16,24,40,.04); -webkit-tap-highlight-color: transparent;
  }
  .tk-card:hover { text-decoration: none; }
  .tk-card:active { background: var(--surface-2); }
  .tk-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .tk-card-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
  .tk-card-top .tk-no { font-size: 12px; }
  .tk-card-status { margin-left: auto; }
  .tk-card-subj { font-size: 15px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .tk-card-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; color: var(--text-2); }
  .tk-card-meta > span { display: inline-flex; align-items: center; gap: 4px; min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tk-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 8px; border-top: 1px solid var(--border); flex-wrap: wrap; }
  .tk-card-tech { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; min-width: 0; }
  .tk-card-tech > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (max-width: 360px) {
  .tk-filter-grid { grid-template-columns: 1fr; }
  .tk-search-row .btn { padding-left: 10px; padding-right: 10px; }
}

/* ---- R53: the ticket page ---- */
.tkv-hero { padding: 18px 20px; }
.tkv-hero-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tkv-hero-top .tk-no { font-size: 13px; }
.tkv-title { font-size: 22px; font-weight: 700; letter-spacing: -.015em; line-height: 1.3; margin: 8px 0 14px; overflow-wrap: anywhere; }
.tkv-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px 20px; margin: 0; padding: 14px 0 0; border-top: 1px solid var(--border); }
.tkv-facts > div { min-width: 0; }
.tkv-facts dt { display: flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-2); margin: 0 0 3px; }
.tkv-facts dd { margin: 0; font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.tkv-fact-note { font-size: 12.5px; font-weight: 400; }
.tkv-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.tkv-actions form { display: inline; margin: 0; }
.tkv-actions:empty { display: none; }
.tkv-delete { margin: 12px 0 0; display: flex; justify-content: flex-end; }
.tkv-actions + .tkv-delete { margin-top: -38px; } /* sits at the right end of the action row on computers */
.tkv-problem { padding: 14px 18px; }
.tkv-label { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-2); margin-bottom: 4px; }
.tkv-problem > div:last-child { white-space: pre-wrap; overflow-wrap: anywhere; }
.tkv-sec { scroll-margin-top: 84px; }
.tkv-jump { margin: 0 0 16px; }
.tkv-jump .chip { min-height: 34px; font-size: 13px; font-weight: 500; color: var(--text-2); }
.tkv-jump .chip[hidden] { display: none; }

/* Status path: rounded segments in the new look */
.ticket-path { gap: 4px; margin: 0 0 12px; }
.ticket-path .step { padding: 7px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--text-2); font-weight: 500; }
.ticket-path .step::after { display: none; }
.ticket-path .step:first-child { padding-left: 14px; border-radius: 999px; }
.ticket-path .step.is-done { border-color: transparent; }
.ticket-path .step.is-done > span::before { content: "✓ "; }
.ticket-path .step.is-current { border-color: var(--accent); font-weight: 600; }
.ticket-path .step.is-closed-pill { margin-left: 4px; border-radius: 999px; border-color: transparent; }

@media (max-width: 860px) {
  .tkv-hero { padding: 14px; }
  .tkv-title { font-size: 18px; margin: 6px 0 12px; }
  .tkv-facts { grid-template-columns: 1fr 1fr; gap: 10px 12px; }
  .tkv-facts dd { font-size: 13.5px; }
  .tkv-actions { display: grid; grid-template-columns: 1fr; gap: 8px; }
  .tkv-actions form { display: block; }
  .tkv-actions .btn, .tkv-actions .btn-secondary { width: 100%; justify-content: center; text-align: center; }
  .tkv-actions > .badge { justify-self: start; white-space: normal; }
  .tkv-facts .tkv-fact-due { grid-column: 1 / -1; }
  .tkv-facts .due { white-space: normal; flex-wrap: wrap; }
  .tkv-actions + .tkv-delete { margin-top: 10px; }
  .ticket-path, .tkv-jump { flex-wrap: nowrap; overflow-x: auto; margin-left: -12px; margin-right: -12px; padding: 2px 12px 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .ticket-path::-webkit-scrollbar, .tkv-jump::-webkit-scrollbar { display: none; }
  .ticket-path .step { flex: 0 0 auto; white-space: nowrap; }
  .tkv-sec { scroll-margin-top: 72px; }
}
@media (max-width: 360px) { .tkv-facts { grid-template-columns: 1fr; } }
@media print { .tkv-jump, .tkv-actions, .tkv-delete { display: none !important; } }
.tkv-actions:not(:has(*)) { display: none; }
/* R53 — tablets / narrow windows (861–1100 px): drop the Category column so the table fits without sideways scrolling. */
@media (min-width: 861px) and (max-width: 1100px) {
  .tk-table .tk-col-cat { display: none; }
  .tk-col-ticket { min-width: 200px; }
  .tk-table th, .tk-table td { padding-left: 8px; padding-right: 8px; }
}

/* ---- R54: Assets (reuses the R53 list / card / pill / due styles) ---- */
.tabnum { font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 860px) { .tk-desk-only { display: none; } }
.page-head-actions { margin-left: auto; }
.tkv-actions .btn, .tkv-actions .btn-secondary { white-space: nowrap; }
@media (max-width: 860px) {
  .page-head-actions { margin-left: 0; }
  .page-head-actions .btn-secondary { padding: 6px 12px; font-size: 13px; }
}
@media (max-width: 860px) { .tk-head .page-head-text:not(:has(.subtitle:not(.is-default))) { display: none; } }

/* =====================================================================================================
   R55 — TRAVEL new look (reuses the R53 head / chips / search / table / card styles). Status words are the same
   pills as Tickets and Assets. tw-* stays the Travel prefix.
   ===================================================================================================== */
.pill-bad { background: var(--bad-bg); color: var(--bad); }
.tw-kpis .kpi .label { overflow: hidden; text-overflow: ellipsis; }
.tw-switch { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; margin-bottom: 12px; }
.tw-switch .chips { margin: 0; }
.tw-scope { border-radius: 999px; padding: 3px; gap: 2px; border-color: var(--border); }
.tw-scope a { border: 0; border-radius: 999px; padding: 6px 14px; font-weight: 600; }
.tw-scope a:hover { color: var(--text); background: var(--muted-bg); text-decoration: none; }
.tw-scope a.active, .tw-scope a.active:hover { background: var(--accent); color: #fff; }
.tw-table .tw-date { font-weight: 600; color: var(--text); margin-top: 2px; }
.tw-table tfoot th { background: var(--surface-2); text-transform: none; letter-spacing: 0; font-size: 13px; }
.tw-amt { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tk-card.is-dim, .tk-row.is-dim td { opacity: .6; }
.tw-help { margin-top: 18px; }
.tw-help > summary { cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--text-2); }
.tw-card-total { display: none; }
@media (max-width: 860px) {
  .tw-switch { flex-direction: column; align-items: stretch; gap: 8px; }
  .tw-switch .chips { margin: 0 -12px; }
  .tw-scope { display: flex; }
  .tw-scope a { flex: 1 1 0; text-align: center; }
  .tw-card-purpose { font-size: 13px; color: var(--text-2); overflow-wrap: anywhere; }
  .tk-card .tw-progress { gap: 4px; }
  .tw-card-total { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); border: 1px dashed var(--border); font-size: 13.5px; }
  .tw-card-total small { color: var(--text-2); }
  .tw-card-total strong { font-size: 16px; font-variant-numeric: tabular-nums; }
}

/* R55 — one travel entry / one claim: the same header card as a ticket or an asset (tkv-*). */
.tw-hero .tkv-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tw-hero .tkv-title .tw-arrow { color: var(--text-2); font-weight: 500; }
.tw-hero-amt { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tw-hero .tw-flow { margin: 14px 0 0; }
@media (max-width: 860px) { .tw-hero-amt { font-size: 18px; } .tw-hero .tw-flow { flex-wrap: nowrap; overflow-x: auto; margin-left: -14px; margin-right: -14px; padding: 0 14px 2px; scrollbar-width: none; } .tw-hero .tw-flow li { flex: 0 0 auto; white-space: nowrap; } }
/* R55 — phone cards made from tables: a total row (tfoot) shows as one dashed "total" line instead of a stray box;
   buttons with an icon keep the icon beside the words. */
@media (max-width: 860px) {
  .table-wrap.card-on-mobile table tfoot { display: block; }
  .table-wrap.card-on-mobile table tfoot tr { display: flex; justify-content: space-between; align-items: center; gap: 12px; border: 1px dashed var(--border); border-radius: var(--radius); padding: 10px 12px; background: var(--surface-2); }
  .table-wrap.card-on-mobile table tfoot th { padding: 0; border: 0; background: none; text-align: left; }
  .table-wrap.card-on-mobile table tfoot th:empty { display: none; }
}
.tkv-actions .btn, .tkv-actions .btn-secondary, .tkv-actions .btn-danger { display: inline-flex; align-items: center; gap: 6px; }
.tw-sum, .tw-sum.is-warn, .tw-sum.is-good, .tw-sum.is-info { border: 1px solid var(--border); border-radius: 12px; }
.tw-sum.is-warn .n { color: var(--warn); } .tw-sum.is-good .n { color: var(--good); } .tw-sum.is-info .n { color: var(--accent-text); }
a.tw-sum:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); text-decoration: none; }

/* =====================================================================================================
   R56 — new look, step 5: SETUP, REPORTS, PROFILE, LOGIN + polish.
   ===================================================================================================== */
/* Polish: every kind of text box looks the same (web address, phone and month boxes were left plain), and the
   grey hint text inside a box is no longer shown in capitals (what you type still is, as before). */
input[type=url], input[type=tel], input[type=search], input[type=month], input[type=datetime-local] {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; font-family: inherit; background: var(--input-bg); color: var(--text);
}
/* R56.3 — hint text back in capitals too (Soumen's rule: every letter in capitals). */
input::placeholder, textarea::placeholder { text-transform: uppercase; }
input[type=password]::placeholder, input[type=url]::placeholder { text-transform: none; }
:root[data-theme="dark"] input[type=month], :root[data-theme="dark"] input[type=date], :root[data-theme="dark"] input[type=time] { color-scheme: dark; }
/* Phones: a page's own heading that repeats the header's page name is hidden (see includes/footer.php). */
@media (max-width: 860px) { .ui-dup-title { display: none; } }

/* Setup: page heading + section chips (computers) / section picker (phones) */
.st-eyebrow { margin: 6px 0 0; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-2); }
.st-title { font-size: 24px; font-weight: 700; letter-spacing: -.02em; margin: 2px 0 4px; }
.st-nav { margin: 4px 0 18px; display: flex; flex-direction: column; gap: 10px; }
.st-pick { display: none; }
.st-group { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px; align-items: start; }
.st-group-label { padding-top: 7px; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-2); }
.st-group-label small { display: block; font-size: 10.5px; font-weight: 500; letter-spacing: 0; text-transform: none; }
.st-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.st-chip { display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: 13px; font-weight: 500; text-decoration: none; white-space: nowrap; }
.st-chip:hover { color: var(--text); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); text-decoration: none; }
.st-chip.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.st-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 860px) {
  .st-eyebrow { display: none; }
  .st-group { display: none; }
  .st-pick { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
  .st-pick label { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-2); }
  .st-pick select { min-height: 42px; font-size: 15px; font-weight: 600; }
  .st-nav { margin-bottom: 14px; }
}

/* Reports landing page */
.report-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin-top: 4px; }
.report-card { display: flex; gap: 14px; align-items: flex-start; padding: 18px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text); text-decoration: none; box-shadow: 0 1px 2px rgba(16,24,40,.04); transition: border-color .12s ease, box-shadow .12s ease; }
a.report-card:hover { text-decoration: none; border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); box-shadow: 0 6px 18px rgba(16,24,40,.08); }
a.report-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.report-ico { flex: 0 0 44px; height: 44px; border-radius: 12px; background: var(--accent-bg); color: var(--accent-text); display: flex; align-items: center; justify-content: center; }
.report-card.is-disabled .report-ico { background: var(--muted-bg); color: var(--text-2); }
.report-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.report-body strong { font-size: 15.5px; }
.report-body > span:not(.report-tags) { font-size: 13.5px; color: var(--text-2); line-height: 1.45; }
.report-tags { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.report-fmt { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-2); font-weight: 600; }
.report-card.is-disabled { opacity: .75; cursor: default; }
.report-more { margin-top: 18px; font-size: 13.5px; }

/* Profile */
.profile-cover { background: linear-gradient(120deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #0b1020)) !important; }
.profile-header { border-radius: 14px; }
.profile-header + .subtitle, .profile-header ~ .alert { margin-top: 0; }
.theme-choice { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.theme-opt { display: block; margin: 0; font-weight: 400; color: var(--text); cursor: pointer; position: relative; }
.theme-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.theme-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: 12px; background: var(--surface); transition: border-color .12s ease, box-shadow .12s ease; }
.theme-card strong { display: block; font-size: 14px; }
.theme-card small { display: block; font-size: 12.5px; color: var(--text-2); }
.theme-ico { flex: 0 0 38px; height: 38px; border-radius: 10px; background: var(--muted-bg); color: var(--text-2); display: flex; align-items: center; justify-content: center; }
.theme-opt input:checked + .theme-card { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.theme-opt input:checked + .theme-card .theme-ico { background: var(--accent-bg); color: var(--accent-text); }
.theme-opt input:focus-visible + .theme-card { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 860px) { .theme-choice { grid-template-columns: 1fr; } .profile-header + .subtitle { font-size: 13px; } }

/* Login */
.no-shell .page:has(.login-shell) { max-width: none; padding: 0; }
.login-shell { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.login-side { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; padding: 44px 52px; color: #fff;
  background: radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, var(--accent) 70%, #fff) 0%, transparent 55%), linear-gradient(150deg, var(--accent), color-mix(in srgb, var(--accent) 50%, #070a14)); }
.login-side::after { content: ""; position: absolute; right: -120px; bottom: -120px; width: 380px; height: 380px; border-radius: 50%; border: 60px solid rgba(255,255,255,.07); }
.login-side-brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 17px; }
.login-side-brand .sb-mark { background: rgba(255,255,255,.18); }
/* R58.2 item 5 — logo on the left panel: a white tile keeps a dark or coloured logo readable on the brand colour */
.login-side-logo { display: inline-flex; align-items: center; justify-content: center; background: #fff; border-radius: 12px; padding: 8px 12px; box-shadow: 0 4px 14px rgba(0,0,0,.12); max-width: 240px; }
.login-side-logo img { display: block; max-height: 48px; max-width: 216px; width: auto; height: auto; }
.login-side-name { font-size: 19px; letter-spacing: -.01em; overflow-wrap: anywhere; }
.login-main { flex-direction: column; gap: 14px; }
.login-credit { margin: 0; text-align: center; font-size: 12px; color: var(--text-2); max-width: 380px; } /* R58.2 item 1 */
.login-credit a { color: inherit; font-weight: 600; }
@media (min-width: 901px) { .login-card .login-logo-card { display: none; } } /* the left panel already shows it */
.login-side-copy h2 { font-size: 34px; line-height: 1.15; letter-spacing: -.02em; margin: 0 0 22px; max-width: 420px; }
.login-side-copy ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.login-side-copy li { display: flex; align-items: center; gap: 12px; font-size: 15px; opacity: .95; }
.login-side-copy li .ui-ico { flex: 0 0 36px; width: 36px; height: 36px; padding: 8px; border-radius: 10px; background: rgba(255,255,255,.14); }
.login-side-foot { margin: 0; font-size: 13px; opacity: .8; }
.login-main { display: flex; align-items: center; justify-content: center; padding: 32px 20px; }
.login-card { width: 100%; max-width: 380px; padding: 30px 28px; border-radius: 16px; box-shadow: 0 12px 32px rgba(16,24,40,.08); }
.login-card h1 { text-align: center; font-size: 22px; letter-spacing: -.01em; margin: 0 0 2px; }
.login-card .subtitle { text-align: center; margin-bottom: 20px; }
.login-logo { text-align: center; margin: 0 0 12px; } .login-logo img { max-width: 260px; }
.login-mark { display: flex; justify-content: center; margin: 0 0 12px; } .login-mark .sb-mark { width: 46px; height: 46px; font-size: 22px; border-radius: 14px; }
.login-input { display: flex; align-items: center; gap: 8px; padding: 0 12px; height: 44px; border: 1px solid var(--border); border-radius: 10px; background: var(--input-bg); color: var(--text-2); }
.login-input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.login-input input { flex: 1 1 auto; min-width: 0; border: 0 !important; outline: none; background: transparent; padding: 0; height: 42px; font-size: 15px; color: var(--text); box-shadow: none !important; text-transform: uppercase; } /* R56.3 — username in capitals as before; the password box below stays as typed */
.login-input input.login-pw { text-transform: none !important; } /* stays as typed even when "Show" turns it into a text box */
.login-eye { border: 0; background: none; color: var(--accent-text); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; padding: 4px 2px; }
.login-btn { width: 100%; height: 44px; font-size: 15px; margin-top: 4px; justify-content: center; }
.login-forgot { text-align: center; margin: 14px 0 0; font-size: 13.5px; } /* R58.1 */
.login-forgot a { color: var(--accent-text); font-weight: 600; text-decoration: none; }
.login-forgot a:hover { text-decoration: underline; }
.login-steps { margin: 0 0 16px; padding: 0; list-style: none; display: flex; gap: 6px; justify-content: center; font-size: 12px; color: var(--text-2); } /* R58.1 forgot password */
.login-steps li { padding: 3px 10px; border-radius: 999px; background: var(--surface-2); }
.login-steps li.on { background: var(--accent-bg); color: var(--accent-text); font-weight: 600; }
.otp-input { letter-spacing: .4em; font-size: 20px !important; text-align: center; }
@media (max-width: 900px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-side { display: none; }
  .login-main { align-items: flex-start; padding-top: max(48px, env(safe-area-inset-top, 0px)); }
  .login-card { box-shadow: none; }
  .login-main { align-items: center; justify-content: flex-start; } /* R58.2: column layout (card + credit) — keep it centred, at the top */
}

/* =====================================================================================================
   R57 — PUSH NOTIFICATIONS: My Profile "Notifications on this device" card and Setup > Push notifications.
   ===================================================================================================== */
.push-box { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; background: var(--surface-2); }
.push-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.push-ico { flex: 0 0 40px; height: 40px; border-radius: 12px; background: var(--accent-bg); color: var(--accent-text); display: flex; align-items: center; justify-content: center; }
.push-state { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; flex: 1 1 160px; min-width: 0; }
.push-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.push-actions .btn[hidden], .push-actions .btn-secondary[hidden] { display: none; }
.push-hint { margin: 10px 0 0; font-size: 13.5px; color: var(--text-2); line-height: 1.5; }
.push-hint[hidden] { display: none; }
.push-devices-title { margin: 14px 0 6px; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-2); }
.push-devices { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.push-devices li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13.5px; }
.push-devices li .ui-ico { color: var(--text-2); }
.push-note { font-size: 12.5px; margin: 8px 0 0; }
.push-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.push-steps li { display: flex; gap: 12px; align-items: flex-start; }
.push-steps li > span:last-child { display: flex; flex-direction: column; gap: 1px; font-size: 13.5px; }
.push-step-n { flex: 0 0 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 700; background: var(--muted-bg); color: var(--text-2); }
.push-steps li.is-ok .push-step-n { background: var(--good-bg); color: var(--good); }
.push-code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; font-size: 12.5px; overflow-x: auto; white-space: pre; }
.push-pub { word-break: break-all; font-size: 12px; }
@media (max-width: 860px) { .push-actions { width: 100%; } .push-actions .btn, .push-actions .btn-secondary { flex: 1 1 auto; } }
/* R57 — any button with a line icon keeps the icon beside its words (it was stacked above them on plain cards). */
.btn:has(> .ui-ico), .btn-secondary:has(> .ui-ico), .btn-danger:has(> .ui-ico) { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
/* R56.1 — Setup on phones: fold-open list of links instead of the drop-down picker. */
@media (max-width: 860px) {
  .st-pick { display: block; padding: 0; overflow: hidden; }
  .st-pick > summary { display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; list-style: none; -webkit-tap-highlight-color: transparent; }
  .st-pick > summary::-webkit-details-marker { display: none; }
  .st-pick-label { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-2); white-space: nowrap; }
  .st-pick-current { flex: 1 1 auto; min-width: 0; font-size: 15px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
  .st-pick-chev { color: var(--text-2); display: inline-flex; transition: transform .15s ease; }
  .st-pick[open] .st-pick-chev { transform: rotate(180deg); }
  .st-pick-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 4px 12px 14px; border-top: 1px solid var(--border); }
  .st-pick-group { grid-column: 1 / -1; margin: 10px 2px 2px; font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-2); }
  .st-pick-list a { display: flex; align-items: center; min-height: 42px; padding: 6px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font-size: 13.5px; font-weight: 500; text-decoration: none; line-height: 1.25; }
  .st-pick-list a.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
}
@media (max-width: 340px) { .st-pick-list { grid-template-columns: 1fr; } }
/* R56.2 — Setup > App Settings: installed app name + icon */
.ai-grid { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 20px; align-items: start; }
.ai-modes { border: 0; padding: 0; margin: 0 0 14px; }
.ai-modes legend { font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; padding: 0; }
.ai-mode { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; margin: 0 0 6px; font-weight: 400; color: var(--text); cursor: pointer; background: var(--surface); }
.ai-mode input { margin-top: 3px; accent-color: var(--accent); }
.ai-mode strong { display: block; font-size: 14px; }
.ai-mode small { display: block; font-size: 12.5px; color: var(--text-2); }
.ai-mode:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.ai-mode.is-off { opacity: .6; cursor: default; }
.ai-file { margin-top: 4px; }
.ai-bg { display: inline-flex; align-items: center; gap: 10px; }
.ai-bg input[type=color] { width: 48px; height: 36px; padding: 2px; border: 1px solid var(--border); border-radius: 8px; background: var(--input-bg); }
.ai-preview { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); }
.ai-preview-title { font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-2); }
.ai-phone { display: flex; gap: 18px; padding: 16px 12px; border-radius: 12px; background: linear-gradient(160deg, #3b4a6b, #1d2436); justify-content: center; }
.ai-tile { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 76px; }
.ai-tile img { width: 64px; height: 64px; border-radius: 15px; box-shadow: 0 2px 8px rgba(0,0,0,.3); background: #fff; }
.ai-tile.ai-round img { border-radius: 50%; }
.ai-tile span { color: #fff; font-size: 11.5px; text-align: center; max-width: 76px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 760px) { .ai-grid { grid-template-columns: 1fr; } }

/* R59 — Setup home (setup.php) */
.sh-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 18px; }
.sh-search { flex: 1 1 320px; max-width: 520px; display: flex; align-items: center; gap: 8px; padding: 0 12px; min-height: 42px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text-2); margin: 0; }
.sh-search input { border: 0; background: transparent; box-shadow: none; padding: 8px 0; min-height: 0; flex: 1; font-size: 14.5px; color: var(--text); outline: none; }
.sh-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.sh-count { font-size: 13px; }
.sh-group { margin: 0 0 26px; }
.sh-group[hidden], .sh-card[hidden] { display: none; }
.sh-head { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-2); margin: 0 0 10px; }
.sh-head small { font-size: 12px; font-weight: 500; letter-spacing: 0; text-transform: none; margin-left: 6px; }
.sh-card { padding: 14px 16px; }
.sh-card .report-body strong { font-size: 15px; }
.sh-card .report-body .text-muted { font-size: 13px; line-height: 1.4; }
/* Breadcrumb on every Setup page (replaces the old "Setup & Masters" line) */
.st-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; }
.st-crumbs a { color: var(--text-2); }
.st-crumbs a:hover { color: var(--accent-text); text-decoration: underline; }
.st-crumbs [aria-current] { color: var(--text); }
.st-crumb-sep { color: var(--text-2); opacity: .7; }
.st-pick-home { font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
@media (max-width: 860px) { .st-eyebrow.st-crumbs { display: flex; font-size: 11.5px; margin-bottom: 6px; } }
/* Setup > Modules */
.mod-name { display: inline-flex; align-items: center; gap: 8px; }
.mod-switch { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-weight: 600; cursor: pointer; }
.mod-switch input { width: 20px; height: 20px; }

/* R59 — Home page pop-ups (install the app / turn on notifications) */
.hp-card { position: fixed; right: 24px; bottom: 24px; z-index: 60; width: min(420px, calc(100vw - 32px)); background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 18px 48px rgba(16,24,40,.18), 0 2px 6px rgba(16,24,40,.08); padding: 16px 18px; opacity: 0; transform: translateY(12px); transition: opacity .2s ease, transform .2s ease; }
.hp-card[hidden] { display: none; }
.hp-card.is-in { opacity: 1; transform: none; }
.hp-step { display: flex; gap: 14px; align-items: flex-start; }
.hp-step[hidden] { display: none; }
.hp-ico { flex: 0 0 44px; height: 44px; border-radius: 12px; overflow: hidden; display: flex; align-items: center; justify-content: center; background: var(--accent-bg); color: var(--accent-text); }
.hp-ico img { width: 44px; height: 44px; display: block; }
.hp-ico-ok { background: var(--good-bg); color: var(--good); }
.hp-body { min-width: 0; flex: 1; }
.hp-title { font-size: 16px; font-weight: 700; margin: 2px 0 4px; letter-spacing: -.01em; }
.hp-body p { margin: 0 0 10px; font-size: 13.5px; color: var(--text-2); line-height: 1.45; }
.hp-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.hp-actions .btn { min-height: 40px; }
.hp-ios { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 8px; counter-reset: hp; }
.hp-ios li { display: flex; align-items: center; gap: 10px; font-size: 13.5px; counter-increment: hp; }
.hp-ios li::before { content: counter(hp); flex: 0 0 20px; height: 20px; border-radius: 50%; background: var(--surface-2); color: var(--text-2); font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.hp-pic { flex: 0 0 36px; height: 36px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface-2); color: #0a84ff; display: flex; align-items: center; justify-content: center; }
.hp-pic-text { font-size: 13px; font-weight: 700; }
.hp-list { margin: 0 0 10px; padding-left: 18px; font-size: 13px; color: var(--text-2); }
.hp-list li { margin-bottom: 4px; }
.hp-msg { color: var(--bad, #b83430) !important; }
@media (max-width: 860px) {
  .hp-card { left: 10px; right: 10px; width: auto; bottom: calc(var(--bb-h) + 10px + env(safe-area-inset-bottom, 0px)); }
}
@media (prefers-reduced-motion: reduce) { .hp-card { transition: none; } }
@media print { .hp-card { display: none !important; } }

/* R59.1 — Google-style search bar + drop-down for the "type to search, click to pick" pickers.
   Markup is added by the enhancer at the end of assets/js/app.js (.gsearch > .gsearch-bar + .gsearch-drop). */
.gsearch { position: relative; }
.gsearch-bar { position: relative; display: flex; align-items: center; }
.gsearch-bar .gsearch-input {
  width: 100%; box-sizing: border-box; height: 44px; margin: 0;
  padding: 0 40px 0 42px; border-radius: 22px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-size: 14px; letter-spacing: .01em;
  transition: box-shadow .15s ease, border-color .15s ease;
}
.gsearch-bar .gsearch-input:hover { box-shadow: 0 1px 6px rgba(32,33,36,.18); border-color: transparent; }
.gsearch-bar .gsearch-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 1px 6px rgba(32,33,36,.18); }
.gsearch-bar .gsearch-input::placeholder { color: var(--text-2); opacity: .75; font-size: 13px; }
.gsearch-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-2); display: flex; pointer-events: none; }
.gsearch-clear {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px; border-radius: 50%; border: 0; background: transparent;
  color: var(--text-2); font-size: 22px; line-height: 1; cursor: pointer; display: none; padding: 0;
}
.gsearch-clear:hover { background: var(--muted-bg); color: var(--text); }
.gsearch-bar.has-text .gsearch-clear { display: block; }

/* Kind A: list lives in a drop-down that opens only while searching */
.gsearch-drop {
  display: none; position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 40;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 6px 24px rgba(32,33,36,.18); overflow: hidden;
}
.gsearch.is-open .gsearch-drop { display: block; }
.gsearch.is-open .gsearch-input { border-color: var(--accent); }
.gsearch-drop .picker-list { border: 0; border-radius: 0; margin: 0 !important; max-height: min(320px, 50vh); }
.gsearch-hint { margin: 0 !important; padding: 7px 14px; font-size: 11.5px !important; color: var(--text-2); border-bottom: 1px solid var(--border); background: var(--muted-bg); }

/* Kind B: page opens/closes it itself — same floating look */
.gsearch .picker-list.gsearch-pop {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 40; width: auto !important;
  background: var(--surface) !important; border: 1px solid var(--border) !important; border-radius: 14px;
  box-shadow: 0 6px 24px rgba(32,33,36,.18); max-height: min(320px, 50vh) !important;
}

/* Rows inside the new look: one tidy line, quieter separators */
.gsearch-drop .picker-option, .gsearch-pop .picker-option, .gsearch-inline .picker-option {
  padding: 9px 14px; border-bottom: 0; font-size: 13.5px;
}
.gsearch-drop .picker-option .picker-main, .gsearch-pop .picker-option .picker-main, .gsearch-inline .picker-option .picker-main {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.picker-option.is-active { background: var(--muted-bg); border-left-color: var(--accent); }
.gsearch-inline { margin-top: 8px; border-radius: 12px; }

/* The "Selected: …" line under a picker becomes a clear chip */
.gsearch ~ .picker-selected-label, .gsearch-inline ~ .picker-selected-label { margin-top: 8px; font-size: 12.5px; }
.gsearch ~ .picker-selected-label.has-selection, .gsearch-inline ~ .picker-selected-label.has-selection {
  display: inline-flex; align-items: baseline; gap: 6px; max-width: 100%; box-sizing: border-box;
  padding: 5px 12px; border-radius: 14px; background: var(--accent-bg); color: var(--accent-text);
}
.gsearch ~ .picker-selected-label.has-selection::before, .gsearch-inline ~ .picker-selected-label.has-selection::before { content: "✓"; font-weight: 700; }

@media (max-width: 640px) {
  .gsearch-bar .gsearch-input { font-size: 16px; height: 46px; } /* 16px stops iPhone zooming in */
  .gsearch-drop .picker-option, .gsearch-pop .picker-option { padding: 12px 14px; }  /* finger-sized rows */
  .gsearch-drop .picker-option .picker-main, .gsearch-pop .picker-option .picker-main, .gsearch-inline .picker-option .picker-main { white-space: normal; }
  .gsearch-drop .picker-list, .gsearch .picker-list.gsearch-pop { max-height: 55vh !important; }
}
/* search box + "All categories" filter on one line (Tag pickers on the asset page) */
.gsearch-row { flex-wrap: nowrap !important; align-items: center; margin-bottom: 0 !important; }
.gsearch-row > select { flex: 0 0 210px; width: 210px !important; min-width: 0 !important; height: 44px; border-radius: 22px; padding: 0 14px; margin: 0; }
@media (max-width: 640px) {
  .gsearch-row { flex-wrap: wrap !important; }
  .gsearch-row > select { flex: 1 1 100%; width: 100% !important; }
}

/* R60 — Tickets: Mine / My team / All (segmented switch above the status chips) */
.tk-who { display: inline-flex; gap: 2px; padding: 3px; margin: 0 0 12px; background: var(--muted-bg); border: 1px solid var(--border); border-radius: 12px; max-width: 100%; }
.tk-who-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 7px 16px; border-radius: 9px; color: var(--text-2); font-size: 13.5px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.tk-who-btn:hover { color: var(--text); text-decoration: none; background: color-mix(in srgb, var(--surface) 60%, transparent); }
.tk-who-btn.is-on { background: var(--surface); color: var(--accent-text); box-shadow: 0 1px 3px rgba(20,26,32,.14); }
.tk-who-btn svg { flex-shrink: 0; }
.tk-who-n { min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--surface); color: var(--text-2); font-size: 12px; font-weight: 700; text-align: center; line-height: 1.5; }
.tk-who-btn.is-on .tk-who-n { background: var(--accent); color: #fff; }
@media (max-width: 640px) {
  .tk-who { display: flex; width: 100%; box-sizing: border-box; }
  .tk-who-btn { flex: 1 1 0; padding: 9px 6px; gap: 5px; font-size: 13px; }
}
