/* ══════════════════════════════════════════
   МОТОСТОП — Design System
   Palette: deep anthracite + red-orange accent
   ══════════════════════════════════════════ */

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

:root {
  /* ── Neon design system (см. DESIGN.md) ── */
  --bg:        #000000;   /* Blackout — фон страницы */
  --surface:   #0a0a0b;   /* Depth — приподнятые поверхности (сайдбар, топбар) */
  --card:      #151617;   /* Graphite Deep — карточки, модалки, код-блоки */
  --border:    #303236;   /* Graphite Light — рамки, разделители */
  --accent:    #34d59a;   /* Neon Glow — основной акцент */
  --accent2:   #2ebd89;   /* чуть темнее Neon Glow, для hover */
  --accent-muted: #285d49; /* Neon Muted */
  --text:      #ffffff;   /* Whiteout */
  --muted:     #797d86;   /* Ash */
  --pewter:    #94979e;   /* Pewter */
  --success:   #34d59a;
  --warn:      #f59e0b;
  --danger:    #ff3621;   /* System Warning */
  --info:      #3b82f6;
  --sidebar-w: 240px;
  --radius:        4px;    /* карточки/поля/контейнеры — острые углы */
  --radius-pill:   9999px; /* кнопки — таблетка */
  --shadow:    0 8px 20px rgba(0,0,0,.4);

  --font-inter:     'Inter', ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-geistmono: 'Fira Code', 'GeistMono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

body {
  font-family: var(--font-inter);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: -0.43px;
}

/* ── Utils ── */
.hidden { display: none !important; }

/* ══════════════════════════════════════════
   LOGIN
   ══════════════════════════════════════════ */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000000;
}

.login-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 36px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow);
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 32px;
}

.logo-icon {
  font-size: 36px;
  color: var(--accent);
  line-height: 1;
  filter: drop-shadow(0 0 10px var(--accent));
}

.logo-name {
  font-family: var(--font-inter);
  font-weight: 700;
  font-size: 28px;
  letter-spacing: -1.2px;
  color: var(--text);
  line-height: 1;
}

.logo-sub {
  font-family: var(--font-geistmono);
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.login-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--text);
}

.login-error {
  background: rgba(255,54,33,.12);
  border: 1px solid rgba(255,54,33,.4);
  color: #ff9c8f;
  padding: 10px 14px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 13px;
}

.login-hint {
  margin-top: 14px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

/* ══════════════════════════════════════════
   FIELDS
   ══════════════════════════════════════════ */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-family: var(--font-geistmono); font-size: 12px; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }

input, select, textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color .2s;
  width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
input::placeholder, textarea::placeholder { color: var(--muted); }

.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 42px; }
.pw-toggle {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--muted); cursor: pointer; font-size: 16px;
}

/* ══════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════ */
.btn-primary {
  background: var(--text);
  color: var(--card);
  border: none;
  border-radius: var(--radius-pill);
  padding: 12px 28px;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: opacity .2s, transform .1s;
  white-space: nowrap;
}
.btn-primary:hover { opacity: .85; }
.btn-primary:active { transform: scale(.97); }
.btn-primary.full { width: 100%; padding: 12px; }

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 12px 18px;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: background .2s, border-color .2s;
  white-space: nowrap;
}
.btn-secondary:hover { background: var(--card); border-color: var(--accent); }

.btn-icon {
  background: none; border: none; cursor: pointer;
  font-size: 16px; padding: 4px 8px; border-radius: var(--radius);
  color: var(--muted); transition: color .2s, background .2s;
}
.btn-icon:hover { background: var(--border); color: var(--text); }

/* ══════════════════════════════════════════
   APP SHELL
   ══════════════════════════════════════════ */
.app {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 200;
  transition: transform .25s;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 18px;
  border-bottom: 1px solid var(--border);
}

.logo-icon-sm { font-size: 24px; color: var(--accent); filter: drop-shadow(0 0 6px var(--accent)); }

.sidebar-brand {
  font-family: var(--font-inter);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.6px;
  line-height: 1;
}

.sidebar-user { font-family: var(--font-geistmono); font-size: 11px; color: var(--muted); margin-top: 2px; }

.nav { flex: 1; padding: 12px 0; overflow-y: auto; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: none;
  border: none;
  color: var(--muted);
  padding: 11px 18px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: color .2s, background .2s;
  border-radius: 0;
}
.nav-item:hover { color: var(--text); background: rgba(255,255,255,.04); }
.nav-item.active { color: var(--accent); background: rgba(52,213,154,.1); border-right: 3px solid var(--accent); }
.nav-icon { font-size: 16px; }

.logout-btn {
  width: 100%;
  background: none;
  border: none;
  border-top: 1px solid var(--border);
  color: var(--muted);
  padding: 16px 18px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: color .2s;
}
.logout-btn:hover { color: var(--danger); }

/* Topbar (mobile) */
.topbar {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  z-index: 100;
}
.burger { background: none; border: none; color: var(--text); font-size: 22px; cursor: pointer; }
.topbar-title { flex: 1; font-weight: 600; font-size: 15px; }
.topbar-right { font-size: 12px; color: var(--muted); }

/* Main */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 32px;
  min-height: 100vh;
}

/* ══════════════════════════════════════════
   PAGES
   ══════════════════════════════════════════ */
.page { display: none; }
.page.active { display: block; }

.page-title { font-size: 24px; font-weight: 700; margin-bottom: 24px; }

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-header .page-title { margin-bottom: 0; }

.filter-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.filter-bar input, .filter-bar select {
  width: auto;
  flex: 1;
  min-width: 160px;
}

/* ── KPI cards ── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.kpi-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent-c, var(--accent));
}
.kpi-label { font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); margin-bottom: 8px; }
.kpi-value { font-family: var(--font-inter); font-weight: 700; letter-spacing: -0.64px; font-size: 36px; line-height: 1; color: var(--text); }
.kpi-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ── Dashboard grid ── */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.card-head {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--muted);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.compact-list { display: flex; flex-direction: column; gap: 8px; }
.compact-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: var(--surface);
  border-radius: var(--radius);
  font-size: 13px;
}
.compact-row-left { font-weight: 500; }
.compact-row-right { color: var(--muted); font-size: 12px; text-align: right; }

/* ── Tables ── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table th {
  background: var(--surface);
  padding: 12px 14px;
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: rgba(255,255,255,.03); }

/* Status badges */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  white-space: nowrap;
}
.badge-new     { background: rgba(59,130,246,.2);  color: #93c5fd; }
.badge-working { background: rgba(245,158,11,.2);  color: #fcd34d; }
.badge-ready   { background: rgba(34,197,94,.2);   color: #86efac; }
.badge-done    { background: rgba(122,122,149,.15); color: var(--muted); }

/* ── Employee cards ── */
.emp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.emp-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
}
.emp-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-inter); font-weight: 700; letter-spacing: -0.64px;
  font-size: 20px;
  color: #fff;
  margin-bottom: 12px;
}
.emp-name { font-weight: 700; font-size: 15px; margin-bottom: 2px; }
.emp-role { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.emp-info { font-size: 12px; color: var(--muted); line-height: 1.8; }
.emp-actions { display: flex; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.emp-stat { font-size: 11px; color: var(--muted); }
.emp-stat strong { color: var(--text); font-size: 13px; }

/* ── Salary table ── */
.salary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}
.salary-table th {
  background: var(--surface);
  padding: 12px 14px;
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.salary-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); }
.salary-table tbody tr:last-child td { border-bottom: none; }
.salary-total { color: var(--accent); font-weight: 700; }

/* ── Reports ── */
.report-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

.report-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.report-row:last-child { border-bottom: none; }
.report-bar-wrap { flex: 1; margin: 0 12px; height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.report-bar { height: 100%; background: var(--accent); border-radius: 3px; transition: width .4s; }
.report-val { font-weight: 600; font-family: var(--font-geistmono); font-size: 12px; min-width: 60px; text-align: right; }

/* ══════════════════════════════════════════
   MODALS
   ══════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  padding: 16px;
  backdrop-filter: blur(4px);
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: 16px;
}

.modal-close {
  background: none; border: none; color: var(--muted);
  font-size: 18px; cursor: pointer; transition: color .2s;
}
.modal-close:hover { color: var(--text); }

.modal-body { padding: 24px; }

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 20px;
}
.field.full { grid-column: 1 / -1; }
.form-grid .field { margin-bottom: 14px; }

/* ══════════════════════════════════════════
   TOAST
   ══════════════════════════════════════════ */
.toast {
  position: fixed;
  bottom: 28px; right: 28px;
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--success);
  color: var(--text);
  padding: 14px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow);
  z-index: 1000;
  animation: toastIn .25s ease;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════ */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 40px rgba(0,0,0,.6);
  }
  .topbar { display: flex; }
  .main { margin-left: 0; padding: 80px 16px 24px; }
  .dash-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .report-grid { grid-template-columns: 1fr; }
  .kpi-value { font-size: 28px; }
}

/* ── Documents page ── */
#docEditorModal .modal {
  max-height: 95vh;
  display: flex;
  flex-direction: column;
}
#docEditorModal .modal-body {
  flex: 1;
  overflow: hidden;
  padding: 0;
}
#docFrame {
  display: block;
  width: 100%;
  height: 100%;
  border: none;
  background: #fff;
}

/* ── Mobile sidebar overlay ── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 199;
  backdrop-filter: blur(2px);
  animation: fadeIn .2s ease;
}
.sidebar-overlay:not(.hidden) {
  display: block;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Sidebar close button (only on mobile) */
.sidebar-close {
  display: none;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  margin-left: auto;
  padding: 4px 8px;
  border-radius: var(--radius);
  transition: color .2s, background .2s;
  line-height: 1;
}
.sidebar-close:hover { color: var(--text); background: var(--border); }

@media (max-width: 768px) {
  .sidebar-close { display: block; }

  /* Smooth slide-in animation */
  .sidebar {
    transition: transform .25s cubic-bezier(.4,0,.2,1);
    box-shadow: none;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 40px rgba(0,0,0,.7);
    animation: slideIn .25s cubic-bezier(.4,0,.2,1);
  }
  @keyframes slideIn {
    from { transform: translateX(-100%); }
    to   { transform: translateX(0); }
  }
}

/* ── Multi-select employees ── */
.emp-multiselect {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 180px;
  overflow-y: auto;
  padding: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.emp-check-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background .15s;
  user-select: none;
}
.emp-check-item:hover { background: rgba(255,255,255,.05); }
.emp-check-item input[type=checkbox] {
  width: 16px; height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}
.emp-check-item input[type=checkbox]:checked + .emp-check-name {
  color: var(--accent);
  font-weight: 600;
}
.emp-check-name { font-size: 14px; flex: 1; }
.emp-check-role { font-size: 11px; color: var(--muted); }

/* ── Update page ── */
.update-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 768px) { .update-grid { grid-template-columns: 1fr; } }

.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.upload-zone.drag,
.upload-zone:hover {
  border-color: var(--accent);
  background: rgba(52,213,154,.06);
}
.upload-icon { font-size: 36px; margin-bottom: 8px; }
.upload-text { font-size: 15px; font-weight: 600; }
.upload-sub  { font-size: 13px; color: var(--muted); margin: 6px 0; }
.upload-hint { font-size: 11px; color: var(--muted); margin-top: 12px; font-family: var(--font-geistmono); }

.file-preview {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.file-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: 13px;
}
.file-ok  { background: rgba(34,197,94,.1);  border: 1px solid rgba(34,197,94,.25); }
.file-bad { background: rgba(239,68,68,.1);  border: 1px solid rgba(239,68,68,.25); }
.file-icon { font-size: 16px; }
.file-name { flex: 1; font-family: var(--font-geistmono); }
.file-size { color: var(--muted); font-size: 11px; }

.upload-result {
  margin-top: 12px;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.6;
}
.upload-result.success {
  background: rgba(34,197,94,.1);
  border: 1px solid rgba(34,197,94,.3);
  color: #86efac;
}
.upload-result.error {
  background: rgba(239,68,68,.1);
  border: 1px solid rgba(239,68,68,.3);
  color: #fca5a5;
}

/* ── Owner checkbox ── */
.owner-check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(245,158,11,.08);
  border: 1px solid rgba(245,158,11,.25);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}
.owner-check input[type=checkbox] {
  width: 18px; height: 18px;
  accent-color: var(--warn);
  cursor: pointer;
}

.owner-badge {
  display: inline-block;
  font-size: 10px;
  background: rgba(245,158,11,.2);
  color: #fcd34d;
  padding: 2px 8px;
  border-radius: var(--radius);
  margin-left: 6px;
  font-weight: 700;
}

/* ── Order document buttons ── */
.btn-doc-linked {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(59,130,246,.12);
  border: 1px solid rgba(59,130,246,.3);
  color: #93c5fd;
  border-radius: var(--radius);
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background .2s;
  font-family: var(--font-geistmono);
}
.btn-doc-linked:hover {
  background: rgba(59,130,246,.25);
  color: #fff;
}

.btn-doc-attach {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: 1px dashed var(--border);
  color: var(--muted);
  border-radius: var(--radius);
  padding: 4px 10px;
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .2s, color .2s;
}
.btn-doc-attach:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Minimal icon symbols ── */
.nav-icon {
  font-size: 15px;
  opacity: .85;
  font-style: normal;
  line-height: 1;
  min-width: 18px;
  display: inline-block;
  text-align: center;
}
.logo-icon {
  font-style: normal;
}
.logo-icon-sm {
  font-style: normal;
}

/* ── Quick orders ── */
.quick-form-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 22px 24px 18px;
  margin-bottom: 8px;
}
.quick-form-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 18px;
  text-transform: uppercase;
  letter-spacing: .6px;
}
.quick-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0 20px;
}
.quick-form-grid .field { margin-bottom: 14px; }
.quick-form-grid .field.full { grid-column: 1 / -1; }

.quick-total {
  font-family: var(--font-inter); font-weight: 700; letter-spacing: -0.64px;
  font-size: 32px;
  color: var(--success);
  line-height: 1;
  padding: 8px 0 4px;
  letter-spacing: 1px;
}

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

/* ══════════════════════════════════════
   LIGHT THEME
   ══════════════════════════════════════ */
body.light {
  --bg:      #f0f2f5;
  --surface: #ffffff;
  --card:    #ffffff;
  --border:  #dde1e7;
  --accent:  #1fae7d;
  --accent2: #17966b;
  --text:    #1a1a2e;
  --muted:   #6b7280;
  --success: #1fae7d;
  --warn:    #d97706;
  --danger:  #dc2626;
  --info:    #2563eb;
  --shadow:  0 4px 24px rgba(0,0,0,.12);
}

body.light .sidebar        { background: #ffffff; border-right-color: #dde1e7; }
body.light .topbar         { background: #ffffff; border-bottom-color: #dde1e7; }
body.light .nav-item:hover { background: rgba(0,0,0,.04); }
body.light .nav-item.active{ background: rgba(31,174,125,.08); }
body.light input, body.light select, body.light textarea { background: #f8f9fa; color: var(--text); border-color: #dde1e7; }
body.light input::placeholder, body.light textarea::placeholder { color: #9ca3af; }
body.light .data-table th  { background: #f8f9fa; }
body.light .data-table tbody tr:hover { background: rgba(0,0,0,.02); }
body.light .kpi-card       { background: #ffffff; border-color: #dde1e7; }
body.light .emp-card       { background: #ffffff; border-color: #dde1e7; }
body.light .modal          { background: #ffffff; border-color: #dde1e7; }
body.light .emp-multiselect{ background: #f8f9fa; border-color: #dde1e7; }
body.light .emp-check-item:hover { background: rgba(0,0,0,.04); }
body.light .upload-zone    { border-color: #dde1e7; }
body.light .upload-zone:hover { background: rgba(31,174,125,.04); }
body.light .quick-form-card{ background: #ffffff; border-color: #dde1e7; }
body.light .toast          { background: #ffffff; border-color: #dde1e7; }
body.light .salary-table th{ background: #f8f9fa; }
body.light .btn-secondary  { background: #f8f9fa; border-color: #dde1e7; color: var(--text); }
body.light .btn-secondary:hover { background: #edf0f3; }
body.light .btn-primary    { background: #1a1a2e; color: #ffffff; }
body.light .btn-icon       { color: #6b7280; }
body.light .btn-icon:hover { background: #f0f2f5; color: var(--text); }
body.light .sidebar-brand  { color: #1a1a2e; }
body.light .logout-btn     { border-top-color: #dde1e7; color: #6b7280; }
body.light .login-screen   { background: #f0f2f5 !important; }
body.light .login-card     { background: #ffffff; border-color: #dde1e7; }
body.light .stars-bg       { opacity: 0; }
body.light .filter-bar input,
body.light .filter-bar select { background: #ffffff; }
body.light .compact-row    { background: #f8f9fa; }
body.light .table-wrap     { border-color: #dde1e7; }

/* ══════════════════════════════════════
   BLOOM SWITCH (переключатель темы)
   ══════════════════════════════════════ */
.sidebar-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.bloom-switch {
  display: inline-block;
  cursor: pointer;
  flex-shrink: 0;
}
.bloom-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}
.bloom-switch__track {
  display: inline-block;
  position: relative;
  width: 3.6rem;
  height: 1.8rem;
  border-radius: 999px;
  background: linear-gradient(120deg, #1f0a4a, #0e0322);
  border: 1px solid rgba(165,123,255,.4);
  box-shadow: inset 0 2px 6px rgba(0,0,0,.45);
  transition: background 320ms cubic-bezier(.22,1,.36,1), border-color 320ms cubic-bezier(.22,1,.36,1);
  overflow: hidden;
}
.bloom-switch__thumb {
  position: absolute;
  top: 50%;
  left: 0.18rem;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  background: #ffd23f;
  display: grid;
  place-items: center;
  transform: translateY(-50%);
  transition: left 360ms cubic-bezier(.34,1.56,.64,1), background 320ms, color 320ms, box-shadow 320ms;
  color: #0e0322;
  box-shadow: 0 0 12px rgba(255,210,63,.55);
}
.bloom-switch__sun,
.bloom-switch__moon {
  position: absolute;
  width: 0.85rem;
  height: 0.85rem;
  transition: opacity 220ms, transform 320ms;
}
.bloom-switch__moon {
  opacity: 0;
  transform: rotate(-60deg) scale(.8);
}
.bloom-switch__star {
  position: absolute;
  width: 3px; height: 3px;
  border-radius: 50%;
  background: #fbf5ff;
  opacity: 0;
  transition: opacity 320ms, transform 360ms;
}
.bloom-switch__star--1 { top: 22%; left: 58%; transform: scale(.4); }
.bloom-switch__star--2 { top: 55%; left: 70%; width: 2px; height: 2px; transform: scale(.4); }
.bloom-switch__star--3 { top: 38%; left: 82%; width: 2px; height: 2px; transform: scale(.4); }

/* checked = ночной (тёмный) режим */
.bloom-switch input:checked ~ .bloom-switch__track {
  background: linear-gradient(120deg, #150633, #0e0322);
  border-color: rgba(165,123,255,.55);
}
.bloom-switch input:checked ~ .bloom-switch__track .bloom-switch__thumb {
  left: calc(100% - 1.58rem);
  background: #fbf5ff;
  color: #1f0a4a;
  box-shadow: 0 0 12px rgba(165,123,255,.6);
}
.bloom-switch input:checked ~ .bloom-switch__track .bloom-switch__sun  { opacity: 0; transform: rotate(60deg) scale(.6); }
.bloom-switch input:checked ~ .bloom-switch__track .bloom-switch__moon { opacity: 1; transform: rotate(0) scale(1); }
.bloom-switch input:checked ~ .bloom-switch__track .bloom-switch__star { opacity: 1; transform: scale(1); }

/* light mode — switch track looks different */
body.light .bloom-switch__track {
  background: linear-gradient(120deg, #e8f4fd, #dbeafe);
  border-color: rgba(59,130,246,.3);
  box-shadow: inset 0 2px 4px rgba(0,0,0,.1);
}

/* ── Theme toggle row (bottom of sidebar) ── */
.sidebar-header-right {
  display: none; /* убрали из шапки */
}

.theme-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
}

.theme-toggle-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

body.light .theme-toggle-label {
  color: var(--muted);
}

/* ══════════════════════════════════════
   CUSTOM CHECKBOX (jelly style)
   ══════════════════════════════════════ */

/* Hide native checkbox everywhere */
input[type="checkbox"] {
  display: none !important;
}

/* Every checkbox needs a label right after it to render */
input[type="checkbox"] + label,
input[type="checkbox"] + span,
input[type="checkbox"] ~ label.cbx {
  /* fallback — overridden per context below */
}

/* Generic custom checkbox via adjacent label trick.
   Applied to: .emp-check-item, .owner-check, user modal, bloom-switch (excluded below) */

/* ── emp-multiselect checkboxes ── */
.emp-check-item input[type="checkbox"] {
  display: none !important;
}
.emp-check-item {
  position: relative;
  padding-left: 38px;
}
.emp-check-item::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border: 1px solid #c8ccd4;
  border-radius: 3px;
  background: transparent;
  transition: background 0.1s ease, border-color 0.1s ease;
  cursor: pointer;
  flex-shrink: 0;
}
.emp-check-item::after {
  content: '';
  position: absolute;
  left: 18px;
  top: calc(50% - 7px);
  width: 6px;
  height: 12px;
  opacity: 0;
  transform: rotate(45deg) scale(0);
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transition: all 0.3s ease;
  transition-delay: 0.15s;
  pointer-events: none;
}
.emp-check-item:has(input:checked)::before {
  border-color: transparent;
  background: var(--accent);
  animation: jelly 0.6s ease;
}
.emp-check-item:has(input:checked)::after {
  opacity: 1;
  transform: rotate(45deg) scale(1);
}

/* ── owner checkbox ── */
.owner-check input[type="checkbox"] {
  display: none !important;
}
.owner-check {
  position: relative;
  padding-left: 38px;
}
.owner-check::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border: 1px solid #c8ccd4;
  border-radius: 3px;
  background: transparent;
  transition: background 0.1s ease, border-color 0.1s ease;
}
.owner-check::after {
  content: '';
  position: absolute;
  left: 18px;
  top: calc(50% - 7px);
  width: 6px;
  height: 12px;
  opacity: 0;
  transform: rotate(45deg) scale(0);
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transition: all 0.3s ease;
  transition-delay: 0.15s;
  pointer-events: none;
}
.owner-check:has(input:checked)::before {
  border-color: transparent;
  background: var(--accent);
  animation: jelly 0.6s ease;
}
.owner-check:has(input:checked)::after {
  opacity: 1;
  transform: rotate(45deg) scale(1);
}

/* ── Bloom switch — restore its hidden input ── */
.bloom-switch input[type="checkbox"] {
  display: none !important; /* already hidden, keep as is */
}

/* ── Jelly keyframe ── */
@keyframes jelly {
  from  { transform: translateY(-50%) scale(1, 1); }
  30%   { transform: translateY(-50%) scale(1.25, 0.75); }
  40%   { transform: translateY(-50%) scale(0.75, 1.25); }
  50%   { transform: translateY(-50%) scale(1.15, 0.85); }
  65%   { transform: translateY(-50%) scale(0.95, 1.05); }
  75%   { transform: translateY(-50%) scale(1.05, 0.95); }
  to    { transform: translateY(-50%) scale(1, 1); }
}

/* Light theme checkbox border */
body.light .emp-check-item::before,
body.light .owner-check::before {
  border-color: #9ca3af;
  background: #f8f9fa;
}
