/* =====================================================================
   Order & Shipping Management System — design system
   Modern, classic, quiet. Every page shares these components.
   ===================================================================== */
:root {
  --bg: #f3f5f9; --bg-soft: #f8fafc; --card: #ffffff; --text: #1b2430; --text-2: #3f4b5b; --muted: #6b7686;
  --border: #e3e8ef; --border-strong: #cfd6e0;
  --primary: #1d4ed8; --primary-2: #2563eb; --primary-dark: #1e3a8a; --primary-soft: #e8efff; --accent: #60a5fa;
  --danger: #b91c1c; --danger-soft: #fdecec; --success: #15803d; --success-soft: #e6f6ec; --warn: #b45309; --warn-soft: #fff4e0;
  --sidebar: #141c2b; --sidebar-2: #1b2537; --sidebar-text: #c7d0dd;
  --radius: 12px; --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05); --shadow: 0 2px 10px rgba(16, 24, 40, .06), 0 1px 2px rgba(16,24,40,.04);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .12);
  --font: "Inter", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font: 14.5px/1.5 var(--font); color: var(--text); background: var(--bg); display: flex; min-height: 100vh;
  -webkit-font-smoothing: antialiased; font-feature-settings: "cv02", "cv03", "tnum" 0; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); text-decoration: underline; text-underline-offset: 2px; }
h1 { font-size: 1.55rem; margin: 0 0 .2rem; font-weight: 700; letter-spacing: -.015em; line-height: 1.2; }
h2 { font-size: 1.05rem; margin: 1.6rem 0 .6rem; font-weight: 700; letter-spacing: -.005em; display: flex; align-items: center; gap: 10px; }
h2::before { content: ""; width: 4px; height: 18px; border-radius: 2px; background: linear-gradient(180deg, var(--primary-2), var(--accent)); }
h3 { font-size: .95rem; margin: 1rem 0 .5rem; font-weight: 700; }
small { font-size: .82rem; }
code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .85em; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; }

/* ---------- Sidebar ---------- */
.sidebar { width: 244px; flex: 0 0 244px; background: linear-gradient(180deg, var(--sidebar-2) 0%, var(--sidebar) 100%); color: var(--sidebar-text);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; transition: width .18s ease, flex-basis .18s ease;
  box-shadow: 1px 0 0 rgba(255,255,255,.04); }
.sidebar .brand { padding: 14px 12px 14px 16px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid rgba(255,255,255,.07); min-height: 60px; }
.sidebar .logo { height: 32px; width: 32px; object-fit: contain; border-radius: 8px; background: #fff; flex: 0 0 32px; }
.sidebar .logo-mark { height: 32px; width: 32px; border-radius: 9px; background: linear-gradient(135deg, #3b82f6, #6366f1); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; flex: 0 0 32px; box-shadow: 0 4px 10px rgba(59,130,246,.35); }
.sidebar .brand-name { color: #fff; font-weight: 700; font-size: 1rem; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: -.01em; }
.sidebar .brand-name:hover { text-decoration: none; }
.menu-toggle { display: none; background: none; border: 1px solid rgba(255,255,255,.18); color: #fff; border-radius: 8px; font-size: 1.1rem; line-height: 1; padding: 5px 10px; cursor: pointer; }
.collapse-toggle { background: none; border: 0; color: #8b98ab; cursor: pointer; padding: 4px; border-radius: 6px; display: inline-flex; }
.collapse-toggle:hover { background: rgba(255,255,255,.08); color: #fff; }
.collapse-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .18s; }
.sidebar ul { list-style: none; margin: 0; padding: 10px 12px; flex: 1; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; scrollbar-color: #3b4658 transparent; }
.sidebar ul::-webkit-scrollbar { width: 6px; }
.sidebar ul::-webkit-scrollbar-thumb { background: #3b4658; border-radius: 3px; }
.sidebar li.group { padding: 16px 10px 5px; font-size: .66rem; text-transform: uppercase; letter-spacing: .12em; color: #6b788b; font-weight: 700; white-space: nowrap; }
.sidebar li a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; margin: 1px 0; border-radius: 9px; color: var(--sidebar-text); white-space: nowrap; position: relative; transition: background .12s, color .12s; font-size: .92rem; }
.sidebar li a svg { width: 18px; height: 18px; flex: 0 0 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: .8; }
.sidebar li a span { overflow: hidden; text-overflow: ellipsis; }
.sidebar li a:hover { background: rgba(255,255,255,.07); color: #fff; text-decoration: none; }
.sidebar li a.active { background: linear-gradient(90deg, rgba(59,130,246,.28), rgba(59,130,246,.10)); color: #fff; font-weight: 600; }
.sidebar li a.active::before { content: ""; position: absolute; left: -12px; top: 7px; bottom: 7px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.sidebar li a.active svg { opacity: 1; color: #93c5fd; }
.sidebar .user { padding: 12px 14px; border-top: 1px solid rgba(255,255,255,.07); font-size: .84rem; display: flex; align-items: center; gap: 9px; background: rgba(0,0,0,.12); }
.sidebar .avatar { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, #334155, #475569); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .8rem; flex: 0 0 30px; }
.sidebar .who { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #e2e8f0; }
.sidebar .user .badge { background: rgba(96,165,250,.2); color: #bfdbfe; }
.sidebar .user form { display: inline; }
button.link { background: none; border: 0; color: #93c5fd; cursor: pointer; padding: 0; font: inherit; }
button.link:hover { color: #fff; }

html.nav-collapsed .sidebar { width: 68px; flex-basis: 68px; }
html.nav-collapsed .sidebar .brand { padding: 12px 0; justify-content: center; flex-direction: column; gap: 6px; }
html.nav-collapsed .sidebar .brand-name, html.nav-collapsed .sidebar li.group span, html.nav-collapsed .sidebar li a span,
html.nav-collapsed .sidebar .who, html.nav-collapsed .sidebar .user form { display: none; }
html.nav-collapsed .sidebar li.group { padding: 8px 0 0; border-top: 1px solid rgba(255,255,255,.07); margin-top: 6px; }
html.nav-collapsed .sidebar li a { justify-content: center; padding: 10px 0; }
html.nav-collapsed .sidebar li a.active::before { left: -12px; }
html.nav-collapsed .collapse-toggle svg { transform: rotate(180deg); }
html.nav-collapsed .sidebar .user { justify-content: center; }

/* ---------- Layout ---------- */
main { flex: 1; padding: 26px 32px 72px; min-width: 0; max-width: 100%; overflow-x: hidden; }
main > * { max-width: 100%; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.page-head .sub { color: var(--muted); font-size: .92rem; margin-top: 4px; }
.page-head .badge { vertical-align: middle; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.actions form { display: inline; }

.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 22px; margin-bottom: 18px; box-shadow: var(--shadow-sm); overflow-x: auto; }
.card.narrow { max-width: 600px; }
.card h2:first-child, .card h3:first-child { margin-top: 0; }
.card h3 { padding-bottom: 8px; border-bottom: 1px solid var(--border); margin-bottom: 10px; color: var(--text); }
.card h2::before { display: none; }
.grid { display: grid; gap: 18px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1500px) { .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid.wide-tables { grid-template-columns: 1fr; } }
@media (max-width: 1100px) { .grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: #fff; color: var(--text); cursor: pointer; font: inherit; font-weight: 500; line-height: 1.25; box-shadow: var(--shadow-sm); transition: background .12s, box-shadow .12s, transform .06s, border-color .12s; white-space: nowrap; }
.btn:hover { background: var(--bg-soft); border-color: #b9c2cf; text-decoration: none; color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(180deg, var(--primary-2), var(--primary)); border-color: var(--primary); color: #fff; box-shadow: 0 1px 2px rgba(29,78,216,.3); }
.btn.primary:hover { background: linear-gradient(180deg, var(--primary), var(--primary-dark)); color: #fff; }
.btn.danger { background: #fff; color: var(--danger); border-color: #f1b8b8; }
.btn.danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn.success { background: linear-gradient(180deg, #16a34a, var(--success)); border-color: var(--success); color: #fff; }
.btn.success:hover { background: var(--success); color: #fff; }
.btn.small { padding: 4px 10px; font-size: .82rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: separate; border-spacing: 0; background: #fff; font-size: .9rem; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
th { background: var(--bg-soft); font-weight: 600; font-size: .74rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; position: sticky; top: 0; z-index: 1; }
tbody tr:hover > td { background: #fbfcfe; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.total td { font-weight: 700; background: var(--bg-soft); border-top: 2px solid var(--border-strong); }
tr.clickable { cursor: pointer; }
tr.clickable:hover > td { background: var(--primary-soft); }
tr.muted td { color: var(--muted); text-decoration: line-through; }
tbody tr:last-child td { border-bottom: 0; }
.table-wrap { overflow: auto; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 18px; max-width: 100%; box-shadow: var(--shadow-sm); max-height: 78vh; }
.table-wrap table { border: 0; }
.table-wrap.internal { border-left: 4px solid var(--warn); }
.card table { width: 100%; font-size: .88rem; }
.card table th, .card table td { padding: 7px 8px; }
.card table th { white-space: normal; position: static; }
.card table td.num { white-space: nowrap; }
.card table td:first-child, .card table th:first-child { padding-left: 4px; }
.card table td:last-child, .card table th:last-child { padding-right: 4px; }
td a { font-weight: 500; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px 22px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field.wide { grid-column: 1 / -1; }
.field.checkbox { flex-direction: row; align-items: center; gap: 8px; }
.field.checkbox input { width: auto; }
.field label { font-size: .8rem; font-weight: 600; color: var(--text-2); letter-spacing: .01em; }
.field small { color: var(--muted); font-size: .78rem; }
.field small.error, .msg.error { color: var(--danger); }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--danger); background: #fffafa; }
input, select, textarea { font: inherit; padding: 8px 11px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: #fff; color: var(--text); width: 100%; min-width: 0; transition: border-color .12s, box-shadow .12s; }
input::placeholder, textarea::placeholder { color: #a3adba; }
select { min-width: 160px; background-image: linear-gradient(45deg, transparent 50%, #6b7686 50%), linear-gradient(135deg, #6b7686 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat; appearance: none; -webkit-appearance: none; padding-right: 30px; }
select[multiple] { background-image: none; padding-right: 11px; }
textarea { min-height: 76px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary-2); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
input[type="checkbox"], input[type="radio"] { width: 16px; height: 16px; accent-color: var(--primary); box-shadow: none; }
.form-actions { margin-top: 18px; display: flex; gap: 8px; padding-top: 14px; border-top: 1px solid var(--border); }
table.lines input, table.lines select { padding: 6px 8px; font-size: .9rem; }
table.lines td { padding: 4px 6px; }
table.lines th { position: static; }
table.lines select { min-width: 200px; }
table.lines td.line-total { text-align: right; font-variant-numeric: tabular-nums; }
form .card + .card { margin-top: 0; }
.searchable-wrap { position: relative; }
.searchable-wrap input.search-box { margin-bottom: 4px; font-size: .88rem; padding: 6px 10px; background: var(--bg-soft); }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; padding: 12px 14px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.filters .field { min-width: 150px; }
.filters .field label { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.filters input, .filters select { padding: 6px 10px; font-size: .9rem; }
.filters .btn { padding: 7px 14px; }

/* ---------- Messages & badges ---------- */
.messages { margin-bottom: 14px; }
.msg { padding: 11px 14px; border-radius: var(--radius-sm); margin-bottom: 8px; background: var(--primary-soft); border: 1px solid #c7d7fb; border-left-width: 4px; border-left-color: var(--primary-2); color: #1e3a8a; font-size: .92rem; }
.msg.success { background: var(--success-soft); border-color: #b7e4c4; border-left-color: var(--success); color: #14532d; }
.msg.error { background: var(--danger-soft); border-color: #f5c2c2; border-left-color: var(--danger); color: #7f1d1d; }
.msg.warning { background: var(--warn-soft); border-color: #f9d9a4; border-left-color: var(--warn); color: #7c2d12; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: .72rem; font-weight: 600; background: #eef1f5; color: #3f4b5b; white-space: nowrap; line-height: 1.6; letter-spacing: .01em; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .7; }
.badge.draft, .badge.none { background: #eef1f5; color: #4b5563; }
.badge.sent, .badge.confirmed, .badge.posted, .badge.valid, .badge.active, .badge.applied, .badge.main { background: #e0ebff; color: #1e40af; }
.badge.paid, .badge.done, .badge.fully_arrived, .badge.completed, .badge.full { background: var(--success-soft); color: #166534; }
.badge.partial, .badge.partially_arrived, .badge.purchasing, .badge.waiting_shipment, .badge.pending, .badge.prepared, .badge.today { background: var(--warn-soft); color: #92400e; }
.badge.unpaid, .badge.overdue, .badge.failed, .badge.cancelled, .badge.void, .badge.reversed, .badge.unapplied, .badge.over { background: var(--danger-soft); color: #991b1b; }
.badge.internal { background: var(--warn-soft); color: var(--warn); }

/* ---------- KPI cards ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpis.internal { padding-left: 0; }
.kpi { position: relative; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px 14px 18px; display: block; color: inherit; box-shadow: var(--shadow-sm); transition: box-shadow .15s, transform .15s, border-color .15s; overflow: hidden; }
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: linear-gradient(180deg, var(--primary-2), var(--accent)); }
.kpi.pos::before { background: linear-gradient(180deg, #16a34a, #4ade80); }
.kpi.neg::before { background: linear-gradient(180deg, #dc2626, #f87171); }
a.kpi:hover { text-decoration: none; box-shadow: var(--shadow); transform: translateY(-1px); border-color: #c7d2fe; color: inherit; }
.kpi .label { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.kpi .value { font-size: 1.45rem; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; color: var(--text); }
.kpi .hint { font-size: .8rem; color: var(--muted); margin-top: 2px; }
.kpi.neg .value { color: var(--danger); }
.kpi.pos .value { color: var(--success); }

/* ---------- Smart buttons, property lists, misc ---------- */
.smart-buttons { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.smart-buttons a { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 8px 14px; color: var(--text); min-width: 96px; box-shadow: var(--shadow-sm); transition: border-color .12s, box-shadow .12s; }
.smart-buttons a:hover { text-decoration: none; border-color: var(--accent); box-shadow: var(--shadow); }
.smart-buttons a b { display: block; font-size: 1.1rem; letter-spacing: -.01em; }
.smart-buttons a small { color: var(--muted); font-size: .76rem; }

dl.props { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
dl.props dt { color: var(--muted); font-size: .82rem; padding-top: 2px; }
dl.props dd { margin: 0; }
.money { font-variant-numeric: tabular-nums; white-space: nowrap; }
.neg { color: var(--danger); }
.pos { color: var(--success); }
.muted { color: var(--muted); }
.right { text-align: right; }
.internal { border-left: 4px solid var(--warn); }
.internal h3::after, .internal h2::after { content: "internal"; margin-left: 8px; font-size: .66rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--warn); background: var(--warn-soft); border-radius: 999px; padding: 1px 8px; vertical-align: middle; }
.pagination { display: flex; gap: 12px; align-items: center; margin: 12px 0; color: var(--muted); font-size: .9rem; }
.pagination a { padding: 4px 10px; border: 1px solid var(--border); border-radius: 6px; background: #fff; }
.empty { padding: 28px; text-align: center; color: var(--muted); }
.inline-form { display: inline; }
.drill a { font-weight: 600; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 14px; flex-wrap: wrap; }
.tabs a { padding: 8px 14px; border-radius: 8px 8px 0 0; color: var(--muted); font-weight: 500; }
.tabs a:hover { text-decoration: none; color: var(--text); background: var(--bg-soft); }
.tabs a.active { background: #fff; border: 1px solid var(--border); border-bottom-color: #fff; color: var(--primary); margin-bottom: -1px; }
.notes { white-space: pre-wrap; }
.print-only { display: none; }

/* Reporting Center tiles */
.report-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.report-tile { display: block; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; color: inherit; box-shadow: var(--shadow-sm); transition: box-shadow .15s, transform .15s, border-color .15s; }
.report-tile:hover { text-decoration: none; color: inherit; box-shadow: var(--shadow); transform: translateY(-1px); border-color: #c7d2fe; }
.report-tile b { display: block; font-size: 1rem; margin-bottom: 4px; color: var(--primary); }
.report-tile span { color: var(--muted); font-size: .86rem; }
.report-tile .badge { float: right; }

/* ---------- Login ---------- */
.login-page { align-items: center; justify-content: center; background: radial-gradient(1200px 600px at 20% -10%, #dbe7ff 0%, transparent 60%), radial-gradient(900px 500px at 110% 110%, #e0e7ff 0%, transparent 60%), var(--bg); }
.login-card { width: 380px; padding: 28px 30px; box-shadow: var(--shadow-lg); border-radius: 16px; }
.login-card h1 { margin-bottom: 4px; }
.login-card .tag { color: var(--muted); font-size: .9rem; margin-bottom: 18px; }
.login-card .logo-mark { display: inline-flex; width: 44px; height: 44px; border-radius: 12px; background: linear-gradient(135deg, #3b82f6, #6366f1); color: #fff; align-items: center; justify-content: center; font-weight: 800; font-size: 1.2rem; margin-bottom: 14px; box-shadow: 0 6px 16px rgba(59,130,246,.35); }
.login-card label { display: block; margin-bottom: 12px; font-size: .82rem; font-weight: 600; color: var(--text-2); }
.login-card input { margin-top: 5px; }
.login-card .btn { width: 100%; margin-top: 8px; justify-content: center; padding: 10px; }

/* ---------- Narrow screens ---------- */
@media (max-width: 1000px) {
  body { flex-direction: column; }
  .sidebar { width: auto; height: auto; position: sticky; top: 0; flex: none; z-index: 20; overflow: visible; }
  .sidebar .brand { padding: 8px 12px; border-bottom: 0; min-height: 0; }
  .collapse-toggle { display: none; }
  html.nav-collapsed .sidebar { width: auto; flex-basis: auto; }
  html.nav-collapsed .sidebar .brand-name, html.nav-collapsed .sidebar li a span, html.nav-collapsed .sidebar li.group span, html.nav-collapsed .sidebar .who, html.nav-collapsed .sidebar .user form { display: initial; }
  html.nav-collapsed .sidebar li a { justify-content: flex-start; padding: 8px 10px; }
  .menu-toggle { display: inline-block; }
  .sidebar ul, .sidebar .user { display: none; }
  .sidebar.open ul { display: block; padding: 4px 10px 8px; border-top: 1px solid rgba(255,255,255,.08); max-height: 70vh; overflow-y: auto; }
  .sidebar.open .user { display: flex; }
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
  main { padding: 16px 14px 48px; }
  .page-head { flex-direction: column; }
  .kpis { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  dl.props { grid-template-columns: 1fr; }
  dl.props dt { margin-top: 6px; }
  .filters .field { min-width: 120px; flex: 1; }
  .card { padding: 14px 16px; }
  th { position: static; }
}

/* ---------- Print ---------- */
@media print {
  .sidebar, .actions, .filters, .pagination, .no-print, .menu-toggle { display: none !important; }
  body { background: #fff; }
  main { padding: 0; }
  .card, .table-wrap, .kpi { border: 1px solid #ccc; box-shadow: none; break-inside: avoid; }
  th { position: static; }
  a { color: inherit; }
}
