/* ============================================================
   Phils Manufaktur ERP — Design System
   ============================================================ */

:root {
  --bg:          #0f1117;
  --surface:     #1a1d27;
  --surface-2:   #22263a;
  --border:      #2e3250;
  --border-light:#3a3f60;
  --accent:      #6c8fff;
  --accent-dim:  #3d5acc;
  --text:        #e8eaf6;
  --text-muted:  #7e84a3;
  --text-faint:  #4a5070;
  --green:       #4caf7d;
  --orange:      #f59e42;
  --red:         #e05252;
  --yellow:      #f4d03f;
  --radius:      8px;
  --radius-sm:   4px;
  --sidebar-w:   220px;
  --topnav-h:    52px;
  --font:        'Inter', 'Segoe UI', system-ui, sans-serif;
  --font-mono:   'JetBrains Mono', 'Fira Code', monospace;
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
}

/* ---- Layout (horizontal top nav) ---- */
#topnav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topnav-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  z-index: 200;
}

#content {
  margin-top: var(--topnav-h);
  min-height: calc(100vh - var(--topnav-h));
  overflow-y: auto;
}

/* ---- Brand ---- */
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-right: 12px;
  margin-right: 4px;
  border-right: 1px solid var(--border);
  flex-shrink: 0;
}
.brand-icon {
  font-size: 20px;
  color: var(--accent);
}
.brand-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* ---- Nav (horizontal, scrolls on narrow screens) ---- */
nav {
  display: flex;
  flex-direction: row;
  gap: 2px;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: thin;
}
nav::-webkit-scrollbar { height: 4px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
  cursor: pointer;
}
.nav-item:hover  { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--accent-dim); color: #fff; }
.nav-item .icon  { text-align: center; opacity: 0.7; }

/* ---- Page shell ---- */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px 16px;
  border-bottom: 1px solid var(--border);
}
.page-title {
  font-size: 18px;
  font-weight: 600;
}
.page-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ---- Search bar ---- */
.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.search-input {
  flex: 1;
  max-width: 380px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  color: var(--text);
  font-size: 13px;
  outline: none;
}
.search-input:focus { border-color: var(--accent); }
.search-input::placeholder { color: var(--text-faint); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s;
}
.btn:hover { opacity: 0.85; }
.btn-primary   { background: var(--accent); color: #fff; }
.btn-secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn-danger    { background: var(--red); color: #fff; }
.btn-ghost     { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-sm        { padding: 4px 10px; font-size: 12px; }

/* ---- Table ---- */
.table-wrap {
  padding: 0 28px 28px;
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
thead th {
  text-align: left;
  padding: 10px 12px;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
}
tbody tr {
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.1s;
}
tbody tr:hover { background: var(--surface-2); }
tbody td { padding: 10px 12px; }
.td-mono { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }
.td-muted { color: var(--text-muted); }

/* ---- Badges ---- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}
.badge-green  { background: rgba(76,175,125,0.15); color: var(--green); }
.badge-orange { background: rgba(245,158,66,0.15);  color: var(--orange); }
.badge-red    { background: rgba(224,82,82,0.15);   color: var(--red); }
.badge-blue   { background: rgba(108,143,255,0.15); color: var(--accent); }
.badge-gray   { background: var(--surface-2); color: var(--text-muted); }

/* ---- Panel (fiche détail) ---- */
.detail-panel {
  position: fixed;
  top: var(--topnav-h); right: 0; bottom: 0;
  width: 480px;
  background: var(--surface);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  z-index: 100;
}
.detail-panel.open { transform: translateX(0); }

.panel-header {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}
.panel-title  { font-size: 15px; font-weight: 600; }
.panel-sku    { font-family: var(--font-mono); font-size: 11px; color: var(--accent); margin-top: 3px; }
.panel-close  { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 18px; padding: 0; }
.panel-close:hover { color: var(--text); }

.panel-body { flex: 1; overflow-y: auto; padding: 20px; }

.panel-section { margin-bottom: 24px; }
.panel-section-title {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin-bottom: 10px;
}

.kv-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.kv-item {}
.kv-label { font-size: 11px; color: var(--text-muted); margin-bottom: 2px; }
.kv-value { font-size: 13px; font-weight: 500; }
.kv-value.mono { font-family: var(--font-mono); font-size: 12px; }

/* Stock indicator */
.stock-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px;
  background: var(--surface-2);
  border-radius: var(--radius);
  margin-bottom: 10px;
}
.stock-num { font-size: 22px; font-weight: 700; }
.stock-label { font-size: 11px; color: var(--text-muted); }

/* Movements mini-table */
.mini-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.mini-table th {
  text-align: left;
  padding: 6px 8px;
  color: var(--text-faint);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}
.mini-table td { padding: 6px 8px; border-bottom: 1px solid var(--border); }
.mini-table tr:last-child td { border-bottom: none; }

/* ---- Modal (form) ---- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 200;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 560px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  transform: translateY(16px);
  transition: transform 0.2s;
}
.modal-overlay.open .modal { transform: translateY(0); }

.modal-header {
  padding: 20px 20px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title  { font-size: 15px; font-weight: 600; }
.modal-body   { flex: 1; overflow-y: auto; padding: 20px; }
.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ---- Form ---- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group.span-2 { grid-column: 1 / -1; }

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

input[type=text], input[type=number], input[type=email],
input[type=date], select, textarea {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  color: var(--text);
  font-size: 13px;
  font-family: var(--font);
  outline: none;
  width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
select { cursor: pointer; }
textarea { resize: vertical; min-height: 70px; }

.checkbox-row {
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
}
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  cursor: pointer;
}
input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--accent); }

/* ---- Empty / Loading states ---- */
.state-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--text-faint);
  gap: 10px;
}
.state-empty .icon-lg { font-size: 40px; opacity: 0.3; }
.state-loading { text-align: center; padding: 40px; color: var(--text-muted); }

/* ---- Thumbnails (list) ---- */
.thumb {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--surface-2);
  display: block;
}
.thumb-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
  font-size: 16px;
}

/* ---- Photo gallery (detail panel) ---- */
.photo-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.gallery-item {
  width: 88px;
  height: 88px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: block;
}
.gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-item.broken { display: none; }

/* ---- Photo input rows (form) ---- */
.photo-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
}
.photo-input-row .photo-url { flex: 1; }
.photo-remove { flex: none; padding: 6px 9px; }

/* Inline hint */
.hint { color: var(--text-faint); font-weight: 400; font-size: 10px; }

/* ---- Settings layout ---- */
.settings-layout { display: flex; min-height: calc(100vh - 80px); }
.settings-subnav {
  width: 250px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  padding: 16px 10px;
}
.settings-navitem {
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  margin-bottom: 2px;
  line-height: 1.3;
}
.settings-navitem:hover  { background: var(--surface-2); color: var(--text); }
.settings-navitem.active { background: var(--accent-dim); color: #fff; }

.settings-content { flex: 1; padding: 22px 28px; overflow-y: auto; }
.settings-section-title { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.settings-section-desc  { font-size: 12px; color: var(--text-muted); margin-bottom: 20px; max-width: 640px; }

/* Two-column manager (categories / sub-categories) */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.col-box { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.col-box-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.col-box-title {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--text-muted);
}

.list-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.list-row:last-child { border-bottom: none; }
.list-row:hover, .list-row.active { background: var(--surface-2); }
.list-row .row-main { display: flex; flex-direction: column; gap: 2px; }
.list-row .row-name { font-size: 13px; }
.list-row .row-meta { font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); }
.row-actions { display: flex; gap: 4px; opacity: 0; transition: opacity 0.1s; }
.list-row:hover .row-actions { opacity: 1; }

.icon-btn {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; padding: 3px 7px; border-radius: 3px; font-size: 13px;
}
.icon-btn:hover { background: var(--border); color: var(--text); }
.icon-btn.danger:hover { background: var(--red); color: #fff; }

.kv-form { max-width: 520px; }
.kv-form .form-group { margin-bottom: 14px; }

/* ---- Form section titles (catalogue form) ---- */
.form-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--accent);
  margin: 18px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.form-section-title:first-child { margin-top: 0; }

/* ---- Paired input rows (attributes, BOM) ---- */
.pair-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
}
.pair-row input, .pair-row select { flex: 1; }
.pair-row .row-x { flex: none; padding: 6px 9px; }

/* ---- Attribute chips (detail panel) ---- */
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px 11px;
  font-size: 12px;
  color: var(--text);
}
.chip b { color: var(--text-muted); font-weight: 500; }

/* ---- Tabs (inventory) ---- */
.tabs {
  display: flex;
  gap: 4px;
  padding: 12px 28px 0;
  border-bottom: 1px solid var(--border);
}
.tab {
  padding: 9px 16px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--accent); }

.inv-summary {
  font-size: 13px;
  color: var(--text-muted);
  padding: 14px 0 10px;
}
.inv-summary b { color: var(--text); }

/* ---- Receipt line editor ---- */
.receipt-head {
  display: flex;
  gap: 8px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
  padding: 4px 0;
}
.receipt-line {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
}

/* ---- Quote line editor ---- */
.quote-head {
  display: flex;
  gap: 8px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
  padding: 4px 0;
}
.quote-line {
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  background: var(--surface);
}
.quote-line .ql-main { display: flex; gap: 8px; align-items: center; }
.ql-comment { font-size: 12px; }

.quote-totals {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--text-muted);
  max-width: 280px;
  margin-left: auto;
}
.quote-totals > div { display: flex; justify-content: space-between; }
.quote-totals b { color: var(--text); font-family: var(--font-mono); }
.quote-totals .grand { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--border); font-size: 15px; }
.quote-totals .grand b { color: var(--accent); }

/* ---- Inactive machine row ---- */
.row-inactive { opacity: 0.5; }

/* ---- Catalogue treeview ---- */
.tree { padding: 10px 20px 28px; }
.tree-children { display: none; padding-left: 14px; margin-left: 9px; border-left: 1px solid var(--border); }
.tree-node.open > .tree-children { display: block; }
.tree-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; border-radius: var(--radius-sm); cursor: pointer; font-size: 13px;
}
.tree-row:hover { background: var(--surface-2); }
.tree-row.branch { font-weight: 500; }
.tree-node.cat > .tree-row { font-size: 14px; }
.caret { width: 12px; text-align: center; color: var(--text-muted); font-size: 10px; transition: transform 0.15s; flex: none; }
.tree-node.open > .tree-row .caret { transform: rotate(90deg); }
.caret-spacer { width: 12px; flex: none; }
.tree-label { flex: none; }
.tree-link:hover { color: var(--accent); text-decoration: underline; }
.tree-meta { color: var(--text-muted); font-family: var(--font-mono); font-size: 11px; }
.tree-row.leaf.variant .tree-label { color: var(--text-muted); }

/* ---- Article scan/search picker ---- */
.ap-wrap { position: relative; flex: 1; }
.ap-input { width: 100%; }

/* ---- Collapsible advanced sections (catalogue form) ---- */
details.adv { margin: 10px 0; border: 1px solid var(--border); border-radius: var(--radius-sm); }
details.adv > summary {
  cursor: pointer; padding: 9px 12px; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); list-style: none;
}
details.adv > summary::-webkit-details-marker { display: none; }
details.adv > summary::before { content: '▸ '; color: var(--text-faint); }
details.adv[open] > summary::before { content: '▾ '; }
details.adv > summary:hover { color: var(--text); }
details.adv > *:not(summary) { padding: 0 12px 12px; }

/* ---- Inline scan/search suggestions (receipts) ---- */
.l-suggest {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 50;
  background: var(--surface); border: 1px solid var(--border-light);
  border-radius: var(--radius-sm); margin-top: 2px; max-height: 220px; overflow-y: auto;
  box-shadow: 0 6px 20px rgba(0,0,0,0.45);
}
.l-opt { padding: 7px 10px; font-size: 13px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.l-opt:hover { background: var(--surface-2); }

/* ---- Production planning ---- */
.plan-grid { padding: 16px 20px; overflow-x: auto; }
.plan-row { display: flex; align-items: center; gap: 0; min-width: max-content; }
.plan-label { width: 150px; flex: none; font-size: 12px; padding: 4px 8px; color: var(--text-muted); }
.plan-cell { width: 30px; flex: none; height: 26px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); position: relative; font-size: 9px; text-align: center; color: var(--text-faint); }
.plan-cell.weekend { background: var(--surface); }
.plan-bar { height: 16px; border-radius: 3px; background: var(--accent-dim); position: absolute; top: 4px; }
.load-ok { background: rgba(76,175,125,0.35); }
.load-warn { background: rgba(245,158,66,0.4); }
.load-over { background: rgba(224,82,82,0.45); }
.load-off { background: repeating-linear-gradient(45deg, var(--surface), var(--surface) 4px, transparent 4px, transparent 8px); color: var(--text-faint); cursor: not-allowed; }

/* ---- Confidential (dashboard privacy toggle) ---- */
.conf-hidden .conf { filter: blur(8px); transition: filter 0.12s; }
.conf-hidden .conf:hover { filter: blur(8px); }   /* stay blurred even on hover */
.day-pick { cursor: pointer; }
.day-pick:hover { background: var(--surface-2); }
.plan-cell.slot-sel { outline: 2px solid var(--accent); outline-offset: -2px; }
.plan-cell { height: auto; min-height: 26px; line-height: 1.2; padding: 2px 0; }

/* ---- Planning drag & drop ---- */
.plan-pool { display: flex; flex-wrap: wrap; gap: 6px; }
.plan-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface-2); border: 1px solid var(--border-light);
  border-radius: var(--radius-sm); padding: 5px 10px; font-size: 12px; cursor: grab;
}
.order-drag { cursor: grab; }
.order-drag:active { cursor: grabbing; }
.dragging { opacity: 0.45; }
.drop-cell { cursor: copy; }
.drop-hover { outline: 2px dashed var(--accent); outline-offset: -2px; }

/* Material chip remove */
.chip-x { cursor: pointer; color: var(--text-faint); margin-left: 2px; }
.chip-x:hover { color: var(--red); }

/* ---- Receipt summary footer ---- */
.receipt-foot {
  margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border);
  font-size: 13px; color: var(--text-muted); text-align: right;
}
.receipt-foot b { color: var(--text); }

/* ---- Deposit progress bar (quotes) ---- */
.deposit-bar {
  height: 8px;
  background: var(--surface-2);
  border-radius: 20px;
  overflow: hidden;
}
.deposit-fill {
  height: 100%;
  border-radius: 20px;
  transition: width 0.3s ease;
}

/* ---- Budget bar (actual + committed) ---- */
.budget-bar {
  height: 12px; background: var(--surface-2); border-radius: 20px; overflow: hidden; display: flex;
}
.seg-actual { height: 100%; background: var(--green); }
.seg-committed { height: 100%; background: var(--orange); }

/* ---- Kanban (Orders board) ---- */
.kanban { display: flex; gap: 12px; padding: 18px; overflow-x: auto; align-items: flex-start; min-height: calc(100vh - var(--topnav-h) - 80px); }
.kan-col { flex: 0 0 240px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; max-height: calc(100vh - var(--topnav-h) - 96px); }
.kan-col-head { padding: 10px 12px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.kan-count { background: var(--surface-2); color: var(--text-muted); border-radius: 10px; padding: 1px 8px; font-size: 11px; }
.kan-list { padding: 8px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; flex: 1; min-height: 60px; }
.kan-list.over { background: var(--accent-dim); outline: 2px dashed var(--accent); outline-offset: -4px; }
.kan-empty { min-height: 40px; }
.kan-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px; cursor: grab; }
.kan-card.dragging { opacity: 0.5; }
.kan-card-no { font-family: var(--font-mono); font-size: 12px; font-weight: 700; color: var(--accent); }
.kan-card-cust { font-size: 13px; margin: 3px 0; }
.kan-card-ttc { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }
.kan-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.kan-chip { font-size: 11px; background: var(--surface); border: 1px solid var(--border-light); border-radius: 12px; padding: 2px 8px; cursor: pointer; color: var(--text); text-decoration: none; white-space: nowrap; }
.kan-chip:hover { border-color: var(--accent); color: var(--accent); }

/* ---- Dashboard / KPI cards ---- */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.kpi-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px;
}
.kpi-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
.kpi-value { font-size: 24px; font-weight: 700; margin-top: 6px; font-family: var(--font-mono); }
.kpi-sub { font-size: 11px; color: var(--text-faint); margin-top: 4px; }

.db-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.db-panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
}
@media (max-width: 900px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .db-cols { grid-template-columns: 1fr; }
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }
