/**
 * Pages — План, Зарплата, Бонусы, Ремонты, Заказы
 */

/* ===== PLAN ===== */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.plan-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-card); }
.plan-card-header { padding: 16px 20px; color: #fff; }
.plan-card-header .title { font-size: 13px; font-weight: 700; opacity: .9; }
.plan-card-header .value { font-family: var(--font-mono); font-size: 24px; font-weight: 800; margin-top: 4px; }
.plan-card-header.aurora { background: var(--aurora); }
.plan-card-header.gudok { background: var(--gudok); }
.plan-card-header.total { background: var(--text); }
.plan-card-body { padding: 16px 20px; }
.plan-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; }
.plan-row .label { color: var(--text-secondary); }
.plan-row .value { font-family: var(--font-mono); font-weight: 700; }
.plan-status { text-align: center; padding: 10px; margin-top: 8px; border-radius: var(--radius-sm); font-weight: 800; font-size: 14px; }
.plan-status.ok { background: var(--green-bg); color: var(--green); }
.plan-status.behind { background: var(--red-bg); color: var(--red); }
.plan-edit-section { background: var(--bg3); border-radius: var(--radius-sm); padding: 12px; margin-bottom: 12px; }
.plan-edit-section .input-money { font-size: 14px; }

/* ===== SALARY ===== */
.salary-tabs { display: flex; gap: 4px; margin-bottom: 16px; flex-wrap: wrap; }
.salary-tab { padding: 12px 24px; border-radius: 10px; font-size: 15px; font-weight: 700; border: none; background: var(--bg3); color: var(--text-secondary); cursor: pointer; transition: all .15s; }
.salary-tab.active { background: var(--accent); color: #fff; }

.salary-period-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(370px, 1fr)); max-width: 1200px; margin-left: auto; margin-right: auto;
  gap: 16px;
}

.salary-period-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-card);
}

.salary-period-card.is-bonus {
  border-color: rgba(139,92,246,.25);
}

.salary-period-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-left: 12px;
  margin-bottom: 16px;
  border-left: 4px solid var(--accent);
}

.salary-period-header.bonus-header {
  border-left-color: var(--purple);
}

.salary-period-header .period-name {
  font-weight: 800;
  font-size: 18px;
}

.salary-period-header .period-dolg {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px;
  color: var(--text-secondary);
}

.salary-vydeleno-compact {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding: 10px 14px;
  background: var(--bg3);
  border-radius: 10px;
}

.salary-vydeleno-compact .vydeleno-label {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}

.salary-vydeleno-compact .input-sm {
  width: 120px;
  padding: 8px 10px;
  font-size: 15px;
  font-family: var(--font-mono);
  border-radius: 8px;
}

.salary-vydeleno-compact .vydeleno-value {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 15px;
}

/* Сотрудники в карточке */
.salary-emp-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.salary-emp-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg3);
}

.salary-emp-row.paid {
  background: var(--green-bg);
}

.salary-emp-row .emp-tag {
  flex-shrink: 0;
  font-size: 13px;
  padding: 4px 12px;
  min-width: 90px;
  text-align: center;
}

.salary-emp-row .input-dolg {
  width: 80px;
  padding: 6px 8px;
  font-size: 14px;
  font-family: var(--font-mono);
  font-weight: 600;
  text-align: right;
  border-radius: 8px;
}

.salary-emp-row .dolg-value {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px;
  min-width: 70px;
  text-align: right;
}

.salary-emp-row .vydat-block {
  margin-left: auto;
  text-align: right;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 15px;
  white-space: nowrap;
}

.salary-emp-row .vydat-block.paid {
  color: var(--green);
}

.salary-emp-row .pay-btn {
  padding: 8px 12px;
  font-size: 13px;
  border-radius: 8px;
  flex-shrink: 0;
}

.salary-emp-row .paid-mark {
  color: var(--green);
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
}

/* Итого */
.salary-grand-total {
  margin-top: 24px;
  padding: 18px 24px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  gap: 24px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 16px;
  font-weight: 600;
  box-shadow: var(--shadow-card);
}

.salary-grand-total .total-label {
  font-weight: 800;
}

.salary-grand-total .total-value {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 18px;
}

/* ===== SALARY v3 — clean vertical table ===== */
.sal-table-wrap { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.sal-table { font-size: 14px; }
.sal-table th { font-size: 11px; padding: 10px 10px; font-weight: 800; text-align: center; white-space: nowrap; }
.sal-table td { padding: 8px 10px; text-align: center; border-bottom: 1px solid var(--border); vertical-align: middle; }
.sal-th-period { text-align: left !important; width: 70px; }
.sal-th-vyd { width: 100px; }

.sal-label { text-align: left !important; font-size: 13px; font-weight: 700; white-space: nowrap; }
.sal-vyd { font-weight: 700; color: var(--text-secondary); font-family: var(--font-mono); font-size: 13px; }
.sal-vyd-accent { color: var(--accent); font-weight: 800; }

.sal-inp-vyd { width: 90px; padding: 5px 6px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; text-align: center; background: var(--bg); color: var(--text-primary); font-family: var(--font-mono); font-weight: 700; }

/* Ячейка сотрудника */
.sal-cell { min-width: 80px; position: relative; transition: background .15s; border-radius: 0; }
.sal-cell[style*="cursor:pointer"]:hover { filter: brightness(0.95); }
.sal-unpaid { background: #fef9c3; }
.sal-paid { background: #dcfce7; }
.sal-penalty { background: #fee2e2; }

/* Инпут долга — мелкий, сверху */
.sal-inp-dolg { width: 64px; padding: 3px 4px; border: 1px solid var(--border); border-radius: 4px; font-size: 11px; text-align: center; background: rgba(255,255,255,.7); color: var(--text-secondary); font-family: var(--font-mono); margin-bottom: 2px; display: block; margin-left: auto; margin-right: auto; }

/* Сумма к выплате — ГЛАВНЫЙ элемент */
.sal-vyplata { font-size: 15px; font-weight: 800; font-family: var(--font-mono); color: var(--text-primary); line-height: 1.2; }
.sal-vyplata.sal-zero { font-size: 13px; font-weight: 400; color: var(--text-muted); }

.sal-paid-mark { font-size: 10px; color: #059669; font-weight: 700; margin-top: 2px; }

/* Итого */
.sal-total-cell { background: var(--bg3); }
.sal-total { font-weight: 800; font-size: 14px; font-family: var(--font-mono); }
.sal-pos { color: #059669; }
.sal-neg { color: var(--red); }

/* Строки бонуса и итого */
.sal-row-bonus { border-top: 2px solid var(--accent); }
.sal-row-bonus .sal-label { color: var(--accent); }
.sal-row-total { border-top: 2px solid var(--border); }
.sal-row-total td { background: var(--bg3); }

/* ===== BONUS v2 ===== */
.bonus-settings { margin-bottom: 16px; }
.bonus-settings .form-row { max-width: 400px; }
.bonus-settings-info { display: flex; gap: 20px; margin-bottom: 16px; font-size: 14px; color: var(--text-secondary); }

/* Настройки — компактная строка */
.bonus-settings-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.bonus-s-field { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.bonus-s-field label { color: var(--text-muted); }
.bonus-s-input { width: 70px !important; padding: 4px 8px !important; font-size: 13px !important; text-align: center; }
.bonus-multipliers-details { margin-bottom: 14px; }
.bonus-multipliers-summary { font-size: 12px; font-weight: 600; color: var(--text-muted); cursor: pointer; padding: 4px 0; user-select: none; }
.bonus-multipliers-summary:hover { color: var(--text-secondary); }
.bonus-settings-mul { margin-top: 8px; margin-bottom: 0; }
.bonus-settings-mul .bonus-s-input { width: 60px !important; }

/* Таблица */
.bonus-table-wrap { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 12px; }
.bonus-calc-table { font-size: 14px; }
.bonus-calc-table th { font-size: 11px; padding: 8px 10px; font-weight: 800; text-align: center; }
.bonus-calc-table td { padding: 8px 10px; font-weight: 700; font-family: var(--font-mono); text-align: center; }
.bonus-type-col { text-align: left !important; white-space: nowrap; }
.bonus-type-label { text-align: left !important; font-family: var(--font) !important; font-size: 13px; font-weight: 700; white-space: nowrap; }
.bonus-emp-col { vertical-align: middle; }
.bonus-emp-col .sch-legend-chip { font-size: 12px; padding: 4px 10px; }
.bonus-emp-col .sch-legend-stat { font-size: 10px; }
.bonus-mult { font-size: 10px; color: var(--text-muted); font-weight: 500; }
.bonus-diff { font-size: 11px; font-weight: 600; }
.bonus-diff.positive { color: var(--green); }
.bonus-diff.negative { color: var(--red); }
.bonus-row-overtime td { background: var(--bg3); }
.bonus-calc-table tr:hover td { background: transparent; }
.bonus-calc-table tr.bonus-row-overtime:hover td { background: var(--bg3); }
.bonus-row-total td { border-top: 2px solid var(--border); background: var(--bg3); }
.bonus-calc-table tr.bonus-row-total:hover td { background: var(--bg3); }
.bonus-total { font-size: 13px !important; font-weight: 800 !important; }
.bonus-total.positive { color: var(--green); }
.bonus-total.negative { color: var(--red); }

/* Ячейки (кликабельные) */
.bonus-cell { cursor: default; min-width: 50px; }
.bonus-cell-clickable { cursor: pointer; border-radius: 6px; transition: all .15s; position: relative; }
.bonus-cell-plus { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent-light); color: var(--accent); font-size: 20px; font-weight: 900; line-height: 1; transition: all .2s; }
.bonus-cell-clickable:hover .bonus-cell-plus { background: var(--accent); color: #fff; transform: scale(1.15); box-shadow: 0 2px 8px var(--accent-glow); }
.bonus-cell-mistake { color: var(--red); }

/* Hover: показываем + кружок вместо числа */
.bonus-val { transition: opacity .1s; }
.bonus-hover-plus { display: none; position: absolute; inset: 0; align-items: center; justify-content: center; }
.bonus-hover-plus::after { content: '+'; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 20px; font-weight: 900; line-height: 1; box-shadow: 0 2px 8px var(--accent-glow); }
.bonus-cell-clickable:hover .bonus-val { opacity: 0; }
.bonus-cell-clickable:hover .bonus-hover-plus { display: inline-flex; }

/* Формула */
.bonus-formula-ref { margin-top: 12px; }
.bonus-formula-ref summary { font-size: 12px; color: var(--text-muted); cursor: pointer; font-weight: 600; }
.bonus-formula-ref code { display: block; margin-top: 8px; padding: 12px; background: var(--bg3); border-radius: var(--radius-sm); font-size: 11px; font-family: var(--font-mono); color: var(--text-secondary); line-height: 1.6; word-break: break-all; }

/* Секция заявок */
.bonus-requests-section { margin-top: 20px; }
.bonus-section-title { font-size: 14px; font-weight: 800; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.bonus-requests-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.bonus-req-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; cursor: pointer; transition: all .15s; }
.bonus-req-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-1px); }
.bonus-req-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.bonus-req-card-body { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.bonus-req-date { font-size: 11px; color: var(--text-muted); }
.bonus-req-comment { font-size: 12px; color: var(--text-secondary); margin-top: 4px; line-height: 1.4; }
.bonus-req-actions { display: flex; gap: 8px; margin-top: 10px; }
.bonus-req-actions .btn { padding: 6px 14px; font-size: 13px; font-weight: 700; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,.12); }

/* Фильтры */
.bonus-filter-bar { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.bonus-filter-count { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 10px; font-size: 10px; font-weight: 800; background: var(--bg3); color: var(--text-muted); margin-left: 4px; }
.filter-btn.active .bonus-filter-count { background: rgba(255,255,255,.25); color: #fff; }

/* Бейдж «Изменяли» */
.bonus-req-edited-badge { font-size: 11px; font-weight: 600; color: var(--text-muted); margin-top: 4px; }

/* Карточки по статусу — фон */
.bonus-req-card-approved { background: rgba(34,197,94,.08); border-color: rgba(34,197,94,.2); }
.bonus-req-card-rejected { background: rgba(239,68,68,.06); border-color: rgba(239,68,68,.15); opacity: .75; }
.bonus-req-card-pending { background: rgba(251,191,36,.08); border-color: rgba(251,191,36,.2); }

/* Статус-select в карточке */
.bonus-status-select { width: auto; min-width: 160px; padding: 4px 10px; font-size: 13px; font-weight: 700; border-radius: 20px; }

/* Кнопка оспаривания */
.btn-warning { background: var(--orange); color: #fff; }
.btn-warning:hover { opacity: .9; }

/* Секция оспаривания */
.bonus-dispute-section { margin-top: 12px; padding: 12px; background: rgba(251,191,36,.08); border: 1px solid rgba(251,191,36,.2); border-radius: var(--radius-sm); }

/* Список заявок в модалке ячейки */
.bonus-card-list { display: flex; flex-direction: column; gap: 8px; }
.bonus-card-item { background: var(--bg3); border-radius: var(--radius-sm); padding: 12px; cursor: pointer; transition: all .15s; border-left: 3px solid var(--border); }
.bonus-card-item:hover { background: var(--accent-light); }
.bonus-card-item.approved { border-left-color: var(--green); }
.bonus-card-item.rejected { border-left-color: var(--red); }
.bonus-card-item.pending { border-left-color: var(--orange); }
.bonus-card-item-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.bonus-card-item-body { font-size: 16px; }

/* Карточка заявки (модалка) */
.bonus-card-info { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.bonus-card-info-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--border); }
.bonus-card-info-row:last-child { border-bottom: none; }
.bonus-card-label { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.bonus-card-edit { margin-bottom: 12px; }

/* История изменений */
.bonus-history-section { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 12px; }
.bonus-history-title { font-size: 12px; font-weight: 700; color: var(--text-muted); cursor: pointer; }
.bonus-history-list { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.bonus-history-item { padding: 8px 12px; background: var(--bg3); border-radius: var(--radius-sm); font-size: 12px; }
.bonus-history-meta { font-weight: 700; margin-bottom: 2px; color: var(--text-secondary); }
.bonus-history-desc { color: var(--text); }

/* ===== ORDERS — table (desktop) + cards (mobile) ===== */

/* ── Desktop table ── */
/* ── Phone mask ── */
.phone-valid { border-color: #34C759 !important; background: #EEFBF1 !important; box-shadow: 0 0 0 3px rgba(52,199,89,0.15) !important; }
.phone-invalid { border-color: var(--border); }

/* ── Search bar ── */
.order-search-bar { margin-bottom: 12px; }
.order-search-input { width: 100%; max-width: 400px; padding: 10px 14px; font-size: 14px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg2); transition: border-color .15s; }
.order-search-input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(225,80,150,.12); }

/* ── Desktop table ── */
.order-table-wrap { display: block; overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.order-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.order-table thead th { padding: 10px 12px; text-align: left; font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; border-bottom: 2px solid var(--border); white-space: nowrap; background: var(--bg); }
.order-table tbody tr { cursor: pointer; transition: background .12s; }
.order-table tbody tr:hover { background: var(--bg3); }
.order-table tbody tr { height: 52px; }
.order-table tbody td { padding: 6px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.order-table .ot-num { font-family: var(--font-mono); font-weight: 800; font-size: 13px; white-space: nowrap; }
.order-table .ot-mono { font-family: var(--font-mono); font-weight: 700; white-space: nowrap; }
.order-table .ot-nowrap { white-space: nowrap; }
.order-table .ot-type { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.order-table .ot-del-badge { color: var(--red); font-size: 11px; }
.order-table .ot-row-deleted td { opacity: .5; }
.order-table .ot-row-deleted .ot-num { text-decoration: line-through; }
.order-table .ot-prices-cell { white-space: nowrap; text-align: right; min-width: 100px; }
.order-table thead th:nth-last-child(2) { text-align: right; }

/* 2-line cells */
.ot-cell2 { white-space: nowrap; }
.ot-line1 { font-size: 13px; font-weight: 500; line-height: 1.3; }
.ot-line2 { font-size: 11px; color: var(--text-muted); line-height: 1.3; margin-top: 1px; }
.ot-price-val-sub { font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); }

/* ── Price badges (Цены) ── */
.ot-price-badge { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 700; font-family: var(--font-mono); line-height: 1.5; }
.ot-price-green { background: #22C55E18; color: #16A34A; }
.ot-price-yellow { background: #F59E0B18; color: #D97706; }
.ot-prices .ot-price-badge + .ot-price-badge,
.order-card-prices .ot-price-badge + .ot-price-badge { display: block; margin-top: 2px; }
.order-card-prices { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }

/* ── Multi-input widget ── */
.multi-input-wrap { }
.multi-input-row { display: flex; gap: 6px; align-items: center; margin-bottom: 4px; }
.multi-input-row .input { flex: 1; }
.multi-input-del { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: 6px; background: var(--bg2); cursor: pointer; font-size: 12px; color: var(--text-muted); transition: all .15s; flex-shrink: 0; }
.multi-input-del:hover { border-color: var(--red); color: var(--red); background: rgba(239,68,68,.08); }

/* ── Order detail header actions ── */
.od-header-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.od-action-btn {
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 8px; background: var(--bg2);
  cursor: pointer; font-size: 16px; transition: all .15s;
}
.od-action-btn:hover { background: var(--bg3); }
.od-act-edit:hover { border-color: var(--accent); background: rgba(225,80,150,.08); }
.od-act-delete:hover { border-color: var(--red); background: rgba(239,68,68,.08); }
.od-act-restore:hover { border-color: var(--green); background: rgba(34,197,94,.08); }

/* ── Order detail field layout ── */
.od-fields-grid { display: flex; flex-direction: column; gap: 8px; }
.od-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.od-field { padding: 8px 12px; background: var(--bg3); border-radius: var(--radius-sm); }
.od-field-label { font-size: 11px; font-weight: 600; color: var(--text-muted); margin-bottom: 2px; }
.od-field-value { font-weight: 700; font-size: 14px; }
.od-field-value.mono { font-family: var(--font-mono); }

/* ── Работы / Запчасти — строки в карточке заказа ── */
.od-line-item {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 8px 0; font-size: 13px; border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.od-line-name { flex: 1; font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.od-line-actions { display: flex; align-items: center; gap: 6px; }
.od-line-price { font-family: var(--font-mono); font-weight: 700; white-space: nowrap; }
.od-inline-edit {
  display: flex; align-items: center; gap: 6px; width: 100%; padding: 4px 0;
}
/* Запчасти — информационные, не влияют на итого */
.od-part-info { opacity: .85; }
.od-part-info .od-line-price { color: var(--text-secondary); }
/* Развернутые запчасти внутри работы */
.od-work-parts { font-size: 12px; color: var(--text-secondary); }
/* Stock picker в модалках добавления */
.od-stock-list { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); }
.od-stock-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; cursor: pointer; border-bottom: 1px solid var(--border); transition: background .1s; font-size: 13px; }
.od-stock-row:last-child { border-bottom: none; }
.od-stock-row:hover { background: color-mix(in srgb, var(--accent) 8%, var(--bg)); }
.od-stock-name { font-weight: 600; flex: 1; }
.od-stock-meta { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); white-space: nowrap; margin-left: 12px; }
/* Inline employee dropdown */
.od-emp-dd { position: absolute; right: 0; top: 100%; background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-hover); z-index: 100; min-width: 160px; max-height: 200px; overflow-y: auto; }
.od-emp-dd-item { display: flex; align-items: center; gap: 8px; padding: 8px 12px; cursor: pointer; font-size: 13px; transition: background .1s; }
.od-emp-dd-item:hover { background: var(--bg3); }
/* Согласованные запчасти виджет */
.od-agreed-parts { border: 1.5px dashed var(--accent); border-radius: var(--radius-sm); padding: 12px; background: color-mix(in srgb, var(--accent) 4%, var(--bg)); }
.od-agreed-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 12px; border-bottom: 1px solid color-mix(in srgb, var(--border) 50%, transparent); }
.od-agreed-row:last-child { border-bottom: none; }
.od-agreed-name { flex: 1; font-weight: 600; }
.od-agreed-source { font-size: 11px; padding: 2px 8px; border-radius: 10px; background: var(--bg3); color: var(--accent); font-weight: 600; text-decoration: none; }
.od-agreed-source:hover { opacity: .8; }
.od-agreed-price { font-family: var(--font-mono); font-weight: 700; font-size: 12px; }
/* ===== ORDER DETAIL TABS ===== */
.od-tabs { display: flex; gap: 0; margin-bottom: 16px; }
.od-tab-btn {
  flex: 1; padding: 10px 16px; font-size: 13px; font-weight: 700;
  border: 2px solid var(--border); background: var(--bg2); color: var(--text-secondary);
  cursor: pointer; transition: all .15s; text-align: center;
}
.od-tab-btn:first-child { border-radius: 10px 0 0 10px; }
.od-tab-btn:last-child { border-radius: 0 10px 10px 0; border-left: none; }
.od-tab-btn:hover { color: var(--accent); border-color: var(--accent); }
.od-tab-btn.od-tab-active { background: var(--accent); color: #fff; border-color: var(--accent); }
.od-tab-content { display: none; }
.od-tab-content.od-tab-visible { display: block; }

/* ===== ORDER DETAIL SECTIONS ===== */
.od-section { margin-bottom: 14px; }
.od-section-title {
  font-size: 11px; font-weight: 800; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .5px;
  margin-bottom: 6px; padding-left: 2px;
}
.od-section-body { display: flex; flex-direction: column; gap: 8px; }

/* Stock picker tree tabs */
.sp-tab-row { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 0; }
.sp-tab-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ── Mobile cards (hidden on desktop) ── */
/* ── Кнопка "Показать ещё" ── */
.orders-load-more { text-align: center; padding: 16px 0; }
.orders-load-more-btn { padding: 10px 32px; font-size: 14px; font-weight: 600; border-radius: var(--radius); background: var(--bg2); border: 1px solid var(--border); cursor: pointer; transition: all .15s; color: var(--text); }
.orders-load-more-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.orders-count { text-align: center; font-size: 12px; color: var(--text-muted); padding: 4px 0 12px; }

.order-cards-mobile { display: none; flex-direction: column; gap: 8px; }
.order-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; cursor: pointer; transition: all .15s; }
.order-card:hover { box-shadow: var(--shadow-hover); border-color: var(--accent); }
.order-card-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.order-card-number { font-family: var(--font-mono); font-weight: 800; font-size: 14px; color: var(--text); }
.order-card-status { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.order-card-type { font-size: 12px; color: var(--text-muted); margin-left: auto; white-space: nowrap; }
.order-card-fields { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--text); }
.order-card-field { display: flex; align-items: baseline; gap: 4px; }
.order-card-field-label { font-size: 11px; color: var(--text-muted); font-weight: 600; }
.order-card-field-value { font-weight: 600; }
.order-card-field-value.mono { font-family: var(--font-mono); }
.order-card-bottom { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 12px; color: var(--text-muted); }
.order-card-bottom .order-card-manager { font-weight: 600; }
.order-card-bottom .order-card-date { margin-left: auto; }

/* Deleted card */
.order-card-deleted { opacity: .55; border-style: dashed; border-color: var(--red-border); background: var(--red-bg); }
.order-card-deleted .order-card-number,
.order-card-deleted .order-card-field-value { text-decoration: line-through; }
.order-card-deleted:hover { border-color: var(--red); }

/* Legacy compat */
.repair-list { display: flex; flex-direction: column; gap: 8px; }
.repair-row { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; display: grid; grid-template-columns: 80px 100px 1fr 1.2fr 1fr 120px; align-items: center; gap: 12px; cursor: pointer; transition: all .15s; }
.repair-row:hover { box-shadow: var(--shadow-hover); transform: translateY(-1px); }
.repair-row .number { font-family: var(--font-mono); font-weight: 800; font-size: 13px; }
.repair-row .device { font-weight: 600; font-size: 13px; }
.repair-row .defect { font-size: 12px; color: var(--text-secondary); }

/* ===== EMPLOYEES ===== */
.user-info:hover { opacity: .7; }
.emp-list { display: flex; flex-direction: column; gap: 8px; }
.emp-list-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; display: flex; align-items: center; gap: 16px; cursor: pointer; transition: all .15s; }
.emp-list-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-1px); }
.emp-list-card.emp-inactive { opacity: .5; }
.emp-list-avatar { flex-shrink: 0; width: 48px; height: 48px; border-radius: 50%; overflow: hidden; display: flex; align-items: center; justify-content: center; background: var(--bg3); }
.emp-list-avatar img { width: 100%; height: 100%; object-fit: cover; }
.emp-list-info { flex: 1; min-width: 0; }
.emp-list-name { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.emp-list-fullname { font-size: 12px; font-weight: 400; color: var(--text-muted); margin-left: 6px; }
.emp-list-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.emp-list-shop { font-size: 12px; color: var(--text-secondary); }
.emp-list-phone { font-size: 12px; color: var(--text-muted); font-family: var(--font-mono); }
.emp-list-arrow { color: var(--text-muted); font-size: 18px; flex-shrink: 0; }

/* Карточка сотрудника (модалка) */
.emp-card-modal { max-height: 70vh; overflow-y: auto; }
.emp-card-section { margin-bottom: 16px; }
.emp-card-section-title { font-size: 13px; font-weight: 800; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 12px; }
.emp-card-details { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0; margin-bottom: 8px; }
.emp-card-details[open] { padding-bottom: 12px; }
.emp-card-toggle { padding: 12px 16px; cursor: pointer; user-select: none; list-style: none; }
.emp-card-toggle::-webkit-details-marker { display: none; }
.emp-card-toggle::before { content: '▸ '; transition: transform .2s; }
.emp-card-details[open] > .emp-card-toggle::before { content: '▾ '; }
.emp-card-section-body { padding: 0 16px; }

/* Color picker */
.emp-color-picker { display: flex; gap: 6px; flex-wrap: wrap; padding: 4px 0; }
.emp-color-dot { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 14px; font-weight: 800; border: 3px solid transparent; transition: all .15s; }
.emp-color-dot:hover { transform: scale(1.15); }
.emp-color-dot.active { transform: scale(1.15); box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.emp-color-dot.taken { cursor: not-allowed; pointer-events: none; }

/* Профиль (модалка) */
.profile-header { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.profile-avatar { flex-shrink: 0; width: 64px; height: 64px; border-radius: 50%; overflow: hidden; display: flex; align-items: center; justify-content: center; background: var(--bg3); }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-name-block { flex: 1; }
.profile-name { font-size: 20px; font-weight: 800; }
.profile-fullname { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.profile-meta { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.profile-shop { font-size: 12px; color: var(--text-secondary); }
.profile-info { display: flex; flex-direction: column; gap: 0; }
.profile-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.profile-row:last-child { border-bottom: none; }
.profile-label { font-size: 13px; color: var(--text-secondary); font-weight: 600; }
.profile-value { font-size: 14px; font-weight: 700; text-align: right; }
.profile-details { margin-top: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.profile-details summary { padding: 10px 16px; font-size: 13px; font-weight: 700; color: var(--text-muted); cursor: pointer; list-style: none; }
.profile-details summary::-webkit-details-marker { display: none; }
.profile-details[open] > summary { border-bottom: 1px solid var(--border); }
