/* ============================================================
   Дизайн-система — «Отчёты»
   Холодный dark интерфейс, голубой акцент, стеклянные панели.
   Все классы-хуки сохранены для совместимости с app.js.
   ============================================================ */

:root {
  color-scheme: dark;

  --bg: #03060a;
  --bg-2: #080d14;
  --panel: rgba(29, 36, 49, 0.86);
  --panel-solid: #192130;
  --panel-strong: #202b3c;
  --surface: rgba(24, 32, 45, 0.78);
  --field: #1b2534;
  --field-strong: #223148;
  --sidebar: rgba(6, 11, 19, 0.95);

  --ink: #ffffff;
  --ink-soft: #eef5ff;
  --muted: #b7c7dc;
  --faint: #8fa3bd;
  --line: rgba(164, 214, 255, 0.2);
  --line-strong: rgba(164, 214, 255, 0.36);

  --accent: #8cd3ff;
  --accent-2: #c8ecff;
  --accent-glow: rgba(92, 178, 255, 0.42);
  --blue: #8cd3ff;
  --blue-strong: #c2e9ff;

  --green: #5ee2a7;
  --green-dark: #7cf0bd;
  --amber: #ffd36a;
  --red: #ff747b;

  --button-text: #ffffff;
  --nav-text: #c1cee0;

  --soft-blue: rgba(140, 211, 255, 0.18);
  --soft-green: rgba(94, 226, 167, 0.18);
  --soft-danger: rgba(255, 116, 123, 0.18);
  --soft-warning: rgba(255, 211, 106, 0.2);

  --grad-accent: linear-gradient(180deg, #a7ddff 0%, #78c8ff 48%, #4aa5ed 100%);
  --grad-panel: linear-gradient(180deg, rgba(210, 235, 255, 0.11), rgba(210, 235, 255, 0.015));

  --shadow: 0 24px 70px rgba(0, 0, 0, 0.58);
  --shadow-sm: 0 10px 28px rgba(0, 0, 0, 0.36);
  --shadow-lg: var(--shadow);
  --shadow-glow: 0 18px 42px rgba(75, 165, 237, 0.3);

  --r: 14px;
  --r-sm: 10px;
  --r-md: var(--r);
  --r-lg: 18px;
  --r-pill: 999px;

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

body[data-theme="light"] {
  color-scheme: light;

  --bg: #eef4fb;
  --bg-2: #e5edf7;
  --panel: rgba(255, 255, 255, 0.84);
  --panel-solid: #ffffff;
  --panel-strong: #f1f6fc;
  --surface: rgba(245, 249, 254, 0.78);
  --field: #f8fbff;
  --field-strong: #edf4fb;
  --sidebar: rgba(248, 251, 255, 0.9);

  --ink: #0b1c30;
  --ink-soft: #1f344b;
  --muted: #4b6178;
  --faint: #657b93;
  --line: rgba(55, 112, 168, 0.18);
  --line-strong: rgba(55, 112, 168, 0.32);

  --accent: #258fe8;
  --accent-2: #6fc4ff;
  --accent-glow: rgba(37, 143, 232, 0.24);
  --blue: #258fe8;
  --blue-strong: #176fb8;

  --green: #139d72;
  --green-dark: #0f7a58;
  --amber: #bb850e;
  --red: #d84f59;

  --button-text: #ffffff;
  --nav-text: #42576e;

  --soft-blue: rgba(37, 143, 232, 0.12);
  --soft-green: rgba(19, 157, 114, 0.12);
  --soft-danger: rgba(216, 79, 89, 0.11);
  --soft-warning: rgba(187, 133, 14, 0.13);

  --grad-accent: linear-gradient(180deg, #78cbff 0%, #2f9dec 52%, #1678c8 100%);
  --grad-panel: linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0));

  --shadow: 0 18px 44px rgba(24, 63, 102, 0.13);
  --shadow-sm: 0 6px 18px rgba(24, 63, 102, 0.09);
  --shadow-glow: 0 14px 32px rgba(37, 143, 232, 0.2);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  letter-spacing: 0;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(118deg, transparent 0 18%, rgba(160, 215, 255, 0.045) 23%, transparent 35% 100%),
    linear-gradient(62deg, transparent 0 42%, rgba(255, 255, 255, 0.035) 49%, transparent 60% 100%),
    linear-gradient(142deg, rgba(7, 13, 22, 0.2), transparent 34%, rgba(3, 6, 10, 0.55) 76%),
    repeating-linear-gradient(90deg, rgba(124, 200, 255, 0.018) 0 1px, transparent 1px 68px),
    radial-gradient(1200px circle at 52% -18%, rgba(103, 184, 243, 0.12), transparent 58%),
    linear-gradient(180deg, var(--bg-2), var(--bg));
}

body::after {
  content: "";
  position: fixed;
  inset: -18%;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(125deg, transparent 8%, rgba(255, 255, 255, 0.035) 20%, rgba(255, 255, 255, 0.008) 31%, transparent 43%),
    linear-gradient(68deg, transparent 38%, rgba(120, 200, 255, 0.045) 49%, transparent 58%),
    linear-gradient(160deg, transparent 55%, rgba(255, 255, 255, 0.028) 66%, transparent 77%);
  filter: blur(22px);
  opacity: 0.9;
}

body[data-theme="light"]::before {
  background:
    linear-gradient(118deg, transparent 0 18%, rgba(37, 143, 232, 0.05) 23%, transparent 36% 100%),
    repeating-linear-gradient(90deg, rgba(37, 143, 232, 0.028) 0 1px, transparent 1px 68px),
    radial-gradient(1000px circle at 50% -8%, rgba(37, 143, 232, 0.16), transparent 50%),
    linear-gradient(180deg, #f7fbff, var(--bg));
}

body[data-theme="light"]::after {
  opacity: 0.32;
}

body[data-theme="light"] .login-card,
body[data-theme="light"] .modal {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0)),
    rgba(255, 255, 255, 0.9);
}

body[data-theme="light"] .topbar-actions button,
body[data-theme="light"] .import-button,
body[data-theme="light"] .ghost-button,
body[data-theme="light"] .icon-button,
body[data-theme="light"] .delete-button,
body[data-theme="light"] .extra-chip,
body[data-theme="light"] .tx-type-btn {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0)),
    rgba(255, 255, 255, 0.72);
}

body[data-theme="light"] .sidebar-note,
body[data-theme="light"] .table-wrap,
body[data-theme="light"] .payroll-tool-card,
body[data-theme="light"] .admin-shift-card,
body[data-theme="light"] .shift-detail-stat,
body[data-theme="light"] .shift-detail-section {
  background: rgba(255, 255, 255, 0.64);
}

body[data-theme="light"] thead th {
  background: rgba(240, 247, 255, 0.96);
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

::selection {
  background: var(--accent-glow);
  color: var(--ink);
}

/* ---------- Скроллбар ---------- */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: var(--r-pill);
  border: 2px solid transparent;
  background-clip: content-box;
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--faint);
  background-clip: content-box;
}

/* ============================================================
   Экран входа
   ============================================================ */
.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.36)),
    radial-gradient(520px circle at 50% 52%, rgba(124, 200, 255, 0.08), transparent 68%);
}

.login-card {
  position: relative;
  width: min(392px, 100%);
  display: grid;
  gap: 17px;
  border: 1px solid rgba(150, 205, 255, 0.14);
  border-radius: var(--r-lg);
  padding: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0)),
    rgba(22, 25, 33, 0.78);
  backdrop-filter: blur(22px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 28px 90px rgba(0, 0, 0, 0.62);
  overflow: hidden;
}

.login-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(124, 200, 255, 0.08);
}

.login-brand {
  color: var(--ink);
}

.login-brand span:not(.brand-mark) {
  color: var(--faint);
}

.login-card h1 {
  font-size: 28px;
}

.login-error {
  margin: 0;
  border: 1px solid rgba(255, 96, 114, 0.35);
  border-radius: var(--r-sm);
  padding: 11px 13px;
  background: var(--soft-danger);
  color: var(--red);
  font-weight: 700;
  font-size: 14px;
}

.login-hint {
  margin: 0;
  color: var(--faint);
  font-size: 13px;
  text-align: center;
}

/* ============================================================
   Каркас приложения
   ============================================================ */
.app-shell {
  display: grid;
  grid-template-columns: 258px minmax(0, 1fr);
  min-height: 100vh;
}

.app-shell[hidden],
.login-screen[hidden] {
  display: none !important;
}

/* ---------- Сайдбар ---------- */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px 16px;
  background:
    linear-gradient(180deg, rgba(124, 200, 255, 0.045), transparent 28%),
    var(--sidebar);
  backdrop-filter: blur(24px);
  border-right: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 4px 8px;
  min-height: 68px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border: 1px solid rgba(194, 233, 255, 0.28);
  border-radius: 18px;
  background: var(--panel-strong);
  color: #06121d;
  font-weight: 800;
  font-size: 20px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 16px 36px rgba(70, 170, 245, 0.2);
  overflow: hidden;
}

.brand-mark svg {
  display: none;
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-mark::before {
  content: "";
  display: none;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  border: 1px solid rgba(6, 18, 29, 0.24);
  background: rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  color: var(--ink);
  font-size: 22px;
  line-height: 1.1;
  letter-spacing: 0;
}

.brand span {
  color: var(--faint);
  font-size: 12.5px;
  font-weight: 650;
}

.login-brand .brand-message {
  max-width: 250px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.35;
}

.nav {
  display: grid;
  gap: 4px;
}

.nav-group {
  display: grid;
  gap: 4px;
}

.nav-group[hidden] {
  display: none;
}

.nav-group + .nav-group {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.nav-label {
  padding: 2px 13px 6px;
  color: var(--blue-strong);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

.nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 13px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  color: var(--nav-text);
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 180ms var(--ease), background 180ms var(--ease), color 180ms var(--ease), transform 120ms var(--ease);
}

.nav a svg {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
  opacity: 0.85;
}

.nav a[hidden] {
  display: none;
}

.nav a:hover {
  background: var(--soft-blue);
  border-color: var(--line);
  color: var(--ink);
}

.nav a.active {
  background: var(--grad-accent);
  color: #06121d;
  box-shadow: var(--shadow-glow);
}

.nav a.active svg {
  opacity: 1;
}

.sidebar-note {
  margin-top: auto;
  display: grid;
  gap: 10px;
  padding: 15px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: rgba(24, 32, 45, 0.78);
  color: var(--ink-soft);
  font-size: 12.5px;
  line-height: 1.4;
}

.sidebar-note button {
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  padding: 9px 10px;
  background: transparent;
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 13px;
  transition: border-color 160ms var(--ease), color 160ms var(--ease);
}

.sidebar-note button:hover {
  border-color: var(--red);
  color: var(--red);
}

/* ---------- Основная область ---------- */
main {
  min-width: 0;
  width: 100%;
  padding: 28px 34px 44px;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
  flex-wrap: wrap;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--blue-strong);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1.12;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(26px, 3.2vw, 38px);
  font-weight: 800;
}

h2 {
  font-size: 19px;
  font-weight: 700;
}

.topbar-actions,
.filters,
.panel-heading {
  display: flex;
  align-items: center;
  gap: 9px;
}

.topbar-actions {
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 10px;
}

.table-actions {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.table-actions[hidden],
body[data-page="dashboard"] .table-actions,
body[data-page="employees"] .table-actions,
body[data-page="processing"] .table-actions {
  display: none !important;
}

.profile-switcher {
  display: grid;
  gap: 6px;
  min-width: 184px;
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0;
}

.profile-switcher select {
  height: 46px;
  min-height: 46px;
  margin-top: 0;
}

/* ---------- Кнопки в топбаре (вторичные) ---------- */
.topbar-actions button,
.import-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  border: 1px solid rgba(164, 214, 255, 0.28);
  border-radius: var(--r-sm);
  padding: 0 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0)),
    rgba(24, 32, 45, 0.82);
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045);
  transition: border-color 160ms var(--ease), background 160ms var(--ease), color 160ms var(--ease), transform 120ms var(--ease), box-shadow 160ms var(--ease);
}

.topbar-actions button:hover,
.import-button:hover {
  border-color: var(--accent);
  color: var(--ink);
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.075),
    0 12px 30px rgba(75, 165, 237, 0.12);
}

.import-button {
  cursor: pointer;
  border-style: dashed;
}

.import-button input {
  display: none;
}

.theme-toggle {
  min-width: 108px;
}

.theme-toggle::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}

#exportCsv {
  border-color: rgba(94, 226, 167, 0.38);
  color: var(--green-dark);
}

#exportCsv:hover {
  border-color: var(--green);
}

#logoutButton:hover {
  border-color: var(--red);
  color: var(--red);
}

/* ---------- Основная (акцентная) кнопка ---------- */
.primary-button {
  position: relative;
  width: 100%;
  border: 1px solid rgba(167, 221, 255, 0.72);
  border-radius: var(--r-sm);
  padding: 12px 16px;
  background: var(--grad-accent);
  color: #06121d;
  font-weight: 700;
  font-size: 14.5px;
  text-shadow: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.48),
    var(--shadow-glow);
  transition: transform 120ms var(--ease), box-shadow 200ms var(--ease), filter 160ms var(--ease);
}

.primary-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.56),
    0 22px 48px var(--accent-glow);
}

.primary-button:active {
  transform: translateY(0);
}

.panel-heading .primary-button {
  width: auto;
  padding: 10px 18px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border-radius: var(--r-pill);
  padding: 5px 13px;
  background: var(--soft-blue);
  color: var(--blue-strong);
  font-size: 12.5px;
  font-weight: 700;
}

/* ============================================================
   Карточки-метрики
   ============================================================ */
.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 15px;
}

.page {
  min-width: 0;
}

.page[hidden] {
  display: none !important;
}

.page > .panel + .panel,
.page > form + .panel {
  margin-top: 18px;
}

#operations {
  display: grid;
  gap: 18px;
}

.metrics article {
  position: relative;
  padding: 20px;
  border: 1px solid rgba(164, 214, 255, 0.24);
  border-radius: var(--r);
  background:
    var(--grad-panel),
    var(--panel);
  backdrop-filter: blur(16px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    var(--shadow-sm);
  overflow: hidden;
  transition: transform 180ms var(--ease), border-color 180ms var(--ease);
}

.metrics article:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
}

.metrics article::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--accent);
  opacity: 0.7;
}

.metrics article:nth-child(2)::after {
  background: var(--green);
}

.metrics article:nth-child(3)::after {
  background: var(--amber);
}

.metrics span,
.report-grid span {
  display: block;
  color: var(--faint);
  font-size: 13px;
  font-weight: 650;
}

.metrics strong {
  display: block;
  margin-top: 11px;
  font-size: 29px;
  font-weight: 800;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.net-card::after {
  width: 100% !important;
  height: 3px;
  bottom: auto !important;
  background: var(--grad-accent) !important;
  opacity: 1 !important;
}

.net-card strong {
  background: var(--grad-accent);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ============================================================
   Панели
   ============================================================ */
.workspace {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(360px, 1.3fr) minmax(310px, 0.7fr);
  gap: 18px;
  margin-bottom: 18px;
}

.panel {
  min-width: 0;
  padding: 22px;
  border: 1px solid rgba(164, 214, 255, 0.24);
  border-radius: var(--r);
  background:
    var(--grad-panel),
    var(--panel);
  backdrop-filter: blur(16px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    var(--shadow-sm);
}

.panel-heading {
  justify-content: space-between;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 12px;
}

.icon-button,
.delete-button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(164, 214, 255, 0.24);
  border-radius: var(--r-sm);
  background: rgba(24, 32, 45, 0.78);
  color: var(--ink-soft);
  font-size: 20px;
}

.icon-button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.row-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
  white-space: nowrap;
}
.row-actions .row-action,
.row-actions .delete-button {
  width: 32px;
  height: 32px;
  font-size: 16px;
}
.row-actions .delete-button:hover {
  border-color: var(--red);
  color: var(--red);
}

.delete-button {
  width: 30px;
  height: 30px;
  font-size: 18px;
  color: var(--faint);
}

@media (hover: hover) {
  .delete-button:hover {
    border-color: var(--red);
    background: var(--soft-danger);
    color: var(--red);
  }
}

/* Подсветка только при реальном нажатии — никакого залипания на тач/трекпаде. */
.delete-button:active {
  border-color: var(--red);
  background: var(--soft-danger);
  color: var(--red);
}

/* Кнопка скрина в режиме подтверждения удаления (после первого клика). */
.delete-button.confirming {
  border-color: var(--red) !important;
  background: var(--soft-danger) !important;
  color: var(--red) !important;
}

/* ============================================================
   Формы
   ============================================================ */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
  margin-bottom: 16px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 650;
}

.wide {
  grid-column: 1 / -1;
}

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(164, 214, 255, 0.3);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0)),
    var(--field);
  color: var(--ink);
  transition: border-color 150ms var(--ease), box-shadow 150ms var(--ease), background 150ms var(--ease);
}

input:hover,
select:hover {
  border-color: var(--faint);
}

input:focus,
select:focus,
button:focus-visible,
.import-button:focus-within {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

input::placeholder {
  color: var(--faint);
  opacity: 1;
}

select {
  appearance: none;
  background-image:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%238ccfff' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
}

/* ---------- Комбобокс ---------- */
.combo-wrap {
  position: relative;
}

.combo-wrap::after {
  content: "";
  position: absolute;
  right: 13px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  pointer-events: none;
  transform: translateY(-65%) rotate(45deg);
}

.combo-wrap input {
  padding-right: 36px;
}

.combo-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 264px;
  overflow-y: auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--panel-strong);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
  padding: 6px;
}

.combo-option {
  width: 100%;
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  padding: 9px 11px;
  background: transparent;
  color: var(--ink-soft);
  text-align: left;
  font-weight: 600;
  transition: background 120ms var(--ease), color 120ms var(--ease);
}

.combo-option:hover,
.combo-option:focus-visible {
  background: var(--soft-blue);
  color: var(--ink);
  outline: 0;
}

.combo-empty {
  padding: 12px 11px;
  color: var(--faint);
  font-weight: 600;
}

/* ---------- Отчётная сетка ---------- */
.report-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}

.report-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  padding: 16px;
  margin-bottom: 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
}

.report-filter-wide {
  grid-column: 1 / -1;
}

.report-count {
  margin: 0 0 14px;
  color: var(--faint);
  font-size: 13.5px;
  font-weight: 600;
}

/* ---------- Курс USDT ---------- */
.rate-panel {
  margin-bottom: 18px;
}

.rate-widget {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.rate-note {
  margin: 6px 0 0;
  max-width: 460px;
  color: var(--faint);
  font-size: 12.5px;
  line-height: 1.45;
}

.rate-form {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.rate-form label {
  min-width: 150px;
}

.rate-form .primary-button {
  width: auto;
  white-space: nowrap;
}

/* ---------- Доп услуги ---------- */
.extras-panel {
  margin-top: 18px;
}

.extra-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(140px, 0.5fr) minmax(120px, 0.25fr) auto;
  gap: 13px;
  align-items: end;
  margin-bottom: 18px;
}

.extra-form .primary-button {
  width: auto;
  padding: 12px 22px;
}

.operation-extras {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 42px;
  align-items: center;
}

.operation-extras-empty {
  color: var(--faint);
  font-size: 13px;
  font-weight: 650;
}

.extra-chip {
  border: 1px solid rgba(164, 214, 255, 0.28);
  border-radius: var(--r-pill);
  padding: 8px 14px;
  background: rgba(24, 32, 45, 0.78);
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 13px;
  transition: border-color 140ms var(--ease), background 140ms var(--ease), color 140ms var(--ease);
}

.extra-chip:hover {
  border-color: var(--accent);
}

.extra-chip.active {
  border-color: transparent;
  background: var(--grad-accent);
  color: #06121d;
}

/* ---------- Плитки прайса ---------- */
.price-tiles-panel .panel-heading input[type="search"] {
  width: auto;
  min-width: 200px;
}

.price-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
}

.price-tile {
  display: grid;
  gap: 5px;
  text-align: left;
  padding: 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  transition: transform 120ms var(--ease), border-color 140ms var(--ease), box-shadow 160ms var(--ease);
}

.price-tile:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.price-tile strong {
  font-size: 15px;
}

.price-tile span {
  color: var(--faint);
  font-size: 12.5px;
}

.price-tile small {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.price-tile .tile-stock-ok { color: var(--green-dark); }
.price-tile .tile-stock-empty { color: var(--red); }

/* ---------- Аналитика Авито ---------- */
.avito-metrics {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin-bottom: 18px;
}

.avito-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.avito-actions input[type="search"] {
  width: auto;
  min-width: 180px;
}

.avito-status {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
}

.avito-period {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 14px;
  font-size: 13px;
}

.avito-period-label {
  color: var(--muted);
}

.avito-period label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}

.avito-period input[type="date"] {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: inherit;
}

.avito-table {
  min-width: 2200px;
}
.avito-group-row td {
  background: var(--surface);
  font-size: 13px;
  color: var(--muted);
  padding: 10px 12px;
  border-top: 2px solid var(--border);
}
.avito-group-row strong { color: inherit; font-size: 14px; }
.avito-table th.avito-hl,
.avito-table td.avito-hl {
  background: var(--soft-blue);
  font-weight: 600;
}
.avito-table th.avito-hl { color: var(--accent); }

.avito-table td {
  font-variant-numeric: tabular-nums;
}

.avito-table td:first-child {
  font-weight: 600;
  max-width: 280px;
}

/* ---------- Склад ---------- */
.stock-metrics { margin-bottom: 18px; }
.stock-add-panel { margin-bottom: 18px; }

.stock-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}

.stock-form .wide { grid-column: 1 / -1; }

.stock-form textarea {
  width: 100%;
  min-height: 96px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  background: var(--field);
  color: var(--ink);
  font: inherit;
  resize: vertical;
}

.stock-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.stock-form .primary-button { grid-column: 1 / -1; justify-self: start; width: auto; padding: 12px 28px; }

.stock-filters input,
.stock-filters select { min-width: 160px; }

.stock-groups {
  display: grid;
  gap: 10px;
}

.stock-group {
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  overflow: hidden;
}

.stock-group-head {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 16px;
  background: transparent;
  border: 0;
  color: var(--ink);
  text-align: left;
}

.stock-group-head:hover { background: var(--soft-blue); }

.stock-group-title { display: flex; align-items: baseline; gap: 10px; flex: 1; min-width: 0; }
.stock-group-title strong { font-size: 15.5px; }
.stock-group-title span { color: var(--muted); font-size: 13px; }
.stock-group-title .stock-orphan { color: var(--red); font-weight: 700; }

.stock-group-counts { display: flex; gap: 8px; }

.stock-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: var(--r-pill);
  font-weight: 700;
  font-size: 12.5px;
}

.stock-pill.available { background: var(--soft-green); color: var(--green-dark); }
.stock-pill.used { background: var(--soft-warning); color: var(--amber); }

.stock-caret { color: var(--muted); font-size: 12px; }

.stock-items {
  display: grid;
  gap: 6px;
  padding: 0 14px 14px;
}

.stock-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-solid);
}

.stock-item.used { opacity: 0.62; }

.stock-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  color: var(--ink);
  word-break: break-all;
  min-width: 120px;
}

.stock-item-meta {
  color: var(--muted);
  font-size: 12.5px;
  margin-right: auto;
}

.stock-item-actions { display: flex; align-items: center; gap: 6px; }
.stock-item-actions .icon-button { width: 30px; height: 30px; font-size: 15px; }
.stock-toggle-btn { padding: 7px 12px; font-size: 12.5px; }

@media (max-width: 680px) {
  .stock-form { grid-template-columns: 1fr; }
  .stock-group-head { flex-wrap: wrap; }
  .stock-item { flex-wrap: wrap; }
}

.bars b {
  margin-left: 6px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.price-panel,
.platforms-panel,
.payments-panel {
  margin-bottom: 0;
}

.price-form,
.platform-form,
.employee-form,
.role-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 13px;
  align-items: end;
  margin-bottom: 18px;
}

.roles-panel {
  margin-top: 18px;
}

.role-form .permission-grid {
  grid-column: 1 / -1;
}

.role-form > label:first-child {
  grid-column: 1 / -1;
  max-width: 360px;
}

.role-form .primary-button {
  grid-column: 1 / -1;
  justify-self: start;
  width: auto;
  padding: 12px 28px;
}

.platform-form {
  grid-template-columns: minmax(220px, 1fr) repeat(3, minmax(150px, 0.5fr)) minmax(170px, 0.45fr);
}

.employee-form {
  grid-template-columns: repeat(4, minmax(170px, 1fr));
}

.permission-grid {
  grid-column: span 3;
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 9px;
  align-self: stretch;
  padding: 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
}

.permission-grid label {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink-soft);
  font-weight: 600;
}

.permission-grid input {
  width: 17px;
  min-height: 17px;
  accent-color: var(--accent);
}

/* ---------- Сводка платежей ---------- */
.payment-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
  margin-bottom: 16px;
}

.payment-summary div,
.report-grid div {
  padding: 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
}

.payment-summary span {
  display: block;
  color: var(--faint);
  font-size: 13px;
  font-weight: 650;
}

.payment-summary strong,
.report-grid strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   Процессинг
   ============================================================ */
.processing-metrics {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 18px;
}

.debt-card::after {
  background: var(--red) !important;
}

.debt-card strong.negative {
  color: var(--red);
}

.debt-card strong.positive {
  color: var(--green-dark);
}

/* ---------- Зарплаты процессинга ---------- */
.payroll-panel {
  display: grid;
  gap: 18px;
}

.payroll-content {
  display: grid;
  gap: 18px;
}

.payroll-employee-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.payroll-employee-card {
  display: grid;
  gap: 6px;
  min-height: 96px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  padding: 14px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  transition: border-color 160ms var(--ease), transform 160ms var(--ease), background 160ms var(--ease);
}

.payroll-employee-card:hover,
.payroll-employee-card.active {
  border-color: var(--accent);
  background: var(--panel);
  transform: translateY(-1px);
}

.payroll-employee-card strong {
  font-size: 15px;
}

.payroll-employee-card span {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.payroll-employee-card small {
  color: var(--faint);
  font-weight: 700;
}

.payroll-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.payroll-stat {
  display: grid;
  gap: 7px;
  min-height: 84px;
  padding: 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
}

.payroll-stat span {
  color: var(--faint);
  font-size: 12px;
  font-weight: 700;
}

.payroll-stat strong {
  align-self: end;
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.payroll-stat.negative strong,
.payroll-employee-card .negative {
  color: var(--red);
}

.payroll-stat.positive strong,
.payroll-employee-card .positive {
  color: var(--green-dark);
}

.payroll-tools {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 14px;
}

.payroll-tool-card {
  display: grid;
  gap: 12px;
  align-content: start;
  border: 1px solid rgba(164, 214, 255, 0.24);
  border-radius: var(--r-sm);
  padding: 16px;
  background: rgba(24, 32, 45, 0.72);
}

.payroll-tool-card h3 {
  margin: 0;
  font-size: 16px;
}

.payroll-tool-card .primary-button,
.payroll-tool-card .ghost-button {
  width: auto;
  justify-self: start;
  padding-inline: 22px;
}

.payroll-preview {
  margin: 0;
  color: var(--faint);
  font-size: 13px;
  line-height: 1.45;
}

.payroll-section {
  padding: 16px;
}

.payroll-table-wrap {
  margin: 0;
}

.payroll-table {
  min-width: 760px;
}

.payroll-table .empty-row {
  color: var(--faint);
  text-align: center;
  font-weight: 700;
}

.admin-processing-panel {
  display: grid;
  gap: 16px;
}

.admin-processing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.admin-processing-actions .primary-button,
.admin-processing-actions .ghost-button,
.admin-back-button {
  width: auto;
  padding-inline: 18px;
}

.admin-shift-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.admin-shift-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(164, 214, 255, 0.24);
  border-radius: var(--r-sm);
  background: rgba(24, 32, 45, 0.72);
}

.admin-shift-card > strong {
  font-size: 17px;
}

.admin-shift-card > span {
  color: var(--faint);
  font-size: 13px;
  font-weight: 700;
}

.admin-shift-card .ghost-button {
  width: auto;
  justify-self: start;
  padding-inline: 18px;
}

.admin-shift-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.admin-shift-stats .payroll-stat {
  min-height: 72px;
  padding: 11px;
}

.admin-shift-stats .payroll-stat strong {
  font-size: 15px;
}

/* ---------- Вкладки процессинга ---------- */
.proc-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 18px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
}

.proc-tab {
  border: 0;
  border-radius: 9px;
  padding: 9px 18px;
  background: transparent;
  color: var(--faint);
  font-weight: 600;
  font-size: 14px;
  transition: background 160ms var(--ease), color 160ms var(--ease);
}

.proc-tab:hover {
  color: var(--ink);
}

.proc-tab.active {
  background: var(--grad-accent);
  color: #06121d;
  box-shadow: var(--shadow-glow);
}

/* ---------- Калькулятор чистого % (матрица) ---------- */
.calc-rates {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.calc-rate {
  display: grid;
  gap: 7px;
  flex: 1 1 200px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
}

.calc-rate input {
  min-height: 56px;
  font-size: 24px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-align: center;
  letter-spacing: 0.02em;
  border: 2px solid #2f8bff;
  background: rgba(47, 139, 255, 0.12);
  color: #eaf4ff;
  box-shadow: 0 0 0 1px rgba(47, 139, 255, 0.4), 0 8px 26px rgba(47, 139, 255, 0.25);
}

.calc-rate input::placeholder {
  color: rgba(180, 214, 255, 0.6);
}

.calc-rate input:focus {
  border-color: #4da3ff;
  box-shadow: 0 0 0 4px rgba(47, 139, 255, 0.3), 0 10px 30px rgba(47, 139, 255, 0.35);
}

.calc-arrow {
  padding-bottom: 14px;
  color: var(--accent);
  font-size: 22px;
  font-weight: 800;
}

.calc-clear {
  margin-bottom: 0;
  height: 56px;
  white-space: nowrap;
}

.calc-settings {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  padding: 14px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
}

.calc-setting {
  display: grid;
  gap: 6px;
}

.calc-setting span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

/* матрица */
.calc-matrix {
  display: grid;
  gap: 8px;
}

.calc-matrix-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) repeat(2, minmax(110px, 1fr));
  gap: 8px;
}

.calc-corner {
  background: transparent;
}

.calc-col-head {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 2px;
  padding: 10px;
  border-radius: var(--r-sm);
  background: var(--panel-strong);
  color: var(--ink);
  font-weight: 800;
  font-size: 15px;
  text-align: center;
}

.calc-col-head small {
  color: var(--muted);
  font-weight: 600;
  font-size: 11.5px;
}

.calc-row-head {
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  color: #fff;
  font-weight: 800;
  font-size: 15px;
}

.calc-row-head small {
  font-weight: 600;
  font-size: 11.5px;
  opacity: 0.85;
}

.calc-row-head.calc-exotic { background: #1e3a8a; }
.calc-row-head.calc-syncra { background: #7c3aed; }

.calc-cell {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 2px;
  min-height: 64px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  font-variant-numeric: tabular-nums;
}

.calc-cell b {
  font-size: 22px;
  font-weight: 800;
}

.calc-cell small {
  font-size: 12px;
  color: var(--muted);
}

.calc-cell.positive b { color: var(--green-dark); }
.calc-cell.negative b { color: var(--red); }
.calc-cell.empty {
  color: var(--faint);
  font-size: 20px;
  font-weight: 700;
}


.calc-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 680px) {
  .calc-matrix-row {
    grid-template-columns: minmax(96px, 1fr) repeat(2, minmax(86px, 1fr));
  }
  .calc-cell b { font-size: 18px; }
  .calc-arrow { display: none; }
}

/* ---------- Экран «Начать смену» ---------- */
.shift-start {
  display: grid;
  justify-items: center;
  gap: 14px;
  text-align: center;
  padding: 48px 24px;
}

.shift-start-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background: var(--soft-blue);
  color: var(--accent);
  font-size: 26px;
}

.shift-start-hint {
  margin: 0;
  max-width: 420px;
  color: var(--faint);
  font-size: 14px;
  line-height: 1.5;
}

.shift-start-btn {
  width: auto;
  padding: 14px 34px;
  font-size: 15px;
}

/* ---------- Карточка активной смены ---------- */
.shift-card {
  display: grid;
  gap: 18px;
}

.shift-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line-strong);
}

.shift-who strong {
  display: block;
  font-size: 17px;
  font-weight: 700;
}

.shift-who span {
  color: var(--faint);
  font-size: 13px;
}

.shift-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: var(--r-pill);
  background: var(--soft-green);
  color: var(--green-dark);
  font-weight: 700;
  font-size: 13px;
}

.shift-status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
  animation: pulse 1.6s var(--ease) infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.shift-stage {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
}

.shift-stage-head {
  display: flex;
  align-items: center;
  gap: 11px;
}

.shift-stage-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.stage-num {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: var(--grad-accent);
  color: #06121d;
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
}

.stage-time {
  margin-left: auto;
  color: var(--faint);
  font-weight: 600;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.shift-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  align-items: end;
}

.proc-field {
  display: grid;
  gap: 7px;
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 600;
}

.stage-stamp-btn {
  justify-self: start;
}

/* ---------- Левые транзакции ---------- */
.tx-bar {
  display: flex;
}

.tx-add-btn {
  width: auto;
  padding: 10px 18px;
}

.tx-list {
  display: grid;
  gap: 8px;
}

.tx-empty {
  margin: 0;
  color: var(--faint);
  font-size: 13.5px;
  font-weight: 650;
}

.tx-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--panel-solid);
}

.tx-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: var(--r-pill);
  font-weight: 700;
  font-size: 12.5px;
  white-space: nowrap;
}

.tx-pill.tx-loss { background: var(--soft-danger); color: var(--red); }
.tx-pill.tx-gain { background: var(--soft-green); color: var(--green-dark); }
.tx-pill.tx-out { background: var(--soft-warning); color: var(--amber); }
.tx-pill.tx-uid { background: var(--soft-blue); color: var(--blue-strong); }
.tx-pill.tx-other { background: var(--soft-blue); color: var(--blue-strong); }
.tx-pill.tx-salary { background: var(--soft-green); color: var(--green-dark); }
.tx-pill.tx-transfer { background: var(--soft-blue); color: var(--blue-strong); }

.stock-export-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stock-export-controls .monitor-filters,
.stock-export-controls .monitor-employees {
  margin-bottom: 0;
}

.stock-export-controls #stockExport {
  align-self: flex-start;
}

/* Окно выдачи кодов со склада */
.issued-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 14px 0;
  max-height: 50vh;
  overflow-y: auto;
}

.issued-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.issued-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.issued-name {
  font-size: 12px;
  color: var(--muted);
}

.issued-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 15px;
  font-weight: 600;
  word-break: break-all;
}

.issued-copy {
  flex-shrink: 0;
}

.issued-copy.copied {
  color: var(--green-dark);
  border-color: var(--green-dark);
}

.editing-row {
  background: var(--soft-blue);
}

/* Форма операции — вариант 2 */
.op-v2 {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
#opSaleFields,
#opLossFields {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
#opSaleFields[hidden],
#opLossFields[hidden] {
  display: none;
}

.op-label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 6px;
}

.op-method-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  align-self: flex-start;
  flex-wrap: wrap;
}
.op-method-tab {
  padding: 9px 20px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  border-radius: 9px;
  cursor: pointer;
}
.op-method-tab:hover { color: inherit; border-color: var(--border); }
.op-method-tab.active {
  background: #1f6fb8;
  color: #fff;
  box-shadow: 0 2px 8px rgba(31, 111, 184, 0.4);
}

.op-hero {
  display: block;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid #1f6fb8;
  background: var(--soft-blue);
}
.op-hero .op-label { color: var(--accent); }
.op-hero > input {
  width: 100%;
  height: 40px;
  font-size: 17px;
  font-weight: 600;
  padding: 0 10px;
  border: none;
  background: transparent;
}
.op-hero > input:focus { outline: none; box-shadow: none; }

.op-platform-block { }
.op-platform-input {
  display: none;
  margin-top: 10px;
  max-width: 320px;
}
.quick-chip-other {
  border-style: dashed;
}

.quick-pick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.quick-chip {
  padding: 9px 18px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.quick-chip:hover { border-color: var(--blue-strong); color: var(--blue-strong); }
.quick-chip.active {
  background: #1f6fb8;
  color: #fff;
  border-color: #1f6fb8;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(31, 111, 184, 0.4);
}

.op-money-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 14px;
}
.op-money {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 16px;
}
.op-money > input {
  width: 100%;
  border: none;
  background: transparent;
  padding: 0;
  font-size: 22px;
  font-weight: 600;
}
.op-money > input:focus { outline: none; box-shadow: none; }
.op-money-hero {
  border-color: var(--green-dark, #1f9d57);
  background: var(--soft-green);
}
.op-money-hero .op-label { color: var(--green-dark, #1f9d57); }
.op-money-hero > input { font-size: 28px; color: var(--green-dark, #1f9d57); }

.op-money-loss {
  border-color: var(--red);
  background: var(--soft-danger);
}
.op-money-loss .op-label { color: var(--red); }
.op-money-loss > input { color: var(--red); font-size: 24px; }
.op-loss-platform { display: flex; flex-direction: column; gap: 6px; max-width: 360px; }

.op-comment {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.op-comment > textarea {
  width: 100%;
  min-height: 56px;
  resize: vertical;
  padding: 12px 14px;
  font: inherit;
}

.op-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}
.op-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}
.op-extras-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.confirm-summary {
  font-weight: 600;
  margin: 4px 0 12px;
}
.confirm-comment {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
}
.confirm-comment-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 4px;
}
.confirm-comment p { margin: 0; white-space: pre-wrap; }
.confirm-comment.empty { color: var(--muted); font-style: italic; }
.confirm-warn { font-size: 13px; color: var(--red); margin: 0 0 8px; }
.danger-button { background: var(--red); border-color: var(--red); }
.confirm-actions { flex-wrap: wrap; }

.entry-details-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 16px;
  margin: 8px 0 14px;
  font-size: 14px;
}
.entry-details-key { color: var(--muted); }
.entry-details-val { text-align: right; }

.journal-toggle-btn {
  display: block;
  width: 100%;
  margin: 8px auto 0;
  padding: 16px;
  font-size: 16px;
  font-weight: 600;
}

.entries-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 14px;
}
.entries-pager-info {
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.entry-code {
  margin-top: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: var(--blue-strong);
  word-break: break-all;
}

/* ВАЖНО: проблемы */
.nav-important span {
  color: var(--red);
  font-weight: 700;
}
.nav-important svg { color: var(--red); }

.nav-badge-red {
  background: var(--red) !important;
  color: #fff !important;
}

.eyebrow.important { color: var(--red); }

.problems-banner {
  display: block;
  padding: 16px 20px;
  margin-bottom: 18px;
  border-radius: 14px;
  border: 1px solid var(--red);
  background: var(--soft-danger);
  color: var(--red);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.01em;
  text-decoration: none;
}

.dashboard-problems:hover { filter: brightness(1.05); }

.problem-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.problem-form .wide { grid-column: 1 / -1; }
.problem-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.problem-form input,
.problem-form select,
.problem-form textarea {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: inherit;
  font: inherit;
}
.problem-form > button { grid-column: 1 / -1; justify-self: start; }

.problems-show-resolved {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.problems-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.problem-card {
  border: 1px solid var(--border);
  border-left: 4px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  background: var(--surface);
}
.problem-card.ps-refund { border-left-color: var(--red); }
.problem-card.ps-replace { border-left-color: var(--amber); }
.problem-card.ps-fail { border-left-color: var(--blue-strong); }
.problem-card.is-resolved { opacity: 0.6; }

.problem-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.problem-title-wrap { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.problem-title { font-size: 16px; }

.problem-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.problem-pill {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--soft-blue);
  color: var(--blue-strong);
}
.problem-pill.ps-refund { background: var(--soft-danger); color: var(--red); }
.problem-pill.ps-replace { background: var(--soft-warning); color: var(--amber); }
.problem-pill.problem-flag {
  background: var(--red);
  color: #fff;
  letter-spacing: 0.04em;
}
.problem-pill.problem-done { background: var(--soft-green); color: var(--green-dark); }

.problem-meta { margin: 10px 0 0; font-size: 12px; color: var(--muted); }
.problem-info { margin: 8px 0 0; font-size: 14px; white-space: pre-wrap; }

.problem-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}
.problem-resolve {
  padding: 12px 26px;
  border: none;
  border-radius: 12px;
  background: var(--green-dark, #1f9d57);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.problem-resolve:hover { filter: brightness(1.08); }
.problem-delete { color: var(--muted); }

/* Выбор диапазона дат */
.range-picker {
  position: relative;
  display: inline-block;
}

.range-trigger {
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  min-width: 190px;
  text-align: left;
}

.range-trigger.has-value {
  color: inherit;
  border-color: var(--blue-strong);
}

.range-pop {
  position: absolute;
  z-index: 50;
  top: calc(100% + 8px);
  left: 0;
  width: 280px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--panel, #1b2230);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

.range-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.range-month {
  font-weight: 600;
  font-size: 14px;
}

.range-nav {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: inherit;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.range-nav:hover {
  border-color: var(--blue-strong);
}

.range-week,
.range-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.range-week span {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  padding: 4px 0;
}

.range-day {
  aspect-ratio: 1 / 1;
  border: none;
  background: transparent;
  color: inherit;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
}

.range-day:hover {
  background: var(--surface);
}

.range-day.is-today {
  outline: 1px solid var(--border);
}

.range-day.in-range {
  background: var(--soft-blue);
  border-radius: 0;
}

.range-day.is-start,
.range-day.is-end {
  background: var(--blue-strong);
  color: #fff;
  font-weight: 600;
}

.range-day.is-start { border-radius: 8px 0 0 8px; }
.range-day.is-end { border-radius: 0 8px 8px 0; }

.range-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
}

.range-clear,
.range-done {
  border: none;
  background: transparent;
  color: var(--blue-strong);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 4px;
}

/* Слежка за сотрудниками */
.monitor-filters,
.monitor-employees {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.monitor-filter-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.monitor-filter-hint {
  color: var(--muted);
  font-size: 12px;
  font-style: italic;
}

.monitor-filters label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.monitor-filters input[type="date"] {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: inherit;
}

.monitor-emp-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  cursor: pointer;
}

.monitor-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
}

.monitor-chip {
  flex: 1 1 130px;
  min-width: 120px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.monitor-chip span {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 4px;
}

.monitor-chip strong {
  font-size: 19px;
  font-variant-numeric: tabular-nums;
}

.monitor-section {
  margin-top: 18px;
}

.monitor-section h3 {
  margin: 0 0 10px;
  font-size: 14px;
}

.monitor-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

.monitor-table th,
.monitor-table td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

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

.monitor-table th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.monitor-table td:first-child {
  font-weight: 600;
}

.tx-salary-fields {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--soft-green);
}

.tx-salary-fields[hidden] {
  display: none;
}

.salary-requests.has-pending {
  border: 1px solid rgba(70, 211, 154, 0.4);
  border-radius: var(--r);
  padding: 14px;
  background: var(--soft-green);
}

.salary-confirm-btn {
  width: auto;
  padding: 9px 16px;
  font-size: 13px;
  white-space: nowrap;
}

.salary-amount-input {
  min-width: 92px;
  max-width: 120px;
  min-height: 34px;
  padding: 6px 9px;
  font-weight: 700;
  color: var(--green-dark);
}

.nav-badge {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  display: inline-grid;
  place-items: center;
  border-radius: var(--r-pill);
  background: var(--red);
  color: #fff;
  font-size: 11.5px;
  font-weight: 800;
  line-height: 1;
}

.nav a.active .nav-badge {
  background: rgba(0, 0, 0, 0.28);
}

.tx-amount {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.tx-meta {
  color: var(--faint);
  font-size: 13px;
  margin-right: auto;
}

.tx-item .delete-button {
  width: 28px;
  height: 28px;
  font-size: 16px;
}

/* ---------- Итог смены ---------- */
.shift-summary {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: end;
  gap: 16px;
}

.shift-comment {
  min-width: 0;
}

.shift-stats {
  display: flex;
  gap: 22px;
}

.shift-stats div {
  display: grid;
  gap: 2px;
}

.shift-stats span {
  color: var(--faint);
  font-size: 12.5px;
}

.shift-stats strong {
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.shift-close-btn {
  width: auto;
  padding: 13px 24px;
}

/* ---------- История ---------- */
.processing-history-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--surface);
}

.processing-history-filters label {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
}

.processing-history-filters input,
.processing-history-filters select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  padding: 9px 11px;
  background: var(--field);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
}

.processing-filter-search {
  grid-column: span 2;
}

.processing-history-filters .ghost-button {
  align-self: end;
  min-height: 40px;
}

.history-screens {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.history-screen-link {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: var(--soft-blue);
  color: var(--blue-strong);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none !important;
}

.history-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.history-detail-btn {
  min-height: 30px;
  padding: 6px 10px;
  font-size: 12px;
}

.history-reopen {
  width: 30px;
  height: 30px;
  font-size: 16px;
}

/* ---------- Модальное окно ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(1, 4, 8, 0.68);
  backdrop-filter: blur(8px);
}

.modal {
  width: min(440px, 100%);
  display: grid;
  gap: 16px;
  padding: 24px;
  border: 1px solid rgba(164, 214, 255, 0.3);
  border-radius: var(--r-lg);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0)),
    rgba(20, 25, 34, 0.94);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.045),
    var(--shadow);
}

.modal h3 {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
}

.shift-detail-modal {
  width: min(1040px, 96vw);
  max-height: 92vh;
  overflow: auto;
  align-content: start;
}

.shift-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 4px;
}

.shift-detail-head h3 {
  margin: 3px 0 4px;
  font-size: 24px;
}

.shift-detail-head p {
  margin: 0;
  color: var(--faint);
  font-weight: 600;
}

.shift-detail-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 10px;
}

.shift-detail-stat {
  display: grid;
  gap: 5px;
  padding: 13px 14px;
  border: 1px solid rgba(164, 214, 255, 0.24);
  border-radius: var(--r-sm);
  background: rgba(24, 32, 45, 0.72);
}

.shift-detail-stat span {
  color: var(--faint);
  font-size: 12px;
  font-weight: 700;
}

.shift-detail-stat strong {
  font-size: 20px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.shift-detail-screen-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.shift-detail-section {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(164, 214, 255, 0.24);
  border-radius: var(--r-sm);
  background: rgba(24, 32, 45, 0.72);
}

.shift-detail-section h4 {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
}

.shift-detail-screens {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.shift-detail-screens a {
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  padding: 7px 10px;
  background: var(--soft-blue);
  color: var(--blue-strong);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.shift-detail-tx-list {
  display: grid;
  gap: 10px;
}

.shift-detail-tx {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid rgba(164, 214, 255, 0.24);
  border-radius: var(--r-sm);
  background: rgba(15, 20, 28, 0.9);
}

.shift-detail-tx-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.shift-detail-tx-top strong {
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}

.shift-detail-tx-top span:last-child {
  margin-left: auto;
  color: var(--faint);
  font-size: 12px;
  font-weight: 700;
}

.shift-detail-tx p,
.shift-detail-comment {
  margin: 0;
  color: var(--faint);
  line-height: 1.45;
}

.tx-type-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.tx-type-btn {
  border: 1px solid rgba(164, 214, 255, 0.28);
  border-radius: var(--r-sm);
  padding: 11px 12px;
  background: rgba(24, 32, 45, 0.78);
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 14px;
  transition: border-color 140ms var(--ease), background 140ms var(--ease), color 140ms var(--ease);
}

.tx-type-btn:hover {
  border-color: var(--accent);
}

.tx-type-btn.active {
  border-color: transparent;
  background: var(--grad-accent);
  color: #06121d;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.modal-actions .primary-button,
.modal-actions .ghost-button {
  width: auto;
  padding: 11px 22px;
}

.ghost-button {
  border: 1px solid rgba(164, 214, 255, 0.28);
  border-radius: var(--r-sm);
  padding: 11px 18px;
  background: rgba(24, 32, 45, 0.72);
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 14px;
  transition: border-color 140ms var(--ease), background 140ms var(--ease), color 140ms var(--ease), transform 120ms var(--ease);
}

.ghost-button:hover {
  border-color: var(--accent);
  background: var(--soft-blue);
  color: var(--ink);
  transform: translateY(-1px);
}

@media (max-width: 680px) {
  .shift-summary {
    grid-template-columns: 1fr;
  }

  .tx-type-grid {
    grid-template-columns: 1fr;
  }
}

.processing-table {
  min-width: 1700px;
}

.processing-table .table-input {
  min-height: 36px;
  padding: 7px 9px;
  font-size: 13px;
  background: var(--field-strong);
}

.processing-table input[type="date"],
.processing-table input[type="number"] {
  min-width: 94px;
}

.processing-table input[type="text"] {
  min-width: 120px;
}

.processing-table select.table-input {
  min-width: 120px;
}

.processing-image-cell {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 152px;
}

.processing-image-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.processing-image-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface);
  font-size: 12.5px;
}

/* Ссылка занимает всю строку — клик «просмотреть» больше не попадает в крестик. */
.processing-image-item > a {
  flex: 1;
  min-width: 0;
  padding: 6px 2px;
  display: block;
}

.processing-image-item .delete-button {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  font-size: 15px;
}

.processing-image-upload {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px dashed var(--line-strong);
  border-radius: 9px;
  padding: 8px 10px;
  background: var(--soft-blue);
  color: var(--blue-strong);
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  transition: border-color 160ms var(--ease), background 160ms var(--ease);
}

.processing-image-upload:hover {
  border-color: var(--accent);
  background: var(--soft-blue);
}

.processing-image-upload input {
  display: none;
}

.tx-screens {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.tx-screens a {
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 4px 8px;
  background: var(--soft-blue);
  color: var(--blue-strong);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.image-viewer-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.78);
}

.image-viewer {
  width: min(1100px, 96vw);
  max-height: 92vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--panel);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.image-viewer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-strong);
}

.image-viewer img {
  display: block;
  max-width: 100%;
  max-height: calc(92vh - 64px);
  margin: auto;
  object-fit: contain;
}

/* ============================================================
   Таблицы
   ============================================================ */
.table-wrap a {
  color: var(--blue-strong);
  font-weight: 700;
  text-decoration: none;
}

.table-wrap a:hover {
  text-decoration: underline;
}

.table-panel {
  overflow: hidden;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(164, 214, 255, 0.24);
  border-radius: var(--r-sm);
  background: rgba(14, 20, 30, 0.84);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 10px 26px rgba(0, 0, 0, 0.16);
}

table {
  width: 100%;
  min-width: 1220px;
  border-collapse: separate;
  border-spacing: 0;
}

.compact-table table {
  min-width: 1120px;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(32, 43, 60, 0.98);
  color: var(--ink-soft);
  text-align: left;
  white-space: nowrap;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
  padding: 13px 12px;
  border-bottom: 1px solid var(--line-strong);
}

th:last-child {
  width: 48px;
}

td {
  padding: 12px 12px;
  border-bottom: 1px solid rgba(164, 214, 255, 0.14);
  font-size: 14px;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

tbody tr {
  transition: background 130ms var(--ease);
}

tbody tr:hover {
  background: var(--soft-blue);
}

tbody tr.payment-fuzzy-row {
  background: var(--soft-blue);
}

tbody tr.payment-missing-row {
  background: var(--soft-warning);
}

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

/* ---------- Пилюли и статусы ---------- */
.method-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: var(--r-pill);
  padding: 4px 11px;
  background: var(--soft-blue);
  color: var(--blue-strong);
  font-size: 12.5px;
  font-weight: 700;
}

.method-pill.buy {
  background: var(--soft-warning);
  color: var(--amber);
}

.method-pill.loss {
  background: var(--soft-danger);
  color: var(--red);
}

.match-ok {
  color: var(--green-dark);
  font-weight: 700;
}

.match-missing {
  color: var(--amber);
  font-weight: 700;
}

.match-fuzzy {
  color: var(--blue-strong);
  font-weight: 700;
}

.positive {
  color: var(--green-dark);
  font-weight: 700;
}

.negative {
  color: var(--red);
  font-weight: 700;
}

.empty-state {
  margin: 18px 0 4px;
  padding: 28px;
  color: var(--faint);
  text-align: center;
  font-size: 14px;
  font-weight: 650;
}

/* ---------- Графики отчёта ---------- */
.bars {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}

.bars div {
  display: grid;
  gap: 8px;
}

.bars span {
  color: var(--faint);
  font-size: 13px;
  font-weight: 600;
}

.bars i {
  display: block;
  width: 0%;
  height: 11px;
  border-radius: var(--r-pill);
  background: var(--grad-accent);
  transition: width 220ms var(--ease);
}

.bars div:nth-child(2) i {
  background: var(--amber);
}

.bars div:nth-child(3) i {
  background: linear-gradient(135deg, var(--green), var(--green-dark));
}

/* ============================================================
   Адаптив
   ============================================================ */
@media (max-width: 1050px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
  }

  .nav {
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    margin-left: auto;
  }

  .nav-group {
    display: contents;
  }

  .nav-group + .nav-group {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
  }

  .nav-label {
    display: none;
  }

  .nav a span {
    display: none;
  }

  .nav a {
    padding: 11px;
  }

  .sidebar-note {
    width: 100%;
    margin-top: 0;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .processing-metrics,
  .payroll-summary,
  .payroll-tools {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar-actions {
    justify-content: flex-start;
  }
  .price-form,
  .platform-form,
  .employee-form,
  .role-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .permission-grid {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  main {
    padding: 18px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions,
  .filters {
    justify-content: stretch;
  }

  .topbar-actions > *,
  .filters > * {
    flex: 1 1 150px;
  }

  .nav {
    grid-auto-flow: row;
    grid-template-columns: repeat(auto-fit, minmax(46px, 1fr));
    width: 100%;
    margin-left: 0;
  }

  .metrics,
  .form-grid,
  .report-grid,
  .payment-summary,
  .price-form,
  .platform-form,
    .employee-form,
  .permission-grid,
  .processing-metrics,
  .payroll-summary,
  .payroll-tools,
  .admin-shift-stats {
    grid-template-columns: 1fr;
  }

  .wide {
    grid-column: auto;
  }
}
