/* =========================================================================
   Flix Town Panel — design system
   One stylesheet. Tokens first, then layout, components, pages.
   ========================================================================= */

@font-face {
  font-family: "Geist";
  src: url("/static/fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;

  /* Surfaces: each step is one layer closer to the viewer */
  --bg: #0b0b0d;
  --bg-2: #111216;
  --surface: #17181d;
  --surface-2: #1d1f24;
  --surface-3: #25272d;
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.12);
  --line-3: rgba(255, 255, 255, 0.18);

  --text: #f5f5f7;
  --text-2: #b7bac2;
  --text-3: #7d818b;

  /* Flix red: slightly deeper than broadcast red so it reads premium on charcoal */
  --red: #dc1f2e;
  --red-hi: #ef3341;
  --red-lo: #b3141f;
  --red-soft: rgba(220, 31, 46, 0.14);
  --red-glow: 0 0 0 1px rgba(220, 31, 46, 0.55), 0 0 18px -2px rgba(220, 31, 46, 0.45);

  --ok: #22c55e;
  --ok-text: #5ee08f;
  --ok-soft: rgba(34, 197, 94, 0.12);
  --warn: #f59e0b;
  --warn-text: #fbbf4d;
  --warn-soft: rgba(245, 158, 11, 0.13);
  --danger: #ef4444;
  --danger-text: #fb7676;
  --danger-soft: rgba(239, 68, 68, 0.13);
  --info: #60a5fa;
  --info-soft: rgba(96, 165, 250, 0.12);

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

  /* Type scale (px): 12 · 13 · 14 · 16 · 20 · 28 · 34 */
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-md: 14px;
  --fs-lg: 16px;
  --fs-xl: 20px;
  --fs-2xl: 28px;
  --fs-3xl: 34px;

  /* Radii follow hierarchy: controls < cards < dialogs */
  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;

  --sidebar: 248px;
  --sidebar-c: 72px;
  --topbar: 64px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --t: 160ms;
  --shadow-pop: 0 24px 60px -12px rgba(0, 0, 0, .65), 0 0 0 1px var(--line-2);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-md);
  line-height: 1.5;
  font-feature-settings: "ss01" on;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }
code, .mono-ish { font-variant-numeric: tabular-nums; }
code {
  font-family: var(--font);
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  padding: 1px 6px;
  font-size: var(--fs-sm);
}
.num, td, .kpi-value, .chip, .stat b { font-variant-numeric: tabular-nums; }
::selection { background: rgba(220, 31, 46, .35); }
:focus-visible { outline: none; box-shadow: var(--red-glow); border-radius: var(--r-xs); }
[hidden] { display: none !important; }

.icon { width: 18px; height: 18px; flex: none; display: inline-block; vertical-align: middle; }
.icon-sm { width: 15px; height: 15px; }
.icon-lg { width: 22px; height: 22px; }

/* -------------------------------------------------------------------------
   App shell
   ------------------------------------------------------------------------- */
.shell { min-height: 100vh; }

.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 40;
  width: var(--sidebar);
  display: flex; flex-direction: column;
  background: var(--bg-2);
  border-right: 1px solid var(--line);
  transition: width var(--t) var(--ease), transform var(--t) var(--ease);
}
.brand {
  display: flex; align-items: center; gap: 12px;
  height: var(--topbar); padding: 0 18px;
  border-bottom: 1px solid var(--line);
}
.brand-mark {
  width: 34px; height: 34px; flex: none;
  display: grid; place-items: center;
  border-radius: 10px;
  background: linear-gradient(160deg, #e3283a, #a3121d);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22), 0 6px 18px -6px rgba(220,31,46,.7);
  font-weight: 750; font-size: 15px; letter-spacing: -.04em; color: #fff;
}
.brand-name { font-weight: 650; font-size: var(--fs-lg); letter-spacing: -.02em; white-space: nowrap; }
.brand-name small { display: block; font-size: var(--fs-xs); color: var(--text-3); font-weight: 500; letter-spacing: 0; }

.nav { flex: 1; overflow-y: auto; padding: 14px 12px; }
.nav-group + .nav-group { margin-top: 18px; }
.nav-label {
  padding: 0 10px 6px; color: var(--text-3);
  font-size: var(--fs-xs); font-weight: 500; white-space: nowrap;
}
.nav-link {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  height: 38px; padding: 0 10px; margin: 1px 0;
  border-radius: var(--r-sm);
  color: var(--text-2); font-weight: 500; white-space: nowrap;
  transition: background var(--t) var(--ease), color var(--t) var(--ease);
}
.nav-link .icon { color: var(--text-3); transition: color var(--t) var(--ease); }
.nav-link:hover { background: var(--surface); color: var(--text); }
.nav-link:hover .icon { color: var(--text-2); }
.nav-link.active { background: var(--surface-2); color: var(--text); }
.nav-link.active .icon { color: var(--red-hi); }
.nav-link.active::before {
  content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--red);
  box-shadow: 0 0 12px 1px rgba(220,31,46,.65);
}
.nav-badge {
  margin-left: auto; min-width: 22px; height: 20px; padding: 0 7px;
  display: grid; place-items: center; border-radius: 10px;
  background: var(--warn-soft); color: var(--warn-text); font-size: 11px; font-weight: 600;
}

.sidebar-foot { border-top: 1px solid var(--line); padding: 12px; }
.account {
  display: flex; align-items: center; gap: 10px;
  padding: 8px; border-radius: var(--r-sm); background: var(--surface);
  border: 1px solid var(--line);
}
.avatar {
  width: 32px; height: 32px; flex: none; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface-3); border: 1px solid var(--line-2);
  font-weight: 600; font-size: var(--fs-sm); text-transform: uppercase;
}
.account-meta { min-width: 0; flex: 1; line-height: 1.25; }
.account-meta b { display: block; font-weight: 600; font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-meta span { color: var(--text-3); font-size: var(--fs-xs); }
.collapse-btn { margin-top: 8px; width: 100%; justify-content: flex-start; }

.main { margin-left: var(--sidebar); min-width: 0; transition: margin-left var(--t) var(--ease); }

/* Collapsed rail */
:is(.shell.collapsed, .pre-collapsed .shell) .sidebar { width: var(--sidebar-c); }
:is(.shell.collapsed, .pre-collapsed .shell) .main { margin-left: var(--sidebar-c); }
:is(.shell.collapsed, .pre-collapsed .shell) .brand { padding: 0 19px; }
:is(.shell.collapsed, .pre-collapsed .shell) .brand-name,
:is(.shell.collapsed, .pre-collapsed .shell) .nav-label,
:is(.shell.collapsed, .pre-collapsed .shell) .nav-link span,
:is(.shell.collapsed, .pre-collapsed .shell) .nav-badge,
:is(.shell.collapsed, .pre-collapsed .shell) .account-meta,
:is(.shell.collapsed, .pre-collapsed .shell) .account .btn,
:is(.shell.collapsed, .pre-collapsed .shell) .collapse-btn span { display: none; }
:is(.shell.collapsed, .pre-collapsed .shell) .nav-link { justify-content: center; padding: 0; }
:is(.shell.collapsed, .pre-collapsed .shell) .nav-group + .nav-group { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
:is(.shell.collapsed, .pre-collapsed .shell) .account { justify-content: center; padding: 6px; }
:is(.shell.collapsed, .pre-collapsed .shell) .collapse-btn { justify-content: center; }

:is(.shell.collapsed, .pre-collapsed .shell) .nav-link::after {
  content: attr(data-tip-collapsed);
  position: absolute; left: calc(100% + 14px); top: 50%; transform: translate(-4px, -50%);
  padding: 5px 9px; border-radius: var(--r-xs); background: #2b2d34; border: 1px solid var(--line-2);
  color: var(--text); font-size: var(--fs-xs); white-space: nowrap; pointer-events: none;
  opacity: 0; transition: opacity var(--t) var(--ease), transform var(--t) var(--ease); z-index: 60;
}
:is(.shell.collapsed, .pre-collapsed .shell) .nav-link:hover::after { opacity: 1; transform: translate(0, -50%); }
:is(.shell.collapsed, .pre-collapsed .shell) .nav { overflow: visible; }

/* Top bar: a thin layer of glass over the content */
.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--topbar);
  display: flex; align-items: center; gap: 14px;
  padding: 0 28px;
  background: rgba(11, 11, 13, .72);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-title { min-width: 0; }
.crumb { color: var(--text-3); font-size: var(--fs-sm); white-space: nowrap; }
.crumb b { color: var(--text); font-weight: 600; }
.topbar-spacer { flex: 1; }
.search {
  position: relative; width: min(340px, 34vw);
}
.search .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-3); width: 16px; height: 16px; }

.health {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 12px; border-radius: 18px;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--text-2); font-size: var(--fs-sm); white-space: nowrap;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); flex: none; }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 3px rgba(34,197,94,.16); }
.dot.warn { background: var(--warn); box-shadow: 0 0 0 3px rgba(245,158,11,.16); }
.dot.bad { background: var(--danger); box-shadow: 0 0 0 3px rgba(239,68,68,.18); }
.topbar .menu-btn { display: none; }

/* Profile dropdown (native <details>, no framework) */
.dropdown { position: relative; }
.dropdown > summary { list-style: none; cursor: pointer; }
.dropdown > summary::-webkit-details-marker { display: none; }
.dropdown-panel {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; z-index: 50;
  padding: 6px; border-radius: var(--r-md);
  background: var(--surface-2); box-shadow: var(--shadow-pop);
  animation: pop var(--t) var(--ease);
}
.dropdown-head { padding: 10px 10px 8px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.dropdown-head b { display: block; }
.dropdown-head span { color: var(--text-3); font-size: var(--fs-sm); }
.dropdown-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 10px; border-radius: var(--r-xs); border: 0; background: none;
  color: var(--text-2); font: inherit; cursor: pointer; text-align: left;
}
.dropdown-item:hover { background: var(--surface-3); color: var(--text); }
.dropdown-item.danger:hover { color: var(--danger-text); }
.profile-trigger {
  display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 6px 0 4px;
  border-radius: 18px; border: 1px solid var(--line); background: var(--surface);
}
.profile-trigger .avatar { width: 28px; height: 28px; font-size: var(--fs-xs); }
.profile-trigger:hover { border-color: var(--line-2); }

.content { padding: 28px 28px 64px; max-width: 1480px; }

/* Page header */
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
  margin-bottom: 24px; flex-wrap: wrap;
}
.page-head h1 { margin: 0; font-size: var(--fs-xl); font-weight: 650; letter-spacing: -.02em; line-height: 1.25; }
.page-head p { margin: 4px 0 0; color: var(--text-3); font-size: var(--fs-md); max-width: 70ch; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* -------------------------------------------------------------------------
   Buttons — primary · secondary · success · danger · ghost; sm/normal; loading
   ------------------------------------------------------------------------- */
.btn {
  --h: 36px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--h); padding: 0 14px;
  border-radius: var(--r-sm); border: 1px solid var(--line-2);
  background: var(--surface-2); color: var(--text);
  font: inherit; font-size: var(--fs-md); font-weight: 550; line-height: 1;
  white-space: nowrap; cursor: pointer; user-select: none;
  transition: background var(--t) var(--ease), border-color var(--t) var(--ease), color var(--t) var(--ease), box-shadow var(--t) var(--ease), transform 80ms var(--ease);
}
.btn .icon { width: 16px; height: 16px; }
.btn:hover { background: var(--surface-3); border-color: var(--line-3); }
.btn:active { transform: translateY(1px); }
.btn-sm { --h: 30px; padding: 0 10px; font-size: var(--fs-sm); gap: 6px; border-radius: var(--r-xs); }
.btn-sm .icon { width: 14px; height: 14px; }
.btn-icon { width: var(--h); padding: 0; }

.btn-primary { background: var(--red); border-color: transparent; color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,.16); }
.btn-primary:hover { background: var(--red-hi); border-color: transparent; }
.btn-primary:active { background: var(--red-lo); }
.btn-primary:focus-visible { box-shadow: var(--red-glow); }

.btn-secondary { background: var(--surface-2); }

.btn-success { background: rgba(34,197,94,.14); border-color: rgba(34,197,94,.32); color: var(--ok-text); }
.btn-success:hover { background: rgba(34,197,94,.22); border-color: rgba(34,197,94,.45); }

.btn-danger { background: rgba(239,68,68,.12); border-color: rgba(239,68,68,.3); color: var(--danger-text); }
.btn-danger:hover { background: rgba(239,68,68,.2); border-color: rgba(239,68,68,.45); }
.btn-danger-solid { background: var(--danger); border-color: transparent; color: #fff; }
.btn-danger-solid:hover { background: #f05656; }

.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); border-color: transparent; color: var(--text); }
.btn-ghost.danger:hover { color: var(--danger-text); background: var(--danger-soft); }

.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; }
.btn[aria-busy="true"] { cursor: progress; opacity: .85; }
.btn[aria-busy="true"] .icon { display: none; }
.btn[aria-busy="true"]::before {
  content: ""; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: spin .7s linear infinite;
}
.btn-group { display: inline-flex; gap: 4px; align-items: center; }
.inline-form { display: inline; margin: 0; }

/* Tooltips */
[data-tip] { position: relative; }
[data-tip]::after {
  content: attr(data-tip);
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translate(-50%, 4px);
  padding: 5px 8px; border-radius: var(--r-xs);
  background: #2b2d34; color: var(--text); border: 1px solid var(--line-2);
  font-size: var(--fs-xs); font-weight: 500; white-space: nowrap; pointer-events: none;
  opacity: 0; transition: opacity var(--t) var(--ease), transform var(--t) var(--ease);
  z-index: 60;
}
[data-tip]:hover::after, [data-tip]:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }

/* -------------------------------------------------------------------------
   Forms
   ------------------------------------------------------------------------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-all { grid-column: 1 / -1; }
.form-section + .form-section { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line); }
.form-section h3 { margin: 0 0 4px; font-size: var(--fs-md); font-weight: 600; }
.form-section > p { margin: 0 0 16px; color: var(--text-3); font-size: var(--fs-sm); }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: var(--fs-sm); font-weight: 550; color: var(--text-2); }
.field .help, .help { font-size: var(--fs-xs); color: var(--text-3); line-height: 1.45; }
.field .error-text { font-size: var(--fs-xs); color: var(--danger-text); }

.input, .select, .textarea,
.field input:not([type=checkbox]):not([type=radio]),
.field select, .field textarea, .search input, .toolbar input, .toolbar select {
  width: 100%; height: 38px; padding: 0 12px;
  border-radius: var(--r-sm); border: 1px solid var(--line-2);
  background: var(--bg-2); color: var(--text);
  font: inherit; font-size: var(--fs-md);
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease), background var(--t) var(--ease);
}
.field textarea, .textarea { height: auto; min-height: 104px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.field select, .select, .toolbar select {
  appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237d818b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.field input::placeholder, .field textarea::placeholder, .search input::placeholder, .toolbar input::placeholder { color: var(--text-3); }
.field input:hover, .field select:hover, .field textarea:hover, .toolbar input:hover, .toolbar select:hover, .search input:hover { border-color: var(--line-3); }
.field input:focus, .field select:focus, .field textarea:focus, .toolbar input:focus, .toolbar select:focus, .search input:focus, .input:focus {
  outline: none; border-color: rgba(220,31,46,.7); box-shadow: 0 0 0 3px rgba(220,31,46,.18); background: var(--surface);
}
.field input:disabled, .field select:disabled, .field textarea:disabled { opacity: .5; cursor: not-allowed; }
.field input:user-invalid, .field.is-invalid input, .field.is-invalid select { border-color: rgba(239,68,68,.7); box-shadow: 0 0 0 3px rgba(239,68,68,.14); }
.field input[type="datetime-local"]::-webkit-calendar-picker-indicator,
.field input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(.75); cursor: pointer; opacity: .8; }
.field input[readonly] { background: var(--surface); color: var(--text-2); }

/* Input with trailing button (password reveal, copy) */
.input-group { position: relative; display: flex; }
.input-group input { padding-right: 44px; }
.input-group .btn { position: absolute; right: 4px; top: 4px; --h: 30px; }

/* Number stepper */
.stepper { display: flex; align-items: stretch; }
.stepper input { text-align: center; border-radius: 0 !important; border-left: 0 !important; border-right: 0 !important; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper .btn { --h: 38px; width: 38px; padding: 0; border-radius: 0; background: var(--surface); }
.stepper .btn:first-child { border-radius: var(--r-sm) 0 0 var(--r-sm); }
.stepper .btn:last-child { border-radius: 0 var(--r-sm) var(--r-sm) 0; }

/* Checkbox + toggle */
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; color: var(--text-2); font-size: var(--fs-md); }
.check input[type=checkbox] {
  appearance: none; -webkit-appearance: none; margin: 0;
  width: 18px; height: 18px; flex: none; border-radius: 5px;
  border: 1px solid var(--line-3); background: var(--bg-2); display: grid; place-items: center;
  transition: background var(--t) var(--ease), border-color var(--t) var(--ease);
}
.check input[type=checkbox]::after {
  content: ""; width: 9px; height: 5px; border: 2px solid #fff; border-top: 0; border-right: 0;
  transform: rotate(-45deg) translate(1px, -1px) scale(0); transition: transform var(--t) var(--ease);
}
.check input[type=checkbox]:checked { background: var(--red); border-color: var(--red); }
.check input[type=checkbox]:checked::after { transform: rotate(-45deg) translate(1px, -1px) scale(1); }
.check:hover input[type=checkbox]:not(:checked) { border-color: var(--text-3); }
.toggle { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; color: var(--text-2); }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle .track {
  width: 38px; height: 22px; border-radius: 11px; background: var(--surface-3); border: 1px solid var(--line-2);
  position: relative; transition: background var(--t) var(--ease), border-color var(--t) var(--ease); flex: none;
}
.toggle .track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--text-2); transition: transform var(--t) var(--ease), background var(--t) var(--ease);
}
.toggle input:checked + .track { background: var(--red); border-color: var(--red); }
.toggle input:checked + .track::after { transform: translateX(16px); background: #fff; }
.toggle input:focus-visible + .track { box-shadow: var(--red-glow); }

/* Searchable checkbox list (bouquets, user bouquets) */
.picker { border: 1px solid var(--line-2); border-radius: var(--r-md); background: var(--bg-2); overflow: hidden; }
.picker-head { display: flex; align-items: center; gap: 8px; padding: 8px; border-bottom: 1px solid var(--line); }
.picker-head input { height: 32px !important; }
.picker-head .count { color: var(--text-3); font-size: var(--fs-xs); white-space: nowrap; padding: 0 4px; }
.picker-list { max-height: 260px; overflow-y: auto; padding: 6px; }
.picker-list .check { display: flex; padding: 7px 8px; border-radius: var(--r-xs); width: 100%; }
.picker-list .check:hover { background: var(--surface); }
.picker-list .check small { margin-left: auto; color: var(--text-3); font-size: var(--fs-xs); }
.picker-empty { padding: 16px; color: var(--text-3); font-size: var(--fs-sm); text-align: center; }

/* -------------------------------------------------------------------------
   Cards, panels, KPIs
   ------------------------------------------------------------------------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  box-shadow: 0 1px 0 rgba(255,255,255,.03) inset;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.card-head h2, .card-head h3 { margin: 0; font-size: var(--fs-lg); font-weight: 600; letter-spacing: -.01em; }
.card-head p { margin: 2px 0 0; color: var(--text-3); font-size: var(--fs-sm); }
.card-body { padding: 20px; }
.card-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.stack { display: grid; gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }

.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.kpi {
  position: relative; padding: 16px 18px 18px; border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--line);
  transition: border-color var(--t) var(--ease), background var(--t) var(--ease);
}
a.kpi:hover { border-color: var(--line-2); background: var(--surface-2); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; color: var(--text-3); font-size: var(--fs-sm); }
.kpi-top .icon { width: 16px; height: 16px; }
.kpi-value { margin-top: 10px; font-size: var(--fs-2xl); font-weight: 650; letter-spacing: -.03em; line-height: 1.1; }
.kpi-sub { margin-top: 4px; color: var(--text-3); font-size: var(--fs-xs); }
.kpi.is-live .kpi-value { color: var(--text); }
.kpi.is-alert { border-color: rgba(245,158,11,.28); }
.kpi.is-alert .kpi-value { color: var(--warn-text); }

/* Dashboard status line — the one bold moment */
.status-hero {
  position: relative; overflow: hidden;
  padding: 26px 28px; margin-bottom: 18px;
  border-radius: var(--r-lg); border: 1px solid var(--line);
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(220,31,46,.16), transparent 46%),
    linear-gradient(180deg, var(--surface-2), var(--surface));
}
.status-hero.is-bad { background: radial-gradient(120% 140% at 0% 0%, rgba(239,68,68,.2), transparent 50%), linear-gradient(180deg, var(--surface-2), var(--surface)); }
.status-hero.is-warn { background: radial-gradient(120% 140% at 0% 0%, rgba(245,158,11,.14), transparent 50%), linear-gradient(180deg, var(--surface-2), var(--surface)); }
.status-line { display: flex; align-items: center; gap: 12px; color: var(--text-2); font-size: var(--fs-sm); }
.status-hero h2 {
  margin: 10px 0 0; max-width: 34ch;
  font-size: var(--fs-3xl); font-weight: 600; letter-spacing: -.035em; line-height: 1.12;
}
.status-hero h2 .muted { color: var(--text-3); }
.status-facts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }

/* Server / infrastructure card */
.server-card { overflow: hidden; }
.server-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 14px; }
.server-name { display: flex; align-items: center; gap: 12px; }
.server-icon {
  width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center;
  background: var(--surface-3); border: 1px solid var(--line-2); color: var(--text-2);
}
.server-name h3 { margin: 0; font-size: var(--fs-lg); font-weight: 600; }
.server-name p { margin: 2px 0 0; color: var(--text-3); font-size: var(--fs-sm); word-break: break-all; }
.meters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border-top: 1px solid var(--line); }
.meter { background: var(--surface); padding: 14px 20px 16px; }
.meter-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; color: var(--text-3); font-size: var(--fs-xs); }
.meter-top .icon { width: 14px; height: 14px; margin-right: 6px; }
.meter-value { margin-top: 6px; font-size: var(--fs-xl); font-weight: 600; letter-spacing: -.02em; }
.meter-value small { font-size: var(--fs-sm); color: var(--text-3); font-weight: 500; margin-left: 2px; }
.progress { height: 5px; margin-top: 10px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 3px; background: var(--text-2); transition: width .4s var(--ease); }
.progress.ok > span { background: var(--ok); }
.progress.warn > span { background: var(--warn); }
.progress.bad > span { background: var(--danger); }
.server-paths { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 12px 20px; border-top: 1px solid var(--line); color: var(--text-3); font-size: var(--fs-xs); }
.server-paths span { display: inline-flex; align-items: center; gap: 6px; }
.server-paths code { font-size: var(--fs-xs); }
.server-note { padding: 10px 20px; border-top: 1px solid var(--line); color: var(--warn-text); font-size: var(--fs-xs); background: rgba(245,158,11,.05); }

/* Key/value list */
.kv { display: grid; grid-template-columns: minmax(140px, 220px) 1fr; gap: 0; margin: 0; }
.kv dt, .kv dd { margin: 0; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: var(--fs-md); }
.kv dt { color: var(--text-3); }
.kv dd { color: var(--text); min-width: 0; word-break: break-word; }
.kv > :nth-last-child(-n+2) { border-bottom: 0; }

/* -------------------------------------------------------------------------
   Chips / status badges
   ------------------------------------------------------------------------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 9px; border-radius: 12px;
  font-size: var(--fs-xs); font-weight: 550; white-space: nowrap;
  background: var(--surface-3); color: var(--text-2); border: 1px solid var(--line);
}
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .9; }
.chip.plain::before { display: none; }
.chip.ok { background: var(--ok-soft); color: var(--ok-text); border-color: rgba(34,197,94,.22); }
.chip.warn { background: var(--warn-soft); color: var(--warn-text); border-color: rgba(245,158,11,.24); }
.chip.bad { background: var(--danger-soft); color: var(--danger-text); border-color: rgba(239,68,68,.24); }
.chip.info { background: var(--info-soft); color: #93c5fd; border-color: rgba(96,165,250,.22); }
.chip.red { background: var(--red-soft); color: #ff6b77; border-color: rgba(220,31,46,.3); }
.chip.muted { color: var(--text-3); }
.chip.pulse::before { animation: pulse 1.6s ease-in-out infinite; }
.chips { display: inline-flex; flex-wrap: wrap; gap: 6px; }

/* -------------------------------------------------------------------------
   Tables
   ------------------------------------------------------------------------- */
.table-card { overflow: hidden; }
.toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 14px; border-bottom: 1px solid var(--line);
}
.toolbar .grow { flex: 1; }
.toolbar input, .toolbar select { height: 34px; width: auto; min-width: 180px; background: var(--bg-2); }
.toolbar .search-input { position: relative; flex: 1; min-width: 200px; max-width: 360px; }
.toolbar .search-input input { width: 100%; padding-left: 34px; }
.toolbar .search-input .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--text-3); }
.toolbar .meta { color: var(--text-3); font-size: var(--fs-sm); margin-left: auto; }

.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--r-sm); background: var(--bg-2); border: 1px solid var(--line); }
.seg a, .seg button {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: 6px;
  border: 0; background: none; color: var(--text-3); font: inherit; font-size: var(--fs-sm); font-weight: 550; cursor: pointer;
  transition: background var(--t) var(--ease), color var(--t) var(--ease);
}
.seg a:hover, .seg button:hover { color: var(--text); }
.seg .on { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 0 rgba(255,255,255,.06) inset; }
.seg .n { color: var(--text-3); font-weight: 500; }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-wrap.tall { max-height: 70vh; overflow-y: auto; }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--fs-sm); }
.tbl th {
  position: sticky; top: 0; z-index: 2;
  height: 40px; padding: 0 14px; text-align: left; white-space: nowrap;
  background: var(--surface); color: var(--text-3); font-weight: 550; font-size: var(--fs-xs);
  border-bottom: 1px solid var(--line-2);
}
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; color: var(--text-2); }
.tbl tbody tr { transition: background var(--t) var(--ease); }
.tbl tbody tr:hover { background: rgba(255,255,255,.025); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .primary { color: var(--text); font-weight: 550; }
.tbl .sub { display: block; color: var(--text-3); font-size: var(--fs-xs); margin-top: 2px; font-weight: 400; }
.tbl .right, .tbl th.right { text-align: right; }
.tbl .actions { text-align: right; white-space: nowrap; width: 1%; }
.tbl .actions .btn-group { justify-content: flex-end; }
.tbl .path { max-width: 380px; word-break: break-all; color: var(--text-3); font-size: var(--fs-xs); }
.tbl .msg { max-width: 420px; color: var(--text-2); }
.tbl .w-min { width: 1%; white-space: nowrap; }
.tbl tr.is-dim td { opacity: .55; }
.title-cell { display: flex; align-items: center; gap: 12px; min-width: 220px; }
.poster {
  width: 34px; height: 50px; flex: none; border-radius: 5px; object-fit: cover;
  background: var(--surface-3); border: 1px solid var(--line);
  display: grid; place-items: center; color: var(--text-3);
}
.poster .icon { width: 15px; height: 15px; }
.poster-lg { width: 120px; height: 180px; border-radius: var(--r-sm); }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--line); color: var(--text-3); font-size: var(--fs-sm); }
.pager .btn-group { gap: 6px; }

.empty { padding: 48px 20px; text-align: center; }
.empty .empty-icon {
  width: 48px; height: 48px; margin: 0 auto 14px; border-radius: 14px; display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--line-2); color: var(--text-3);
}
.empty h3 { margin: 0; font-size: var(--fs-lg); font-weight: 600; }
.empty p { margin: 6px auto 16px; color: var(--text-3); max-width: 46ch; }

/* -------------------------------------------------------------------------
   Alerts + toasts
   ------------------------------------------------------------------------- */
.alert {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 14px; border-radius: var(--r-md); border: 1px solid var(--line-2);
  background: var(--surface); color: var(--text-2); font-size: var(--fs-md); margin-bottom: 16px;
}
.alert .icon { margin-top: 1px; }
.alert b { color: var(--text); font-weight: 600; }
.alert.ok { border-color: rgba(34,197,94,.28); background: rgba(34,197,94,.07); } .alert.ok .icon { color: var(--ok-text); }
.alert.warn { border-color: rgba(245,158,11,.3); background: rgba(245,158,11,.07); } .alert.warn .icon { color: var(--warn-text); }
.alert.bad { border-color: rgba(239,68,68,.3); background: rgba(239,68,68,.07); } .alert.bad .icon { color: var(--danger-text); }
.alert.info { border-color: rgba(96,165,250,.26); background: rgba(96,165,250,.06); } .alert.info .icon { color: #93c5fd; }

.toasts { position: fixed; right: 20px; top: 76px; z-index: 90; display: grid; gap: 10px; width: min(380px, calc(100vw - 32px)); }
.toast {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 13px 14px; border-radius: var(--r-md);
  background: var(--surface-2); box-shadow: var(--shadow-pop);
  border-left: 3px solid var(--text-3);
  animation: toast-in 200ms var(--ease);
}
.toast.ok { border-left-color: var(--ok); } .toast.ok > .icon { color: var(--ok-text); }
.toast.warn { border-left-color: var(--warn); } .toast.warn > .icon { color: var(--warn-text); }
.toast.bad { border-left-color: var(--danger); } .toast.bad > .icon { color: var(--danger-text); }
.toast.info { border-left-color: var(--info); } .toast.info > .icon { color: #93c5fd; }
.toast-body { flex: 1; font-size: var(--fs-md); color: var(--text-2); }
.toast-body b { display: block; color: var(--text); font-weight: 600; margin-bottom: 1px; }
.toast .close { margin: -4px -4px 0 0; }
.toast.leaving { animation: toast-out 180ms var(--ease) forwards; }

/* -------------------------------------------------------------------------
   Dialogs: confirm modal + side drawer (native <dialog>)
   ------------------------------------------------------------------------- */
dialog { color: var(--text); padding: 0; border: 0; background: transparent; max-width: none; max-height: none; }
dialog::backdrop { background: rgba(4, 4, 6, .66); backdrop-filter: blur(3px); }
.modal {
  width: min(440px, calc(100vw - 32px)); margin: auto;
  border-radius: var(--r-lg); background: var(--surface-2); box-shadow: var(--shadow-pop);
}
.modal[open] { animation: pop 180ms var(--ease); }
.modal-body { padding: 22px 22px 8px; display: flex; gap: 14px; }
.modal-icon {
  width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center;
  background: var(--danger-soft); color: var(--danger-text); border: 1px solid rgba(239,68,68,.25);
}
.modal h2 { margin: 2px 0 6px; font-size: var(--fs-lg); font-weight: 600; }
.modal p { margin: 0; color: var(--text-2); font-size: var(--fs-md); }
.modal-foot { padding: 18px 22px 20px; display: flex; justify-content: flex-end; gap: 8px; }

.drawer {
  position: fixed; inset: 0 0 0 auto; margin: 0; height: 100vh; height: 100dvh;
  width: min(620px, 100vw);
  background: var(--surface); border-left: 1px solid var(--line-2);
  box-shadow: -30px 0 80px -20px rgba(0,0,0,.7);
  display: none; flex-direction: column;
}
.drawer[open] { display: flex; animation: slide-in 200ms var(--ease); }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0; font-size: var(--fs-xl); font-weight: 650; letter-spacing: -.02em; }
.drawer-head p { margin: 4px 0 0; color: var(--text-3); font-size: var(--fs-sm); }
.drawer-body { flex: 1; overflow-y: auto; padding: 22px 24px; }
.drawer-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 24px; border-top: 1px solid var(--line); background: var(--bg-2); }
.drawer form { display: contents; }

/* -------------------------------------------------------------------------
   Login
   ------------------------------------------------------------------------- */
.login-page {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(60% 50% at 50% 0%, rgba(220,31,46,.14), transparent 70%),
    var(--bg);
}
.login-card { width: min(400px, 100%); }
.login-brand { display: flex; align-items: center; gap: 12px; justify-content: center; margin-bottom: 26px; }
.login-brand .brand-mark { width: 42px; height: 42px; border-radius: 12px; font-size: 18px; }
.login-brand b { font-size: var(--fs-xl); font-weight: 650; letter-spacing: -.02em; }
.login-panel { padding: 28px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: 0 30px 80px -30px rgba(0,0,0,.8); }
.login-panel h1 { margin: 0; font-size: var(--fs-xl); font-weight: 650; letter-spacing: -.02em; }
.login-panel > p { margin: 4px 0 22px; color: var(--text-3); }
.login-panel .field + .field { margin-top: 14px; }
.login-panel > .btn[type=submit] { width: 100%; margin-top: 22px; --h: 42px; }
.login-foot { margin-top: 18px; text-align: center; color: var(--text-3); font-size: var(--fs-xs); }

/* -------------------------------------------------------------------------
   Page-specific bits
   ------------------------------------------------------------------------- */
.split { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.automation-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-bottom: 20px; }
.job-state { display: flex; align-items: center; gap: 14px; }
.job-state .ring {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex: none;
  background: var(--surface-3); border: 1px solid var(--line-2); color: var(--text-2);
}
.job-state .ring.running { color: var(--red-hi); border-color: rgba(220,31,46,.4); box-shadow: 0 0 20px -6px rgba(220,31,46,.6); }
.job-state .ring.running .icon { animation: spin 1.6s linear infinite; }
.job-state h3 { margin: 0; font-size: var(--fs-lg); font-weight: 600; }
.job-state p { margin: 2px 0 0; color: var(--text-3); font-size: var(--fs-sm); }
.counts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border-top: 1px solid var(--line); }
.counts > div { background: var(--surface); padding: 14px 20px; }
.counts b { display: block; font-size: var(--fs-xl); font-weight: 600; letter-spacing: -.02em; }
.counts span { color: var(--text-3); font-size: var(--fs-xs); }
.counts .warn b { color: var(--warn-text); }
.counts .bad b { color: var(--danger-text); }
.progress-line { padding: 12px 20px; border-top: 1px solid var(--line); color: var(--text-2); font-size: var(--fs-sm); display: flex; gap: 10px; align-items: center; }

.retry-form { display: inline-flex; gap: 6px; align-items: center; }
.retry-form input { height: 30px !important; width: 128px !important; min-width: 0 !important; font-size: var(--fs-sm) !important; padding: 0 10px !important; border-radius: var(--r-xs) !important; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text); }
.retry-form input:focus { outline: none; border-color: rgba(220,31,46,.7); box-shadow: 0 0 0 3px rgba(220,31,46,.18); }

.extend-form { display: inline-flex; align-items: center; }
.extend-form select { height: 30px; border-radius: var(--r-xs) 0 0 var(--r-xs); border: 1px solid var(--line-2); border-right: 0; background-color: var(--bg-2); color: var(--text); font: inherit; font-size: var(--fs-sm); padding: 0 26px 0 8px; appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%237d818b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 7px center; }
.extend-form .btn { border-radius: 0 var(--r-xs) var(--r-xs) 0; }

.secret { display: inline-flex; align-items: center; gap: 8px; }
.secret code { letter-spacing: .08em; }
.season { margin-top: 16px; }
.season:first-child { margin-top: 0; }
.season-head { display: flex; align-items: center; justify-content: space-between; padding: 0 2px 10px; }
.season-head h3 { margin: 0; font-size: var(--fs-md); font-weight: 600; }
.ep-still { width: 96px; height: 54px; border-radius: 6px; object-fit: cover; background: var(--surface-3); border: 1px solid var(--line); display: grid; place-items: center; color: var(--text-3); flex: none; }
.series-hero { display: flex; gap: 22px; padding: 22px; }
.series-hero h2 { margin: 0; font-size: var(--fs-2xl); font-weight: 650; letter-spacing: -.03em; }
.series-hero p.plot { color: var(--text-2); max-width: 75ch; margin: 10px 0 14px; }
.muted { color: var(--text-3); }
.text-ok { color: var(--ok-text); } .text-warn { color: var(--warn-text); } .text-bad { color: var(--danger-text); }
.mt-0 { margin-top: 0; } .mt-16 { margin-top: 16px; } .mt-20 { margin-top: 20px; } .mb-20 { margin-bottom: 20px; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* -------------------------------------------------------------------------
   Motion
   ------------------------------------------------------------------------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes pop { from { opacity: 0; transform: translateY(4px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes slide-in { from { transform: translateX(24px); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(16px); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}

/* -------------------------------------------------------------------------
   Responsive
   ------------------------------------------------------------------------- */
@media (max-width: 1380px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1180px) {
  .split { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .sidebar { transform: translateX(-100%); width: var(--sidebar) !important; box-shadow: 30px 0 80px -20px rgba(0,0,0,.8); }
  .shell.nav-open .sidebar { transform: none; }
  .shell.nav-open::after { content: ""; position: fixed; inset: 0; z-index: 35; background: rgba(0,0,0,.55); }
  .main, :is(.shell.collapsed, .pre-collapsed .shell) .main { margin-left: 0; }
  :is(.shell.collapsed, .pre-collapsed .shell) .brand-name, :is(.shell.collapsed, .pre-collapsed .shell) .nav-label, :is(.shell.collapsed, .pre-collapsed .shell) .nav-link span, :is(.shell.collapsed, .pre-collapsed .shell) .account-meta { display: revert; }
  :is(.shell.collapsed, .pre-collapsed .shell) .nav-link { justify-content: flex-start; padding: 0 10px; }
  .collapse-btn { display: none !important; }
  .topbar .menu-btn { display: inline-flex; }
  .topbar { padding: 0 16px; }
  .content { padding: 20px 16px 48px; }
  .search { display: none; }
  .automation-tiles, .grid-2 { grid-template-columns: 1fr; }
  .meters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3, .form-grid, .form-grid.cols-3 { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .status-hero { padding: 20px; }
  .status-hero h2 { font-size: var(--fs-2xl); }
  .health span.label-text { display: none; }
  .counts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kv { grid-template-columns: 1fr; }
  .kv dt { padding-bottom: 0; border-bottom: 0; }
  .series-hero { flex-direction: column; }
  .page-head { align-items: flex-start; }
}
.server-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(560px, 100%), 1fr)); gap: 20px; }

/* topbar search: after the generic input rule so the icon padding wins */
.topbar .search input { padding-left: 36px; height: 36px; background: var(--surface); }
.tbl .sub.nowrap { white-space: nowrap; }
.pw-inline { display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; }
.pw-inline code { padding: 0 5px; font-size: 11px; }
.pw-inline .btn { --h: 22px; width: 22px; }
.pw-inline .btn .icon { width: 13px; height: 13px; }
.automation-tiles > .card, .grid-2 > .card { display: flex; flex-direction: column; }
.automation-tiles > .card > .card-body, .grid-2 > .card > .card-body { flex: 1; }
.tbl .path, .tbl .sub.path { word-break: normal; overflow-wrap: anywhere; }
.tbl .msg { min-width: 260px; }
/* Tooltips near the right edge open leftwards; hidden tooltips never widen the page */
.topbar [data-tip]::after, .tbl .actions [data-tip]::after { left: auto; right: 0; transform: translate(0, 4px); }
.topbar [data-tip]:hover::after, .tbl .actions [data-tip]:hover::after { transform: translate(0, 0); }
.topbar [data-tip]::after { top: calc(100% + 8px); bottom: auto; }
.main { overflow-x: clip; }
