/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Base ────────────────────────────────────────────────── */
html { font-size: 16px; }

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: var(--text-primary);
  background: var(--bg-base);
  display: grid;
  grid-template-rows: var(--header-height) 1fr;
  grid-template-columns: var(--sidebar-width) 1fr;
  grid-template-areas:
    "header header"
    "sidebar main";
  width: 100vw;
  height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Grid area assignments for direct body children */
#app-header  { grid-area: header; }
#app-sidebar { grid-area: sidebar; overflow: hidden; }

/* ── Header ──────────────────────────────────────────────── */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-6);
  height: 100%;
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-border);
  z-index: 10;
}

.app-header__title {
  font-size: var(--text-md);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-primary);
}

.app-header__title span {
  color: var(--accent-primary);
}

.app-header__meta {
  display: flex;
  align-items: center;
  gap: var(--space-5);
}

.app-header__locale {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  text-transform: uppercase;
  padding: 3px var(--space-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.app-header__user {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
  height: 100%;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Brand */
.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}

.sidebar__brand-hex { flex-shrink: 0; filter: drop-shadow(0 0 6px color-mix(in srgb, var(--accent-primary) 40%, transparent)); }

.sidebar__brand-text { display: flex; flex-direction: column; line-height: 1.1; }

.sidebar__brand-name {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: #F1F5F9;
}

.sidebar__brand-tag {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--accent-primary);
  text-transform: uppercase;
}

/* Nav body — scrollable container for all sections */
.sidebar__nav-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: var(--space-3);
}

/* Section label */
.sidebar__section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--sidebar-text);
  padding: 14px 20px 4px;
  flex-shrink: 0;
}

/* Nav list — no longer needs flex or overflow (nav-body handles it) */
.sidebar__list {
  list-style: none;
  padding: 2px 10px;
}

.sidebar__item {
  margin-bottom: 2px;
}

.sidebar__link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 18px;
  font-weight: 500;
  border-radius: 8px;
  position: relative;
  transition: background .15s ease, color .15s ease, transform .15s ease;
  overflow: hidden;
}

.sidebar__link:hover {
  background: rgba(255,255,255,.045);
  color: var(--sidebar-text-hover);
  transform: translateX(2px);
}

.sidebar__link:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--sidebar-accent);
}

.sidebar__link.active {
  background: transparent;
  color: var(--sidebar-text-active);
  font-weight: 600;
}

.sidebar__link.active:hover {
  background: rgba(255,255,255,.045);
}

.sidebar__link.active .sidebar__icon {
  color: var(--sidebar-accent);
}

/* Thin cyan line — the primary active indicator */
.sidebar__active-pip {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  height: 16px;
  border-radius: 0 2px 2px 0;
  background: var(--sidebar-accent);
  box-shadow: 0 0 8px color-mix(in srgb, var(--sidebar-accent) 60%, transparent);
}

.sidebar__icon {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: inherit;
}

.sidebar__label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Profile card */
.sidebar__profile {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 14px 14px 16px;
  border-top: 1px solid var(--sidebar-border);
  background: var(--sidebar-surface);
  flex-shrink: 0;
}

.sb-prof-av-wrap { position: relative; flex-shrink: 0; }

.sb-prof-av {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: -0.02em;
  box-shadow: 0 0 0 2px var(--sidebar-border);
}

.sb-prof-dot {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--status-success);
  border: 2px solid var(--sidebar-surface);
  ;
}

.sb-prof-info { flex: 1; min-width: 0; }

.sb-prof-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--sidebar-text-active);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sb-prof-role {
  font-size: 11px;
  color: var(--sidebar-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.sb-prof-btn {
  background: none;
  border: none;
  color: var(--sidebar-text);
  cursor: pointer;
  padding: 5px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  transition: color 0.12s, background 0.12s;
  flex-shrink: 0;
}

.sb-prof-btn:hover {
  color: var(--status-danger);
  background: rgba(168,84,74,0.08);
}

/* Gradient avatar utility (shared across pages) */
.grad-av {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: -0.02em;
}

/* ── Main ────────────────────────────────────────────────── */
#app-main {
  grid-area: main;
  padding: var(--space-8);
  overflow-y: auto;
}

.content-wrap {
  max-width: 1600px;
  margin: 0 auto;
}

/* ── Page header ─────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}
.page-header .page-title {
  margin-bottom: 0;
  flex: 1;
}

/* ── Page title ──────────────────────────────────────────── */
.page-title {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: var(--space-8);
}

/* ── Detail panel header ─────────────────────────────────── */
.detail-panel__header {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
}
.detail-panel__header .company-detail__name {
  flex: 1;
  margin-bottom: 0;
}
.detail-panel__actions {
  display: flex;
  gap: var(--space-2);
  flex-shrink: 0;
  flex-wrap: wrap;
}

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
}

.card--glass {
  background: var(--glass-bg);
  border-color: var(--glass-border);
}

/* ── Metric cards ────────────────────────────────────────── */
.metric-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  min-height: 120px;  /* was fixed 140px — caused clipping on smaller viewports */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.metric-card__label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.metric-card__value {
  font-size: 36px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1;
}

/* ── Dashboard layout ────────────────────────────────────── */
.dashboard__title {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: var(--space-8);
}

.dashboard__metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-5);
  margin-bottom: var(--space-8);
}

.dashboard__section {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin-bottom: var(--space-5);
}

.dashboard__section-title {
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-5);
}

.dashboard__placeholder {
  color: var(--text-muted);
  font-size: var(--text-sm);
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 9px var(--space-5);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 500;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
  white-space: nowrap;
  line-height: 1;
}

.btn--primary {
  background: var(--accent-primary);
  color: var(--text-inverse);
  border-color: var(--accent-primary);
}
.btn--primary:hover {
  background: var(--accent-primary-dk);
  border-color: var(--accent-primary-dk);
}

.btn--secondary {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border);
}
.btn--secondary:hover {
  background: var(--bg-primary);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.btn--danger {
  background: transparent;
  color: var(--color-danger);
  border-color: rgba(168,84,74,0.4);
}
.btn--danger:hover {
  background: rgba(168,84,74,0.08);
  border-color: var(--color-danger);
}

.btn--sm { padding: 5px var(--space-3); font-size: var(--text-xs); }
.btn--lg { padding: 12px var(--space-8); font-size: var(--text-base); }

/* ── Forms ───────────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}

.form-label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
}

.form-input,
.form-select,
.form-textarea {
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px var(--space-3);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--text-primary);
  transition: border-color var(--transition);
  width: 100%;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--border-focus);
}

.form-input::placeholder,
.form-textarea::placeholder { color: var(--text-muted); }

.form-textarea { resize: vertical; min-height: 100px; }

.form-stack { display: flex; flex-direction: column; }

/* ── Tables ──────────────────────────────────────────────── */
.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.table th {
  padding: var(--space-3) var(--space-5);
  text-align: left;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

.table td {
  padding: var(--space-3) var(--space-5);
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-subtle);
}

.table tbody tr:hover td {
  background: var(--accent-surface);
}

/* ── Page wrapper ────────────────────────────────────────── */
.page {
  max-width: 1600px;
  margin: 0 auto;
}

/* ── Modal ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.modal-overlay--visible {
  opacity: 1;
}
.modal {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  width: 100%;
  outline: none;
  transform: translateY(8px);
  transition: transform 0.15s ease;
}
.modal-overlay--visible .modal {
  transform: translateY(0);
}
.modal--sm { max-width: 400px; }
.modal--md { max-width: 600px; }
.modal--lg { max-width: 900px; }

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-6) var(--space-8);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}
.modal__title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-primary);
}
.modal__dismiss {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: var(--text-base);
  line-height: 1;
  padding: var(--space-1);
  border-radius: var(--radius-sm);
  transition: color 0.1s;
}
.modal__dismiss:hover { color: var(--text-primary); }

.modal__body {
  padding: var(--space-6) var(--space-8);
  overflow-y: auto;
  flex: 1;
  color: var(--text-primary);
}
.modal__message {
  color: var(--text-secondary);
  line-height: 1.6;
}

.modal__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: var(--space-5) var(--space-8);
  border-top: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

/* ── Toast ───────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: var(--space-8);
  right: var(--space-8);
  z-index: 1100;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-panel);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  min-width: 280px;
  max-width: 420px;
  pointer-events: all;
  opacity: 0;
  transform: translateX(16px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast--visible {
  opacity: 1;
  transform: translateX(0);
}
.toast--success { border-left: 3px solid var(--color-success); }
.toast--error   { border-left: 3px solid var(--color-danger);  }
.toast--warning { border-left: 3px solid var(--color-warning); }
.toast--info    { border-left: 3px solid var(--accent-primary); }

.toast__icon {
  font-size: var(--text-base);
  flex-shrink: 0;
}
.toast--success .toast__icon { color: var(--color-success); }
.toast--error   .toast__icon { color: var(--color-danger);  }
.toast--warning .toast__icon { color: var(--color-warning); }
.toast--info    .toast__icon { color: var(--accent-primary); }

.toast__message {
  flex: 1;
  font-size: var(--text-sm);
  color: var(--text-primary);
  line-height: 1.5;
}
.toast__close {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: var(--text-sm);
  padding: 0;
  flex-shrink: 0;
  transition: color 0.1s;
}
.toast__close:hover { color: var(--text-primary); }

/* ── Toolbar ─────────────────────────────────────────────── */
.toolbar {
  display: flex;
  align-items: flex-end;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
}
.toolbar__actions { display: flex; align-items: center; gap: var(--space-3); margin-left: auto; }

.filter-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.form-input--sm,
.form-select--sm {
  padding: 7px var(--space-3);
  font-size: var(--text-sm);
  height: 36px;
}

.form-input--sm { min-width: 220px; }
.form-select--sm { min-width: 140px; }

/* ── States: empty ───────────────────────────────────────── */
.state-empty {
  padding: var(--space-10) var(--space-6);
  color: var(--text-muted);
  font-size: var(--text-sm);
  text-align: center;
}

/* ── Users layout ────────────────────────────────────────── */
.users-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
}

.users-layout:has(.company-detail),
.users-layout:has(.detail-panel--open),
.users-layout--panel-open {
  grid-template-columns: 1fr 320px;
}

/* Первая колонка сетки обязана уметь сжиматься: без min-width:0 grid-элемент
   не уходит ниже min-content таблицы, и карточка справа уезжает за край окна
   (на 1440px было видно 84px из 320px). Горизонтальная прокрутка таблицы уже
   есть в .core-table-wrap. */
.users-layout:has(.company-detail) > :first-child,
.users-layout:has(.detail-panel--open) > :first-child,
.users-layout--panel-open > :first-child {
  min-width: 0;
}

tbody tr[data-id] { cursor: pointer; }
tbody tr.row--active td { background: var(--accent-surface); }

/* ── Table row link ─────────────────────────────────────── */
.row-link {
  color: var(--text-primary);
  text-decoration: none;
}
.row-link:hover { color: var(--accent-primary); }

/* ── Ticket detail ───────────────────────────────────────── */
.ticket-detail__back { margin-bottom: var(--space-5); }

.ticket-section {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin-bottom: var(--space-5);
}

.ticket-section__title {
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-5);
}

.ticket-description {
  margin-top: var(--space-5);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border-subtle);
}

.ticket-description__label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-secondary);
  margin-bottom: var(--space-3);
}

.ticket-description__body {
  font-size: var(--text-sm);
  color: var(--text-primary);
  line-height: 1.7;
  white-space: pre-wrap;
}

.ticket-comment {
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--border-subtle);
}

.ticket-comment:last-child { border-bottom: none; }

.ticket-comment__meta {
  display: flex;
  gap: var(--space-4);
  align-items: baseline;
  margin-bottom: var(--space-2);
}

.ticket-comment__author {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
}

.ticket-comment__body {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.6;
}

.attachment-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: var(--text-sm);
  color: var(--text-primary);
}

.attachment-row:last-child { border-bottom: none; }

/* ── Company cards ───────────────────────────────────────── */
.companies-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
}

.companies-layout:has(.company-detail) {
  grid-template-columns: 1fr 360px;
}

.company-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-4);
  align-content: start;
}

.company-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: border-color 0.15s, transform 0.15s;
  --co-accent: #6B7280;
}

.company-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--co-accent);
}

.company-card:hover {
  border-color: var(--co-accent);
  transform: translateY(-1px);
}

.company-card--active {
  border-color: var(--co-accent);
  background: var(--bg-panel-hover);
}

.company-card__top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px 12px 18px;
}

.company-card__avatar {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--co-accent) 15%, transparent);
  color: var(--co-accent);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.company-card__avatar--img {
  object-fit: contain;
  border: 1px solid var(--border-subtle);
}

.company-card__info {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.company-card__name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.company-card__tier {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--co-accent);
}

.company-card__tier-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--co-accent);
  flex-shrink: 0;
}

.company-card__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--border-subtle);
}

.company-card__stat {
  padding: 10px 8px;
  text-align: center;
  border-right: 1px solid var(--border-subtle);
}

.company-card__stat:last-child {
  border-right: none;
}

.company-card__stat-val {
  display: block;
  font-size: 18px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.2;
}

.company-card__stat-lbl {
  display: block;
  font-size: 10px;
  color: var(--text-tertiary);
  margin-top: 2px;
  letter-spacing: 0.02em;
}

.company-card__meta {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Company detail panel ────────────────────────────────── */
.company-detail {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  align-self: start;
  /* Without this, the panel sits at the top of the grid track (aligned with
     the table's first row) instead of the viewport — scroll a long list and
     open a detail, and it renders off-screen above with no visual sign a
     click even worked. Same fix .detail-panel already has. */
  position: sticky;
  top: 64px;
  max-height: calc(100vh - 84px);
  overflow-y: auto;
}

.company-detail__name {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-5);
}

.detail-key {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  width: 40%;
  padding-right: var(--space-3);
}

/* ── States: loading / error ─────────────────────────────── */
.state-loading {
  padding: var(--space-10) var(--space-6);
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.state-error {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-6);
  background: rgba(168,84,74,0.07);
  border: 1px solid rgba(168,84,74,0.2);
  border-radius: var(--radius-lg);
  color: var(--color-danger);
  font-size: var(--text-sm);
}
.state-error__actions { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }

.state-error--permission {
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
  background: var(--surface-secondary);
  border-color: var(--border-default);
  color: var(--text-t2);
}
.state-error__hint { font-size: var(--text-xs); color: var(--text-t4); }

.activity-row {
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: var(--text-sm);
  color: var(--text-primary);
}

.activity-row:last-child { border-bottom: none; }

/* ── Badges ──────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px var(--space-2);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
}
.badge--success { background: var(--status-success-bg); color: var(--status-success); border: 1px solid color-mix(in srgb, var(--status-success) 25%, transparent); }
.badge--warning { background: var(--status-warning-bg); color: var(--status-warning); border: 1px solid color-mix(in srgb, var(--status-warning) 28%, transparent); }
.badge--danger  { background: var(--status-danger-bg);  color: var(--status-danger);  border: 1px solid color-mix(in srgb, var(--status-danger) 25%, transparent); }
.badge--primary { background: var(--accent-surface);    color: var(--accent-primary); border: 1px solid color-mix(in srgb, var(--accent-primary) 28%, transparent); }
.badge--muted   { background: var(--status-neutral-bg); color: var(--text-muted);     border: 1px solid var(--border-subtle); }

/* ── Utility ─────────────────────────────────────────────── */
.hidden      { display: none !important; }
.sr-only     { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.text-muted  { color: var(--text-secondary); }
.text-danger { color: var(--color-danger); }
.text-success{ color: var(--color-success); }

/* ═══════════════════════════════════════════════════════════
   SPRINT 2 — PAGINATION
   ═══════════════════════════════════════════════════════════ */

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) 0;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.pagination__info {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  min-width: 90px;
}

.pagination__controls {
  display: flex;
  align-items: center;
  gap: 3px;
}

.pagination__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 var(--space-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  cursor: pointer;
  transition: all var(--transition);
  line-height: 1;
}

.pagination__btn:hover:not(:disabled):not(.pagination__btn--active) {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  background: var(--accent-surface);
}

.pagination__btn--active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: var(--text-inverse);
  font-weight: 600;
}

.pagination__btn--nav {
  min-width: 60px;
  padding: 0 var(--space-3);
}

.pagination__btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.pagination__ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 32px;
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.pagination__size {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.pagination__size-label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════
   SPRINT 2 — GLOBAL SEARCH
   ═══════════════════════════════════════════════════════════ */

.gs-backdrop {
  position: fixed;
  inset: 0;
  background: var(--surface-overlay);
  z-index: 200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 80px;
  animation: gs-in 0.12s ease;
}

@keyframes gs-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.gs-modal {
  width: 100%;
  max-width: 600px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: gs-slide-in 0.12s ease;
}

@keyframes gs-slide-in {
  from { transform: translateY(-10px); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}

.gs-input-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border);
}

.gs-input-icon {
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
}

.gs-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--text-md);
  caret-color: var(--accent-primary);
}

.gs-input::placeholder { color: var(--text-muted); }

.gs-kbd {
  display: inline-flex;
  align-items: center;
  font-size: var(--text-xs);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 7px;
  font-family: var(--font-mono);
  flex-shrink: 0;
  line-height: 18px;
}

.gs-results {
  max-height: 400px;
  overflow-y: auto;
  padding: var(--space-2) 0;
}

.gs-empty {
  text-align: center;
  padding: var(--space-8);
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.gs-group-label {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: var(--space-3) var(--space-5) var(--space-1);
  margin-top: var(--space-1);
}

.gs-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  cursor: pointer;
  transition: background var(--transition);
}

.gs-item:hover,
.gs-item--focused {
  background: var(--accent-surface);
}

.gs-item__icon {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  background: var(--accent-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.gs-item__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.gs-item__title {
  font-size: var(--text-sm);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gs-item__sub {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gs-footer {
  display: flex;
  gap: var(--space-5);
  padding: var(--space-3) var(--space-5);
  border-top: 1px solid var(--border);
  background: var(--surface-overlay);
}

.gs-hint {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════
   SPRINT 2 — REPORTS
   ═══════════════════════════════════════════════════════════ */

.rpt-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: var(--space-6);
  align-items: start;
}

.rpt-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
}

.rpt-nav__item {
  display: block;
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  text-align: left;
  cursor: pointer;
  transition: all var(--transition);
  line-height: 1.4;
}

.rpt-nav__item:hover {
  background: var(--accent-surface);
  color: var(--text-primary);
}

.rpt-nav__item--active {
  background: var(--accent-surface);
  border-color: color-mix(in srgb, var(--accent-primary) 20%, transparent);
  color: var(--accent-primary);
  font-weight: 600;
}

.rpt-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.rpt-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}

.rpt-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-6);
  gap: var(--space-4);
  flex-wrap: wrap;
}

.rpt-card__title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-primary);
}

.rpt-card__toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.rpt-actions {
  display: flex;
  gap: var(--space-2);
}

.rpt-chart-wrap {
  position: relative;
  height: 360px;
}

.rpt-period-toggle {
  display: flex;
  gap: 2px;
  padding: 3px;
  background: var(--surface-overlay);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.rpt-period-btn {
  padding: 4px 14px;
  border-radius: 4px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  cursor: pointer;
  transition: all var(--transition);
  line-height: 1.5;
}

.rpt-period-btn:hover { color: var(--text-primary); }

.rpt-period-btn--active {
  background: var(--accent-primary);
  color: var(--text-inverse);
  font-weight: 600;
}

/* SLA summary row */
.rpt-sla-summary {
  display: flex;
  gap: var(--space-8);
  margin-bottom: var(--space-5);
  padding: var(--space-5);
  background: var(--surface-overlay);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
}

.rpt-sla-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rpt-sla-num {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
}

.rpt-sla-label {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

/* ════���══════════════════════════════════════════════════════
   SPRINT 3 — COMMERCIAL / BILLING
   ═══════════════════════════════════════════════════════════ */

/* ── Plan badge ───────────────────────────────────────────── */
.plan-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid;
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: 0.1em;
}
.plan-badge--sm {
  padding: 2px 9px;
  font-size: 10px;
}

/* ── Plan card grid ───────────────────────────────────────── */
.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-5);
}

.plan-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.plan-card:hover {
  border-color: color-mix(in srgb, var(--accent-primary) 25%, transparent);
  box-shadow: 0 4px 24px rgba(0,0,0,0.35);
}

.plan-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.plan-card__pricing {
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.plan-price {
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}
.plan-price__unit {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.plan-limits {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--surface-overlay);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
}
.plan-limit {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.plan-limit__val {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-primary);
}
.plan-limit__label {
  font-size: 10px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.plan-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: var(--space-1);
}
.plan-features--compact { gap: 4px; }

.plan-feature {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--text-sm);
  color: var(--text-secondary);
}
.plan-feature__check {
  color: var(--color-success);
  font-weight: 700;
  flex-shrink: 0;
  font-size: 12px;
}

/* ── Usage bar ────────────────────────────────────────────── */
.usage-bar {
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  overflow: hidden;
}
.usage-bar__fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}
.usage-bar__fill--ok     { background: var(--color-success); }
.usage-bar__fill--warn   { background: var(--color-warning); }
.usage-bar__fill--danger { background: var(--color-danger);  }

/* ── Subscription table cell ──────────────────────────────── */
.sub-usage-cell {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 160px;
}
.sub-usage-text {
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

/* ── Customer cards ───────────────────────────────────────── */
.cust-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  flex: 1;
  min-width: 0;
}

.cust-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.cust-card:hover    { background: var(--bg-panel-hover); }
.cust-card--active  { border-color: color-mix(in srgb, var(--accent-primary) 40%, transparent); background: var(--bg-subtle); }

.cust-card__header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.cust-card__info   { flex: 1; min-width: 0; }
.cust-card__name   { font-weight: 600; font-size: var(--text-sm); color: var(--text-primary); }
.cust-card__mrr    { font-size: var(--text-md); font-weight: 700; color: var(--accent-primary); white-space: nowrap; }
.cust-card__no-sub { font-size: var(--text-xs); color: var(--text-muted); }

.cust-usage { display: flex; flex-direction: column; gap: 5px; }
.cust-usage__numbers {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-xs);
  color: var(--text-secondary);
}
.cust-overlimit { font-size: var(--text-xs); }

/* ── Revenue KPI row ──────────────────────────────────────── */
.rev-kpi-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
  margin-bottom: var(--space-5);
}

.rev-kpi {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-left: 3px solid;
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
}
.rev-kpi__label {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}
.rev-kpi__value {
  font-size: var(--text-2xl);
  font-weight: 800;
  line-height: 1.1;
}
.rev-kpi__sub {
  font-size: var(--text-xs);
  margin-top: var(--space-1);
}

.rev-charts-row {
  display: flex;
  gap: var(--space-5);
  margin-bottom: var(--space-5);
}

/* ── Dashboard subscription widget ───────────────────────── */
.dash-sub-widget {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  padding: var(--space-4) var(--space-6);
  background: var(--accent-surface);
  border: 1px solid color-mix(in srgb, var(--accent-primary) 15%, transparent);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-5);
  flex-wrap: wrap;
}
.dash-sub-widget__left {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}
.dash-sub-widget__label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.dash-sub-widget__center {
  flex: 1;
  min-width: 200px;
}
.dash-sub-widget__numbers {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: 5px;
}
.dash-sub-widget__pct {
  font-size: var(--text-xl);
  font-weight: 800;
  line-height: 1;
  flex-shrink: 0;
}

/* ════════════════════════════════════════════════════════════
   SPRINT 4 — MTR & INVENTORY FOUNDATION
   ════════════════════════════════════════════════════════════ */

/* ── Utility ──────────────────────────────────────────────── */
.mono {
  font-family: var(--font-mono);
  font-size: 0.85em;
  letter-spacing: 0.03em;
}

.cell-primary {
  font-size: var(--text-sm);
  color: var(--text-primary);
  font-weight: 500;
  line-height: 1.3;
}

.cell-sub {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  line-height: 1.3;
  margin-top: 2px;
}

/* ── Form row (two columns) ───────────────────────────────── */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

/* ── Detail panel — Sprint 4 extended ────────────────────── */
.detail-panel {
  display: flex;
  flex-direction: column;
  align-self: start;
  position: sticky;
  top: 64px;
  overflow: hidden;
}
.detail-panel--open {
  border-left: 1px solid var(--border);
}

.detail-panel__close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  transition: color var(--transition);
}
.detail-panel__close:hover { color: var(--text-primary); }

.detail-panel__sub {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 2px;
}

.detail-panel__empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  font-size: var(--text-sm);
  text-align: center;
  padding: var(--space-8);
}

.detail-panel__title {
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.detail-panel__body {
  flex: 1;
  overflow-y: auto;
  padding: 0 var(--space-4) var(--space-4);
}

.detail-panel__actions {
  padding: var(--space-4);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  gap: var(--space-2);
  flex-shrink: 0;
  flex-wrap: wrap;
}

/* ── Detail sections (MTR fields) ────────────────────────── */
.detail-section {
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-5);
  border-bottom: 1px solid var(--border-subtle);
}
.detail-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  font-size: var(--text-sm);
}

.detail-label {
  color: var(--text-secondary);
  flex-shrink: 0;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding-top: 2px;
  min-width: 100px;
}

.detail-value {
  color: var(--text-primary);
  text-align: right;
  word-break: break-word;
}

/* ── MTR page layouts ─────────────────────────────────────── */
.mtr-page {
  padding: var(--space-6);
  max-width: 1400px;
}

/* ── Lifecycle status colours (override badge in assets) ──── */
.badge--lifecycle-received   { background: var(--status-neutral-bg); color: var(--text-muted);     border-color: var(--border-default); }
.badge--lifecycle-in_stock   { background: var(--status-info-bg);    color: var(--status-info);    border-color: color-mix(in srgb, var(--status-info) 28%, transparent); }
.badge--lifecycle-assigned   { background: var(--status-success-bg); color: var(--status-success); border-color: color-mix(in srgb, var(--status-success) 28%, transparent); }
.badge--lifecycle-in_repair  { background: var(--status-warning-bg); color: var(--status-warning); border-color: color-mix(in srgb, var(--status-warning) 30%, transparent); }
.badge--lifecycle-returned   { background: var(--status-neutral-bg); color: var(--text-muted);     border-color: var(--border-subtle); }
.badge--lifecycle-written_off{ background: var(--status-danger-bg);  color: var(--status-danger);  border-color: color-mix(in srgb, var(--status-danger) 25%, transparent); }

/* ── Inventory Sessions ───────────────────────────────────── */
.inv-progress {
  position: relative;
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
  overflow: hidden;
  min-width: 100px;
}
.inv-progress__bar {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  border-radius: 4px;
  transition: width 0.4s ease;
}
.inv-progress__label {
  position: absolute;
  right: 0; top: -18px;
  font-size: 11px;
  color: var(--text-muted);
}

/* ── KPI strip (Inventory Sessions page) ─────────────────── */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}
.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
}
.kpi-card__value {
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}
.kpi-card__label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--space-1);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.kpi-card--active .kpi-card__value  { color: var(--accent-primary); }
.kpi-card--success .kpi-card__value { color: var(--status-success); }
.kpi-card--danger  .kpi-card__value { color: var(--status-danger); }

/* Table actions cell */
.table-actions { display: flex; gap: var(--space-2); align-items: center; }

/* Smaller button variant */
.btn--xs {
  padding: 3px 10px;
  font-size: 11px;
  border-radius: var(--radius-sm);
}
.btn--success {
  background: rgba(18,119,94,0.15);
  color: var(--status-success);
  border: 1px solid rgba(18,119,94,0.3);
}
.btn--success:hover { background: rgba(18,119,94,0.25); }

/* Highlighted selected row */
.row--selected { background: var(--accent-surface); }

/* ── QR Labels page ──────────────────────────────────────── */
.qr-preview-wrap {
  display: flex;
  gap: var(--space-6);
  align-items: flex-start;
}
.qr-preview__code svg {
  border-radius: var(--radius-md);
  background: #fff;
  padding: 8px;
}
.qr-preview__info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.qr-meta-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.qr-meta-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.qr-meta-value {
  font-size: var(--text-sm);
  color: var(--text-primary);
}
.search-bar-wrap {
  margin-bottom: var(--space-4);
}

/* ── Dashboard inventory strip ───────────────────────────── */
.dash-inv-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
  margin: var(--space-3) 0;
}
.dash-inv-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-4);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s;
}
.dash-inv-card:hover { border-color: color-mix(in srgb, var(--accent-primary) 30%, transparent); }
.dash-inv-card__icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.dash-inv-card__body { flex: 1; min-width: 0; }
.dash-inv-card__value {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
}
.dash-inv-card__label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.dash-inv-progress {
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  overflow: hidden;
  margin-top: var(--space-1);
}
.dash-inv-progress > div {
  height: 100%;
  border-radius: 2px;
  transition: width 0.4s;
}

/* ── Asset Passport ───────────────────────────────────────── */
.pp-page { max-width: 1400px; }

.pp-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: var(--space-5);
  margin-top: var(--space-5);
}

.pp-main { display: flex; flex-direction: column; gap: var(--space-4); }
.pp-side { display: flex; flex-direction: column; gap: var(--space-4); }

.pp-section {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.pp-section__title {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(255,255,255,0.02);
}
.pp-section__body { padding: var(--space-3) var(--space-4); }

.pp-field {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.pp-field:last-child { border-bottom: none; }
.pp-field__label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  min-width: 160px;
  flex-shrink: 0;
  padding-top: 2px;
}
.pp-field__value { font-size: var(--text-sm); color: var(--text-primary); }

/* ── Warranty banner ──────────────────────────────────────── */
.pp-warranty-banner {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  margin-bottom: var(--space-4);
}
.pp-warranty-banner--expired  { background: rgba(168,84,74,0.12);  color: var(--status-danger); border: 1px solid rgba(168,84,74,0.3); }
.pp-warranty-banner--critical { background: rgba(168,84,74,0.12);  color: var(--status-danger); border: 1px solid rgba(168,84,74,0.3); }
.pp-warranty-banner--warn     { background: rgba(138,106,42,0.12); color: var(--status-warning); border: 1px solid rgba(138,106,42,0.3); }

/* ── Voice line + 4-metric strip + lifecycle stepper (Phase 8 §7) ────────── */

.pp-voice {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  line-height: 1.5;
  margin-bottom: var(--space-3);
}

.pp-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-3); margin-bottom: var(--space-4); }
.pp-strip__card {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  min-width: 0;
}
.pp-strip__key {
  font-family: var(--font-mono);
  font-size: 9px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pp-strip__value {
  font-family: var(--font-mono);
  font-size: 19px; font-weight: 600; letter-spacing: -.01em;
  color: var(--text-primary);
  margin: 6px 0 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pp-strip__value.is-money { color: var(--money); }
.pp-strip__value.is-crit  { color: var(--status-danger); }
.pp-strip__note { font-size: 10.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pp-strip__note.is-crit { color: var(--status-danger); }

@media (max-width: 900px) { .pp-strip { grid-template-columns: repeat(2, 1fr); } }

.pp-lifecycle { display: flex; flex-direction: column; }
.pp-lifecycle__row {
  display: grid; grid-template-columns: 14px minmax(0,1fr) auto auto;
  gap: var(--space-3); align-items: center;
  padding: var(--space-2) 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.pp-lifecycle__row:last-child { border-bottom: none; }
.pp-lifecycle__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-muted); }
.pp-lifecycle__dot--next { background: var(--accent-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-primary) 22%, transparent); }
.pp-lifecycle__label { font-size: var(--text-sm); color: var(--text-secondary); }
.pp-lifecycle__label.is-next { color: var(--text-primary); font-weight: 600; }
.pp-lifecycle__date { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-muted); white-space: nowrap; }
.pp-pill { font-size: 10px; padding: 2px 8px; border-radius: var(--radius-full); border: 1px solid var(--border-subtle); color: var(--text-muted); white-space: nowrap; }
.pp-pill--next { color: var(--accent-primary); border-color: var(--accent-primary); }

/* ── QR in passport ──────────────────────────────────────── */
.pp-qr-wrap {
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}
.pp-qr-code svg { border-radius: 8px; background: #fff; padding: 8px; display: block; }
.pp-qr-info { flex: 1; }
.pp-qr-title { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: var(--space-1); }
.pp-qr-inv   { font-size: var(--text-sm); font-family: var(--font-mono); color: var(--accent-primary); }
.pp-qr-info .btn { display: block; width: 100%; text-align: center; }

/* ── Lifecycle timeline ───────────────────────────────────── */
.tl { display: flex; flex-direction: column; gap: 0; padding: var(--space-2) 0; }

.tl-event {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  position: relative;
}
.tl-event__left {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  width: 32px;
}
.tl-event__dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
  z-index: 1;
}
.tl-event__line {
  flex: 1;
  width: 2px;
  background: rgba(255,255,255,0.06);
  margin: 4px 0;
  min-height: 12px;
}
.tl-event:last-child .tl-event__line { display: none; }

.tl-event__body { flex: 1; padding-bottom: var(--space-2); }
.tl-event__primary  { font-size: var(--text-sm); font-weight: 500; color: var(--text-primary); }
.tl-event__secondary { font-size: var(--text-xs); color: var(--text-muted); margin-top: 2px; }
.tl-event__meta { font-size: 11px; color: var(--text-muted); margin-top: 4px; opacity: 0.7; }

/* ── Warranty dashboard widget ───────────────────────────── */
.dash-warranty-widget {
  background: var(--bg-card);
  border: 1px solid rgba(138,106,42,0.2);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin-top: var(--space-4);
}
.dash-warranty-widget__title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--status-warning);
  margin-bottom: var(--space-3);
}
.dash-warranty-widget__rows { display: flex; flex-direction: column; gap: var(--space-2); }
.dash-ww-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--text-sm);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
}
.dash-ww-row--danger { background: rgba(168,84,74,0.08);  color: var(--status-danger); }
.dash-ww-row--warn   { background: rgba(138,106,42,0.08); color: var(--status-warning); }
.dash-ww-row--info   { background: var(--accent-surface); color: var(--status-info); }
.dash-ww-count {
  font-weight: 700;
  font-size: var(--text-base);
}

/* ── Badge additional variants ───────────────────────────── */
.badge--neutral { background: var(--status-neutral-bg); color: var(--text-muted);  border-color: var(--border-default); }
.badge--info    { background: var(--status-info-bg);    color: var(--status-info); border-color: color-mix(in srgb, var(--status-info) 28%, transparent); }

/* ════════════════════════════════════════════════════════════
   SIDEBAR UX — ARKAN SCROLLBARS
   ════════════════════════════════════════════════════════════ */

/* C. ARKAN Scrollbars — WebKit (Chrome, Edge, Safari) */
::-webkit-scrollbar              { width: 5px; height: 5px; }
::-webkit-scrollbar-track        { background: var(--scrollbar-track); border-radius: 99px; }
::-webkit-scrollbar-thumb        { background: var(--scrollbar-thumb); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover  { background: var(--scrollbar-thumb-hover); }
::-webkit-scrollbar-corner       { background: var(--scrollbar-track); }

/* Firefox */
* { scrollbar-width: thin; scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track); }

/* Specific containers — ARKAN dark theme scrollbar */
#app-main,
.sidebar__nav-body,
.modal__body,
.table-wrap,
.gs-results,
.detail-panel__body,
.dash-act-list {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

/* ════════════════════════════════════════════════════════════
   SIDEBAR UX — COLLAPSE MODE
   ════════════════════════════════════════════════════════════ */

/* D. Collapse toggle button */
.sb-collapse-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid rgba(30,45,69,.6);
  background: rgba(255,255,255,.03);
  color: var(--sidebar-text);
  cursor: pointer;
  transition: .15s ease;
  flex-shrink: 0;
  margin-left: auto;
}
.sb-collapse-btn:hover {
  background: var(--accent-surface);
  border-color: color-mix(in srgb, var(--accent-primary) 30%, transparent);
  color: var(--accent-primary);
}
.sb-collapse-btn svg {
  transition: transform .25s ease;
}
.sidebar--collapsed .sb-collapse-btn svg {
  transform: rotate(180deg);
}

/* Collapsed state — body class toggled */
body.sidebar--collapsed {
  --sidebar-width: var(--sidebar-collapsed-width);
}

/* Hide text in collapsed mode */
.sidebar--collapsed .sidebar__brand-text,
.sidebar--collapsed .sidebar__label,
.sidebar--collapsed .sb-group__label,
.sidebar--collapsed .sb-group__chevron,
.sidebar--collapsed .sb-group__body,
.sidebar--collapsed .sb-group__badge,
.sidebar--collapsed .sb-pinned-label,
.sidebar--collapsed .sb-quick-access,
.sidebar--collapsed .sb-version,
.sidebar--collapsed .sb-prof-info,
.sidebar--collapsed .sb-prof-btn {
  display: none;
}

.sidebar--collapsed .sidebar__brand {
  justify-content: center;
  padding: 16px 10px 14px;
}

.sidebar--collapsed .sidebar__link {
  justify-content: center;
  padding: 10px 0;
}

.sidebar--collapsed .sb-group__header {
  justify-content: center;
  padding: 10px 0;
  width: 100%;
  margin: 0;
  border-radius: 0;
}

.sidebar--collapsed .sb-group__header-icon {
  margin: 0;
}

.sidebar--collapsed .sidebar__profile {
  justify-content: center;
  padding: 14px 10px 16px;
}

.sidebar--collapsed .sb-av {
  margin: 0;
}

/* ════════════════════════════════════════════════════════════
   SIDEBAR UX — ACCORDION GROUPS
   ════════════════════════════════════════════════════════════ */

/* A. Accordion group wrapper */
.sb-group {
  margin-bottom: 2px;
}

/* Group header — the clickable section label */
.sb-group__header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px 8px 14px;
  width: calc(100% - 20px);
  margin: 0 10px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(92,112,144,.6);
  text-align: left;
  border-radius: 6px;
  transition: color .14s, background .14s;
  position: relative;
}
.sb-group__header:hover {
  color: #94A3B8;
  background: rgba(255,255,255,.045);
}
.sb-group__header--has-active {
  color: var(--accent-primary) !important;
}

.sb-group__header-icon {
  display: none; /* shown only in collapsed mode via override */
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: inherit;
}
.sidebar--collapsed .sb-group__header-icon {
  display: flex;
}

.sb-group__label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
}

.sb-group__chevron {
  flex-shrink: 0;
  opacity: .5;
  font-size: 13px;
  line-height: 1;
  transition: transform .22s ease;
}

.sb-group--open .sb-group__chevron {
  transform: rotate(90deg);
  opacity: .8;
}

/* Group body — animated open/close */
.sb-group__body {
  overflow: hidden;
  max-height: 0;
  transition: max-height .28s cubic-bezier(.4, 0, .2, 1);
  will-change: max-height;
}

/* The open state is driven by JS setting data-height */
.sb-group--open .sb-group__body {
  /* max-height is set inline by JS for exact measurement */
}

/* Pinned items (null-label sections) — no accordion chrome */
.sb-pinned {}
.sb-pinned-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
  color: rgba(92,112,144,.4);
  padding: 14px 20px 4px;
  display: block;
}

/* Active indicator on group header */
.sb-group__active-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-primary);
  box-shadow: 0 0 6px color-mix(in srgb, var(--accent-primary) 70%, transparent);
  flex-shrink: 0;
  display: none;
}
.sb-group:not(.sb-group--open) .sb-group__header--has-active .sb-group__active-dot {
  display: block;
}

/* ════════════════════════════════════════════════════════════
   MOBILE RESPONSIVE — ≤ 768px
   Sidebar becomes a slide-in overlay drawer.
   ════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {

  /* Body: single-column, sidebar not in grid flow */
  body {
    grid-template-columns: 1fr;
    grid-template-rows: var(--header-height) 1fr;
    grid-template-areas:
      "header"
      "main";
  }

  /* Sidebar: fixed overlay drawer, hidden off-screen by default */
  #app-sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    width: 280px;
    z-index: 200;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
    overflow-y: auto;
    overflow-x: hidden;
  }

  /* Open state — toggled by JS adding .mobile-nav-open to body */
  body.mobile-nav-open #app-sidebar {
    transform: translateX(0);
  }

  /* Backdrop overlay */
  body.mobile-nav-open::after {
    content: '';
    position: fixed;
    inset: 0;
    top: var(--header-height);
    background: rgba(0, 0, 0, 0.55);
    z-index: 199;
  }

  /* Main content: full width */
  #app-main {
    grid-area: main;
    overflow-y: auto;
    min-height: 0;
  }

  /* Header: show hamburger, compress meta */
  .app-header {
    padding: 0 var(--space-3);
    gap: var(--space-2);
  }

  /* Hamburger button */
  .mob-hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
  }
  .mob-hamburger:hover {
    background: var(--accent-surface);
    color: var(--accent-primary);
    border-color: var(--accent-primary);
  }

  /* Hide theme labels, keep only icons */
  .theme-btn__label { display: none; }
  .theme-btn { padding: 0 6px; }

  /* Hide username text on very narrow screens */
  .app-header__user { display: none; }

  /* Header title compress */
  .app-header__title {
    font-size: var(--text-sm);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Collapse button inside sidebar — hide on mobile (redundant) */
  .sb-collapse-btn { display: none; }

  /* Disable desktop collapsed state on mobile */
  body.sidebar--collapsed {
    --sidebar-width: 240px;
  }
  body.sidebar--collapsed #app-sidebar {
    width: 240px;
  }
  body.sidebar--collapsed .sidebar__brand-text,
  body.sidebar--collapsed .sidebar__label,
  body.sidebar--collapsed .sb-group__label,
  body.sidebar--collapsed .sb-group__chevron,
  body.sidebar--collapsed .sb-group__body,
  body.sidebar--collapsed .sb-group__badge,
  body.sidebar--collapsed .sb-pinned-label,
  body.sidebar--collapsed .sb-quick-access,
  body.sidebar--collapsed .sb-version,
  body.sidebar--collapsed .sb-prof-info,
  body.sidebar--collapsed .sb-prof-btn {
    display: revert;
  }
  body.sidebar--collapsed .sidebar__brand { justify-content: flex-start; padding: 18px 18px 14px; }
  body.sidebar--collapsed .sidebar__link  { justify-content: flex-start; padding: 0 var(--space-3); }
  body.sidebar--collapsed .sb-group__header {
    justify-content: flex-start;
    padding: 8px 10px 8px 14px;
    width: calc(100% - 20px);
    margin: 0 10px;
    border-radius: 6px;
  }
  body.sidebar--collapsed .sidebar__profile  { justify-content: flex-start; padding: 12px var(--space-4); }
  body.sidebar--collapsed .sb-group__header-icon { display: none; }
  body.sidebar--collapsed .sb-av { margin: revert; }
}

/* Hamburger hidden on desktop (>=769px) */
@media (min-width: 769px) {
  .mob-hamburger { display: none; }
}

/* ════════════════════════════════════════════════════════════
   PAGES — MOBILE CONTENT (≤ 640px)
   ════════════════════════════════════════════════════════════ */

/* ИИ-контроль: боковая колонка 360px перестаёт помещаться раньше телефона —
   на планшете список находок сжимается до нечитаемого. Складываем в одну
   колонку уже на 1024px, рекомендации уходят под список. */
@media (max-width: 1024px) {
  .cp-cols { grid-template-columns: 1fr !important; }
}

@media (max-width: 640px) {

  #app-main { padding: var(--space-3); }

  /* Profile page: fixed 340px right column overflows on mobile — stack instead */
  .profile-grid { grid-template-columns: 1fr !important; }

  .page-title {
    font-size: var(--text-xl);
    margin-bottom: var(--space-4);
  }

  .page-header {
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
  }

  .page-header .page-title { font-size: var(--text-lg); }

  /* Generic stat card grids — single col on phone */
  .metric-cards-grid,
  .stats-grid,
  .cards-grid {
    grid-template-columns: 1fr !important;
  }

  /* Tables — allow horizontal scroll instead of overflow hidden */
  .table-wrap, .table-container { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* Modals — full width on mobile */
  .modal { width: 95vw !important; max-width: 95vw !important; margin: var(--space-4); }

  /* Form rows — stack */
  .form-row, .form-grid { grid-template-columns: 1fr !important; }

  /* Buttons in header — smaller */
  .page-header .btn { padding: 6px 10px; font-size: var(--text-xs); }
}

/* ════════════════════════════════════════════════════════════
   ALL MODULES — MOBILE (<=640px)
   ════════════════════════════════════════════════════════════ */

@media (max-width: 640px) {

  /* ── Ticket Detail ─────────────────────────────────────── */
  .td-page       { padding: var(--space-3); }
  .td-layout     { grid-template-columns: 1fr; }
  .td-topbar     { flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-3); }
  .td-title      { font-size: 16px; }
  .td-actions    { flex-wrap: wrap; width: 100%; }
  .td-actions .btn { flex: 1; justify-content: center; font-size: var(--text-xs); padding: 6px 8px; }
  .td-sla-banner { flex-wrap: wrap; gap: var(--space-2); padding: 8px 12px; }
  .td-sla-priority { margin-left: 0; }
  .td-card       { padding: var(--space-3) var(--space-4); }

  /* ── Users / Companies (master-detail) ────────────────── */
  .users-layout,
  .users-layout:has(.company-detail)     { grid-template-columns: 1fr; }
  .companies-layout,
  .companies-layout:has(.company-detail) { grid-template-columns: 1fr; }
  .company-list  { grid-template-columns: 1fr; }

  /* ── Reports ───────────────────────────────────────────── */
  .rpt-layout    { grid-template-columns: 1fr; }
  .rpt-nav       { display: flex; flex-direction: row; flex-wrap: wrap; gap: var(--space-1); border-right: none; border-bottom: 1px solid var(--border-subtle); padding-bottom: var(--space-2); margin-bottom: var(--space-3); }
  .rpt-nav-item  { white-space: nowrap; }

  /* ── Plans / Subscriptions ─────────────────────────────── */
  .plan-grid     { grid-template-columns: 1fr; }
  .plan-limits   { grid-template-columns: 1fr; }

  /* ── Revenue ───────────────────────────────────────────── */
  .rev-kpi-row   { grid-template-columns: 1fr 1fr; gap: var(--space-2); }

  /* ── KPI Strips (Inventory, etc.) ──────────────────────── */
  .kpi-strip         { grid-template-columns: 1fr 1fr; gap: var(--space-2); }
  .dash-inv-strip    { grid-template-columns: 1fr 1fr; gap: var(--space-2); }

  /* ── Asset Passport ────────────────────────────────────── */
  .pp-layout     { grid-template-columns: 1fr; }
  .pp-page       { padding: var(--space-3); }

  /* ── Page toolbar (search + actions row) ───────────────── */
  .page-toolbar  { flex-wrap: wrap; gap: var(--space-2); }
  .page-toolbar .page-toolbar__right,
  .page-toolbar__actions { flex-wrap: wrap; width: 100%; }

  /* ── Tables — compact on mobile ────────────────────────── */
  .table-wrap    { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table          { font-size: var(--text-xs); }
  th, td         { padding: 6px 8px !important; }

  /* ── Filters / toolbar chips ────────────────────────────── */
  .filter-bar    { flex-wrap: wrap; gap: var(--space-1); }
  .filter-chip   { font-size: var(--text-xs); padding: 3px 8px; }

  /* ── Detail panels (slide-in) ───────────────────────────── */
  .detail-panel,
  .company-detail { width: 100% !important; position: static !important; }

  /* ── Form rows ──────────────────────────────────────────── */
  .form-row,
  .form-grid     { grid-template-columns: 1fr !important; }

  /* ── Modal ──────────────────────────────────────────────── */
  .modal         { width: 95vw !important; max-width: 95vw !important; }

  /* ── Tabs on pages ──────────────────────────────────────── */
  .tabs, .tab-bar { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; }
  .tab-btn { white-space: nowrap; flex-shrink: 0; }
}

/* ≤400px — even tighter */
@media (max-width: 400px) {
  .rev-kpi-row       { grid-template-columns: 1fr; }
  .kpi-strip         { grid-template-columns: 1fr; }
  .dash-inv-strip    { grid-template-columns: 1fr; }
}

/* ── Profile page ─────────────────────────────────────────── */
.profile-card {
  max-width: 640px;
  margin: var(--space-6) auto;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.profile-card__section {
  padding: var(--space-6);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.profile-card__section:first-child {
  flex-direction: row;
  align-items: center;
  gap: var(--space-4);
}
.profile-card__section:last-child { border-bottom: none; }
.profile-card__avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent-primary, #1e8be5);
  color: #fff;
  font-size: 24px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.profile-card__info { display: flex; flex-direction: column; gap: 2px; }
.profile-card__name { font-size: var(--text-lg); font-weight: var(--font-semibold); color: var(--text-primary); }
.profile-card__role { font-size: var(--text-sm); color: var(--text-secondary); }
.profile-card__email { font-size: var(--text-sm); color: var(--text-tertiary); }
.profile-card__section-title { font-size: var(--text-base); font-weight: var(--font-semibold); color: var(--text-primary); }
.profile-card__hint { font-size: var(--text-sm); color: var(--text-secondary); }
.profile-card__token-result { margin-top: var(--space-2); }
.profile-card__token-box {
  padding: var(--space-4);
  background: var(--bg-subtle, var(--bg-base));
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}
.profile-card__token-link {
  word-break: break-all;
  color: var(--accent-primary);
  font-weight: var(--font-medium);
}
.profile-card__token-hint { color: var(--text-tertiary); }

/* ════════════════════════════════════════════════════════════
   ARKAN ENTERPRISE DESIGN SYSTEM
   White content · Dark sidebar · Warm Jade accent · No blur
   ════════════════════════════════════════════════════════════ */

/* ── Body backgrounds ─────────────────────────────────────── */
[data-theme="light"] body  { background: var(--bg-primary); }
[data-theme="dark"] body   { background: var(--bg-primary); }
[data-theme="system"] body { background: var(--bg-primary); }

/* ── Flat card surfaces — no backdrop-filter ──────────────── */
[data-theme="light"] .card,
[data-theme="light"] .metric-card,
[data-theme="light"] .dashboard__section,
[data-theme="light"] .ticket-section,
[data-theme="light"] .rpt-card,
[data-theme="light"] .kpi-card,
[data-theme="light"] .plan-card,
[data-theme="light"] .pp-section,
[data-theme="light"] .cust-card,
[data-theme="light"] .modal,
[data-theme="light"] .gs-modal,
[data-theme="light"] .dash-kpi,
[data-theme="light"] .dash-panel,
[data-theme="light"] .dash-ops-card,
[data-theme="light"] .dash-attention,
[data-theme="light"] .dash-ms-item {
  box-shadow: var(--shadow-sm);
}

/* ── Sidebar section header — uses sidebar tokens ────────── */
.sb-group__header {
  color: var(--sidebar-text);
}
.sb-group__header:hover {
  color: var(--sidebar-text-hover);
  background: var(--sidebar-active-bg);
}

/* Active group indicator — no neon glow, clean dot ─────── */
.sb-group__active-dot {
  background: var(--sidebar-accent);
  box-shadow: none;
}

/* ── Sidebar collapse btn — variable-based ────────────────── */
.sb-collapse-btn {
  border-color: var(--border-default);
  background: transparent;
}
.sb-collapse-btn:hover {
  background: var(--accent-surface);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

/* ── Light theme table row hover — jade tint, matches core-table ── */
[data-theme="light"] .table tbody tr:hover td {
  background: var(--accent-surface);
}

/* ── Pinned label — variable-based ────────────────────────── */
.sb-pinned-label {
  color: var(--text-muted);
}

/* ── Form inputs in light mode — jade focus (matches form.css default) ── */
[data-theme="light"] .form-input:focus,
[data-theme="light"] .form-select:focus,
[data-theme="light"] .form-textarea:focus {
  box-shadow: 0 0 0 3px var(--accent-surface);
}

/* ── Global search backdrop in light mode ─────────────────── */
[data-theme="light"] .gs-backdrop {
  background: var(--surface-overlay);
}
[data-theme="light"] .gs-footer {
  background: var(--bg-primary);
}

/* ── Transition for theme switching ───────────────────────── */
body,
.sidebar,
.app-header,
.card,
.metric-card,
.dashboard__section {
  transition:
    background 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}

/* Panel footer — used in matrix, agents, metrics */
.dash-panel__footer {
  padding: var(--space-3) 0 var(--space-1);
  border-top: 1px solid var(--border-subtle);
  margin-top: var(--space-3);
}

/* Make agent rows visually hoverable */
.dash-agent-row--clickable:hover { background: var(--bg-panel-hover) !important; }

/* ════════════════════════════════════════════════════════════
   ARKAN ADVISOR — Sprint 3
   ════════════════════════════════════════════════════════════ */

@keyframes advisor-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.85); }
}
@keyframes advisor-pulse-crit {
  0%, 100% { box-shadow: 0 0 0 0 rgba(168,84,74,0.5); }
  50%       { box-shadow: 0 0 0 5px rgba(168,84,74,0); }
}

.advisor-block {
  margin-bottom: var(--space-5);
  border: 1px solid color-mix(in srgb, var(--accent-primary) 12%, transparent);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--accent-primary) 2%, transparent);
  overflow: hidden;
  flex-shrink: 0;
}
.advisor-block--critical {
  border-color: color-mix(in srgb, var(--status-danger) 20%, transparent);
  background: color-mix(in srgb, var(--status-danger) 2%, transparent);
}
.advisor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid color-mix(in srgb, var(--accent-primary) 7%, transparent);
}
.advisor-block--critical .advisor-header { border-bottom-color: color-mix(in srgb, var(--status-danger) 10%, transparent); }
.advisor-header__left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.advisor-header__title {
  font-size: var(--text-sm);
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: 0.01em;
}
.advisor-header__sub {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 1px;
}
.advisor-header__badge {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: color-mix(in srgb, var(--accent-primary) 10%, transparent);
  color: var(--accent-primary);
  border: 1px solid color-mix(in srgb, var(--accent-primary) 20%, transparent);
}
.advisor-header__badge--critical {
  background: var(--status-danger-bg);
  color: var(--status-danger);
  border-color: color-mix(in srgb, var(--status-danger) 25%, transparent);
}
.advisor-pulse {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-primary);
  flex-shrink: 0;
  animation: advisor-pulse 2.4s ease-in-out infinite;
}
.advisor-pulse--critical {
  background: var(--status-danger);
  animation: advisor-pulse-crit 1.8s ease-in-out infinite;
}
.advisor-cards {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-5);
}
.advisor-card {
  display: flex;
  gap: 0;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-primary);
  overflow: hidden;
  transition: background var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.advisor-card:hover {
  background: var(--surface-elevated);
  box-shadow: var(--shadow-sm);
}
.advisor-card--critical { border-color: color-mix(in srgb, var(--status-danger)  20%, transparent); }
.advisor-card--high     { border-color: color-mix(in srgb, var(--status-danger)  14%, transparent); }
.advisor-card--warn     { border-color: color-mix(in srgb, var(--status-warning) 18%, transparent); }
.advisor-card--info     { border-color: color-mix(in srgb, var(--status-info)    15%, transparent); }
.advisor-card__accent {
  width: 3px;
  flex-shrink: 0;
}
.advisor-card__body {
  flex: 1;
  min-width: 0;
  padding: var(--space-4) var(--space-5);
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto auto auto;
  column-gap: var(--space-4);
  row-gap: 4px;
  align-items: start;
}
.advisor-card__head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  grid-column: 1;
}
.advisor-card__icon { display: flex; align-items: center; flex-shrink: 0; }
.advisor-card__tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid transparent;
}
.advisor-card__title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-primary);
  grid-column: 1;
  line-height: 1.3;
}
.advisor-card__desc {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  grid-column: 1;
  line-height: 1.5;
}
.advisor-card__risk {
  font-size: var(--text-xs);
  color: var(--text-muted);
  grid-column: 1;
  font-style: italic;
  line-height: 1.4;
}
.advisor-card__btn {
  grid-column: 2;
  grid-row: 1 / 5;
  align-self: center;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  font-size: var(--text-xs);
  font-weight: 700;
  padding: 7px 16px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  text-decoration: none;
  transition: opacity var(--transition);
  flex-shrink: 0;
}
.advisor-card__btn:hover { opacity: 0.8; }
.advisor-card--hidden { display: none; }

/* ── Focus-visible for all action links/buttons ─────────── */
.advisor-card__btn:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
  opacity: 1;
  border-radius: 3px;
}

/* ── Small tablet (≤ 768px) ──────────────────────────────── */
@media (max-width: 768px) {
  /* Advisor — tighter padding */
  .advisor-block { margin-bottom: var(--space-4); }
  .advisor-header { padding: var(--space-3) var(--space-4); gap: var(--space-3); }
  .advisor-cards  { padding: var(--space-3) var(--space-4); }
  /* Advisor card body — single column (btn drops below) */
  .advisor-card__body {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    padding: var(--space-3) var(--space-4);
  }
  .advisor-card__btn {
    grid-column: 1;
    grid-row: auto;
    align-self: flex-start;
    margin-top: var(--space-2);
    width: fit-content;
  }
  /* Show-more full-width on mobile */
  .advisor-show-more { align-self: stretch; text-align: center; }
}

.advisor-show-more {
  background: none;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: 600;
  padding: var(--space-2) var(--space-4);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
  align-self: flex-start;
  margin-top: var(--space-1);
}
.advisor-show-more:hover {
  background: var(--surface-elevated);
  border-color: var(--border-strong);
  color: var(--text-primary);
}
.advisor-show-more:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

/* =======================================================================
   WORKPLACE CENTER  (Sprint 5)
   ======================================================================= */

/* Page shell */
.wpc-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--space-6) var(--space-6) var(--space-10);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

/* Topbar */
.wpc-topbar { display: flex; align-items: center; gap: var(--space-3); }
.wpc-back {
  display: inline-flex; align-items: center; gap: var(--space-2);
  color: var(--text-secondary); font-size: var(--text-sm); text-decoration: none;
  transition: color var(--transition-fast);
}
.wpc-back:hover { color: var(--text-primary); }
.wpc-topbar__label { font-size: var(--text-xs); color: var(--text-muted); margin-left: auto; }

/* Hero */
.wpc-hero {
  display: flex; align-items: flex-start; gap: var(--space-5);
  background: var(--surface-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}
.wpc-hero__info { flex: 1; min-width: 0; }
.wpc-hero__name { font-size: 1.35rem; font-weight: 800; color: var(--text-primary); line-height: 1.15; }
.wpc-hero__meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2);
  margin-top: var(--space-1); font-size: var(--text-sm); color: var(--text-secondary);
}
.wpc-hero__role { font-weight: 600; color: var(--text-primary); }
.wpc-meta-sep { color: var(--text-muted); }
.wpc-email { color: var(--accent-primary); text-decoration: none; font-size: var(--text-xs); }
.wpc-email:hover { text-decoration: underline; }

/* Actions row */
.wpc-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-3); }
.wpc-action-btn {
  display: flex; flex-direction: column; align-items: center; gap: var(--space-2);
  padding: var(--space-5) var(--space-3);
  border-radius: var(--radius-lg); border: 1px solid var(--border-default);
  background: var(--surface-primary);
  font-size: var(--text-sm); font-weight: 600; color: var(--text-primary);
  text-decoration: none; cursor: pointer; text-align: center;
  transition: background var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast), color var(--transition-fast);
}
.wpc-action-btn:hover { background: var(--surface-elevated); border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.wpc-action-btn--primary { color: var(--accent-primary); border-color: color-mix(in srgb, var(--accent-primary) 25%, transparent); }
.wpc-action-btn--primary:hover { background: color-mix(in srgb, var(--accent-primary) 6%, transparent); border-color: var(--accent-primary); }
.wpc-action-btn--secondary { color: var(--text-secondary); }
.wpc-action-btn--danger { color: var(--status-danger); border-color: color-mix(in srgb, var(--status-danger) 25%, transparent); }
.wpc-action-btn--danger:hover { background: var(--status-danger-bg); border-color: var(--status-danger); }
.wpc-action-btn:focus-visible { outline: 2px solid var(--accent-primary); outline-offset: 2px; }

/* Two-column layout */
.wpc-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-5); }

/* Panel */
.wpc-panel { background: var(--surface-primary); border: 1px solid var(--border-default); border-radius: var(--radius-lg); overflow: hidden; }
.wpc-panel__header {
  display: flex; align-items: center; gap: var(--space-2);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-default);
  font-size: var(--text-sm); font-weight: 700; color: var(--text-primary);
  background: var(--surface-elevated);
}
.wpc-panel__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); flex-shrink: 0; }
.wpc-panel__badge {
  font-size: .68rem; font-weight: 700;
  background: var(--surface-primary); border: 1px solid var(--border-default);
  color: var(--text-muted); padding: 1px 6px; border-radius: var(--radius-full);
}
.wpc-panel__link { margin-left: auto; font-size: var(--text-xs); color: var(--accent-primary); text-decoration: none; font-weight: 600; }
.wpc-panel__link:hover { text-decoration: underline; }
.wpc-empty { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-5); color: var(--text-muted); font-size: var(--text-sm); }

/* Asset cards */
.wpc-asset-grid { display: flex; flex-direction: column; }
.wpc-asset-card {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-default);
  text-decoration: none; color: var(--text-primary);
  transition: background var(--transition-fast);
}
.wpc-asset-card:last-child { border-bottom: none; }
.wpc-asset-card:hover { background: var(--surface-elevated); }
.wpc-asset-card__icon { width: 38px; height: 38px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.wpc-asset-card__body { flex: 1; min-width: 0; }
.wpc-asset-card__name { font-size: var(--text-sm); font-weight: 600; }
.wpc-asset-card__tag  { font-size: var(--text-xs); color: var(--text-muted); }
.wpc-asset-card__model { font-size: var(--text-xs); color: var(--text-secondary); }
.wpc-card-arrow { color: var(--text-muted); flex-shrink: 0; opacity: .5; }

/* License cards */
.wpc-lic-grid { display: flex; flex-direction: column; }
.wpc-lic-card {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-default);
  text-decoration: none; color: var(--text-primary);
  transition: background var(--transition-fast);
}
.wpc-lic-card:last-child { border-bottom: none; }
.wpc-lic-card:hover { background: var(--surface-elevated); }
.wpc-lic-card--expired { opacity: .6; }
.wpc-lic-card__icon { width: 36px; height: 36px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.wpc-lic-card__body { flex: 1; min-width: 0; }
.wpc-lic-card__name { font-size: var(--text-sm); font-weight: 600; }
.wpc-lic-card__exp  { font-size: var(--text-xs); color: var(--text-muted); margin-top: 1px; }
.wpc-lic-card__exp--bad  { color: var(--status-danger); }
.wpc-lic-card__exp--warn { color: var(--status-warning); }

/* Cost panel */
.wpc-cost-row { display: flex; align-items: center; padding: var(--space-5); }
.wpc-cost-item { text-align: center; flex: 1; padding: 0 var(--space-4); }
.wpc-cost-item__val { font-size: 1.6rem; font-weight: 800; color: var(--text-primary); line-height: 1; }
.wpc-cost-item__val--accent { color: var(--status-success); }
.wpc-cost-item__label { font-size: var(--text-xs); color: var(--text-muted); margin-top: 4px; }
.wpc-cost-sep { width: 1px; height: 40px; background: var(--border-default); flex-shrink: 0; }

/* History */
.wpc-history-list { display: flex; flex-direction: column; }
.wpc-history-row {
  display: flex; align-items: flex-start; gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  border-bottom: 1px solid var(--border-default);
}
.wpc-history-row:last-child { border-bottom: none; }
.wpc-history-row__icon { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 1px; }
.wpc-history-row__body { flex: 1; min-width: 0; }
.wpc-history-row__action { font-size: var(--text-sm); font-weight: 500; color: var(--text-primary); }
.wpc-history-row__meta   { font-size: var(--text-xs); color: var(--text-muted); margin-top: 1px; }
.wpc-history-row__time   { font-size: var(--text-xs); color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }

/* Tickets */
.wpc-ticket-list { display: flex; flex-direction: column; }
.wpc-ticket-row {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-default);
  text-decoration: none; color: var(--text-primary);
  transition: background var(--transition-fast);
}
.wpc-ticket-row:last-child { border-bottom: none; }
.wpc-ticket-row:hover { background: var(--surface-elevated); }
.wpc-ticket-row__title { font-size: var(--text-sm); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }

/* Responsive */
@media (max-width: 900px) {
  .wpc-two-col { grid-template-columns: 1fr; }
  .wpc-actions { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .wpc-page { padding: var(--space-4); gap: var(--space-4); }
  .wpc-hero { flex-direction: column; padding: var(--space-4); }
  .wpc-cost-row { flex-direction: column; gap: var(--space-4); }
  .wpc-cost-sep { width: 100%; height: 1px; }
}
@media (max-width: 420px) {
  .wpc-actions { grid-template-columns: 1fr; }
}

/* ── Voice line + 4-metric strip (Phase 8 §7) ────────────────────────────── */

.wpc-voice {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--surface-elevated);
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  font-size: var(--text-sm);
}
.wpc-voice__icon { flex-shrink: 0; display: flex; color: var(--text-muted); }
.wpc-voice__text { line-height: 1.5; }

.wpc-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-3); }
.wpc-strip__card {
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-default);
  background: var(--surface-primary);
  min-width: 0;
}
.wpc-strip__key {
  font-family: var(--font-mono, monospace);
  font-size: 9px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wpc-strip__value {
  font-family: var(--font-mono, monospace);
  font-size: 22px; font-weight: 600; letter-spacing: -.01em;
  color: var(--text-primary);
  margin: 7px 0 3px;
}
.wpc-strip__value.is-crit { color: var(--status-danger); }
.wpc-strip__note {
  font-size: var(--text-xs); color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wpc-strip__note.is-crit { color: var(--status-danger); }

@media (max-width: 900px) { .wpc-strip { grid-template-columns: repeat(2, 1fr); } }

/* ── Week block (replaces the old raw-attendance panel, Phase 8 §7) ─────── */

.wpc-week { padding: var(--space-2) var(--space-5) var(--space-3); }
.wpc-week-row {
  display: grid; grid-template-columns: 46px 70px 70px minmax(0,1fr);
  gap: var(--space-3); align-items: center;
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border-subtle);
}
.wpc-week-row:last-child { border-bottom: none; }
.wpc-week-row--head {
  font-family: var(--font-mono, monospace);
  font-size: 9px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-default);
  padding-bottom: var(--space-2);
}
.wpc-week-row__day { font-size: var(--text-sm); color: var(--text-secondary); text-transform: capitalize; }
.wpc-week-row__time { font-family: var(--font-mono, monospace); font-size: var(--text-sm); color: var(--text-primary); }
.wpc-week-row__time.is-crit { color: var(--status-danger); }
.wpc-week-row__hours { font-size: var(--text-sm); color: var(--text-secondary); }

/* ── Sprint 13 · Demo Experience Polish ─────────────────────────────────── */

/* Page entrance animation */
@keyframes s13-fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.page { animation: s13-fade-up .3s ease both; }
.noc-dashboard { animation: s13-fade-up .3s ease both; }

/* KPI card hover — subtle lift + glow */
.kpi-card {
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  cursor: default;
}
.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(18,119,94,.12);
  border-color: rgba(18,119,94,.3);
}

/* Table row hover — stronger highlight */
.table tbody tr {
  transition: background .12s ease;
}
.table tbody tr:hover td {
  background: rgba(18,119,94,.06) !important;
}
[data-theme="light"] .table tbody tr:hover td {
  background: rgba(18,119,94,.06) !important;
}

/* Button micro-animation */
.btn {
  transition: background .15s ease, transform .1s ease, box-shadow .15s ease !important;
}
.btn:active {
  transform: scale(.97) !important;
}

/* Sidebar link smooth hover */
.sidebar-link, .nav-item {
  transition: background .15s ease, color .15s ease;
}

/* Badge refinement */
.badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  letter-spacing: .02em;
}

/* Table header — professional uppercase */
.table thead th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-weight: 700;
  opacity: .7;
}

/* Scrollbar polish */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.22); }
[data-theme="light"] ::-webkit-scrollbar-thumb { background: rgba(0,0,0,.12); }
[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,.22); }

/* Page header with subtitle pattern */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 1.5rem; }
.page-header > div > .page-title { margin-bottom: 0; }

/* ── END Sprint 13 polish ───────────────────────────────────────────────── */

/* ════════════════════════════════════════════════════════════════════════
   SPRINT 14 · Enterprise Feeling — Design System Unification
   Target: $500–3000/mo SaaS feel (Linear × Stripe × Notion aesthetic)
   ════════════════════════════════════════════════════════════════════════ */

/* ── 1. Typography Scale ────────────────────────────────────────────────── */

/* Unified page title — every page, same spec */
.page-title {
  font-size: clamp(1.5rem, 2.5vw, 1.875rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.15;
  color: var(--text-primary);
}

/* Section headers inside pages */
.section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* Monospace for IDs / codes (tickets, assets) */
.mono {
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  letter-spacing: 0.03em;
  opacity: .7;
}

/* ── 2. Premium Badge System ────────────────────────────────────────────── */
/* Override Bootstrap-style filled badges with Stripe-style outlined badges */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  padding: 3px 8px;
  border-radius: 5px;
  letter-spacing: 0.025em;
  white-space: nowrap;
}

/* Semantic variants — outline style using CSS variables */
.badge-success,   .badge--success   { background: var(--status-success-bg); color: var(--status-success); border: 1px solid color-mix(in srgb, var(--status-success) 28%, transparent); }
.badge-warning,   .badge--warning   { background: var(--status-warning-bg); color: var(--status-warning); border: 1px solid color-mix(in srgb, var(--status-warning) 30%, transparent); }
.badge-danger,    .badge--danger    { background: var(--status-danger-bg);  color: var(--status-danger);  border: 1px solid color-mix(in srgb, var(--status-danger) 28%, transparent); }
.badge-info,      .badge--info      { background: var(--status-info-bg);    color: var(--status-info);    border: 1px solid color-mix(in srgb, var(--status-info) 28%, transparent); }
.badge-primary,   .badge--primary   { background: var(--accent-surface);    color: var(--accent-primary); border: 1px solid color-mix(in srgb, var(--accent-primary) 30%, transparent); }
.badge-secondary, .badge--secondary { background: var(--status-neutral-bg); color: var(--text-secondary); border: 1px solid var(--border-default); }
.badge-muted,     .badge--muted     { background: var(--status-neutral-bg); color: var(--text-muted);     border: 1px solid var(--border-subtle); }

/* ── 3. Premium Table System ────────────────────────────────────────────── */

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.table thead th {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-default, rgba(255,255,255,.08));
  white-space: nowrap;
  background: transparent;
}

.table tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle, rgba(255,255,255,.05));
  vertical-align: middle;
  color: var(--text-primary);
  line-height: 1.45;
}

/* First data column — slightly bolder */
.table tbody td:first-child {
  font-weight: 500;
}

/* Row hover — left glow strip via first td (position:relative on tr breaks Chrome table layout) */
.table tbody tr {
  transition: background .12s ease;
}
.table tbody td:first-child {
  position: relative;
}
.table tbody td:first-child::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0;
  background: var(--accent-primary, #12775E);
  border-radius: 0 2px 2px 0;
  transition: width .15s ease;
  opacity: 0;
}
.table tbody tr:hover td:first-child::before {
  width: 3px;
  opacity: .7;
}
.table tbody tr:hover td {
  background: rgba(18,119,94,.04) !important;
}

/* Clickable rows */
.table tbody tr[style*="cursor:pointer"]:hover td,
.table tbody tr[data-id]:hover td {
  background: rgba(18,119,94,.05) !important;
}

[data-theme="light"] .table tbody tr:hover td,
[data-theme="light"] .table tbody tr[data-id]:hover td {
  background: rgba(18,119,94,.04) !important;
}

/* ── 4. Premium Input & Search ──────────────────────────────────────────── */

/* Search inputs */
input[type="text"].form-control,
input[type="search"].form-control,
input[type="text"][class*="search"],
.search-input {
  height: 38px;
  border-radius: 8px;
  border: 1px solid var(--border-default, rgba(255,255,255,.12));
  background: var(--surface-elevated, rgba(255,255,255,.04));
  color: var(--text-primary);
  padding: 0 12px;
  font-size: 13px;
  transition: border-color .15s ease, box-shadow .15s ease;
  outline: none;
}
input[type="text"].form-control:focus,
input[type="search"].form-control:focus {
  border-color: var(--accent-primary, #12775E);
  box-shadow: 0 0 0 3px rgba(18,119,94,.12);
}

/* Select dropdowns */
select.form-control,
select.form-select,
.filter-select {
  height: 38px;
  border-radius: 8px;
  border: 1px solid var(--border-default, rgba(255,255,255,.12));
  background: var(--surface-elevated, rgba(255,255,255,.04));
  color: var(--text-primary);
  padding: 0 32px 0 12px;
  font-size: 13px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2394A3B8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: border-color .15s ease, box-shadow .15s ease;
  outline: none;
}
select.form-control:focus,
select.form-select:focus {
  border-color: var(--accent-primary, #12775E);
  box-shadow: 0 0 0 3px rgba(18,119,94,.12);
}

/* ── 5. Premium Button System ───────────────────────────────────────────── */

.btn-primary, .btn--primary {
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-hover) 60%, var(--accent-pressed) 100%);
  color: #fff;
  border: none;
  font-weight: 600;
  letter-spacing: 0.01em;
  box-shadow: 0 1px 3px rgba(18,119,94,.3), 0 0 0 1px rgba(18,119,94,.2);
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease !important;
}
.btn-primary:hover, .btn--primary:hover {
  filter: brightness(1.08);
  box-shadow: 0 4px 14px rgba(18,119,94,.35), 0 0 0 1px rgba(18,119,94,.3) !important;
  transform: translateY(-1px) !important;
}
.btn-primary:active, .btn--primary:active {
  transform: translateY(0) scale(.98) !important;
  filter: brightness(.97);
}

/* Ghost button refinement */
.btn-outline, .btn--ghost, .btn--secondary {
  background: transparent;
  border: 1px solid var(--border-default, rgba(255,255,255,.15));
  color: var(--text-secondary, #94A3B8);
  font-weight: 500;
  transition: background .15s ease, border-color .15s ease, color .15s ease !important;
}
.btn-outline:hover, .btn--ghost:hover, .btn--secondary:hover {
  background: rgba(255,255,255,.05);
  border-color: rgba(255,255,255,.25);
  color: var(--text-primary);
}

/* ── 6. Card System Unification ─────────────────────────────────────────── */

.card {
  background: var(--surface-elevated, rgba(255,255,255,.03));
  border: 1px solid var(--border-subtle, rgba(255,255,255,.07));
  border-radius: 12px;
  transition: box-shadow .18s ease, border-color .18s ease, transform .18s ease;
}
.card:hover {
  border-color: rgba(255,255,255,.12);
  box-shadow: 0 4px 20px rgba(0,0,0,.2);
}

/* Consistent KPI card — unify all pages */
.kpi-card {
  background: var(--surface-elevated, rgba(255,255,255,.03)) !important;
  border: 1px solid var(--border-subtle, rgba(255,255,255,.07)) !important;
  border-radius: 12px !important;
  transition: transform .18s ease, box-shadow .18s ease !important;
}
.kpi-card:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 28px rgba(0,0,0,.18), 0 0 0 1px rgba(18,119,94,.15) !important;
}

/* ── 7. Sidebar Premium ─────────────────────────────────────────────────── */

/* Active nav item — left indicator strip */
.nav-item.active, .sidebar-link.active, .sidebar-item--active {
  position: relative;
}
.nav-item.active::before, .sidebar-link.active::before {
  content: '';
  position: absolute;
  left: 0; top: 4px; bottom: 4px;
  width: 3px;
  background: var(--accent-primary, #12775E);
  border-radius: 0 3px 3px 0;
}

/* Sidebar section group headers */
.sidebar-group-header, .nav-group-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  opacity: .6;
  padding: 16px 16px 6px;
  user-select: none;
}

/* ── 8. Premium Empty State ─────────────────────────────────────────────── */

.state-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 56px 32px;
  text-align: center;
  background: var(--surface-elevated, rgba(255,255,255,.02));
  border: 1px dashed var(--border-subtle, rgba(255,255,255,.08));
  border-radius: 12px;
}
.state-empty::before {
  content: '○';
  font-size: 2.5rem;
  opacity: .15;
  margin-bottom: 1rem;
  line-height: 1;
}
.state-empty:not(:empty) {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
}

/* ── 9. Loading Skeleton ────────────────────────────────────────────────── */

@keyframes s14-skeleton {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,.04) 25%, rgba(255,255,255,.08) 50%, rgba(255,255,255,.04) 75%);
  background-size: 800px 100%;
  animation: s14-skeleton 1.4s ease-in-out infinite;
  border-radius: 4px;
  display: block;
}
[data-theme="light"] .skeleton {
  background: linear-gradient(90deg, rgba(0,0,0,.04) 25%, rgba(0,0,0,.08) 50%, rgba(0,0,0,.04) 75%);
  background-size: 800px 100%;
}

/* ── 10. Focus Ring System ──────────────────────────────────────────────── */

*:focus-visible {
  outline: 2px solid var(--accent-primary, #12775E);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ── 11. Page Transition System ─────────────────────────────────────────── */

@keyframes s14-page-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.page {
  animation: s14-page-in .25s cubic-bezier(.16,1,.3,1) both !important;
}

/* ── 12. Premium Scrollbar ──────────────────────────────────────────────── */

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.1) transparent;
}
[data-theme="light"] * {
  scrollbar-color: rgba(0,0,0,.12) transparent;
}

/* ── 13. Visual Hierarchy — Page Header ─────────────────────────────────── */

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 0;
}
.page-header__left { flex: 1; }
.page-header__right { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }

.page-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 400;
  line-height: 1.5;
}

/* ── 14. Table Wrap Refinement ──────────────────────────────────────────── */

.table-wrap {
  border-radius: 12px;
  border: 1px solid var(--border-subtle, rgba(255,255,255,.07));
  overflow: hidden;
  background: var(--surface-elevated, rgba(255,255,255,.02));
}
.table-wrap .table {
  margin: 0;
}
.table-wrap .table thead th {
  background: rgba(255,255,255,.02);
}

/* ── 15. Premium Stat Cards (consistent across all pages) ───────────────── */

/* Unified stat number style */
.stat-value {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
}
.stat-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── 16. Ticket ID Monospace Chip ───────────────────────────────────────── */

.ticket-id {
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.02em;
}

/* ── 17. Filter Bar Pattern ─────────────────────────────────────────────── */

.filter-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.filter-bar label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── 18. Topbar Polish ──────────────────────────────────────────────────── */

.app-header {
  border-bottom: 1px solid rgba(255,255,255,.06) !important;
}
[data-theme="light"] .app-header {
  border-bottom: 1px solid rgba(0,0,0,.08) !important;
}

/* ── 19. Modal Premium ──────────────────────────────────────────────────── */

.modal, .modal-content, .modal-dialog {
  border-radius: 16px !important;
  border: 1px solid var(--border-default) !important;
}
.modal-header {
  border-bottom: 1px solid var(--border-subtle) !important;
  padding: 20px 24px 16px !important;
}
.modal-footer {
  border-top: 1px solid var(--border-subtle) !important;
  padding: 16px 24px 20px !important;
}

/* ── 20. Premium avatar circle ──────────────────────────────────────────── */

.avatar, [class*="avatar-"] {
  border: 2px solid rgba(255,255,255,.1);
  box-shadow: 0 0 0 1px rgba(0,0,0,.2);
}

/* ── END Sprint 14 Enterprise Design System ─────────────────────────────── */
/* ══════════════════════════════════════════════════════════════════════════
   Sprint 15 — Welcome Experience & Onboarding Tips
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Overlay backdrop ───────────────────────────────────────────────────── */

.wf-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: var(--surface-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: wf-fade-in 0.35s ease;
}

.wf-overlay--out {
  animation: wf-fade-out 0.35s ease forwards;
}

@keyframes wf-fade-in  { from { opacity: 0; } to { opacity: 1; } }
@keyframes wf-fade-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes wf-slide-up { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

/* ── Card container ─────────────────────────────────────────────────────── */

.wf-card {
  background: var(--surface-elevated, #14181f);
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 20px;
  padding: 48px 52px;
  max-width: 560px;
  width: 100%;
  box-shadow: 0 32px 80px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.05);
  position: relative;
}

.wf-card--center { text-align: center; }

.wf-animate-in { animation: wf-slide-up 0.4s cubic-bezier(.16,1,.3,1); }

/* ── Brand header ───────────────────────────────────────────────────────── */

.wf-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 24px;
}

.wf-brand__logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-hover));
  color: #fff;
  font-weight: 800;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px var(--accent-surface);
}

.wf-brand__name {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary, #f0f2f5);
}

/* ── Step dots ──────────────────────────────────────────────────────────── */

.wf-step-dots {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-bottom: 28px;
}

.wf-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  transition: all .25s;
}

.wf-dot--active {
  background: var(--accent-primary);
  width: 24px;
  border-radius: 4px;
}

/* ── Typography ─────────────────────────────────────────────────────────── */

.wf-h1 {
  font-size: clamp(1.6rem, 3vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 16px;
  color: var(--text-primary, #f0f2f5);
}

.wf-h2 {
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.3;
  margin-bottom: 10px;
  color: var(--text-primary, #f0f2f5);
}

.wf-lead {
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-muted, #8b9ab0);
  margin-bottom: 28px;
}

.wf-sub {
  font-size: 14px;
  color: var(--text-muted, #8b9ab0);
  margin-bottom: 24px;
  line-height: 1.6;
}

/* ── Feature chips (screen 1) ───────────────────────────────────────────── */

.wf-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 36px;
  text-align: left;
}

.wf-feature {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 10px;
  font-size: 13px;
  color: var(--text-secondary, #c0ccd8);
}

.wf-feature svg { opacity: .7; flex-shrink: 0; }

/* ── Buttons ────────────────────────────────────────────────────────────── */
/* .wf-btn* moved to styles/pages/welcome-flow.css (2026-08-16 cleanup:
   removed duplicate that was always overridden anyway — welcome-flow.css
   loads after main.css in index.html, so this copy was dead weight). */

.wf-nav {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
}

/* ── Interest selection (screen 2) ──────────────────────────────────────── */

.wf-interests {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

.wf-interest {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: rgba(255,255,255,.03);
  border: 1.5px solid rgba(255,255,255,.08);
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  transition: all .18s;
  width: 100%;
  font-family: inherit;
}

.wf-interest:hover {
  border-color: rgba(18,119,94,.4);
  background: rgba(18,119,94,.06);
}

.wf-interest--active {
  border-color: var(--accent-primary);
  background: rgba(18,119,94,.1);
}

.wf-interest__icon {
  color: var(--text-muted, #8b9ab0);
  flex-shrink: 0;
  transition: color .18s;
  display: flex;
}

.wf-interest--active .wf-interest__icon { color: var(--accent-primary); }

.wf-interest__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.wf-interest__label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary, #f0f2f5);
}

.wf-interest__desc {
  font-size: 12px;
  color: var(--text-muted, #8b9ab0);
}

.wf-interest__check {
  color: var(--accent-primary);
  opacity: 0;
  transition: opacity .18s;
  display: flex;
}

.wf-interest--active .wf-interest__check { opacity: 1; }

/* ── Demo stats grid (screen 3) ─────────────────────────────────────────── */

.wf-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 24px 0 32px;
}

.wf-stat {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 12px;
  padding: 16px 12px;
  text-align: center;
}

.wf-stat__value {
  font-size: 24px;
  font-weight: 800;
  color: var(--accent-primary);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.wf-stat__label {
  font-size: 11px;
  color: var(--text-muted, #8b9ab0);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Ready badge ────────────────────────────────────────────────────────── */

.wf-ready-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-primary);
  background: rgba(18,119,94,.12);
  border: 1px solid rgba(18,119,94,.25);
  border-radius: 20px;
  padding: 4px 12px;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.wf-ready-badge--green {
  color: var(--status-success);
  background: rgba(18,119,94,.12);
  border-color: rgba(18,119,94,.25);
}

/* ── Tip preview row (screen 3 non-demo) ────────────────────────────────── */

.wf-tip-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(18,119,94,.06);
  border: 1px solid rgba(18,119,94,.15);
  border-radius: 10px;
  font-size: 13px;
  color: var(--text-secondary, #c0ccd8);
  margin: 20px 0 28px;
  text-align: left;
}

.wf-tip-preview__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-primary);
  flex-shrink: 0;
  box-shadow: 0 0 8px var(--accent-primary);
  animation: wf-pulse 2s infinite;
}

@keyframes wf-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .6; transform: scale(1.3); }
}

/* ══════════════════════════════════════════════════════════════════════════
   Onboarding Tip Banner (appears on Dashboard)
   ══════════════════════════════════════════════════════════════════════════ */

.wf-tip {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-left: 3px solid var(--tip-color, var(--accent-primary));
  border-radius: 12px;
  margin-bottom: 20px;
  animation: wf-slide-up 0.35s cubic-bezier(.16,1,.3,1);
  position: relative;
}

.wf-tip--congrats {
  background: rgba(138,106,42,.04);
  border-color: rgba(138,106,42,.15);
  border-left-color: var(--status-warning);
}

.wf-tip__icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.wf-tip__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.wf-tip__title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary, #f0f2f5);
}

.wf-tip__text {
  font-size: 12px;
  color: var(--text-muted, #8b9ab0);
  line-height: 1.5;
}

.wf-tip__action {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-primary);
  text-decoration: none;
  padding: 6px 14px;
  background: rgba(18,119,94,.1);
  border: 1px solid rgba(18,119,94,.2);
  border-radius: 8px;
  transition: all .15s;
  cursor: pointer;
  flex-shrink: 0;
  font-family: inherit;
}

.wf-tip__action--btn {
  background: none;
  border: 1px solid rgba(255,255,255,.12);
  color: var(--text-secondary, #c0ccd8);
}

.wf-tip__action:hover { background: rgba(18,119,94,.18); }

.wf-tip__close {
  background: none;
  border: none;
  color: var(--text-muted, #8b9ab0);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  transition: color .15s, background .15s;
  flex-shrink: 0;
}

.wf-tip__close:hover {
  background: rgba(255,255,255,.08);
  color: var(--text-primary, #f0f2f5);
}

/* ── Integrations Center ──────────────────────────────────── */
.int-card {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 0;
}

@keyframes ic-spin-kf {
  to { transform: rotate(360deg); }
}
.ic-spin {
  animation: ic-spin-kf .7s linear infinite;
  display: inline-block;
}

/* ── Dashboard: МОИ РЕШЕНИЯ block ────────────────────────── */
.dash-my-decisions { margin-bottom: var(--space-4); }
.dash-my-decisions .dash-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-3);
}
.dash-link-sm {
  font-size: 12px;
  color: var(--accent-primary);
  text-decoration: none;
  font-weight: 500;
}
.dash-link-sm:hover { text-decoration: underline; }
.dash-my-decisions-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}
.dash-md-stat {
  text-align: center;
  padding: var(--space-2);
  border-radius: 8px;
  background: var(--surface-elevated, var(--bg-panel));
}
.dash-md-val {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}
.dash-md-val--warn   { color: var(--status-warning); }
.dash-md-val--danger { color: var(--status-danger); }
.dash-md-lbl {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 3px;
  line-height: 1.3;
}

/* ── Workplace object screen (Phase 8 §7) ────────────────────────────────── */

.wd-page { max-width: 1100px; margin: 0 auto; padding: var(--space-6); display: flex; flex-direction: column; gap: var(--space-4); }
.wd-topbar { display: flex; align-items: center; }
.wd-back { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-sm); color: var(--text-muted); text-decoration: none; }
.wd-back:hover { color: var(--text-primary); }

.wd-hero {
  display: flex; align-items: flex-start; gap: var(--space-4);
  background: var(--surface-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}
.wd-hero__icon {
  width: 52px; height: 52px; border-radius: var(--radius-lg); flex-shrink: 0;
  background: color-mix(in srgb, var(--status-success) 12%, transparent); color: var(--status-success);
  display: flex; align-items: center; justify-content: center;
}
.wd-hero__info { flex: 1; min-width: 0; }
.wd-hero__name { font-size: 1.25rem; font-weight: 800; color: var(--text-primary); margin: 0; }
.wd-hero__meta { font-size: var(--text-sm); color: var(--text-secondary); margin-top: 4px; }

.wd-voice {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--bg-card, var(--surface-primary));
  border: 1px solid var(--border-subtle, var(--border-default));
  color: var(--text-secondary);
  font-size: var(--text-sm);
  line-height: 1.5;
}

.wd-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-3); }
.wd-strip__card {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  background: var(--surface-primary);
  min-width: 0;
}
.wd-strip__key {
  font-family: var(--font-mono);
  font-size: 9px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wd-strip__value {
  font-family: var(--font-mono);
  font-size: 19px; font-weight: 600; color: var(--text-primary);
  margin: 6px 0 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wd-strip__note { font-size: 10.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 900px) { .wd-strip { grid-template-columns: repeat(2, 1fr); } }

.wd-layout { display: grid; grid-template-columns: 1.4fr 1fr; gap: var(--space-4); align-items: start; }
@media (max-width: 900px) { .wd-layout { grid-template-columns: 1fr; } }
.wd-main, .wd-side { display: flex; flex-direction: column; gap: var(--space-4); }

.wd-section { background: var(--surface-primary); border: 1px solid var(--border-default); border-radius: var(--radius-lg); overflow: hidden; }
.wd-section__title {
  font-size: var(--text-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-muted);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-default);
  background: var(--surface-elevated);
}
.wd-section__body { padding: var(--space-3) var(--space-4); }
.wd-empty { padding: var(--space-4) 0; color: var(--text-muted); font-size: var(--text-sm); }

.wd-equip-list { display: flex; flex-direction: column; }
.wd-equip-row {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-subtle, rgba(255,255,255,.06));
  text-decoration: none; color: inherit;
}
.wd-equip-row:last-child { border-bottom: none; }
.wd-equip-row:hover { color: var(--accent-primary); }
.wd-equip-row__icon { flex-shrink: 0; color: var(--text-muted); display: flex; }
.wd-equip-row__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.wd-equip-row__name { font-size: var(--text-sm); font-weight: 500; color: var(--text-primary); }
.wd-equip-row__meta { font-size: var(--text-xs); color: var(--text-muted); font-family: var(--font-mono); }

.wd-history-list { display: flex; flex-direction: column; }
.wd-history-row { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-2) 0; }
.wd-history-row__dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; margin-top: 6px; }
.wd-history-row__body { display: flex; flex-direction: column; gap: 1px; }
.wd-history-row__title { font-size: var(--text-sm); color: var(--text-primary); }
.wd-history-row__meta { font-size: var(--text-xs); color: var(--text-muted); font-family: var(--font-mono); }
