/* Кабинет сотрудника — специфика страницы поверх общей дизайн-системы
   (/assets/theme.css: токены, шрифт Inter, свет+тёмная, базовые компоненты).
   Дизайн v2 «Solar Staff»: app-shell (sidebar ≥1024px / bottom-nav <1024px),
   hash-роутинг между 5 панелями (#/home #/receipts #/salary #/news #/profile).
   Палитра/типографика/радиусы/тени — из theme.css, здесь только специфика кабинета. */

/* Классы с display:flex/grid не должны перебивать атрибут hidden (экраны, алерты, тайлы, панели) */
[hidden] {
  display: none !important;
}

:root {
  --sidebar-w: 240px;
  --topbar-h: 56px;
  --bottom-nav-h: 64px;
  --bottomnav-shadow: 0 -2px 10px rgba(15, 23, 42, 0.05);
  /* Фирменный синий логотипа SolarGroup (#3a75ff с reg.solargroup.pro); в dark — светлее */
  --logo-color: #3a75ff;
}

/* Тень .bottom-nav захардкожена под светлый фон — в тёмной теме её не видно, заводим
   тёмный вариант той же переменной (тот же паттерн переключения темы, что в theme.css) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bottomnav-shadow: 0 -4px 14px rgba(0, 0, 0, 0.45);
    --logo-color: #7aa3ff;
  }
}

:root[data-theme='dark'] {
  --bottomnav-shadow: 0 -4px 14px rgba(0, 0, 0, 0.45);
  --logo-color: #7aa3ff;
}

/* ===== Логотип SolarGroup (symbol #solargroup-logo в index.html) ===== */
.brand-logo {
  display: block;
  width: 146px;
  aspect-ratio: 161.935 / 35.11;
  height: auto;
  color: var(--logo-color);
  fill: currentColor;
  flex: none;
}

.brand-logo--sm {
  width: 118px;
}

.brand-logo--login {
  width: 168px;
  margin: 0 auto;
}

/* ===== Узкие центрированные экраны (boot / login) ===== */
.wrap {
  width: 100%;
  max-width: min(1280px, 96vw);
  margin: 0 auto;
  padding: 24px 16px 56px;
}

.muted {
  color: var(--muted-fg);
}

/* ===== Карточки ===== */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  margin-bottom: 16px;
}

.card-title {
  margin: 0 0 14px;
  font-size: 14.5px;
  font-weight: 640;
  color: var(--heading);
}

.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.card-title-row .card-title {
  margin: 0;
}

.section-title {
  margin: 24px 0 12px;
  font-size: 15px;
  font-weight: 640;
  color: var(--heading);
}

/* ===== Кнопки: touch-таргеты не меньше 44px ===== */
.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: inherit;
  font-weight: 560;
  font-size: 14px;
  line-height: 1;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--fg);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: background 0.12s, border-color 0.12s, color 0.12s, box-shadow 0.12s, transform 0.05s;
}

.btn svg {
  width: 16px;
  height: 16px;
  flex: none;
}

.btn:not(:disabled):hover {
  background: var(--muted);
  text-decoration: none;
}

.btn:active {
  transform: translateY(0.5px);
}

.btn:disabled {
  opacity: 0.55;
  cursor: default;
  transform: none;
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-fg);
  border-color: transparent;
  box-shadow: var(--shadow-xs);
}

.btn-primary:not(:disabled):hover {
  background: var(--primary-hover);
}

.btn-primary:not(:disabled):active {
  background: var(--primary-active);
}

.btn-ghost {
  background: var(--surface);
  color: var(--fg);
  border-color: var(--input-border);
}

.btn-ghost:not(:disabled):hover {
  background: var(--muted);
}

.btn-danger {
  background: var(--surface);
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 35%, var(--input-border));
}

.btn-danger:not(:disabled):hover {
  background: var(--danger-wash);
}

.btn-block {
  width: 100%;
  min-height: 48px;
}

.btn-telegram svg {
  width: 18px;
  height: 18px;
}

/* Компактные кнопки в строках таблиц / хедлайна начислений — колонка «Листок» */
.btn-row {
  min-height: 40px;
  padding: 5px 12px;
  font-size: 12.5px;
  font-weight: 560;
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--primary);
  border-color: var(--input-border);
  white-space: nowrap;
  text-decoration: none;
}

.btn-row:not(:disabled):hover {
  background: var(--primary-wash);
}

/* Тач-таргет 44px на телефоне/тачскрине; на desktop с мышью 40px плотнее в таблице */
@media (pointer: coarse), (max-width: 560px) {
  .btn-row {
    min-height: 44px;
  }
}

/* «Отправлено ✓» — зелёная отметка, не приглушать как обычный disabled */
.btn-row.is-sent,
.btn-row.is-sent:disabled {
  opacity: 1;
  color: var(--success);
  background: var(--success-wash);
  border-color: color-mix(in srgb, var(--success) 40%, transparent);
}

/* Ссылка-кнопка «Отправить код повторно» / «Все новости →» */
.link-btn {
  appearance: none;
  min-height: 44px;
  padding: 8px;
  margin-top: 4px;
  font: inherit;
  font-weight: 560;
  font-size: 13.5px;
  color: var(--primary);
  background: none;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}

.link-btn:not(:disabled):hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

.link-btn:disabled {
  color: var(--subtle-fg);
  cursor: default;
}

#email-start .link-btn,
#email-verify .link-btn {
  width: 100%;
  justify-content: center;
}

/* ===== Поля формы ===== */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.field-row {
  display: flex;
  gap: 14px;
}

.field-row .field {
  flex: 1;
  min-width: 0;
}

@media (max-width: 640px) {
  .field-row {
    flex-direction: column;
    gap: 0;
  }
}

.field-label {
  font-size: 12.5px;
  font-weight: 560;
  color: var(--muted-fg);
}

.field-hint {
  font-size: 12px;
  color: var(--subtle-fg);
}

select,
input[type="text"],
input[type="email"],
input[type="file"] {
  appearance: none;
  width: 100%;
  font: inherit;
  font-size: 16px; /* 16px — iOS Safari не зумит страницу при фокусе */
  color: var(--fg);
  background: var(--surface);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  min-height: 44px;
  transition: border-color 0.12s, box-shadow 0.12s;
}

select {
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  cursor: pointer;
}

input::placeholder {
  color: var(--subtle-fg);
}

select:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="file"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--ring);
}

/* ===== Статусы, алерты, плашки ===== */
.status {
  padding: 32px 16px;
  text-align: center;
  color: var(--muted-fg);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}

.status.is-error {
  color: var(--danger);
}

.status .btn {
  margin-top: 12px;
}

.status-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted-fg);
}

.up-progress {
  margin-top: 12px;
  justify-content: center;
  text-align: left;
}

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  flex: none;
  vertical-align: -3px;
  border: 2.5px solid var(--border-strong);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.status .spinner {
  margin-right: 8px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.alert {
  border-radius: var(--radius);
  padding: 12px 15px;
  font-size: 13.5px;
  border: 1px solid var(--border);
  margin: 0 0 14px;
}

.alert-info {
  background: var(--primary-soft);
  border-color: color-mix(in srgb, var(--primary) 22%, transparent);
  color: color-mix(in srgb, var(--primary) 82%, var(--fg));
}

.alert-ok {
  background: var(--success-soft);
  border-color: color-mix(in srgb, var(--success) 26%, transparent);
  color: color-mix(in srgb, var(--success) 72%, var(--fg));
}

.alert-err {
  background: var(--danger-soft);
  border-color: color-mix(in srgb, var(--danger) 26%, transparent);
  color: color-mix(in srgb, var(--danger) 72%, var(--fg));
}

.alert-warn {
  background: var(--warning-soft);
  border-color: color-mix(in srgb, var(--warning) 30%, transparent);
  color: color-mix(in srgb, var(--warning) 78%, var(--fg));
}

/* Результат загрузки чека: зелёная плашка при совпадении сумм, жёлтая при прочих вердиктах */
.banner {
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-top: 14px;
  border: 1px solid var(--border);
}

.banner strong {
  display: block;
  margin-bottom: 4px;
  font-weight: 640;
}

.banner a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 6px;
  font-weight: 560;
}

.banner-ok {
  background: var(--success-soft);
  border-color: color-mix(in srgb, var(--success) 30%, transparent);
}

.banner-ok strong {
  color: color-mix(in srgb, var(--success) 72%, var(--fg));
}

.banner-warn {
  background: var(--warning-soft);
  border-color: color-mix(in srgb, var(--warning) 34%, transparent);
}

.banner-warn strong {
  color: color-mix(in srgb, var(--warning) 78%, var(--fg));
}

/* ===== Экран входа ===== */
.login-card {
  max-width: 420px;
  margin: 8vh auto 0;
  padding: 32px 28px;
  text-align: center;
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  position: relative;
}

/* Экран-контейнер логина: два мягких radial-пятна primary-wash на фоне */
#screen-login {
  position: relative;
  overflow: hidden;
}

#screen-login::before,
#screen-login::after {
  content: '';
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: var(--primary-wash);
  filter: blur(70px);
  pointer-events: none;
  z-index: -1;
}

#screen-login::before {
  top: -180px;
  left: -140px;
}

#screen-login::after {
  bottom: -200px;
  right: -160px;
}

.login-card h1 {
  margin: 14px 0 6px;
  font-size: 21px;
  font-weight: 680;
  letter-spacing: -0.02em;
  color: var(--heading);
}

.login-sub {
  margin: 0 0 22px;
  font-size: 14px;
  color: var(--muted-fg);
}

/* Разделитель «или» между входом через Telegram и по почте */
.login-or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: var(--subtle-fg);
  font-size: 12.5px;
}

.login-or::before,
.login-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

#email-start,
#email-verify {
  text-align: left;
}

.login-wait-status {
  justify-content: center;
}

.login-hint {
  margin: 16px 0 6px;
  font-size: 13px;
  color: var(--muted-fg);
}

.login-link {
  word-break: break-all;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

/* ===== App shell: sidebar (desktop) / topbar + bottom-nav (mobile) ===== */
.cab-shell {
  /* Mobile: topbar над контентом (column); desktop: sidebar слева (row) */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg);
}

@media (min-width: 1024px) {
  .cab-shell {
    flex-direction: row;
  }
}

.sidebar {
  display: none;
}

@media (min-width: 1024px) {
  .sidebar {
    display: flex;
    flex-direction: column;
    flex: none;
    width: var(--sidebar-w);
    position: sticky;
    top: 0;
    align-self: flex-start;
    height: 100vh;
    padding: 18px 14px 16px;
    border-right: 1px solid var(--border);
    background: var(--surface);
  }
}

.sidebar-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  padding: 8px 10px 22px;
}

.brand-caption {
  font-size: 11.5px;
  font-weight: 550;
  letter-spacing: 0.015em;
  color: var(--muted-fg);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.sidebar-foot {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 14px;
  margin-top: 14px;
  border-top: 1px solid var(--border);
}

.sidebar-foot .theme-toggle {
  align-self: flex-start;
  margin-left: 12px;
}

/* Пункт навигации — общий для sidebar и bottom-nav */
.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--muted-fg);
  font-weight: 550;
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s;
}

.nav-link:hover {
  background: var(--muted);
  color: var(--fg);
  text-decoration: none;
}

.nav-link.is-active,
.nav-link[aria-current="page"] {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 620;
}

.nav-icon {
  width: 20px;
  height: 20px;
  flex: none;
}

.nav-link .tab-badge {
  margin-left: auto;
}

/* ===== Top bar — мобильный sticky-хедер ===== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: var(--topbar-h);
  padding: 0 16px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}

@media (min-width: 1024px) {
  .topbar {
    display: none;
  }
}

.topbar-brand {
  display: flex;
  align-items: center;
}

/* ===== Основная зона контента ===== */
.main-content {
  flex: 1;
  min-width: 0;
}

.content-inner {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px 32px 56px;
}

@media (max-width: 1023px) {
  .content-inner {
    padding: 20px 16px calc(var(--bottom-nav-h) + env(safe-area-inset-bottom) + 24px);
  }
}

.panel-title {
  font-size: 21px;
  font-weight: 680;
  letter-spacing: -0.02em;
  color: var(--heading);
  margin: 0 0 4px;
}

/* Заголовок панели получает программный фокус при переходе между разделами (navigate()) —
   Кольцо не рисуем вовсе: h1[tabindex="-1"] — не интерактивный элемент (в Tab-порядок
   не входит), это цель программного фокуса для скринридеров; Safari, в отличие от Chrome,
   рисовал :focus-visible на программном фокусе даже при мышиной навигации. */
.panel-title:focus,
.panel-title:focus-visible {
  outline: none;
  box-shadow: none;
}

.panel-sub {
  margin: 0 0 20px;
  font-size: 13.5px;
  color: var(--muted-fg);
}

.panel-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.panel-head-row .panel-title {
  margin: 0;
}

/* Переход между разделами: fade + translateY(6px), 180ms ease-out */
.panel {
  animation: panel-in 180ms ease-out;
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .panel {
    animation: none;
  }
}

/* ===== Bottom nav — мобильная нижняя навигация ===== */
.bottom-nav {
  display: flex;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: var(--bottomnav-shadow);
}

@media (min-width: 1024px) {
  .bottom-nav {
    display: none;
  }
}

.bottom-nav .nav-link {
  flex: 1;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  min-height: var(--bottom-nav-h);
  padding: 8px 4px 6px;
  border-radius: 0;
  font-size: 11px;
  font-weight: 550;
  text-align: center;
  position: relative;
}

.bottom-nav .nav-link.is-active,
.bottom-nav .nav-link[aria-current="page"] {
  background: transparent;
  font-weight: 620;
}

.bottom-nav .nav-link .tab-badge {
  position: absolute;
  top: 4px;
  left: calc(50% + 6px);
  margin-left: 0;
}

/* ===== Плитки-показатели ===== */
.tiles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}

@media (min-width: 560px) {
  .tiles {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }
}

.tiles:empty {
  display: none;
}

.tile {
  display: flex;
  flex-direction: column;
  padding: 16px 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
}

a.tile.tile-link {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: border-color 0.12s, box-shadow 0.12s;
}

a.tile.tile-link:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
}

.tile-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--primary-wash);
  color: var(--primary);
  margin-bottom: 10px;
}

.tile-icon svg {
  width: 17px;
  height: 17px;
}

.tile-label {
  font-size: 12px;
  font-weight: 550;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted-fg);
}

.tile-value {
  margin-top: 6px;
  font-size: 22px;
  font-weight: 700;
  color: var(--heading);
  letter-spacing: -0.02em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.tile-sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted-fg);
}

/* ===== Главная: hero-карточка «Начислено за период» ===== */
.hero-card {
  padding: 24px;
  margin-bottom: 16px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, var(--primary-soft), var(--card) 65%);
  box-shadow: var(--shadow-sm);
}

.hero-card:empty {
  display: none;
}

.hero-top {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.hero-period {
  font-size: 13.5px;
  font-weight: 560;
  color: var(--muted-fg);
}

.hero-sum {
  font-size: 38px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--heading);
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  margin: 4px 0 18px;
}

/* «в т.ч. компенсация налога … · чек — на …» под суммой hero */
.hero-tax {
  font-size: 13.5px;
  color: var(--muted-fg);
  font-variant-numeric: tabular-nums;
  margin: -12px 0 18px;
}

.hero-tax b {
  font-weight: 640;
  color: var(--heading);
}

/* Ожидаемая сумма чека за выбранный месяц в форме загрузки */
.up-expected {
  font-size: 13px;
  color: var(--muted-fg);
  font-variant-numeric: tabular-nums;
  background: var(--primary-soft);
  border: 1px solid color-mix(in srgb, var(--primary) 18%, transparent);
  border-radius: var(--radius);
  padding: 10px 13px;
  margin-bottom: 14px;
}

.up-expected b {
  font-weight: 640;
  color: var(--heading);
  white-space: nowrap;
}

.hero-card .pdf-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.hero-empty {
  text-align: center;
  padding: 18px 10px;
  color: var(--muted-fg);
}

.hero-empty svg {
  width: 34px;
  height: 34px;
  margin-bottom: 10px;
  color: var(--subtle-fg);
}

.hero-empty p {
  margin: 0;
  font-size: 14px;
}

/* ===== Quick action: «Загрузить чек» ===== */
.quick-action {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  margin-bottom: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.12s, box-shadow 0.12s;
}

.quick-action:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
}

.quick-action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--primary-wash);
  color: var(--primary);
  flex: none;
}

.quick-action-icon svg {
  width: 20px;
  height: 20px;
}

.quick-action-body {
  flex: 1;
  min-width: 0;
}

.quick-action-title {
  display: block;
  font-weight: 620;
  color: var(--heading);
  font-size: 14.5px;
}

.quick-action-sub {
  display: block;
  margin-top: 2px;
  font-size: 12.5px;
  color: var(--muted-fg);
}

.quick-action-arrow {
  width: 18px;
  height: 18px;
  color: var(--subtle-fg);
  flex: none;
}

/* ===== Превью новостей на главной ===== */
.news-preview-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.news-preview-item {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.news-preview-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.news-preview-title {
  font-weight: 620;
  font-size: 14px;
  color: var(--heading);
}

.news-preview-date {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted-fg);
}

.news-preview-text {
  margin-top: 6px;
  font-size: 13.5px;
  color: var(--muted-fg);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== Callout: «Выплаты для самозанятых и ИП» (не-чековые сотрудники) ===== */
.callout-card {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.callout-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  flex: none;
  background: var(--warning-wash);
  color: var(--warning);
}

.callout-icon svg {
  width: 22px;
  height: 22px;
}

.callout-body {
  flex: 1;
  min-width: 220px;
}

.callout-body .card-title {
  margin-bottom: 4px;
}

.callout-text {
  margin: 0;
  font-size: 13.5px;
  color: var(--muted-fg);
  line-height: 1.5;
}

.callout-cta {
  flex: none;
}

/* ===== Зона загрузки чека — drag&drop ===== */
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  padding: 28px 16px;
  margin-bottom: 16px;
  border: 2px dashed var(--input-border);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  cursor: pointer;
  position: relative;
  transition: border-color 0.12s, background 0.12s;
}

.dropzone:hover,
.dropzone.is-dragover {
  border-color: var(--primary);
  background: var(--primary-wash);
}

/* #up-file растянут прозрачным поверх дропзоны (opacity:0) — стандартный :focus-visible
   на самом инпуте не виден, отмечаем фокус-кольцом контейнер */
.dropzone:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--ring);
}

.dropzone-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.dropzone-icon {
  width: 26px;
  height: 26px;
  color: var(--muted-fg);
}

.dropzone-text {
  font-size: 13.5px;
  font-weight: 560;
  color: var(--fg);
}

.dropzone-file {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.dropzone-file-icon {
  width: 18px;
  height: 18px;
  color: var(--muted-fg);
  flex: none;
}

.dropzone-file-name {
  font-size: 13.5px;
  font-weight: 560;
  color: var(--heading);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropzone-file-size {
  font-size: 12px;
  color: var(--muted-fg);
  flex: none;
}

.dropzone-file-remove {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted-fg);
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: none;
}

.dropzone-file-remove:hover {
  background: var(--muted);
  color: var(--danger);
}

.dropzone-file-remove svg {
  width: 16px;
  height: 16px;
}

/* ===== Профиль: личные данные ===== */
.profile-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.profile-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.profile-label {
  color: var(--muted-fg);
  font-size: 12.5px;
  font-weight: 560;
}

.profile-value {
  color: var(--heading);
  font-weight: 560;
  text-align: right;
  overflow-wrap: anywhere;
}

.profile-logout-row {
  margin-top: 20px;
  padding-top: 4px;
}

/* ===== Таблица «Мои чеки» / начисления ===== */
.table-card {
  padding: 4px 16px;
  overflow-x: auto;
}

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

.receipts-table thead th {
  text-align: left;
  color: var(--muted-fg);
  font-weight: 580;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 11px 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.receipts-table tbody td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.receipts-table tbody tr:last-child td {
  border-bottom: none;
}

.receipts-table th.num,
.receipts-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.receipts-table td.nowrap {
  white-space: nowrap;
}

.receipts-table strong {
  font-weight: 640;
  color: var(--heading);
}

/* Цвет сравнения сумм — дополнение к символу ✅/❌/❗️ в тексте, не единственный канал */
.cmp-ok { color: var(--success); }
.cmp-bad { color: var(--danger); }
.cmp-warn { color: var(--muted-fg); }

/* Иконки статусов в ячейках таблицы чеков и плашке результата — вместо эмодзи из API */
.cell-flag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 560;
}

.cell-ico {
  width: 15px;
  height: 15px;
  flex: none;
}

.cell-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 560;
}

.cell-link .cell-ico {
  width: 13px;
  height: 13px;
}

.banner-cmp {
  margin-top: 2px;
}

.banner-cmp .cell-flag { font-weight: 600; }
.banner-ok .banner-cmp .cell-flag { color: var(--success); }
.banner-warn .banner-cmp .cell-flag { color: color-mix(in srgb, var(--warning) 78%, var(--fg)); }

/* Статус чека: «Проверен» (обычный текст) — зелёный; «Отклонён» (.cmp-bad) — красный;
   «— на проверке» (.muted) — нейтральный. Вложенные span'ы перебивают цвет ячейки. */
.receipts-table td[data-label="Статус"] {
  color: var(--success);
  font-weight: 560;
}

.receipts-table td[data-label="Статус"] .cmp-bad {
  color: var(--danger);
}

.receipts-table td[data-label="Статус"] .muted {
  color: var(--muted-fg);
  font-weight: 400;
}

/* Статус-бейдж (новый вид, опционально): success/neutral/danger */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 560;
  white-space: nowrap;
}

.status-badge svg {
  width: 13px;
  height: 13px;
}

.status-badge--success {
  background: var(--success-wash);
  color: var(--success);
}

.status-badge--neutral {
  background: var(--muted);
  color: var(--muted-fg);
}

.status-badge--danger {
  background: var(--danger-wash);
  color: var(--danger);
}

/* Колонка «Листок»: две компактные кнопки + место под ошибку отправки */
.pdf-actions {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}

.pdf-msg {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--danger);
}

/* На телефоне таблица превращается в карточки: подписи колонок — через data-label */
@media (max-width: 560px) {
  .table-card {
    background: none;
    border: none;
    box-shadow: none;
    padding: 0;
    margin-bottom: 0;
    overflow: visible;
  }

  .receipts-table,
  .receipts-table tbody,
  .receipts-table tr,
  .receipts-table td {
    display: block;
  }

  .receipts-table thead {
    display: none;
  }

  .receipts-table tr {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 4px 14px;
    margin-bottom: 10px;
  }

  .receipts-table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    padding: 9px 0;
    text-align: right;
    white-space: normal;
  }

  .receipts-table tbody td::before {
    content: attr(data-label);
    flex: none;
    color: var(--muted-fg);
    font-weight: 500;
    text-align: left;
  }

  .receipts-table td:last-child {
    border-bottom: none;
  }

  /* Пустая ячейка «Листок» (строки без начислений) на телефоне не показываем */
  .receipts-table td.pdf-cell-empty {
    display: none;
  }

  /* Ошибка отправки — на всю ширину карточки под кнопками */
  .receipts-table td.pdf-cell {
    flex-wrap: wrap;
  }

  .pdf-cell .pdf-msg {
    flex-basis: 100%;
    text-align: right;
  }
}

/* ===== Скелетон списка чеков ===== */
/* Контейнер #receipts-skeleton (.skeleton) — просто обёртка; шиммер даёт .skeleton-row */
.skeleton {
  background: none;
  animation: none;
  border-radius: 0;
}

.skeleton-row {
  height: 64px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 10px;
  background: linear-gradient(90deg, var(--muted) 25%, var(--surface-2) 50%, var(--muted) 75%);
  background-size: 200% 100%;
  animation: cab-shimmer 1.3s linear infinite;
}

@keyframes cab-shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton-row,
  .spinner {
    animation: none;
  }
}

/* ===== Чарт начислений / чеков (тот же подход, что в дашборде) ===== */
.chart {
  overflow-x: auto;
}

.chart svg {
  display: block;
  width: 100%;
  height: auto;
}

/* Читаемость на узких экранах: график шире вьюпорта, скролл только там */
@media (max-width: 700px) {
  .chart svg {
    min-width: 640px;
  }
}

.chart .gridline {
  stroke: var(--chart-grid);
  stroke-width: 1;
}

.chart .baseline {
  stroke: var(--border-strong);
  stroke-width: 1;
}

.chart .tick-label,
.chart .x-label {
  fill: var(--muted-fg);
  font-size: 11px;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
}

.chart .bar path {
  fill: var(--chart-bar);
  transition: fill 0.12s;
}

.chart .bar:hover path {
  fill: var(--chart-bar-hover);
}

/* невидимая зона наведения на всю высоту столбца */
.chart .bar .hit {
  fill: transparent;
}

.chart-empty {
  padding: 28px;
  text-align: center;
  color: var(--muted-fg);
}

/* ===== Tooltip графиков ===== */
.chart-tip {
  position: fixed;
  z-index: 100;
  min-width: 168px;
  max-width: 270px;
  padding: 11px 13px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  pointer-events: none;
}

.chart-tip-head {
  font-weight: 680;
  color: var(--heading);
  margin-bottom: 7px;
}

.chart-tip-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 2px 0;
  color: var(--muted-fg);
}

.chart-tip-row b {
  font-weight: 600;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.chart-tip-total {
  margin-top: 5px;
  padding-top: 7px;
  border-top: 1px solid var(--border);
  color: var(--fg);
}

/* Цветная точка категории в строке тултипа (стековый график начислений) */
.tip-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 3px;
  margin-right: 7px;
  vertical-align: 0;
  flex: none;
}

/* Линия среднего уровня начислений */
.chart .avg-line {
  stroke: var(--heading);
  stroke-opacity: 0.55;
  stroke-width: 1.5;
  stroke-dasharray: 6 5;
}

/* Маркер линии среднего в легенде */
.legend-avg {
  display: inline-block;
  width: 16px;
  height: 0;
  border-top: 2px dashed color-mix(in srgb, var(--heading) 55%, transparent);
  flex: none;
}

/* ===== Лента новостей (кабинет) ===== */
.tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--primary);
  color: var(--primary-fg);
  font-size: 11px;
  font-weight: 650;
  line-height: 1;
  vertical-align: middle;
}

.news-feed {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.news-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 18px 20px;
}
.news-card.is-unread {
  border-color: color-mix(in srgb, var(--primary) 40%, var(--border));
  box-shadow: var(--shadow-sm), inset 3px 0 0 var(--primary);
}
.news-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.news-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary-wash);
  color: var(--primary);
  font-size: 12px;
  font-weight: 650;
  flex: none;
}
.news-card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 640;
  color: var(--heading);
  flex: 1;
}
.news-new {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-wash);
  padding: 3px 8px;
  border-radius: 999px;
  flex: none;
}
.news-card-date {
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--muted-fg);
}
.news-card-body {
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--fg);
  white-space: pre-wrap;
  word-break: break-word;
}

.empty {
  text-align: center;
  color: var(--muted-fg);
  padding: 40px 20px;
  font-size: 13.5px;
}
.empty svg {
  width: 36px;
  height: 36px;
  margin: 0 auto 12px;
  color: var(--subtle-fg);
  opacity: 0.8;
  display: block;
}

/* ===== Заявка на выплаты (ИП/самозанятый) ===== */
.apply-card .apply-text {
  margin: 0 0 14px;
  color: var(--muted-fg);
  font-size: 14px;
  line-height: 1.6;
}
#apply-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.apply-seg {
  display: flex;
  gap: 3px;
  padding: 4px;
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 340px;
}
.apply-seg-btn {
  flex: 1;
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted-fg);
  font: inherit;
  font-weight: 560;
  font-size: 13.5px;
  min-height: 44px;
  padding: 9px 14px;
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, box-shadow 0.12s;
}
.apply-seg-btn:hover {
  color: var(--fg);
}
.apply-seg-btn.is-active {
  background: var(--surface);
  color: var(--heading);
  box-shadow: var(--shadow-xs);
  font-weight: 600;
}
.apply-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
#apply-file {
  font-size: 13.5px;
  color: var(--muted-fg);
}

/* ===== Совмещённый график: начисления (голубой) + чеки (жёлтый) ===== */
.chart .bar-salary path { fill: var(--chart-bar); }
.chart .bar-salary:hover path { fill: var(--chart-bar-hover); }
.chart .bar-receipts path { fill: var(--chart-bar-2); }
.chart .bar-receipts:hover path { fill: var(--chart-bar-2-hover); }

.chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.chart-head .card-title { margin: 0; }
.chart-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap; /* легенда стекового графика шире мобильного экрана — переносим */
  gap: 8px 16px;
  font-size: 12.5px;
  color: var(--muted-fg);
}
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 550;
}
.legend-dot {
  width: 11px;
  height: 11px;
  border-radius: 3px;
  flex: none;
}
.legend-dot.legend-salary { background: var(--chart-bar); }
.legend-dot.legend-receipts { background: var(--chart-bar-2); }

/* ===== Бейдж статуса сотрудника (hero / профиль) ===== */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--primary-wash);
  color: var(--primary);
  font-size: 12px;
  font-weight: 560;
  white-space: nowrap;
}

.badge::before {
  content: none;
}

/* Привязка Telegram в профиле (SPEC §8.5): статус «Привязан ✓» */
.badge-success {
  background: var(--success-wash);
  color: var(--success);
}

.doc-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 560;
}

/* ===== Загрузка документа о налоговом режиме (в вебе) ===== */
.docs-upload {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.docs-upload input[type="file"] {
  font-size: 13.5px;
  color: var(--muted-fg);
}
