:root {
  --bg: #0a0a0b;
  --surface: #141417;
  --surface-2: #1b1b1f;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #fafafa;
  --text-2: #a1a1aa;
  --text-3: #6b6b73;
  --ok: #5cc99a;
  --warn: #d9b06a;
  --bad: #d97a6a;
  --st-booked: #8b8b93;
  --st-active: #e0954f;
  --st-overdue: #a586d8;
  --st-done: #5cc99a;
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Outfit", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.5;
  min-height: 100dvh;
  color-scheme: dark; /* нативные календарь и крутилки времени — в тёмной теме */
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

.glow {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(50% 40% at 80% 0%, rgba(120, 150, 135, 0.08), transparent 70%);
}

.container { position: relative; z-index: 1; max-width: 940px; margin: 0 auto; padding: 0 24px 80px; }

/* topbar */
.topbar {
  position: relative; z-index: 2; max-width: 940px; margin: 0 auto;
  display: flex; align-items: center; gap: 16px;
  padding: 22px 24px;
}
.brand { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.02em; font-size: 18px; }
.crumbs { display: flex; align-items: center; gap: 8px; color: var(--text-3); font-size: 14px; flex: 1; }
.crumbs a { color: var(--text-3); transition: color .2s; }
.crumbs a:hover { color: var(--text); }
.crumbs .sep { color: var(--text-3); opacity: .5; }
.crumbs .here { color: var(--text); }
.topbar-link { font-size: 13px; color: var(--text-3); border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; transition: all .2s; }
.topbar-link:hover { color: var(--text); border-color: var(--line-strong); }

/* left sidebar */
body.has-side { padding-left: 240px; }
.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0; width: 240px; z-index: 5;
  background: #0c0c0e; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 26px; padding: 26px 16px;
}
.side-brand {
  font-family: var(--font-display); font-weight: 600; font-size: 19px;
  letter-spacing: -0.02em; padding: 0 10px;
}
.side-nav { display: flex; flex-direction: column; gap: 4px; }
.side-link {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: 11px;
  color: var(--text-2); font-size: 15px;
  transition: background .2s, color .2s;
}
.side-link:hover { background: rgba(255,255,255,0.04); color: var(--text); }
.side-link.active { background: var(--surface); color: var(--text); }
.side-ico { width: 18px; height: 18px; flex: none; opacity: .85; }
.side-sep { height: 1px; background: var(--line); margin: 2px 10px; }

@media (max-width: 860px) {
  body.has-side { padding-left: 0; }
  .sidebar {
    position: sticky; top: 0; width: auto; flex-direction: row; align-items: center;
    gap: 8px; padding: 12px 16px; border-right: none; border-bottom: 1px solid var(--line);
    overflow-x: auto;
  }
  .side-brand { font-size: 17px; padding: 0 6px 0 4px; white-space: nowrap; }
  .side-nav { flex-direction: row; gap: 2px; }
  .side-link { padding: 9px 12px; white-space: nowrap; }
  .side-sep { display: none; }
}

/* section heading with an action on the right */
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0 6px; }

/* page heading */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 20px 0 8px; }
.page-head h1 { font-family: var(--font-display); font-weight: 600; font-size: clamp(26px, 4vw, 38px); letter-spacing: -0.02em; }
.page-sub { color: var(--text-2); font-size: 15px; margin-bottom: 24px; }
.head-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.back { display: inline-block; color: var(--text-3); font-size: 14px; margin: 4px 0 14px; transition: color .2s; }
.back:hover { color: var(--text); }

/* big choice rows (project select, аренды list) */
.rows { border-top: 1px solid var(--line); }
.row {
  display: flex; align-items: center; gap: 18px;
  padding: 22px 8px; border-bottom: 1px solid var(--line);
  transition: background .2s, padding-left .2s;
}
.row:hover { background: rgba(255,255,255,0.02); padding-left: 14px; }
.row-index { font-family: var(--font-display); font-size: 13px; color: var(--text-3); width: 26px; }
.row-main { flex: 1; min-width: 0; }
.row-title { font-family: var(--font-display); font-weight: 500; font-size: 19px; letter-spacing: -0.01em; }
.row-meta { color: var(--text-2); font-size: 14px; margin-top: 3px; }
.row-arrow { color: var(--text-3); font-size: 20px; transition: transform .2s, color .2s; }
.row:hover .row-arrow { color: var(--text); transform: translateX(3px); }
.row-badge {
  font-size: 12px; color: var(--text-2); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px 11px; white-space: nowrap;
}

/* buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--text); color: #0a0a0b; font-weight: 500; font-size: 14px;
  padding: 11px 20px; border: none; border-radius: 11px;
  transition: transform .2s cubic-bezier(.16,1,.3,1), box-shadow .3s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 28px -14px rgba(255,255,255,0.3); }
.btn:active { transform: translateY(0) scale(.98); }
.btn-ghost {
  background: transparent; color: var(--text-2); border: 1px solid var(--line);
}
.btn-ghost:hover { color: var(--text); border-color: var(--line-strong); box-shadow: none; transform: none; }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-danger { background: transparent; color: var(--bad); border: 1px solid var(--line); }
.btn-danger:hover { border-color: var(--bad); box-shadow: none; transform: none; }

/* card / detail */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  padding: 24px; margin-bottom: 24px;
}
.meta-line { display: flex; flex-wrap: wrap; gap: 22px; color: var(--text-2); font-size: 14px; }
.meta-line b { color: var(--text); font-weight: 500; }

/* equipment rows inside аренда */
.item-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 4px; border-bottom: 1px solid var(--line);
}
.item-row:last-child { border-bottom: none; }
.item-art { font-family: var(--font-display); font-size: 12px; color: var(--text-3); width: 84px; }
.item-name { flex: 1; font-size: 15px; }
.item-cat { color: var(--text-3); font-size: 13px; }

/* forms */
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 7px; }
.field input, .field select {
  width: 100%; background: var(--surface-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 11px; padding: 12px 14px;
  font-family: inherit; font-size: 15px;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--line-strong); }
.field-hint { font-size: 12px; color: var(--text-3); margin-top: 6px; }
.edit-units { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.edit-unit { display: grid; grid-template-columns: 1fr 1.4fr auto; align-items: center; gap: 12px; }
.edit-unit input { width: 100%; background: var(--surface-2); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-family: inherit; font-size: 14px; }
.edit-unit input:focus { outline: none; border-color: var(--line-strong); }
.edit-unit-status { font-size: 12px; color: var(--text-3); white-space: nowrap; }
@media (max-width: 640px) { .edit-unit { grid-template-columns: 1fr; } }
.dt-row { display: flex; gap: 10px; }
.dt-row input[type="date"] { flex: 2; }
.dt-row input[type="time"] { flex: 1; min-width: 118px; }
.form-actions { display: flex; gap: 12px; margin-top: 6px; }
.add-inline { display: flex; gap: 10px; align-items: stretch; margin-top: 18px; }
.add-inline select { flex: 1; }

/* alerts */
.alert { border-radius: 12px; padding: 14px 16px; margin-bottom: 20px; font-size: 14px; }
.alert-bad { background: rgba(217,122,106,0.10); border: 1px solid rgba(217,122,106,0.35); color: #f0b3a8; }

/* empty state */
.empty { color: var(--text-3); text-align: center; padding: 48px 20px; border: 1px dashed var(--line); border-radius: 16px; }

/* status dot */
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.dot-ok { background: var(--ok); } .dot-warn { background: var(--warn); } .dot-bad { background: var(--bad); }

@media (max-width: 640px) {
  .add-inline { flex-direction: column; }
  .page-head { flex-direction: column; align-items: flex-start; }
}

/* каталог техники */
.cat-search { margin-bottom: 26px; }
.cat-search input {
  width: 100%; background: var(--surface-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 12px; padding: 13px 16px;
  font-family: inherit; font-size: 15px;
}
.cat-search input::placeholder { color: var(--text-3); }
.cat-search input:focus { outline: none; border-color: var(--line-strong); }

.cat-group { margin-bottom: 26px; }
.cat-group-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.cat-group-title { font-family: var(--font-display); font-weight: 500; font-size: 15px; color: var(--text-2); }
.cat-group-count { font-size: 12px; color: var(--text-3); border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; }

.cat-list { padding: 6px 22px; margin-bottom: 0; }
.cat-row {
  display: grid; grid-template-columns: 1fr auto auto 18px; align-items: center; gap: 16px;
  padding: 15px 2px; border-bottom: 1px solid var(--line);
  color: var(--text); transition: padding-left .2s, background .2s;
}
.cat-row:last-child { border-bottom: none; }
.cat-row:hover { background: rgba(255,255,255,0.02); padding-left: 8px; }
.cat-art { font-family: var(--font-display); font-size: 12px; color: var(--text-3); letter-spacing: .02em; }
.cat-name { font-size: 15px; }
.cat-status { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); white-space: nowrap; }
.cat-broken { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--bad); white-space: nowrap; }
.cat-qty { font-family: var(--font-display); font-size: 13px; color: var(--text-2); white-space: nowrap; }
.cat-chevron { color: var(--text-3); font-size: 16px; transition: transform .2s, color .2s; text-align: right; }
.cat-row:hover .cat-chevron { color: var(--text); transform: translateX(3px); }

@media (max-width: 640px) {
  .cat-row { grid-template-columns: 1fr auto 18px; gap: 10px; }
  .cat-broken { display: none; }
}

/* добавление единицы в модель */
.add-unit-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.add-unit-row input {
  flex: 1; min-width: 160px; background: var(--surface-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px;
  font-family: inherit; font-size: 14px;
}
.add-unit-row input::placeholder { color: var(--text-3); }
.add-unit-row input:focus { outline: none; border-color: var(--line-strong); }

/* карточка модели: экземпляры + история */
.unit-list { display: flex; flex-direction: column; gap: 14px; }
.unit-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; }
.unit-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.unit-head-right { display: flex; align-items: center; gap: 14px; }
.unit-art { font-family: var(--font-display); font-size: 14px; color: var(--text); letter-spacing: .02em; }
.unit-notes { color: var(--text-3); font-size: 13px; margin-top: 8px; }
.unit-history { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.unit-history-label { font-size: 12px; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 8px; }
.hist-row {
  display: grid; grid-template-columns: 130px 1fr auto; align-items: center; gap: 14px;
  padding: 9px 6px; border-radius: 9px; color: var(--text); transition: background .2s;
}
.hist-row:hover { background: rgba(255,255,255,0.03); }
.hist-project { font-size: 12px; color: var(--text-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; justify-self: start; white-space: nowrap; }
.hist-title { font-size: 14px; }
.hist-period { font-family: var(--font-display); font-size: 12px; color: var(--text-3); white-space: nowrap; }
.unit-norent { color: var(--text-3); font-size: 13px; font-style: italic; }

@media (max-width: 640px) {
  .hist-row { grid-template-columns: 1fr; gap: 4px; }
  .hist-period { justify-self: start; }
}

/* статусы аренды — бейджи и цветовые окна */
.status-badge {
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  font-size: 12px; padding: 4px 11px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--text-2);
}
.status-badge .dot { width: 7px; height: 7px; border-radius: 50%; }
.status-badge.st-booked { color: var(--st-booked); border-color: rgba(139,139,147,0.4); }
.status-badge.st-booked .dot { background: var(--st-booked); }
.status-badge.st-active { color: var(--st-active); border-color: rgba(224,149,79,0.4); background: rgba(224,149,79,0.08); }
.status-badge.st-active .dot { background: var(--st-active); }
.status-badge.st-overdue { color: var(--st-overdue); border-color: rgba(165,134,216,0.45); background: rgba(165,134,216,0.10); }
.status-badge.st-overdue .dot { background: var(--st-overdue); }
.status-badge.st-done { color: var(--st-done); border-color: rgba(92,201,154,0.4); }
.status-badge.st-done .dot { background: var(--st-done); }

/* горизонтальные вкладки статусов */
.tab-bar {
  display: flex; gap: 4px; margin-bottom: 26px;
  border-bottom: 1px solid var(--line); overflow-x: auto;
}
.tab {
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--text-3); font-family: inherit; font-size: 14px;
  padding: 11px 15px; transition: color .2s, border-color .2s;
}
.tab:hover { color: var(--text-2); }
.tab.active { color: var(--text); }
.tab-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--text-3); }
.tab-count {
  font-size: 12px; color: var(--text-3); border: 1px solid var(--line);
  border-radius: 999px; padding: 1px 8px;
}
.tab.st-booked .tab-dot { background: var(--st-booked); }
.tab.st-active .tab-dot { background: var(--st-active); }
.tab.st-overdue .tab-dot { background: var(--st-overdue); }
.tab.st-done .tab-dot { background: var(--st-done); }
.tab.st-booked.active { border-bottom-color: var(--st-booked); }
.tab.st-active.active { border-bottom-color: var(--st-active); }
.tab.st-overdue.active { border-bottom-color: var(--st-overdue); }
.tab.st-done.active { border-bottom-color: var(--st-done); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.cal-window { margin-bottom: 34px; }
.cal-window-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.cal-window-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.cal-window-title { font-family: var(--font-display); font-weight: 500; font-size: 16px; }
.cal-window-count { font-size: 12px; color: var(--text-3); border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; }
.cal-window-line { flex: 1; height: 1px; background: var(--line); }
.cal-window-empty { color: var(--text-3); font-size: 14px; padding: 4px 2px 8px; }
.st-booked .cal-window-dot { background: var(--st-booked); }
.st-active .cal-window-dot { background: var(--st-active); }
.st-overdue .cal-window-dot { background: var(--st-overdue); }
.st-done .cal-window-dot { background: var(--st-done); }
.cal-card.st-active { border-left: 3px solid var(--st-active); }
.cal-card.st-overdue { border-left: 3px solid var(--st-overdue); }
.cal-card.st-booked { border-left: 3px solid var(--st-booked); }
.cal-card.st-done { border-left: 3px solid var(--st-done); }

/* календарь аренд */
.cal-day { margin-bottom: 34px; }
.cal-day-head { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.cal-day-title { font-family: var(--font-display); font-weight: 500; font-size: 15px; color: var(--text-2); letter-spacing: .01em; white-space: nowrap; }
.cal-day-line { flex: 1; height: 1px; background: var(--line); }

.cal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }

.cal-card {
  display: flex; flex-direction: column; gap: 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 18px 18px 16px;
  transition: transform .25s cubic-bezier(.16,1,.3,1), border-color .25s, box-shadow .3s;
}
.cal-card:hover { transform: translateY(-3px); border-color: var(--line-strong); box-shadow: 0 18px 40px -22px rgba(0,0,0,0.8); }

.cal-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cal-project {
  font-size: 12px; color: var(--text-2); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px 11px; white-space: nowrap;
}
.cal-live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ok); white-space: nowrap; }

.cal-title { font-family: var(--font-display); font-weight: 500; font-size: 18px; letter-spacing: -0.01em; }

.cal-when { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.cal-date { font-size: 14px; color: var(--text); }
.cal-time { font-family: var(--font-display); font-size: 13px; color: var(--text-2); }

.cal-items { display: flex; flex-wrap: wrap; gap: 6px; }
.cal-chip {
  font-size: 12px; color: var(--text-2); background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 8px; padding: 4px 9px;
}
.cal-noitems { font-size: 13px; color: var(--text-3); font-style: italic; }

.cal-card-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 2px; padding-top: 12px; border-top: 1px solid var(--line);
}
.cal-count { font-size: 12px; color: var(--text-3); font-family: var(--font-display); }
.cal-open { font-size: 13px; color: var(--text-3); transition: color .2s, transform .2s; }
.cal-card:hover .cal-open { color: var(--text); transform: translateX(3px); }

/* добавление списком (сленг) */
.bulk-body { padding: 14px 16px 4px; }
.bulk-text {
  width: 100%; background: var(--surface-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
  font-family: inherit; font-size: 14px; line-height: 1.5; resize: vertical;
}
.bulk-text::placeholder { color: var(--text-3); }
.bulk-text:focus { outline: none; border-color: var(--line-strong); }
.bulk-preview { margin-top: 12px; max-height: 40vh; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.bulk-empty { color: var(--text-3); font-size: 14px; padding: 8px 0; }
.bulk-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2);
}
.bulk-in { font-size: 13px; color: var(--text-3); }
.bulk-arrow { color: var(--text-3); }
.bulk-name { font-size: 14px; color: var(--text); flex: 1; min-width: 0; }
.bulk-qty { font-family: var(--font-display); font-size: 12px; color: var(--ok); white-space: nowrap; }
.bulk-res { font-size: 13px; color: var(--bad); }
.bulk-row.bulk-bad { border-color: rgba(217,122,106,0.35); }
.bulk-row.bulk-bad .bulk-qty { color: var(--bad); }

/* окно подтверждения выдачи */
.confirm-modal { max-width: 440px; }
.confirm-body { padding: 18px 20px 4px; }
.confirm-lead { font-size: 16px; margin-bottom: 14px; }
.confirm-meta { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--text-2); margin-bottom: 18px; }
.confirm-meta b { color: var(--text); font-weight: 500; }
.confirm-gear-label { font-size: 12px; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 8px; }
.confirm-gear { max-height: 34vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; padding: 4px 12px; }
.confirm-gear-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.confirm-gear-row:last-child { border-bottom: none; }
.confirm-gear-name { font-size: 14px; }
.confirm-gear-art { font-family: var(--font-display); font-size: 12px; color: var(--text-3); }
.confirm-gear-empty { color: var(--text-3); font-size: 14px; padding: 10px 0; }
.confirm-note { font-size: 13px; color: var(--text-3); margin-top: 14px; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 20px 20px; }

/* модальное окно выбора техники */
.modal-overlay {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(6, 6, 8, 0.66); backdrop-filter: blur(5px);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.modal-overlay[hidden] { display: none; }
.modal {
  width: 100%; max-width: 460px; max-height: 82vh;
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 18px;
  box-shadow: 0 32px 80px -24px rgba(0, 0, 0, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  overflow: hidden;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 17px 20px; border-bottom: 1px solid var(--line);
}
.modal-title { font-family: var(--font-display); font-weight: 500; font-size: 16px; }
.modal-close {
  background: none; border: none; color: var(--text-3); font-size: 16px;
  padding: 6px 9px; border-radius: 9px; transition: color .2s, background .2s;
}
.modal-close:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.modal-search { padding: 12px 12px 8px; }
.modal-search input {
  width: 100%; background: var(--surface-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 13px;
  font-family: inherit; font-size: 14px;
}
.modal-search input::placeholder { color: var(--text-3); }
.modal-search input:focus { outline: none; border-color: var(--line-strong); }
.modal-list { overflow-y: auto; padding: 8px; }

.equip-btn {
  width: 100%; display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 16px;
  background: none; border: none; border-radius: 12px; padding: 14px 12px;
  text-align: left; color: var(--text); transition: background .2s;
}
.equip-btn:hover { background: rgba(255, 255, 255, 0.05); }
.equip-name { font-size: 15px; }
.equip-qty { font-size: 13px; color: var(--text-3); font-family: var(--font-display); white-space: nowrap; }
.equip-status { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; white-space: nowrap; min-width: 84px; justify-content: flex-end; }
.equip-status.free { color: var(--ok); }
.equip-status.busy { color: var(--bad); }
.equip-busy { opacity: 0.5; cursor: default; }
.equip-busy:hover { background: none; }

/* универсальный слот «Техника с ренталов» */
.equip-custom {
  grid-template-columns: auto 1fr auto; gap: 10px; align-items: center;
  background: var(--surface-2); border: 1px dashed var(--line-strong);
}
.equip-custom:hover { background: var(--surface-2); }
.equip-tag {
  font-size: 10px; color: var(--text-3); border: 1px solid var(--line);
  border-radius: 999px; padding: 2px 7px; vertical-align: middle; white-space: nowrap;
}
.equip-custom-input {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: 9px; padding: 8px 11px;
  font-family: inherit; font-size: 14px; min-width: 0;
}
.equip-custom-input::placeholder { color: var(--text-3); }
.equip-custom-input:focus { outline: none; border-color: var(--line-strong); }
.equip-add-custom {
  background: var(--text); color: #0a0a0b; border: none; border-radius: 9px;
  padding: 8px 14px; font-size: 13px; font-weight: 500; white-space: nowrap;
}
.item-tag {
  font-size: 10px; color: var(--text-3); border: 1px solid var(--line);
  border-radius: 999px; padding: 2px 7px; white-space: nowrap;
}
.item-edit {
  flex: 1; min-width: 0; background: var(--surface-2); color: var(--text);
  border: 1px solid var(--line-strong); border-radius: 9px; padding: 8px 11px;
  font-family: inherit; font-size: 15px;
}
.item-edit:focus { outline: none; border-color: var(--text-2); }

/* нижний блок сайдбара: текущий пользователь и выход */
.side-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding: 0 10px; }
.side-user { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.side-user-name { font-size: 14px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user-role { font-size: 12px; color: var(--text-3); }
.side-logout {
  width: 100%; background: none; border: 1px solid var(--line); color: var(--text-3);
  border-radius: 9px; padding: 7px 12px; font-size: 13px; transition: color .2s, border-color .2s;
}
.side-logout:hover { color: var(--text); border-color: var(--line-strong); }
@media (max-width: 860px) {
  .side-bottom { margin-top: 0; margin-left: auto; flex-direction: row; align-items: center; gap: 12px; padding: 0; }
  .side-user-role { display: none; }
  .side-logout { width: auto; white-space: nowrap; }
}

/* пользователь в верхней панели (старая оболочка) */
.topbar-user { font-size: 13px; color: var(--text-2); white-space: nowrap; }
.topbar-logout { background: none; }

/* страницы входа и первого запуска */
.auth-wrap { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px; position: relative; z-index: 1; }
.auth-card {
  width: 100%; max-width: 400px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px;
  padding: 34px 32px;
}
.auth-brand { font-family: var(--font-display); font-weight: 600; font-size: 20px; letter-spacing: -0.02em; margin-bottom: 6px; }
.auth-sub { color: var(--text-2); font-size: 14px; margin-bottom: 24px; }
.auth-btn { width: 100%; justify-content: center; margin-top: 4px; }

/* журнал действий */
.log-row {
  display: grid; grid-template-columns: 110px 160px 1fr; gap: 14px; align-items: baseline;
  padding: 11px 4px; border-bottom: 1px solid var(--line);
}
.log-row:last-child { border-bottom: none; }
.log-when { font-family: var(--font-display); font-size: 12px; color: var(--text-3); white-space: nowrap; }
.log-who { font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.log-text { font-size: 14px; }
@media (max-width: 640px) {
  .log-row { grid-template-columns: 1fr; gap: 2px; }
}

/* сотрудники */
.staff-row {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 14px 4px; border-bottom: 1px solid var(--line);
}
.staff-row:last-child { border-bottom: none; }
.staff-row.staff-off { opacity: .55; }
.staff-main { flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 2px; }
.staff-name { font-size: 15px; }
.staff-login { font-size: 13px; color: var(--text-3); }
.staff-pass { display: flex; gap: 8px; align-items: center; }
.staff-pass input {
  width: 150px; background: var(--surface-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 9px; padding: 8px 11px;
  font-family: inherit; font-size: 13px;
}
.staff-pass input::placeholder { color: var(--text-3); }
.staff-pass input:focus { outline: none; border-color: var(--line-strong); }
.staff-new { max-width: 420px; }

/* алерты: успех и предупреждение (в пару к alert-bad) */
.alert-ok { background: rgba(92,201,154,0.10); border: 1px solid rgba(92,201,154,0.35); color: #9adbbd; }
.alert-warn { background: rgba(217,176,106,0.10); border: 1px solid rgba(217,176,106,0.35); color: #e3c98f; }

/* инвентаризация: прогресс */
.inv-progress { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.inv-progress-bar { flex: 1; height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.inv-progress-fill { height: 100%; width: 0; border-radius: 999px; background: var(--ok); transition: width .4s cubic-bezier(.16,1,.3,1); }
.inv-progress-text { font-family: var(--font-display); font-size: 13px; color: var(--text-2); white-space: nowrap; }

/* инвентаризация: строки обхода */
.inv-row {
  display: grid; grid-template-columns: 84px 1fr auto minmax(110px, 170px) auto;
  gap: 12px; align-items: center; padding: 11px 4px; border-bottom: 1px solid var(--line);
}
.inv-row:last-child { border-bottom: none; }
.inv-name { font-size: 15px; min-width: 0; }
.inv-note {
  background: var(--surface-2); color: var(--text); border: 1px solid var(--line);
  border-radius: 9px; padding: 7px 10px; font-family: inherit; font-size: 13px; min-width: 0;
}
.inv-note::placeholder { color: var(--text-3); }
.inv-note:focus { outline: none; border-color: var(--line-strong); }
.inv-actions { display: flex; gap: 6px; white-space: nowrap; }
.inv-row.inv-done { opacity: .55; }
.inv-row.inv-done.inv-missing { opacity: 1; background: rgba(217,122,106,0.05); }
.inv-mark { font-size: 11px; border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
.inv-mark-ok { color: var(--ok); border-color: rgba(92,201,154,0.4); }
.inv-mark-missing { color: var(--bad); border-color: rgba(217,122,106,0.45); }
.inv-mark-repair { color: var(--warn); border-color: rgba(217,176,106,0.45); }
@media (max-width: 860px) {
  .inv-row { grid-template-columns: 1fr auto; }
  .inv-row .item-art, .inv-note { display: none; }
}

/* шкала состояния: точки 1–5 */
.cond-dots { display: inline-flex; gap: 5px; align-items: center; }
.cond-dot {
  width: 12px; height: 12px; border-radius: 50%; padding: 0; border: 1px solid var(--line-strong);
  background: transparent; transition: background .15s, transform .15s;
}
.cond-dot:hover { transform: scale(1.25); }
.cond-dot.on { background: var(--text-2); border-color: var(--text-2); }
.cond-static { display: inline-flex; gap: 4px; }
.cond-static i { width: 9px; height: 9px; border-radius: 50%; border: 1px solid var(--line-strong); }
.cond-static i.on { background: var(--text-2); border-color: var(--text-2); }

/* сканер QR */
.scan-body { padding: 14px 16px 16px; }
#scan-video { width: 100%; border-radius: 12px; background: #000; max-height: 46vh; object-fit: cover; }
.scan-status { min-height: 22px; margin-top: 10px; font-size: 14px; }

/* страница печати QR */
.qr-page { padding: 24px; background: var(--bg); }
.qr-toolbar { display: flex; align-items: center; gap: 16px; margin-bottom: 6px; flex-wrap: wrap; }
.qr-filter select {
  background: var(--surface-2); color: var(--text); border: 1px solid var(--line);
  border-radius: 9px; padding: 8px 11px; font-family: inherit; font-size: 13px;
}
.qr-count { color: var(--text-3); font-size: 13px; flex: 1; }
.qr-hint { color: var(--text-3); font-size: 13px; margin-bottom: 22px; }
.qr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.qr-label {
  background: #fff; color: #111; border-radius: 10px; padding: 12px 10px 10px;
  text-align: center; break-inside: avoid;
}
.qr-svg svg { width: 96px; height: 96px; display: block; margin: 0 auto; }
.qr-art { font-family: var(--font-display); font-weight: 600; font-size: 15px; margin-top: 8px; }
.qr-name { font-size: 11px; color: #555; margin-top: 2px; line-height: 1.25; }
@media print {
  .qr-page { background: #fff; padding: 0; }
  .qr-toolbar, .qr-hint { display: none; }
  .qr-grid { gap: 8px; }
  .qr-label { border: 1px dashed #bbb; border-radius: 0; }
}

/* строка каталога: flex вместо жёсткой сетки (бейджи пропаж/проверок) */
.cat-row { display: flex; }
.cat-row .cat-name { flex: 1; min-width: 0; }
.cat-stale {
  font-size: 11px; color: var(--text-3); border: 1px dashed var(--line-strong);
  border-radius: 999px; padding: 2px 9px; white-space: nowrap;
}

/* состояние единицы на карточке модели */
.unit-cond { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.unit-cond-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cond-select {
  background: var(--surface-2); color: var(--text); border: 1px solid var(--line);
  border-radius: 9px; padding: 7px 10px; font-family: inherit; font-size: 13px;
}
.unit-cond-form input[type="text"] {
  flex: 1; min-width: 140px; background: var(--surface-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 9px; padding: 7px 10px;
  font-family: inherit; font-size: 13px;
}
.unit-cond-form input[type="text"]::placeholder { color: var(--text-3); }
.unit-cond-form input[type="text"]:focus { outline: none; border-color: var(--line-strong); }
.unit-cond-meta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px; font-size: 12px; color: var(--text-3); }

/* комплектация: чипы + добавление из списка */
.unit-kit { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.kit-chip-form { display: inline-flex; }
.kit-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-2); background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 6px 4px 11px;
}
.kit-chip-x {
  background: none; border: none; color: var(--text-3); font-size: 10px;
  padding: 2px 5px; border-radius: 50%; line-height: 1; transition: color .15s, background .15s;
}
.kit-chip-x:hover { color: var(--bad); background: rgba(217,122,106,0.12); }
.kit-add-form { display: inline-flex; gap: 6px; align-items: center; }
.kit-add-form input {
  width: 130px; background: var(--surface-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px;
  font-family: inherit; font-size: 12px;
}
.kit-add-form input::placeholder { color: var(--text-3); }
.kit-add-form input:focus { outline: none; border-color: var(--line-strong); }
.kit-add-form .btn { border-radius: 999px; padding: 5px 11px; }
