﻿/* ===== Design tokens (evolved indigo, cockpit density) ===== */
:root {
  /* Neutrals — cool zinc only */
  --bg: #f4f5f8;
  --bg-gradient: linear-gradient(165deg, #f0f2f7 0%, #f4f5f8 45%, #eef0f5 100%);
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --surface-hover: #f1f3f8;
  --surface-raised: #ffffff;
  --text: #18181b;
  --text-muted: #71717a;
  --text-subtle: #a1a1aa;
  --border: #e4e4e7;
  --border-strong: #d4d4d8;

  /* Accent — single indigo, no violet cascade */
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: rgba(99, 102, 241, 0.1);
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --accent-soft: rgba(99, 102, 241, 0.08);
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  --accent-gradient-subtle: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(99, 102, 241, 0.03) 100%);
  --focus-ring: 0 0 0 3px rgba(99, 102, 241, 0.18);

  /* Semantic */
  --success: #059669;
  --warning: #d97706;
  --danger: #dc2626;
  --info: #2563eb;
  --in: #059669;
  --out: #2563eb;

  /* Request statuses */
  --status-new: #6366f1;
  --status-accepted: #059669;
  --status-archived: #71717a;

  /* Shape lock */
  --radius: 12px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --radius-pill: 999px;

  /* Elevation — border-first, tinted shadows */
  --shadow: 0 1px 2px rgba(24, 24, 27, 0.04);
  --shadow-md: 0 4px 12px rgba(99, 102, 241, 0.08);
  --shadow-lg: 0 8px 24px rgba(99, 102, 241, 0.1);
  --shadow-card: none;
  --shadow-hover: 0 4px 16px rgba(99, 102, 241, 0.08);

  /* Header shell */
  --header-h: 64px;
  --glass-bg: #ffffff;
  --glass-border: var(--border);

  /* Type */
  --font: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', 'SF Mono', Menlo, monospace;

  /* Spacing / motion */
  --space-section: 1.75rem;
  --touch-min: 44px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --transition: 0.2s var(--ease-out);
}

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

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

html {
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg-gradient);
  background-attachment: fixed;
  min-height: 100vh;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  padding-bottom: env(safe-area-inset-bottom);
}

.app {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ===== Header ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 10;
  padding-top: env(safe-area-inset-top);
  background: var(--glass-bg);
  border-bottom: 1px solid var(--border);
  color: var(--text);
  min-height: var(--header-h);
}

.header__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.625rem 1rem;
  min-height: calc(var(--header-h) - 1px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Страницы «назад + заголовок + действия»: одна строка в шапке */
.header__inner--centered-title {
  flex-wrap: nowrap;
}

.header__brand { display: flex; align-items: center; justify-content: center; gap: 0.55rem; }
.header__brand--row { gap: 0.75rem; min-width: 0; flex-shrink: 0; }
.header__brand--row .header__title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.header__left { flex-shrink: 0; }
.header__title--center { flex: 1; text-align: center; min-width: 0; padding: 0 0.5rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header__icon {
  display: block;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
}
.header__icon img,
.header__icon svg {
  display: block;
  width: 28px;
  height: 28px;
}
.header__title { font-size: 1rem; font-weight: 700; letter-spacing: -0.025em; color: var(--text); vertical-align: bottom; }
.header__title--page { font-weight: 700; }

.header__back {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.875rem;
  padding: 0.375rem 0;
  min-height: var(--touch-min);
  display: inline-flex;
  align-items: center;
  transition: color var(--transition), background-color var(--transition);
  touch-action: manipulation;
  border-radius: var(--radius-sm);
}
.header__back:hover { color: var(--text); background: var(--surface-hover); }
.header__back:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.header__back--icon { padding: 0.5rem; min-width: var(--touch-min); min-height: var(--touch-min); justify-content: center; }
.header__back-icon { display: block; flex-shrink: 0; }

.header__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header .input {
  padding: 0.4rem 0.65rem;
  font-size: 0.875rem;
  border-color: var(--border);
  background: var(--surface);
}
.header .input--date { min-width: 132px; }
.header .input,
.header .btn { min-height: 40px; }
.header .btn { padding: 0.4rem 0.65rem; font-size: 0.875rem; }
.header .btn--icon {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  padding: 0;
  align-items: center;
  justify-content: center;
}
.header .btn--icon .btn__icon { width: 20px; height: 20px; }
.header .btn--ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid transparent;
}
.header .btn--ghost:hover { color: var(--text); background: var(--surface-hover); }
.header .btn--secondary { background: var(--surface); color: var(--accent); border: 1px solid var(--border); box-shadow: none; }
.header .btn--secondary:hover { background: var(--accent-soft); border-color: var(--accent); }

.date-wrap { position: relative; }

/* Flatpickr: русский календарь поверх шапки */
.flatpickr-calendar {
  z-index: 100;
  font-family: var(--font);
}
.input {
  font-family: var(--font);
  font-size: 0.9375rem;
  padding: 0.5rem 0.75rem;
  min-height: var(--touch-min);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  touch-action: manipulation;
  transition: border-color var(--transition), box-shadow var(--transition), background-color var(--transition);
}
.input--date { min-width: 160px; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus-ring); }
.input::placeholder { color: var(--text-subtle); }

.btn {
  font-family: var(--font);
  font-size: 0.9375rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  min-height: var(--touch-min);
  min-width: var(--touch-min);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color var(--transition), transform 0.12s var(--ease-out), box-shadow var(--transition), color var(--transition), border-color var(--transition);
  touch-action: manipulation;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  position: relative;
  white-space: nowrap;
}
.btn:active { transform: scale(0.98); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn__icon { flex-shrink: 0; display: block; }
.btn--icon { padding: 0.5rem; }
.btn--icon .btn__icon { width: 1.25em; height: 1.25em; }

.btn--primary {
  background: var(--accent);
  color: #fff;
  box-shadow: none;
}
.btn--primary:hover { background: var(--accent-hover); box-shadow: var(--shadow-hover); }

.btn--ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid transparent;
}
.btn--ghost:hover { color: var(--text); background: var(--surface-hover); }

.btn--secondary {
  background: var(--surface);
  color: var(--accent);
  border: 1px solid var(--border);
}
.btn--secondary:hover { background: var(--accent-soft); border-color: var(--accent); }

/* ===== Main ===== */
.main {
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.25rem 1rem;
  padding-bottom: calc(1.25rem + env(safe-area-inset-bottom));
  width: 100%;
}

/* ===== Flower watering ticker ===== */
.flower-ticker {
  overflow: hidden;
  margin: 0 0 1rem;
  padding: 0.5rem 0;
  background: var(--accent-soft);
  border: 1px solid rgba(99, 102, 241, 0.18);
  border-radius: var(--radius-sm);
}
.flower-ticker__viewport {
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.flower-ticker__track {
  display: flex;
  width: max-content;
  animation: flower-ticker-scroll 22s linear infinite;
}
.flower-ticker__track:hover {
  animation-play-state: paused;
}
.flower-ticker__item {
  flex-shrink: 0;
  padding: 0 2.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
}
.flower-ticker__employee {
  color: var(--accent);
  font-weight: 700;
}
@keyframes flower-ticker-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .flower-ticker__viewport { mask-image: none; }
  .flower-ticker__track {
    animation: none;
    width: 100%;
    justify-content: center;
  }
  .flower-ticker__item + .flower-ticker__item { display: none; }
}

.section { margin-bottom: var(--space-section); }
.section__title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.75rem;
}
.section__title--sub { margin-top: 1.25rem; margin-bottom: 0.5rem; }

/* ===== Stats grid (адаптивные компактные карточки) ===== */
.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  height: fit-content;
}

.stat {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.9rem;
  min-height: 0;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border);
  transition: box-shadow var(--transition), border-color var(--transition), transform var(--transition);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.stat:hover {
  box-shadow: var(--shadow-hover);
  border-color: rgba(99, 102, 241, 0.28);
}

.stat__label {
  display: block;
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-bottom: 0.125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.2;
}
.stat__value {
  font-family: var(--font-mono);
  font-size: clamp(1.125rem, 4vw, 1.5rem);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.stat__value--mono { font-variant-numeric: tabular-nums; font-size: clamp(1rem, 3.5vw, 1.375rem); }

.stat--in .stat__value { color: var(--in); }
.stat--out .stat__value { color: var(--out); }
.stat--time .stat__value { color: var(--accent); }

.stats--compact .stat { padding: 0.5rem 0.75rem; }
.stats--compact .stat__label { font-size: 0.625rem; }
.stats--compact .stat__value { font-size: 1.125rem; }
.stats--compact .stat__value--mono { font-size: 1rem; }

/* Главная: hero KPI + вторичный ряд */
.dashboard-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 0.9rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.dashboard-date-context {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-weight: 600;
  margin: 0;
  padding: 0 0.1rem;
}
.stats-empty-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  border: 1px solid rgba(99, 102, 241, 0.2);
}
.stats-empty-banner[hidden] { display: none !important; }
.stats-empty-banner__text { margin: 0; font-size: 0.9rem; color: var(--text); font-weight: 600; }

.stats--dashboard {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.stats--dashboard .stat--primary {
  padding: 0.9rem 1rem;
  border: 1px solid rgba(99, 102, 241, 0.2);
  background: var(--surface);
  box-shadow: none;
}
.stats--dashboard .stat--primary .stat__label {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
}
.stats--dashboard .stat--primary .stat__value {
  font-size: clamp(2rem, 6vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
}
.stats--dashboard .stat--primary:hover {
  transform: none;
  box-shadow: var(--shadow-hover);
  border-color: rgba(99, 102, 241, 0.3);
}
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}
.stats--dashboard .stat--secondary {
  padding: 0.65rem 0.75rem;
  box-shadow: none;
}
.stats--dashboard .stat--secondary:hover {
  transform: none;
}
.stats--dashboard .stat--secondary .stat__value {
  font-size: clamp(1rem, 3.2vw, 1.25rem);
}
.stats--dashboard .stat--secondary .stat__label {
  font-size: 0.62rem;
}
.stats--dashboard.stats--empty {
  opacity: 0.72;
}
@media (max-width: 520px) {
  .stats-row { grid-template-columns: 1fr; }
}

.compare-wrap { margin-top: 0.15rem; }
.compare-block__hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin: 0 0 0.35rem 0;
  line-height: 1.35;
  font-weight: 500;
}

/* ===== Compare (сравнение с вчера) ===== */
.compare-block {
  margin-top: 0;
  margin-bottom: 0;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.9rem;
  box-shadow: none;
  border: 1px solid var(--border);
}
.compare-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.28rem 0;
  font-size: 0.8125rem;
}
.compare-row--diff { border-top: 1px solid var(--border); margin-top: 0.2rem; padding-top: 0.45rem; }
.compare__label { color: var(--text-muted); font-weight: 500; font-size: 0.78rem; }
.compare__value { font-weight: 600; color: var(--text); font-size: 0.8125rem; font-variant-numeric: tabular-nums; font-family: var(--font-mono); }
.compare__value--up { color: var(--success); }
.compare__value--down { color: var(--danger); }
.compare__diff-wrap { display: inline; }
.compare__diff-wrap .compare__value { white-space: nowrap; }

/* ===== Charts (активность по часам, тренд) ===== */
.chart { min-height: 120px; }
.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 0.25rem;
  padding: 1.1rem 1.15rem;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  flex-wrap: wrap;
  justify-content: center;
}
.chart-bars--hours { gap: 2px; }
.chart-bars--days { gap: 0.5rem; }
.chart-bar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 24px;
  flex: 1;
  max-width: 48px;
}
.chart-bars--hours .chart-bar-wrap { max-width: 32px; min-width: 18px; }
.chart-bar {
  width: 100%;
  height: 80px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  margin: 0.25rem 0;
}
.chart-bar__fill {
  width: 100%;
  background: var(--accent);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  min-height: 2px;
  transition: height 0.25s var(--ease-out);
}
.chart-bar__label {
  font-size: 0.6875rem;
  color: var(--text-muted);
  font-weight: 500;
}
.chart-bar__value {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* ===== Top employees ===== */
.top-employees {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.top-employees__podium {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  align-items: end;
  padding-top: 4.5rem;
  overflow: visible;
}
.podium__slot {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 0;
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: none;
  padding: 1.35rem 0 0;
  min-height: 148px;
  overflow: visible;
  isolation: isolate;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.podium__slot::before {
  content: none;
}
.podium__slot:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(99, 102, 241, 0.28);
}
.podium__slot--1 {
  min-height: 204px;
  border-color: rgba(245, 158, 11, 0.35);
  background: var(--surface);
  box-shadow: none;
}
.podium__slot--2 {
  min-height: 176px;
  border-color: rgba(148, 163, 184, 0.45);
  background: var(--surface);
}
.podium__slot--3 {
  min-height: 160px;
  border-color: rgba(249, 115, 22, 0.32);
  background: var(--surface);
}
.podium__slot--empty {
  opacity: 0.28;
  pointer-events: none;
}
.podium__medal {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -72%);
  width: auto;
  height: auto;
  line-height: 0;
  z-index: 2;
  pointer-events: none;
  filter: drop-shadow(0 14px 22px rgba(30, 40, 80, 0.2));
  animation: podium-medal-pop 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.podium__slot--1 .podium__medal {
  filter: drop-shadow(0 16px 26px rgba(245, 158, 11, 0.42));
  animation-delay: 0.08s;
}
.podium__slot--2 .podium__medal { animation-delay: 0s; }
.podium__slot--3 .podium__medal { animation-delay: 0.14s; }
.podium__medal-img {
  display: block;
  width: 76px;
  height: 76px;
  object-fit: contain;
}
.podium__slot--1 .podium__medal-img { width: 108px; height: 108px; }
.podium__slot--2 .podium__medal-img { width: 86px; height: 86px; }
.podium__slot--3 .podium__medal-img { width: 76px; height: 76px; }
@keyframes podium-medal-pop {
  from { opacity: 0; transform: translate(-50%, -48%) scale(0.86); }
  to { opacity: 1; transform: translate(-50%, -72%) scale(1); }
}
.podium__body {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
  padding: 0 0.15rem 0.85rem;
  flex: 1;
  justify-content: center;
}
.podium__place {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: inherit;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  color: #fff;
  text-shadow: 0 1px 0 rgba(0,0,0,0.08);
}
.podium__slot--1 .podium__place { font-size: 1.35rem; }
.podium__name {
  font-weight: 800;
  text-align: center;
  line-height: 1.25;
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 0.95rem;
}
.podium__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 0.1rem 0.2rem;
  font-size: 0.8125rem;
  font-weight: 650;
  color: var(--text-muted);
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.podium__meta-sep { opacity: 0.75; }
.podium__base {
  position: relative;
  z-index: 1;
  width: calc(100% + 2px);
  margin: 0 -1px -1px;
  min-height: 2.35rem;
  border-radius: 0 0 calc(var(--radius-md) - 1px) calc(var(--radius-md) - 1px);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
}
.podium__slot--1 .podium__base {
  min-height: 2.85rem;
  background: linear-gradient(180deg, #fbbf24 0%, #f59e0b 100%);
}
.podium__slot--2 .podium__base {
  min-height: 2.5rem;
  background: linear-gradient(180deg, #cbd5e1 0%, #94a3b8 100%);
}
.podium__slot--3 .podium__base {
  background: linear-gradient(180deg, #fdba74 0%, #f97316 100%);
}
@media (max-width: 640px) {
  .top-employees__podium {
    gap: 0.55rem;
    padding-top: 3.5rem;
  }
  .podium__slot {
    padding-top: 1.1rem;
    border-radius: 14px;
  }
  .podium__slot--1 { min-height: 178px; }
  .podium__slot--2 { min-height: 156px; }
  .podium__slot--3 { min-height: 144px; }
  .podium__slot--1 .podium__medal-img { width: 84px; height: 84px; }
  .podium__slot--2 .podium__medal-img { width: 70px; height: 70px; }
  .podium__slot--3 .podium__medal-img { width: 62px; height: 62px; }
  .podium__name { font-size: 0.8125rem; }
  .podium__meta {
    flex-direction: column;
    align-items: center;
    gap: 0.05rem;
    font-size: 0.72rem;
  }
  .podium__meta-sep { display: none; }
  .podium__base { border-radius: 0 0 13px 13px; min-height: 2rem; }
  .podium__slot--1 .podium__base { min-height: 2.35rem; }
}

.top-employees__rest {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: none;
  overflow: hidden;
}
.top-employees__list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.top-employees__list--rest { margin-top: 0; }
.top-employees__item { border-bottom: 1px solid var(--border); }
.top-employees__item:last-child { border-bottom: none; }
.top-employees__row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem 1rem;
  padding: 0.75rem 1rem;
  color: var(--text);
  text-decoration: none;
  transition: background var(--transition), border-color var(--transition);
}
.top-employees__row:hover {
  background: var(--surface-hover);
}
.top-employees__row:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.top-employees__rank {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.8125rem;
  color: var(--text-muted);
  background: var(--surface-raised);
  border: 1px solid var(--border);
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.top-employees__body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.top-employees__name {
  font-weight: 700;
  font-size: 0.9375rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.top-employees__row:hover .top-employees__name { color: var(--accent); }
.top-employees__meta {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.top-employees__duration {
  font-weight: 800;
  font-size: 0.9375rem;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  letter-spacing: -0.01em;
}
.top-employees__duration.card__value--red { color: var(--danger); }
.top-employees__duration.card__value--green { color: var(--success); }
.top-employees__duration.card__value--orange { color: var(--warning); }

.top-employees__link { cursor: pointer; }

@media (max-width: 520px) {
  .top-employees__row {
    grid-template-columns: auto 1fr;
    row-gap: 0.35rem;
  }
  .top-employees__duration {
    grid-column: 2;
    justify-self: start;
    font-size: 0.875rem;
  }
}

/* ===== Period select ===== */
.input--period {
  min-width: 100px;
  cursor: pointer;
}

/* ===== Loading ===== */
.loading {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 2rem;
  color: var(--text-muted);
  font-size: 0.9375rem;
}
.loading.visible { display: flex; }

.loading__spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Skeleton placeholders */
.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.2s ease-in-out infinite;
  border-radius: var(--radius-sm);
  color: transparent !important;
}
@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .skeleton { animation: none; background: var(--surface-2); }
}

.stats--loading .stat__value,
.stat__value--pending {
  opacity: 0.45;
}
.section--loading {
  opacity: 0.72;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

/* ===== Departments (по сотрудникам) ===== */
.departments {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  align-items: start;
}
.department {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: none;
  padding: 0.75rem 0.85rem;
}
.department__title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
  padding-bottom: 0.375rem;
  border-bottom: 2px solid var(--accent);
}
.employee-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.625rem;
}
.empty-state--small {
  padding: 1rem;
  font-size: 0.8125rem;
}

/* ===== Employee cards (компактные) ===== */

.employee-list.loading .card { opacity: 0.6; pointer-events: none; }

.card {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 0.7rem 0.85rem;
  box-shadow: none;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  transition: box-shadow var(--transition), border-color var(--transition), transform var(--transition);
}
.card:hover {
  box-shadow: var(--shadow-hover);
  border-color: rgba(99, 102, 241, 0.25);
  transform: none;
}

.card__title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  cursor: pointer;
  margin: 0;
  border-radius: var(--radius);
  padding: 0.125rem 0;
}
.card__title:hover { color: var(--accent); }
.card__title:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.card__meta {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}
.card__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8125rem;
}
.card__row span:first-child { color: var(--text-muted); }
.card__row span:last-child { font-weight: 600; color: var(--text); }
.card__value-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}
.card__copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.125rem;
  margin: 0 0 0 4px;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius);
}
.card__copy:hover { color: var(--text); }
.card__copy:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.card__copy-icon { flex-shrink: 0; }

.card__value-wrap .card__value.card__value--red { color: var(--danger) !important; }
.card__value-wrap .card__value.card__value--green { color: var(--success) !important; }
.card__value-wrap .card__value.card__value--orange { color: var(--warning) !important; }
.card__crown {
  width: 18px;
  height: auto;
  flex-shrink: 0;
  vertical-align: middle;
}

.card__action { margin-top: 0.25rem; width: 100%; }
.card__action .btn {
  height: fit-content;
  min-height: 0;
  width: 100%;
  padding: 4px 12px;
  font-size: 0.8125rem;
}

/* ===== Empty state ===== */
.empty-state {
  grid-column: 1 / -1;
  padding: 2rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
  background: var(--surface-2);
  border-radius: var(--radius-md);
  border: 1px dashed var(--border);
  font-size: 0.9375rem;
}

/* ===== Call filters ===== */
.call-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.call-filters .input--search {
  flex: 1;
  min-width: 140px;
}
.call-filters .input--filter {
  min-width: 120px;
}

/* ===== Call list (employee page) ===== */
.call-list { display: flex; flex-direction: column; gap: 0.75rem; }
.call-list.loading .call { opacity: 0.6; pointer-events: none; }

.call {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  box-shadow: none;
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  transition: box-shadow var(--transition), border-color var(--transition), transform var(--transition);
}
.call:hover {
  box-shadow: var(--shadow-hover);
  transform: none;
}

.call.call--in { border-left-color: var(--in); }
.call.call--out { border-left-color: var(--out); }

.call__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.call__header-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.call__provider-icon {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
}
.call__dir {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
}
.call__dir--in { color: var(--in); background: rgba(5, 150, 105, 0.1); }
.call__dir--out { color: var(--out); background: rgba(37, 99, 235, 0.1); }
.call__time {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
.call__body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.875rem;
}
.call__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
}
.call__label { color: var(--text-muted); }
.call__value { font-weight: 500; }

.call__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.5rem;
}
.call__actions .call__link { margin-top: 0; }
.call__actions .call__btn { margin-top: 0; margin-left: 0; }

.call__actions--multi {
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
}
.call__record-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border);
}
.call__record-row:last-child { border-bottom: none; padding-bottom: 0; }
.call__record-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 4.5rem;
}
.call__record-btns {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.call__record-btns .call__btn { margin-left: 0; margin-top: 0; }
.call__player-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.call__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--touch-min);
  margin-top: 0.5rem;
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  font-size: 0.9375rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--accent);
  transition: background 0.2s, color 0.2s;
  touch-action: manipulation;
}
.call__link:hover { background: var(--accent); color: #fff; }
.call__link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.call__link--toggle {
  font-family: inherit;
  cursor: pointer;
  border: 1px solid var(--accent);
  background: transparent;
  padding: 0.5rem;
}
.call__link--toggle:hover { background: var(--accent); color: #fff; }
.call__link--toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.call__play-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
}
.call__play-icon svg { display: block; }

.call__player-wrap {
  display: none;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  flex-direction: column;
  gap: 0.5rem;
}
.call--player-open .call__player-wrap {
  display: flex;
}
.call__player {
  width: 100%;
  max-width: 100%;
  height: 40px;
}
.call__player-link {
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-decoration: none;
}
.call__player-link:hover { color: var(--accent); text-decoration: underline; }

.call__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--touch-min);
  min-width: var(--touch-min);
  margin-top: 0.5rem;
  margin-left: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  touch-action: manipulation;
}
.call__btn:hover:not(:disabled) { background: var(--accent); color: #fff; }
.call__btn:disabled { opacity: 0.7; cursor: not-allowed; }
.call__btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.call__transcribe-result {
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: var(--bg);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
}
.call__transcribe-loading { color: var(--text-muted); margin: 0; }
.call__transcribe-label { font-weight: 600; margin: 0 0 0.25rem 0; color: var(--text-muted); }
.call__transcribe-text { margin: 0; white-space: pre-wrap; word-break: break-word; }
.call__transcribe-text--speakers { line-height: 1.5; }
.call__transcribe-error { margin: 0; color: var(--danger, #c53030); }

/* Legacy class for JS-generated content (direction badge) */
.call-direction.in { color: var(--in); }
.call-direction.out { color: var(--out); }

/* ===== Login page ===== */
.login {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  padding-left: max(1.5rem, env(safe-area-inset-left));
  padding-right: max(1.5rem, env(safe-area-inset-right));
  padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
  min-height: 100vh;
}
.login__card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 2rem 1.75rem;
  box-shadow: none;
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.login__card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}
.login__header { text-align: center; margin-bottom: 1.75rem; }
.login__icon { font-size: 2.5rem; display: block; margin-bottom: 0.5rem; }
.login__icon-wrap {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  box-shadow: none;
  overflow: hidden;
}
.login__icon-wrap img {
  width: 56px;
  height: 56px;
  display: block;
}
.login__title { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.03em; color: var(--text); margin-bottom: 0.35rem; }
.login__subtitle { font-size: 0.9rem; color: var(--text-muted); }
.login__form { display: flex; flex-direction: column; gap: 1.25rem; }
.login__error { font-size: 0.875rem; color: var(--danger); min-height: 1.25em; }
.form-group { display: flex; flex-direction: column; gap: 0.5rem; }
.form-label { font-size: 0.9375rem; font-weight: 500; color: var(--text); }
.input--full { width: 100%; min-height: var(--touch-min); font-size: 16px; }
.btn--block { width: 100%; margin-top: 0.25rem; min-height: var(--touch-min); padding: 0.75rem 1rem; font-size: 1rem; }

/* ===== Modal (смена логина/пароля) ===== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}
.modal.is-open {
  opacity: 1;
  visibility: visible;
}
.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
}
.modal__dialog {
  position: relative;
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}
.modal__title { font-size: 1.25rem; font-weight: 700; color: var(--text); margin-bottom: 0.5rem; }
.modal__text { font-size: 0.9375rem; color: var(--text-muted); margin-bottom: 1.25rem; }
.modal__form { display: flex; flex-direction: column; gap: 1rem; }
.modal__error { font-size: 0.875rem; color: var(--danger); min-height: 1.25em; }
.modal__actions { display: flex; gap: 0.75rem; justify-content: flex-end; margin-top: 0.5rem; }

/* ===== Global banners (ошибки, офлайн) ===== */
.app-banner {
  padding: 0.75rem 1rem;
  font-size: 0.9375rem;
  border-bottom: 1px solid var(--border);
}
.app-banner--hidden { display: none; }
.app-banner--error {
  background: linear-gradient(90deg, rgba(254, 226, 226, 0.95), rgba(254, 242, 242, 0.98));
  color: #991b1b;
}
.app-banner--offline {
  background: linear-gradient(90deg, rgba(254, 243, 199, 0.95), rgba(255, 251, 235, 0.98));
  color: #92400e;
}
.app-banner__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  justify-content: space-between;
}
.app-banner__text { flex: 1; min-width: 0; }
.btn--banner { flex-shrink: 0; }

/* ===== Dashboard: экспорт, ошибка ===== */
.section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: none;
}
.section__head .section__title { margin-bottom: 0; }
.section__toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
  justify-content: flex-end;
}
.section__toolbar--with-tabs {
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}
.requests-tabs {
  display: inline-flex;
  height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  overflow: hidden;
  background: rgba(15, 23, 42, 0.02);
}
.requests-tabs__btn {
  margin: 0;
  padding: 0.45rem 0.95rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.requests-tabs__btn:hover {
  color: var(--text);
  background: rgba(99, 102, 241, 0.08);
}
.requests-tabs__btn--active {
  color: #fff;
  background: var(--accent);
}
.requests-tabs__btn + .requests-tabs__btn {
  border-left: 1px solid rgba(148, 163, 184, 0.25);
}
#requests-search {
  flex: 1 1 220px;
  min-width: 0;
  width: auto;
  max-width: 500px;
}
#requests-clear-unaccepted-btn {
  flex-shrink: 0;
  white-space: nowrap;
}
.btn--sm {
  min-height: 34px;
  padding: 0.3rem 0.7rem;
  font-size: 0.8125rem;
}
.dashboard-error {
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
  border-radius: var(--radius-sm);
  background: rgba(254, 226, 226, 0.65);
  color: #991b1b;
  border: 1px solid rgba(220, 38, 38, 0.2);
  font-size: 0.9375rem;
}
.dashboard-error--hidden { display: none; }

/* ===== Requests ===== */
.requests-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  align-items: start;
}
.requests-footer {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
}

/* Card base */
.request-card {
  position: relative;
  display: flex;
  min-width: 0;
  container-type: inline-size;
  container-name: request-card;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: none;
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
}
.request-card:hover {
  box-shadow: var(--shadow-hover);
  transform: none;
  border-color: rgba(99, 102, 241, 0.22);
}
@keyframes request-in {
  from { opacity: 0; transform: translateY(-12px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}
.request-card--animate-in {
  animation: request-in 0.35s ease forwards;
}

/* Colored left stripe */
.request-card__stripe {
  width: 3px;
  flex-shrink: 0;
  background: var(--status-new);
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}
.request-card--accepted .request-card__stripe {
  background: var(--status-accepted);
}
.request-card--released .request-card__stripe {
  background: var(--danger);
}
.request-card--archived .request-card__stripe {
  background: var(--status-archived);
}

.request-card__delete {
  align-self: stretch;
  width: 1.75rem;
  min-width: 1.75rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  border: none;
  border-left: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--danger);
  cursor: pointer;
  transition: background-color var(--transition), color var(--transition);
}
.request-card__delete:hover {
  background: rgba(220, 38, 38, 0.1);
  color: var(--danger);
}
.request-card__delete:active {
  background: rgba(220, 38, 38, 0.16);
}
.request-card__delete:focus-visible {
  outline: 2px solid var(--danger);
  outline-offset: -2px;
  z-index: 1;
}
.request-card__delete svg {
  flex-shrink: 0;
  opacity: 0.8;
}
.request-card__delete:hover svg { opacity: 1; }

/* Inner content */
.request-card__inner {
  flex: 1;
  padding: 0.85rem 1rem;
  min-width: 0;
}

/* Head */
.request-card__head {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}
.request-card__head-left {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}
.request-card__title {
  font-size: clamp(0.75rem, 0.55rem + 1.1cqi, 1rem);
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
}
@supports not (container-type: inline-size) {
  .request-card__title {
    font-size: clamp(0.75rem, 0.65rem + 0.6vw, 1rem);
  }
}
.request-card__time {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
  padding-top: 0.1rem;
}

.request-card__compact {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.35rem 0.5rem;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.25;
  align-items: center;
  justify-content: space-between;
}
.request-card__compact-text {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  min-width: 0;
  flex: 1;
}
.request-card__bit {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.request-card__expand-btn {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.02);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
}
.request-card__expand-btn:hover {
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.25);
}
.request-card__expand-btn:active {
  transform: translateY(1px);
}
.request-card__expand-icon { display: block; }
.request-card--expanded .request-card__expand-icon { transform: rotate(180deg); }

.request-card__spoiler {
  border-top: 1px dashed rgba(148, 163, 184, 0.55);
  padding-top: 0.5rem;
  margin-top: 0.4rem;
}
.request-card__spoiler[hidden] { display: none; }
.request-card--expanded .request-card__grid { margin-top: 0.65rem; }

/* Status badge */
.request-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  width: fit-content;
}
.request-badge--new {
  background: var(--accent-soft);
  color: var(--status-new);
}
.request-badge--accepted {
  background: rgba(5, 150, 105, 0.12);
  color: var(--status-accepted);
}
.request-badge--released {
  background: rgba(220, 38, 38, 0.12);
  color: var(--danger);
}
.request-badge--archived {
  background: rgba(113, 113, 122, 0.15);
  color: var(--status-archived);
}

/* Data grid */
.request-card__grid {
  display: grid;
  gap: 0.3rem;
  margin-bottom: 0.75rem;
  border-top: 1px solid var(--border);
  padding-top: 0.6rem;
}
.request-card__row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
}
.request-card__label {
  font-size: 0.72rem;
  color: var(--text-muted);
  flex-shrink: 0;
  max-width: 38%;
  line-height: 1.3;
}
.request-card__value {
  font-size: clamp(0.7rem, 0.55rem + 0.85cqi, 0.8125rem);
  color: var(--text);
  text-align: right;
  flex: 1;
  min-width: 0;
  word-break: break-word;
  overflow-wrap: anywhere;
  font-weight: 500;
  line-height: 1.35;
}
.request-card__value .request-card__link {
  color: var(--primary);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.12em;
  word-break: break-all;
}
.request-card__value .request-card__link:hover {
  color: var(--primary-dark, #4f46e5);
}
@supports not (container-type: inline-size) {
  .request-card__value {
    font-size: clamp(0.7rem, 0.65rem + 0.35vw, 0.8125rem);
  }
}

/* Accepted row */
.request-card__accepted {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--success);
  margin-bottom: 0.6rem;
  background: rgba(5, 150, 105, 0.08);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.6rem;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.request-card__accepted svg { flex-shrink: 0; }
.request-card__accepted-date {
  margin-left: auto;
  font-size: 0.7rem;
  opacity: 0.7;
  flex-shrink: 0;
  white-space: nowrap;
}

/* Передача ответственного («Отжать») */
.request-card__handoff {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  background: rgba(99, 102, 241, 0.06);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.55rem;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.request-card__handoff svg { flex-shrink: 0; opacity: 0.85; }
.request-card__handoff-date {
  margin-left: auto;
  font-size: 0.68rem;
  opacity: 0.8;
}

/* Снята с себя (отжата) */
.request-card__released {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: #b91c1c;
  margin-bottom: 0.6rem;
  background: rgba(239,68,68,0.08);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.6rem;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.request-card__released svg { flex-shrink: 0; }
.request-card__released-date {
  margin-left: auto;
  font-size: 0.7rem;
  opacity: 0.75;
}

.request-card__archived {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: #475569;
  margin-bottom: 0.6rem;
  background: rgba(100, 116, 139, 0.08);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.6rem;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.request-card__archived svg { flex-shrink: 0; opacity: 0.85; }
.request-card__archived-date {
  margin-left: auto;
  font-size: 0.7rem;
  opacity: 0.75;
}

/* Actions row */
.request-card__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.6rem;
  flex-wrap: wrap;
}
.btn--accept {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.9rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--transition), transform 0.1s, box-shadow var(--transition);
  box-shadow: none;
}
.btn--accept:hover { background: var(--primary-dark); box-shadow: var(--shadow-hover); transform: none; }
.btn--accept:active { transform: scale(0.98); }
.btn--release {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.9rem;
  background: var(--danger);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--transition), transform 0.1s, box-shadow var(--transition);
  box-shadow: none;
}
.btn--release:hover {
  background: #b91c1c;
  box-shadow: var(--shadow-hover);
  transform: none;
}
.btn--release:active { transform: scale(0.98); }
.btn--archive {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.85rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.btn--archive:hover {
  border-color: #64748b;
  color: #475569;
  background: rgba(100, 116, 139, 0.08);
}
.btn--unarchive {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.85rem;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.btn--unarchive:hover {
  background: rgba(99, 102, 241, 0.14);
  border-color: rgba(99, 102, 241, 0.5);
}
.btn--comments {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  margin-left: auto;
  position: relative;
  min-width: 34px;
  min-height: 34px;
  justify-content: center;
}
.btn--comments:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(99,102,241,0.05);
}
.comments-count {
  font-weight: 800;
  font-size: 0.72rem;
  line-height: 1;
  color: #fff;
  background: #ef4444;
  border: 2px solid var(--surface);
  border-radius: 999px;
  padding: 0.18rem 0.35rem;
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 20px;
  text-align: center;
}
.comments-count[hidden] { display: none; }

/* Push button states */
.btn--push-on {
  border-color: var(--success) !important;
  color: var(--success) !important;
}

.requests-header-push {
  gap: 0.35rem;
}
.requests-header-push .btn__icon {
  flex-shrink: 0;
}

/* Comments section */
.comments-section {
  margin-top: 0.75rem;
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
}
.comments-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}
.comments-empty {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  padding: 0.5rem 0;
}
.comment-item {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
}
.comment-item__avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(99,102,241,0.15);
  color: var(--primary);
  font-size: 0.65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.comment-item__body {
  flex: 1;
  min-width: 0;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.65rem;
}
.comment-item__meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.2rem;
}
.comment-item__author {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text);
}
.comment-item__date {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-left: auto;
}
.comment-item__text {
  font-size: 0.8125rem;
  color: var(--text);
  word-break: break-word;
  white-space: pre-wrap;
  line-height: 1.45;
}
.add-comment {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
}
.add-comment__input {
  flex: 1;
  resize: vertical;
  min-height: 56px;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-size: 0.8125rem;
  font-family: inherit;
  transition: border-color 0.15s;
}
.add-comment__input:focus {
  outline: none;
  border-color: var(--primary);
}
.add-comment__btn {
  flex-shrink: 0;
  padding: 0.5rem 0.9rem;
  font-size: 0.8125rem;
}

/* ===== App prompt bar (install PWA + push notifications) ===== */
.app-prompt-bar {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.7rem 1.1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
  position: relative;
}
.app-prompt-bar[hidden] { display: none !important; }
.app-prompt-bar__inner {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.875rem;
  flex-wrap: wrap;
}
.app-prompt-bar__icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.app-prompt-bar__text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.app-prompt-bar__title {
  font-weight: 700;
  color: var(--text);
  font-size: 0.875rem;
}
.app-prompt-bar__desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.app-prompt-bar__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
.app-prompt-bar__close {
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: background var(--transition), color var(--transition);
}
.app-prompt-bar__close:hover { background: rgba(30,40,80,0.08); color: var(--text); }

/* ===== Requests nav badge ===== */
.requests-nav-link {
  position: relative;
}
.requests-badge {
  position: absolute;
  top: -6px;
  right: -8px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  background: #ef4444;
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 1px 4px rgba(239,68,68,0.4);
  pointer-events: none;
}
.requests-badge[hidden] { display: none !important; }

/* ===== Infinity scroll sentinel ===== */
.sentinel {
  height: 1px;
  width: 100%;
  margin-top: 0.5rem;
}

/* ===== PWA install bar (legacy alias) ===== */
.pwa-install-bar {
  display: none !important;
}

/* ===== Offline fallback page ===== */
.offline-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: #18181b;
}
.offline-page__card {
  background: #27272a;
  padding: 2rem;
  border-radius: var(--radius-md);
  box-shadow: none;
  border: 1px solid #3f3f46;
  text-align: center;
  max-width: 360px;
}
.offline-page__title { font-size: 1.25rem; margin-bottom: 0.5rem; color: #fafafa; }
.offline-page__text { color: #a1a1aa; margin-bottom: 1.25rem; }
.offline-page .btn--primary {
  background: var(--accent);
  color: #fff;
}

@media (prefers-reduced-motion: reduce) {
  .podium__slot:hover,
  .stat:hover,
  .card:hover,
  .request-card:hover,
  .call:hover {
    transform: none;
  }
  .podium__medal {
    animation: none;
  }
  .loading__spinner {
    animation: none;
    border-top-color: var(--accent);
  }
  .request-card--animate-in {
    animation: none;
  }
}

/* ===== Responsive & touch ===== */
@media (min-width: 640px) {
  .stats { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
  .stat { padding: 0.5rem 0.75rem; }
  .stat__value { font-size: clamp(1.125rem, 4vw, 1.375rem); }
  .stats--compact .stat__value { font-size: 1.0625rem; }
}

@media (max-width: 768px) {
  .main { padding: 1rem; padding-bottom: calc(1rem + env(safe-area-inset-bottom)); }
  .section { margin-bottom: 1.5rem; }
  .section__title { font-size: 0.75rem; }
  .section__head {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }
  .section__toolbar,
  .section__toolbar--with-tabs {
    width: 100%;
    justify-content: stretch;
  }
  .section__toolbar--with-tabs {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "tabs clear"
      "search search";
    gap: 0.5rem;
    align-items: center;
  }
  .requests-tabs { grid-area: tabs; }
  #requests-search {
    grid-area: search;
    width: 100%;
    max-width: none;
    flex: none;
  }
  #requests-clear-unaccepted-btn {
    grid-area: clear;
    justify-self: end;
  }
  .departments { grid-template-columns: 1fr; gap: 1rem; }
  .employee-list { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0.5rem; }
  .card { padding: 0.5rem 0.625rem; min-height: auto; gap: 0.25rem; }
  .card__action .btn { height: fit-content; min-height: 0; width: 100%; padding: 4px 12px; font-size: 0.8125rem; }
  .call { padding: 1rem; }
  .call__header { gap: 0.5rem; }
  .call__link, .call__btn { margin-top: 0.5rem; }
}

@media (max-width: 600px) {
  body { font-size: 15px; }
  .call-filters { flex-direction: column; align-items: stretch; }
  .call-filters .input--search { width: 100%; min-width: 0; }
  .header__inner {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
  }
  .header__inner--centered-title {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: auto;
    gap: 0.5rem 0.75rem;
    padding: 0.75rem 1rem;
    align-items: center;
  }
  .header__inner--centered-title .header__left { grid-column: 1; grid-row: 1; align-self: center; }
  .header__inner--centered-title .header__title--center {
    grid-column: 2;
    grid-row: 1;
    flex: none;
    justify-self: start;
    text-align: left;
    padding: 0;
    min-width: 0;
  }
  .header__inner--centered-title .header__actions {
    grid-column: 3;
    grid-row: 1;
    display: flex;
    flex-wrap: nowrap;
    gap: 0.375rem;
    align-items: center;
    justify-content: flex-end;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }
  .header__inner--centered-title .header__actions .input--period { min-width: 0; width: 5.5rem; flex-shrink: 0; }
  .header__inner--centered-title .header__actions .date-wrap { flex: 1; min-width: 0; }
  .header__inner--centered-title .header__actions .input--date { min-width: 0; width: 100%; }
  .header__inner--centered-title .header .btn { min-width: var(--touch-min); min-height: var(--touch-min); padding: 0.5rem 0.75rem; }
  .header__inner--centered-title .header .btn--icon { width: var(--touch-min); height: var(--touch-min); min-width: var(--touch-min); min-height: var(--touch-min); padding: 0; }
  .header__brand { min-height: 2rem; }
  .header__title { font-size: 1rem; }
  .header__actions {
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-start;
  }
  .date-wrap { flex: 1; min-width: 0; }
  .header .input--date,
  .input--date { min-width: 0; width: 100%; }
  .header .btn { min-width: var(--touch-min); }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 0.375rem; }
  .stat { padding: 0.5rem 0.625rem; }
  .stat__label { font-size: 0.625rem; }
  .stat__value { font-size: 1.125rem; }
  .stat__value--mono { font-size: 1rem; }
  .stats--compact .stat { padding: 0.5rem 0.625rem; }
  .stats--compact .stat__value { font-size: 1rem; }
  .main { padding: 0.75rem; padding-bottom: calc(0.75rem + env(safe-area-inset-bottom)); }
  .section { margin-bottom: 1.5rem; }
  .department__title { font-size: 0.875rem; margin-bottom: 0.375rem; }
  .card__title { font-size: 0.75rem; }
  .card__row { font-size: 0.75rem; }
  .login { padding: 1rem; }
  .login__card { padding: 1.5rem; }
  .login__title { font-size: 1.375rem; }
  .chart-bars--hours .chart-bar-wrap { min-width: 14px; max-width: 24px; }
  .chart-bars--days .chart-bar-wrap { min-width: 28px; max-width: 40px; }
  .chart-bar { height: 64px; }
  .input--period { min-width: 80px; }
}

@media (max-width: 380px) {
  .header__actions { justify-content: space-between; }
  .header .btn--ghost { min-width: 40px; padding: 0.5rem; }
  .header__inner--centered-title { padding: 0.625rem 0.75rem; gap: 0.625rem 0.75rem; }
  .header__inner--centered-title .header__title--center { font-size: 0.9375rem; }
  .requests-header-push span { display: none; }
}

@media (pointer: coarse) {
  .btn, .call__link, .call__btn { min-height: var(--touch-min); }
  .input { min-height: var(--touch-min); }
  .card { cursor: default; }
}
