/* ============================================================================
   Travelheart Family — Journey Engine · Design System
   ----------------------------------------------------------------------------
   One shared stylesheet for the whole admin platform. Built on the official
   Travelheart Family 2026 brand guide:
     · Travelheart Grøn  #00534A   (primary / "stærkeste farve")
     · Aqua              #AAE3D2
     · Sand              #F2EBE6
     · Fersken           #F09A7A
     · Fersken lys       #F4CABA
     · Display font      Travelheart.otf  (headlines / wordmark only)
     · Body font         DM Sans          (Light / Regular / Medium / Bold)

   Per-agency identity is layered on top via the --accent* tokens, which
   brand.js sets per tenant. Travelheart green stays the functional primary
   (buttons, focus, links); the agency accent marks identity surfaces
   (brand lockup, monogram, active nav, agency chip) so it is always evident
   which agency you are managing — inside one Travelheart Family system.
   ============================================================================ */

/* ---------- Fonts ---------- */
@font-face { font-family: 'DM Sans'; src: url('assets/fonts/DMSans-Light.ttf') format('truetype'); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: 'DM Sans'; src: url('assets/fonts/DMSans-LightItalic.ttf') format('truetype'); font-weight: 300; font-style: italic; font-display: swap; }
@font-face { font-family: 'DM Sans'; src: url('assets/fonts/DMSans-Regular.ttf') format('truetype'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'DM Sans'; src: url('assets/fonts/DMSans-Italic.ttf') format('truetype'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'DM Sans'; src: url('assets/fonts/DMSans-Medium.ttf') format('truetype'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'DM Sans'; src: url('assets/fonts/DMSans-MediumItalic.ttf') format('truetype'); font-weight: 500; font-style: italic; font-display: swap; }
@font-face { font-family: 'DM Sans'; src: url('assets/fonts/DMSans-Bold.ttf') format('truetype'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'DM Sans'; src: url('assets/fonts/DMSans-BoldItalic.ttf') format('truetype'); font-weight: 700; font-style: italic; font-display: swap; }
@font-face { font-family: 'Travelheart'; src: url('assets/fonts/Travelheart.otf') format('opentype'); font-weight: 400; font-style: normal; font-display: swap; }

/* ============================================================================
   Tokens — single theme (Sand canvas · Travelheart green in front)
   ----------------------------------------------------------------------------
   The platform ships one theme, straight from the 2026 brand guide:
   Sand (#F2EBE6) behind, Travelheart green (#00534A) in front. There is no
   dark variant — the look is fixed regardless of the OS colour scheme.
   ============================================================================ */
:root {
  color-scheme: only light;

  /* Brand palette (verbatim from the 2026 brand guide) */
  --thf-green: #00534a;
  --thf-aqua:  #aae3d2;
  --thf-sand:  #f2ebe6;
  --thf-peach: #f09a7a;
  --thf-peach-light: #f4caba;

  /* Brand roles */
  --brand: #00534a;
  --brand-strong: #013c35;
  --brand-hover: #014b43;
  --brand-contrast: #ffffff;
  --brand-soft: rgba(0, 83, 74, .08);
  --brand-tint: #e7efed;          /* very light green wash for surfaces */
  --brand-ring: rgba(0, 83, 74, .18);

  /* Per-agency accent — defaults to brand green; brand.js overrides per tenant */
  --accent: #00534a;
  --accent-strong: #013c35;
  --accent-soft: rgba(0, 83, 74, .12);
  --accent-contrast: #ffffff;

  /* Neutrals / surfaces */
  --bg: #f2ebe6;                  /* app canvas — Sand (brand guide) */
  --bg-grad: radial-gradient(1100px 540px at 100% -8%, rgba(170, 227, 210, .22) 0%, transparent 60%),
             radial-gradient(980px 520px at -8% 108%, rgba(0, 83, 74, .05) 0%, transparent 58%);
  --surface: #ffffff;
  --surface-2: #f6f1e9;           /* inset fields, table zebra — warm Sand */
  --surface-3: #ece5da;
  --sand: #f2ebe6;
  --sand-soft: #faf6f2;

  --border: #e7e0d4;
  --border-strong: #d8cfc1;
  --border-faint: #f0eae0;

  --text: #122019;
  --text-2: #34423c;
  --muted: #5c6b65;
  --faint: #8a958f;

  /* Semantic */
  --primary: var(--brand);        /* legacy alias used widely in markup */
  --primary-hover: var(--brand-hover);
  --primary-soft: var(--brand-soft);

  --success: #0c8a5c;
  --success-bg: rgba(12, 138, 92, .12);
  --warning: #b15a1e;             /* darkened peach → AA on light surfaces */
  --warning-bg: rgba(240, 154, 122, .20);
  --danger: #c5453b;
  --danger-bg: rgba(197, 69, 59, .12);
  --purple: #6f5bd0;              /* "sleeping / conditional" status accent */
  --purple-soft: rgba(111, 91, 208, .12);

  /* Radii */
  --radius-xs: 7px;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-pill: 999px;

  /* Elevation — soft, green-tinted ambient light */
  --shadow-xs: 0 1px 2px rgba(78, 56, 40, .05);
  --shadow-sm: 0 1px 2px rgba(78, 56, 40, .05), 0 2px 6px rgba(78, 56, 40, .04);
  --shadow: 0 1px 2px rgba(78, 56, 40, .05), 0 6px 20px rgba(78, 56, 40, .07);
  --shadow-lg: 0 2px 4px rgba(78, 56, 40, .06), 0 18px 40px rgba(78, 56, 40, .11);
  --shadow-pop: 0 12px 32px rgba(78, 56, 40, .17);

  /* Typography */
  --font-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-display: 'Travelheart', 'DM Sans', Georgia, serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* Layout */
  --sidebar-w: 252px;
  --topbar-h: 60px;
  --content-max: 10000px;
  --transition: .18s cubic-bezier(.4, 0, .2, 1);
}

/* ============================================================================
   Module surfaces — light workspace
   ----------------------------------------------------------------------------
   Working surfaces (cards, toolbar, tables, forms) are white on the Sand
   canvas; Travelheart green is spent deliberately on actions, active states,
   focus and the one identity moment: the dashboard stat band below.
   ============================================================================ */
.stat {
  color: var(--text);

  --surface: #00534a;
  --surface-2: #0a6055;
  --surface-3: #137163;

  --border: rgba(242, 235, 230, .16);
  --border-strong: rgba(242, 235, 230, .30);
  --border-faint: rgba(242, 235, 230, .10);

  --text: #f3eee4;
  --text-2: #d9e6e0;
  --muted: #b2ccc2;
  --faint: #95b4aa;

  --accent: #aae3d2;
  --accent-strong: #c4ede1;
  --accent-soft: rgba(170, 227, 210, .20);
  --accent-contrast: #003029;

  --shadow-sm: 0 1px 2px rgba(0, 38, 33, .18), 0 2px 8px rgba(0, 38, 33, .14);
}
.stat .pill-active { background: rgba(170, 227, 210, .20); color: #d6f3ea; }

/* ============================================================================
   Base
   ============================================================================ */
* { box-sizing: border-box; }
[v-cloak] { display: none !important; }

/* Slightly larger base so the wider canvas reads comfortably (everything is rem-based). */
html { -webkit-text-size-adjust: 100%; font-size: 16.5px; }
body {
  font-family: var(--font-sans);
  font-weight: 400;
  color: var(--text);
  background: var(--bg);
  background-image: var(--bg-grad);
  background-attachment: fixed;
  line-height: 1.55;
  margin: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--accent-soft); }

/* Scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; border: 3px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--muted); background-clip: content-box; }

/* ---------- Headings ---------- */
h1, h2, h3 { color: var(--brand); letter-spacing: -.01em; margin: 0; }
h1 { font-size: 1.5rem; font-weight: 700; letter-spacing: -.02em; display: flex; align-items: center; gap: .55rem; }
h2 { font-size: 1rem; font-weight: 700; margin: 0 0 .7rem; display: flex; align-items: center; gap: .45rem; }
h3 { font-size: .88rem; font-weight: 700; }
.display { font-family: var(--font-display); font-weight: 400; letter-spacing: .01em; line-height: 1.05; }

.subtitle { font-size: .84rem; color: var(--muted); margin: .25rem 0 1.4rem; font-weight: 400; }
.card-desc { font-size: .8rem; color: var(--muted); margin: -.2rem 0 1rem; max-width: 76ch; }
.hint { font-size: .76rem; color: var(--muted); }
.empty { text-align: center; padding: 2.4rem 1rem; color: var(--faint); font-style: italic; }

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
a.link { color: var(--brand); font-size: .82rem; font-weight: 600; }

/* ============================================================================
   App shell (dashboard)
   ============================================================================ */
.app-shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }

/* ---- Sidebar ---- */
.sidebar {
  position: sticky; top: 0; align-self: start; height: 100vh;
  display: flex; flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 1.1rem .85rem;
  z-index: 30;
}
.sidebar-brand { display: flex; align-items: center; gap: .7rem; padding: .35rem .5rem 1rem; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
  display: grid; place-items: center;
  background: linear-gradient(150deg, var(--accent) 0%, var(--accent-strong) 100%);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, .15);
  position: relative; overflow: hidden;
}
.brand-mark .thf-heart { width: 22px; height: 22px; background: var(--accent-contrast); }
.brand-mark .agency-monogram { color: var(--accent-contrast); font-weight: 700; font-size: 1.05rem; letter-spacing: -.02em; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-agency { font-weight: 700; font-size: .92rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-system { font-size: .64rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: .3rem; }
.brand-system .thf-heart { width: 9px; height: 9px; background: var(--brand); }

.nav { display: flex; flex-direction: column; gap: .12rem; margin-top: .4rem; }
.nav-label { font-size: .62rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); padding: .6rem .7rem .3rem; }
.nav-item {
  display: flex; align-items: center; justify-content: flex-start; gap: .65rem;
  padding: .6rem .7rem; border-radius: var(--radius-sm);
  font-size: .85rem; font-weight: 500; color: var(--text-2);
  cursor: pointer; border: 0; background: transparent; width: 100%; text-align: left;
  position: relative; transition: background var(--transition), color var(--transition);
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
/* Sidebar items that are plain links (Administration section) share the button look. */
a.nav-item { text-decoration: none; }
a.nav-item:hover { text-decoration: none; }
/* min-width:0 stops wide color-emoji (🛍 / ⚙️) from expanding the fixed icon
   column past 1.5rem, which would otherwise shove those labels right. */
.nav-item .nav-ic { font-size: 1rem; flex: 0 0 1.5rem; min-width: 0; display: inline-flex; align-items: center; justify-content: flex-start; line-height: 1; opacity: .9; }
.nav-item.active { background: var(--accent-soft); color: var(--accent-strong); font-weight: 700; }
.nav-item.active::before {
  content: ''; position: absolute; left: -.85rem; top: 50%; transform: translateY(-50%);
  width: 3px; height: 60%; border-radius: 999px; background: var(--accent);
}
.sidebar-foot { margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--border-faint); display: flex; flex-direction: column; gap: .5rem; }
.sidebar-foot .link-btn { justify-content: center; }

/* ---- Main column ---- */
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 25;
  min-height: var(--topbar-h);
  display: flex; align-items: center; gap: .7rem; flex-wrap: wrap;
  padding: .6rem 1.6rem;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--border);
}
/* Left-aligned against the sidebar (top-left), capped so it doesn't sprawl on ultrawide. */
.content { padding: 1.6rem; max-width: var(--content-max); width: 100%; margin: 0; }

/* Generic centered page wrapper (agencies / users) */
.page { max-width: 1280px; margin: 0; padding: 1.75rem 1.5rem 4rem; }
.bar { display: flex; align-items: center; gap: .6rem; margin-bottom: 1.25rem; }

/* ============================================================================
   Auth bar (top chrome rendered by auth-bar.js)
   ============================================================================ */
.authbar { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; flex: 1 1 auto; min-width: 0; font-size: .82rem; }
.topbar-title { display: flex; align-items: center; gap: .55rem; font-family: var(--font-display); font-weight: 400; font-size: 1.35rem; color: var(--brand); white-space: nowrap; }
.topbar-title .eyebrow { display: inline-flex; align-items: center; color: var(--brand); }
.product-badge { display: flex; align-items: center; gap: .45rem; font-size: .72rem; font-weight: 600; color: var(--muted); padding: .5rem .6rem; }
.product-badge .thf-heart { width: 12px; height: 12px; background: var(--brand); }
.authbar .who { font-weight: 600; }
.authbar .who strong { font-weight: 700; }
.authbar .role-pill {
  font-size: .62rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: .18rem .5rem; border-radius: var(--radius-pill);
  background: var(--brand-soft); color: var(--brand);
}
.authbar select { min-width: 180px; }
.authbar .sep-label { color: var(--muted); }

/* ============================================================================
   Cards
   ============================================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
  margin-bottom: 1.15rem;
  box-shadow: var(--shadow-sm);
}
.card.collapsible .card-head {
  display: flex; align-items: center; gap: .6rem;
  cursor: pointer; user-select: none;
}
.card.collapsible .card-head h2 { margin: 0; }
.card.collapsible.collapsed { padding-bottom: 1.4rem; }
.card-chevron { margin-left: auto; color: var(--muted); transition: transform var(--transition); flex-shrink: 0; }
.card-chevron.open { transform: rotate(180deg); }

/* ============================================================================
   Forms
   ============================================================================ */
label {
  font-size: .74rem; font-weight: 600; color: var(--text-2);
  display: block; margin-bottom: .32rem;
}
label .hint { font-weight: 400; color: var(--muted); }
input, select, textarea {
  padding: .55rem .7rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); font-size: .85rem;
  background: var(--surface); color: var(--text);
  font-family: inherit; width: 100%;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: var(--surface);
}
select {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%235c6b65' d='M6 8.5L1.5 4h9z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .6rem center;
  padding-right: 1.8rem;
}
.field-group { display: flex; flex-direction: column; gap: .3rem; }
.field-group input, .field-group select { width: 100%; }
.row { display: flex; gap: .8rem; flex-wrap: wrap; align-items: flex-end; }
.grid { display: grid; gap: .8rem; align-items: end; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.15rem; }
@media (max-width: 760px) { .grid-2 { grid-template-columns: 1fr; } }
.grid-3 { display: grid; grid-template-columns: 1.4fr 1.4fr 1fr; gap: 1.15rem; }
@media (max-width: 760px) { .grid-3 { grid-template-columns: 1fr; } }

/* ============================================================================
   Buttons
   ============================================================================ */
button {
  font-family: inherit; font-weight: 600; font-size: .8rem;
  padding: .55rem 1.05rem; border-radius: var(--radius-sm); border: 1px solid transparent;
  background: var(--brand); color: var(--brand-contrast); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  transition: background var(--transition), box-shadow var(--transition), transform .08s, opacity var(--transition), border-color var(--transition);
  white-space: nowrap;
}
button:hover { background: var(--brand-hover); }
button:active { transform: translateY(1px); }
button:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
button:disabled { opacity: .55; cursor: default; transform: none; }
button.success { background: var(--success); color: #fff; }
button.success:hover { background: color-mix(in srgb, var(--success) 88%, #000); }
button.warning { background: var(--warning); color: #fff; }
button.warning:hover { background: color-mix(in srgb, var(--warning) 88%, #000); }
button.danger { background: var(--danger); color: #fff; }
button.danger:hover { background: color-mix(in srgb, var(--danger) 88%, #000); }
button.accent { background: var(--accent); color: var(--accent-contrast); }
button.accent:hover { background: var(--accent-strong); }
button.ghost {
  background: var(--surface); color: var(--text-2); border-color: var(--border-strong);
}
button.ghost:hover { background: var(--surface-2); color: var(--text); border-color: var(--muted); }
button.subtle { background: var(--surface-2); color: var(--text-2); border-color: var(--border); }
button.subtle:hover { background: var(--surface-3); }

/* Link styled as a button (used for external tools / nav links) */
.link-btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .5rem .9rem; border-radius: var(--radius-sm);
  font-weight: 600; font-size: .78rem; text-decoration: none;
  background: var(--brand); color: var(--brand-contrast);
  border: 1px solid transparent; transition: background var(--transition), border-color var(--transition);
}
.link-btn:hover { background: var(--brand-hover); text-decoration: none; }
.link-btn.ghost { background: var(--surface); color: var(--text-2); border-color: var(--border-strong); }
.link-btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.link-btn.accent { background: var(--accent); color: var(--accent-contrast); }

/* ============================================================================
   Tables
   ============================================================================ */
table { width: 100%; border-collapse: collapse; font-size: .82rem; }
th {
  text-align: left; padding: .6rem .6rem; font-size: .7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; color: var(--muted);
  border-bottom: 1px solid var(--border-strong); white-space: nowrap;
}
td { padding: .65rem .6rem; border-bottom: 1px solid var(--border-faint); vertical-align: middle; }
tbody tr { transition: background var(--transition); }
tbody tr:hover td { background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }

/* ============================================================================
   Pills / badges
   ============================================================================ */
.pill {
  padding: .2rem .6rem .2rem .5rem; border-radius: var(--radius-pill);
  font-size: .68rem; font-weight: 600; display: inline-flex; align-items: center; gap: .32rem;
  letter-spacing: .01em; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-2);
}
.pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); flex-shrink: 0; }
.pill-active { color: var(--brand); }
.pill-active::before { background: var(--brand); }
.pill-completed { color: var(--success); }
.pill-completed::before { background: var(--success); }
.pill-cancelled { color: var(--danger); }
.pill-cancelled::before { background: var(--danger); }
.pill-warning { color: var(--warning); }
.pill-warning::before { background: var(--warning); }
.pill.editor { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }

/* Scope tags — distinguish global (all-agency) controls from per-agency ones */
.scope-tag {
  display: inline-block; vertical-align: middle; margin-left: .5rem;
  font-size: .58rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  padding: .18rem .5rem; border-radius: var(--radius-pill); border: 1px solid transparent;
}
.scope-tag.global { background: rgba(224, 122, 63, .14); color: var(--warning); border-color: rgba(224, 122, 63, .28); }
.scope-tag.agency { background: var(--surface-2); color: var(--muted); border-color: var(--border); }

.agency-chip {
  font-size: .72rem; font-weight: 700; padding: .26rem .7rem; border-radius: var(--radius-pill);
  background: var(--accent-soft); color: var(--accent-strong);
  display: inline-flex; align-items: center; gap: .35rem; vertical-align: middle;
}
.agency-chip .thf-heart { width: 11px; height: 11px; background: var(--accent-strong); }

code {
  background: var(--surface-2); border: 1px solid var(--border);
  padding: .1rem .4rem; border-radius: var(--radius-xs);
  font-size: .76rem; font-family: var(--font-mono); color: var(--text-2);
}

/* ============================================================================
   Heart icon (masked → tintable via background-color)
   ============================================================================ */
.thf-heart {
  display: inline-block; flex-shrink: 0;
  -webkit-mask: url('assets/brand/heart.svg') center / contain no-repeat;
  mask: url('assets/brand/heart.svg') center / contain no-repeat;
  background-color: currentColor;
}

/* ============================================================================
   Stats
   ============================================================================ */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1.15rem; }
@media (max-width: 760px) { .stats { grid-template-columns: 1fr; } }
.stat {
  padding: 1.15rem 1.25rem; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
}
.stat::after {
  content: ''; position: absolute; inset: 0 auto 0 0; width: 3px;
  background: var(--accent); opacity: .7;
}
.stat-value { font-family: var(--font-display); font-size: 2.3rem; font-weight: 400; letter-spacing: 0; line-height: 1.05; }
.stat-label { font-size: .68rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; margin-top: .2rem; }

/* ============================================================================
   Toolbar
   ============================================================================ */
.toolbar {
  display: flex; gap: .55rem; align-items: center; flex-wrap: wrap;
  margin-bottom: 1.3rem; padding: .7rem .9rem;
  border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.toolbar-sep { width: 1px; height: 24px; background: var(--border-strong); margin: 0 .25rem; }

/* ============================================================================
   Journey flow
   ============================================================================ */
.journey-flow { display: flex; align-items: center; gap: 0; overflow-x: auto; padding: .35rem .1rem .5rem; }
.step-node {
  border: 1.5px solid var(--border-strong); border-radius: var(--radius);
  padding: .85rem 1rem; min-width: 190px; text-align: left; flex-shrink: 0;
  transition: all var(--transition); background: var(--surface);
}
.step-node.done { border-color: var(--success); background: var(--success-bg); }
.step-node.current { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.step-node.pending { opacity: .55; }
.step-node.clickable { cursor: pointer; }
.step-node.clickable:hover { border-color: var(--accent); transform: translateY(-1px); }
.step-node.clickable:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.step-node.selected {
  border-color: var(--accent); background: var(--accent-soft);
  box-shadow: 0 0 0 3px var(--accent-soft); opacity: 1;
}
.step-node-header { display: flex; align-items: flex-start; justify-content: space-between; gap: .4rem; margin-bottom: .45rem; }
.step-number { font-size: .58rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.step-expires-badge {
  font-size: .58rem; font-weight: 600; color: var(--warning);
  background: var(--warning-bg); border-radius: var(--radius-pill);
  padding: .15rem .45rem; white-space: nowrap; flex-shrink: 0;
}
.step-name { font-size: .86rem; font-weight: 700; margin: 0 0 .45rem; line-height: 1.3; }
.step-meta { font-size: .65rem; color: var(--muted); line-height: 1.7; }
.step-arrow { color: var(--border-strong); margin: 0 .35rem; flex-shrink: 0; font-size: 1.15rem; }

/* ============================================================================
   Stop panel
   ============================================================================ */
.stop-panel {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: .9rem 1.1rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface-2);
}
.stop-panel.paused { border-color: var(--danger); background: var(--danger-bg); }

/* Settings groupings + scheduled-jobs table */
.settings-group { margin: 1.3rem 0 .55rem; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); padding-bottom: .4rem; border-bottom: 1px solid var(--border-faint); }
.settings-group:first-of-type { margin-top: .4rem; }

.settings-section-head { display: flex; align-items: center; gap: .55rem; margin: 1.9rem .15rem .8rem; font-size: 1.02rem; font-weight: 700; color: var(--brand); }
.settings-section-head:first-child { margin-top: .3rem; }
.settings-section-head .section-sub { font-size: .78rem; font-weight: 400; color: var(--muted); text-transform: none; letter-spacing: 0; }
.jobs-table td { vertical-align: top; }
.jobs-table code { white-space: nowrap; }
.job-name { font-weight: 700; white-space: nowrap; }
.cron-cell { display: flex; align-items: center; gap: .4rem; }
.cron-input { font-family: var(--font-mono); font-size: .76rem; padding: .35rem .55rem; width: 140px; }
.cron-save-btn { padding: .3rem .6rem; font-size: .72rem; white-space: nowrap; }
.cron-view { font-family: var(--font-mono); font-size: .78rem; color: var(--text-2); background: var(--surface-2); padding: .2rem .5rem; border-radius: 5px; }
.cron-toast { font-size: .72rem; white-space: nowrap; }
.cron-shared { font-family: var(--font-mono); font-size: .76rem; padding: .35rem 0; display: inline-block; opacity: .7; }
th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable:hover { color: var(--text); }
.sort-ic { font-size: .6rem; opacity: .55; margin-left: .2rem; }

/* ============================================================================
   Notification status text
   ============================================================================ */
.notif-ready { color: var(--success); font-weight: 600; font-size: .78rem; }
.notif-waiting-cond { color: var(--purple); font-size: .78rem; }
.notif-retry { color: var(--danger); font-weight: 700; font-size: .7rem; }

/* ============================================================================
   Journey editor
   ============================================================================ */
.editor-toolbar { display: flex; align-items: center; gap: .5rem; margin: .2rem 0 .9rem; }
/* No resting outline — the lifted fill (surface-2) separates each step from the
   card, and the inset dark fields carry the structure. The 1px transparent border
   is kept only so the dirty / save-ok / save-err states can tint it as feedback. */
.editor-step {
  border: 1px solid transparent; border-radius: var(--radius);
  margin-bottom: 1rem;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
  background: var(--surface-2);
}
.editor-step:hover { box-shadow: var(--shadow-sm); }
.editor-step.collapsed:hover { background: var(--surface-3); }

/* Compact summary row */
.editor-summary { display: flex; align-items: center; gap: .6rem; padding: .85rem 1.1rem; cursor: pointer; user-select: none; }
.es-name { font-weight: 700; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60%; flex-shrink: 0; }
.es-summary { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.es-chevron { margin-left: auto; color: var(--muted); font-size: .9rem; transition: transform var(--transition); flex-shrink: 0; }
.es-chevron.open { transform: rotate(180deg); }
.editor-step.dirty .es-chevron { color: var(--warning); }

/* Expanded body */
.editor-body { padding: 0 1.25rem 1.15rem; border-top: 1px solid var(--border-faint); margin-top: -.2rem; padding-top: 1rem; }
.editor-step.save-ok { border-color: var(--success); box-shadow: 0 0 0 3px var(--success-bg); }
.editor-step.save-err { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-bg); }
.editor-step.dirty { border-color: var(--warning); }
.unsaved-badge {
  font-size: .62rem; font-weight: 700; color: var(--warning); background: var(--warning-bg);
  padding: .2rem .55rem; border-radius: var(--radius-pill); white-space: nowrap;
}
.step-role-badge {
  font-size: .6rem; font-weight: 700; padding: .2rem .55rem; border-radius: var(--radius-pill);
  background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); white-space: nowrap;
}
.editor-header { display: flex; align-items: center; gap: .55rem; margin-bottom: .9rem; flex-wrap: wrap; }
.editor-header .je-name { flex: 1; min-width: 130px; font-weight: 700; font-size: .88rem; }
.step-number-badge {
  min-width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: 50%;
  background: var(--accent); color: var(--accent-contrast); font-size: .74rem; font-weight: 700; flex-shrink: 0;
}
.section { margin-bottom: .85rem; }
.section > label { display: block; margin-bottom: .35rem; }
/* Bottom-align so inputs share one baseline even when a label wraps to two lines (e.g. "No later than / days before") */
.step-fields { display: grid; grid-template-columns: 96px 1fr 1fr; gap: .75rem; align-items: end; margin-bottom: .3rem; }
/* Auto-flowing variant — fields wrap to new rows instead of crushing each other on narrow windows. */
.step-fields-auto { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.step-fields .field-group input,
.step-fields .field-group select { width: 100%; }

/* ============================================================================
   Variant / item rows
   ============================================================================ */
.variant-remove { background: none; border: none; color: color-mix(in srgb, var(--danger) 70%, #000); cursor: pointer; font-size: .9rem; padding: .15rem .35rem; margin-left: auto; opacity: .7; }
.variant-remove:hover { opacity: 1; background: none; }
.variant-list { display: flex; flex-direction: column; gap: .5rem; margin-bottom: .5rem; }
.variant-row {
  position: relative;
  display: flex; flex-wrap: wrap; align-items: center; gap: .55rem;
  padding: .55rem .65rem; background: var(--surface-2); border: 1px solid transparent; border-radius: var(--radius-sm);
}
.variant-row .item-id { flex: 0 0 200px; }
.variant-row .item-template,
.variant-row .item-title,
.variant-row .item-body { flex: 1 1 150px; min-width: 130px; }
.variant-row .variant-remove { margin-left: auto; }
.drag-handle { cursor: grab; user-select: none; color: var(--faint); font-size: 1rem; line-height: 1; padding: 0 .15rem; flex: 0 0 auto; }
.drag-handle:active { cursor: grabbing; }
.variant-row.drag-ghost { opacity: .4; }
.variant-row.drop-above::before,
.variant-row.drop-below::after {
  content: ''; position: absolute; left: .2rem; right: .2rem; height: 3px; z-index: 3;
  background: var(--accent); border-radius: 2px; box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent);
}
.variant-row.drop-above::before { top: -5px; }
.variant-row.drop-below::after { bottom: -5px; }

/* ============================================================================
   Tooltips
   ============================================================================ */
.tooltip-wrap { position: relative; display: inline-flex; align-items: center; gap: .3rem; }
.tooltip-icon {
  display: inline-flex; align-items: center; justify-content: center; width: 15px; height: 15px;
  border-radius: 50%; background: var(--muted); color: var(--surface); font-size: .62rem; font-weight: 800;
  cursor: default; flex-shrink: 0; line-height: 1;
}
.tooltip-box {
  position: absolute; bottom: calc(100% + 7px); left: 0; background: var(--text); color: var(--surface);
  font-size: .72rem; font-weight: 400; padding: .5rem .7rem; border-radius: var(--radius-xs); white-space: normal;
  width: 250px; line-height: 1.45; z-index: 100; pointer-events: none; opacity: 0; transition: opacity var(--transition);
  box-shadow: var(--shadow-lg); text-transform: none; letter-spacing: 0;
}
.tooltip-wrap:hover .tooltip-box { opacity: 1; }

/* ============================================================================
   Queue log / notification log
   ============================================================================ */
.q-log-entry { padding: .3rem .5rem; border-radius: var(--radius-xs); margin-bottom: .2rem; display: flex; gap: .5rem; align-items: center; font-size: .74rem; font-family: var(--font-mono); }
.q-log-entry.success { background: var(--success-bg); }
.q-log-entry.error { background: var(--danger-bg); }
.log-row-error td { background: color-mix(in srgb, var(--danger) 8%, transparent); }
.log-row-skip td { background: color-mix(in srgb, var(--warning) 9%, transparent); }
.trace-id { font-family: var(--font-mono); font-size: .68rem; color: var(--muted); cursor: pointer; border-bottom: 1px dashed var(--border-strong); }
.trace-id:hover { color: var(--accent); border-bottom-color: var(--accent); }
.log-row-expandable { cursor: pointer; }
.log-row-expandable:hover td { background: color-mix(in srgb, var(--danger) 14%, transparent); }
.log-row-skip.log-row-expandable:hover td { background: color-mix(in srgb, var(--warning) 15%, transparent); }
.log-row-open td { border-bottom: none; }
.log-expand-caret { display: inline-block; width: .9rem; color: var(--muted); }
.log-detail-row td { padding-top: 0; }
.log-detail-text { font-family: var(--font-mono); font-size: .72rem; white-space: pre-wrap; word-break: break-word; color: var(--danger); background: color-mix(in srgb, var(--danger) 6%, transparent); border: 1px solid color-mix(in srgb, var(--danger) 20%, transparent); border-radius: var(--radius-xs); padding: .5rem .65rem; margin: 0 0 .35rem; max-height: 14rem; overflow-y: auto; }
.log-row-skip .log-detail-text { color: var(--text); background: color-mix(in srgb, var(--warning) 8%, transparent); border-color: color-mix(in srgb, var(--warning) 25%, transparent); }

/* ============================================================================
   Misc
   ============================================================================ */
.toast { font-size: .78rem; font-weight: 600; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn-spinner { display: inline-block; width: 12px; height: 12px; border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff; border-radius: 50%; animation: spin .65s linear infinite; vertical-align: middle; }
.data-loading { opacity: .5; transition: opacity var(--transition); pointer-events: none; }

/* Small inline spinner — page-transition indicator in the pager. */
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--border-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin .65s linear infinite; vertical-align: middle; }

@keyframes fadeInUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.tab-panel { animation: fadeInUp .22s ease both; }

/* ============================================================================
   Responsive — collapse sidebar
   ============================================================================ */
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: static; height: auto; flex-direction: row; align-items: center;
    flex-wrap: wrap; gap: .4rem; border-right: 0; border-bottom: 1px solid var(--border);
  }
  .sidebar-brand { padding: .25rem .5rem; }
  .nav { flex-direction: row; flex-wrap: wrap; margin-top: 0; }
  .nav-label { display: none; }
  .nav-item.active::before { display: none; }
  .sidebar-foot { margin-top: 0; border-top: 0; flex-direction: row; padding-top: 0; }
  .content, .topbar { padding-left: 1rem; padding-right: 1rem; }
}

/* ============================================================================
   Modal (replaces native prompt/confirm)
   ============================================================================ */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 1000;
  background: color-mix(in srgb, var(--ink, #00322c) 45%, transparent);
  backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
  animation: fadeInUp .15s ease both;
}
.modal {
  background: var(--surface, #fff); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: 0 18px 50px rgba(0, 30, 26, .28);
  width: min(440px, calc(100vw - 2rem)); padding: 1.25rem 1.4rem 1.15rem;
}
.modal-title { margin: 0 0 .45rem; font-size: 1rem; }
.modal-text { margin: 0; font-size: .82rem; color: var(--muted); line-height: 1.45; }
.modal-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1rem; }

/* ============================================================================
   Editor extras — empty state, icon buttons, subject chip
   ============================================================================ */
.empty-state {
  text-align: center; padding: 2.2rem 1rem; border: 1px dashed var(--border-strong);
  border-radius: var(--radius); margin: .8rem 0;
}
.empty-state-icon { font-size: 1.8rem; margin-bottom: .35rem; }
.empty-state strong { display: block; font-size: .95rem; margin-bottom: .25rem; }
.empty-state p { font-size: .78rem; color: var(--muted); margin: 0 0 .9rem; line-height: 1.5; }

.icon-btn { font-size: .8rem; padding: .3rem .5rem; margin-left: .3rem; line-height: 1; }
.icon-btn:disabled { opacity: .4; }
.danger-hover:hover:not(:disabled) { border-color: var(--danger); color: var(--danger); }

.subject-chip {
  display: inline-block; margin-left: .4rem; padding: .05rem .4rem;
  font-size: .64rem; font-weight: 600; border-radius: 99px;
  background: color-mix(in srgb, var(--purple, #7c5cff) 14%, transparent);
  color: var(--purple, #7c5cff); vertical-align: middle; white-space: nowrap;
}

/* ============================================================================
   Inline SVG icons
   ============================================================================ */
.ic { width: 1.05em; height: 1.05em; flex-shrink: 0; vertical-align: -.16em; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ic-sm { width: .9em; height: .9em; }
.ic-lg { width: 1.3em; height: 1.3em; }

/* ============================================================================
   Toast stack (corner notifications)
   ============================================================================ */
.toast-stack { position: fixed; right: 1.2rem; bottom: 1.2rem; z-index: 1200; display: flex; flex-direction: column; gap: .5rem; max-width: 360px; }
.toast-item {
  display: flex; align-items: flex-start; gap: .55rem;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-left: 3px solid var(--success); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg); padding: .7rem .9rem; font-size: .8rem;
  animation: toastIn .18s ease both;
}
.toast-item.err { border-left-color: var(--danger); }
.toast-item .ic { margin-top: .1em; color: var(--success); }
.toast-item.err .ic { color: var(--danger); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ============================================================================
   Skeleton loading
   ============================================================================ */
.skel { position: relative; overflow: hidden; background: var(--surface-2); border-radius: var(--radius-xs); color: transparent !important; min-height: .9em; }
.skel::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent);
  animation: skelSweep 1.2s infinite;
}
@keyframes skelSweep { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* ============================================================================
   Journey editor — timeline rail
   ============================================================================ */
.step-list { position: relative; padding-left: 148px; }
.step-list::before {
  content: ''; position: absolute; left: 118px; top: 10px; bottom: 10px;
  width: 2px; background: var(--border-strong); border-radius: 2px;
}
.step-list .editor-step { position: relative; }
.step-list .editor-step::before {
  content: ''; position: absolute; left: -35px; top: 1.35rem;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--surface); border: 3px solid var(--brand);
  box-shadow: 0 0 0 3px var(--surface);
}
.tl-marker {
  position: absolute; left: -148px; top: 1.15rem; width: 104px;
  text-align: right; line-height: 1.25;
}
.tl-days { display: block; font-weight: 700; font-size: .78rem; color: var(--brand); }
.tl-anchor { display: block; font-size: .64rem; color: var(--muted); }
.tl-phase {
  position: relative; margin: 0 0 1rem; padding: .2rem 0 .2rem 0;
  font-size: .66rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--faint);
}
@media (max-width: 900px) {
  .step-list { padding-left: 0; }
  .step-list::before, .step-list .editor-step::before { display: none; }
  .tl-marker { display: none; }
}

/* ============================================================================
   Phone notification preview
   ============================================================================ */
.phone-preview {
  background: linear-gradient(160deg, #0e1a2b 0%, #23364f 100%);
  border-radius: 22px; padding: 1.7rem .9rem 1.4rem; max-width: 300px;
  box-shadow: var(--shadow), inset 0 0 0 5px rgba(255,255,255,.06);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.phone-clock { text-align: center; color: rgba(255,255,255,.92); font-size: 1.6rem; font-weight: 300; letter-spacing: .02em; margin-bottom: .9rem; }
.phone-notif {
  background: rgba(250, 250, 252, .92); border-radius: 14px; padding: .65rem .75rem;
  color: #111; box-shadow: 0 4px 18px rgba(0,0,0,.35);
}
.phone-notif-head { display: flex; align-items: center; gap: .4rem; margin-bottom: .25rem; }
.phone-app-icon {
  width: 18px; height: 18px; border-radius: 5px; flex-shrink: 0;
  background: var(--thf-green); display: grid; place-items: center;
}
.phone-app-icon .thf-heart { width: 11px; height: 11px; background: #fff; }
.phone-app-name { font-size: .6rem; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: #555; flex: 1; }
.phone-when { font-size: .6rem; color: #888; }
.phone-notif-title { font-size: .76rem; font-weight: 700; line-height: 1.3; }
.phone-notif-body { font-size: .74rem; line-height: 1.35; color: #333; word-break: break-word; }
.phone-hint { font-size: .64rem; color: var(--faint); text-align: center; margin-top: .45rem; }
.editor-content-grid { display: grid; grid-template-columns: 1fr 300px; gap: 1.1rem; align-items: start; }
@media (max-width: 980px) { .editor-content-grid { grid-template-columns: 1fr; } .phone-preview { max-width: 340px; } }
.token-chips { display: flex; gap: .35rem; flex-wrap: wrap; margin-top: .35rem; }
.token-chip {
  font-size: .66rem; font-weight: 600; font-family: var(--font-mono);
  background: var(--brand-soft); color: var(--brand); border: 1px solid transparent;
  border-radius: var(--radius-pill); padding: .14rem .55rem; cursor: pointer;
}
.token-chip:hover { border-color: var(--brand); background: var(--brand-soft); }

/* ============================================================================
   Unsaved-changes bar (sticky)
   ============================================================================ */
.savebar {
  position: sticky; bottom: 1rem; z-index: 40;
  display: flex; align-items: center; gap: .7rem;
  background: var(--brand); color: var(--brand-contrast);
  border-radius: var(--radius); padding: .65rem 1rem;
  box-shadow: var(--shadow-lg); margin-top: 1rem;
  animation: toastIn .18s ease both;
}
.savebar .savebar-msg { font-size: .82rem; font-weight: 600; flex: 1; }
.savebar button { background: #fff; color: var(--brand); }
.savebar button:hover { background: var(--thf-aqua); }
.savebar button.ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
.savebar button.ghost:hover { background: rgba(255,255,255,.12); }

/* ============================================================================
   Booking detail drawer
   ============================================================================ */
.drawer-backdrop { position: fixed; inset: 0; z-index: 900; background: rgba(0, 40, 34, .28); animation: toastIn .15s ease both; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 950;
  width: min(480px, 94vw); background: var(--surface);
  border-left: 1px solid var(--border); box-shadow: var(--shadow-pop);
  display: flex; flex-direction: column;
  animation: drawerIn .22s cubic-bezier(.4, 0, .2, 1) both;
}
@keyframes drawerIn { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-head {
  display: flex; align-items: center; gap: .6rem; padding: 1.05rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.drawer-title { font-family: var(--font-display); font-size: 1.25rem; color: var(--brand); flex: 1; }
.drawer-close { background: transparent; border: 0; color: var(--muted); padding: .3rem; cursor: pointer; }
.drawer-close:hover { background: var(--surface-2); color: var(--text); border-radius: var(--radius-xs); }
.drawer-body { flex: 1; overflow-y: auto; padding: 1.1rem 1.25rem 2rem; }
.drawer-section { margin-bottom: 1.4rem; }
.drawer-section > h3 { margin-bottom: .6rem; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); }
.drawer-kv { display: grid; grid-template-columns: auto 1fr; gap: .3rem .9rem; font-size: .8rem; }
.drawer-kv dt { color: var(--muted); }
.drawer-kv dd { margin: 0; font-weight: 600; }

/* Vertical journey progress inside the drawer */
.jprog { position: relative; padding-left: 22px; }
.jprog::before { content: ''; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: var(--border-strong); }
.jprog-step { position: relative; padding: .32rem 0 .32rem .35rem; font-size: .8rem; display: flex; gap: .5rem; align-items: baseline; }
.jprog-step::before {
  content: ''; position: absolute; left: -20px; top: .62rem;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--surface); border: 2.5px solid var(--border-strong);
}
.jprog-step.done { color: var(--muted); }
.jprog-step.done::before { background: var(--success); border-color: var(--success); }
.jprog-step.current { font-weight: 700; }
.jprog-step.current::before { border-color: var(--brand); background: var(--surface); box-shadow: 0 0 0 3px var(--brand-soft); }
.jprog-when { margin-left: auto; font-size: .7rem; color: var(--faint); white-space: nowrap; }

/* History list inside drawer */
.hist-item { display: flex; gap: .55rem; align-items: flex-start; padding: .45rem 0; border-bottom: 1px solid var(--border-faint); font-size: .78rem; }
.hist-item:last-child { border-bottom: 0; }
.hist-when { color: var(--faint); font-size: .68rem; white-space: nowrap; margin-top: .1rem; min-width: 88px; }
.hist-main { flex: 1; min-width: 0; }
.hist-title { font-weight: 600; }
.hist-err { color: var(--danger); font-size: .72rem; }

/* Row click affordance on drill-down tables */
tr.rowlink { cursor: pointer; }

/* ============================================================================
   Segmented tabs (dashboard journey filter)
   ============================================================================ */
.seg-tabs { display: inline-flex; gap: .25rem; padding: .25rem; margin-bottom: 1.15rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-pill); box-shadow: var(--shadow-sm); flex-wrap: wrap; }
.seg { display: inline-flex; align-items: center; gap: .4rem; padding: .4rem .9rem;
  border: 0; background: transparent; color: var(--muted); font-weight: 600; font-size: .82rem;
  border-radius: var(--radius-pill); cursor: pointer; transition: background var(--transition), color var(--transition); white-space: nowrap; }
.seg:hover { color: var(--text); background: var(--surface-2); }
.seg.active { background: var(--brand); color: var(--brand-contrast); }
.seg.active:hover { background: var(--brand-hover); }
