:root {
  --radius: 0.625rem;
  --brand-magenta: #d81b60;
  --brand-purple: #7b1fa2;
  --brand-purple-deep: #6a1b9a;
  --background: oklch(0.985 0.002 247.858);
  --foreground: oklch(0.129 0.042 264.695);
  --card: oklch(1 0 0);
  --card-foreground: oklch(0.129 0.042 264.695);
  --popover: oklch(1 0 0);
  --popover-foreground: oklch(0.129 0.042 264.695);
  --primary: var(--brand-purple);
  --primary-foreground: #ffffff;
  --secondary: oklch(0.967 0.003 264.542);
  --secondary-foreground: oklch(0.208 0.042 265.755);
  --muted: oklch(0.967 0.003 264.542);
  --muted-foreground: oklch(0.554 0.046 257.417);
  --accent: oklch(0.967 0.003 264.542);
  --accent-foreground: oklch(0.208 0.042 265.755);
  --destructive: oklch(0.577 0.245 27.325);
  --destructive-foreground: oklch(0.984 0.003 247.858);
  --border: oklch(0.929 0.013 255.508);
  --input: oklch(0.929 0.013 255.508);
  --ring: var(--brand-purple);
  --success: oklch(0.627 0.194 149.214);
  --warn: oklch(0.666 0.179 58.318);

  /* Spacing scale (4px base) — use everywhere for professional rhythm */
  --space-1: 0.25rem;   /* 4 */
  --space-2: 0.5rem;    /* 8 */
  --space-3: 0.75rem;   /* 12 */
  --space-4: 1rem;      /* 16 */
  --space-5: 1.25rem;   /* 20 */
  --space-6: 1.5rem;    /* 24 */
  --space-7: 2rem;      /* 32 */
  --space-8: 2.5rem;    /* 40 */

  --page-pad-x: var(--space-6);
  --page-pad-y: var(--space-6);
  --page-gap: var(--space-6);
  --section-gap: var(--space-4);
  --stack-gap: var(--space-3);
  --inline-gap: var(--space-2);
  --card-pad: var(--space-5);
  --field-gap: var(--space-2);
  --header-gap: var(--space-2);

  /* Shell alignment: content breadcrumb lines up with first sidebar nav row */
  --shell-header-h: 3.5rem;
  --sidebar-nav-pad: var(--space-2);
  --nav-link-pad-y: var(--space-2);
  --content-pad-top: calc(var(--sidebar-nav-pad) + var(--nav-link-pad-y));
}
@media (max-width: 1023px) {
  :root {
    --page-pad-x: var(--space-5);
    --page-pad-y: var(--space-5);
    --page-gap: var(--space-5);
  }
}
@media (max-width: 767px) {
  :root {
    --page-pad-x: var(--space-4);
    --page-pad-y: var(--space-4);
    --page-gap: var(--space-4);
    --section-gap: var(--space-3);
    --card-pad: var(--space-4);
  }
}

html.dark {
  --background: oklch(0.129 0.042 264.695);
  --foreground: oklch(0.984 0.003 247.858);
  --card: oklch(0.208 0.042 265.755);
  --card-foreground: oklch(0.984 0.003 247.858);
  --popover: oklch(0.208 0.042 265.755);
  --popover-foreground: oklch(0.984 0.003 247.858);
  --primary: var(--brand-purple);
  --primary-foreground: #ffffff;
  --secondary: oklch(0.279 0.041 260.031);
  --secondary-foreground: oklch(0.984 0.003 247.858);
  --muted: oklch(0.279 0.041 260.031);
  --muted-foreground: oklch(0.704 0.04 256.788);
  --accent: oklch(0.279 0.041 260.031);
  --accent-foreground: oklch(0.984 0.003 247.858);
  --destructive: oklch(0.577 0.245 27.325);
  --destructive-foreground: oklch(0.984 0.003 247.858);
  --border: oklch(0.372 0.044 257.287);
  --input: oklch(0.372 0.044 257.287);
  --ring: var(--brand-purple);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
.h-full { height: 100%; }
body:has(.app-shell) {
  overflow: hidden;
  height: 100%;
  height: 100dvh;
}
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  background: var(--background);
  color: var(--foreground);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; }

.scrollbar-thin {
  scrollbar-width: thin;
  scrollbar-color: oklch(0.55 0.02 264 / 0.35) transparent;
}
html.dark .scrollbar-thin {
  scrollbar-color: oklch(0.45 0.02 264 / 0.45) transparent;
}
.scrollbar-thin::-webkit-scrollbar { width: 6px; height: 6px; }
.scrollbar-thin::-webkit-scrollbar-track { background: transparent; }
.scrollbar-thin::-webkit-scrollbar-thumb {
  background-color: oklch(0.45 0.02 264 / 0.45);
  border-radius: 9999px;
}

.app-content--map {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.app-content--map > [data-ajax-page],
.app-content--map > .ops-map-page {
  flex: 1;
  min-height: 0;
}
.app-shell--map .app-main {
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.app-shell {
  display: flex;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  background: var(--background);
}
.app-sidebar {
  display: flex;
  flex-direction: column;
  width: 14rem;
  flex-shrink: 0;
  height: 100%;
  max-height: 100dvh;
  min-height: 0;
  overflow: hidden;
  border-right: 1px solid var(--border);
  background: color-mix(in oklch, var(--muted) 55%, var(--card));
}
.app-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
  height: var(--shell-header-h);
  flex-shrink: 0;
  padding: 0 0.75rem 0 1rem;
  border-bottom: 1px solid var(--border);
}
.app-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  min-width: 0;
  font-weight: 700;
  font-size: 1rem;
}
.app-sidebar-brand-text {
  min-width: 0;
  line-height: 1.2;
}
.app-sidebar-brand .accent { color: var(--brand-magenta); }
.brand-logo {
  display: block;
  width: 2.25rem;
  height: 2.25rem;
  object-fit: contain;
  flex-shrink: 0;
}
.brand-logo--sidebar {
  width: 1.875rem;
  height: 1.875rem;
}
.brand-logo--md {
  width: 2.5rem;
  height: 2.5rem;
}
.brand-logo--lg {
  width: 2.75rem;
  height: 2.75rem;
}
.app-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgb(0 0 0 / 0.45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
html.layout-mobile body.sidebar-open .app-sidebar-backdrop {
  display: block;
}
.app-sidebar-nav {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding: var(--sidebar-nav-pad);
  padding-bottom: max(var(--space-3), env(safe-area-inset-bottom, 0px));
}
.nav-group { margin-bottom: var(--section-gap); }
.nav-group:last-child { margin-bottom: 0; }
.nav-label {
  margin-bottom: var(--space-1);
  padding: 0 var(--space-3);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}
.nav-link {
  display: flex;
  align-items: center;
  gap: var(--stack-gap);
  padding: var(--nav-link-pad-y) var(--space-3);
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--muted-foreground);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.nav-link:hover {
  background: var(--accent);
  color: var(--foreground);
}
.nav-link.active {
  background: color-mix(in oklch, var(--primary) 10%, transparent);
  color: var(--foreground);
  font-weight: 500;
}
.nav-icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.app-main {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
.app-topbar {
  z-index: 10;
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: space-between;
  gap: var(--inline-gap);
  border-bottom: 1px solid var(--border);
  background: var(--background);
  padding: 0 var(--page-pad-x);
  padding-top: env(safe-area-inset-top, 0px);
  height: calc(var(--shell-header-h) + env(safe-area-inset-top, 0px));
}
.app-topbar-start {
  display: flex;
  align-items: center;
  gap: var(--inline-gap);
  min-width: 0;
  flex: 1;
}
.app-topbar-title {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted-foreground);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--inline-gap);
  flex-shrink: 0;
}
.user-menu-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 2.25rem;
  padding: 0 0.625rem 0 0.375rem;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--foreground);
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 500;
  transition: background 0.15s, border-color 0.15s;
}
.user-menu-trigger:hover {
  background: var(--accent);
}
.user-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 9999px;
  background: color-mix(in oklch, var(--primary) 12%, transparent);
  color: var(--primary);
}
.user-avatar .nav-icon { width: 1rem; height: 1rem; }
.user-menu-label {
  max-width: 8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted-foreground);
}
.user-menu-chevron {
  display: inline-flex;
  color: var(--muted-foreground);
}
.user-menu-chevron .nav-icon { width: 0.875rem; height: 0.875rem; }
.app-topbar-user {
  font-size: 0.75rem;
  color: var(--muted-foreground);
}
.app-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: var(--content-pad-top) var(--page-pad-x) var(--page-pad-y);
  padding-bottom: max(var(--page-pad-y), env(safe-area-inset-bottom, 0px));
}

/* Vertical rhythm: major blocks inside a page */
.app-content > [data-ajax-page] > .page-top,
.app-content > .page-top {
  margin-bottom: var(--section-gap);
}
.app-content > [data-ajax-page] > .page-header:not(.page-top .page-header),
.app-content > .page-header:not(.page-top .page-header) {
  margin-bottom: var(--page-gap);
}
.app-content > [data-ajax-page] > .page-body,
.app-content > .page-body {
  margin-bottom: var(--page-gap);
}
.app-content > [data-ajax-page] > .stat-grid:not(.page-body .stat-grid),
.app-content > .stat-grid:not(.page-body .stat-grid),
.app-content > [data-ajax-page] > .filter-bar,
.app-content > .filter-bar,
.app-content > [data-ajax-page] > .ui-card,
.app-content > .ui-card,
.app-content > [data-ajax-page] > .dashboard-card,
.app-content > .dashboard-card,
.app-content > [data-ajax-page] > .report-card,
.app-content > .report-card,
.app-content > [data-ajax-page] > .crm-grid-shell,
.app-content > .crm-grid-shell,
.app-content > [data-ajax-page] > .data-grid,
.app-content > .data-grid,
.app-content > [data-ajax-page] > .settings-form,
.app-content > .settings-form {
  margin-bottom: var(--page-gap);
}
.app-content > [data-ajax-page] > :last-child,
.app-content > :last-child {
  margin-bottom: 0;
}

/* Buttons */
.ui-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 2.25rem;
  padding: 0 1rem;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid transparent;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}
.ui-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.ui-btn-primary {
  background: var(--primary);
  color: var(--primary-foreground);
}
.ui-btn-primary:hover:not(:disabled) {
  filter: brightness(0.95);
}
.ui-btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--foreground);
}
.ui-btn-outline:hover:not(:disabled) {
  background: var(--accent);
}
.ui-btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--foreground);
}
.ui-btn-ghost:hover:not(:disabled) {
  background: var(--accent);
}
.ui-btn-destructive:not(.ui-btn-outline):not(.ui-btn-ghost) {
  background: var(--destructive);
  color: var(--destructive-foreground);
}
.ui-btn-outline.ui-btn-destructive {
  background: transparent;
  border-color: var(--border);
  color: var(--destructive);
}
.ui-btn-outline.ui-btn-destructive:hover:not(:disabled) {
  background: color-mix(in oklch, var(--destructive) 10%, transparent);
  color: var(--destructive);
}
.ui-btn-icon {
  width: 2rem;
  height: 2rem;
  padding: 0;
}
.ui-btn-lg { height: 3rem; padding: 0 1.25rem; font-size: 0.875rem; }
.ui-btn-full { width: 100%; }

/* Form fields — align-content:start agar kolom 2 sejajar meski satu field punya hint */
.ui-field {
  display: grid;
  gap: var(--field-gap);
  align-content: start;
  align-items: stretch;
  min-width: 0;
}
.ui-label {
  display: inline-flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: baseline;
  gap: 0.2rem;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25;
}
/* Dialog forms: tighter, sectioned layout */
.ui-dialog-body.form-stack {
  gap: 1rem;
}
.ui-dialog-body .ui-form-section + .ui-form-section {
  margin-top: 0.15rem;
  padding-top: 0.9rem;
}
.ui-dialog-body .ui-form-grid {
  gap: 0.75rem;
}
.ui-dialog-body .form-row-2 {
  gap: 0.75rem;
}
.ui-input,
.ui-textarea,
.ui-select {
  width: 100%;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid var(--input);
  background: transparent;
  color: var(--foreground);
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  transition: box-shadow 0.15s, border-color 0.15s;
}
.ui-input,
.ui-select {
  height: 2.25rem;
  padding: 0.25rem 0.75rem;
  font-size: 0.875rem;
}
.ui-input::placeholder,
.ui-textarea::placeholder { color: var(--muted-foreground); }
.ui-input:focus,
.ui-textarea:focus,
.ui-select:focus {
  outline: none;
  border-color: var(--ring);
  box-shadow: 0 0 0 1px var(--ring);
}
.ui-input:disabled,
.ui-textarea:disabled,
.ui-select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.ui-input-lg { height: 3rem; font-size: 1rem; }
.ui-textarea {
  min-height: 3.75rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  resize: vertical;
}
.ui-input-wrap { position: relative; }
.ui-input-wrap.has-icon .ui-input { padding-left: 2.25rem; }
.ui-input-wrap.has-icon-right .ui-input { padding-right: 2.5rem; }
.ui-input-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-foreground);
  pointer-events: none;
  display: flex;
}
.ui-input-icon .nav-icon { width: 1rem; height: 1rem; }
.ui-input-toggle {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--muted-foreground);
  cursor: pointer;
  padding: 0;
  display: flex;
}
.ui-input-toggle:hover { color: var(--foreground); }

.ui-select-wrap { position: relative; }
.ui-select {
  appearance: none;
  padding-right: 2rem;
  cursor: pointer;
}
.ui-select-chevron {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--muted-foreground);
  opacity: 0.5;
}
.ui-select-chevron .nav-icon { width: 1rem; height: 1rem; }

.ui-datepicker { position: relative; }
.ui-datepicker-input-wrap { position: relative; display: flex; align-items: center; }
.ui-datepicker-input-wrap .ui-input {
  padding-right: 4.25rem;
  cursor: pointer;
}
.ui-datepicker-clear {
  position: absolute;
  right: 2.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted-foreground);
  font-size: 1.125rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.ui-datepicker-clear:hover:not(:disabled) {
  background: color-mix(in oklch, var(--destructive) 12%, transparent);
  color: var(--destructive);
}
.ui-datepicker-clear:disabled { cursor: default; }
.ui-datepicker-icon {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-foreground);
  pointer-events: none;
}
.ui-datepicker-icon .nav-icon { width: 1rem; height: 1rem; }
.ui-field-hint {
  margin: 0;
  font-size: 0.75rem;
  color: var(--muted-foreground);
  line-height: 1.35;
}

.flatpickr-calendar {
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--border);
  font-family: inherit;
  background: var(--popover);
  color: var(--popover-foreground);
}
.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
}
.flatpickr-day.selected:hover { filter: brightness(0.95); }
.flatpickr-time input { font-family: inherit; }
.flatpickr-months .flatpickr-month { color: var(--primary); }
.dark .flatpickr-calendar {
  background: var(--card);
  color: var(--foreground);
  border-color: var(--border);
}
.dark .flatpickr-day { color: var(--foreground); }
.dark .flatpickr-day.flatpickr-disabled,
.dark .flatpickr-day.prevMonthDay,
.dark .flatpickr-day.nextMonthDay { color: var(--muted-foreground); }

/* legacy alias */
.ui-datepicker-wrap { position: relative; }

/* Checkbox — card-style, checkbox + label on one line */
.ui-checkbox {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid var(--input);
  cursor: pointer;
  font-size: 0.875rem;
  line-height: 1.25;
  user-select: none;
}
.ui-checkbox:has(input:checked) {
  border-color: var(--primary);
  background: color-mix(in oklch, var(--primary) 5%, transparent);
}
.ui-checkbox:has(input:disabled) {
  opacity: 0.6;
  cursor: not-allowed;
}
.ui-checkbox input[type="checkbox"] {
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  margin: 0;
  accent-color: var(--primary);
}
.ui-checkbox-label {
  flex: 1;
  min-width: 0;
}
.ui-checkbox.is-inline {
  padding: 0;
  border: none;
  background: transparent;
}
.ui-checkbox.is-inline:has(input:checked) {
  border-color: transparent;
  background: transparent;
}
input[type="checkbox"][data-grid-inline] {
  width: 1rem;
  height: 1rem;
  margin: 0;
  accent-color: var(--primary);
  cursor: pointer;
}

/* Dropdown menu */
.ui-dropdown { position: relative; display: inline-flex; }
.ui-dropdown-menu {
  position: absolute;
  top: calc(100% + 0.25rem);
  right: 0;
  z-index: 50;
  min-width: 8rem;
  display: none;
  padding: 0.25rem;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid var(--border);
  background: var(--popover);
  color: var(--popover-foreground);
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}
.ui-dropdown.open .ui-dropdown-menu { display: block; }
.ui-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.375rem 0.5rem;
  border: 0;
  border-radius: calc(var(--radius) - 4px);
  background: transparent;
  color: inherit;
  font-size: 0.875rem;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.ui-dropdown-item:hover,
.ui-dropdown-item:focus {
  background: var(--accent);
  outline: none;
}
.ui-dropdown-item.destructive { color: var(--destructive); }
.ui-dropdown-item .nav-icon { width: 1rem; height: 1rem; }
.ui-dropdown-sep {
  height: 1px;
  margin: 0.25rem -0.25rem;
  background: var(--border);
}
.ui-dropdown-label {
  padding: 0.375rem 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
}
.ui-dropdown-hint {
  border-top: 1px solid var(--border);
  padding: 0.375rem 0.5rem;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}
.ui-dropdown-item .check-slot {
  margin-left: auto;
  width: 1rem;
  height: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Cards & panels */
.ui-card {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--card-foreground);
  box-shadow:
    0 1px 2px 0 rgb(0 0 0 / 0.04),
    0 4px 12px -2px rgb(15 23 42 / 0.06);
}
.ui-card-body { padding: var(--card-pad); }
.ui-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--section-gap);
  margin-bottom: var(--section-gap);
}
.ui-card-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

/* Alerts */
.ui-alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid var(--border);
  background: color-mix(in oklch, var(--muted) 40%, var(--card));
  font-size: 0.875rem;
  line-height: 1.5;
}
.ui-alert-icon {
  display: inline-flex;
  flex-shrink: 0;
  width: 1.125rem;
  height: 1.125rem;
  margin-top: 0.1rem;
  opacity: 0.9;
}
.ui-alert-icon .nav-icon {
  width: 100%;
  height: 100%;
}
.ui-alert-title {
  margin: 0;
  font-weight: 600;
  color: var(--foreground);
}
.ui-alert-desc {
  margin: var(--space-1) 0 0;
  color: var(--muted-foreground);
}
.ui-alert.is-info {
  border-color: color-mix(in oklch, var(--primary) 28%, var(--border));
  background: color-mix(in oklch, var(--primary) 8%, var(--card));
}
.ui-alert.is-info .ui-alert-icon { color: var(--primary); }
.ui-alert.is-success {
  border-color: color-mix(in oklch, var(--success) 35%, var(--border));
  background: color-mix(in oklch, var(--success) 10%, var(--card));
}
.ui-alert.is-success .ui-alert-icon { color: var(--success); }
.ui-alert.is-warning {
  border-color: color-mix(in oklch, var(--warn) 35%, var(--border));
  background: color-mix(in oklch, var(--warn) 10%, var(--card));
}
.ui-alert.is-warning .ui-alert-icon { color: var(--warn); }
.ui-alert.is-danger,
.ui-alert.is-destructive {
  border-color: color-mix(in oklch, var(--destructive) 35%, var(--border));
  background: color-mix(in oklch, var(--destructive) 8%, var(--card));
}
.ui-alert.is-danger .ui-alert-icon,
.ui-alert.is-destructive .ui-alert-icon { color: var(--destructive); }

/* Page shell (Billiar UI Kit rhythm) */
.page-top {
  display: flex;
  flex-direction: column;
  gap: var(--header-gap);
}
.page-top .page-breadcrumb,
.page-top .ui-breadcrumb {
  margin-bottom: 0;
}
.page-top .page-header {
  margin-bottom: 0;
}
.page-top--headless {
  gap: 0.25rem;
}
.page-top--headless + .page-body > .dash-exec {
  margin-top: -0.15rem;
}
.page-breadcrumb {
  margin-bottom: 0;
}
.page-body {
  display: grid;
  gap: var(--page-gap);
  align-content: start;
  padding-top: 0;
}
.page-body > .stat-grid,
.page-body > .data-grid,
.page-body > .crm-grid-shell,
.page-body > .space-y-4,
.page-body > .settings-form,
.page-body > .page-two-col,
.page-body > .ui-card,
.page-body > .ld-page,
.page-body > .dash-period,
.page-body > .dash-toolbar,
.page-body > .dash-tiles,
.page-body > .dash-charts,
.page-body > .dash-pro,
.page-body > .dash-bento,
.page-body > .dash-exec,
.page-body > .dash-hero,
.page-body > .dash-action-grid,
.page-body > .ts-page,
.page-body > section,
.page-body > .devmgr {
  margin-bottom: 0;
}
.page-body > .stat-grid {
  gap: var(--section-gap);
}
.ui-kit-page,
.page-body {
  min-width: 0;
}
.ui-kit-page {
  display: grid;
  gap: var(--page-gap);
}
.ui-kit-section {
  display: grid;
  gap: var(--section-gap);
}
.ui-kit-section-title {
  margin: 0 0 var(--space-3);
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}
.ui-kit-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}
.ui-kit-grid {
  display: grid;
  gap: var(--section-gap);
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
}

/* Page header */
.page-header {
  display: flex;
  flex-direction: column;
  gap: var(--stack-gap);
  margin-bottom: var(--page-gap);
}
@media (min-width: 768px) {
  .page-header {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--section-gap);
  }
}
.page-header > div:first-child {
  min-width: 0;
  flex: 1;
  text-align: left;
}
.page-header h2 {
  margin: 0;
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
}
@media (min-width: 768px) {
  .page-header h2 {
    font-size: 1.5rem;
  }
}
.page-header p {
  margin: var(--space-1) 0 0;
  max-width: 40rem;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--muted-foreground);
}
.page-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
  flex-shrink: 0;
  padding-top: 0.15rem;
}

/* Stats */
.stat-grid {
  display: grid;
  gap: var(--section-gap);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  margin-bottom: var(--page-gap);
}
.stat-card {
  border-radius: calc(var(--radius) + 2px);
  border: 1px solid var(--border);
  background: var(--card);
  padding: var(--card-pad);
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.04);
}
.stat-label {
  font-size: 0.8125rem;
  color: var(--muted-foreground);
  letter-spacing: 0.01em;
}
.stat-value {
  margin-top: var(--space-2);
  font-size: 1.625rem;
  font-weight: 700;
  line-height: 1.2;
}
.stat-split {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  margin: 0.45rem 0 0;
  font-size: 0.6875rem;
  color: var(--muted-foreground);
  line-height: 1.3;
}
.stat-split-item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.stat-dot {
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  flex-shrink: 0;
}
.stat-dot--billiar { background: var(--primary); }
.stat-dot--cafe {
  background: color-mix(in oklch, var(--accent-emerald, oklch(0.65 0.15 160)) 88%, var(--foreground));
}
.hourly-chart-aside {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem 1rem;
}
.hourly-peak-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  padding: 0.35rem 0.65rem;
  border-radius: 0.65rem;
  border: 1px solid color-mix(in oklch, var(--primary) 22%, var(--border));
  background: color-mix(in oklch, var(--primary) 8%, var(--card));
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}
.hourly-peak-label {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary);
}
.hourly-peak-chip strong {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--foreground);
}
.table-hourly-col.is-peak .table-hourly-label {
  color: var(--primary);
  font-weight: 700;
}
.table-hourly-col.is-peak .table-hourly-bar {
  box-shadow: 0 0 0 1px color-mix(in oklch, var(--primary) 35%, transparent);
}

/* Denyut kas — owner cash pulse (not a ledger) */
.cash-pulse-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--section-gap);
}
.cash-pulse-panel {
  min-width: 0;
  padding: 0.85rem 0.95rem;
  border-radius: 0.85rem;
  border: 1px solid var(--border);
  background: color-mix(in oklch, var(--muted) 22%, var(--card));
}
.cash-pulse-label {
  margin: 0 0 0.65rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}
.cash-pulse-mix {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.cash-pulse-mix-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}
.cash-pulse-mix-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--foreground);
}
.cash-pulse-mix-amt {
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}
.cash-pulse-mix-track {
  margin-top: 0.3rem;
  height: 0.4rem;
  border-radius: 999px;
  background: color-mix(in oklch, var(--muted) 55%, transparent);
  overflow: hidden;
}
.cash-pulse-mix-track span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--primary);
  min-width: 2px;
}
.cash-pulse-mix-meta {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.6875rem;
  color: var(--muted-foreground);
  font-variant-numeric: tabular-nums;
}
.cash-pulse-tickets {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.cash-pulse-ticket {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.55rem 0.65rem;
  border-radius: 0.65rem;
  border: 1px solid var(--border);
  background: var(--card);
}
.cash-pulse-ticket-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.6875rem;
  font-weight: 650;
  color: var(--muted-foreground);
}
.cash-pulse-ticket strong {
  font-size: 1.05rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.cash-pulse-ticket .muted,
.cash-pulse-scale {
  font-size: 0.6875rem;
  font-variant-numeric: tabular-nums;
}
.cash-pulse-scale {
  margin: 0.75rem 0 0;
}
.cash-pulse-feed {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.cash-pulse-feed li {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid color-mix(in oklch, var(--border) 80%, transparent);
}
.cash-pulse-feed li:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}
.cash-pulse-feed-main {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}
.cash-pulse-feed-type {
  font-size: 0.8125rem;
  font-weight: 650;
  color: var(--foreground);
}
.cash-pulse-feed-where {
  font-size: 0.6875rem;
  color: var(--muted-foreground);
}
.cash-pulse-feed-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.1rem;
  text-align: right;
  flex-shrink: 0;
}
.cash-pulse-feed-side strong {
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}
.cash-pulse-feed-side time {
  font-size: 0.625rem;
  white-space: nowrap;
}
.cash-pulse-empty {
  margin: 0;
  font-size: 0.8125rem;
}
@media (max-width: 960px) {
  .cash-pulse-grid {
    grid-template-columns: 1fr;
  }
}

/* Table */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  margin-inline: -0.15rem;
  padding-inline: 0.15rem;
}
.ui-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.ui-table th,
.ui-table td {
  text-align: left;
  padding: var(--space-3) var(--space-2);
  border-bottom: 1px solid var(--border);
}
.ui-table th {
  color: var(--muted-foreground);
  font-weight: 600;
}
.ui-table .text-right { text-align: right; }
.row-actions {
  display: inline-flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 0.375rem;
  align-items: center;
  vertical-align: middle;
}
.row-actions > * {
  flex-shrink: 0;
}
.row-actions form,
.row-actions .inline-form {
  display: inline-flex;
  flex-wrap: nowrap;
  margin: 0;
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  background: var(--muted);
  color: var(--muted-foreground);
}
.badge-success {
  background: color-mix(in oklch, var(--success) 20%, transparent);
  color: var(--success);
}
.badge-warn {
  background: color-mix(in oklch, var(--warn) 20%, transparent);
  color: var(--warn);
}
.badge-muted {
  background: var(--muted);
  color: var(--muted-foreground);
}
.badge-destructive {
  background: color-mix(in oklch, var(--destructive) 20%, transparent);
  color: var(--destructive);
}

/* Alerts */
.alert {
  padding: var(--space-3) var(--space-4);
  border-radius: calc(var(--radius) - 2px);
  margin-bottom: var(--section-gap);
  font-size: 0.875rem;
}
.alert-success {
  background: color-mix(in oklch, var(--success) 15%, transparent);
  color: var(--success);
}
.alert-error {
  background: color-mix(in oklch, var(--destructive) 15%, transparent);
  color: var(--destructive);
}

.muted { color: var(--muted-foreground); }
.text-right { text-align: right; }
.form-grid { display: grid; gap: var(--section-gap); max-width: 40rem; }
.form-grid-wide { max-width: none; }
.stack { display: grid; gap: var(--section-gap); }
.form-actions { margin-top: 0.5rem; }
.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
.link-danger {
  border: 0;
  background: none;
  color: var(--destructive);
  cursor: pointer;
  padding: 0;
  font-size: 0.875rem;
  text-decoration: underline;
}

/* Pagination */
.pagination {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-top: 1rem;
  font-size: 0.875rem;
}
.pagination a { color: var(--primary); text-decoration: none; }
.pagination a:hover { text-decoration: underline; }

/* Chart */
.chart-bars {
  display: grid;
  grid-template-columns: repeat(24, minmax(0, 1fr));
  gap: 2px;
  align-items: end;
  height: 140px;
  margin-top: 1rem;
  width: 100%;
}
.chart-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  position: relative;
}
.chart-bar-wrap {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  position: relative;
  min-height: 0;
}
.chart-hit {
  cursor: crosshair;
}
.chart-hit:focus {
  outline: 2px solid color-mix(in oklch, var(--primary) 45%, transparent);
  outline-offset: 2px;
}
.chart-bar {
  width: 100%;
  background: var(--primary);
  border-radius: 2px 2px 0 0;
  min-height: 2px;
}
.chart-label {
  font-size: 0.55rem;
  color: var(--muted-foreground);
  margin-top: 0.25rem;
}

/* Omzet per jam — Billiar vs Cafe grouped bars */
.hourly-chart-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
}
.hourly-chart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted-foreground);
}
.hourly-chart-swatch {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 0.2rem;
}
.hourly-chart-swatch--billiar { background: var(--primary); }
.hourly-chart-swatch--cafe {
  background: color-mix(in oklch, var(--accent-emerald, oklch(0.65 0.15 160)) 88%, var(--foreground));
}
.hourly-chart-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
  margin: 0.85rem 0 1rem;
}
.hourly-chart-stat {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  padding: 0.7rem 0.85rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  background: color-mix(in oklch, var(--muted) 28%, var(--card));
}
.hourly-chart-stat-label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}
.hourly-chart-stat-value {
  font-size: 0.95rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--foreground);
  line-height: 1.2;
}
.hourly-chart-stat-sub {
  font-size: 0.6875rem;
  color: var(--muted-foreground);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hourly-chart {
  --hourly-cols: 24;
  display: grid;
  grid-template-columns: repeat(var(--hourly-cols), minmax(0, 1fr));
  gap: 0.2rem;
  align-items: end;
  height: 11.5rem;
  width: 100%;
  padding-top: 0.35rem;
  border-bottom: 1px solid var(--border);
}
.hourly-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  min-width: 0;
  position: relative;
  border-radius: 0.35rem 0.35rem 0 0;
  transition: background 0.12s ease;
}
.hourly-col:hover,
.hourly-col:focus-visible {
  background: color-mix(in oklch, var(--muted) 35%, transparent);
}
.hourly-col.is-peak .hourly-label {
  color: var(--primary);
  font-weight: 700;
}
.hourly-bars {
  flex: 1;
  width: 100%;
  max-width: 1.85rem;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0.12rem;
  min-height: 0;
  padding-bottom: 0.15rem;
}
.hourly-bar {
  flex: 1 1 0;
  min-width: 0;
  min-height: 2px;
  border-radius: 3px 3px 0 0;
  transition: height 0.2s ease, filter 0.12s ease;
}
.hourly-bar--billiar { background: var(--primary); }
.hourly-bar--cafe {
  background: color-mix(in oklch, var(--accent-emerald, oklch(0.65 0.15 160)) 88%, var(--foreground));
}
.hourly-col:hover .hourly-bar,
.hourly-col:focus-visible .hourly-bar { filter: brightness(1.06); }
.hourly-label {
  font-size: 0.625rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted-foreground);
  line-height: 1;
  padding: 0.3rem 0 0.1rem;
}
@media (max-width: 1100px) {
  .hourly-chart-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .hourly-chart-summary { grid-template-columns: 1fr; }
  .hourly-chart { height: 10rem; gap: 0.12rem; }
  .hourly-bars { max-width: 1.35rem; gap: 0.08rem; }
  .hourly-label { font-size: 0.55rem; }
}

/* Floating chart tooltip portal */
.chart-tip-portal {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 10050;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s ease;
}
.chart-tip-portal.is-visible {
  opacity: 1;
}
.chart-tip-portal[hidden] {
  display: none !important;
}
.chart-tip-card {
  border-radius: calc(var(--radius) - 1px);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--foreground);
  padding: 0.55rem 0.7rem;
  box-shadow:
    0 4px 6px -1px rgb(0 0 0 / 0.08),
    0 12px 28px -6px rgb(0 0 0 / 0.16);
  min-width: 9.5rem;
  max-width: 15rem;
}
html.dark .chart-tip-card {
  box-shadow:
    0 4px 6px -1px rgb(0 0 0 / 0.35),
    0 12px 28px -6px rgb(0 0 0 / 0.5);
}
.chart-tip-card--active {
  border-color: color-mix(in oklch, var(--success) 45%, var(--border));
}
.chart-tip-title {
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 0.4rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}
.chart-tip-card--active .chart-tip-title {
  color: color-mix(in oklch, var(--success) 75%, var(--foreground));
}
.chart-tip-meta {
  margin: 0;
  display: grid;
  gap: 0.2rem;
}
.chart-tip-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.75rem;
  line-height: 1.35;
}
.chart-tip-row dt {
  margin: 0;
  color: var(--muted-foreground);
  font-weight: 500;
  white-space: nowrap;
}
.chart-tip-row dd {
  margin: 0;
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
}

.dashboard-chart-head {
  display: flex;
  flex-wrap: wrap;
  gap: var(--stack-gap) var(--space-6);
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

/* Dashboard day navigator — full-width, centered date, status right */
.dashboard-page-header {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--section-gap);
  margin-bottom: var(--page-gap);
}
.dashboard-page-intro {
  min-width: 0;
  width: 100%;
}
.dashboard-kicker {
  margin: 0 0 var(--space-1);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}
.dashboard-page-intro h2 {
  margin: 0;
  font-size: 1.625rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}
.dashboard-ops-window {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  margin: var(--space-2) 0 0;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--muted-foreground);
}
.dashboard-ops-range {
  font-variant-numeric: tabular-nums;
  color: color-mix(in oklch, var(--foreground) 72%, var(--muted-foreground));
  font-weight: 500;
}
.dashboard-ops-sep {
  display: inline-block;
  width: 0.25rem;
  height: 0.25rem;
  border-radius: 999px;
  background: color-mix(in oklch, var(--muted-foreground) 55%, transparent);
}
.dashboard-ops-data {
  font-variant-numeric: tabular-nums;
}

.dash-day-nav {
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr) auto 2.5rem;
  align-items: center;
  gap: var(--space-1) var(--space-2);
  width: 100%;
  padding: var(--space-2);
  border-radius: 1rem;
  border: 1px solid color-mix(in oklch, var(--border) 90%, transparent);
  background:
    linear-gradient(
      180deg,
      color-mix(in oklch, var(--card) 92%, transparent),
      color-mix(in oklch, var(--muted) 28%, var(--card))
    );
  box-shadow:
    0 1px 0 color-mix(in oklch, var(--foreground) 4%, transparent),
    inset 0 1px 0 color-mix(in oklch, var(--foreground) 3%, transparent);
}
.dash-day-nav.is-live {
  border-color: color-mix(in oklch, var(--success) 22%, var(--border));
}
.dash-day-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 0;
  border-radius: 0.8rem;
  background: transparent;
  color: var(--muted-foreground);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}
.dash-day-nav-btn svg {
  width: 1.1rem;
  height: 1.1rem;
  stroke-width: 2.25;
}
.dash-day-nav-btn:hover:not([disabled]) {
  background: color-mix(in oklch, var(--muted) 70%, transparent);
  color: var(--foreground);
}
.dash-day-nav-btn:focus-visible {
  outline: 2px solid color-mix(in oklch, var(--primary) 55%, transparent);
  outline-offset: 1px;
}
.dash-day-nav-btn[disabled] {
  opacity: 0.28;
  cursor: not-allowed;
}
.dash-day-nav-body {
  min-width: 0;
  padding: 0.35rem 0.85rem;
  text-align: center;
}
.dash-day-nav-line {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0.55rem 0.75rem;
  margin: 0;
  max-width: 100%;
}
.dash-day-nav-title {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--foreground);
}
.dash-day-nav-divider {
  display: inline-block;
  width: 1px;
  height: 0.95em;
  align-self: center;
  background: color-mix(in oklch, var(--border) 88%, var(--muted-foreground));
  opacity: 0.9;
}
.dash-day-nav-meta {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.3rem 0.35rem;
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--muted-foreground);
}
.dash-day-nav-clock {
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  color: color-mix(in oklch, var(--foreground) 78%, var(--muted-foreground));
}
.dash-day-nav-sep {
  margin: 0 0.05rem;
  opacity: 0.65;
}
.dash-day-nav-aside {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 0.15rem;
}
.dash-day-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.25;
  white-space: nowrap;
}
.dash-day-pill--live {
  color: color-mix(in oklch, var(--success) 88%, var(--foreground));
  background: color-mix(in oklch, var(--success) 14%, transparent);
  border: 1px solid color-mix(in oklch, var(--success) 26%, transparent);
}
.dash-day-pill-dot {
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 0 0 color-mix(in oklch, currentColor 35%, transparent);
  animation: dash-live-pulse 2s ease-out infinite;
}
@keyframes dash-live-pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in oklch, currentColor 35%, transparent); }
  70% { box-shadow: 0 0 0 0.35rem transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.dash-day-pill--archive {
  color: var(--muted-foreground);
  background: color-mix(in oklch, var(--muted) 55%, transparent);
  border: 1px solid color-mix(in oklch, var(--border) 90%, transparent);
}
.dash-day-today-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8125rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--primary);
  text-decoration: none;
}
.dash-day-today-link .nav-icon {
  width: 0.95rem;
  height: 0.95rem;
  flex-shrink: 0;
  opacity: 0.9;
}
.dash-day-today-link:hover {
  text-decoration: underline;
  text-underline-offset: 0.12em;
}
.dash-day-today-link:hover .nav-icon {
  opacity: 1;
}
.dash-day-today-link:focus-visible {
  outline: 2px solid color-mix(in oklch, var(--primary) 55%, transparent);
  outline-offset: 2px;
  border-radius: 0.25rem;
}
@media (max-width: 639px) {
  .dashboard-page-intro h2 {
    font-size: 1.375rem;
  }
  .dash-day-nav {
    grid-template-columns: 2.25rem minmax(0, 1fr) 2.25rem;
    grid-template-areas:
      "prev body next"
      "aside aside aside";
    row-gap: 0.35rem;
  }
  .dash-day-nav-btn:first-child { grid-area: prev; }
  .dash-day-nav-body { grid-area: body; padding-inline: 0.25rem; }
  .dash-day-nav-aside {
    grid-area: aside;
    justify-content: center;
    padding: 0 0 0.15rem;
  }
  .dash-day-nav-btn:last-child,
  .dash-day-nav > button.dash-day-nav-btn { grid-area: next; }
  .dash-day-nav-line {
    gap: 0.35rem 0.55rem;
  }
  .dash-day-nav-title {
    font-size: 0.9375rem;
  }
  .dash-day-nav-meta {
    font-size: 0.75rem;
  }
  .dash-day-nav-divider {
    display: none;
  }
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

.chart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.chart-legend-swatch {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 2px;
}

.chart-legend-swatch--revenue {
  background: var(--primary);
}

.chart-legend-swatch--count,
.chart-legend-swatch--sessions {
  background: color-mix(in oklch, var(--warning, #d97706) 85%, var(--foreground));
}

.chart-legend-swatch--hours {
  background: color-mix(in oklch, var(--success) 85%, var(--foreground));
}

.table-chart-bars {
  display: grid;
  grid-template-columns: repeat(var(--table-cols, 12), minmax(0, 1fr));
  gap: clamp(1px, calc(24px / var(--table-cols, 12)), 4px);
  align-items: end;
  height: 160px;
  margin-top: 1rem;
  width: 100%;
}

.table-chart-col {
  min-width: 0;
}

.table-chart-trio,
.table-chart-duo {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  width: 100%;
  height: 120px;
}

.table-chart-bar {
  flex: 1;
  border-radius: 2px 2px 0 0;
  min-height: 2px;
}

.table-chart-bar--revenue {
  background: var(--primary);
}

.table-chart-bar--hours {
  background: color-mix(in oklch, var(--success) 85%, var(--foreground));
}

.table-chart-bar--count,
.table-chart-bar--sessions {
  background: color-mix(in oklch, var(--warning, #d97706) 85%, var(--foreground));
}

.table-chart-bars .chart-label {
  font-size: clamp(0.45rem, calc(9rem / var(--table-cols, 12)), 0.55rem);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-empty-chart {
  margin: 1.5rem 0 0.5rem;
  text-align: center;
  font-size: 0.875rem;
}

/* Table session analytics panel */
.table-analytics-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--stack-gap);
  margin-bottom: var(--page-gap);
}

.table-analytics-kpi {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-3) var(--space-4);
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid var(--border);
  background: color-mix(in oklch, var(--muted) 22%, transparent);
  min-width: 0;
}

.table-analytics-kpi-label {
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

.table-analytics-kpi-value {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.3;
}

.table-analytics-kpi-value .muted {
  font-size: 0.85em;
  font-weight: 500;
}

.table-analytics-kpi-sub {
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

.table-analytics-panels {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: var(--section-gap);
  margin-bottom: var(--page-gap);
}

.table-analytics-panel {
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  padding: var(--card-pad);
  background: color-mix(in oklch, var(--card) 92%, var(--muted));
  min-width: 0;
}

.table-analytics-panel-head h4 {
  margin: 0 0 0.15rem;
  font-size: 0.875rem;
  font-weight: 600;
}

.table-analytics-panel-head p {
  margin: 0;
  font-size: 0.75rem;
}

.table-analytics-panel-head--split {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 0.75rem;
}

.table-analytics-panel-head:not(.table-analytics-panel-head--split) p {
  margin-bottom: 0.75rem;
}

/* Chart pan — professional horizontal navigator (no native scrollbar) */
.chart-pan {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-width: 0;
}
.chart-pan-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  padding: 0.2rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  background: color-mix(in oklch, var(--card) 88%, var(--muted));
  box-shadow: 0 1px 0 color-mix(in oklch, var(--foreground) 4%, transparent);
}
.chart-pan-controls[hidden] {
  display: none !important;
}
.chart-pan-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  border-radius: 0.55rem;
  background: transparent;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, opacity 0.12s ease;
}
.chart-pan-btn .nav-icon {
  width: 1rem;
  height: 1rem;
}
.chart-pan-btn:hover:not(:disabled) {
  background: color-mix(in oklch, var(--muted) 70%, transparent);
  color: var(--foreground);
}
.chart-pan-btn:focus-visible {
  outline: 2px solid color-mix(in oklch, var(--ring) 45%, transparent);
  outline-offset: 1px;
}
.chart-pan-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.chart-pan-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 7.5rem;
  max-width: 11rem;
  padding: 0 0.35rem;
  text-align: center;
  line-height: 1.2;
}
.chart-pan-range {
  font-size: 0.75rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--foreground);
  white-space: nowrap;
}
.chart-pan-count {
  margin-top: 0.1rem;
  font-size: 0.625rem;
  white-space: nowrap;
}
.chart-pan-viewport {
  position: relative;
  min-width: 0;
}
.chart-pan-fade {
  position: absolute;
  top: 0;
  bottom: 0.15rem;
  width: 1.75rem;
  z-index: 2;
  pointer-events: none;
}
.chart-pan-fade[hidden] {
  display: none !important;
}
.chart-pan-fade--start {
  left: 0;
  background: linear-gradient(
    90deg,
    color-mix(in oklch, var(--card) 92%, var(--muted)),
    transparent
  );
}
.chart-pan-fade--end {
  right: 0;
  background: linear-gradient(
    270deg,
    color-mix(in oklch, var(--card) 92%, var(--muted)),
    transparent
  );
}
.chart-pan-track,
.table-hourly-chart.chart-pan-track {
  display: flex;
  align-items: flex-end;
  gap: 0.45rem;
  height: 10rem;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.15rem 0.1rem 0.35rem;
  scroll-behavior: smooth;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.chart-pan-track::-webkit-scrollbar,
.table-hourly-chart.chart-pan-track::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}
.chart-pan-track:focus-visible {
  outline: 2px solid color-mix(in oklch, var(--ring) 40%, transparent);
  outline-offset: 2px;
  border-radius: 0.35rem;
}
.table-hourly-col {
  flex: 0 0 auto;
  width: 3.35rem;
  min-width: 3.35rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  height: 100%;
  position: relative;
  scroll-snap-align: start;
}
.table-hourly-value {
  font-size: 0.6875rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--muted-foreground);
  min-height: 0.95rem;
  line-height: 1;
}
.table-hourly-bar-wrap {
  flex: 1;
  width: 100%;
  max-width: 1.65rem;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  position: relative;
}
.table-hourly-bar {
  width: 100%;
  min-height: 2px;
  border-radius: 4px 4px 0 0;
  background: color-mix(in oklch, var(--primary) 75%, var(--foreground));
  transition: height 0.2s ease;
}
.table-hourly-col:hover .table-hourly-bar,
.table-hourly-col:focus-visible .table-hourly-bar {
  filter: brightness(1.08);
}
.table-hourly-label {
  font-size: 0.625rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted-foreground);
  white-space: nowrap;
  letter-spacing: -0.01em;
  line-height: 1.15;
  text-align: center;
}
.chart-pan-rail {
  position: relative;
  height: 0.35rem;
  border-radius: 999px;
  background: color-mix(in oklch, var(--muted) 70%, transparent);
  cursor: pointer;
}
.chart-pan-rail[hidden] {
  display: none !important;
}
.chart-pan-thumb {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  min-width: 2rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: color-mix(in oklch, var(--primary) 55%, var(--muted-foreground));
  cursor: grab;
  transition: background 0.12s ease;
}
.chart-pan-thumb:hover,
.chart-pan-thumb:active {
  background: var(--primary);
}
.chart-pan-thumb:active {
  cursor: grabbing;
}
.chart-pan-thumb:focus-visible {
  outline: 2px solid color-mix(in oklch, var(--ring) 45%, transparent);
  outline-offset: 2px;
}

@media (max-width: 640px) {
  .table-analytics-panel-head--split {
    flex-direction: column;
    align-items: stretch;
  }
  .chart-pan-controls {
    width: 100%;
    justify-content: space-between;
  }
  .chart-pan-info {
    min-width: 0;
    flex: 1;
    max-width: none;
  }
  .table-hourly-col {
    width: 3rem;
    min-width: 3rem;
  }
}

.table-timeline {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.table-timeline-axis {
  display: flex;
  justify-content: space-between;
  margin-left: 2.75rem;
  font-size: 0.6875rem;
  color: var(--muted-foreground);
  padding-bottom: 0.25rem;
  border-bottom: 1px dashed var(--border);
}

.table-timeline-row {
  display: grid;
  grid-template-columns: 2.25rem minmax(0, 1fr);
  gap: 0.5rem;
  align-items: center;
}

.table-timeline-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted-foreground);
  text-align: right;
}

.table-timeline-track {
  position: relative;
  height: 1.125rem;
  border-radius: 999px;
  background: color-mix(in oklch, var(--muted) 35%, transparent);
  overflow: hidden;
}

.table-timeline-block {
  position: absolute;
  top: 2px;
  bottom: 2px;
  border-radius: 999px;
  min-width: 3px;
  cursor: crosshair;
}

.table-timeline-block--completed {
  background: color-mix(in oklch, var(--primary) 88%, white);
}

.table-timeline-block--active {
  background: color-mix(in oklch, var(--success) 80%, white);
  box-shadow: 0 0 0 1px color-mix(in oklch, var(--success) 40%, transparent);
  animation: table-timeline-pulse 2s ease-in-out infinite;
}

@keyframes table-timeline-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.72; }
}

.table-hourly-chart {
  display: flex;
  align-items: flex-end;
  gap: 0.45rem;
  height: 10rem;
  min-width: 0;
}

.table-analytics-table-wrap {
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  padding: 1rem;
  overflow-x: auto;
}
.table-analytics-table-wrap.perf-board {
  overflow: hidden;
}
.perf-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.perf-row {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1.2fr) minmax(6.5rem, 0.7fr) minmax(10rem, 1.2fr);
  gap: 0.75rem 1rem;
  align-items: center;
  padding: 0.75rem 0.85rem;
  border-radius: 0.85rem;
  border: 1px solid var(--border);
  background: color-mix(in oklch, var(--card) 94%, var(--muted));
  transition: background 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}
.perf-row:hover,
.perf-row:focus-visible {
  background: color-mix(in oklch, var(--primary) 6%, var(--card));
  border-color: color-mix(in oklch, var(--primary) 22%, var(--border));
}
.perf-row.is-top {
  background:
    linear-gradient(
      90deg,
      color-mix(in oklch, var(--primary) 8%, transparent),
      color-mix(in oklch, var(--card) 94%, var(--muted))
    );
}
.perf-row.is-live {
  box-shadow: inset 3px 0 0 color-mix(in oklch, var(--success) 75%, transparent);
}
.perf-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.55rem;
  font-size: 0.75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--muted-foreground);
  background: color-mix(in oklch, var(--muted) 55%, transparent);
}
.perf-row.is-top .perf-rank {
  color: var(--primary-foreground);
  background: var(--primary);
}
.perf-identity { min-width: 0; }
.perf-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}
.perf-name {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--foreground);
}
.perf-meta {
  margin: 0.2rem 0 0;
  font-size: 0.75rem;
  color: var(--muted-foreground);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.perf-omzet {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.1rem;
  text-align: right;
}
.perf-omzet strong {
  font-size: 0.95rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--foreground);
}
.perf-omzet span {
  font-size: 0.6875rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted-foreground);
}
.perf-bars {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}
.perf-bar-row {
  display: grid;
  grid-template-columns: 2.4rem minmax(0, 1fr) 2.75rem;
  gap: 0.4rem;
  align-items: center;
}
.perf-bar-label {
  font-size: 0.625rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}
.perf-bar-track {
  height: 0.4rem;
  border-radius: 999px;
  background: color-mix(in oklch, var(--muted) 55%, transparent);
  overflow: hidden;
}
.perf-bar-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  min-width: 2px;
}
.perf-bar-fill--share { background: var(--primary); }
.perf-bar-fill--util {
  background: color-mix(in oklch, var(--accent-emerald, oklch(0.65 0.15 160)) 85%, var(--foreground));
}
.perf-bar-pct {
  font-size: 0.6875rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--muted-foreground);
  text-align: right;
}
@media (max-width: 900px) {
  .perf-row {
    grid-template-columns: 2rem minmax(0, 1fr) auto;
    grid-template-areas:
      "rank identity omzet"
      "bars bars bars";
  }
  .perf-rank { grid-area: rank; }
  .perf-identity { grid-area: identity; }
  .perf-omzet { grid-area: omzet; }
  .perf-bars { grid-area: bars; }
}

.table-analytics-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.table-analytics-table th,
.table-analytics-table td {
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.table-analytics-table th {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted-foreground);
  text-align: left;
  white-space: nowrap;
}

.table-analytics-table tbody tr:last-child td {
  border-bottom: 0;
}

.table-analytics-row.chart-hit {
  cursor: default;
  transition: background 0.12s ease;
}

.table-analytics-row.chart-hit:hover,
.table-analytics-row.chart-hit:focus-within {
  background: color-mix(in oklch, var(--primary) 7%, transparent);
}

.table-analytics-table-name {
  font-weight: 600;
  margin-right: 0.35rem;
}

.table-analytics-live {
  font-size: 0.625rem;
  padding: 0.1rem 0.4rem;
  vertical-align: middle;
}

.table-analytics-share {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 7.5rem;
}

.table-analytics-share-bar {
  flex: 1;
  height: 0.4rem;
  border-radius: 999px;
  background: color-mix(in oklch, var(--muted) 40%, transparent);
  overflow: hidden;
}

.table-analytics-share-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--primary);
  min-width: 2px;
  pointer-events: none;
}

.table-analytics-share--util .table-analytics-share-bar span {
  background: color-mix(in oklch, var(--accent-emerald, oklch(0.65 0.15 160)) 85%, var(--foreground));
}

.table-analytics-share-pct {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  white-space: nowrap;
  min-width: 2.5rem;
  text-align: right;
}

.table-analytics-row.is-top {
  background: color-mix(in oklch, var(--primary) 5%, transparent);
}

.table-analytics-row.is-live td:first-child {
  box-shadow: inset 3px 0 0 color-mix(in oklch, var(--success) 75%, transparent);
}

@media (max-width: 960px) {
  .table-analytics-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .table-analytics-panels {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .table-analytics-kpis {
    grid-template-columns: 1fr;
  }
}

/* Login page */
.login-page {
  position: relative;
  display: flex;
  min-height: 100vh;
  background: var(--background);
}
.login-brand {
  position: relative;
  display: none;
  width: 42%;
  flex-shrink: 0;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  background: linear-gradient(145deg, var(--brand-magenta) 0%, var(--brand-purple) 52%, var(--brand-purple-deep) 100%);
  color: #ffffff;
  padding: 3rem 2.5rem;
}
@media (min-width: 1024px) {
  .login-brand { display: flex; }
}
.login-brand-glow {
  pointer-events: none;
  position: absolute;
  right: -5rem;
  top: 33%;
  width: 16rem;
  height: 16rem;
  border-radius: 9999px;
  background: rgb(255 255 255 / 0.08);
  filter: blur(48px);
}
.login-brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  position: relative;
}
.login-brand-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5rem;
  background: rgb(255 255 255 / 0.15);
}
.login-brand-icon .nav-icon { width: 1.25rem; height: 1.25rem; }
.login-brand-title { font-size: 1.125rem; font-weight: 700; letter-spacing: -0.025em; }
.login-brand-sub { font-size: 0.75rem; opacity: 0.7; margin-top: 0.125rem; }
.login-brand-content { position: relative; max-width: 24rem; }
.login-brand-content h1 {
  font-size: 1.875rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.025em;
  margin: 0;
}
.login-brand-content p {
  margin: 0.75rem 0 0;
  font-size: 0.875rem;
  line-height: 1.6;
  opacity: 0.75;
}
.login-features {
  list-style: none;
  padding: 0;
  margin: 2.5rem 0 0;
  display: grid;
  gap: 0.75rem;
}
.login-features li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
}
.login-features .nav-icon { opacity: 0.8; }
.login-brand-footer {
  position: relative;
  font-size: 0.75rem;
  opacity: 0.5;
}
.login-main {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
}
.login-main-glow {
  pointer-events: none;
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at top right, color-mix(in srgb, var(--brand-magenta) 10%, transparent), transparent 55%);
}
html.dark .login-main-glow {
  background: radial-gradient(ellipse at top right, color-mix(in srgb, var(--brand-purple) 18%, transparent), transparent 55%);
}
.login-brand-title .accent,
.login-mobile-brand .accent {
  color: var(--brand-magenta);
}
.login-brand .login-brand-title .accent {
  color: #ffffff;
  font-weight: 800;
}
.login-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 1.5rem 1.5rem 0;
}
@media (min-width: 640px) {
  .login-header { padding: 1.5rem 2.5rem 0; }
}
.login-body {
  position: relative;
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.5rem;
}
@media (min-width: 640px) {
  .login-body { padding: 2.5rem; }
}
.login-form-wrap { width: 100%; max-width: 26.25rem; }
.login-mobile-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
}
@media (min-width: 1024px) {
  .login-mobile-brand { display: none; }
}
.login-mobile-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  background: color-mix(in oklch, var(--primary) 10%, transparent);
  color: var(--primary);
  box-shadow: 0 0 0 1px color-mix(in oklch, var(--primary) 20%, transparent);
}
.login-intro { margin-bottom: 2rem; }
.login-intro h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}
.login-intro p {
  margin: 0.5rem 0 0;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--muted-foreground);
}
.login-card {
  display: grid;
  gap: 1.25rem;
  padding: 1.5rem;
  border-radius: 1rem;
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}
@media (min-width: 640px) {
  .login-card { padding: 2rem; }
}
.login-footer-note {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Drawer sidebar: tablet and below only (≤1023) */
@media (max-width: 1023px) {
  body.sidebar-open { overflow: hidden; }

  .app-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 60;
    width: min(18rem, 88vw);
    max-height: 100dvh;
    padding-left: env(safe-area-inset-left, 0px);
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: none;
  }
  .app-sidebar-header {
    padding-top: max(0px, env(safe-area-inset-top, 0px));
  }
  .app-sidebar.is-open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgb(0 0 0 / 0.18);
  }

  .app-content {
    padding: var(--content-pad-top) var(--page-pad-x) var(--page-pad-y);
    padding-bottom: max(var(--page-pad-y), env(safe-area-inset-bottom, 0px));
  }
}

/* Phone / small tablet content densify (≤767) */
@media (max-width: 767px) {
  .app-topbar {
    padding-left: var(--page-pad-x);
    padding-right: var(--page-pad-x);
  }
  .app-topbar-user { display: none; }
  .user-menu-label { display: none; }
  .user-menu-chevron { display: none; }
  .user-menu-trigger {
    padding: 0;
    width: 2.5rem;
    height: 2.5rem;
    justify-content: center;
    border-radius: 9999px;
  }
  .app-content {
    padding: var(--content-pad-top) var(--page-pad-x) var(--page-pad-y);
    padding-bottom: max(var(--page-pad-y), env(safe-area-inset-bottom, 0px));
  }

  .page-header h2 { font-size: 1.25rem; }
  .page-header-actions {
    width: 100%;
  }
  .page-header-actions > .ui-btn,
  .page-header > .ui-btn {
    flex: 1 1 auto;
    min-height: 2.75rem;
    justify-content: center;
  }

  .ui-card-header {
    flex-direction: column;
    align-items: stretch;
  }
  .ui-card-header .ui-btn {
    width: 100%;
    justify-content: center;
    min-height: 2.75rem;
  }

  .data-grid-table {
    font-size: 0.8125rem;
  }

  .row-actions {
    gap: var(--space-1);
  }

  .filter-bar {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
    align-content: start;
    gap: var(--stack-gap);
    padding: var(--card-pad);
  }
  .filter-bar .ui-field,
  .filter-bar .filter-select {
    min-width: 0;
    width: 100%;
    flex: none;
  }
  .filter-bar > .ui-btn,
  .filter-bar > a.ui-btn {
    width: 100%;
    min-height: 2.75rem;
    justify-content: center;
  }

  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--stack-gap);
  }
  .stat-value { font-size: 1.25rem; }

  .chart-bars {
    gap: var(--space-1);
    overflow-x: auto;
    padding-bottom: var(--space-1);
  }
  .chart-label { font-size: 0.625rem; }

  .ui-dialog-backdrop {
    padding: 0;
    align-items: flex-end;
  }
  .ui-dialog-backdrop > .ui-dialog {
    max-height: min(94dvh, 100%);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
  }
  .ui-dialog-backdrop .ui-dialog-footer {
    padding-bottom: max(var(--space-4), env(safe-area-inset-bottom, 0px));
  }
  .ui-dialog-backdrop .ui-dialog-footer-actions {
    width: 100%;
  }
  .ui-dialog-backdrop .ui-dialog-footer-actions .ui-btn {
    flex: 1 1 0;
    min-height: 2.75rem;
    justify-content: center;
  }
  .ui-dialog-backdrop .ui-dialog-footer .ui-btn-primary {
    min-width: 0;
  }

  .settings-actions .ui-btn {
    width: 100%;
    justify-content: center;
    min-height: 2.75rem;
  }

  .settings-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }
  .settings-tabs::-webkit-scrollbar { display: none; }
  .settings-tab {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .ui-dropdown-menu {
    right: 0;
    left: auto;
  }

  /* Touch targets for chrome only — not dense table row actions */
  .app-topbar .ui-btn-icon,
  .app-sidebar-toggle {
    min-width: 2.75rem;
    min-height: 2.75rem;
  }
}

@media (max-width: 480px) {
  .stat-grid {
    grid-template-columns: 1fr;
  }
}

/* —— DataGrid (chrome in ui-kit-grid.css; keep loading + embedded hooks) —— */
.data-grid-shell.is-loading,
.data-grid.is-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.55;
  transition: opacity 0.15s ease;
}
.data-grid.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    110deg,
    transparent 30%,
    color-mix(in srgb, var(--card) 55%, transparent) 50%,
    transparent 70%
  );
  background-size: 200% 100%;
  animation: grid-loading-shimmer 1.1s linear infinite;
  pointer-events: none;
}
[data-ajax-page].is-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.55;
  transition: opacity 0.15s ease;
  min-height: 8rem;
}
@keyframes grid-loading-shimmer {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

/* —— Alpine CRM data-grid (partials/data-grid.html) —— */
.crm-grid-toolbar {
  display: flex;
  flex-direction: column;
}
.crm-grid-toolbar-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 0.85rem;
  padding: 0.75rem 1rem;
}
.crm-grid-search {
  position: relative;
  flex: 1 1 auto;
  max-width: 24rem;
  width: 100%;
  min-width: 0;
}
.crm-grid-toolbar-actions {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.crm-grid-toolbar-add {
  height: 2.35rem;
  white-space: nowrap;
}

/* Filter bar — satu baris dropdown, terpisah dari search */
.crm-grid-filter-bar {
  padding: 0 1rem 0.65rem;
}
.crm-grid-filter-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
}
.app-content .crm-grid-filter-select,
.app-content .crm-grid-scope-select,
.crm-grid-filter-select,
.crm-grid-scope-select,
.app-content .crm-grid-filter-combobox,
.crm-grid-filter-combobox {
  box-sizing: border-box;
  flex: 1 1 0%;
  width: 0;
  min-width: 0;
  max-width: none;
}
.app-content .crm-grid-filter-select,
.app-content .crm-grid-scope-select,
.crm-grid-filter-select,
.crm-grid-scope-select {
  height: 2.25rem;
  min-height: 2.25rem;
  padding: 0 1.75rem 0 0.65rem;
  border: 1px solid var(--input);
  border-radius: calc(var(--radius) - 2px);
  background-color: var(--background);
  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='%236b7280' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  background-size: 0.75rem;
  color: var(--foreground);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: normal;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  box-shadow: none;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.app-content .crm-grid-filter-display,
.crm-grid-filter-display {
  box-sizing: border-box;
  display: block;
  width: 100%;
  height: 2.25rem;
  min-height: 2.25rem;
  padding: 0 1.75rem 0 0.65rem;
  border: 1px solid var(--input);
  border-radius: calc(var(--radius) - 2px);
  background-color: var(--background);
  background-image: none;
  color: var(--foreground);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: normal;
  cursor: text;
  box-shadow: none;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.app-content .crm-grid-filter-select.is-active,
.app-content .crm-grid-scope-select.is-active,
.crm-grid-filter-select.is-active,
.crm-grid-scope-select.is-active,
.app-content .crm-grid-filter-combobox:has(select.is-active) .crm-grid-filter-display,
.crm-grid-filter-combobox:has(select.is-active) .crm-grid-filter-display {
  border-color: color-mix(in oklab, var(--primary) 42%, var(--input));
  font-weight: 600;
}
.app-content .crm-grid-filter-select:focus,
.app-content .crm-grid-scope-select:focus,
.crm-grid-filter-select:focus,
.crm-grid-scope-select:focus,
.app-content .crm-grid-filter-display:focus,
.crm-grid-filter-display:focus,
.app-content .crm-grid-filter-combobox.is-open .crm-grid-filter-display,
.crm-grid-filter-combobox.is-open .crm-grid-filter-display {
  outline: none;
  border-color: color-mix(in oklab, var(--ring) 55%, var(--input));
  box-shadow: 0 0 0 2px color-mix(in oklab, var(--ring) 14%, transparent);
}
.crm-grid-filter-reset {
  flex: 0 0 auto;
  height: 2.25rem;
  min-height: 2.25rem;
  padding: 0 0.65rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  background: var(--background);
  color: var(--muted-foreground);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.12s ease, color 0.12s ease;
}
.crm-grid-filter-row.is-active .crm-grid-filter-reset {
  border-color: color-mix(in oklab, var(--primary) 30%, var(--border));
  color: var(--primary);
}
.crm-grid-filter-reset:hover {
  border-color: color-mix(in oklab, var(--primary) 35%, var(--border));
  color: var(--foreground);
}

@media (max-width: 639px) {
  .crm-grid-filter-row {
    flex-wrap: wrap;
  }
  .crm-grid-filter-select,
  .crm-grid-filter-combobox {
    flex: 1 1 calc(50% - 0.25rem);
    width: auto;
  }
  .crm-grid-filter-reset {
    flex: 1 1 100%;
  }
}
.crm-grid-search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  color: var(--muted-foreground);
  pointer-events: none;
  z-index: 1;
}
.crm-grid-search-icon svg {
  width: 1rem;
  height: 1rem;
}
.crm-grid-search-input {
  box-sizing: border-box;
  width: 100%;
  height: 2.35rem;
  padding: 0 0.75rem 0 2.5rem;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid var(--input);
  background: var(--background);
  color: var(--foreground);
  font-size: 0.875rem;
  line-height: 1.25;
  box-shadow: none;
}
.crm-grid-search-input::placeholder {
  color: var(--muted-foreground);
}
.crm-grid-search-input:focus {
  outline: none;
  border-color: color-mix(in oklab, var(--ring) 50%, var(--input));
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 22%, transparent);
}
.crm-grid-search-input.is-filtered {
  padding-right: 2.25rem;
}
.crm-grid-search-clear {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border: 0;
  border-radius: 0.375rem;
  background: transparent;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.crm-grid-search-clear:hover {
  background: var(--muted);
  color: var(--foreground);
}
.crm-grid-search-clear svg {
  width: 0.875rem;
  height: 0.875rem;
}
.crm-grid-search-input::-webkit-search-cancel-button,
.crm-grid-search-input::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}
.crm-grid-scroll {
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  min-width: 0;
  max-width: 100%;
}
.crm-grid-card {
  min-width: 0;
}
.crm-grid-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
}
.crm-grid-table--sticky {
  border-collapse: separate;
  border-spacing: 0;
}
.crm-grid-sticky {
  position: sticky;
  z-index: 2;
}
.crm-grid-thead .crm-grid-sticky {
  z-index: 5;
  background: color-mix(in oklab, var(--muted) 50%, var(--card));
}
.crm-grid-sticky-left-0 {
  left: 0;
  width: 8rem;
  min-width: 8rem;
  max-width: 8rem;
}
.crm-grid-sticky-left-1 {
  left: 8rem;
  width: 12rem;
  min-width: 12rem;
  max-width: 12rem;
}
.crm-grid-sticky-left-2 {
  left: 20rem;
  width: 10rem;
  min-width: 10rem;
  max-width: 10rem;
}
.crm-grid-sticky-right {
  right: 0;
  min-width: 9rem;
  z-index: 3;
}
.crm-grid-thead .crm-grid-sticky-right {
  z-index: 6;
}
.crm-grid-table--sticky tbody tr .crm-grid-sticky {
  background: var(--card);
}
.crm-grid-table--sticky tbody tr:nth-child(even) .crm-grid-sticky {
  background: color-mix(in oklab, var(--muted) 15%, var(--card));
}
.crm-grid-table--sticky tbody tr:hover .crm-grid-sticky {
  background: color-mix(in oklab, var(--muted) 35%, var(--card));
}
.crm-grid-sticky-left-edge::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 6px;
  transform: translateX(100%);
  background: linear-gradient(90deg, rgb(15 23 42 / 0.08), transparent);
  pointer-events: none;
}
.crm-grid-sticky-right-edge::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 6px;
  transform: translateX(-100%);
  background: linear-gradient(270deg, rgb(15 23 42 / 0.08), transparent);
  pointer-events: none;
}
.crm-grid-sticky-left-edge,
.crm-grid-sticky-right-edge {
  position: sticky;
}
.crm-grid-thead {
  display: table-header-group;
}
.crm-grid-thead tr {
  border-bottom: 1px solid var(--border);
  background: color-mix(in oklab, var(--muted) 50%, transparent);
}
.crm-grid-th {
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  vertical-align: middle;
  white-space: nowrap;
}
.crm-grid-th-index {
  width: 3rem;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
  text-align: center;
}
.crm-grid-th-actions {
  text-align: right;
}
.crm-grid-sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 100%;
  min-height: 1.25rem;
  padding: 0.15rem 0.25rem;
  margin: -0.15rem -0.25rem;
  border: 0;
  background: transparent;
  color: var(--muted-foreground);
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  line-height: 1.2;
  cursor: pointer;
  border-radius: 0.35rem;
  transition: color 0.12s ease, background 0.12s ease;
}
.crm-grid-sort-label {
  color: inherit;
}
.crm-grid-sort-btn:hover,
.crm-grid-sort-btn.is-active {
  color: var(--foreground);
}
.crm-grid-sort-btn:hover {
  background: color-mix(in oklab, var(--muted) 55%, transparent);
}
.crm-grid-sort-btn--center {
  justify-content: center;
  margin-inline: auto;
}
.crm-grid-sort-icon {
  display: inline-flex;
  flex-direction: column;
  flex-shrink: 0;
  width: 0.75rem;
  line-height: 0;
  gap: 0;
  opacity: 0.45;
  transition: opacity 0.12s ease;
}
.crm-grid-sort-btn:hover .crm-grid-sort-icon,
.crm-grid-sort-btn.is-active .crm-grid-sort-icon {
  opacity: 0.9;
}
.crm-grid-sort-up,
.crm-grid-sort-down {
  width: 0.75rem;
  height: 0.45rem;
  stroke-width: 2.25;
}
.crm-grid-sort-up.is-on,
.crm-grid-sort-down.is-on {
  color: var(--primary);
  opacity: 1;
}
.crm-grid-th .crm-grid-sort-btn {
  pointer-events: auto;
  position: relative;
  z-index: 1;
}
.crm-grid-mobile-count {
  font-size: 0.6875rem;
  line-height: 1.35;
}
.crm-grid-page-size select {
  box-sizing: border-box;
  width: auto;
  min-width: 3.25rem;
  height: 2rem;
  padding: 0 0.5rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--foreground);
  font-size: 0.75rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: normal;
  box-shadow: none;
  appearance: auto;
  -webkit-appearance: menulist;
  cursor: pointer;
}
.app-content .crm-grid-page-size select:focus {
  outline: none;
  box-shadow: none;
}
.data-grid-embedded,
.data-grid.data-grid-embedded {
  border: none;
  box-shadow: none;
  background: transparent;
  border-radius: 0;
}
.data-grid-embedded .data-grid-body { padding: 0; }
/* legacy header/search rules removed — toolbar lives in ui-kit-grid.css */
.ui-table tbody tr[hidden] { display: none; }
/* Hover for non-grid tables only; grid zebra/hover is in ui-kit-grid.css */
.app-content table:not(.data-grid-table) tbody tr:hover td {
  background: color-mix(in oklch, var(--accent) 50%, transparent);
}
.text-right, .ui-table .text-right { text-align: right; }

/* —— Dialog (professional create/edit sheet) —— */
body.dialog-open { overflow: hidden; }
.ui-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  background: rgb(15 23 42 / 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: ui-dialog-fade 0.18s ease-out;
}
@media (min-width: 640px) {
  .ui-dialog-backdrop {
    align-items: center;
    padding: 1.25rem;
  }
}
.ui-dialog-backdrop[hidden] { display: none !important; }
@keyframes ui-dialog-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes ui-dialog-rise {
  from { opacity: 0; transform: translateY(1rem) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.ui-dialog-backdrop > .ui-dialog {
  width: 100%;
  max-width: 32rem;
  max-height: min(92dvh, 40rem);
  display: flex;
  flex-direction: column;
  overflow: hidden; /* never scroll the whole dialog */
  border-radius: 1.1rem 1.1rem 0 0;
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow:
    0 0 0 1px color-mix(in oklch, var(--primary) 12%, transparent),
    0 28px 60px -20px rgb(0 0 0 / 0.45);
  animation: ui-dialog-rise 0.22s ease-out;
}
@media (min-width: 640px) {
  .ui-dialog-backdrop > .ui-dialog { border-radius: 1.1rem; }
}
.ui-dialog-backdrop .ui-dialog-wide { max-width: 42rem; }
.ui-dialog-backdrop .ui-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--stack-gap);
  flex-shrink: 0;
  padding: var(--space-5) var(--card-pad) var(--space-4);
  border-bottom: 1px solid var(--border);
  background:
    linear-gradient(180deg, color-mix(in oklch, var(--primary) 7%, transparent), transparent 70%);
}
.ui-dialog-backdrop .ui-dialog-heading { min-width: 0; flex: 1; }
.ui-dialog-backdrop .ui-dialog-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.ui-dialog-backdrop .ui-dialog-desc {
  margin: 0.35rem 0 0;
  font-size: 0.875rem;
  line-height: 1.4;
  color: var(--muted-foreground);
}
.ui-dialog-backdrop .ui-dialog-desc[hidden] { display: none !important; }
.ui-dialog-backdrop .ui-dialog-form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0; /* allow child body to scroll */
  overflow: hidden;
  padding: 0;
}
.ui-dialog-backdrop .ui-dialog-form[hidden] {
  display: none !important;
}
.ui-dialog-backdrop .ui-dialog-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: var(--space-5) var(--card-pad) var(--space-4);
  display: grid;
  gap: var(--section-gap);
  align-content: start;
}
.ui-dialog-backdrop .ui-dialog-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--stack-gap);
  flex-shrink: 0;
  margin-top: 0;
  padding: var(--space-4) var(--card-pad) var(--space-5);
  border-top: 1px solid var(--border);
  background: color-mix(in oklch, var(--muted) 35%, transparent);
}
.ui-dialog-backdrop .ui-dialog-footer-actions {
  display: flex;
  gap: var(--inline-gap);
}
.ui-dialog-backdrop .ui-dialog-footer .ui-btn-primary {
  min-width: 7.5rem;
}
.ui-readonly {
  margin: 0;
  padding: 0.65rem 0.85rem;
  border-radius: calc(var(--radius) - 2px);
  background: color-mix(in oklch, var(--muted) 50%, transparent);
  border: 1px solid var(--border);
  font-size: 0.9rem;
}

/* —— Form stack —— */
.form-stack { display: grid; gap: var(--space-5); }
.form-card { margin-bottom: var(--page-gap); }
.form-section-title {
  margin: 0 0 var(--space-4);
  font-size: 1rem;
  font-weight: 600;
}
.form-section-desc {
  margin: calc(var(--space-2) * -1) 0 var(--space-4);
  font-size: 0.875rem;
  color: var(--muted-foreground);
}
.form-row-2 {
  display: grid;
  gap: var(--section-gap);
  grid-template-columns: 1fr 1fr;
  align-items: start;
}
@media (max-width: 639px) { .form-row-2 { grid-template-columns: 1fr; } }
.ui-choice-fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}
.booking-deposit-section {
  display: grid;
  gap: 0.75rem;
  padding: 0.85rem 0 0;
  border-top: 1px solid var(--border);
}
.booking-deposit-section [data-booking-payment-field] {
  transition: opacity 0.15s;
}
.booking-deposit-section.is-collapsed [data-booking-payment-field] {
  display: none;
}
.ui-radio-group { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.ui-radio-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid var(--input);
  font-size: 0.875rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  color: var(--muted-foreground);
}
.ui-radio-item.is-checked,
.ui-radio-item:has(input:checked) {
  border-color: var(--primary);
  background: color-mix(in oklch, var(--primary) 5%, transparent);
  color: var(--foreground);
  font-weight: 500;
}
.ui-radio-item input { accent-color: var(--primary); }
/* —— Upload —— */
.ui-upload { margin: 0.5rem 0; }
.ui-upload-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.ui-upload-step {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
}
.ui-upload-label { font-size: 0.875rem; font-weight: 600; }
.ui-upload-hint { font-size: 0.8rem; color: var(--muted-foreground); margin: 0 0 0.75rem; }
.ui-upload-status {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: var(--muted);
  color: var(--muted-foreground);
}
.ui-upload-status[data-tone="ok"] {
  background: color-mix(in oklch, var(--success) 15%, transparent);
  color: var(--success);
}
.ui-upload-dropzone {
  border: 1.5px dashed var(--border);
  border-radius: calc(var(--radius) - 2px);
  padding: 1rem;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
}
.ui-upload-dropzone.dragover {
  border-color: var(--primary);
  background: color-mix(in oklch, var(--primary) 8%, transparent);
}
.ui-upload-pick {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  color: var(--muted-foreground);
}
.ui-upload-pick strong { color: var(--foreground); font-size: 0.875rem; }
.ui-upload-icon {
  width: 2.75rem;
  height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem;
  background: color-mix(in oklch, var(--primary) 10%, transparent);
  margin-bottom: 0.25rem;
}
.ui-upload-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
}
.ui-upload-preview {
  margin-bottom: 0.75rem;
  text-align: center;
}
.ui-upload-preview img {
  max-height: 12rem;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid var(--border);
  background: #fff;
  padding: 0.5rem;
}
.ui-upload-preview.hidden, .hidden { display: none !important; }

/* —— Sweeter sidebar —— */
html.dark .app-sidebar {
  background: color-mix(in oklch, var(--card) 88%, var(--background));
}
.app-sidebar-brand {
  background: color-mix(in srgb, var(--brand-purple) 6%, transparent);
  letter-spacing: -0.02em;
}
.nav-link.active {
  box-shadow: inset 3px 0 0 var(--primary);
  border-radius: 0 calc(var(--radius) - 2px) calc(var(--radius) - 2px) 0;
}

/* Legacy aliases (templates migrating to ui-* classes) */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 2.25rem;
  padding: 0 1rem;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid transparent;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  background: var(--primary);
  color: var(--primary-foreground);
}
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 2.25rem;
  padding: 0 1rem;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid var(--border);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  background: transparent;
  color: var(--foreground);
}
.btn-ghost:hover { background: var(--accent); }
.panel {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}
.panel h3 { margin-top: 0; margin-bottom: 1rem; font-size: 1rem; font-weight: 600; }
.app-content table.crm-grid-table th,
.app-content table.crm-grid-table td {
  border-bottom: 1px solid var(--border);
}
.app-content table.crm-grid-table th {
  color: var(--muted-foreground);
  font-weight: 650;
}
.app-content table:not(.ui-table):not(.crm-grid-table) {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.app-content table:not(.ui-table):not(.crm-grid-table) th,
.app-content table:not(.ui-table):not(.crm-grid-table) td {
  text-align: left;
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid var(--border);
}
.app-content table:not(.ui-table):not(.crm-grid-table) th {
  color: var(--muted-foreground);
  font-weight: 600;
}
.app-content label:not(.ui-checkbox):not(.ui-radio-item):not(.ui-radio):not(.ui-label):not(.ui-field-label):not(.ops-field-label):not(.ui-field):not(.ui-multiselect-option) {
  display: grid;
  gap: 0.35rem;
  font-size: 0.875rem;
}

/* Themed native <select> — must beat generic .app-content rules below */
.app-content select.ui-field-control,
.app-content .ui-select,
.app-content .crm-grid-filter-select,
.app-content .crm-grid-scope-select,
.app-content .ops-panel .ops-select,
.app-content .crm-grid-page-size select,
.app-content .data-grid-page-size select,
.app-content .filter-bar .filter-select {
  box-sizing: border-box;
  line-height: normal;
}

.app-content select.ui-field-control {
  display: block;
  height: 2.5rem;
  min-height: 2.5rem;
  width: 100%;
  padding: 0 2rem 0 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid var(--input);
  background-color: var(--background);
  color: var(--foreground);
  font-size: 0.875rem;
  box-shadow: none;
  appearance: none;
  -webkit-appearance: none;
  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='%236b7280' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
  background-size: 0.85rem;
  cursor: pointer;
}
.app-content select.ui-field-control:focus {
  outline: none;
  border-color: color-mix(in oklab, var(--ring) 50%, var(--input));
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 22%, transparent);
}
.app-content select.ui-field-control:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.app-content input:not(.ui-input):not(.crm-grid-search-input):not(.ui-field-control):not([type="checkbox"]):not([type="radio"]),
.app-content select:not(.ui-select):not(.ui-combobox-native):not(.ops-select):not(.crm-grid-filter-select):not(.crm-grid-scope-select):not(.ui-field-control),
.app-content textarea:not(.ui-textarea):not(.ui-field-control) {
  width: 100%;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid var(--input);
  background: transparent;
  color: var(--foreground);
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}
/* Generic focus only for unstyled controls — themed selects keep their own rings */
.app-content input:not(.ui-input):not(.crm-grid-search-input):not(.ui-field-control):focus,
.app-content select:not(.ui-select):not(.ui-combobox-native):not(.ops-select):not(.crm-grid-filter-select):not(.crm-grid-scope-select):not(.ui-field-control):focus,
.app-content textarea:not(.ui-textarea):not(.ui-field-control):focus {
  outline: none;
  border-color: var(--ring);
  box-shadow: 0 0 0 1px var(--ring);
}

.ui-readonly { margin: 0; font-size: 0.9375rem; font-weight: 500; }
.ui-link { color: var(--primary); font-size: 0.875rem; text-decoration: none; }
.ui-link:hover { text-decoration: underline; }
.ui-btn-sm { padding: 0.25rem 0.625rem; font-size: 0.8125rem; min-height: 2rem; }
.page-note { margin: -0.5rem 0 1rem; font-size: 0.875rem; }
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  align-content: flex-start;
  gap: var(--stack-gap);
  margin-bottom: var(--page-gap);
  padding: var(--card-pad);
  border-radius: calc(var(--radius) + 2px);
  border: 1px solid var(--border);
  background: var(--card);
}
.filter-bar > * {
  flex: 0 0 auto; /* never stretch vertically in column layouts */
}
.filter-bar .ui-field {
  margin: 0;
  min-width: min(10rem, 100%);
  flex: 1 1 10rem;
}
.filter-bar .filter-select { min-width: min(12rem, 100%); }
@media (max-width: 767px) {
  .filter-bar {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
    align-content: start;
  }
  .filter-bar > *,
  .filter-bar .ui-field {
    flex: none;
    width: 100%;
    min-width: 0;
  }
  .filter-bar > .ui-btn,
  .filter-bar > a.ui-btn {
    width: 100%;
    min-height: 2.75rem;
    justify-content: center;
  }
}

/* Flatpickr: never reserve layout space when closed */
.flatpickr-calendar:not(.open) {
  display: none !important;
}
.flatpickr-calendar.open {
  display: inline-block !important;
  z-index: 80;
}
.ui-datepicker,
.ui-datepicker-input-wrap,
.flatpickr-wrapper {
  min-height: 0;
}

.settings-form {
  max-width: none;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--section-gap);
  padding-bottom: var(--space-7);
}

.settings-layout {
  display: grid;
  gap: var(--section-gap);
}
@media (min-width: 960px) {
  .settings-layout {
    grid-template-columns: minmax(11rem, 14rem) minmax(0, 1fr);
    align-items: start;
    gap: var(--space-5);
  }
  .settings-tabs {
    flex-direction: column;
    flex-wrap: nowrap;
    position: sticky;
    top: var(--space-3);
  }
  .settings-tab {
    width: 100%;
    justify-content: flex-start;
  }
}

.settings-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  padding: var(--space-1);
  border-radius: calc(var(--radius));
  border: 1px solid var(--border);
  background: color-mix(in oklch, var(--muted) 35%, transparent);
}

.settings-tab {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border: 0;
  border-radius: calc(var(--radius) - 4px);
  background: transparent;
  color: var(--muted-foreground);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.settings-tab:hover {
  color: var(--foreground);
  background: color-mix(in oklch, var(--background) 70%, transparent);
}

.settings-tab.is-active {
  color: var(--foreground);
  background: var(--card);
  box-shadow: 0 1px 3px color-mix(in oklch, var(--foreground) 8%, transparent);
}

.settings-tab-icon {
  display: inline-flex;
  width: 1rem;
  height: 1rem;
  opacity: 0.85;
}

.settings-tab-icon svg {
  width: 100%;
  height: 100%;
}

.settings-panels {
  display: grid;
  gap: 1rem;
}

.settings-panel {
  display: none;
  gap: 1rem;
}

.settings-panel.is-active {
  display: grid;
}

.settings-panel-intro {
  margin: 0;
  padding: 0.875rem 1rem;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid var(--border);
  background: color-mix(in oklch, var(--primary) 6%, var(--card));
  font-size: 0.875rem;
  color: var(--muted-foreground);
  line-height: 1.5;
}

.settings-panel-intro strong {
  color: var(--foreground);
}

.settings-card { margin: 0; }
.settings-card .ui-card-desc,
.ui-card-desc {
  margin: var(--space-2) 0 0;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--muted-foreground);
}
.settings-subheading { margin: 0.5rem 0 0; font-size: 0.875rem; font-weight: 600; color: var(--muted-foreground); }
.field-hint { margin: -0.25rem 0 0; font-size: 0.8rem; color: var(--muted-foreground); }
.field-hint code { font-size: 0.85em; color: var(--foreground); }
.duration-preview {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  background: color-mix(in oklch, var(--muted) 30%, transparent);
}
.duration-preview-title { margin: 0 0 0.75rem; font-size: 0.875rem; font-weight: 600; }
.duration-preview-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.duration-chip {
  display: inline-flex;
  padding: 0.375rem 0.75rem;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid var(--border);
  background: var(--background);
  font-size: 0.875rem;
  font-weight: 500;
}
.checkbox-stack { gap: 0.75rem; }
.settings-actions { display: flex; justify-content: flex-start; padding-top: 0.5rem; }
.settings-readonly-note { text-align: center; font-size: 0.875rem; }
.ui-weekday-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
}
.ui-weekday-row .ui-checkbox.is-inline {
  margin: 0;
}
.qris-preview-wrap { margin-bottom: 1rem; }
.qris-preview-img {
  max-height: 12rem;
  width: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #fff;
  padding: 0.5rem;
}
.dashboard-card, .report-card { margin-bottom: var(--page-gap); }
.opname-diff.has-diff { color: #d97706; font-weight: 600; }
.refund-form { display: inline-flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; }
.ui-input-sm { height: 2rem; padding: 0.25rem 0.5rem; font-size: 0.8125rem; }

/* —— Shift detail page —— */
.shift-detail-page {
  display: flex;
  flex-direction: column;
  gap: calc(var(--page-gap) * 0.85);
}
.shift-block-desc {
  margin-top: -0.35rem;
  margin-bottom: 1rem;
}

/* KPI */
.shift-kpi-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (min-width: 1024px) {
  .shift-kpi-grid {
    grid-template-columns: 1.25fr repeat(3, 1fr);
    gap: var(--section-gap);
  }
}
.shift-detail-header {
  align-items: flex-start;
}
.shift-detail-intro {
  min-width: 0;
  flex: 1;
}
.shift-detail-back {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-bottom: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted-foreground);
  text-decoration: none;
  transition: color 0.15s;
}
.shift-detail-back:hover {
  color: var(--foreground);
}
.shift-detail-back .nav-icon {
  width: 1rem;
  height: 1rem;
}
.shift-detail-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.625rem 0.875rem;
}
.shift-detail-title-row h2 {
  margin: 0;
}
.shift-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1px solid var(--border);
  background: var(--muted);
  color: var(--muted-foreground);
}
.shift-status-pill.is-open {
  border-color: color-mix(in oklch, var(--accent-emerald, oklch(0.65 0.15 160)) 35%, var(--border));
  background: color-mix(in oklch, var(--accent-emerald, oklch(0.65 0.15 160)) 12%, var(--card));
  color: color-mix(in oklch, var(--accent-emerald, oklch(0.65 0.15 160)) 70%, var(--foreground));
}
.shift-status-pill.is-closed {
  background: var(--muted);
  color: var(--muted-foreground);
}
.shift-status-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  background: currentColor;
  animation: shift-pulse 2s ease-in-out infinite;
}
@keyframes shift-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}
.shift-detail-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.65rem;
  margin: 0.5rem 0 0;
  font-size: 0.8125rem;
  color: var(--muted-foreground);
  line-height: 1.45;
}
.shift-detail-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.shift-detail-meta-item .nav-icon {
  width: 0.9rem;
  height: 0.9rem;
  opacity: 0.65;
}
.shift-detail-meta-item strong {
  color: var(--foreground);
  font-weight: 600;
}
.shift-detail-meta-sep {
  width: 3px;
  height: 3px;
  border-radius: 999px;
  background: var(--border);
  flex-shrink: 0;
}
.shift-detail-notes {
  margin: 0.5rem 0 0;
  padding: 0.55rem 0.75rem;
  border-radius: calc(var(--radius) - 2px);
  border: 1px dashed var(--border);
  background: color-mix(in oklch, var(--muted) 50%, transparent);
  font-size: 0.8125rem;
  color: var(--muted-foreground);
  line-height: 1.45;
}
.shift-detail-actions {
  flex-shrink: 0;
}
.shift-export-group {
  display: inline-flex;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}
.shift-export-group .ui-btn {
  border-radius: 0;
  border: 0;
  box-shadow: none;
}
.shift-export-group .ui-btn + .ui-btn {
  border-left: 1px solid var(--border);
}
.shift-export-group .ui-btn .nav-icon {
  width: 0.95rem;
  height: 0.95rem;
}

.shift-kpi-card {
  padding: var(--card-pad);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
}
.shift-kpi-hero {
  border-color: color-mix(in oklch, var(--primary) 22%, var(--border));
  background: linear-gradient(
    145deg,
    color-mix(in oklch, var(--primary) 7%, var(--card)) 0%,
    var(--card) 55%
  );
}
.shift-kpi-head {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.shift-kpi-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: calc(var(--radius) - 2px);
  background: var(--muted);
  color: var(--muted-foreground);
}
.shift-kpi-icon .nav-icon {
  width: 1rem;
  height: 1rem;
}
.shift-kpi-icon--sales {
  background: color-mix(in oklch, var(--primary) 14%, var(--muted));
  color: var(--primary);
}
.shift-kpi-label {
  font-size: 0.8rem;
  color: var(--muted-foreground);
}
.shift-kpi-value {
  margin-top: 0.35rem;
  font-size: 1.625rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}
.shift-kpi-value--sm {
  font-size: 1.35rem;
}
.shift-kpi-split {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  margin: 0.5rem 0 0;
  font-size: 0.6875rem;
  color: var(--muted-foreground);
}
.shift-kpi-split-item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-variant-numeric: tabular-nums;
}
.shift-kpi-hint {
  margin: 0.35rem 0 0;
  font-size: 0.75rem;
  line-height: 1.35;
}

.shift-detail-columns {
  display: grid;
  gap: var(--section-gap);
}
@media (min-width: 960px) {
  .shift-detail-columns {
    grid-template-columns: 1fr 1fr;
  }
}
.shift-section {
  margin-bottom: 0;
}
.shift-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 1rem;
}
.shift-inline-badge {
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
  background: color-mix(in oklch, var(--accent-amber, oklch(0.75 0.12 85)) 14%, var(--muted));
  color: color-mix(in oklch, var(--accent-amber, oklch(0.75 0.12 85)) 75%, var(--foreground));
  white-space: nowrap;
}

.shift-cash-card .ui-card-body {
  padding-bottom: 1rem;
}

/* Cash flow — horizontal, tidak menumpuk */
.shift-cash-flow {
  display: flex;
  align-items: stretch;
  gap: 0.35rem;
  padding: 0.85rem;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid var(--border);
  background: color-mix(in oklch, var(--muted) 24%, var(--card));
  overflow-x: auto;
}
.shift-cash-flow-step {
  flex: 1 1 0;
  min-width: 7.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.55rem 0.65rem;
  border-radius: calc(var(--radius) - 4px);
  background: var(--card);
  border: 1px solid color-mix(in oklch, var(--border) 85%, transparent);
}
.shift-cash-flow-step--variance.shift-variance--surplus {
  border-color: color-mix(in oklch, var(--accent-emerald, oklch(0.65 0.15 160)) 35%, var(--border));
  background: color-mix(in oklch, var(--accent-emerald, oklch(0.65 0.15 160)) 8%, var(--card));
}
.shift-cash-flow-step--variance.shift-variance--short {
  border-color: color-mix(in oklch, var(--destructive) 35%, var(--border));
  background: color-mix(in oklch, var(--destructive) 6%, var(--card));
}
.shift-cash-flow-step--variance.shift-variance--short .shift-cash-flow-value {
  color: var(--destructive);
}
.shift-cash-flow-label {
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-foreground);
}
.shift-cash-flow-value {
  font-size: clamp(0.8125rem, 1.8vw, 1rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
  word-break: break-word;
}
.shift-cash-flow-hint {
  font-size: 0.625rem;
  color: var(--muted-foreground);
  line-height: 1.25;
}
.shift-cash-flow-arrow {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  color: var(--muted-foreground);
  opacity: 0.4;
}
.shift-cash-flow-arrow .nav-icon {
  width: 0.9rem;
  height: 0.9rem;
}

.shift-cash-pay-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.85rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}
.shift-cash-pay-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  border: 1px solid var(--border);
  background: var(--card);
  white-space: nowrap;
}
.shift-cash-pay-chip strong {
  font-variant-numeric: tabular-nums;
}
.shift-cash-pay-chip--cash {
  border-color: color-mix(in oklch, var(--primary) 20%, var(--border));
}
.shift-cash-pay-chip--qris {
  border-color: color-mix(in oklch, var(--accent-emerald, oklch(0.65 0.15 160)) 20%, var(--border));
}
.shift-cash-pay-note {
  font-size: 0.6875rem;
  margin-left: auto;
}

/* Analytics — 3 kolom seimbang */
.shift-analytics-grid {
  display: grid;
  gap: 0.75rem;
}
@media (min-width: 960px) {
  .shift-analytics-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--section-gap);
    align-items: stretch;
  }
}
.shift-analytics-card {
  height: 100%;
}
.shift-analytics-card .ui-card-body {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.shift-analytics-card .ui-card-title {
  margin-bottom: 0.75rem;
}

.shift-mix-list--compact {
  gap: 0.65rem;
  flex: 1;
}

/* Breakdown satu baris — label | bar | nominal */
.shift-breakdown-list--compact {
  gap: 0.55rem;
}
.shift-breakdown-list--compact .shift-breakdown-row {
  display: grid;
  grid-template-columns: minmax(5.5rem, 1fr) minmax(3rem, 2fr) auto;
  align-items: center;
  gap: 0.5rem 0.65rem;
}
.shift-breakdown-list--compact .shift-breakdown-label {
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.25;
}
.shift-breakdown-list--compact .shift-breakdown-meta {
  font-size: 0.6875rem;
  font-weight: 400;
}
.shift-breakdown-list--compact .shift-breakdown-bar {
  height: 0.35rem;
}
.shift-breakdown-list--compact .shift-breakdown-amount {
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-align: right;
}

/* Panel header — judul + chip sebaris */
.shift-panel-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem 1rem;
  margin-bottom: 0;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
}
.shift-panel-header-main {
  min-width: 0;
}
.shift-panel-header-main .ui-card-desc {
  margin-top: 0.15rem;
  margin-bottom: 0;
}
.shift-panel-title-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}
.shift-panel-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: calc(var(--radius) - 2px);
  flex-shrink: 0;
}
.shift-panel-icon .nav-icon {
  width: 1.1rem;
  height: 1.1rem;
}
.shift-panel-icon--ops {
  background: color-mix(in oklch, var(--accent-amber, oklch(0.75 0.12 85)) 14%, var(--muted));
  color: color-mix(in oklch, var(--accent-emerald, oklch(0.65 0.15 160)) 80%, var(--foreground));
}
.shift-panel-icon--fin {
  background: color-mix(in oklch, var(--primary) 12%, var(--muted));
  color: var(--primary);
}
.shift-panel-title-row .ui-card-title {
  margin: 0;
  line-height: 1.25;
}
.shift-panel-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
.shift-panel-chip {
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  border: 1px solid var(--border);
  background: var(--muted);
  color: var(--muted-foreground);
  white-space: nowrap;
}
.shift-panel-chip--money {
  color: var(--foreground);
  background: color-mix(in oklch, var(--primary) 8%, var(--card));
  border-color: color-mix(in oklch, var(--primary) 22%, var(--border));
}
.shift-panel-chip--muted {
  opacity: 0.8;
}
.shift-panel-toolbar {
  padding: 0.75rem 0;
  border-bottom: 1px solid color-mix(in oklch, var(--border) 70%, transparent);
  margin-bottom: 0.75rem;
}
.shift-ledger--ops .shift-pro-table-wrap,
.shift-ledger--fin .data-grid-shell.is-embedded {
  margin-top: 0;
}

.shift-cash-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.625rem;
}
@media (min-width: 900px) {
  .shift-cash-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
  }
}

.shift-cash-metric {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-height: 5rem;
  padding: 0.8rem 0.85rem;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid var(--border);
  background: color-mix(in oklch, var(--muted) 30%, var(--card));
}
.shift-cash-metric-label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  line-height: 1.2;
}
.shift-cash-metric-value {
  font-size: clamp(0.875rem, 2.2vw, 1.0625rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
  word-break: break-word;
}
.shift-cash-metric-hint {
  margin-top: auto;
  font-size: 0.6875rem;
  line-height: 1.3;
  min-height: 0.9rem;
}

.shift-cash-metric--variance.shift-variance--surplus {
  border-color: color-mix(in oklch, var(--accent-emerald, oklch(0.65 0.15 160)) 40%, var(--border));
  background: color-mix(in oklch, var(--accent-emerald, oklch(0.65 0.15 160)) 10%, var(--card));
}
.shift-cash-metric--variance.shift-variance--surplus .shift-cash-metric-label,
.shift-cash-metric--variance.shift-variance--surplus .shift-cash-metric-hint {
  color: color-mix(in oklch, var(--accent-emerald, oklch(0.65 0.15 160)) 70%, var(--foreground));
}
.shift-cash-metric--variance.shift-variance--short {
  border-color: color-mix(in oklch, var(--destructive) 40%, var(--border));
  background: color-mix(in oklch, var(--destructive) 7%, var(--card));
}
.shift-cash-metric--variance.shift-variance--short .shift-cash-metric-label,
.shift-cash-metric--variance.shift-variance--short .shift-cash-metric-hint {
  color: color-mix(in oklch, var(--destructive) 75%, var(--foreground));
}
.shift-cash-metric--variance.shift-variance--short .shift-cash-metric-value {
  color: var(--destructive);
}

.shift-cash-inflow {
  padding: 0.85rem;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid var(--border);
  background: color-mix(in oklch, var(--muted) 22%, var(--card));
}
.shift-cash-inflow-title {
  display: block;
  margin-bottom: 0.55rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted-foreground);
}
.shift-cash-inflow-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.625rem;
}
.shift-cash-inflow-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.65rem 0.75rem;
  border-radius: calc(var(--radius) - 4px);
  border: 1px solid var(--border);
  background: var(--card);
}
.shift-cash-inflow-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.shift-cash-inflow-item-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--foreground);
  white-space: nowrap;
}
.shift-cash-inflow-item-count {
  font-size: 0.6875rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted-foreground);
  white-space: nowrap;
}
.shift-cash-inflow-item-value {
  font-size: 0.9375rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.shift-cash-inflow-item--cash {
  border-color: color-mix(in oklch, var(--primary) 18%, var(--border));
}
.shift-cash-inflow-item--qris {
  border-color: color-mix(in oklch, var(--accent-emerald, oklch(0.65 0.15 160)) 18%, var(--border));
}
.shift-cash-inflow-note {
  margin: 0.65rem 0 0;
  font-size: 0.6875rem;
  line-height: 1.4;
}

.shift-mix-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.shift-mix-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.shift-mix-info {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}
.shift-mix-name {
  font-size: 0.875rem;
  font-weight: 500;
}
.shift-mix-count {
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}
.shift-mix-bar {
  height: 0.45rem;
  border-radius: 999px;
  background: var(--muted);
  overflow: hidden;
}
.shift-mix-fill {
  height: 100%;
  border-radius: inherit;
  min-width: 2px;
  transition: width 0.35s ease;
}
.shift-mix-fill--session { background: var(--primary); }
.shift-mix-fill--extend { background: color-mix(in oklch, var(--primary) 55%, var(--accent-emerald, oklch(0.65 0.15 160))); }
.shift-mix-fill--order { background: color-mix(in oklch, var(--accent-emerald, oklch(0.65 0.15 160)) 88%, var(--foreground)); }

.shift-breakdown-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.shift-breakdown-row {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.shift-breakdown-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}
.shift-breakdown-label {
  font-size: 0.875rem;
  font-weight: 500;
}
.shift-breakdown-amount {
  font-variant-numeric: tabular-nums;
  font-size: 0.875rem;
}
.shift-breakdown-bar {
  height: 0.4rem;
  border-radius: 999px;
  background: var(--muted);
  overflow: hidden;
}
.shift-breakdown-fill {
  height: 100%;
  border-radius: inherit;
  min-width: 2px;
}
.shift-breakdown-fill--cash { background: var(--primary); }
.shift-breakdown-fill--qris { background: color-mix(in oklch, var(--accent-emerald, oklch(0.65 0.15 160)) 88%, var(--foreground)); }
.shift-breakdown-fill--cafe { background: color-mix(in oklch, var(--accent-amber, oklch(0.75 0.12 85)) 85%, var(--foreground)); }
.shift-breakdown-fill--vip { background: color-mix(in oklch, var(--primary) 70%, #a855f7); }
.shift-breakdown-fill--standard { background: color-mix(in oklch, var(--primary) 45%, var(--muted-foreground)); }
.shift-breakdown-fill--payment { background: var(--primary); }
.shift-breakdown-meta {
  font-size: 0.6875rem;
}
.shift-empty-hint {
  margin: 0;
  padding: 1.25rem 0;
  text-align: center;
  font-size: 0.875rem;
}

.shift-cafe-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
.shift-cafe-chip {
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--muted);
  color: var(--muted-foreground);
  font-variant-numeric: tabular-nums;
}
.shift-cafe-chip strong {
  font-weight: 700;
  color: var(--foreground);
}
.shift-cafe-chip--ok {
  border-color: color-mix(in oklch, var(--accent-emerald, oklch(0.65 0.15 160)) 30%, var(--border));
  color: color-mix(in oklch, var(--accent-emerald, oklch(0.65 0.15 160)) 70%, var(--foreground));
}
.shift-cafe-chip--warn {
  border-color: color-mix(in oklch, var(--accent-amber, oklch(0.75 0.12 85)) 35%, var(--border));
  color: color-mix(in oklch, var(--accent-amber, oklch(0.75 0.12 85)) 75%, var(--foreground));
}
.shift-cafe-chip--muted {
  opacity: 0.75;
}
.shift-cafe-chip--total {
  font-weight: 700;
  color: var(--foreground);
  background: color-mix(in oklch, var(--primary) 10%, var(--card));
  border-color: color-mix(in oklch, var(--primary) 25%, var(--border));
}

.shift-order-id {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--muted-foreground);
}
.shift-order-source {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  border-radius: calc(var(--radius) - 4px);
  font-size: 0.75rem;
  font-weight: 500;
  background: var(--muted);
}
.shift-order-items {
  max-width: 16rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.shift-txn-type {
  font-size: 0.8125rem;
  font-weight: 500;
}

/* Ledger compare + professional tables */
.shift-ledger-compare {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: color-mix(in oklch, var(--muted) 22%, var(--card));
}
@media (max-width: 767px) {
  .shift-ledger-compare {
    grid-template-columns: 1fr;
  }
  .shift-ledger-compare-divider {
    transform: rotate(90deg);
    justify-self: center;
  }
}
.shift-ledger-compare-card {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  min-width: 0;
}
.shift-ledger-compare-card strong {
  display: block;
  font-size: 0.8125rem;
}
.shift-ledger-compare-card p {
  margin: 0.1rem 0 0;
  font-size: 0.6875rem;
  line-height: 1.35;
  color: var(--muted-foreground);
}
.shift-ledger-compare-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: calc(var(--radius) - 2px);
  flex-shrink: 0;
}
.shift-ledger-compare-icon .nav-icon {
  width: 1rem;
  height: 1rem;
}
.shift-ledger-compare-card--ops .shift-ledger-compare-icon {
  background: color-mix(in oklch, var(--accent-amber, oklch(0.75 0.12 85)) 14%, var(--muted));
  color: color-mix(in oklch, var(--accent-amber, oklch(0.75 0.12 85)) 80%, var(--foreground));
}
.shift-ledger-compare-card--fin .shift-ledger-compare-icon {
  background: color-mix(in oklch, var(--primary) 12%, var(--muted));
  color: var(--primary);
}
.shift-ledger-compare-divider {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted-foreground);
  opacity: 0.45;
}
.shift-ledger-compare-divider .nav-icon {
  width: 1rem;
  height: 1rem;
}

.shift-ledger {
  overflow: hidden;
}
.shift-ledger--ops {
  border-color: color-mix(in oklch, var(--accent-amber, oklch(0.75 0.12 85)) 22%, var(--border));
}
.shift-ledger--fin {
  border-color: color-mix(in oklch, var(--primary) 22%, var(--border));
}
.shift-ledger-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem 1.25rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.shift-ledger-head-main {
  min-width: min(100%, 14rem);
  flex: 1;
}
.shift-ledger-badge {
  display: inline-block;
  margin-bottom: 0.35rem;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.shift-ledger-badge--ops {
  background: color-mix(in oklch, var(--accent-amber, oklch(0.75 0.12 85)) 14%, var(--muted));
  color: color-mix(in oklch, var(--accent-amber, oklch(0.75 0.12 85)) 75%, var(--foreground));
}
.shift-ledger-badge--fin {
  background: color-mix(in oklch, var(--primary) 12%, var(--muted));
  color: var(--primary);
}
.shift-ledger-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.85rem;
  margin: 0;
}
.shift-ledger-stat {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.45rem 0.65rem;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid var(--border);
  background: var(--card);
  min-width: 4.25rem;
}
.shift-ledger-stat dt {
  margin: 0;
  font-size: 0.625rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted-foreground);
}
.shift-ledger-stat dd {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}
.shift-ledger-stat--ok dd { color: color-mix(in oklch, var(--accent-emerald, oklch(0.65 0.15 160)) 75%, var(--foreground)); }
.shift-ledger-stat--warn dd { color: color-mix(in oklch, var(--accent-amber, oklch(0.75 0.12 85)) 80%, var(--foreground)); }
.shift-ledger-stat--muted dd { color: var(--muted-foreground); }
.shift-ledger-stat--money dd { font-size: 0.8125rem; }

.shift-table-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.65rem;
  margin-bottom: 0.85rem;
}
.shift-table-search {
  position: relative;
  flex: 1;
  min-width: min(100%, 14rem);
}
.shift-table-search .data-grid-search-icon {
  position: absolute;
  left: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  opacity: 0.55;
}
.shift-table-search .ui-input {
  width: 100%;
  padding-left: 2.1rem;
}
.shift-table-toolbar-meta {
  margin-left: auto;
  font-size: 0.8125rem;
  color: var(--muted-foreground);
  font-variant-numeric: tabular-nums;
}
.shift-table-toolbar-meta strong {
  color: var(--foreground);
}

.shift-pro-table-wrap {
  overflow-x: auto;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid var(--border);
}
.shift-pro-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}
.shift-pro-table thead th {
  padding: 0.55rem 0.75rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted-foreground);
  background: color-mix(in oklch, var(--muted) 45%, transparent);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.shift-pro-table tbody td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid color-mix(in oklch, var(--border) 70%, transparent);
  vertical-align: top;
}
.shift-pro-table tbody tr:last-child td {
  border-bottom: 0;
}
.shift-pro-table tbody tr:hover td {
  background: color-mix(in oklch, var(--muted) 25%, transparent);
}
.shift-pro-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.shift-row-id {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--foreground);
}
.shift-row-note {
  display: inline-flex;
  margin-left: 0.25rem;
  vertical-align: middle;
  color: var(--muted-foreground);
  opacity: 0.7;
}
.shift-row-note .nav-icon {
  width: 0.85rem;
  height: 0.85rem;
}

.shift-src-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.45rem;
  border-radius: calc(var(--radius) - 4px);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}
.shift-src-badge--counter {
  background: color-mix(in oklch, var(--accent-amber, oklch(0.75 0.12 85)) 12%, var(--muted));
  color: color-mix(in oklch, var(--accent-amber, oklch(0.75 0.12 85)) 78%, var(--foreground));
}
.shift-src-badge--table {
  background: color-mix(in oklch, var(--primary) 10%, var(--muted));
  color: var(--primary);
}

.shift-item-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  max-width: 18rem;
}
.shift-item-chip {
  display: inline-block;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  line-height: 1.3;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--foreground);
}
.shift-item-chip--more {
  color: var(--muted-foreground);
  font-style: italic;
  border-style: dashed;
}

.shift-qty-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  padding: 0.1rem 0.35rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--muted);
}

.shift-money-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.1rem;
}
.shift-money-sub {
  font-size: 0.6875rem;
}

.shift-created-cell {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 7rem;
}
.shift-created-by {
  font-size: 0.6875rem;
  color: var(--muted-foreground);
}

.shift-table-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 2rem 1rem;
  text-align: center;
}
.shift-table-empty .nav-icon {
  width: 1.75rem;
  height: 1.75rem;
  opacity: 0.35;
}
.shift-table-empty p {
  margin: 0;
}

.shift-table-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}

.shift-ledger--fin .data-grid-shell.is-embedded {
  margin-top: 0;
}
.shift-ledger--fin .data-grid-toolbar {
  margin-bottom: 0.65rem;
}

.shift-txn-badge {
  display: inline-flex;
  padding: 0.15rem 0.45rem;
  border-radius: calc(var(--radius) - 4px);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}
.shift-txn-badge--session {
  background: color-mix(in oklch, var(--primary) 12%, var(--muted));
  color: var(--primary);
}
.shift-txn-badge--extend {
  background: color-mix(in oklch, var(--primary) 8%, var(--muted));
  color: color-mix(in oklch, var(--primary) 65%, var(--foreground));
}
.shift-txn-badge--order {
  background: color-mix(in oklch, var(--accent-emerald, oklch(0.65 0.15 160)) 12%, var(--muted));
  color: color-mix(in oklch, var(--accent-emerald, oklch(0.65 0.15 160)) 72%, var(--foreground));
}
.shift-txn-badge--member {
  background: var(--muted);
  color: var(--muted-foreground);
}

.shift-txn-relation {
  display: block;
  font-size: 0.6875rem;
  margin-top: 0.1rem;
}
.shift-context-cell {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  align-items: flex-start;
}
.shift-txn-customer {
  font-size: 0.6875rem;
  color: var(--muted-foreground);
}
.shift-pay-method {
  font-size: 0.8125rem;
  font-weight: 500;
}
.shift-amount--refund {
  color: var(--destructive);
}
.shift-txn-by {
  display: block;
  font-size: 0.6875rem;
  margin-top: 0.15rem;
}
.shift-txn-row--refund td {
  background: color-mix(in oklch, var(--destructive) 4%, transparent);
}

@media (max-width: 639px) {
  .shift-cash-flow {
    flex-direction: column;
    gap: 0.35rem;
  }
  .shift-cash-flow-arrow {
    justify-content: center;
    transform: rotate(90deg);
  }
  .shift-breakdown-list--compact .shift-breakdown-row {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
  }
  .shift-breakdown-list--compact .shift-breakdown-bar {
    grid-column: 1 / -1;
  }
  .shift-detail-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .shift-cafe-chips {
    width: 100%;
  }
  .shift-kpi-value {
    font-size: 1.375rem;
  }
}

/* —— Page layout utilities —— */
.page-two-col {
  display: grid;
  gap: var(--page-gap);
  align-items: start;
}
@media (min-width: 1024px) {
  .page-two-col {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}
.page-two-col-main,
.page-two-col-side {
  display: flex;
  flex-direction: column;
  gap: var(--section-gap);
  min-width: 0;
}
.stack-gap {
  display: flex;
  flex-direction: column;
  gap: var(--section-gap);
}
.form-grid--2 {
  grid-template-columns: 1fr;
  max-width: none;
}
.form-grid--3 {
  grid-template-columns: 1fr;
  max-width: none;
}
@media (min-width: 640px) {
  .form-grid--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .form-grid--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Definition list */
.ui-dl {
  margin: 0;
  display: grid;
  gap: 0;
}
.ui-dl-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-3) 0;
  border-top: 1px solid var(--border);
  font-size: 0.875rem;
}
.ui-dl-row:first-child {
  border-top: 0;
  padding-top: 0;
}
.ui-dl-row dt {
  margin: 0;
  color: var(--muted-foreground);
  flex-shrink: 0;
}
.ui-dl-row dd {
  margin: 0;
  text-align: right;
  font-weight: 500;
  word-break: break-word;
}

/* Card footer */
.ui-card-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--inline-gap);
  padding: var(--space-4) var(--card-pad);
  border-top: 1px solid var(--border);
}
.ui-card > .ui-card-header {
  padding: var(--card-pad) var(--card-pad) var(--space-4);
  margin-bottom: 0;
}
.ui-card > .ui-card-header + .ui-card-body {
  padding-top: 0;
}
.ui-card > .ui-card-body:only-child,
.ui-card > .ui-card-body:last-child {
  padding-bottom: var(--card-pad);
}

/* Breadcrumb */
.ui-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0 var(--space-2);
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--muted-foreground);
}
.ui-breadcrumb a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  color: var(--muted-foreground);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s ease;
}
.ui-breadcrumb a:hover {
  color: var(--foreground);
}
.ui-breadcrumb-sep {
  display: inline-flex;
  color: var(--muted-foreground);
  opacity: 0.55;
}
.ui-breadcrumb-sep .nav-icon {
  width: 0.875rem;
  height: 0.875rem;
}
.ui-breadcrumb-current {
  color: var(--foreground);
  font-weight: 550;
}

/* Stat variants */
.stat-value--sm {
  font-size: 1.125rem;
  font-weight: 650;
  line-height: 1.35;
}
.stat-value--badge {
  font-size: inherit;
  font-weight: inherit;
  margin-top: var(--space-2);
}
.stat-grid--client {
  margin-bottom: var(--page-gap);
}

/* Settings layout */
.settings-form {
  width: 100%;
  max-width: none;
}
.settings-theme-card .ui-card-body {
  padding-top: var(--space-3);
}
.bank-import-card .ui-card-body {
  max-width: 36rem;
}

/* Client portal */
.client-portal {
  min-height: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--background);
}
.client-portal-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--section-gap);
  padding: var(--space-4) var(--page-pad-x);
  border-bottom: 1px solid var(--border);
  background: color-mix(in oklch, var(--card) 92%, var(--background));
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.client-portal-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
}
.client-portal-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius);
  background: color-mix(in oklch, var(--primary) 12%, var(--muted));
  color: var(--primary);
}
.client-portal-logo .nav-icon {
  width: 1.25rem;
  height: 1.25rem;
}
.client-portal-title {
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.client-portal-sub {
  font-size: 0.8125rem;
  color: var(--muted-foreground);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.client-portal-actions {
  display: flex;
  align-items: center;
  gap: var(--inline-gap);
  flex-shrink: 0;
}
.client-portal-main {
  flex: 1;
  padding: var(--page-pad-y) var(--page-pad-x);
  max-width: 56rem;
  margin: 0 auto;
  width: 100%;
}

/* Client login variant */
.login-page--client {
  min-height: 100%;
  min-height: 100dvh;
}
.login-main--centered {
  width: 100%;
  min-height: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* Data grid — looser rhythm inside page body */
.page-body .space-y-4 > :not([hidden]) ~ :not([hidden]) {
  margin-top: var(--section-gap) !important;
}
.page-body .crm-grid-shell,
.page-body .space-y-4 {
  min-width: 0;
}
.page-body .crm-grid-card,
.page-body .space-y-4 > div.overflow-hidden {
  border-radius: calc(var(--radius) + 2px);
  box-shadow:
    0 1px 2px 0 rgb(0 0 0 / 0.04),
    0 4px 12px -2px rgb(15 23 42 / 0.06);
}

.ld-page > .page-top {
  margin-bottom: var(--space-5);
  border-bottom: 0;
  padding-bottom: 0;
}

/* —— Ticket simple (ts-*) —— */
.ui-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  border-radius: 9999px;
  padding: 0.18rem 0.55rem;
  font-size: 0.68rem;
  font-weight: 650;
  line-height: 1.25;
  white-space: nowrap;
  border: 1px solid transparent;
  vertical-align: middle;
}
.ui-badge-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.ui-badge-ico .nav-icon { width: 0.72rem; height: 0.72rem; }
.ui-badge-default,
.ui-badge-secondary {
  background: color-mix(in oklab, var(--muted) 85%, transparent);
  color: var(--muted-foreground);
}
.ui-badge-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--foreground);
}
.ui-badge-success {
  background: color-mix(in oklab, #10b981 14%, transparent);
  color: #047857;
}
.ui-badge-warn {
  background: color-mix(in oklab, #f59e0b 16%, transparent);
  color: #b45309;
}
.ui-badge-destructive {
  background: color-mix(in oklab, var(--destructive) 14%, transparent);
  color: var(--destructive);
}
.ui-badge-info {
  background: color-mix(in oklab, #0ea5e9 14%, transparent);
  color: #0369a1;
}
.ui-badge-purple {
  background: color-mix(in oklab, #8b5cf6 14%, transparent);
  color: #6d28d9;
}
.dark .ui-badge-success { color: #6ee7b7; }
.dark .ui-badge-warn { color: #fcd34d; }
.dark .ui-badge-info { color: #7dd3fc; }
.dark .ui-badge-purple { color: #c4b5fd; }

/* Ticket detail — simple + icons (ts-*) */
.ts-top {
  display: grid;
  gap: 0.75rem;
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border);
}
.ts-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  color: currentColor;
  opacity: 0.88;
}
.ts-ico .nav-icon {
  width: 0.9rem;
  height: 0.9rem;
}
.ts-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1rem;
}
.ts-head-main { min-width: 0; flex: 1 1 16rem; }
.ts-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}
.ts-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.4rem;
}
.ts-num {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.95rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}
.ts-num .ts-ico .nav-icon {
  width: 1rem;
  height: 1rem;
}
.ts-subject {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 720;
  line-height: 1.3;
  letter-spacing: -0.015em;
}
.ts-page {
  display: grid;
  gap: 0.9rem;
  min-width: 0;
}
.page-body > .ts-page { margin-bottom: 0; }

.ts-layout {
  display: grid;
  gap: 0.9rem;
  align-items: start;
}
@media (min-width: 1024px) {
  .ts-layout {
    grid-template-columns: minmax(0, 1fr) minmax(16rem, 19rem);
    gap: 1rem;
  }
  .ts-rail {
    position: sticky;
    top: 1rem;
  }
}
.ts-main,
.ts-rail {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-width: 0;
}
.ts-rail-card {
  padding: 0.9rem 0.95rem;
  gap: 0.7rem;
}
.ts-rail-card .ts-card-title {
  font-size: 0.8rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid color-mix(in oklab, var(--border) 80%, transparent);
}
.ts-rail-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.45rem;
  font-size: 0.8125rem;
}
.ts-rail-list li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}
.ts-rail-list a { font-weight: 650; }
.ts-quick--stack {
  flex-direction: column;
  align-items: stretch;
}
.ts-dl dd.is-danger {
  color: var(--destructive);
  font-weight: 700;
}

.ts-card {
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  background: var(--card);
  padding: 1.05rem 1.1rem;
  display: grid;
  gap: 0.9rem;
  box-shadow: 0 1px 0 color-mix(in oklab, var(--foreground) 3%, transparent);
}
.ts-card--work {
  border-color: color-mix(in oklab, var(--primary) 28%, var(--border));
  background:
    linear-gradient(180deg, color-mix(in oklab, var(--primary) 4%, var(--card)), var(--card) 2.5rem);
}
.ts-card-title {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.92rem;
  font-weight: 750;
}
.ts-card-title .ts-ico {
  color: var(--primary);
  opacity: 1;
}
.ts-subhead {
  margin: 0 0 0.45rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.ts-subhead .ts-ico .nav-icon {
  width: 0.8rem;
  height: 0.8rem;
}
.ts-muted {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.3rem;
  color: var(--muted-foreground);
  font-size: 0.8125rem;
}
.ts-warn {
  margin: 0 0 0.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: #b45309;
  font-size: 0.8125rem;
  font-weight: 600;
}
.ts-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.2rem;
  padding: 0.05rem 0.35rem;
  border-radius: 9999px;
  font-size: 0.65rem;
  font-weight: 700;
  background: color-mix(in oklab, var(--primary) 12%, transparent);
  color: var(--primary);
  text-transform: none;
  letter-spacing: 0;
}

.ts-customer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.85rem 1rem;
}
.ts-customer-body { min-width: 0; flex: 1 1 14rem; }
.ts-customer-name {
  font-size: 1.05rem;
  font-weight: 720;
  margin-bottom: 0.45rem;
}
.ts-facts {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.35rem;
  font-size: 0.85rem;
}
.ts-facts li {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  color: var(--foreground);
  line-height: 1.4;
}
.ts-facts .ts-ico {
  margin-top: 0.1rem;
  color: var(--muted-foreground);
}
.ts-facts .ts-ico .nav-icon {
  width: 0.85rem;
  height: 0.85rem;
}
.ts-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: flex-start;
}
.ts-desc {
  padding-top: 0.75rem;
  border-top: 1px solid color-mix(in oklab, var(--border) 85%, transparent);
}
.ts-desc-text {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.6;
  white-space: pre-wrap;
}

.ts-work-block {
  padding-top: 0.85rem;
  border-top: 1px solid color-mix(in oklab, var(--border) 85%, transparent);
}
.ts-work-block:first-of-type {
  padding-top: 0;
  border-top: 0;
}
.ts-work-block--focus {
  margin-top: 0.15rem;
  padding: 0.9rem;
  border: 1px solid color-mix(in oklab, var(--primary) 30%, var(--border));
  border-radius: calc(var(--radius) - 2px);
  background: color-mix(in oklab, var(--primary) 5%, transparent);
}
.ts-avatar {
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 750;
  background: color-mix(in oklab, var(--primary) 14%, var(--muted));
  color: var(--primary);
  flex: 0 0 auto;
  text-transform: uppercase;
}
.ts-avatar--sm {
  width: 1.25rem;
  height: 1.25rem;
  font-size: 0.6rem;
}
.ts-check-list {
  display: grid;
  gap: 0.35rem;
  max-height: 12rem;
  overflow-y: auto;
  margin-bottom: 0.65rem;
}
.ts-photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(5.75rem, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}
.ts-photo {
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: calc(var(--radius) - 4px);
  border: 1px solid var(--border);
  background: var(--muted);
}
.ts-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ts-result {
  margin: 0;
  display: inline-flex;
  align-items: flex-start;
  gap: 0.4rem;
  font-size: 0.875rem;
}

.ts-notes {
  display: grid;
  gap: 0.7rem;
  max-height: 22rem;
  overflow-y: auto;
}
.ts-note {
  padding-bottom: 0.6rem;
  border-bottom: 1px solid color-mix(in oklab, var(--border) 75%, transparent);
}
.ts-note:last-child { border-bottom: 0; padding-bottom: 0; }
.ts-note header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.45rem;
  margin-bottom: 0.25rem;
  font-size: 0.8125rem;
}
.ts-note time {
  font-size: 0.72rem;
  color: var(--muted-foreground);
  margin-left: auto;
}
.ts-note p {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.5;
  white-space: pre-wrap;
}
.ts-more {
  border: 1px dashed var(--border);
  border-radius: calc(var(--radius) - 2px);
  padding: 0.7rem 0.9rem;
  background: color-mix(in oklab, var(--muted) 22%, transparent);
}
.ts-more summary {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8125rem;
  font-weight: 650;
  color: var(--muted-foreground);
  list-style: none;
}
.ts-more summary::-webkit-details-marker { display: none; }
.ts-more[open] summary { margin-bottom: 0.75rem; color: var(--foreground); }
.ts-more-body { display: grid; gap: 1rem; }
.ts-more-section {
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}
.ts-more-section:first-child {
  padding-top: 0;
  border-top: 0;
}
.ts-plain-list {
  margin: 0 0 0.55rem;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.35rem;
  font-size: 0.8125rem;
}
.ts-plain-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}
.ts-inline-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 4.5rem auto;
  gap: 0.45rem;
  align-items: center;
}
@media (max-width: 640px) {
  .ts-inline-row { grid-template-columns: 1fr; }
}
.ts-qty { max-width: 4.5rem; }
.ts-mini {
  padding: 0.1rem 0.4rem;
  font-size: 0.68rem;
  min-height: 0;
  height: auto;
}
.ts-dl {
  margin: 0;
  display: grid;
  gap: 0.5rem;
  font-size: 0.78rem;
}
.ts-dl > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.65rem;
}
.ts-dl dt {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--muted-foreground);
  flex: 0 1 auto;
  font-weight: 500;
}
.ts-dl dt .ts-ico .nav-icon {
  width: 0.78rem;
  height: 0.78rem;
}
.ts-dl dd {
  margin: 0;
  text-align: right;
  font-weight: 650;
  word-break: break-word;
}

/* —— Ticket list (compact) —— */
.tk-rail {
  list-style: none;
  margin: 0 0 0.85rem;
  padding: 0.55rem 0.75rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.15rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in oklch, var(--muted) 22%, var(--background));
}
.tk-rail li {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  padding: 0.2rem 0.45rem;
  font-size: 0.82rem;
}
.tk-rail li + li::before {
  content: "→";
  margin-right: 0.45rem;
  color: var(--muted-foreground);
  font-weight: 600;
}
.tk-rail span {
  display: inline-grid;
  place-items: center;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 750;
  background: color-mix(in oklch, var(--foreground) 10%, var(--background));
  color: var(--foreground);
}
.tk-rail strong {
  font-weight: 650;
  white-space: nowrap;
}
.tk-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}
.tk-stats--tech {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.tk-stat {
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--background);
  display: grid;
  gap: 0.1rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.12s ease, background 0.12s ease;
}
a.tk-stat:hover,
.tk-stat.is-active {
  border-color: color-mix(in oklch, var(--foreground) 26%, var(--border));
  background: color-mix(in oklch, var(--foreground) 3.5%, var(--background));
}
.tk-stat-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}
.tk-stat-value {
  font-size: 1.2rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.tk-stat--danger {
  border-color: color-mix(in oklch, var(--destructive) 40%, var(--border));
  background: color-mix(in oklch, var(--destructive) 6%, var(--background));
}
.tk-stat--danger .tk-stat-value { color: var(--destructive); }

/* legacy guide classes kept for other pages */
.tk-guide {
  display: grid;
  gap: 0.85rem;
  margin-bottom: var(--section-gap);
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in oklch, var(--muted) 35%, var(--background));
}
.tk-guide-head { max-width: 42rem; }
.tk-guide-title { margin: 0 0 0.25rem; font-size: 1rem; font-weight: 700; }
.tk-guide-desc { margin: 0; color: var(--muted-foreground); font-size: 0.9rem; line-height: 1.45; }
.tk-guide-steps {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 0.75rem; grid-template-columns: repeat(4, minmax(0, 1fr));
}
.tk-guide-step {
  display: flex; gap: 0.65rem; align-items: flex-start; min-width: 0;
  padding: 0.75rem; border-radius: calc(var(--radius) - 2px);
  background: var(--background);
  border: 1px solid color-mix(in oklch, var(--border) 80%, transparent);
}
.tk-guide-step strong { display: block; font-size: 0.92rem; margin-bottom: 0.2rem; }
.tk-guide-step p { margin: 0; font-size: 0.82rem; color: var(--muted-foreground); line-height: 1.4; }
.tk-guide-num {
  flex: 0 0 auto; width: 1.6rem; height: 1.6rem; border-radius: 999px;
  display: grid; place-items: center; font-size: 0.78rem; font-weight: 700;
  background: var(--foreground); color: var(--background);
}
.tk-focus { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: var(--section-gap); }
.tk-focus-chip {
  display: inline-flex; align-items: center; padding: 0.35rem 0.7rem;
  border-radius: 999px; border: 1px solid var(--border); background: var(--background);
  font-size: 0.8rem; font-weight: 600; text-decoration: none; color: inherit;
}
.tk-focus-chip:hover, .tk-focus-chip.is-active {
  border-color: color-mix(in oklch, var(--foreground) 22%, var(--border));
  background: color-mix(in oklch, var(--foreground) 4%, var(--background));
}

.tk-bulk .ui-field { margin: 0; }
.tk-bulk .form-grid { align-items: start; }

.tk-bulk-dialog {
  max-width: min(40rem, 100%);
  max-height: min(92dvh, 42rem);
}
.tk-bulk-dialog .ui-dialog-title-row {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  min-width: 0;
  flex: 1;
}
.tk-bulk-dialog .ui-dialog-icon {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.65rem;
  background: color-mix(in oklch, var(--foreground) 8%, var(--background));
  flex: 0 0 auto;
}
.tk-bulk-dialog .ui-dialog-icon .nav-icon { width: 1rem; height: 1rem; }
.tk-bulk-stack {
  display: grid;
  gap: 0.75rem;
  padding-bottom: 0.9rem;
  margin-bottom: 0.9rem;
  border-bottom: 1px solid var(--border);
}
.tk-bulk-stack:last-child {
  border-bottom: 0;
  margin-bottom: 0;
  padding-bottom: 0;
}
.tk-bulk-stack-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}
.tk-bulk-stack-head h4 {
  margin: 0;
  font-size: 0.84rem;
  font-weight: 750;
}
.tk-bulk-stack-head span {
  font-size: 0.74rem;
  color: var(--muted-foreground);
}
.tk-bulk-picker {
  display: grid;
  gap: 0.3rem;
  max-height: 11rem;
  overflow: auto;
  padding: 0.45rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  background: color-mix(in oklch, var(--muted) 14%, var(--background));
}
.tk-bulk-pick {
  padding: 0.4rem 0.5rem;
  border-radius: calc(var(--radius) - 4px);
  border: 1px solid transparent;
  background: var(--background);
}
.tk-bulk-pick:hover { border-color: var(--border); }
.tk-bulk-dialog .form-grid { align-items: start; }
.tk-bulk-dialog .ui-multiselect-list { max-height: 9.5rem; }
.crm-form-dialog .ui-multiselect-list { max-height: 12rem; }

@media (max-width: 1100px) {
  .tk-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tk-guide-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .tk-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tk-guide-steps { grid-template-columns: 1fr; }
  .tk-rail li,
  .tk-rail strong { white-space: normal; }
}


.tk-flow {
  margin-bottom: 1rem;
  padding: 1rem 1.15rem 1.15rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--background);
}
.tk-flow-head { margin-bottom: 0.85rem; }
.tk-flow-title {
  margin: 0 0 0.2rem;
  font-size: 1rem;
  font-weight: 700;
}
.tk-flow-desc {
  margin: 0;
  font-size: 0.86rem;
  color: var(--muted-foreground);
}
.tk-flow-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.45rem;
}
.tk-flow-step {
  display: grid;
  gap: 0.45rem;
  justify-items: start;
  min-width: 0;
  padding: 0.55rem 0.5rem;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid transparent;
}
.tk-flow-dot {
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  border: 1.5px solid var(--border);
  background: var(--background);
  color: var(--muted-foreground);
}
.tk-flow-dot .nav-icon { width: 0.75rem; height: 0.75rem; }
.tk-flow-copy {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}
.tk-flow-copy strong {
  font-size: 0.78rem;
  line-height: 1.25;
}
.tk-flow-copy > span {
  font-size: 0.7rem;
  color: var(--muted-foreground);
  line-height: 1.3;
}
.tk-flow-cta {
  font-style: normal;
  font-size: 0.7rem;
  font-weight: 650;
  color: var(--foreground);
}
.tk-flow-step--done .tk-flow-dot {
  background: color-mix(in oklch, var(--success, #16a34a) 18%, var(--background));
  border-color: color-mix(in oklch, var(--success, #16a34a) 55%, var(--border));
  color: var(--success, #16a34a);
}
.tk-flow-step--current {
  background: color-mix(in oklch, var(--primary, #2563eb) 8%, var(--background));
  border-color: color-mix(in oklch, var(--primary, #2563eb) 35%, var(--border));
}
.tk-flow-step--current .tk-flow-dot {
  background: var(--foreground);
  border-color: var(--foreground);
  color: var(--background);
}
.tk-flow-step--todo { opacity: 0.72; }

.tk-next {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  margin-bottom: 1rem;
  padding: 0.95rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: color-mix(in oklch, var(--muted) 40%, var(--background));
}
.tk-next--focus {
  border-color: color-mix(in oklch, var(--foreground) 28%, var(--border));
  background: color-mix(in oklch, var(--foreground) 4%, var(--background));
  box-shadow: 0 0 0 1px color-mix(in oklch, var(--foreground) 6%, transparent);
}
.tk-next-icon {
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--foreground);
  color: var(--background);
}
.tk-next-icon .nav-icon { width: 1rem; height: 1rem; }
.tk-next-title {
  margin: 0 0 0.2rem;
  font-size: 0.98rem;
  font-weight: 700;
}
.tk-next-body {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--muted-foreground);
}

.ts-meta-line {
  margin: 0.35rem 0 0;
  font-size: 0.86rem;
  color: var(--muted-foreground);
}
.ts-card--step {
  position: relative;
  scroll-margin-top: 5rem;
}
.ts-card--current {
  border-color: color-mix(in oklch, var(--foreground) 30%, var(--border));
  box-shadow: 0 0 0 1px color-mix(in oklch, var(--foreground) 8%, transparent);
}
.ts-step-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}
.ts-step-label span {
  display: inline-block;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  background: color-mix(in oklch, var(--muted) 70%, transparent);
  color: var(--foreground);
  letter-spacing: 0.02em;
}
.ts-split {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.ts-split-actions {
  display: grid;
  gap: 0.65rem;
  align-content: start;
}
.ts-role {
  font-style: normal;
  font-size: 0.75rem;
  color: var(--muted-foreground);
  margin-left: 0.25rem;
}

@media (max-width: 1100px) {
  .tk-guide-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tk-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tk-flow-steps { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .tk-guide-steps,
  .tk-stats,
  .tk-flow-steps,
  .ts-split { grid-template-columns: 1fr; }
}

/* Schedule day board */
.tk-day-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.tk-day-nav-center {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  justify-content: center;
}
.tk-day-nav-center strong { font-size: 1.05rem; }
.tk-day-pill {
  display: inline-flex;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: color-mix(in oklch, var(--foreground) 8%, var(--background));
  border: 1px solid var(--border);
}
.tk-day-pill--link {
  text-decoration: none;
  color: inherit;
}
.tk-day-jump .ui-field-control { min-height: 2.1rem; padding: 0.25rem 0.5rem; }
.tk-day-empty {
  padding: 2rem 1.25rem;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: color-mix(in oklch, var(--muted) 30%, var(--background));
}
.tk-day-empty h3 { margin: 0 0 0.35rem; }
.tk-day-empty p { margin: 0 0 1rem; color: var(--muted-foreground); }
.tk-day-empty .ts-quick { justify-content: center; }
.tk-day-bucket { margin-bottom: 1.25rem; }
.tk-day-bucket-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}
.tk-day-bucket-head h3 {
  margin: 0;
  font-size: 0.95rem;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}
.tk-day-bucket-head h3 span {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted-foreground);
}
.tk-day-count {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted-foreground);
}
.tk-day-cards { display: grid; gap: 0.65rem; }
.tk-day-card {
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 1fr) auto;
  gap: 0.85rem;
  align-items: start;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--background);
}
.tk-day-card.is-high {
  border-color: color-mix(in oklch, var(--destructive) 35%, var(--border));
}
.tk-day-card.is-done { opacity: 0.72; }
.tk-day-card-time {
  font-size: 1rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  padding-top: 0.15rem;
}
.tk-day-card-top {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  margin-bottom: 0.35rem;
}
.tk-day-card-num {
  font-weight: 700;
  text-decoration: none;
  color: var(--foreground);
  margin-right: 0.15rem;
}
.tk-day-card-title {
  margin: 0 0 0.2rem;
  font-size: 0.98rem;
  font-weight: 700;
}
.tk-day-card-title a { color: inherit; text-decoration: none; }
.tk-day-card-title a:hover { text-decoration: underline; }
.tk-day-card-party {
  margin: 0 0 0.35rem;
  font-weight: 650;
}
.tk-day-card-meta {
  margin: 0.15rem 0;
  font-size: 0.82rem;
  color: var(--muted-foreground);
  display: flex;
  gap: 0.35rem;
  align-items: flex-start;
}
.tk-day-card-hint {
  margin: 0.45rem 0 0;
  font-size: 0.82rem;
  font-weight: 600;
}
.tk-day-card-actions {
  display: grid;
  gap: 0.35rem;
  justify-items: stretch;
}
.ts-note--system { opacity: 0.92; }
.ts-note-kind {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  padding: 0.1rem 0.35rem;
  border: 1px solid var(--border);
  border-radius: 999px;
}
.ts-avatar--sys {
  background: color-mix(in oklch, var(--muted) 70%, transparent);
  font-size: 0.7rem;
}
@media (max-width: 720px) {
  .tk-day-card {
    grid-template-columns: 3rem minmax(0, 1fr);
  }
  .tk-day-card-actions {
    grid-column: 1 / -1;
    grid-template-columns: 1fr 1fr;
  }
}

.inline-form { display: inline; margin: 0; }
.w-fit { width: fit-content; }
.assignee-picker {
  display: grid;
  gap: var(--space-2);
  max-height: 10rem;
  overflow-y: auto;
  padding: var(--space-1);
}
.ui-checkbox--inline {
  align-self: end;
  padding: var(--space-2) 0;
}
.ui-btn .nav-icon {
  width: 0.95rem;
  height: 0.95rem;
}

/* Onboarding breadcrumb in header */
.wz-back-link {
  margin-bottom: var(--space-1);
}

.wz-pay-proof-thumb {
  display: inline-flex;
  max-width: 12rem;
  border-radius: calc(var(--radius) - 2px);
  overflow: hidden;
  border: 1px solid var(--border);
  background: color-mix(in oklch, var(--muted) 40%, transparent);
}
.wz-pay-proof-thumb img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 10rem;
  object-fit: cover;
}
.wz-pay-proof-thumb:hover {
  border-color: color-mix(in oklch, var(--primary) 45%, var(--border));
}

/* Fiber topology map layers */
.ops-marker-pin--site {
  --pin: #dc2626;
  width: 2rem;
  height: 2rem;
  border-radius: 0.45rem;
  transform: rotate(0deg);
}
.ops-marker-pin--site .ops-marker-dot {
  width: 0.55rem;
  height: 0.55rem;
}
.ops-marker-pin--odc {
  --pin: #0d9488;
  min-width: 2.25rem;
  border-radius: 0.3rem;
  transform: rotate(0deg);
}
.ops-marker-pin--odp {
  --pin: #2563eb;
  min-width: 2.1rem;
  border-radius: 0.35rem;
  transform: rotate(0deg);
}
.ops-marker-pin--odp-full {
  --pin: #7c3aed;
}
.ops-marker-odp-label {
  display: block;
  margin-top: 1px;
  font-size: 0.55rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  color: #fff;
  text-shadow: 0 1px 1px rgba(0,0,0,0.35);
}
.ops-result.is-preview {
  background: color-mix(in srgb, var(--primary) 6%, transparent);
  border-color: color-mix(in srgb, var(--primary) 18%, transparent);
}
.ops-result.is-preview:not(.is-selected) {
  transform: translateX(2px);
}
.ops-route-tip {
  font-size: 0.72rem;
  font-weight: 600;
  border: none;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.18);
}
.leaflet-tooltip.ops-route-tip {
  background: color-mix(in oklch, var(--card) 92%, transparent);
  color: var(--foreground);
}
.ops-route-dist-label {
  display: inline-block;
  transform: translate(-50%, -50%);
  padding: 0.1rem 0.35rem;
  border-radius: 0.25rem;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  color: #0f172a;
  background: color-mix(in oklch, #fff 88%, transparent);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.18);
  pointer-events: none;
}
html.dark .ops-route-dist-label {
  color: #f8fafc;
  background: color-mix(in oklch, #1e293b 88%, transparent);
}

/* Operations map — polished left command panel */
.ops-panel {
  width: min(100% - 1.5rem, 24rem);
  border-radius: 1.05rem;
  z-index: 25;
  /* Solid enough that map tiles never bleed through */
  background: var(--card) !important;
  border-color: color-mix(in oklab, var(--border) 88%, transparent);
  box-shadow:
    0 22px 44px -14px rgb(15 23 42 / 0.22),
    0 8px 18px -10px rgb(15 23 42 / 0.12);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
@supports (backdrop-filter: blur(16px)) {
  .ops-panel {
    background: var(--card) !important;
  }
}
.ops-mobile-only { display: none !important; }
.ops-desktop-only { display: none !important; }
.ops-mobile-only.is-hidden,
.ops-desktop-only.is-hidden,
.ops-panel-toggle.is-hidden {
  display: none !important;
}
@media (max-width: 767px) {
  .ops-mobile-only:not(.is-hidden) { display: inline-flex !important; }
  .ops-panel-toggle.ops-mobile-only:not(.is-hidden) { display: inline-flex !important; }
}
@media (min-width: 768px) {
  .ops-desktop-only:not(.is-hidden) { display: inline-flex !important; }
  .ops-panel-toggle,
  .ops-panel-toggle.ops-mobile-only,
  .ops-panel-toggle.ui-btn {
    display: none !important;
  }
}

.ops-panel-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.55rem;
}
.ops-panel-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}
.ops-panel-brand-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 0.65rem;
  border: 1px solid color-mix(in oklab, var(--primary) 22%, var(--border));
  background: color-mix(in oklab, var(--primary) 12%, transparent);
  color: var(--primary);
  flex-shrink: 0;
}
.ops-panel-title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
}
.ops-panel-sub {
  margin: 0.15rem 0 0;
  font-size: 0.68rem;
  color: var(--muted-foreground);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ops-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 0.55rem;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.ops-icon-btn:hover {
  background: var(--muted);
  border-color: var(--border);
  color: var(--foreground);
}

.ops-panel-head {
  padding: 0.7rem 0.85rem 0.55rem;
  border-bottom: 1px solid color-mix(in oklab, var(--border) 85%, transparent);
  background:
    linear-gradient(
      180deg,
      color-mix(in oklab, var(--muted) 28%, transparent) 0%,
      transparent 100%
    );
}
.ops-panel .ops-stats {
  margin-top: 0.55rem;
  gap: 0;
  padding: 0.15rem;
  border-radius: 0.7rem;
  border: 1px solid color-mix(in oklab, var(--border) 90%, transparent);
  background: color-mix(in oklab, var(--background) 72%, transparent);
}
.ops-panel .ops-stat {
  position: relative;
  padding: 0.32rem 0.15rem;
  border: none;
  border-radius: 0.55rem;
  background: transparent;
  cursor: pointer;
  font: inherit;
  color: inherit;
  appearance: none;
  -webkit-appearance: none;
  transition: background 0.12s, color 0.12s;
}
.ops-panel .ops-stat + .ops-stat::before {
  content: "";
  position: absolute;
  left: 0;
  top: 22%;
  bottom: 22%;
  width: 1px;
  background: color-mix(in oklab, var(--border) 80%, transparent);
  pointer-events: none;
}
.ops-panel .ops-stat:hover {
  background: color-mix(in oklab, var(--muted) 85%, transparent);
}
.ops-panel .ops-stat.is-active {
  background: color-mix(in oklab, var(--primary) 12%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--primary) 22%, transparent);
}
.ops-panel .ops-stat.is-active + .ops-stat::before,
.ops-panel .ops-stat.is-active::before {
  opacity: 0;
}
.ops-panel .ops-stat-val {
  font-size: 0.86rem;
}
.ops-panel .ops-stat-lbl {
  font-size: 0.56rem;
  letter-spacing: 0.05em;
}

/* Toolbar: search / layers / filters — compact, no nested scroll */
.ops-panel-toolbar {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  border-bottom: 1px solid color-mix(in oklab, var(--border) 85%, transparent);
  flex-shrink: 0;
}
.ops-panel-search,
.ops-panel-controls {
  display: none; /* legacy; content lives in toolbar */
}
.ops-toolbar-block {
  padding: 0.5rem 0.85rem;
  border-bottom: 1px solid color-mix(in oklab, var(--border) 65%, transparent);
}
.ops-toolbar-block:last-child {
  border-bottom: none;
}
.ops-toolbar-block--search {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
  background: color-mix(in oklab, var(--muted) 18%, transparent);
}
.ops-toolbar-block--filters {
  padding-bottom: 0.55rem;
}
.ops-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.3rem;
}
.ops-section-label {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}
.ops-search-box {
  position: relative;
  display: block;
  isolation: isolate;
}
.ops-search-icon {
  pointer-events: none;
  position: absolute;
  left: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  color: var(--muted-foreground);
  display: flex;
  align-items: center;
  opacity: 0.85;
}
.ops-panel .ops-search-input {
  height: 2rem !important;
  padding: 0 2.2rem 0 2.05rem !important;
  border-radius: 0.55rem !important;
  border-color: color-mix(in oklab, var(--border) 90%, transparent) !important;
  font-size: 0.76rem !important;
  background: var(--card) !important;
  box-shadow: 0 1px 0 color-mix(in oklab, #000 3%, transparent);
}
.ops-panel .ops-search-input:focus {
  border-color: color-mix(in oklab, var(--ring) 55%, var(--input)) !important;
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 18%, transparent) !important;
}
.ops-search-clear {
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 1.25rem;
  height: 1.25rem;
  border: none;
  border-radius: 9999px;
  background: var(--muted);
  color: var(--muted-foreground);
  font-size: 0.8rem;
  line-height: 1;
  cursor: pointer;
}
.ops-search-clear:hover {
  color: var(--foreground);
}
.ops-panel .ops-search-kbd {
  right: 0.5rem;
  z-index: 1;
  border-radius: 0.3rem;
  font-size: 0.6rem;
  opacity: 0.75;
}

.ops-shelter-field {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.28rem;
  min-width: 0;
}
.ops-panel .ops-field-label {
  display: block;
  margin: 0;
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-foreground);
  white-space: nowrap;
  line-height: 1.2;
}
.app-content .ops-panel .ops-select,
.ops-panel .ops-select,
.app-content .ops-panel .ops-combobox-display,
.ops-panel .ops-combobox-display {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 2.15rem;
  min-height: 2.15rem;
  box-sizing: border-box;
  padding: 0 1.7rem 0 0.6rem;
  border: 1px solid color-mix(in oklab, var(--border) 90%, transparent);
  border-radius: 0.5rem;
  background-color: var(--card);
  color: var(--foreground);
  font-size: 0.78rem;
  font-weight: 550;
  line-height: normal;
  box-shadow: 0 1px 0 color-mix(in oklab, #000 3%, transparent);
}
.app-content .ops-panel .ops-select,
.ops-panel .ops-select {
  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='%2364748b' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.45rem center;
  background-size: 0.8rem;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  /* overflow:hidden + line-height=height clips native <select> text on macOS/WebKit */
}
.app-content .ops-panel .ops-combobox-display,
.ops-panel .ops-combobox-display {
  background-image: none;
  cursor: text;
}
.app-content .ops-panel .ops-select:focus,
.ops-panel .ops-select:focus,
.app-content .ops-panel .ops-combobox-display:focus,
.ops-panel .ops-combobox-display:focus,
.app-content .ops-panel .ops-combobox.is-open .ops-combobox-display,
.ops-panel .ops-combobox.is-open .ops-combobox-display {
  outline: none;
  border-color: color-mix(in oklab, var(--primary) 45%, var(--border));
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--primary) 16%, transparent);
}
.ops-panel .ops-combobox {
  width: 100%;
  min-width: 0;
}

.ops-layers {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.28rem;
}
.ops-layer {
  display: flex;
  align-items: center;
  gap: 0.32rem;
  min-height: 1.85rem;
  min-width: 0;
  padding: 0.22rem 0.38rem;
  border-radius: 0.48rem;
  border: 1px solid color-mix(in oklab, var(--border) 88%, transparent);
  background: color-mix(in oklab, var(--card) 88%, transparent);
  color: var(--muted-foreground);
  cursor: pointer;
  text-align: left;
  transition: background 0.12s, border-color 0.12s, color 0.12s, box-shadow 0.12s;
}
.ops-layer:hover {
  background: var(--muted);
  color: var(--foreground);
}
.ops-layer.is-on {
  background: color-mix(in oklab, var(--primary) 9%, var(--card));
  border-color: color-mix(in oklab, var(--primary) 34%, var(--border));
  color: var(--foreground);
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--primary) 8%, transparent);
}
.ops-layer-swatch {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 9999px;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px color-mix(in oklab, currentColor 16%, transparent);
}
.ops-layer-swatch--customer { background: #10b981; color: #10b981; }
.ops-layer-swatch--lead { background: #8b5cf6; color: #8b5cf6; }
.ops-layer-swatch--site { background: #ea580c; color: #ea580c; }
.ops-layer-swatch--odc { background: #0d9488; color: #0d9488; }
.ops-layer-swatch--odp { background: #2563eb; color: #2563eb; }
.ops-layer-swatch--routes {
  background: linear-gradient(90deg, #f97316, #3b82f6);
  color: #f97316;
}
.ops-layer:not(.is-on) .ops-layer-swatch {
  opacity: 0.35;
  box-shadow: none;
}
.ops-layer-meta {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.2rem;
}
.ops-layer-label {
  font-size: 0.64rem;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ops-layer-count {
  font-size: 0.6rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--muted-foreground);
  flex-shrink: 0;
}
.ops-layer.is-on .ops-layer-count {
  color: var(--primary);
}

.ops-panel-toolbar .ops-filters {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0;
}
.ops-filter-group {
  display: grid;
  grid-template-columns: 2.35rem minmax(0, 1fr);
  gap: 0.3rem;
  align-items: start;
}
.ops-filter-caption {
  padding-top: 0.22rem;
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: color-mix(in oklab, var(--muted-foreground) 88%, transparent);
  line-height: 1.2;
}
.ops-chip-rail {
  display: flex;
  flex-wrap: wrap;
  gap: 0.22rem;
  overflow: visible;
  padding: 0.15rem;
  border-radius: 0.5rem;
  background: color-mix(in oklab, var(--muted) 32%, transparent);
}
.ops-chip-rail .ops-chip {
  flex: 0 0 auto;
  height: 1.4rem;
  padding: 0 0.42rem;
  font-size: 0.62rem;
  white-space: nowrap;
  background: color-mix(in oklab, var(--card) 90%, transparent);
}
.ops-chip-rail .ops-chip.is-active {
  background: color-mix(in oklab, var(--primary) 14%, var(--card));
}
.ops-dot--pulse {
  animation: ops-pulse 1.4s ease-in-out infinite;
}
@keyframes ops-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.85); }
}

.ops-panel .ops-results-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.85rem 0.3rem;
  border-bottom: 1px solid color-mix(in oklab, var(--border) 55%, transparent);
}
.ops-results-meta-left {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}
.ops-results-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.05rem;
  padding: 0 0.32rem;
  border-radius: 9999px;
  background: color-mix(in oklab, var(--muted) 80%, transparent);
  color: var(--foreground);
  font-size: 0.62rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.ops-panel .ops-link-btn {
  font-size: 0.66rem;
}
.ops-panel .ops-results {
  padding: 0.3rem 0.45rem 0.65rem;
}
.ops-panel .ops-result {
  padding: 0.5rem 0.55rem;
  border-radius: 0.6rem;
  gap: 0.55rem;
}
.ops-panel .ops-result-name {
  font-size: 0.78rem;
}
.ops-panel .ops-panel-foot {
  padding: 0.42rem 0.65rem;
  background: color-mix(in oklab, var(--muted) 40%, var(--card));
  border-top: 1px solid color-mix(in oklab, var(--border) 85%, transparent);
}
.ops-panel .ops-foot-btn {
  background: color-mix(in oklab, var(--card) 92%, transparent);
}

.ops-panel-reopen {
  display: none;
  border-radius: 0.85rem;
  border: 1px solid color-mix(in oklab, var(--border) 80%, transparent);
  background: color-mix(in oklab, var(--card) 94%, transparent);
  padding: 0.55rem 0.85rem;
  font-size: 0.8125rem;
  font-weight: 650;
  box-shadow: 0 10px 24px -10px rgb(0 0 0 / 0.25);
  backdrop-filter: blur(12px);
}
@media (min-width: 768px) {
  .ops-panel-reopen.ops-desktop-only {
    display: inline-flex;
  }
}

.ops-legend { display: none; }
@media (min-width: 640px) {
  .ops-legend { display: flex; }
}
.ops-legend-card {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 0.85rem;
  border: 1px solid color-mix(in oklab, var(--border) 80%, transparent);
  background: color-mix(in oklab, var(--card) 94%, transparent);
  padding: 0.4rem 0.55rem;
  box-shadow: 0 8px 20px -10px rgb(0 0 0 / 0.2);
  backdrop-filter: blur(12px);
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--muted-foreground);
}
.ops-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.4rem;
}
.ops-line {
  display: inline-block;
  width: 0.9rem;
  height: 3px;
  border-radius: 999px;
  flex-shrink: 0;
}
.ops-line--dash {
  background-image: repeating-linear-gradient(
    90deg,
    currentColor 0 4px,
    transparent 4px 7px
  );
  background-color: transparent !important;
  color: #3b82f6;
  height: 2px;
}

/* Floating waypoint dock */
.ops-waypoint-dock {
  pointer-events: auto;
  position: absolute;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  z-index: 22;
  width: min(28rem, calc(100% - 1.5rem));
  border-radius: 1rem;
  border: 1px solid color-mix(in oklab, var(--border) 75%, transparent);
  background: color-mix(in oklab, var(--card) 92%, transparent);
  box-shadow:
    0 18px 40px -16px rgb(0 0 0 / 0.28),
    0 6px 14px -8px rgb(0 0 0 / 0.15);
  backdrop-filter: blur(16px);
  padding: 0.65rem 0.75rem 0.7rem;
  animation: ops-dock-in 0.2s ease-out;
}
@media (min-width: 768px) {
  .ops-map-page:has(.ops-panel--open) .ops-waypoint-dock:not(.hidden) {
    left: calc(50% + 11rem);
  }
}
.ops-waypoint-dock.hidden { display: none; }
@keyframes ops-dock-in {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.ops-wp-dock-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
}
.ops-wp-dock-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
}
.ops-wp-dock-kicker {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-foreground);
}
.ops-wp-dock-label {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ops-wp-dock-dist {
  font-size: 0.7rem;
  color: var(--muted-foreground);
  font-variant-numeric: tabular-nums;
}
.ops-wp-dock-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}
.ops-wp-btn {
  height: 1.85rem;
  padding: 0 0.7rem;
  border-radius: 0.5rem;
  border: 1px solid color-mix(in oklab, var(--primary) 35%, var(--border));
  background: color-mix(in oklab, var(--primary) 12%, transparent);
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.12s, transform 0.12s;
}
.ops-wp-btn:hover { transform: translateY(-1px); }
.ops-wp-btn.is-active {
  background: var(--primary);
  color: var(--primary-foreground);
  animation: ops-pulse 1.2s ease-in-out infinite;
}
.ops-wp-btn--ghost {
  border-color: var(--border);
  background: transparent;
  color: var(--muted-foreground);
}
.ops-wp-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.55rem;
  min-height: 1.5rem;
}
.ops-wp-empty {
  font-size: 0.7rem;
  color: var(--muted-foreground);
  padding: 0.15rem 0.1rem;
}
.ops-wp-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.7rem;
  height: 1.7rem;
  padding: 0 0.35rem;
  border-radius: 9999px;
  border: 1px solid color-mix(in oklab, #f97316 40%, var(--border));
  background: color-mix(in oklab, #f97316 10%, transparent);
  color: #c2410c;
  font-size: 0.68rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.12s, background 0.12s;
}
.ops-wp-pill:hover { transform: translateY(-1px); background: color-mix(in oklab, #f97316 18%, transparent); }
.ops-wp-pill-del {
  position: absolute;
  top: -0.35rem;
  right: -0.35rem;
  width: 0.95rem;
  height: 0.95rem;
  border-radius: 9999px;
  border: none;
  background: #ef4444;
  color: #fff;
  font-size: 0.65rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s;
}
.ops-wp-pill:hover .ops-wp-pill-del { opacity: 1; }

#ops-map.ops-map--placing {
  cursor: crosshair !important;
}
#ops-map.ops-map--placing .leaflet-container {
  cursor: crosshair !important;
}

/* Richer popup cards */
.ops-card-kicker {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}
.ops-card-title {
  margin-top: 0.15rem;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.25;
}
.ops-card-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem;
  padding: 0.65rem 0.85rem 0.15rem;
}
.ops-metric {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.05rem;
  padding: 0.45rem 0.3rem;
  border-radius: 0.55rem;
  background: color-mix(in oklab, var(--muted) 65%, transparent);
}
.ops-metric-val {
  font-size: 1rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.ops-metric-lbl {
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted-foreground);
}
.ops-portbar {
  margin: 0.25rem 0.55rem 0.45rem;
  padding: 0.55rem 0.6rem;
  border-radius: 0.55rem;
  background: color-mix(in oklab, var(--muted) 55%, transparent);
}
.ops-portbar-top {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  font-weight: 650;
  margin-bottom: 0.35rem;
  color: var(--foreground);
}
.ops-portbar-track {
  height: 0.4rem;
  border-radius: 9999px;
  background: color-mix(in oklab, var(--border) 80%, transparent);
  overflow: hidden;
}
.ops-portbar-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.25s ease;
}
.ops-portbar-fill--ok { background: #10b981; }
.ops-portbar-fill--hot { background: #f59e0b; }
.ops-portbar-fill--full { background: #ef4444; }

/* Nested entity lists inside ODC / ODP / shelter popups */
.ops-card-row--stack {
  align-items: flex-start;
}
.ops-card-row--stack .ops-card-row-body {
  width: 100%;
  min-width: 0;
  flex: 1;
  flex-shrink: 0;
}
.ops-card-row-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}
.ops-card-row-top .ops-card-row-label {
  flex: 1;
  min-width: 0;
}
.ops-card-row-top .ops-card-row-value {
  flex-shrink: 0;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.ops-coords-copy {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0.35rem;
  background: transparent;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: color 0.12s, background 0.12s;
}
.ops-coords-copy svg {
  width: 0.9rem;
  height: 0.9rem;
}
.ops-coords-copy:hover {
  color: var(--primary);
  background: color-mix(in oklab, var(--primary) 10%, transparent);
}
.ops-copyable-value {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
}
.ops-copyable-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.ops-card-row--coords .ops-card-row-value {
  font-size: 0.78rem;
}
.ops-child-list {
  margin: 0.55rem 0.55rem 0.35rem;
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  background: color-mix(in oklab, var(--muted) 35%, transparent);
  overflow: hidden;
}
.ops-child-list--nested {
  margin: 0.4rem 0 0.1rem;
  flex-shrink: 0;
}
.ops-card.ops-card--odp .ops-card-body,
.ops-card.ops-card--odc .ops-card-body,
.ops-card.ops-card--site .ops-card-body {
  max-height: min(60vh, 28rem);
}
.ops-child-list-head {
  padding: 0.4rem 0.55rem;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  border-bottom: 1px solid var(--border);
  background: color-mix(in oklab, var(--card) 70%, transparent);
}
.ops-child-empty {
  padding: 0.55rem 0.5rem;
  font-size: 0.7rem;
  color: var(--muted-foreground);
}
.ops-child-scroll {
  max-height: 11.5rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0.25rem;
}
.ops-child-item {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  width: 100%;
  text-align: left;
  padding: 0.4rem 0.45rem;
  border: none;
  border-radius: 0.45rem;
  background: transparent;
  color: inherit;
  cursor: pointer;
  transition: background 0.12s;
}
.ops-child-item:hover {
  background: color-mix(in oklab, var(--primary) 10%, transparent);
}
.ops-child-dot {
  margin-top: 0.35rem;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 9999px;
  flex-shrink: 0;
}
.ops-child-body {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
}
.ops-child-name {
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ops-child-code,
.ops-child-meta {
  font-size: 0.65rem;
  color: var(--muted-foreground);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ops-child-more {
  padding: 0.35rem 0.45rem 0.45rem;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--muted-foreground);
  text-align: center;
}
.leaflet-popup.ops-popup .leaflet-popup-content {
  margin: 0;
  max-height: min(70vh, 32rem);
  overflow-y: auto;
}

.ops-card-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.55rem 0.75rem 0.75rem;
  border-top: 1px solid var(--border);
  background: color-mix(in oklab, var(--muted) 35%, transparent);
}
.ops-qbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 1.85rem;
  padding: 0 0.65rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  background: var(--background);
  color: var(--foreground);
  font-size: 0.7rem;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, transform 0.12s;
}
.ops-qbtn:hover {
  background: var(--muted);
  transform: translateY(-1px);
}
.ops-qbtn--primary {
  border-color: color-mix(in oklab, var(--primary) 40%, var(--border));
  background: color-mix(in oklab, var(--primary) 12%, transparent);
  color: var(--primary);
}
.ops-qbtn--wa {
  border-color: color-mix(in oklab, #10b981 40%, var(--border));
  color: #059669;
}
.ops-inline-copy {
  margin-left: 0.35rem;
  border: none;
  background: transparent;
  color: var(--primary);
  font-size: 0.65rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.ops-badge--site {
  background: color-mix(in oklab, #ea580c 18%, transparent);
  color: #c2410c;
}
.ops-badge--odc {
  background: color-mix(in oklab, #0d9488 18%, transparent);
  color: #0f766e;
}
.ops-badge--odp {
  background: color-mix(in oklab, #2563eb 18%, transparent);
  color: #1d4ed8;
}
.dark .ops-badge--site { color: #fdba74; }
.dark .ops-badge--odc { color: #5eead4; }
.dark .ops-badge--odp { color: #93c5fd; }

.ops-result {
  transition: background 0.12s, border-color 0.12s, transform 0.14s, box-shadow 0.14s;
}
.ops-result.is-selected {
  box-shadow: 0 0 0 1px color-mix(in oklab, var(--primary) 20%, transparent);
}

@media (max-width: 767px) {
  .ops-waypoint-dock {
    left: 0.75rem;
    right: 0.75rem;
    width: auto;
    transform: none;
    bottom: 0.75rem;
  }
  .ops-toolbar-block {
    padding: 0.5rem 0.75rem;
  }
  .ops-filter-group {
    grid-template-columns: 2.2rem minmax(0, 1fr);
    gap: 0.28rem;
  }
  .ops-layers {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Keep legacy waypoint map markers */
.ops-waypoint-marker { background: transparent !important; border: none !important; }
.ops-waypoint-dot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 9999px;
  background: #fff;
  border: 2px solid #f97316;
  color: #ea580c;
  font-size: 0.58rem;
  font-weight: 800;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}
.ops-waypoint-marker.is-active .ops-waypoint-dot {
  border-color: #2563eb;
  color: #2563eb;
  background: color-mix(in oklch, #2563eb 12%, #fff);
}
html.dark .ops-waypoint-dot { background: #1e293b; }

.ops-panel-toggle {
  pointer-events: auto;
  position: absolute;
  left: var(--space-3);
  top: var(--space-3);
  z-index: 22;
  backdrop-filter: blur(8px);
  background: color-mix(in oklch, var(--card) 95%, transparent);
}
@media (min-width: 768px) {
  .ops-panel-toggle,
  .ops-panel-toggle.ops-mobile-only,
  .ops-panel-toggle.ui-btn {
    display: none !important;
  }
}

/* Visually hide legacy layer checkboxes used as state hooks */
#ops-panel .sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
html.layout-desktop .app-sidebar-toggle {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  position: absolute !important;
  width: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}
html.layout-desktop .app-sidebar-backdrop {
  display: none !important;
}
html.layout-desktop .app-sidebar {
  position: relative !important;
  transform: none !important;
  box-shadow: none !important;
}
html.layout-desktop .app-topbar-start {
  gap: 0;
}
html.layout-mobile .app-sidebar-toggle {
  display: inline-flex !important;
}
html.layout-mobile body.sidebar-open {
  overflow: hidden;
}

/* Fiber route / waypoint panel on operations map */
.ops-route-panel {
  border-top: 1px solid color-mix(in oklch, var(--border) 80%, transparent);
  padding: 0.75rem;
  background: color-mix(in oklch, var(--card) 96%, transparent);
  max-height: 14rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.ops-route-panel.hidden {
  display: none;
}
.ops-route-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}
.ops-route-panel-actions .ops-foot-btn.is-active {
  border-color: var(--primary);
  color: var(--primary);
  background: color-mix(in oklch, var(--primary) 10%, transparent);
}
.ops-waypoint-list {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}
.ops-waypoint-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.5rem;
  border-radius: 0.375rem;
  font-size: 0.72rem;
}
.ops-waypoint-item:hover {
  background: color-mix(in oklch, var(--muted) 40%, transparent);
}
.ops-waypoint-seq {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  font-weight: 700;
  font-size: 0.62rem;
  background: color-mix(in oklch, #f97316 20%, transparent);
  color: #ea580c;
}
.ops-waypoint-coords {
  flex: 1;
  min-width: 0;
  font-family: ui-monospace, monospace;
  color: var(--muted-foreground);
}
.ops-waypoint-del {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  border: none;
  border-radius: 0.25rem;
  background: transparent;
  color: var(--destructive);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}
.ops-waypoint-del:hover {
  background: color-mix(in oklch, var(--destructive) 12%, transparent);
}
.ops-waypoint-marker {
  background: transparent;
  border: none;
}
.ops-waypoint-dot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 9999px;
  background: #fff;
  border: 2px solid #f97316;
  color: #ea580c;
  font-size: 0.58rem;
  font-weight: 800;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}
.ops-waypoint-marker.is-active .ops-waypoint-dot {
  border-color: #2563eb;
  color: #2563eb;
  background: color-mix(in oklch, #2563eb 12%, #fff);
}
html.dark .ops-waypoint-dot {
  background: #1e293b;
}


/* ── Customer import tool ─────────────────────────────────── */
.import-tool { display: flex; flex-direction: column; gap: var(--space-6); }
.import-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
}
.import-step {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  padding: var(--space-4);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
  opacity: 0.72;
}
.import-step.is-active,
.import-step.is-done { opacity: 1; }
.import-step.is-active {
  border-color: color-mix(in oklab, var(--primary) 45%, var(--border));
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--primary) 12%, transparent);
}
.import-step-num {
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--muted);
  color: var(--muted-foreground);
}
.import-step.is-active .import-step-num,
.import-step.is-done .import-step-num {
  background: var(--primary);
  color: var(--primary-foreground);
}
.import-step strong {
  display: block;
  font-size: 0.875rem;
  margin-bottom: 0.15rem;
}
.import-step p {
  margin: 0;
  font-size: 0.75rem;
  color: var(--muted-foreground);
  line-height: 1.4;
}
.import-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: var(--space-4);
}
.import-card-title {
  margin: 0 0 var(--space-2);
  font-size: 1rem;
  font-weight: 700;
}
.import-card-hint {
  margin: 0 0 var(--space-4);
  font-size: 0.8125rem;
  color: var(--muted-foreground);
  line-height: 1.45;
}
.import-card-hint code,
.import-guide-list code {
  font-size: 0.75rem;
  padding: 0.05rem 0.3rem;
  border-radius: 0.25rem;
  background: var(--muted);
}
.import-guide-list {
  margin: 0;
  padding-left: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  font-size: 0.8125rem;
  color: var(--foreground);
  line-height: 1.45;
}
.import-result-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.import-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}
.import-stat {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-3);
  background: color-mix(in oklab, var(--muted) 40%, transparent);
}
.import-stat-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted-foreground);
  margin-bottom: 0.25rem;
}
.import-stat-value {
  font-size: 1.05rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.import-stat-value.is-error { color: var(--destructive); }

/* PPPoE import extras */
.pppoe-picker-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2);
  margin-top: calc(var(--space-2) * -1);
  margin-bottom: var(--space-2);
}
.pppoe-meta-chip {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--muted);
  padding: 0.55rem 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}
.pppoe-meta-chip span {
  font-size: 0.6875rem;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.pppoe-meta-chip strong {
  font-size: 0.8125rem;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pppoe-guide-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}
.pppoe-guide-stats > div {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.pppoe-guide-stats strong {
  font-size: 1.25rem;
  font-weight: 700;
}
.import-log-row.is-unchanged { background: color-mix(in oklab, var(--muted) 55%, transparent); }
.import-log-row.is-skip { opacity: 0.85; }
.import-action.is-unchanged {
  color: var(--muted-foreground);
  background: var(--muted);
}
.import-badge:not(.is-error):not(.is-success) {
  background: var(--muted);
  color: var(--muted-foreground);
}

@media (max-width: 720px) {
  .pppoe-picker-meta,
  .pppoe-guide-stats { grid-template-columns: 1fr; }
}
.import-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.7rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
}
.import-badge.is-error {
  background: color-mix(in oklab, var(--destructive) 14%, transparent);
  color: var(--destructive);
}
.import-badge.is-success {
  background: color-mix(in oklab, var(--success) 18%, transparent);
  color: var(--success);
}
.import-log-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-height: 32rem;
}
.import-log {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}
.import-log th,
.import-log td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
.import-log th {
  position: sticky;
  top: 0;
  background: var(--card);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted-foreground);
  z-index: 1;
}
.import-log .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.75rem; }
.import-log .muted { color: var(--muted-foreground); text-align: center; padding: 1.5rem; }
.import-log-row.is-error { background: color-mix(in oklab, var(--destructive) 6%, transparent); }
.import-log-row.is-create { background: color-mix(in oklab, var(--success) 5%, transparent); }
.import-log-row.is-update { background: color-mix(in oklab, #f59e0b 6%, transparent); }
.import-entity {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  border-radius: 0.3rem;
  background: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.import-action {
  display: inline-block;
  padding: 0.12rem 0.45rem;
  border-radius: 9999px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: var(--muted);
}
.import-action.is-create { background: color-mix(in oklab, var(--success) 20%, transparent); color: var(--success); }
.import-action.is-update { background: color-mix(in oklab, #f59e0b 22%, transparent); color: #b45309; }
.import-action.is-error { background: color-mix(in oklab, var(--destructive) 16%, transparent); color: var(--destructive); }
.import-action.is-unchanged { color: var(--muted-foreground); }
.import-action.is-skip { color: var(--muted-foreground); opacity: 0.9; }
.import-changes {
  margin: 0.35rem 0 0;
  padding-left: 1rem;
  color: var(--muted-foreground);
  font-size: 0.75rem;
}
@media (max-width: 960px) {
  .import-steps,
  .import-grid,
  .import-stats { grid-template-columns: 1fr; }
}

.import-swatch {
  display: inline-block;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 0.15rem;
  vertical-align: middle;
  margin-right: 0.15rem;
}
.import-swatch.is-required { background: #be123c; }
.import-swatch.is-important { background: #fbbf24; }

/* —— Dashboard (icon tiles) —— */
.dash-toolbar {
  display: flex;
  justify-content: flex-end;
}
.dash-period {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
}
.dash-period-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.1rem;
  height: 2.1rem;
  padding: 0 0.45rem;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted-foreground);
  font-size: 0.75rem;
  font-weight: 650;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.dash-period-pill .nav-icon {
  width: 1rem;
  height: 1rem;
}
.dash-period-pill:hover {
  border-color: color-mix(in oklch, var(--primary) 35%, var(--border));
  color: var(--foreground);
}
.dash-period-pill.is-active {
  background: color-mix(in oklch, var(--primary) 12%, var(--card));
  border-color: color-mix(in oklch, var(--primary) 40%, var(--border));
  color: var(--foreground);
}
.dash-tiles {
  display: grid;
  gap: var(--section-gap);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 7.5rem), 1fr));
}
.dash-tiles--kpi {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 8.5rem), 1fr));
}
.dash-tiles--infra {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.dash-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 6.25rem;
  padding: 0.85rem 0.6rem;
  border-radius: calc(var(--radius) + 2px);
  border: 1px solid var(--border);
  background: var(--card);
  text-decoration: none;
  color: inherit;
  text-align: center;
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
a.dash-tile:hover {
  border-color: color-mix(in oklch, var(--primary) 35%, var(--border));
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.06);
  transform: translateY(-1px);
}
.dash-tile--mini {
  min-height: 4.25rem;
  padding: 0.65rem 0.4rem;
  gap: 0.25rem;
}
.dash-tile-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: calc(var(--radius) - 2px);
  background: var(--muted);
  color: var(--muted-foreground);
}
.dash-tile-icon .nav-icon {
  width: 1.05rem;
  height: 1.05rem;
}
.dash-tile-count {
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.dash-tile-count--sm {
  font-size: 1rem;
}
.dash-tile-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}
.dash-tile-sub {
  font-size: 0.7rem;
  color: var(--muted-foreground);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-tile--danger.is-hot {
  border-color: color-mix(in oklch, #e11d48 35%, var(--border));
  background: color-mix(in oklch, #e11d48 6%, var(--card));
}
.dash-tile--danger.is-hot .dash-tile-icon {
  background: color-mix(in oklch, #e11d48 14%, transparent);
  color: #be123c;
}
.dash-tile--warn.is-hot {
  border-color: color-mix(in oklch, #d97706 35%, var(--border));
  background: color-mix(in oklch, #d97706 6%, var(--card));
}
.dash-tile--warn.is-hot .dash-tile-icon {
  background: color-mix(in oklch, #d97706 14%, transparent);
  color: #b45309;
}
.dash-tile--info.is-hot {
  border-color: color-mix(in oklch, var(--primary) 35%, var(--border));
  background: color-mix(in oklch, var(--primary) 6%, var(--card));
}
.dash-tile--info.is-hot .dash-tile-icon {
  background: color-mix(in oklch, var(--primary) 14%, transparent);
  color: var(--primary);
}
.dash-card-head {
  align-items: center;
}
.dash-card-head .ui-card-title {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.dash-card-head .ui-card-title .nav-icon {
  width: 1rem;
  height: 1rem;
  color: var(--muted-foreground);
}
.dash-card-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.dash-pipeline {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  justify-content: space-between;
  gap: 0.35rem;
}
.dash-pipeline-sep {
  display: inline-flex;
  align-items: center;
  color: var(--muted-foreground);
  opacity: 0.45;
  flex-shrink: 0;
}
.dash-pipeline-sep .nav-icon {
  width: 0.9rem;
  height: 0.9rem;
}
.dash-pipeline-step {
  flex: 1 1 4.5rem;
  min-width: 4.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.65rem 0.4rem;
  border-radius: calc(var(--radius) - 1px);
  border: 1px solid transparent;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.dash-pipeline-step:hover,
.dash-pipeline-step.is-hot {
  background: var(--muted);
  border-color: var(--border);
}
.dash-pipeline-icon {
  display: inline-flex;
  color: var(--muted-foreground);
}
.dash-pipeline-icon .nav-icon {
  width: 1.15rem;
  height: 1.15rem;
}
.dash-pipeline-count {
  font-size: 1.15rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.dash-pipeline-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--muted-foreground);
}
.dash-funnel {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.dash-funnel-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.25rem;
}
.dash-funnel-label {
  font-size: 0.8125rem;
  font-weight: 550;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-funnel-count {
  font-size: 0.8125rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--muted-foreground);
}
.dash-funnel-track {
  height: 0.4rem;
  border-radius: 999px;
  background: var(--muted);
  overflow: hidden;
}
.dash-funnel-bar {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: color-mix(in oklch, var(--primary) 80%, transparent);
  min-width: 0;
}
.dash-funnel-bar--plan {
  background: color-mix(in oklch, #0d9488 75%, transparent);
}
.dash-finance-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}
.dash-finance-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  padding: 0.45rem 0.55rem;
  border-radius: calc(var(--radius) - 2px);
  background: var(--muted);
  font-size: 0.8rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-finance-chip .dash-tile-icon {
  width: 1.5rem;
  height: 1.5rem;
  flex-shrink: 0;
}
.dash-finance-chip .dash-tile-icon .nav-icon {
  width: 0.85rem;
  height: 0.85rem;
}
.dash-chart-pair {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0.15rem;
  width: 100%;
  height: 100%;
}
.dash-chart-pair .ui-chart-bar {
  flex: 1;
  max-width: 1.1rem;
}
.dash-bar-rev {
  background: color-mix(in oklch, var(--primary) 85%, transparent);
}
.dash-bar-exp {
  background: color-mix(in oklch, #94a3b8 80%, transparent);
}
.dash-dot {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  vertical-align: middle;
}
.dash-dot-rev { background: color-mix(in oklch, var(--primary) 85%, transparent); }
.dash-dot-exp { background: color-mix(in oklch, #94a3b8 80%, transparent); }
.dash-cell-title {
  font-size: 0.875rem;
  font-weight: 550;
  line-height: 1.3;
}
.dash-table td {
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
  vertical-align: middle;
}
.dash-td-icon {
  width: 1.75rem;
  color: var(--muted-foreground);
  padding-right: 0 !important;
}
.dash-td-icon .nav-icon {
  width: 0.95rem;
  height: 0.95rem;
}
.dash-td-badge,
.dash-td-amount {
  text-align: right;
  white-space: nowrap;
}
.dash-td-amount {
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 640px) {
  .dash-finance-row {
    grid-template-columns: 1fr;
  }
  .dash-pipeline-sep {
    display: none;
  }
}

/* —— Dashboard charts —— */
.dash-charts {
  display: grid;
  gap: var(--section-gap);
  grid-template-columns: repeat(12, minmax(0, 1fr));
}
.dash-chart-card {
  grid-column: span 4;
  min-width: 0;
}
.dash-chart-card--wide {
  grid-column: span 12;
}
@media (min-width: 900px) {
  .dash-chart-card--wide {
    grid-column: span 8;
  }
  .dash-chart-card {
    grid-column: span 4;
  }
}
@media (max-width: 640px) {
  .dash-chart-card,
  .dash-chart-card--wide {
    grid-column: span 12;
  }
}
.dash-chart-legend {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  font-size: 0.7rem;
  color: var(--muted-foreground);
}
.dash-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.dash-legend-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  flex-shrink: 0;
}
.dash-legend-dot--rev { background: color-mix(in oklch, var(--primary) 85%, transparent); }
.dash-legend-dot--exp { background: color-mix(in oklch, #94a3b8 80%, transparent); }
.dash-legend-dot--profit { background: #22c55e; }
.dash-bar-chart {
  height: 9rem;
  margin-bottom: 0.5rem;
}
.dash-sparkline {
  display: flex;
  align-items: flex-end;
  gap: 0.35rem;
  height: 3rem;
  padding: 0.35rem 0.25rem 0;
  border-top: 1px dashed var(--border);
}
.dash-spark-col {
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.dash-spark-bar {
  width: 100%;
  max-width: 1.25rem;
  border-radius: 0.25rem 0.25rem 0.1rem 0.1rem;
  background: #22c55e;
  min-height: 0.15rem;
  transition: height 0.2s ease;
}
.dash-spark-bar.is-neg {
  background: #e11d48;
}
.dash-donut-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
}
@media (min-width: 480px) {
  .dash-donut-wrap {
    flex-direction: row;
    align-items: center;
    justify-content: center;
  }
}
.dash-donut {
  position: relative;
  width: 7.5rem;
  height: 7.5rem;
  border-radius: 50%;
  flex-shrink: 0;
}
.dash-donut-hole {
  position: absolute;
  inset: 22%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--card);
  font-size: 1.25rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  box-shadow: inset 0 0 0 1px var(--border);
}
.dash-donut-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
  flex: 1;
  max-width: 14rem;
}
.dash-donut-legend--scroll {
  max-height: 8.5rem;
  overflow-y: auto;
}
.dash-donut-legend li {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 0.35rem 0.5rem;
  font-size: 0.75rem;
  line-height: 1.25;
}
.dash-donut-legend li span:first-of-type + span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted-foreground);
}
.dash-donut-legend strong {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}
.dash-donut-legend em {
  font-style: normal;
  font-size: 0.68rem;
  color: var(--muted-foreground);
  font-variant-numeric: tabular-nums;
}
.dash-hbar-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.dash-hbar-head {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.25rem;
  font-size: 0.75rem;
}
.dash-hbar-icon {
  display: inline-flex;
  color: var(--muted-foreground);
}
.dash-hbar-icon .nav-icon {
  width: 0.85rem;
  height: 0.85rem;
}
.dash-hbar-label {
  flex: 1;
  min-width: 0;
  font-weight: 550;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-size: 0.68rem;
  color: var(--muted-foreground);
}
.dash-hbar-count {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.dash-hbar-track {
  height: 0.42rem;
  border-radius: 999px;
  background: var(--muted);
  overflow: hidden;
}
.dash-hbar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  min-width: 0;
  transition: width 0.25s ease;
  background: color-mix(in oklch, var(--primary) 75%, transparent);
}

/* —— Dashboard Pro (executive) —— */
.dash-pro {
  display: grid;
  gap: var(--page-gap);
}
.dash-pro-hero {
  padding: var(--card-pad);
  border-radius: calc(var(--radius) + 4px);
  background:
    linear-gradient(
      135deg,
      color-mix(in oklch, var(--primary) 6%, var(--card)) 0%,
      var(--card) 48%,
      color-mix(in oklch, var(--muted) 40%, var(--card)) 100%
    );
  box-shadow:
    0 1px 0 color-mix(in oklch, var(--foreground) 4%, transparent),
    0 8px 24px rgb(0 0 0 / 0.04);
}
.dash-pro-hero-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--section-gap);
}
.dash-pro-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}
.dash-pro-live {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--success, #16a34a);
}
.dash-pro-live-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  background: currentColor;
  animation: dash-live-pulse 2s ease-out infinite;
}
.dash-pro-period {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0.25rem;
  border-radius: calc(var(--radius) + 2px);
  border: 1px solid var(--border);
  background: color-mix(in oklch, var(--muted) 35%, var(--card));
}
.dash-pro-period-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.85rem;
  border-radius: calc(var(--radius) - 1px);
  font-size: 0.8125rem;
  font-weight: 550;
  color: var(--muted-foreground);
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}
.dash-pro-period-btn:hover {
  color: var(--foreground);
  background: color-mix(in oklch, var(--foreground) 4%, transparent);
}
.dash-pro-period-btn.is-active {
  background: var(--card);
  color: var(--foreground);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.06);
}
.dash-pro-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}
.dash-pro-section-title {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  font-size: 0.875rem;
  font-weight: 650;
}
.dash-pro-section-title .nav-icon {
  width: 1rem;
  height: 1rem;
  color: var(--muted-foreground);
}
.dash-pro-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.dash-pro-badge--danger {
  background: color-mix(in oklch, #e11d48 12%, transparent);
  color: #be123c;
}
.dash-pro-alert-grid {
  display: grid;
  gap: var(--section-gap);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
}
.dash-pro-alert {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: calc(var(--radius) + 2px);
  border: 1px solid var(--border);
  background: var(--card);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.dash-pro-alert:hover {
  border-color: color-mix(in oklch, var(--primary) 30%, var(--border));
  box-shadow: 0 4px 14px rgb(0 0 0 / 0.05);
}
.dash-pro-alert--danger { border-color: color-mix(in oklch, #e11d48 28%, var(--border)); background: color-mix(in oklch, #e11d48 5%, var(--card)); }
.dash-pro-alert--warn { border-color: color-mix(in oklch, #d97706 28%, var(--border)); background: color-mix(in oklch, #d97706 5%, var(--card)); }
.dash-pro-alert--info { border-color: color-mix(in oklch, var(--primary) 28%, var(--border)); }
.dash-pro-alert-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: calc(var(--radius) - 2px);
  background: var(--muted);
  flex-shrink: 0;
}
.dash-pro-alert-icon .nav-icon { width: 1.05rem; height: 1.05rem; }
.dash-pro-alert-body { min-width: 0; flex: 1; display: grid; gap: 0.05rem; }
.dash-pro-alert-count { font-size: 1.35rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.dash-pro-alert-label { font-size: 0.8125rem; font-weight: 650; }
.dash-pro-alert-meta { font-size: 0.72rem; color: var(--muted-foreground); }
.dash-pro-alert-go { color: var(--muted-foreground); opacity: 0.5; }
.dash-pro-alert-go .nav-icon { width: 1rem; height: 1rem; }
.dash-pro-kpis {
  display: grid;
  gap: var(--section-gap);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr));
}
.dash-pro-kpi {
  display: block;
  padding: var(--card-pad);
  border-radius: calc(var(--radius) + 2px);
  border: 1px solid var(--border);
  background: var(--card);
  text-decoration: none;
  color: inherit;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.03);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
a.dash-pro-kpi:hover {
  border-color: color-mix(in oklch, var(--primary) 28%, var(--border));
  box-shadow: 0 6px 18px rgb(0 0 0 / 0.05);
  transform: translateY(-1px);
}
.dash-pro-kpi.is-hero {
  border-color: color-mix(in oklch, var(--primary) 22%, var(--border));
  background: linear-gradient(145deg, color-mix(in oklch, var(--primary) 7%, var(--card)), var(--card));
}
.dash-pro-kpi-head {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.dash-pro-kpi-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: calc(var(--radius) - 2px);
  background: var(--muted);
  color: var(--muted-foreground);
}
.dash-pro-kpi--primary .dash-pro-kpi-icon { background: color-mix(in oklch, var(--primary) 14%, var(--muted)); color: var(--primary); }
.dash-pro-kpi--success .dash-pro-kpi-icon { background: color-mix(in oklch, #22c55e 14%, var(--muted)); color: #16a34a; }
.dash-pro-kpi--warn .dash-pro-kpi-icon { background: color-mix(in oklch, #f59e0b 14%, var(--muted)); color: #b45309; }
.dash-pro-kpi-label { font-size: 0.8rem; color: var(--muted-foreground); font-weight: 550; }
.dash-pro-kpi-value {
  margin-top: 0.4rem;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}
.dash-pro-kpi.is-hero .dash-pro-kpi-value { font-size: 1.35rem; }
.dash-pro-kpi-meta {
  margin: 0.35rem 0 0;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}
.dash-pro-kpi-detail {
  margin: 0.2rem 0 0;
  font-size: 0.72rem;
  color: color-mix(in oklch, var(--muted-foreground) 85%, var(--foreground));
}
.dash-pro-layout {
  display: grid;
  gap: var(--page-gap);
  align-items: start;
}
@media (min-width: 1100px) {
  .dash-pro-layout {
    grid-template-columns: minmax(0, 1.65fr) minmax(18rem, 1fr);
  }
}
.dash-pro-main,
.dash-pro-aside {
  display: flex;
  flex-direction: column;
  gap: var(--section-gap);
  min-width: 0;
}
.dash-pro-panel {
  overflow: hidden;
}
.dash-pro-panel--muted {
  background: color-mix(in oklch, var(--muted) 22%, var(--card));
}
.dash-pro-panel-head {
  align-items: flex-start;
  gap: 0.75rem;
}
.dash-pro-panel-head .ui-card-desc {
  margin-top: 0.15rem;
}
.dash-pro-metric-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-left: auto;
}
.dash-pro-metric {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.1rem;
  min-width: 5.5rem;
}
.dash-pro-metric-label {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted-foreground);
}
.dash-pro-metric-value {
  font-size: 0.875rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.dash-pro-metric--accent .dash-pro-metric-value {
  color: #16a34a;
}
.dash-pro-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-bottom: 0.75rem;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}
.dash-pro-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.dash-pro-chart-legend i { font-style: normal; }
.dash-pro-bar-chart {
  height: 10.5rem;
  margin-bottom: 0.75rem;
}
.dash-pro-profit-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.35rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}
.dash-pro-profit-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}
.dash-pro-profit-col .dash-spark-bar {
  width: 100%;
  max-width: 1.5rem;
  height: 2.5rem;
  align-self: center;
}
.dash-pro-profit-val {
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--muted-foreground);
  font-variant-numeric: tabular-nums;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.dash-pro-split {
  display: grid;
  gap: var(--section-gap);
}
@media (min-width: 900px) {
  .dash-pro-split {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.dash-pro-funnel-steps {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.35rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.dash-pro-funnel-arrow {
  display: inline-flex;
  align-items: center;
  color: var(--muted-foreground);
  opacity: 0.4;
}
.dash-pro-funnel-arrow .nav-icon { width: 0.85rem; height: 0.85rem; }
.dash-pro-funnel-step {
  flex: 1 1 4.5rem;
  min-width: 4.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.65rem 0.45rem;
  border-radius: calc(var(--radius) - 1px);
  border: 1px solid transparent;
  text-decoration: none;
  color: inherit;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted-foreground);
  transition: background 0.15s ease, border-color 0.15s ease;
}
.dash-pro-funnel-step strong {
  font-size: 1.1rem;
  color: var(--foreground);
  font-variant-numeric: tabular-nums;
}
.dash-pro-funnel-step.is-active,
.dash-pro-funnel-step:hover {
  background: var(--muted);
  border-color: var(--border);
}
.dash-pro-funnel-icon .nav-icon { width: 1rem; height: 1rem; }
.dash-pro-hbars { margin-top: 0; }
.dash-pro-activity {
  display: grid;
  gap: var(--section-gap);
}
.dash-pro-activity-block + .dash-pro-activity-block {
  padding-top: var(--section-gap);
  border-top: 1px solid var(--border);
}
.dash-pro-activity-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}
.dash-pro-activity-head h4 {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 650;
}
.dash-pro-activity-head h4 .nav-icon {
  width: 0.95rem;
  height: 0.95rem;
  color: var(--muted-foreground);
}
.dash-pro-table thead th {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted-foreground);
  font-weight: 650;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}
.dash-pro-table tbody td {
  font-size: 0.8125rem;
  vertical-align: middle;
}
.dash-pro-donut .dash-donut {
  width: 8.5rem;
  height: 8.5rem;
}
.dash-pro-plan-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.dash-pro-plan-head {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.3rem;
  font-size: 0.8125rem;
}
.dash-pro-plan-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  flex-shrink: 0;
}
.dash-pro-plan-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 550;
}
.dash-pro-plan-count {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.dash-pro-plan-share {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.6875rem;
  color: var(--muted-foreground);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.dash-pro-infra-list {
  margin: 0;
  display: grid;
  gap: 0.5rem;
}
.dash-pro-infra-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: calc(var(--radius) - 2px);
  background: var(--muted);
}
.dash-pro-infra-list dt {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 550;
  color: var(--muted-foreground);
}
.dash-pro-infra-list dt .nav-icon { width: 0.95rem; height: 0.95rem; }
.dash-pro-infra-list dd {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.dash-pro-queue {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.dash-pro-queue-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.65rem;
  border-radius: calc(var(--radius) - 2px);
  text-decoration: none;
  color: inherit;
  font-size: 0.8125rem;
  transition: background 0.15s ease;
}
.dash-pro-queue-item:hover { background: var(--muted); }
.dash-pro-queue-item.is-hot {
  background: color-mix(in oklch, #e11d48 6%, var(--muted));
}
.dash-pro-queue-icon .nav-icon { width: 0.9rem; height: 0.9rem; color: var(--muted-foreground); }
.dash-pro-queue-label { flex: 1; min-width: 0; font-weight: 550; }
.dash-pro-queue-count {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--muted-foreground);
}
.dash-pro-queue-item.is-hot .dash-pro-queue-count { color: #be123c; }
@media (max-width: 640px) {
  .dash-pro-metric-row {
    width: 100%;
    margin-left: 0;
    justify-content: flex-start;
  }
  .dash-pro-metric { align-items: flex-start; }
  .dash-pro-profit-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dash-pro-funnel-arrow { display: none; }
}

/* —— Dashboard Bento —— */
.dash-bento {
  display: flex;
  flex-direction: column;
  gap: var(--section-gap);
}
.dash-bento-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.dash-bento-top-left {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.75rem;
}
.dash-bento-eyebrow {
  font-size: 0.6875rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}
.dash-bento-period-label {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.dash-bento-range {
  font-size: 0.8125rem;
  color: var(--muted-foreground);
  font-variant-numeric: tabular-nums;
}
.dash-bento-tabs {
  display: inline-flex;
  gap: 0.2rem;
  padding: 0.2rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--muted);
}
.dash-bento-tab {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted-foreground);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.dash-bento-tab:hover { color: var(--foreground); }
.dash-bento-tab.is-on {
  background: var(--card);
  color: var(--foreground);
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.08);
}
.dash-bento-chips {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.45rem;
  overflow-x: auto;
  padding-bottom: 0.15rem;
  scrollbar-width: thin;
}
.dash-bento-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  font-size: 0.75rem;
  font-weight: 550;
  color: var(--muted-foreground);
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}
.dash-bento-chip .nav-icon { width: 0.85rem; height: 0.85rem; }
.dash-bento-chip strong {
  font-variant-numeric: tabular-nums;
  color: var(--foreground);
}
.dash-bento-chip.is-hot { border-color: color-mix(in oklch, var(--primary) 35%, var(--border)); }
.dash-bento-chip--danger.is-hot { border-color: color-mix(in oklch, #e11d48 40%, var(--border)); color: #be123c; }
.dash-bento-chip--warn.is-hot { border-color: color-mix(in oklch, #d97706 40%, var(--border)); }
.dash-bento-grid {
  display: grid;
  gap: var(--section-gap);
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-rows: minmax(min-content, auto);
}
.bento {
  grid-column: span 4;
  min-width: 0;
  border-radius: calc(var(--radius) + 4px);
  border: 1px solid var(--border);
  background: var(--card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.bento-kpi {
  grid-column: span 3;
  padding: 1rem;
  text-decoration: none;
  color: inherit;
  gap: 0.15rem;
  transition: border-color 0.15s, transform 0.15s;
}
a.bento-kpi:hover {
  border-color: color-mix(in oklch, var(--primary) 30%, var(--border));
  transform: translateY(-2px);
}
.bento-kpi--hero {
  grid-column: span 6;
  background: linear-gradient(135deg, color-mix(in oklch, var(--primary) 8%, var(--card)), var(--card));
  border-color: color-mix(in oklch, var(--primary) 20%, var(--border));
}
.bento-kpi-icon {
  display: inline-flex;
  color: var(--muted-foreground);
  margin-bottom: 0.25rem;
}
.bento-kpi-icon .nav-icon { width: 1rem; height: 1rem; }
.bento-kpi-val {
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}
.bento-kpi--hero .bento-kpi-val { font-size: 1.125rem; }
.bento-kpi-lbl {
  font-size: 0.72rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted-foreground);
}
.bento-kpi-sub {
  font-size: 0.68rem;
  color: color-mix(in oklch, var(--muted-foreground) 90%, var(--foreground));
  line-height: 1.3;
}
.bento-finance { grid-column: span 8; }
.bento-donut { grid-column: span 4; }
.bento-pipeline { grid-column: span 6; }
.bento-bars { grid-column: span 6; }
.bento-plans { grid-column: span 4; }
.bento-infra { grid-column: span 4; }
.bento-feed { grid-column: span 4; }
.bento-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}
.bento-head h3 {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 650;
}
.bento-head-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  font-size: 0.72rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--muted-foreground);
}
.bento-head-stats span {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.bento-head-stats .nav-icon { width: 0.8rem; height: 0.8rem; }
.bento-pill {
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: var(--muted);
  color: var(--muted-foreground);
  font-variant-numeric: tabular-nums;
}
.bento-link {
  font-size: 0.72rem;
  font-weight: 550;
  color: var(--primary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}
.bento-link:hover { text-decoration: underline; }
.bento-link .nav-icon { width: 0.75rem; height: 0.75rem; }
.bento-body {
  padding: 1rem;
  flex: 1;
  min-height: 0;
}
.bento-body--center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}
.dash-donut--sm {
  width: 6.5rem;
  height: 6.5rem;
}
.dash-donut--sm .dash-donut-hole {
  font-size: 1rem;
}
.dash-bento-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.dash-bento-legend li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}
.dash-bento-legend i {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  flex-shrink: 0;
  font-style: normal;
}
.dash-bento-legend b {
  margin-left: auto;
  color: var(--foreground);
  font-variant-numeric: tabular-nums;
}
.dash-bento-chart {
  height: 8.5rem;
}
.dash-bento-spark {
  display: flex;
  align-items: flex-end;
  gap: 0.25rem;
  height: 2rem;
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px dashed var(--border);
}
.dash-bento-spark-bar {
  flex: 1;
  height: var(--h, 10%);
  min-height: 2px;
  border-radius: 2px 2px 0 0;
  background: #22c55e;
}
.dash-bento-spark-bar.is-neg { background: #e11d48; }
.dash-bento-pipe {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.35rem;
}
.dash-bento-pipe-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.55rem 0.25rem;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid transparent;
  text-decoration: none;
  color: inherit;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--muted-foreground);
  transition: background 0.15s, border-color 0.15s;
}
.dash-bento-pipe-step em {
  font-style: normal;
  display: inline-flex;
}
.dash-bento-pipe-step em .nav-icon { width: 0.95rem; height: 0.95rem; }
.dash-bento-pipe-step strong {
  font-size: 1rem;
  color: var(--foreground);
  font-variant-numeric: tabular-nums;
}
.dash-bento-pipe-step.is-on,
.dash-bento-pipe-step:hover {
  background: var(--muted);
  border-color: var(--border);
}
.dash-bento-plans {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.dash-bento-plans li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: auto auto;
  gap: 0.15rem 0.4rem;
  align-items: center;
  font-size: 0.75rem;
}
.dash-bento-plan-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  grid-row: span 2;
}
.dash-bento-plan-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 550;
}
.dash-bento-plan-n {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.dash-bento-plan-bar {
  grid-column: 2 / -1;
  height: 0.3rem;
  border-radius: 999px;
  background: var(--muted);
  overflow: hidden;
}
.dash-bento-plan-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  font-style: normal;
}
.bento-infra-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  padding: 0.75rem !important;
}
.bento-infra-grid div {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.65rem 0.4rem;
  border-radius: calc(var(--radius) - 2px);
  background: var(--muted);
  text-align: center;
}
.bento-infra-grid span .nav-icon { width: 1rem; height: 1rem; color: var(--muted-foreground); }
.bento-infra-grid strong {
  font-size: 1.125rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.bento-infra-grid em {
  font-size: 0.625rem;
  font-style: normal;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted-foreground);
}
.bento-feed-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.65rem !important;
}
.bento-feed-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.5rem;
  align-items: center;
  padding: 0.5rem 0.55rem;
  border-radius: calc(var(--radius) - 2px);
  text-decoration: none;
  color: inherit;
  font-size: 0.8125rem;
  transition: background 0.12s;
}
a.bento-feed-item:hover { background: var(--muted); }
.bento-feed-id {
  font-size: 0.72rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--muted-foreground);
  white-space: nowrap;
}
.bento-feed-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bento-feed-date {
  font-size: 0.68rem;
  color: var(--muted-foreground);
}
@media (max-width: 1100px) {
  .bento-finance { grid-column: span 12; }
  .bento-kpi { grid-column: span 6; }
  .bento-kpi--hero { grid-column: span 12; }
  .bento-donut, .bento-pipeline, .bento-bars, .bento-plans, .bento-infra, .bento-feed { grid-column: span 6; }
}
@media (max-width: 640px) {
  .bento-kpi, .bento-kpi--hero, .bento-donut, .bento-pipeline, .bento-bars,
  .bento-plans, .bento-infra, .bento-feed, .bento-finance { grid-column: span 12; }
  .dash-bento-pipe { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bento-infra-grid { grid-template-columns: 1fr; }
}

/* —— Dashboard Hero Cards (spotlight + ring) —— */
.dash-hero {
  display: grid;
  gap: var(--section-gap);
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  align-items: stretch;
}
.dash-hero:not(:has(.dash-hero-spotlight)) {
  grid-template-columns: 1fr;
}
.dash-hero:not(:has(.dash-hero-spotlight)) .dash-hero-cards {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
}
@media (max-width: 900px) {
  .dash-hero { grid-template-columns: 1fr; }
}
.dash-hero-spotlight {
  position: relative;
  display: block;
  min-height: 100%;
  padding: 1.35rem 1.5rem;
  border-radius: calc(var(--radius) + 6px);
  border: 1px solid transparent;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
a.dash-hero-spotlight:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgb(0 0 0 / 0.1);
}
.dash-hero-spotlight-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 1;
}
.dash-hero-spotlight--success {
  border-color: color-mix(in oklch, #16a34a 35%, var(--border));
  background: linear-gradient(145deg, #0f766e 0%, #115e59 42%, #134e4a 100%);
  color: #ecfdf5;
}
.dash-hero-spotlight--success .dash-hero-spotlight-bg {
  background:
    radial-gradient(ellipse 80% 60% at 100% 0%, rgb(255 255 255 / 0.12), transparent 55%),
    radial-gradient(circle at 0% 100%, rgb(255 255 255 / 0.06), transparent 45%);
}
.dash-hero-spotlight--primary {
  border-color: color-mix(in oklch, var(--primary) 35%, var(--border));
  background: linear-gradient(145deg, color-mix(in oklch, var(--primary) 88%, #1e3a5f), color-mix(in oklch, var(--primary) 65%, #0f172a));
  color: #f8fafc;
}
.dash-hero-spotlight--primary .dash-hero-spotlight-bg {
  background: radial-gradient(ellipse 70% 50% at 90% 10%, rgb(255 255 255 / 0.15), transparent);
}
.dash-hero-spotlight-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-height: 11rem;
}
.dash-hero-spotlight-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.dash-hero-spotlight-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: calc(var(--radius));
  background: rgb(255 255 255 / 0.12);
  backdrop-filter: blur(4px);
}
.dash-hero-spotlight-icon .nav-icon { width: 1.25rem; height: 1.25rem; }
.dash-hero-spotlight-tag {
  font-size: 0.6875rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.85;
}
.dash-hero-spotlight-label {
  margin: 0.5rem 0 0;
  font-size: 0.8125rem;
  font-weight: 550;
  opacity: 0.88;
}
.dash-hero-spotlight-value {
  margin: 0;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 750;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.dash-hero-spotlight-detail {
  margin: 0;
  font-size: 0.8125rem;
  opacity: 0.78;
  line-height: 1.4;
}
.dash-hero-spotlight-bar {
  margin-top: auto;
  height: 0.35rem;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.15);
  overflow: hidden;
}
.dash-hero-spotlight-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: rgb(255 255 255 / 0.75);
  transition: width 0.4s ease;
}
.dash-hero-spotlight-rate {
  margin: 0.35rem 0 0;
  font-size: 0.6875rem;
  font-weight: 600;
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.dash-hero-cards {
  display: grid;
  gap: var(--section-gap);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
}
@media (max-width: 520px) {
  .dash-hero-cards { grid-template-columns: 1fr; }
}
.dash-hero-card {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1rem 1.05rem;
  border-radius: calc(var(--radius) + 3px);
  border: 1px solid var(--border);
  background: var(--card);
  text-decoration: none;
  color: inherit;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.04);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
a.dash-hero-card:hover {
  border-color: color-mix(in oklch, var(--primary) 28%, var(--border));
  box-shadow: 0 6px 20px rgb(0 0 0 / 0.06);
  transform: translateY(-1px);
}
.dash-hero-card--primary { --ring-color: var(--primary); }
.dash-hero-card--success { --ring-color: #22c55e; }
.dash-hero-card--warn { --ring-color: #f59e0b; }
.dash-hero-card--neutral { --ring-color: #64748b; }
.dash-hero-ring {
  --ring-track: color-mix(in oklch, var(--ring-color, #64748b) 12%, var(--muted));
  --ring-color: var(--ring-color, #64748b);
  flex-shrink: 0;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 50%;
  background: conic-gradient(
    var(--ring-color) 0 calc(var(--pct, 0) * 1%),
    var(--ring-track) calc(var(--pct, 0) * 1%) 100%
  );
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.dash-hero-ring::after {
  content: "";
  position: absolute;
  inset: 0.35rem;
  border-radius: 50%;
  background: var(--card);
}
.dash-hero-ring-label {
  position: relative;
  z-index: 1;
  font-size: 0.625rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--muted-foreground);
}
.dash-hero-card-body {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 0.1rem;
}
.dash-hero-card-icon {
  display: inline-flex;
  color: var(--muted-foreground);
  margin-bottom: 0.15rem;
}
.dash-hero-card-icon .nav-icon { width: 0.9rem; height: 0.9rem; }
.dash-hero-card-value {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}
.dash-hero-card-title {
  font-size: 0.72rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted-foreground);
}
.dash-hero-card-meta {
  font-size: 0.75rem;
  font-weight: 550;
  color: color-mix(in oklch, var(--foreground) 75%, var(--muted-foreground));
}
.dash-hero-card-detail {
  font-size: 0.6875rem;
  color: var(--muted-foreground);
  line-height: 1.35;
}

/* —— Dashboard Executive (ultra-clean) —— */
.dash-exec {
  display: flex;
  flex-direction: column;
  gap: var(--page-gap);
}
.dash-exec-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--section-gap);
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--border);
}
.dash-exec-kicker {
  margin: 0 0 0.2rem;
  font-size: 0.6875rem;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}
.dash-exec-heading {
  margin: 0;
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
}
.dash-exec-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  margin: 0.35rem 0 0;
  font-size: 0.8125rem;
  color: var(--muted-foreground);
  font-variant-numeric: tabular-nums;
}
.dash-exec-dot { opacity: 0.45; }
.dash-exec-seg {
  display: inline-flex;
  gap: 0;
  padding: 0.2rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 2px);
  background: var(--muted);
}
.dash-exec-seg-btn {
  padding: 0.45rem 0.85rem;
  border-radius: calc(var(--radius) - 1px);
  font-size: 0.8125rem;
  font-weight: 550;
  color: var(--muted-foreground);
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
}
.dash-exec-seg-btn:hover { color: var(--foreground); }
.dash-exec-seg-btn.is-on {
  background: var(--card);
  color: var(--foreground);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.06);
}
.dash-exec-panel {
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  background: var(--card);
  overflow: hidden;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.03);
}
.dash-exec-panel--metrics {
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.04);
}
.dash-exec-panel-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding: 0.9rem 1.15rem;
  border-bottom: 1px solid var(--border);
  background: color-mix(in oklch, var(--muted) 18%, var(--card));
}
.dash-exec-panel-title {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.dash-exec-panel-desc {
  margin: 0.2rem 0 0;
  font-size: 0.75rem;
  color: var(--muted-foreground);
  line-height: 1.4;
}
.dash-exec-flag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 650;
  background: color-mix(in oklch, #e11d48 10%, var(--card));
  color: #be123c;
  border: 1px solid color-mix(in oklch, #e11d48 22%, var(--border));
}
.dash-exec-flag .nav-icon { width: 0.85rem; height: 0.85rem; }
.dash-exec-alert-row {
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--border);
}
.dash-exec-alert-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 1.15rem;
  text-decoration: none;
  color: inherit;
  font-size: 0.8125rem;
  border-bottom: 1px solid color-mix(in oklch, var(--border) 80%, transparent);
  transition: background 0.12s;
}
.dash-exec-alert-item:last-child { border-bottom: none; }
.dash-exec-alert-item:hover { background: var(--muted); }
.dash-exec-alert-item--danger { background: color-mix(in oklch, #e11d48 4%, var(--card)); }
.dash-exec-alert-item--warn { background: color-mix(in oklch, #d97706 4%, var(--card)); }
.dash-exec-alert-icon .nav-icon { width: 0.95rem; height: 0.95rem; color: var(--muted-foreground); }
.dash-exec-alert-text strong { font-variant-numeric: tabular-nums; margin-right: 0.25rem; }
.dash-exec-alert-go { color: var(--muted-foreground); opacity: 0.45; }
.dash-exec-alert-go .nav-icon { width: 0.85rem; height: 0.85rem; }
.dash-exec-metric-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
}
.dash-exec-metric {
  grid-column: span 3;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem 1.15rem;
  text-decoration: none;
  color: inherit;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  min-height: 9.5rem;
  transition: background 0.12s;
}
.dash-exec-metric:nth-child(4n) { border-right: none; }
.dash-exec-metric.is-featured {
  grid-column: span 6;
  background: color-mix(in oklch, var(--primary) 4%, var(--card));
}
a.dash-exec-metric:hover { background: color-mix(in oklch, var(--muted) 45%, var(--card)); }
.dash-exec-metric-head {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 1.25rem;
}
.dash-exec-metric-icon .nav-icon { width: 0.9rem; height: 0.9rem; color: var(--muted-foreground); }
.dash-exec-metric-label {
  flex: 1;
  min-width: 0;
  font-size: 0.6875rem;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-exec-metric-badge {
  font-size: 0.625rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 0.1rem 0.35rem;
  border-radius: 999px;
  background: var(--muted);
  color: var(--muted-foreground);
}
.dash-exec-metric--good .dash-exec-metric-badge { background: color-mix(in oklch, #22c55e 14%, var(--muted)); color: #15803d; }
.dash-exec-metric--warn .dash-exec-metric-badge { background: color-mix(in oklch, #f59e0b 14%, var(--muted)); color: #b45309; }
.dash-exec-metric--critical .dash-exec-metric-badge { background: color-mix(in oklch, #e11d48 14%, var(--muted)); color: #be123c; }
.dash-exec-metric-value {
  margin: 0.15rem 0 0;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}
.dash-exec-metric.is-featured .dash-exec-metric-value { font-size: 1.65rem; }
.dash-exec-metric-meta {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 550;
  color: color-mix(in oklch, var(--foreground) 78%, var(--muted-foreground));
}
.dash-exec-metric-detail {
  margin: 0;
  font-size: 0.72rem;
  color: var(--muted-foreground);
  line-height: 1.35;
}
.dash-exec-metric-track {
  margin-top: auto;
  height: 0.28rem;
  border-radius: 999px;
  background: var(--muted);
  overflow: hidden;
}
.dash-exec-metric-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
  transition: width 0.35s ease;
}
.dash-exec-metric-fill--good { background: #22c55e; }
.dash-exec-metric-fill--warn { background: #f59e0b; }
.dash-exec-metric-fill--critical { background: #e11d48; }
.dash-exec-metric-foot {
  margin: 0.25rem 0 0;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}
.dash-exec-grid {
  display: grid;
  gap: var(--section-gap);
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: start;
}
.dash-exec-span-8 { grid-column: span 8; }
.dash-exec-span-12 { grid-column: span 12; }
.dash-exec-span-6 { grid-column: span 6; }
.dash-exec-span-4 { grid-column: span 4; }
.dash-exec-panel-body {
  padding: 1rem 1.15rem 1.15rem;
}
.dash-exec-panel-body--center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
}
.dash-exec-mini-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  margin: 0;
}
.dash-exec-mini-stats div {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.05rem;
}
.dash-exec-mini-stats dt {
  margin: 0;
  font-size: 0.625rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-foreground);
}
.dash-exec-mini-stats dd {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.dash-exec-link {
  font-size: 0.75rem;
  font-weight: 550;
  color: var(--primary);
  text-decoration: none;
  white-space: nowrap;
}
.dash-exec-link:hover { text-decoration: underline; }
.dash-exec-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.dash-exec-legend li {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 0.45rem;
  align-items: center;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}
.dash-exec-legend i {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  font-style: normal;
}
.dash-exec-legend b { color: var(--foreground); font-variant-numeric: tabular-nums; }
.dash-exec-legend em { font-style: normal; font-size: 0.6875rem; font-variant-numeric: tabular-nums; }
.dash-exec-legend span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-exec-chart { height: 9rem; margin-bottom: 0.65rem; }
.dash-exec-legend-row,
.dash-exec-panel-body > .dash-exec-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-bottom: 0.75rem;
  font-size: 0.72rem;
  color: var(--muted-foreground);
}
.dash-exec-panel-body > .dash-exec-legend { flex-direction: row; list-style: none; padding: 0; margin: 0 0 0.75rem; }
.dash-exec-panel-body > .dash-exec-legend span { display: inline-flex; align-items: center; gap: 0.35rem; }
.dash-exec-legend .lg,
.dash-exec-panel-body > .dash-exec-legend i.lg {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 2px;
  font-style: normal;
}
.lg-rev { background: color-mix(in oklch, var(--primary) 85%, transparent); }
.lg-exp { background: color-mix(in oklch, #94a3b8 80%, transparent); }
.lg-profit { background: #22c55e; }
.dash-exec-profit-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.35rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}
.dash-exec-profit-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  min-width: 0;
}
.dash-exec-profit-bar {
  width: 100%;
  max-width: 1.35rem;
  height: 2.25rem;
  align-self: center;
  border-radius: 2px 2px 0 0;
  background: #22c55e;
  min-height: 2px;
}
.dash-exec-profit-bar.is-neg { background: #e11d48; }
.dash-exec-profit-cell em {
  font-style: normal;
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--muted-foreground);
  font-variant-numeric: tabular-nums;
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-exec-pipeline {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.35rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.dash-exec-pipeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.55rem 0.3rem;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted-foreground);
  transition: border-color 0.12s, background 0.12s;
}
.dash-exec-pipeline-step strong {
  font-size: 1rem;
  color: var(--foreground);
  font-variant-numeric: tabular-nums;
}
.dash-exec-pipeline-step em { font-style: normal; }
.dash-exec-pipeline-step.is-active,
.dash-exec-pipeline-step:hover {
  background: color-mix(in oklch, var(--primary) 6%, var(--card));
  border-color: color-mix(in oklch, var(--primary) 25%, var(--border));
}
.dash-exec-pipeline-icon .nav-icon { width: 0.95rem; height: 0.95rem; }
.dash-exec-plan-rows {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.dash-exec-plan-top {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.3rem;
  font-size: 0.8125rem;
}
.dash-exec-plan-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  flex-shrink: 0;
}
.dash-exec-plan-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 550;
}
.dash-exec-plan-n {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.dash-exec-plan-share {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.6875rem;
  color: var(--muted-foreground);
  text-align: right;
}
.dash-exec-infra {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.dash-exec-infra div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--border);
}
.dash-exec-infra div:last-child { border-bottom: none; }
.dash-exec-infra dt {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 550;
  color: var(--muted-foreground);
}
.dash-exec-infra dt .nav-icon { width: 0.95rem; height: 0.95rem; }
.dash-exec-infra dd {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.dash-exec-activity-grid {
  display: grid;
  gap: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
}
.dash-exec-activity-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 0;
  border-right: 1px solid var(--border);
}
.dash-exec-activity-col:last-child { border-right: none; }
.dash-exec-activity-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1.15rem;
  border-bottom: 1px solid var(--border);
  background: color-mix(in oklch, var(--muted) 16%, var(--card));
}
.dash-exec-activity-title {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted-foreground);
}
.dash-exec-activity-title .nav-icon { width: 0.85rem; height: 0.85rem; flex-shrink: 0; }
.dash-act-feed {
  list-style: none;
  margin: 0;
  padding: 0.35rem 0;
  flex: 1;
}
.dash-act-feed li { margin: 0; }
.dash-act-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem 1rem;
  padding: 0.65rem 1.15rem;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid color-mix(in oklch, var(--border) 85%, transparent);
  transition: background 0.12s;
}
.dash-act-feed li:last-child .dash-act-row { border-bottom: none; }
a.dash-act-row:hover { background: color-mix(in oklch, var(--muted) 40%, var(--card)); }
.dash-act-row--static { cursor: default; }
.dash-act-body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}
.dash-act-primary {
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--foreground);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-act-secondary {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  min-width: 0;
  font-size: 0.6875rem;
  line-height: 1.3;
  color: var(--muted-foreground);
}
.dash-act-secondary > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-act-who { max-width: 9rem; }
.dash-act-code {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 0.625rem;
  letter-spacing: 0.01em;
  flex-shrink: 0;
}
.dash-act-sep { opacity: 0.45; flex-shrink: 0; }
.dash-act-aside {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
}
.dash-act-aside .status-badge,
.dash-act-aside .ui-badge { white-space: nowrap; }
.dash-act-amount {
  font-size: 0.8125rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--foreground);
  white-space: nowrap;
}
.dash-act-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 9rem;
  padding: 1.5rem 1rem;
  color: var(--muted-foreground);
  font-size: 0.8125rem;
  text-align: center;
}
.dash-act-empty .nav-icon {
  width: 1.25rem;
  height: 1.25rem;
  opacity: 0.35;
}
.dash-exec-table thead th {
  font-size: 0.625rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-foreground);
  padding-top: 0.45rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--border);
}
.dash-exec-table tbody td {
  font-size: 0.8125rem;
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
  vertical-align: middle;
}
.dash-exec-table .muted { color: var(--muted-foreground); }
@media (max-width: 1100px) {
  .dash-exec-span-8,
  .dash-exec-span-12,
  .dash-exec-span-6,
  .dash-exec-span-4 { grid-column: span 12; }
  .dash-exec-metric { grid-column: span 6; }
  .dash-exec-metric:nth-child(4n) { border-right: 1px solid var(--border); }
  .dash-exec-metric:nth-child(2n) { border-right: none; }
  .dash-exec-metric.is-featured { grid-column: span 12; border-right: none; }
  .dash-exec-activity-grid { grid-template-columns: 1fr; }
  .dash-exec-activity-col { border-right: none; border-bottom: 1px solid var(--border); }
  .dash-exec-activity-col:last-child { border-bottom: none; }
  .dash-act-empty { min-height: 6rem; }
}
@media (max-width: 640px) {
  .dash-exec-metric,
  .dash-exec-metric.is-featured { grid-column: span 12; border-right: none; }
  .dash-exec-pipeline { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dash-exec-profit-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dash-exec-ops-stats { grid-template-columns: 1fr; }
  .dash-exec-queue-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Dashboard ops strips + work queue */
.dash-exec-ops-row {
  display: grid;
  gap: var(--section-gap);
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: stretch;
}
.dash-exec-ops-card {
  grid-column: span 4;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  background: var(--card);
  padding: 0.9rem 1.1rem 1rem;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.03);
}
.dash-exec-ops-card--billing { grid-column: span 6; }
.dash-exec-ops-card--solo {
  width: 100%;
}
.dash-exec-ops-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}
.dash-exec-ops-stats--row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 1100px) {
  .dash-exec-ops-stats--row { grid-template-columns: 1fr; }
}
.dash-exec-ops-card--network,
.dash-exec-ops-card--growth { grid-column: span 3; }
.dash-exec-ops-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.dash-exec-ops-title {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}
.dash-exec-ops-title .nav-icon { width: 0.9rem; height: 0.9rem; }
.dash-exec-ops-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem 0.85rem;
  margin: 0;
}
.dash-exec-ops-stats--compact { grid-template-columns: 1fr; }
.dash-exec-ops-stat {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}
.dash-exec-ops-stat dt {
  margin: 0;
  font-size: 0.625rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted-foreground);
}
.dash-exec-ops-stat dd {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.35;
}
.dash-exec-ops-stat dd strong {
  font-size: 1.05rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin-right: 0.25rem;
}
.dash-exec-ops-stat dd span { color: var(--muted-foreground); font-size: 0.72rem; }
.dash-exec-ops-stat.is-hot dd strong { color: #be123c; }
.dash-exec-ops-stat.is-warn dd strong { color: #b45309; }
.dash-exec-ops-stat.is-good dd strong { color: #15803d; }
.dash-exec-aging {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0.65rem 0 0;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
}
.dash-exec-aging li {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  font-size: 0.6875rem;
  color: var(--muted-foreground);
}
.dash-exec-aging b { color: var(--foreground); font-variant-numeric: tabular-nums; }
.dash-exec-aging em { font-style: normal; font-variant-numeric: tabular-nums; }
.dash-exec-delta {
  font-size: 0.6875rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.dash-exec-delta--up { color: #15803d; }
.dash-exec-delta--down { color: #be123c; }
.dash-exec-delta--flat { color: var(--muted-foreground); }
.dash-exec-metric-delta {
  font-size: 0.625rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 0.08rem 0.3rem;
  border-radius: 999px;
  background: var(--muted);
}
.dash-exec-metric-delta--up { background: color-mix(in oklch, #22c55e 14%, var(--muted)); color: #15803d; }
.dash-exec-metric-delta--down { background: color-mix(in oklch, #e11d48 14%, var(--muted)); color: #be123c; }
.dash-exec-metric-delta--flat { color: var(--muted-foreground); }
.dash-exec-panel--queue { margin-bottom: 0; }
.dash-exec-panel--alerts {
  border-color: color-mix(in oklch, #e11d48 18%, var(--border));
  box-shadow: 0 1px 3px color-mix(in oklch, #e11d48 8%, transparent);
}
.dash-exec-panel--alerts .dash-exec-panel-title {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #be123c;
}
.dash-exec-panel--alerts .dash-exec-panel-title .nav-icon { width: 0.95rem; height: 0.95rem; }
.dash-exec-panel-toolbar--compact { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.dash-exec-panel--alerts .dash-exec-alert-row { border-bottom: none; }
.dash-exec-queue-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}
.dash-exec-queue-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--border);
}
.dash-exec-queue-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  padding: 1rem 0.5rem;
  text-decoration: none;
  color: inherit;
  border-right: 1px solid var(--border);
  transition: background 0.12s;
}
.dash-exec-queue-cell:last-child { border-right: none; }
.dash-exec-queue-cell:hover { background: var(--muted); }
.dash-exec-queue-n {
  font-size: 1.35rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.dash-exec-queue-label {
  font-size: 0.625rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted-foreground);
  text-align: center;
}
.dash-exec-queue-cell.is-hot .dash-exec-queue-n { color: #be123c; }
.dash-exec-queue-cell.is-warn .dash-exec-queue-n { color: #b45309; }
.dash-exec-queue-cell.is-info .dash-exec-queue-n { color: #0369a1; }
@media (max-width: 1100px) {
  .dash-exec-ops-card,
  .dash-exec-ops-card--billing,
  .dash-exec-ops-card--network,
  .dash-exec-ops-card--growth { grid-column: span 12; }
  .dash-exec-queue-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-exec-queue-cell:nth-child(2n) { border-right: none; }
  .dash-exec-queue-cell:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
}


/* —— Ticket detail workbench v2 (tv2-*) —— */
.tv2-top { margin-bottom: 0.25rem; }
.tv2-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem 1.25rem;
  margin-top: 0.35rem;
}
.tv2-hero-main { min-width: 0; flex: 1 1 18rem; }
.tv2-hero-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.45rem;
}
.tv2-num {
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  margin-right: 0.15rem;
}
.tv2-subject {
  margin: 0;
  font-size: clamp(1.2rem, 1.05rem + 0.6vw, 1.55rem);
  line-height: 1.25;
  font-weight: 750;
  letter-spacing: -0.02em;
}
.tv2-meta {
  margin: 0.4rem 0 0;
  font-size: 0.9rem;
  color: var(--muted-foreground);
}
.tv2-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  justify-content: flex-end;
}
.tv2-page {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.page-body > .tv2-page { margin-bottom: 0; }
.tv2-next {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem 1rem;
  padding: 0.95rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in oklch, var(--muted) 35%, var(--background));
  position: sticky;
  top: 0.65rem;
  z-index: 5;
}
.tv2-next.is-focus {
  border-color: color-mix(in oklch, var(--foreground) 28%, var(--border));
  background: color-mix(in oklch, var(--foreground) 4%, var(--background));
  box-shadow: 0 1px 0 color-mix(in oklch, var(--foreground) 6%, transparent);
}
.tv2-next-ico {
  display: grid;
  place-items: center;
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 999px;
  background: color-mix(in oklch, var(--foreground) 8%, var(--background));
  flex: 0 0 auto;
}
.tv2-next-ico .nav-icon { width: 1rem; height: 1rem; }
.tv2-next-copy { min-width: 0; flex: 1 1 14rem; }
.tv2-next-kicker {
  margin: 0 0 0.15rem;
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}
.tv2-next-copy h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 750;
}
.tv2-next-copy p {
  margin: 0.2rem 0 0;
  font-size: 0.86rem;
  color: var(--muted-foreground);
}
.tv2-workbench {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(15rem, 19rem) minmax(0, 1fr);
  align-items: start;
}
.tv2-rail,
.tv2-main {
  display: grid;
  gap: 0.85rem;
  min-width: 0;
}
.tv2-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--background);
  padding: 1rem 1.1rem;
}
.tv2-panel--step { scroll-margin-top: 5.5rem; }
.tv2-panel--step.is-current {
  border-color: color-mix(in oklch, var(--foreground) 26%, var(--border));
  box-shadow: 0 0 0 1px color-mix(in oklch, var(--foreground) 6%, transparent);
}
.tv2-panel-title {
  margin: 0 0 0.55rem;
  font-size: 0.95rem;
  font-weight: 750;
}
.tv2-step-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}
.tv2-step-tag span {
  display: inline-grid;
  place-items: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: color-mix(in oklch, var(--muted) 75%, transparent);
  color: var(--foreground);
  font-variant-numeric: tabular-nums;
}
.tv2-help {
  margin: 0 0 0.85rem;
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--muted-foreground);
}
.tv2-warn {
  margin: 0 0 0.5rem;
  font-size: 0.86rem;
  color: #b45309;
}
.tv2-result {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 650;
}
.tv2-party {
  margin: 0 0 0.55rem;
  font-size: 1rem;
  font-weight: 750;
}
.tv2-report {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.55;
  font-size: 0.92rem;
}
.tv2-facts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}
.tv2-facts li {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  font-size: 0.86rem;
  color: var(--muted-foreground);
}
.tv2-facts .ts-ico { flex: 0 0 auto; margin-top: 0.1rem; }
.tv2-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}
.tv2-people {
  list-style: none;
  margin: 0 0 0.65rem;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}
.tv2-people li {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.88rem;
}
.tv2-dl {
  margin: 0;
  display: grid;
  gap: 0.4rem;
}
.tv2-dl > div {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr);
  gap: 0.4rem;
  font-size: 0.86rem;
}
.tv2-dl dt { color: var(--muted-foreground); margin: 0; }
.tv2-dl dd { margin: 0; font-weight: 650; }
.tv2-dl dd.is-danger { color: #be123c; }
.tv2-related {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}
.tv2-related li {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.86rem;
}
.tv2-related span { color: var(--muted-foreground); }
.tv2-vsteps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}
.tv2-vstep {
  display: grid;
  grid-template-columns: 1.6rem minmax(0, 1fr);
  gap: 0.55rem;
  align-items: start;
}
.tv2-vstep-dot {
  display: grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 750;
  background: var(--muted);
  color: var(--muted-foreground);
}
.tv2-vstep-dot .nav-icon { width: 0.8rem; height: 0.8rem; }
.tv2-vstep strong {
  display: block;
  font-size: 0.86rem;
  font-weight: 750;
}
.tv2-vstep span,
.tv2-vstep em {
  display: block;
  font-size: 0.78rem;
  font-style: normal;
  color: var(--muted-foreground);
}
.tv2-vstep--done .tv2-vstep-dot {
  background: color-mix(in oklch, #22c55e 18%, var(--muted));
  color: #15803d;
}
.tv2-vstep--current .tv2-vstep-dot {
  background: color-mix(in oklch, var(--foreground) 12%, var(--background));
  color: var(--foreground);
}
.tv2-picker {
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  background: color-mix(in oklch, var(--muted) 18%, var(--background));
  overflow: hidden;
}
.tv2-picker-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border);
  background: var(--background);
}
.tv2-picker-head strong { font-size: 0.86rem; }
.tv2-picker-head span {
  font-size: 0.75rem;
  color: var(--muted-foreground);
}
.tv2-picker .tv2-checks {
  margin: 0;
  padding: 0.65rem 0.85rem;
  max-height: 16rem;
  overflow: auto;
}
.tv2-checks {
  display: grid;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}
.tv2-checks--grid {
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
}
.tv2-check {
  padding: 0.45rem 0.55rem;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid transparent;
  background: var(--background);
}
.tv2-check:hover {
  border-color: var(--border);
}
.tv2-cardish {
  padding: 0.85rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  background: color-mix(in oklch, var(--muted) 14%, var(--background));
}
.tv2-cardish-label {
  margin: 0 0 0.65rem;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}
.tv2-split {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.tv2-split-side {
  display: grid;
  gap: 0.65rem;
  align-content: start;
}
.tv2-block {
  padding-top: 0.95rem;
  margin-top: 0.95rem;
  border-top: 1px solid var(--border);
}
.tv2-block:first-of-type {
  padding-top: 0;
  margin-top: 0;
  border-top: 0;
}
.tv2-block-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 0.75rem;
  margin-bottom: 0.55rem;
}
.tv2-block-title {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 750;
}
.tv2-block-meta {
  font-size: 0.75rem;
  color: var(--muted-foreground);
}
.tv2-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 750;
  background: var(--muted);
  color: var(--muted-foreground);
  vertical-align: middle;
}
.tv2-photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr));
  gap: 0.45rem;
  margin-bottom: 0.75rem;
}
.tv2-photo {
  display: block;
  aspect-ratio: 1;
  border-radius: calc(var(--radius) - 2px);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--muted);
}
.tv2-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.tv2-list {
  list-style: none;
  margin: 0 0 0.65rem;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}
.tv2-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.86rem;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  background: color-mix(in oklch, var(--muted) 12%, var(--background));
}
.tv2-inline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 5.5rem auto;
  gap: 0.55rem;
  align-items: end;
}
.tv2-inline-grow { min-width: 0; }
.tv2-inline-action {
  display: flex;
  align-items: flex-end;
  padding-bottom: 0.05rem;
}
.tv2-inline .tv2-qty,
.tv2-qty { max-width: none; }
.tv2-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
  gap: 0.55rem;
  margin-bottom: 0.85rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  background: color-mix(in oklch, var(--muted) 16%, var(--background));
}
.tv2-info-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  margin-bottom: 0.15rem;
}
.tv2-info strong {
  font-size: 0.95rem;
  font-weight: 750;
}
.tv2-comment { margin-bottom: 0.85rem; }
.tv2-notes {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.35rem;
}
.tv2-note {
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}
.tv2-note:last-child { border-bottom: 0; padding-bottom: 0; }
.tv2-note.is-system { opacity: 0.92; }
.tv2-note header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.3rem;
}
.tv2-note header strong { font-size: 0.86rem; }
.tv2-note time {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}
.tv2-note p {
  margin: 0;
  font-size: 0.88rem;
  white-space: pre-wrap;
}
.tv2-kind {
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}
.tv2-more {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--background);
  padding: 0.85rem 1.05rem;
}
.tv2-more summary {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  font-weight: 650;
  font-size: 0.9rem;
  color: var(--muted-foreground);
  list-style: none;
}
.tv2-more summary::-webkit-details-marker { display: none; }
.tv2-more[open] summary {
  margin-bottom: 0.85rem;
  color: var(--foreground);
}
.tv2-more-body { display: grid; gap: 1rem; }
@media (max-width: 980px) {
  .tv2-workbench { grid-template-columns: 1fr; }
  .tv2-rail { order: 2; }
  .tv2-main { order: 1; }
  .tv2-split { grid-template-columns: 1fr; }
  .tv2-inline { grid-template-columns: 1fr; }
  .tv2-inline-action { justify-content: flex-start; }
}

/* —— ODP cascade v2 (toc-*) —— */
.toc {
  display: grid;
  gap: 1rem;
  padding: 1.05rem 1.15rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in oklch, var(--muted) 18%, var(--background));
}
.toc-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem 1.15rem;
}
.toc-head-copy { min-width: 0; flex: 1 1 14rem; }
.toc-kicker {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}
.toc-title {
  margin: 0.2rem 0 0;
  font-size: 1.02rem;
  font-weight: 750;
}
.toc-lead {
  margin: 0.35rem 0 0;
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--muted-foreground);
}
.toc-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.toc-step {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--background);
  font-size: 0.75rem;
  font-weight: 650;
  color: var(--muted-foreground);
}
.toc-step em { font-style: normal; }
.toc-step span {
  display: inline-grid;
  place-items: center;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 750;
  background: var(--muted);
}
.toc-step.is-current {
  color: var(--foreground);
  border-color: color-mix(in oklch, var(--foreground) 22%, var(--border));
}
.toc-step.is-done {
  color: #15803d;
  border-color: color-mix(in oklch, #22c55e 28%, var(--border));
  background: color-mix(in oklch, #22c55e 8%, var(--background));
}
.toc-step.is-muted { opacity: 0.55; }
.toc-grid {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.toc-row3 {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: 1fr;
}
.toc-field--full { grid-column: 1 / -1; }
.toc-field.is-disabled { opacity: 0.7; }
@media (max-width: 720px) {
  .toc-grid { grid-template-columns: 1fr; }
}
@media (min-width: 721px) {
  .toc-row3 { grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.7fr) minmax(0, 0.7fr); }
}

/* —— Schedule: view toggle + month calendar (tcal-*) + day board (tsched-*) —— */
.tk-stats--sched {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.tcal-toggle {
  display: inline-flex;
  gap: 0.2rem;
  padding: 0.2rem;
  margin-bottom: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in oklch, var(--muted) 22%, var(--background));
}
.tcal-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 4.75rem;
  padding: 0.4rem 0.85rem;
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.82rem;
  font-weight: 650;
  text-decoration: none;
  color: var(--muted-foreground);
}
.tcal-toggle-btn:hover {
  color: var(--foreground);
  background: color-mix(in oklch, var(--foreground) 4%, transparent);
}
.tcal-toggle-btn.is-active {
  color: var(--foreground);
  background: var(--background);
  box-shadow: 0 1px 2px color-mix(in oklch, var(--foreground) 8%, transparent);
}
.tcal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--background);
}
.tcal-toolbar-mid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  flex: 1;
}
.tcal-month-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.tcal {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--background);
  overflow: hidden;
}
.tcal-head,
.tcal-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}
.tcal-dow {
  padding: 0.55rem 0.4rem;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  border-bottom: 1px solid var(--border);
  background: color-mix(in oklch, var(--muted) 18%, var(--background));
}
.tcal-dow:nth-child(6),
.tcal-dow:nth-child(7) {
  color: color-mix(in oklch, #b45309 55%, var(--muted-foreground));
}
.tcal-week + .tcal-week {
  border-top: 1px solid var(--border);
}
.tcal-cell {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-height: 7.5rem;
  padding: 0.45rem 0.4rem 0.5rem;
  border-right: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  background: var(--background);
  transition: background 0.12s ease;
}
.tcal-cell:nth-child(7n) { border-right: 0; }
.tcal-cell:hover {
  background: color-mix(in oklch, var(--foreground) 3.5%, var(--background));
}
.tcal-cell.is-out {
  background: color-mix(in oklch, var(--muted) 28%, var(--background));
  color: var(--muted-foreground);
}
.tcal-cell.is-out .tcal-day { opacity: 0.45; }
.tcal-cell.is-weekend:not(.is-out) {
  background: color-mix(in oklch, var(--muted) 10%, var(--background));
}
.tcal-cell.is-today {
  background: color-mix(in oklch, var(--foreground) 4.5%, var(--background));
  box-shadow: inset 0 0 0 1.5px color-mix(in oklch, var(--foreground) 28%, var(--border));
}
.tcal-cell.has-high:not(.is-out) {
  background: color-mix(in oklch, #e11d48 4%, var(--background));
}
.tcal-cell-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem;
}
.tcal-day {
  display: inline-grid;
  place-items: center;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.tcal-cell.is-today .tcal-day {
  background: var(--foreground);
  color: var(--background);
}
.tcal-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  background: color-mix(in oklch, var(--foreground) 8%, var(--background));
  border: 1px solid var(--border);
}
.tcal-count.is-alert {
  color: #be123c;
  border-color: color-mix(in oklch, #e11d48 35%, var(--border));
  background: color-mix(in oklch, #e11d48 8%, var(--background));
}
.tcal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
}
.tcal-chip {
  display: inline-flex;
  padding: 0.08rem 0.35rem;
  border-radius: 4px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.35;
  border: 1px solid transparent;
}
.tcal-chip--open {
  color: #1d4ed8;
  background: color-mix(in oklch, #3b82f6 12%, var(--background));
  border-color: color-mix(in oklch, #3b82f6 22%, var(--border));
}
.tcal-chip--done {
  color: #15803d;
  background: color-mix(in oklch, #22c55e 12%, var(--background));
  border-color: color-mix(in oklch, #22c55e 22%, var(--border));
}
.tcal-chip--high {
  color: #be123c;
  background: color-mix(in oklch, #e11d48 10%, var(--background));
  border-color: color-mix(in oklch, #e11d48 25%, var(--border));
}
.tcal-preview {
  margin: 0.1rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.18rem;
}
.tcal-preview li {
  display: grid;
  grid-template-columns: 2.4rem minmax(0, 1fr);
  gap: 0.25rem;
  align-items: baseline;
  padding: 0.15rem 0.25rem;
  border-radius: 4px;
  font-size: 0.68rem;
  line-height: 1.25;
  background: color-mix(in oklch, var(--muted) 22%, var(--background));
  overflow: hidden;
}
.tcal-preview li.is-high {
  background: color-mix(in oklch, #e11d48 8%, var(--background));
}
.tcal-preview li.is-done { opacity: 0.65; }
.tcal-preview time {
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  color: var(--muted-foreground);
}
.tcal-preview span {
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tcal-none {
  margin: auto 0 0;
  font-size: 0.72rem;
  color: color-mix(in oklch, var(--muted-foreground) 55%, transparent);
  text-align: center;
}
.tcal-footnote {
  margin: 0.65rem 0 0;
  font-size: 0.78rem;
  color: var(--muted-foreground);
}
.tcal-footnote code {
  font-size: 0.74rem;
  padding: 0.05rem 0.3rem;
  border-radius: 4px;
  background: color-mix(in oklch, var(--muted) 35%, var(--background));
}

.tsched-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--background);
}
.tsched-bar-mid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  flex: 1 1 16rem;
}
.tsched-date {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.tsched-date strong { font-size: 0.98rem; }
.tsched-pill {
  display: inline-flex;
  padding: 0.16rem 0.45rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 750;
  background: color-mix(in oklch, var(--foreground) 8%, var(--background));
  border: 1px solid var(--border);
}
.tsched-pill--link {
  text-decoration: none;
  color: inherit;
}
.tsched-jump { min-width: 11rem; }
.tsched-jump .ui-datepicker { width: 100%; }
.tsched-nav span { display: inline; }
.tsched-empty {
  padding: 1.5rem 1.1rem 1.35rem;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: color-mix(in oklch, var(--muted) 24%, var(--background));
}
.tsched-empty .ui-empty { margin-bottom: 0.75rem; }
.tsched-empty .ts-quick { justify-content: center; }
.tsched-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  align-items: start;
}
.tsched-col {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in oklch, var(--muted) 12%, var(--background));
  min-width: 0;
}
.tsched-col-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border);
  background: var(--background);
  border-radius: var(--radius) var(--radius) 0 0;
}
.tsched-col-head h3 {
  margin: 0;
  font-size: 0.9rem;
}
.tsched-col-head p {
  margin: 0.1rem 0 0;
  font-size: 0.72rem;
  color: var(--muted-foreground);
}
.tsched-col-count {
  display: inline-grid;
  place-items: center;
  min-width: 1.45rem;
  height: 1.45rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 750;
  background: color-mix(in oklch, var(--muted) 40%, var(--background));
  border: 1px solid var(--border);
}
.tsched-col-body {
  display: grid;
  gap: 0.5rem;
  padding: 0.65rem;
  min-height: 3.5rem;
}
.tsched-col-empty {
  margin: 0;
  padding: 1.1rem 0.5rem;
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted-foreground);
}
.tsched-card {
  display: grid;
  gap: 0.3rem;
  padding: 0.7rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  background: var(--background);
}
.tsched-card.is-done { opacity: 0.72; }
.tsched-card.is-high {
  border-color: color-mix(in oklch, #e11d48 30%, var(--border));
  box-shadow: inset 3px 0 0 color-mix(in oklch, #e11d48 70%, transparent);
}
.tsched-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
}
.tsched-card-time {
  font-size: 0.8rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}
.tsched-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  justify-content: flex-end;
}
.tsched-card-num {
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  text-decoration: none;
}
.tsched-card-title {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.3;
}
.tsched-card-title a {
  color: inherit;
  text-decoration: none;
}
.tsched-card-title a:hover { text-decoration: underline; }
.tsched-card-facts {
  margin: 0.1rem 0 0;
  display: grid;
  gap: 0.22rem;
}
.tsched-card-facts > div {
  display: grid;
  grid-template-columns: 4.25rem minmax(0, 1fr);
  gap: 0.3rem;
  font-size: 0.76rem;
}
.tsched-card-facts dt {
  margin: 0;
  color: var(--muted-foreground);
}
.tsched-card-facts dd {
  margin: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.tsched-card-hint {
  margin: 0.1rem 0 0;
  font-size: 0.76rem;
  color: var(--muted-foreground);
  padding: 0.3rem 0.4rem;
  border-radius: calc(var(--radius) - 4px);
  background: color-mix(in oklch, var(--muted) 28%, var(--background));
}
.tsched-card-hint span {
  font-weight: 750;
  color: var(--foreground);
}
.tsched-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.3rem;
}
@media (max-width: 1100px) {
  .tsched-board { grid-template-columns: 1fr; }
  .tcal-cell { min-height: 6.25rem; }
}
@media (max-width: 820px) {
  .tcal-meta,
  .tcal-preview,
  .tcal-none { display: none; }
  .tcal-cell { min-height: 3.25rem; padding: 0.4rem; }
  .tk-stats--sched { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .tsched-nav span { display: none; }
  .tsched-bar-mid { justify-content: flex-start; }
  .tcal-toggle { width: 100%; }
  .tcal-toggle-btn { flex: 1; }
}

/* Device consoles (OLT ONU / MikroTik PPPoE) */
[x-cloak] { display: none !important; }
.devmgr { display: grid; gap: 0.85rem; }
.devmgr-toolbar {
  display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: space-between; align-items: center;
}
.devmgr-meta { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.devmgr-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.devmgr-filters {
  display: grid; gap: 0.65rem;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  align-items: end;
}
.devmgr-search { grid-column: span 2; }
@media (max-width: 720px) { .devmgr-search { grid-column: auto; } }
.devmgr-hint { font-size: 0.85rem; color: var(--destructive); margin: 0; }
.devmgr-hint.is-muted { color: var(--muted-foreground); }
.devmgr-ping { font-size: 0.75rem; font-weight: 650; padding: 0.15rem 0.5rem; border-radius: 999px; border: 1px solid var(--border); }
.devmgr-ping.is-ok { color: #047857; border-color: color-mix(in oklab, #10b981 40%, var(--border)); }
.devmgr-ping.is-bad { color: var(--destructive); }
.devmgr-tabs { display: flex; gap: 0.15rem; border-bottom: 1px solid var(--border); }
.devmgr-tab {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: none; border: 0; padding: 0.55rem 0.85rem; font-weight: 650; font-size: 0.875rem;
  color: var(--muted-foreground); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.devmgr-tab.is-on { color: var(--foreground); border-bottom-color: var(--foreground); }
.mt-ppp-tab-n {
  min-width: 1.35rem; padding: 0.05rem 0.4rem; border-radius: 999px;
  background: var(--muted); color: var(--muted-foreground);
  font-size: 0.6875rem; font-weight: 700; font-variant-numeric: tabular-nums; text-align: center;
}
.devmgr-tab.is-on .mt-ppp-tab-n { background: color-mix(in oklab, var(--foreground) 10%, var(--muted)); color: var(--foreground); }
.devmgr-table-wrap { overflow: auto; border: 1px solid var(--border); border-radius: 0.75rem; background: var(--background); }
.devmgr-table { width: 100%; margin: 0; }
.devmgr-empty { text-align: center; color: var(--muted-foreground); padding: 1.5rem 0.75rem; }
.devmgr-row-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.15rem; }
.devmgr-row-actions .is-danger { color: var(--destructive); }
.devmgr-cust { display: flex; flex-direction: column; line-height: 1.2; }
.devmgr-form { display: grid; gap: 0.75rem; }
.devmgr-audit { font-size: 0.8rem; color: var(--muted-foreground); }
.devmgr-audit h2 { font-size: 0.85rem; font-weight: 700; color: var(--foreground); margin: 0 0 0.4rem; }
.devmgr-audit ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.25rem; }
.link { color: var(--accent-blue, #2563eb); }

/* MikroTik PPP console (secrets / sessions / audit) */
.mt-ppp { display: grid; gap: 0.85rem; }
.mt-ppp-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  background: var(--card);
  overflow: hidden;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.03);
}
.mt-ppp-metrics--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mt-ppp-metrics--olt { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.mt-ppp-metrics--olt-diff { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.mt-ppp-metrics--olt > .mt-ppp-metric:nth-child(4n),
.mt-ppp-metrics--olt-diff > .mt-ppp-metric:nth-child(4n) { border-right: none; }
.mt-ppp-metrics--olt > .mt-ppp-metric:nth-child(n+5) { border-top: 1px solid var(--border); }
.mt-ppp-metric {
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.15rem;
  padding: 0.85rem 1rem; min-height: 5.75rem; text-align: left;
  border: 0; border-right: 1px solid var(--border);
  background: transparent; color: inherit; cursor: pointer;
}
.mt-ppp-metrics > .mt-ppp-metric:last-child,
.mt-ppp-metrics--3 > .mt-ppp-metric:last-child { border-right: none; }
article.mt-ppp-metric { cursor: default; }
.mt-ppp-metric span {
  font-size: 0.6875rem; font-weight: 650; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--muted-foreground);
}
.mt-ppp-metric strong {
  font-size: 1.45rem; font-weight: 700; letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums; line-height: 1.1;
}
.mt-ppp-metric em {
  font-style: normal; font-size: 0.75rem; color: var(--muted-foreground);
}
.mt-ppp-metric:hover { background: color-mix(in oklch, var(--muted) 45%, var(--card)); }
.mt-ppp-metric.is-on {
  background: color-mix(in oklch, var(--muted) 55%, var(--card));
  box-shadow: inset 0 -2px 0 var(--foreground);
}
.mt-ppp-metric.is-live strong { color: #047857; }
.mt-ppp-metric.is-off strong { color: var(--destructive); }
.mt-ppp-metric.is-warn strong { color: #b45309; }
.mt-ppp-metric.is-ok strong { color: #047857; }
.dark .mt-ppp-metric.is-live strong,
.dark .mt-ppp-metric.is-ok strong { color: #6ee7b7; }
.dark .mt-ppp-metric.is-warn strong { color: #fcd34d; }

.mt-ppp-panel { position: relative; overflow: hidden; }
.mt-ppp-panel.is-busy::after {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: color-mix(in oklab, var(--card) 45%, transparent);
}
.mt-ppp-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.55rem 0.85rem;
  padding: 0.7rem 1rem; border-bottom: 1px solid var(--border);
}
.mt-ppp-bar-copy { min-width: 0; }
.mt-ppp-bar-title { margin: 0; font-size: 0.875rem; font-weight: 700; }
.mt-ppp-bar-desc { margin: 0.1rem 0 0; font-size: 0.75rem; color: var(--muted-foreground); }
.mt-ppp-pon {
  display: flex; align-items: center; gap: 0.5rem; min-width: 0;
}
.mt-ppp-pon-field {
  display: flex; align-items: center; gap: 0.5rem; min-width: 0;
}
.app-content label.mt-ppp-pon-label,
.mt-ppp-pon-label {
  display: block; margin: 0; padding: 0;
  font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted-foreground); line-height: 1; white-space: nowrap;
}
.app-content select.mt-ppp-pon-select.ui-field-control,
.mt-ppp-pon-select {
  width: auto; min-width: 9.5rem; max-width: 12rem;
  height: 2.25rem; min-height: 2.25rem;
}
.mt-ppp-search {
  flex: 0 1 22rem; width: 100%; min-width: 14rem; max-width: 22rem; margin-left: auto;
}
.mt-ppp-search .ui-input {
  appearance: none; -webkit-appearance: none;
}
.mt-ppp-search .ui-input::-webkit-search-decoration,
.mt-ppp-search .ui-input::-webkit-search-cancel-button,
.mt-ppp-search .ui-input::-webkit-search-results-button,
.mt-ppp-search .ui-input::-webkit-search-results-decoration { display: none; }
.mt-ppp-count {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.28rem;
  margin: 0; height: 2.25rem; padding: 0 0.7rem;
  border: 1px solid var(--border); border-radius: 0.5rem;
  background: color-mix(in oklab, var(--muted) 72%, var(--card));
  font-size: 0.75rem; font-weight: 650; color: var(--muted-foreground);
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
.mt-ppp-count-sep { opacity: 0.42; font-weight: 550; }

.mt-ppp-sheet {
  min-width: 0;
  max-height: min(36rem, calc(100vh - 22rem));
  overflow: auto;
}
.mt-ppp-cols {
  display: grid;
  grid-template-columns: minmax(12rem, 1.5fr) 7.25rem minmax(10rem, 1.1fr) 8.5rem 2.5rem;
  gap: 0.75rem; align-items: center;
  min-width: 44rem; padding: 0 1rem;
}
.mt-ppp-cols--sess {
  grid-template-columns: minmax(11rem, 1.2fr) 8.5rem 8rem 6.5rem minmax(9rem, 1fr) 4.75rem;
  min-width: 52rem;
}
.mt-ppp-cols--olt {
  grid-template-columns: minmax(12rem, 1.5fr) 8.5rem minmax(11rem, 1.2fr) 5.5rem 2.5rem;
  min-width: 48rem;
}
.mt-ppp-cols--gap {
  grid-template-columns: 7.5rem minmax(10rem, 1fr) minmax(10rem, 1.1fr) minmax(12rem, 1.3fr);
  min-width: 48rem;
}
.mt-ppp-cols--head {
  position: sticky; top: 0; z-index: 1;
  min-height: 2.15rem; border-bottom: 1px solid var(--border);
  background: color-mix(in oklab, var(--muted) 55%, var(--card));
  font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--muted-foreground);
}
.mt-ppp-virt { position: relative; }
.mt-ppp-window { will-change: transform; contain: layout style; }
.mt-ppp-list { min-width: 0; }
.mt-ppp-row {
  min-height: 3.5rem; height: 3.5rem;
  border-bottom: 1px solid color-mix(in oklch, var(--border) 80%, transparent);
}
.mt-ppp-row:hover { background: color-mix(in oklch, var(--muted) 40%, var(--card)); }
.mt-ppp-row.is-off { background: color-mix(in oklch, #e11d48 4%, var(--card)); }
.mt-ppp-row.is-live .mt-ppp-dot {
  background: #10b981; opacity: 1;
  box-shadow: 0 0 0 3px color-mix(in oklab, #10b981 25%, transparent);
}
.mt-ppp-row.is-off .mt-ppp-dot { background: var(--destructive); opacity: 1; }
.mt-ppp-user { min-width: 0; display: grid; gap: 0.1rem; }
.mt-ppp-user strong {
  font-size: 0.8125rem; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mt-ppp-user span {
  font-size: 0.72rem; color: var(--muted-foreground);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mt-ppp-status {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.75rem; font-weight: 650; min-width: 0;
}
.mt-ppp-status > div { display: grid; gap: 0.02rem; min-width: 0; }
.mt-ppp-status em {
  font-style: normal; font-size: 0.65rem; font-weight: 550; color: var(--muted-foreground);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mt-ppp-dot {
  width: 0.45rem; height: 0.45rem; border-radius: 999px;
  background: var(--muted-foreground); opacity: 0.4; flex: 0 0 auto;
}
.mt-ppp-cust { min-width: 0; display: grid; gap: 0.08rem; }
.mt-ppp-cust strong {
  font-size: 0.8125rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mt-ppp-cust span {
  font-size: 0.7rem; color: var(--muted-foreground); text-transform: capitalize;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mt-ppp-cust.is-ok strong { color: #047857; }
.mt-ppp-cust.is-warn strong { color: #b45309; }
.mt-ppp-cust.is-mute strong { color: var(--muted-foreground); font-weight: 550; }
.dark .mt-ppp-cust.is-ok strong { color: #6ee7b7; }
.dark .mt-ppp-cust.is-warn strong { color: #fcd34d; }
.mt-ppp-profile span,
.mt-ppp-up,
.mt-ppp-mono {
  font-size: 0.75rem; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mt-ppp-profile span {
  display: inline-block; max-width: 100%;
  padding: 0.15rem 0.45rem; border-radius: 999px;
  background: var(--muted); color: var(--foreground);
}
.mt-ppp-act { display: flex; justify-content: flex-end; }
.mt-ppp-more {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.85rem; height: 1.85rem; padding: 0;
  border: 0; border-radius: 0.45rem; background: transparent; color: var(--muted-foreground); cursor: pointer;
}
.mt-ppp-more svg { width: 1rem; height: 1rem; }
.mt-ppp-more:hover,
.mt-ppp-more[aria-expanded="true"] { background: var(--muted); color: var(--foreground); }
.mt-ppp-empty {
  display: grid; place-items: center; gap: 0.25rem;
  min-height: 10rem; padding: 2rem 1rem; text-align: center; color: var(--muted-foreground);
}
.mt-ppp-empty strong { color: var(--foreground); font-size: 0.9rem; }
.mt-ppp-empty p { margin: 0; font-size: 0.8rem; max-width: 22rem; }

.mt-ppp-menu {
  position: fixed; z-index: 80; width: 12.25rem;
  padding: 0.25rem; border: 1px solid var(--border); border-radius: calc(var(--radius) - 2px);
  background: var(--popover); color: var(--popover-foreground);
  box-shadow: 0 10px 28px rgb(0 0 0 / 0.12);
}
.mt-ppp-menu-head {
  margin: 0; padding: 0.4rem 0.55rem 0.3rem;
  font-size: 0.7rem; color: var(--muted-foreground);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.mt-ppp-audit {
  margin: 0; padding: 0.35rem 0 0.6rem; list-style: none;
  display: grid; max-height: min(36rem, calc(100vh - 20rem)); overflow: auto;
}
.mt-ppp-audit-item {
  display: grid; grid-template-columns: 1.5rem 1fr; gap: 0.65rem;
  padding: 0.7rem 1.15rem; position: relative;
}
.mt-ppp-audit-item + .mt-ppp-audit-item::before {
  content: ""; position: absolute; left: calc(1.15rem + 0.28rem); top: 0; bottom: 50%;
  width: 1px; background: var(--border);
}
.mt-ppp-audit-mark {
  width: 0.6rem; height: 0.6rem; margin-top: 0.35rem; border-radius: 999px;
  background: var(--muted-foreground); opacity: 0.45;
}
.mt-ppp-audit-item.is-ok .mt-ppp-audit-mark { background: #10b981; opacity: 1; }
.mt-ppp-audit-item.is-info .mt-ppp-audit-mark { background: #3b82f6; opacity: 1; }
.mt-ppp-audit-item.is-warn .mt-ppp-audit-mark { background: #f59e0b; opacity: 1; }
.mt-ppp-audit-item.is-bad .mt-ppp-audit-mark { background: var(--destructive); opacity: 1; }
.mt-ppp-audit-body { min-width: 0; display: grid; gap: 0.15rem; }
.mt-ppp-audit-top {
  display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem;
}
.mt-ppp-audit-top strong { font-size: 0.8125rem; font-weight: 700; }
.mt-ppp-audit-top time { font-size: 0.72rem; color: var(--muted-foreground); white-space: nowrap; }
.mt-ppp-audit-detail {
  margin: 0; display: flex; flex-wrap: wrap; gap: 0.35rem 0.65rem;
  font-size: 0.78rem; color: var(--foreground);
}
.mt-ppp-audit-who { color: var(--muted-foreground); }

@media (max-width: 960px) {
  .mt-ppp-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mt-ppp-metrics--3 { grid-template-columns: 1fr; }
  .mt-ppp-metric { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
  .mt-ppp-metrics > .mt-ppp-metric:nth-child(2n) { border-right: none; }
  .mt-ppp-search { max-width: none; margin-left: 0; }
  .mt-ppp-pon { width: 100%; }
  .mt-ppp-pon-field { flex: 1 1 auto; }
  .app-content select.mt-ppp-pon-select.ui-field-control,
  .mt-ppp-pon-select { max-width: none; width: 100%; }
}

/* MikroTik live capacity (Traffic tab) */
.mt-cap { display: grid; gap: 0.85rem; }
.mt-cap-toolbar {
  display: flex; flex-wrap: wrap; gap: 0.65rem 0.85rem; align-items: end;
}
.mt-cap-iface { min-width: 16rem; flex: 1 1 16rem; }
.mt-cap-live {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.75rem; font-weight: 650; padding: 0.35rem 0.65rem;
  border-radius: 999px; border: 1px solid var(--border); color: var(--muted-foreground);
  margin-bottom: 0.15rem;
}
.mt-cap-dot {
  width: 0.45rem; height: 0.45rem; border-radius: 999px;
  background: var(--muted-foreground); opacity: 0.45;
}
.mt-cap-live.is-on { color: #047857; border-color: color-mix(in oklab, #10b981 40%, var(--border)); }
.mt-cap-live.is-on .mt-cap-dot { background: #10b981; opacity: 1; box-shadow: 0 0 0 3px color-mix(in oklab, #10b981 25%, transparent); }
.mt-cap-live.is-bad { color: var(--destructive); }
.mt-cap-live.is-bad .mt-cap-dot { background: var(--destructive); opacity: 1; }
.dark .mt-cap-live.is-on { color: #6ee7b7; }
.mt-cap .dash-exec-seg-btn {
  background: none; border: 0; cursor: pointer; font: inherit;
}
.mt-cap-toolbar-actions { display: flex; gap: 0.35rem; margin-left: auto; }
.mt-cap-panel { overflow: hidden; }
.mt-cap-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-bottom: 1px solid var(--border);
}
.mt-cap-metric {
  display: flex; flex-direction: column; gap: 0.2rem;
  padding: 0.9rem 1rem; min-height: 7.25rem;
  border-right: 1px solid var(--border);
}
.mt-cap-metric:last-child { border-right: none; }
.mt-cap-metric header {
  display: flex; align-items: center; gap: 0.4rem;
  font-size: 0.6875rem; font-weight: 650; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--muted-foreground);
}
.mt-cap-value {
  margin: 0.1rem 0 0; font-size: 1.35rem; font-weight: 700;
  letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1.15;
}
.mt-cap-meta { margin: 0; font-size: 0.75rem; color: var(--muted-foreground); }
.mt-cap-badge {
  margin-left: auto; font-size: 0.625rem; font-weight: 700;
  padding: 0.1rem 0.35rem; border-radius: 999px;
  background: var(--muted); color: var(--muted-foreground);
}
.mt-cap-metric.is-good .mt-cap-badge { background: color-mix(in oklch, #22c55e 14%, var(--muted)); color: #15803d; }
.mt-cap-metric.is-warn .mt-cap-badge { background: color-mix(in oklch, #f59e0b 14%, var(--muted)); color: #b45309; }
.mt-cap-metric.is-critical .mt-cap-badge { background: color-mix(in oklch, #e11d48 14%, var(--muted)); color: #be123c; }
.dark .mt-cap-metric.is-good .mt-cap-badge { color: #6ee7b7; }
.dark .mt-cap-metric.is-warn .mt-cap-badge { color: #fcd34d; }
.dark .mt-cap-metric.is-critical .mt-cap-badge { color: #fda4af; }
.mt-cap-chart-wrap { position: relative; padding: 0.5rem 0.65rem 0.75rem; }
.mt-cap-chart { display: block; width: 100%; height: 16.5rem; }
.mt-cap-tooltip {
  position: absolute; top: 0.75rem; pointer-events: none;
  min-width: 8.5rem; padding: 0.4rem 0.55rem;
  border: 1px solid var(--border); border-radius: 0.5rem;
  background: color-mix(in oklab, var(--card) 92%, transparent);
  box-shadow: 0 8px 20px rgb(0 0 0 / 0.08);
  font-size: 0.7rem; display: grid; gap: 0.12rem;
}
.mt-cap-tooltip strong { font-variant-numeric: tabular-nums; }
.mt-cap-facts {
  display: grid; gap: 0.85rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.mt-cap-dl {
  display: grid; gap: 0; margin: 0; padding: 0.15rem 0;
}
.mt-cap-dl > div {
  display: grid; grid-template-columns: 8.5rem 1fr; gap: 0.65rem;
  padding: 0.45rem 1.15rem; border-bottom: 1px solid color-mix(in oklch, var(--border) 80%, transparent);
  font-size: 0.8125rem;
}
.mt-cap-dl > div:last-child { border-bottom: none; }
.mt-cap-dl dt { margin: 0; color: var(--muted-foreground); font-weight: 550; }
.mt-cap-dl dd { margin: 0; font-weight: 600; }
.mt-cap-dl dd.is-bad { color: var(--destructive); }
@media (max-width: 960px) {
  .mt-cap-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mt-cap-metric:nth-child(2n) { border-right: none; }
  .mt-cap-facts { grid-template-columns: 1fr; }
  .mt-cap-chart { height: 13rem; }
}
