/* ============================================================
   Orders board — dark theme, orange accent, Poppins
   ============================================================ */
:root {
  --bg: #0f151b;
  --bg-2: #131b23;
  --panel: #18222c;
  --panel-2: #1d2934;
  --card: #1e2a36;
  --card-2: #243240;
  --line: #2a3745;
  --line-2: #33424f;
  --text: #e8eef4;
  --text-dim: #9fb0c0;
  --text-mute: #6b7c8c;
  --accent: #ff6a00;
  --accent-2: #ff8a3d;
  --accent-soft: rgba(255, 106, 0, 0.14);
  --new: #4f9dff;
  --progress: #ffb020;
  --done: #37d67a;
  --danger: #ff5c6c;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --radius: 14px;
  --radius-sm: 10px;
}

* { box-sizing: border-box; }

/* Ensure the hidden attribute always wins over display rules */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: 'Poppins', system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(255, 106, 0, 0.08), transparent 60%),
    radial-gradient(900px 500px at 0% 0%, rgba(79, 157, 255, 0.06), transparent 55%),
    var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
}

.app {
  max-width: none;
  margin: 0 auto;
  padding: 20px 24px 40px;
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

/* ---------- Topbar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 14px; }

.brand-logo {
  height: 43px;
  width: auto;
  max-width: 170px;
  display: block;
  object-fit: contain;
}

/* Hide the file picker visually but keep it in layout so a programmatic
   .click() still opens the dialog (display:none would block it in Chrome). */
.file-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.brand-text h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.2px;
}
.brand-text p {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: var(--text-mute);
}

.controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ---------- Segmented control ---------- */
.seg {
  display: inline-flex;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 3px;
  gap: 2px;
}
.seg-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 7px 13px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color .15s, background .15s;
}
.seg-btn:hover { color: var(--text); }
.seg-btn.active {
  background: var(--accent-soft);
  color: var(--accent-2);
  box-shadow: inset 0 0 0 1px rgba(255, 106, 0, 0.35);
}
.seg-btn .cnt {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-dim);
  border-radius: 20px;
  font-size: 11px;
  padding: 1px 7px;
  min-width: 18px;
  text-align: center;
}
.seg-btn.active .cnt { background: rgba(255, 106, 0, 0.25); color: var(--accent-2); }

/* ---------- Switch ---------- */
.switch {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  user-select: none;
}
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track {
  width: 40px;
  height: 22px;
  border-radius: 20px;
  background: var(--line-2);
  position: relative;
  transition: background .18s;
  flex: none;
}
.switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #cfd8e2;
  transition: transform .18s, background .18s;
}
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track .switch-thumb {
  transform: translateX(18px);
  background: #fff;
}
.switch-label { font-size: 13px; color: var(--text-dim); }

/* ---------- Buttons ---------- */
.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  padding: 9px 16px;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: transform .12s, background .15s, border-color .15s, box-shadow .15s;
}
.btn:hover { background: var(--card-2); }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  color: #1a1206;
  font-weight: 600;
  box-shadow: 0 6px 16px rgba(255, 106, 0, 0.3);
}
.btn-primary:hover { box-shadow: 0 8px 22px rgba(255, 106, 0, 0.42); }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: var(--panel-2); }
.btn-sm { padding: 6px 11px; font-size: 12.5px; border-radius: 8px; }
.icon-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  display: inline-flex;
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--panel-2); color: var(--text); }

/* ---------- Toolbar ---------- */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px 0;
}
.search {
  flex: 1 1 260px;
  max-width: 420px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  padding: 10px 14px;
  border-radius: 10px;
  transition: border-color .15s, box-shadow .15s;
}
.search::placeholder { color: var(--text-mute); }
.search:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.stats { display: flex; gap: 10px; flex-wrap: wrap; }
.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px 13px;
  font-size: 12.5px;
  color: var(--text-dim);
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.stat b { color: var(--text); font-weight: 600; font-size: 14px; }
.stat .dot { width: 8px; height: 8px; }
/* clickable status chips (filter the board) */
.stat-btn {
  cursor: pointer;
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s, background .15s, transform .12s;
}
.stat-btn:hover { border-color: var(--line-2); box-shadow: var(--shadow); transform: translateY(-1px); }
.stat-btn.stat-on {
  background: var(--accent-soft);
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
  color: var(--text);
}
.stat-clear {
  cursor: pointer;
  font-family: inherit;
  background: transparent;
  border: 1px dashed var(--line-2);
  color: var(--text-mute);
}
.stat-clear:hover { color: var(--text-dim); border-color: var(--text-mute); }

/* ---------- Board (grouped by product) ---------- */
.board {
  display: grid;
  gap: 16px;
  flex: 1;
  align-items: start;
}
.board-4 { grid-template-columns: repeat(4, 1fr); }
.board-3 { grid-template-columns: repeat(3, 1fr); }
.board-2 { grid-template-columns: repeat(2, 1fr); }
.board-1 { grid-template-columns: 1fr; }
.col {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  min-height: 220px;
  overflow: hidden;
}
.col-head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 14px 16px;
  font-weight: 600;
  font-size: 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent);
}
.col-prod {
  color: var(--text);
  letter-spacing: 0.2px;
}
.col-cnt {
  margin-left: auto;
  background: var(--accent-soft);
  color: var(--accent-2);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 10px;
  min-width: 26px;
  text-align: center;
}
.col-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  min-height: 80px;
  transition: background .15s;
}
.col-body.drag-over {
  background: var(--accent-soft);
  outline: 2px dashed var(--accent);
  outline-offset: -6px;
  border-radius: var(--radius-sm);
}
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.dot-new { background: var(--new); box-shadow: 0 0 8px var(--new); }
.dot-progress { background: var(--progress); box-shadow: 0 0 8px var(--progress); }
.dot-done { background: var(--done); box-shadow: 0 0 8px var(--done); }
.dot-cancelled { background: #8a97a5; box-shadow: 0 0 8px #8a97a5; }

/* ---------- Card ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  cursor: grab;
  position: relative;
  transition: transform .12s, border-color .15s, box-shadow .15s;
  animation: cardIn .25s ease both;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.card:hover {
  border-color: var(--line-2);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.card:active { cursor: grabbing; }
.card.dragging { opacity: 0.4; }
/* cancelled orders: stay in the list but look struck through */
.card-cancelled { background: var(--bg-2); }
.card-cancelled .card-title,
.card-cancelled .card-id,
.card-cancelled .i-code,
.card-cancelled .i-len,
.card-cancelled .i-qty,
.card-cancelled .chip,
.card-cancelled .card-note { text-decoration: line-through; opacity: 0.7; }
.card-cancelled .card-mod { text-decoration: none; opacity: 1; color: var(--progress); }
/* done cards: light tint + bright red flag on the top-right corner */
.card-done { border-color: rgba(226, 59, 46, 0.45); background: linear-gradient(180deg, rgba(226, 59, 46, 0.05), var(--card) 42%); }
.card-flag {
  position: absolute;
  top: -9px;
  right: 10px;
  background: #e23b2e;
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  padding: 2px 9px 3px;
  border-radius: 4px 4px 4px 0;
  box-shadow: 0 2px 6px rgba(226, 59, 46, 0.5);
  pointer-events: none;
  z-index: 2;
}
.card-flag::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -5px;
  border: 3px solid transparent;
  border-top-color: #a32015;
  border-left-color: #a32015;
}
.card-flag-inline {
  position: static;
  display: inline-block;
  margin-left: 4px;
  padding: 1px 7px 2px;
  font-size: 10px;
  vertical-align: middle;
}
.card-flag-inline::after { display: none; }
.card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.card-title {
  font-weight: 600;
  font-size: 14.5px;
  line-height: 1.3;
  flex: 1;
  min-width: 0;
}
.card-id,
.card-ordno {
  font-size: 11px;
  color: var(--text-mute);
  background: var(--panel-2);
  border-radius: 6px;
  padding: 2px 7px;
  flex: none;
  white-space: nowrap;
}
.card-ordno {
  color: var(--accent-2);
  background: var(--accent-soft);
  font-weight: 600;
}
/* toggle expand/collapse details */
.card-toggle {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-mute);
  cursor: pointer;
  padding: 4px;
  border-radius: 7px;
  display: inline-flex;
  flex: none;
  transition: background .15s, color .15s;
}
.card-toggle:hover { background: var(--panel-2); color: var(--text); }
.card-toggle svg { width: 15px; height: 15px; }
/* details (manager + items + note) — hidden when the card is collapsed */
.card-detail {
  overflow: hidden;
  max-height: 4000px;
  opacity: 1;
  transition: max-height .25s ease, opacity .2s ease;
}
.card-collapsed .card-detail {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
}
.card-collapsed .card-top { margin-bottom: 2px; }
.card-collapsed .card-prog { margin-top: 8px; padding-top: 8px; }
.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.chip {
  font-size: 11.5px;
  color: var(--text-dim);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 3px 8px;
}
.chip-accent {
  color: var(--accent-2);
  background: var(--accent-soft);
  border-color: rgba(255, 106, 0, 0.3);
}
.chip-mgr {
  color: var(--text);
  background: var(--panel-2);
  border-color: var(--line);
}
/* pack-only order marker: production outside the report, we wait for packing */
.chip-pack {
  color: #6fe8a0;
  background: rgba(55, 214, 122, 0.12);
  border-color: rgba(55, 214, 122, 0.35);
  font-weight: 600;
}
.card-items {
  border-top: 1px dashed var(--line);
  padding-top: 9px;
  margin-top: 2px;
}
.card-items-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-mute);
  margin-bottom: 6px;
}
.item-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  padding: 3px 0;
}
.item-row .i-code { color: var(--text); font-weight: 500; flex: 1; }
.item-row .i-len { color: var(--text-dim); }
.item-row .i-qty {
  color: var(--accent-2);
  font-weight: 600;
  background: var(--accent-soft);
  border-radius: 6px;
  padding: 1px 8px;
  min-width: 40px;
  text-align: right;
  white-space: nowrap;
}
/* сворачивание длинного списка позиций в карточке */
.card-items .item-hidden { display: none; }
.card-items:not(.items-collapsed) .item-hidden { display: flex; }
.card-items-cnt {
  font-size: 10px;
  font-weight: 600;
  color: var(--accent-2);
  background: var(--accent-soft);
  border-radius: 8px;
  padding: 0 6px;
  margin-left: 4px;
  vertical-align: 1px;
}
.items-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 5px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  color: var(--accent-2);
  background: var(--accent-soft);
  border: 1px solid transparent;
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.items-toggle:hover { background: var(--accent); color: #fff; }
.items-toggle svg { width: 13px; height: 13px; flex: none; }
.card-note {
  font-size: 12.5px;
  color: var(--text-dim);
  margin-top: 8px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 11px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.card-author { font-size: 12px; color: var(--text-mute); }
.card-actions { display: flex; gap: 4px; }
.mini-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-mute);
  cursor: pointer;
  padding: 5px;
  border-radius: 7px;
  display: inline-flex;
  transition: background .15s, color .15s;
}
.mini-btn:hover { background: var(--panel-2); color: var(--text); }
.mini-btn.danger:hover { background: rgba(255, 92, 108, 0.15); color: var(--danger); }
.mini-btn svg { width: 15px; height: 15px; }

/* ---------- Progress bar (completion) ---------- */
.card-prog {
  margin-top: 11px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.prog-count {
  font-size: 11.5px;
  color: var(--text-dim);
  font-weight: 500;
}
.pbar {
  position: relative;
  height: 10px;
  background: var(--panel-2);
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.pbar-fill {
  height: 100%;
  border-radius: 20px;
  transition: width .35s ease;
}
.pbar-low .pbar-fill { background: linear-gradient(90deg, #ff7a3d, #ff9a4d); }
.pbar-mid .pbar-fill { background: linear-gradient(90deg, #ffb020, #ffcb5c); }
.pbar-full .pbar-fill { background: linear-gradient(90deg, #2fc46e, #6fe8a0); }
.pbar-none .pbar-fill { background: transparent; }
.pbar-label {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  font-size: 9.5px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  letter-spacing: 0.3px;
}
.pbar-full .pbar-label { color: #0f151b; text-shadow: none; }

/* ---------- Two-level bar: amber = выпущено (п/ф), green = готово (собранные) ---------- */
.tl-bar {
  position: relative;
  height: 10px;
  background: var(--panel-2);
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.tl-prod {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  border-radius: 20px;
  background: linear-gradient(90deg, #ffb020, #ffcb5c);
  transition: width .35s ease;
}
.tl-fin {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  border-radius: 20px;
  background: linear-gradient(90deg, #2fc46e, #6fe8a0);
  transition: width .35s ease;
}
.tl-label {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  font-size: 9.5px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  letter-spacing: 0.3px;
}
/* two-level legend under the bar */
.prog-count .pl-prod { color: #ffcb5c; font-weight: 600; }
.prog-count .pl-fin { color: #6fe8a0; font-weight: 600; }
.prog-count .pl-sep { color: var(--text-mute); margin: 0 4px; }
.prog-count .pl-of { color: var(--text); font-weight: 600; }
/* color legend chips (in hints) */
.lg { font-weight: 600; padding: 0 6px; border-radius: 5px; }
.lg-ord { color: var(--text); background: var(--panel-2); }
.lg-prod { color: #ffcb5c; background: rgba(255, 176, 32, 0.12); }
.lg-fin { color: #6fe8a0; background: rgba(55, 214, 122, 0.12); }
.row-prog .tl-bar { height: 9px; }

/* produced quantity chip (green tint when there is production) */
.i-qty-prod {
  color: #6fe8a0;
  background: rgba(55, 214, 122, 0.14);
}

/* ---------- Rows view ---------- */
.rows-wrap { flex: 1; }
.table-scroll {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: auto;
}
table.rows { width: 100%; border-collapse: collapse; min-width: 760px; }
table.rows thead th {
  position: sticky;
  top: 0;
  background: var(--panel);
  color: var(--text-dim);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  text-align: left;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  z-index: 2;
}
table.rows tbody td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
  vertical-align: top;
}
table.rows tbody tr { transition: background .12s; }
table.rows tbody tr:hover { background: var(--panel); }
table.rows tbody tr:last-child td { border-bottom: 0; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 11px;
  border-radius: 20px;
  white-space: nowrap;
}
.badge .dot { width: 8px; height: 8px; }
.badge-new { background: rgba(79, 157, 255, 0.14); color: #7db8ff; }
.badge-progress { background: rgba(255, 176, 32, 0.14); color: #ffcb5c; }
.badge-done { background: rgba(55, 214, 122, 0.14); color: #6fe8a0; }
.badge-cancelled { background: rgba(138, 151, 165, 0.16); color: #9aa7b4; text-decoration: line-through; }

.row-title { font-weight: 600; font-size: 14px; }
.row-sub { font-size: 12px; color: var(--text-mute); margin-top: 2px; }
.row-mod { color: var(--progress); }
/* cancelled orders: stay in the list but look struck through */
tr.row-cancelled td { color: var(--text-mute); }
tr.row-cancelled .row-title,
tr.row-cancelled .i-code,
tr.row-cancelled .i-len,
tr.row-cancelled .i-qty,
tr.row-cancelled .chip { text-decoration: line-through; opacity: 0.75; }
tr.row-cancelled .row-mod { text-decoration: none; opacity: 1; }
.row-items { max-width: 320px; }
.row-items .item-row { padding: 2px 0; }
.row-actions { display: flex; gap: 4px; }
.muted { color: var(--text-mute); }
.row-prog { min-width: 130px; max-width: 170px; }
.row-prog .pbar { height: 9px; }

/* ---------- Production ---------- */
.prod-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 4px 0 14px;
}
.prod-bar-label { font-size: 13px; color: var(--text-dim); font-weight: 500; }
.prod-bar-hint { font-size: 12.5px; color: var(--text-mute); margin-left: auto; }

.prod-wrap { flex: 1; display: flex; flex-direction: column; gap: 18px; }
.prod-card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.prod-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}
.prod-card-title { font-size: 15px; font-weight: 600; }
.prod-table-scroll { overflow-x: auto; }
table.prod-table { width: 100%; border-collapse: collapse; min-width: 480px; }
table.prod-table th {
  text-align: right;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-dim);
  font-weight: 600;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  white-space: nowrap;
}
table.prod-table th:first-child { text-align: left; }
table.prod-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  text-align: right;
  white-space: nowrap;
}
table.prod-table td:first-child { text-align: left; }
table.prod-table tbody tr:last-child td { border-bottom: 0; }
.pt-code { font-weight: 600; color: var(--text); }
.pt-qty { color: var(--accent-2); font-weight: 600; }
.pt-qty.pt-part { color: #ffcb5c; }
.pt-qty.pt-done { color: #6fe8a0; }
.pt-zero { color: var(--text-mute); opacity: 0.5; }
.pt-total {
  color: var(--text);
  font-weight: 700;
  background: var(--accent-soft);
}
.pt-total.pt-part { color: #ffcb5c; }
.pt-total.pt-done { color: #6fe8a0; background: rgba(55, 214, 122, 0.14); }
.prod-hint {
  padding: 10px 18px 0;
  font-size: 12.5px;
  color: var(--text-mute);
}
.pt-input {
  appearance: none;
  width: 74px;
  text-align: right;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-2);
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: 5px 8px;
  transition: border-color .15s, box-shadow .15s;
}
.pt-input.pt-part { color: #ffcb5c; }
.pt-input.pt-done { color: #6fe8a0; }
.pt-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(255, 106, 0, 0.25);
}
.pt-input::placeholder { color: var(--text-mute); opacity: 0.6; }
.pt-of { color: var(--text-mute); font-size: 12.5px; margin-left: 4px; white-space: nowrap; }
.pt-of-l { color: var(--text-mute); font-size: 11.5px; margin-right: 3px; font-weight: 600; }
.pt-total-l { color: var(--text-mute); font-weight: 500; font-size: 12px; }
/* production cell: editable "выпущено" on top, read-only "готово" below */
.pt-cell { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.pt-cell-top { display: flex; align-items: center; }
.pt-fin {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-mute);
  opacity: 0.7;
  white-space: nowrap;
}
.pt-fin.pt-fin-part { color: #6fe8a0; opacity: 1; }
.pt-fin.pt-fin-done { color: #6fe8a0; opacity: 1; }
.pt-fin.pt-fin-sub { margin-left: 6px; font-size: 11.5px; }
.prod-card-prog {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 160px;
  max-width: 380px;
}
.prod-card-prog .pbar, .prod-card-prog .tl-bar { flex: 1; height: 10px; }
.prod-card-prog .prog-count { white-space: nowrap; }
.prod-empty {
  padding: 40px;
  text-align: center;
  color: var(--text-mute);
  font-size: 14px;
}

.prod-orders-head {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  font-weight: 600;
  margin-bottom: 10px;
}
.prod-orders-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.prod-order {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 13.5px;
}
.po-badge {
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
}
.po-new { background: rgba(79, 157, 255, 0.14); color: #7db8ff; }
.po-progress { background: rgba(255, 176, 32, 0.14); color: #ffcb5c; }
.po-done { background: rgba(55, 214, 122, 0.14); color: #6fe8a0; }
.po-order { color: var(--accent-2); font-weight: 600; }
.po-buyer { color: var(--text); font-weight: 500; }
.po-mgr { color: var(--text-mute); font-weight: 400; }
.po-items { color: var(--text-dim); font-size: 12.5px; flex: 1; min-width: 200px; }

/* ---------- Empty ---------- */
.empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
}
.empty-inner {
  text-align: center;
  color: var(--text-mute);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.empty-inner svg { color: var(--line-2); }
.empty-inner p { margin: 0; font-size: 16px; }

/* ---------- Footer ---------- */
.foot {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--text-mute);
}
.foot-hint { color: var(--text-mute); opacity: 0.8; }
.foot-ver {
  font-weight: 600;
  background: var(--accent-soft);
  color: var(--accent-2);
  border-radius: 5px;
  padding: 1px 7px;
  margin-right: 2px;
}
.foot-author { font-weight: 500; color: var(--text-dim); }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 10, 14, 0.72);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  z-index: 100;
  overflow-y: auto;
  animation: fadeIn .18s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: 100%;
  max-width: 620px;
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: 18px;
  box-shadow: var(--shadow);
  animation: modalIn .22s cubic-bezier(.2,.9,.3,1.2) both;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}
.modal-head h2 { margin: 0; font-size: 17px; font-weight: 600; }
.modal-body { padding: 20px 22px; display: flex; flex-direction: column; gap: 16px; }
.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 22px;
  border-top: 1px solid var(--line);
}

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field label {
  font-size: 12.5px;
  color: var(--text-dim);
  font-weight: 500;
}
.req { color: var(--accent); }
.field input,
.field select,
.field textarea {
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 12px;
  transition: border-color .15s, box-shadow .15s;
  resize: vertical;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field select { cursor: pointer; }
/* checkbox row (e.g. «только упаковка» in the order form) */
.checkline {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}
.checkline input[type="checkbox"] {
  margin: 0;
  width: 16px;
  height: 16px;
  padding: 0;
  flex: none;
  margin-top: 1px;
  accent-color: var(--accent);
  cursor: pointer;
}
.checkline small {
  display: block;
  color: var(--text-mute);
  font-weight: 400;
  margin-top: 2px;
}

/* items editor */
.items-editor { display: flex; flex-direction: column; gap: 8px; }
.item-edit-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr 0.8fr 0.8fr 0.8fr 34px;
  gap: 8px;
  align-items: center;
}
.item-edit-row input {
  font-family: inherit;
  font-size: 13.5px;
  color: var(--text);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  transition: border-color .15s, box-shadow .15s;
}
.item-edit-row input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.item-edit-row .remove-item {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-mute);
  cursor: pointer;
  border-radius: 7px;
  padding: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
}
.item-edit-row .remove-item:hover { background: rgba(255, 92, 108, 0.15); color: var(--danger); }
.item-edit-row .remove-item svg { width: 15px; height: 15px; }
.items-empty { font-size: 12.5px; color: var(--text-mute); }

.seg-status { width: 100%; }
.seg-status .seg-btn { flex: 1; justify-content: center; }

/* ---------- Change history ---------- */
.hist-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 12, 16, 0.7);
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.hist-modal {
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 560px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.hist-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}
.hist-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.hist-list { padding: 14px 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.hist-entry {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 13px;
}
.hist-ts { font-size: 12px; color: var(--progress); font-weight: 600; margin-bottom: 5px; }
.hist-changes { margin: 0; padding-left: 18px; font-size: 13px; color: var(--text); }
.hist-changes li { margin: 2px 0; }

/* ---------- Toast ---------- */
.toast-wrap {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 200;
  align-items: center;
}
.toast {
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  color: var(--text);
  font-size: 13.5px;
  padding: 12px 18px;
  border-radius: 11px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn .25s ease both;
}
.toast.out { animation: toastOut .3s ease forwards; }
.toast.success { border-color: rgba(55, 214, 122, 0.4); }
.toast.success .t-dot { background: var(--done); }
.toast.error { border-color: rgba(255, 92, 108, 0.4); }
.toast.error .t-dot { background: var(--danger); }
.t-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.toast-undo { gap: 14px; }
.t-undo {
  appearance: none;
  border: 1px solid var(--line-2);
  background: var(--panel);
  color: var(--accent-2);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 8px;
  cursor: pointer;
  flex: none;
  transition: background .15s, color .15s;
}
.t-undo:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(12px); } }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .board-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .board-4, .board-3, .board-2 { grid-template-columns: 1fr; }
  .col { min-height: 120px; }
  .grid2 { grid-template-columns: 1fr; }
  .prod-bar-hint { display: none; }
}
@media (max-width: 560px) {
  .app { padding: 14px 12px 30px; }
  .brand-text h1 { font-size: 17px; }
  .brand-logo { height: 34px; max-width: 130px; }
  .controls { width: 100%; }
  .seg { flex: 1; }
  .seg-btn { flex: 1; justify-content: center; }
  .switch-label { display: none; }
  .item-edit-row { grid-template-columns: 1.1fr 0.9fr 0.6fr 0.6fr 0.6fr 28px; }
}

/* ============================================================
   THEME: 1C:UNF (light, dense, blue accent — like 1C:УНФ UI)
   Toggled via <html data-theme="unf">. The default (dark) theme
   is the :root block above; here we override the CSS variables
   plus the few rules that used hard-coded dark-theme colors.
   ============================================================ */
html[data-theme="unf"] {
  --bg: #eef1f5;
  --bg-2: #e4e9ef;
  --panel: #ffffff;
  --panel-2: #f4f6fa;
  --card: #ffffff;
  --card-2: #eef2f7;
  --line: #d3dae3;
  --line-2: #bcc7d4;
  --text: #1f2a37;
  --text-dim: #46556a;
  --text-mute: #7c8a9c;
  --accent: #2f5496;
  --accent-2: #1f3d75;
  --accent-soft: rgba(47, 84, 150, 0.12);
  --new: #2f5496;
  --progress: #c07d10;
  --done: #2e7d32;
  --danger: #c0392b;
  --shadow: 0 4px 14px rgba(31, 42, 55, 0.12);
  --radius: 8px;
  --radius-sm: 6px;
}

/* 1C:UNF uses a flat, calm background (no orange/blue glows) */
html[data-theme="unf"] body {
  background: var(--bg);
}

/* Logo is white-on-transparent; flip it dark so it stays visible on light */
html[data-theme="unf"] .brand-logo {
  filter: invert(0.9) brightness(0.5);
}

/* Segmented control: active state + counters (were orange-tinted) */
html[data-theme="unf"] .seg-btn.active {
  background: var(--accent-soft);
  color: var(--accent-2);
  box-shadow: inset 0 0 0 1px rgba(47, 84, 150, 0.35);
}
html[data-theme="unf"] .seg-btn .cnt {
  background: rgba(31, 42, 55, 0.08);
  color: var(--text-dim);
}
html[data-theme="unf"] .seg-btn.active .cnt {
  background: rgba(47, 84, 150, 0.18);
  color: var(--accent-2);
}

/* Primary button: blue fill, white text (was orange fill, dark text) */
html[data-theme="unf"] .btn-primary {
  color: #fff;
  box-shadow: 0 4px 12px rgba(47, 84, 150, 0.28);
}
html[data-theme="unf"] .btn-primary:hover {
  box-shadow: 0 6px 18px rgba(47, 84, 150, 0.38);
}

/* Status dots: remove the neon glow on a light surface */
html[data-theme="unf"] .dot-new,
html[data-theme="unf"] .dot-progress,
html[data-theme="unf"] .dot-done,
html[data-theme="unf"] .dot-cancelled { box-shadow: none; }

/* Progress bar label: dark text on the light track */
html[data-theme="unf"] .pbar-label { color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.35); }
html[data-theme="unf"] .pbar-full .pbar-label { color: #fff; text-shadow: none; }
html[data-theme="unf"] .tl-label { color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.35); }

/* Two-level legend + production "готово" line: darker for contrast on white */
html[data-theme="unf"] .prog-count .pl-prod { color: #8a5a06; }
html[data-theme="unf"] .prog-count .pl-fin { color: #1f5c23; }
html[data-theme="unf"] .lg-ord { color: #1f3d75; background: rgba(47, 84, 150, 0.10); }
html[data-theme="unf"] .lg-prod { color: #8a5a06; background: rgba(192, 125, 16, 0.12); }
html[data-theme="unf"] .lg-fin { color: #1f5c23; background: rgba(46, 125, 50, 0.12); }
html[data-theme="unf"] .chip-pack { color: #1f5c23; background: rgba(46, 125, 50, 0.10); border-color: rgba(46, 125, 50, 0.35); }
html[data-theme="unf"] .pt-fin.pt-fin-part,
html[data-theme="unf"] .pt-fin.pt-fin-done { color: #1f5c23; }

/* Produced-quantity chip: darker green for contrast on white */
html[data-theme="unf"] .i-qty-prod {
  color: #2e7d32;
  background: rgba(46, 125, 50, 0.12);
}

/* Status badges: darker tints so they read on white */
html[data-theme="unf"] .badge-new { background: rgba(47, 84, 150, 0.12); color: #1f3d75; }
html[data-theme="unf"] .badge-progress { background: rgba(192, 125, 16, 0.14); color: #8a5a06; }
html[data-theme="unf"] .badge-done { background: rgba(46, 125, 50, 0.14); color: #1f5c23; }
html[data-theme="unf"] .badge-cancelled { background: rgba(124, 138, 156, 0.16); color: #5f6c7c; }
html[data-theme="unf"] .row-mod { color: #8a5a06; }
html[data-theme="unf"] .card-cancelled .card-mod { color: #8a5a06; }

/* Production table: darker status colors + blue focus ring */
html[data-theme="unf"] .pt-qty.pt-part { color: #8a5a06; }
html[data-theme="unf"] .pt-qty.pt-done { color: #1f5c23; }
html[data-theme="unf"] .pt-total.pt-part { color: #8a5a06; }
html[data-theme="unf"] .pt-total.pt-done { color: #1f5c23; background: rgba(46, 125, 50, 0.12); }
html[data-theme="unf"] .pt-input { color: var(--accent-2); }
html[data-theme="unf"] .pt-input.pt-part { color: #8a5a06; }
html[data-theme="unf"] .pt-input.pt-done { color: #1f5c23; }
html[data-theme="unf"] .pt-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(47, 84, 150, 0.22);
}

/* Production order list badges */
html[data-theme="unf"] .po-new { background: rgba(47, 84, 150, 0.12); color: #1f3d75; }
html[data-theme="unf"] .po-progress { background: rgba(192, 125, 16, 0.14); color: #8a5a06; }
html[data-theme="unf"] .po-done { background: rgba(46, 125, 50, 0.14); color: #1f5c23; }
html[data-theme="unf"] .po-order { color: var(--accent-2); }

/* History timestamp */
html[data-theme="unf"] .hist-ts { color: #8a5a06; }

/* Modal / history overlays: lighter, softer on a light page */
html[data-theme="unf"] .modal-backdrop { background: rgba(31, 42, 55, 0.42); }
html[data-theme="unf"] .hist-backdrop { background: rgba(31, 42, 55, 0.42); }

/* Column header subtle gradient (dark-theme artifact) -> flat */
html[data-theme="unf"] .col-head {
  background: var(--panel-2);
}

/* ============================================================
   JOURNAL VIEW (printable incoming report)
   ============================================================ */
.journal-wrap {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.journal-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.journal-title h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}
.journal-sub {
  display: block;
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--text-mute);
}
.journal-acts { display: flex; gap: 8px; }
.journal-tables { display: flex; flex-direction: column; gap: 16px; }
.journal-block {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.journal-block-head {
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  background: var(--panel-2);
  border-bottom: 1px solid var(--line);
}
.journal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.journal-table th {
  padding: 8px 12px;
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-mute);
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
}
.journal-table td {
  padding: 7px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  vertical-align: top;
}
.journal-table .jt-date { white-space: nowrap; color: var(--text-dim); }
.journal-table .jt-code { font-weight: 600; white-space: nowrap; }
.journal-table .jt-qty { text-align: right; font-weight: 600; white-space: nowrap; }
.journal-table .jt-def { text-align: right; white-space: nowrap; color: var(--text-mute); }
.journal-table .jt-def-on { color: var(--danger); font-weight: 700; }
.journal-table tr.jt-sum td {
  background: var(--panel-2);
  font-weight: 700;
  border-bottom: 1px solid var(--line-2);
}
.journal-table tr.jt-grand td {
  background: var(--accent-soft, rgba(47, 84, 150, 0.1));
  border-bottom: none;
}
.journal-empty {
  padding: 30px 20px;
  text-align: center;
  font-size: 13.5px;
  color: var(--text-mute);
  background: var(--panel);
  border: 1px dashed var(--line-2);
  border-radius: 10px;
}

/* ---------- Журнал: режим (Все/Выпуск/Сборка) ---------- */
.seg-sm .seg-btn { padding: 5px 11px; font-size: 12.5px; }

/* ---------- Журнал: сворачивание по датам ---------- */
.journal-day {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 0 0 8px;
  overflow: hidden;
  background: var(--panel);
}
.journal-day:last-child { margin-bottom: 0; }
.journal-day > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  background: var(--panel-2);
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  user-select: none;
}
.journal-day > summary::-webkit-details-marker { display: none; }
.journal-day > summary::before {
  content: '';
  width: 0; height: 0;
  border-left: 5px solid var(--text-mute);
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  transition: transform .15s;
  flex: none;
}
.journal-day[open] > summary::before { transform: rotate(90deg); }
.journal-day > summary .jd-date { white-space: nowrap; }
.journal-day > summary .jd-sum {
  margin-left: auto;
  font-weight: 600;
  font-size: 12.5px;
  color: var(--text-dim);
  white-space: nowrap;
}
.journal-day > summary .jd-sum b { color: var(--text); }
.journal-day .journal-table { border-top: 1px solid var(--line); }
.jt-grand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--accent-soft, rgba(47, 84, 150, 0.1));
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.jt-grand .jt-qty, .jt-grand .jt-def { display: inline; text-align: left; }

/* ---------- Журнал: архив (старше 1 месяца) ---------- */
.journal-archive {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.journal-archive-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: var(--panel-2);
  border-bottom: 1px solid var(--line);
}
.journal-archive-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.journal-archive-sub { font-weight: 500; font-size: 12.5px; color: var(--text-mute); margin-left: 8px; }
.btn-danger-soft { color: var(--danger); border-color: var(--danger); }
.btn-danger-soft:hover { background: rgba(192, 57, 43, 0.08); }
.journal-archive-body { display: flex; flex-direction: column; gap: 16px; padding: 14px; }

/* ---------- Print: only the journal ---------- */
@media print {
  @page { size: A4 portrait; margin: 12mm; }
  body * { visibility: hidden; }
  #journalView, #journalView * { visibility: visible; }
  #journalView {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    display: block;
  }
  #journalView .journal-acts { display: none; }
  #journalView .journal-archive { display: none; }
  #journalView .journal-day { border: none; border-radius: 0; margin: 0 0 6px; background: #fff; }
  #journalView .journal-day > summary { background: #fff; color: #000; border-bottom: 1px solid #999; }
  #journalView .journal-day > summary::before { display: none; }
  #journalView .journal-day > summary .jd-sum { color: #333; }
  #journalView .journal-day > summary .jd-sum b { color: #000; }
  #journalView .journal-day .journal-table { border-top: none; }
  #journalView .jt-grand { background: #fff; color: #000; border-top: 2px solid #000; }
  #journalView .jt-grand .jt-def { color: #c0392b; }
  #journalView .journal-bar { display: block; }
  #journalView .journal-title h2 { color: #000; }
  #journalView .journal-sub { color: #444; }
  #journalView .journal-block {
    background: #fff;
    border: none;
    border-radius: 0;
    box-shadow: none;
    page-break-inside: auto;
  }
  #journalView .journal-block-head {
    background: #fff;
    color: #000;
    border-bottom: 2px solid #000;
  }
  #journalView .journal-table th {
    background: #fff;
    color: #000;
    border-bottom: 2px solid #000;
  }
  #journalView .journal-table td {
    color: #000;
    border-bottom: 1px solid #999;
  }
  /* Жирный текст в печатной форме (кроме первой колонки) */
  #journalView .journal-title h2,
  #journalView .journal-block-head,
  #journalView .journal-table th,
  #journalView .journal-table td,
  #journalView .journal-table .jt-qty,
  #journalView .journal-table .jt-def,
  #journalView .journal-day summary,
  #journalView .journal-day .jd-date,
  #journalView .journal-day .jd-sum { font-weight: 700; }
  #journalView .journal-table td:first-child { font-weight: 400; }
  #journalView .journal-table .jt-date { color: #333; }
  #journalView .journal-table .jt-def { color: #555; }
  #journalView .journal-table .jt-def-on { color: #c0392b; }
  #journalView .journal-table tr.jt-sum td {
    background: #fff;
    border-bottom: 1px solid #000;
  }
  #journalView .journal-table tr.jt-grand td {
    background: #fff;
    border-bottom: 2px solid #000;
  }
  #journalView .journal-table tr { page-break-inside: avoid; }
  #journalView .journal-day { display: block; } /* при печати дни не сворачиваются */
  #journalView .journal-empty {
    background: #fff;
    color: #333;
    border: 1px solid #999;
  }
}
