:root {
  --bg: #0e0f13;
  --surface: #16181f;
  --surface2: #1e2028;
  --border: #2a2d38;
  --accent: #c8f04a;
  --accent2: #7ee8a2;
  --text: #f0f0ee;
  --muted: #7a7d8a;
  --danger: #ff5c5c;
  --radius: 14px;
  --radius-sm: 8px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); font-family: 'Mulish', sans-serif; font-size: 15px; min-height: 100vh; }
.app { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: var(--surface); border-right: 1px solid var(--border); padding: 28px 0; display: flex; flex-direction: column; position: fixed; height: 100vh; z-index: 100; }
.main { margin-left: 220px; flex: 1; padding: 36px 40px; max-width: 1100px; padding-bottom: 100px; }
.logo { font-family: 'Unbounded', sans-serif; font-size: 15px; font-weight: 700; color: var(--accent); padding: 0 24px 28px; letter-spacing: -.02em; border-bottom: 1px solid var(--border); }
.logo span { color: var(--muted); font-weight: 400; }
.nav { padding: 16px 0; flex: 1; overflow-y: auto; }
.nav-section { font-size: 10px; letter-spacing: .1em; color: var(--muted); padding: 12px 24px 6px; text-transform: uppercase; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 10px 24px; cursor: pointer; color: var(--muted); transition: all .15s; border-left: 2px solid transparent; font-weight: 500; font-size: 14px; }
.nav-item:hover { color: var(--text); background: var(--surface2); }
.nav-item.active { color: var(--accent); border-left-color: var(--accent); background: rgba(200,240,74,.06); }
.nav-icon { width: 18px; text-align: center; }
.badge { background: var(--accent); color: #0e0f13; font-size: 10px; font-weight: 700; border-radius: 10px; padding: 1px 7px; margin-left: auto; font-family: 'Unbounded', sans-serif; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 4px 12px; border-radius: 20px; }
.status.open { background: rgba(200,240,74,.15); color: var(--accent); }
.status.closed { background: rgba(255,92,92,.12); color: var(--danger); }
.status.transit { background: rgba(126,232,162,.12); color: var(--accent2); }
.status.paid { background: rgba(160,196,255,.12); color: #a0c4ff; }
.status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; gap: 16px; flex-wrap: wrap; }
.page-title { font-family: 'Unbounded', sans-serif; font-size: 22px; font-weight: 700; letter-spacing: -.03em; }
.page-sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.product-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; cursor: pointer; transition: border-color .2s, transform .15s; display: flex; flex-direction: column; }
.product-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.product-card.in-order { border-color: rgba(200,240,74,.45); box-shadow: inset 0 0 0 1px rgba(200,240,74,.15); }
.product-card-qty {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 12px; border-top: 1px solid var(--border); margin-top: auto;
  background: var(--surface2);
}
.product-card-qty .qty-btn {
  width: 36px; height: 36px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-size: 20px; font-weight: 700;
  cursor: pointer; font-family: inherit; line-height: 1; flex-shrink: 0;
}
.product-card-qty .qty-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.product-card-qty .qty-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.product-card-qty .qty-num { font-weight: 700; font-size: 15px; min-width: 28px; text-align: center; color: var(--accent); }
.product-card-qty .qty-num.zero { color: var(--muted); font-weight: 500; }
.supplier-rates-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.supplier-rate-card { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; }
.supplier-rate-card .form-label { font-size: 11px; margin-bottom: 4px; }
.supplier-rate-card .form-input { padding: 8px 10px; font-size: 13px; }
.admin-bulk-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 14px; margin-bottom: 12px;
  background: rgba(200,240,74,.08); border: 1px solid rgba(200,240,74,.25);
  border-radius: var(--radius-sm);
}
.admin-bulk-bar.hidden { display: none !important; }
.table th input[type="checkbox"], .table td input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; }
.order-expand-btn {
  width: 28px; height: 28px; flex-shrink: 0; border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface); color: var(--text); cursor: pointer; font-size: 11px; line-height: 1;
  font-family: inherit;
}
.order-expand-btn:hover { border-color: var(--accent); color: var(--accent); }
.order-expand-btn.expanded { transform: rotate(90deg); }
.admin-order-client { display: flex; align-items: center; gap: 8px; min-width: 0; }
.admin-order-detail-row td { background: var(--surface2); padding: 8px 12px 14px !important; border-bottom: 1px solid var(--border); }
.order-items-subtable { width: 100%; font-size: 13px; border-collapse: collapse; }
.order-items-subtable th { text-align: left; font-size: 11px; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.order-items-subtable td { padding: 10px; vertical-align: middle; border-bottom: 1px solid rgba(255,255,255,.04); }
.order-items-subtable tr:last-child td { border-bottom: none; }
.order-items-subtable .order-items-price-cell { line-height: 1.4; white-space: nowrap; }
.order-items-subtable .order-items-price-cell .order-price-old {
  display: inline;
  margin-left: 6px;
  font-size: 11px;
  font-weight: 500;
}
.product-img { width: 100%; aspect-ratio: 1; background: var(--surface2); display: flex; align-items: center; justify-content: center; font-size: 48px; }
.product-info { padding: 14px; }
.product-brand { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.product-name { font-weight: 600; font-size: 14px; margin-bottom: 4px; line-height: 1.3; }
.product-variant { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.product-price { font-family: 'Unbounded', sans-serif; font-size: 16px; font-weight: 700; color: var(--accent); }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; cursor: pointer; border: none; transition: all .15s; font-family: 'Mulish', sans-serif; }
.btn-primary { background: var(--accent); color: #0e0f13; }
.btn-primary:hover { background: #d8ff50; }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text); border-color: var(--muted); }
.btn-danger { background: rgba(255,92,92,.12); color: var(--danger); border: 1px solid rgba(255,92,92,.2); }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-icon { width: 36px; height: 36px; padding: 0; justify-content: center; border-radius: var(--radius-sm); }
.order-item { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.order-item:last-child { border-bottom: none; }
.order-emoji { width: 48px; height: 48px; background: var(--surface2); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 24px; flex-shrink: 0; }
.order-info { flex: 1; min-width: 0; }
.order-name { font-weight: 600; font-size: 14px; }
.order-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.qty-control { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.qty-btn { width: 28px; height: 28px; border-radius: 6px; background: var(--surface2); border: 1px solid var(--border); color: var(--text); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 16px; transition: all .15s; }
.qty-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.qty-btn:disabled { opacity: .35; cursor: not-allowed; }
.qty-val { font-weight: 700; font-size: 15px; min-width: 24px; text-align: center; font-family: 'Unbounded', sans-serif; }
.order-price { font-family: 'Unbounded', sans-serif; font-size: 15px; font-weight: 700; color: var(--accent); min-width: 90px; text-align: right; flex-shrink: 0; line-height: 1.3; }
.order-price-old { display: block; font-size: 12px; font-weight: 500; color: var(--muted); text-decoration: line-through; font-family: inherit; margin-top: 2px; }
.product-price-old { font-size: 12px; font-weight: 500; color: var(--muted); text-decoration: line-through; margin-left: 6px; }
.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 24px; }
.stat-label { font-size: 12px; color: var(--muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: .05em; }
.stat-value { font-family: 'Unbounded', sans-serif; font-size: 24px; font-weight: 700; }
.stat-value.green { color: var(--accent); }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; min-width: 600px; }
.table th { text-align: left; padding: 10px 14px; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; border-bottom: 1px solid var(--border); font-weight: 600; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 14px; vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--surface2); }
.filter-row { display: flex; gap: 10px; margin-bottom: 24px; flex-wrap: wrap; align-items: center; }
.filter-chip { padding: 7px 16px; border-radius: 20px; border: 1px solid var(--border); font-size: 13px; cursor: pointer; color: var(--muted); transition: all .15s; background: transparent; font-family: 'Mulish', sans-serif; }
.filter-chip:hover { border-color: var(--muted); color: var(--text); }
.filter-chip.active { background: var(--accent); color: #0e0f13; border-color: var(--accent); font-weight: 700; }
.filter-chip-check { display: inline-flex; align-items: center; cursor: pointer; user-select: none; }
.filter-chip-check.active { background: var(--accent-muted); color: var(--accent-bright); border-color: var(--border-strong); font-weight: 600; }
.search-box { flex: 1; max-width: 280px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 14px; color: var(--text); font-family: 'Mulish', sans-serif; font-size: 14px; outline: none; }
.search-box:focus { border-color: var(--accent); }
.form-group { margin-bottom: 16px; }
.form-label { font-size: 12px; color: var(--muted); margin-bottom: 6px; display: block; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.form-input { width: 100%; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px; color: var(--text); font-family: 'Mulish', sans-serif; font-size: 14px; outline: none; }
.form-input:focus { border-color: var(--accent); }
.profit-line { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 14px; gap: 12px; }
.profit-line:last-child { border-bottom: none; }
.profit-total { font-family: 'Unbounded', sans-serif; font-size: 20px; font-weight: 700; color: var(--accent); }
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.7); z-index: 200; align-items: center; justify-content: center; padding: 16px; }
.modal-overlay.open { display: flex; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; width: 480px; max-width: 96vw; max-height: 90vh; overflow-y: auto; }
.modal-title { font-family: 'Unbounded', sans-serif; font-size: 17px; font-weight: 700; margin-bottom: 20px; }
.toast { position: fixed; bottom: 24px; right: 24px; background: var(--surface2); border: 1px solid var(--accent); color: var(--accent); padding: 12px 20px; border-radius: var(--radius-sm); font-weight: 600; font-size: 14px; z-index: 999; transform: translateY(80px); opacity: 0; transition: all .3s; pointer-events: none; }
.toast.show { transform: translateY(0); opacity: 1; }
.toast.error { border-color: var(--danger); color: var(--danger); }
.order-bar { position: fixed; bottom: 0; left: 220px; right: 0; background: var(--surface); border-top: 1px solid var(--border); padding: 16px 40px; display: none; align-items: center; justify-content: space-between; z-index: 50; }
.order-bar.visible { display: flex; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #0e0f13; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.section { margin-bottom: 32px; }
.section-title { font-family: 'Unbounded', sans-serif; font-size: 14px; font-weight: 700; margin-bottom: 16px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.sidebar-bottom { padding: 20px 24px; border-top: 1px solid var(--border); }
.user-row { display: flex; align-items: center; gap: 10px; }
.user-name { font-size: 13px; font-weight: 600; }
.user-role { font-size: 11px; color: var(--muted); }
.order-row { background: var(--surface2); border-radius: var(--radius-sm); padding: 16px; margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hidden { display: none !important; }
.import-log {
  margin-top: 10px;
  max-height: 140px;
  overflow-y: auto;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 11px;
  line-height: 1.45;
}
.import-log-line { color: var(--muted); }
.import-log-line.warn { color: var(--warning, #e8b84a); }
.import-log-line.error { color: var(--danger); }
.import-log-line.ok { color: var(--accent2); }
.import-progress-active #btn-run-import { opacity: 0.7; pointer-events: none; }
.bonus-chip { background: rgba(200,240,74,.12); color: var(--accent); border-radius: 20px; padding: 4px 14px; font-size: 13px; font-weight: 700; border: 1px solid rgba(200,240,74,.2); }
.status-flow { display: flex; gap: 8px; flex-wrap: wrap; }
.status-step { padding: 7px 16px; border-radius: 20px; font-size: 12px; font-weight: 700; border: 1px solid var(--border); color: var(--muted); cursor: pointer; font-family: inherit; background: transparent; }
.status-step:hover { border-color: var(--muted); color: var(--text); }
.batch-list { display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow-y: auto; }
.batch-list-row { display: flex; align-items: stretch; gap: 8px; }
.batch-list-row .batch-list-item { flex: 1; min-width: 0; }
.batch-list-row .btn-set-active-batch { flex-shrink: 0; align-self: center; white-space: nowrap; }
.batch-list-item { display: block; width: 100%; text-align: left; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; cursor: pointer; color: var(--text); font-family: inherit; transition: border-color .15s; }
.batch-list-item:hover { border-color: var(--muted); }
.batch-list-item.viewing { border-color: var(--muted); background: rgba(255,255,255,.03); }
.batch-list-item.is-active-work { box-shadow: inset 3px 0 0 var(--accent); }
.batch-list-name { font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.batch-list-meta { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); }
.history-row:hover { border-color: var(--accent) !important; }
.history-order-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.history-order-item:last-child { border-bottom: none; padding-bottom: 0; }
.history-order-item:first-child { padding-top: 0; }
.history-order-item-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}
.history-order-item-name { flex: 1; min-width: 0; font-weight: 600; line-height: 1.35; }
.history-order-item-sum {
  font-weight: 700;
  text-align: right;
  flex-shrink: 0;
  line-height: 1.35;
  font-family: 'Unbounded', sans-serif;
  color: var(--accent);
}
.history-order-item-unit {
  color: var(--muted);
  font-size: 12px;
  margin-top: 6px;
  line-height: 1.4;
}
.history-order-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 13px;
  gap: 12px;
}
#history-order-discount { margin-bottom: 4px; }
.history-order-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border);
  padding-top: 14px;
  margin-top: 8px;
  gap: 12px;
}
.history-order-total-row #history-order-total {
  font-family: 'Unbounded', sans-serif;
  font-weight: 700;
  font-size: 18px;
  color: var(--accent);
  text-align: right;
}
.status-step.done { background: rgba(126,232,162,.1); color: var(--accent2); border-color: rgba(126,232,162,.3); }
.status-step.current { background: rgba(200,240,74,.15); color: var(--accent); border-color: var(--accent); }
.lock-notice { background: rgba(255,92,92,.08); border: 1px solid rgba(255,92,92,.2); border-radius: var(--radius-sm); padding: 12px 16px; color: var(--danger); font-size: 13px; margin-bottom: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-2-wide { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.loading-screen { position: fixed; inset: 0; background: var(--bg); display: flex; align-items: center; justify-content: center; z-index: 500; font-family: 'Unbounded', sans-serif; color: var(--accent); }
@media (max-width: 700px) {
  .sidebar { width: 100%; height: auto; position: relative; flex-direction: row; padding: 12px 0; overflow-x: auto; }
  .main { margin-left: 0; padding: 20px 16px 100px; }
  .logo { display: none; }
  .nav { display: flex; flex-direction: row; padding: 0 8px; }
  .nav-section { display: none; }
  .nav-item { padding: 8px 14px; flex-direction: column; gap: 4px; font-size: 11px; border-left: none; border-bottom: 2px solid transparent; white-space: nowrap; }
  .nav-item.active { border-bottom-color: var(--accent); border-left-color: transparent; background: none; }
  .sidebar-bottom { display: none; }
  .stats-row, .grid-2, .grid-2-wide { grid-template-columns: 1fr; }
  .order-bar { left: 0; padding: 14px 16px; }
  .badge { display: none; }
}
