:root {
  --bg: #f5f6f3;
  --surface: #ffffff;
  --surface-2: #f0f2ee;
  --surface-3: #e8ece6;
  --text: #18901d;
  --muted: #66706b;
  --border: #dfe4de;
  --border-strong: #cfd6cf;
  --brand: #1f5a46;
  --brand-2: #153f32;
  --brand-soft: #dcebe4;
  --accent: #d7863e;
  --accent-soft: #f7eadc;
  --danger: #b64b43;
  --danger-soft: #f8e5e3;
  --warning: #9a6a20;
  --warning-soft: #f7eed7;
  --info: #315f89;
  --info-soft: #e4eef7;
  --success: #2f7659;
  --success-soft: #e0f0e7;
  --shadow-sm: 0 1px 2px rgba(18, 31, 26, .06), 0 1px 12px rgba(18, 31, 26, .035);
  --shadow-md: 0 12px 30px rgba(18, 31, 26, .09);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --sidebar: 252px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
svg { display: block; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-splash {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #000;
  opacity: 1;
  visibility: visible;
  transition: opacity .28s ease, visibility 0s linear .28s;
}

.app-splash.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.app-splash-image {
  display: block;
  width: min(100vw, 1672px);
  max-width: none;
  height: auto;
  flex: none;
  user-select: none;
}

@media (max-width: 600px) {
  .app-splash-image { width: 100vw; }
}

@media (prefers-reduced-motion: reduce) {
  .app-splash { transition: none; }
}

.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar); z-index: 30;
  display: flex; flex-direction: column; padding: 22px 16px 16px;
  background: linear-gradient(180deg, #172820 0%, #112019 100%); color: #eef7f2;
  border-right: 1px solid rgba(255,255,255,.06);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 24px; }
.brand-mark {
  width: 38px; height: 38px; display: grid; place-items: center; overflow:visible; border-radius: 0;
  background:transparent; border:0;
  box-shadow:none;
}
.brand-mark img { display:block; width:100%; height:100%; object-fit:contain; object-position:center; }
.brand-title { font-weight: 750; font-size: 16px; letter-spacing: .03em; }
.brand-sub { color: #aabbb2; font-size: 11px; margin-top: 2px; }
.nav { display: grid; gap: 4px; overflow-y: auto; padding-right: 2px; }
.nav-section { color: #82958b; font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; padding: 16px 12px 6px; }
.nav-link {
  display: flex; align-items: center; gap: 11px; min-height: 40px; padding: 9px 11px; border-radius: 9px;
  color: #c7d4cd; font-size: 13px; transition: .16s ease; position: relative;
}
.nav-link:hover { background: rgba(255,255,255,.06); color: white; }
.nav-link.active { background: rgba(225,155,83,.16); color: #fff; }
.nav-link.active::before { content:""; position:absolute; left:-4px; width:3px; height:20px; border-radius:4px; background: var(--accent); }
.nav-icon { width: 18px; height: 18px; opacity: .9; flex: 0 0 auto; }
.nav-count { margin-left: auto; min-width: 22px; padding: 2px 6px; border-radius: 999px; background: rgba(255,255,255,.08); color: #d9e5df; text-align:center; font-size:10px; }
.nav-link.active .nav-count { background: rgba(225,155,83,.22); color: #ffd9b0; }
.sidebar-footer { margin-top: auto; padding-top: 16px; }
.user-card { display:flex; align-items:center; gap:10px; padding:10px; background:rgba(255,255,255,.05); border:1px solid rgba(255,255,255,.06); border-radius:11px; }
.avatar { width:32px; height:32px; border-radius:50%; background:#dfe9e3; color:#19362b; display:grid; place-items:center; font-size:12px; font-weight:800; }
.user-name { font-size:12px; font-weight:650; }
.user-role { font-size:10px; color:#8fa198; margin-top:2px; }

.main { margin-left: var(--sidebar); min-height: 100vh; }
.topbar {
  height: 68px; position: sticky; top:0; z-index:20; display:flex; align-items:center; gap:16px;
  padding: 0 30px; background: rgba(245,246,243,.9); backdrop-filter: blur(14px); border-bottom:1px solid rgba(207,214,207,.7);
}
.mobile-menu { display:none; }
.breadcrumb { min-width:0; }
.page-kicker { color:var(--muted); font-size:11px; margin-bottom:2px; }
.page-title { font-size:18px; font-weight:740; letter-spacing:-.02em; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.top-actions { margin-left:auto; display:flex; align-items:center; gap:9px; }
.global-search { width: 250px; position:relative; }
.global-search input { width:100%; height:36px; border-radius:9px; border:1px solid var(--border); background:var(--surface); padding:0 38px 0 34px; outline:none; font-size:12px; transition:.15s; }
.global-search input:focus { border-color:#9ab8aa; box-shadow:0 0 0 3px rgba(31,90,70,.08); }
.global-search svg { position:absolute; left:11px; top:10px; color:#89938e; }
.icon-button { width:36px; height:36px; border:none; background:var(--surface); border:1px solid var(--border); border-radius:9px; display:grid; place-items:center; color:#59645f; position:relative; }
.icon-button:hover { background:#fff; border-color:var(--border-strong); }
.notification-dot { position:absolute; top:7px; right:7px; width:6px; height:6px; border-radius:50%; background:var(--danger); box-shadow:0 0 0 2px white; }

.content { padding: 26px 30px 48px; max-width: 1600px; margin: 0 auto; }
.page-head { display:flex; align-items:flex-end; justify-content:space-between; gap:18px; margin-bottom:22px; }
.page-head h1 { margin:0; font-size:26px; line-height:1.15; letter-spacing:-.035em; }
.page-head p { margin:7px 0 0; color:var(--muted); font-size:13px; max-width:720px; line-height:1.55; }
.page-actions { display:flex; gap:9px; flex-wrap:wrap; justify-content:flex-end; }

.btn { height:38px; border-radius:9px; padding:0 14px; border:1px solid var(--border-strong); background:#fff; color:#2c3833; display:inline-flex; align-items:center; justify-content:center; gap:8px; font-size:12px; font-weight:650; transition:.15s; white-space:nowrap; }
.btn:hover { transform:translateY(-1px); box-shadow:var(--shadow-sm); }
.btn-primary { background:var(--brand); color:#fff; border-color:var(--brand); }
.btn-primary:hover { background:var(--brand-2); }
.btn-accent { background:var(--accent); color:#fff; border-color:var(--accent); }
.btn-danger { color:var(--danger); border-color:#e3b4b0; background:#fffafa; }
.btn-ghost { border-color:transparent; background:transparent; }
.btn-sm { height:32px; padding:0 10px; font-size:11px; }
.btn:disabled { opacity:.48; cursor:not-allowed; transform:none; box-shadow:none; }

.grid { display:grid; gap:16px; }
.grid-4 { grid-template-columns:repeat(4,minmax(0,1fr)); }
.grid-3 { grid-template-columns:repeat(3,minmax(0,1fr)); }
.grid-2 { grid-template-columns:repeat(2,minmax(0,1fr)); }
.metric-card { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:17px; box-shadow:var(--shadow-sm); min-height:118px; display:flex; flex-direction:column; }
.metric-top { display:flex; align-items:center; justify-content:space-between; }
.metric-label { color:var(--muted); font-size:11px; font-weight:600; }
.metric-icon { width:31px; height:31px; border-radius:9px; display:grid; place-items:center; background:var(--brand-soft); color:var(--brand); }
.metric-value { font-size:25px; font-weight:760; letter-spacing:-.04em; margin-top:14px; }
.metric-foot { margin-top:auto; padding-top:6px; color:var(--muted); font-size:10px; }
.metric-card.warning .metric-icon { background:var(--warning-soft); color:var(--warning); }
.metric-card.danger .metric-icon { background:var(--danger-soft); color:var(--danger); }
.metric-card.info .metric-icon { background:var(--info-soft); color:var(--info); }

.panel { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); box-shadow:var(--shadow-sm); overflow:hidden; }
.panel-head { display:flex; align-items:center; justify-content:space-between; gap:12px; min-height:54px; padding:0 17px; border-bottom:1px solid var(--border); }
.panel-title { font-size:13px; font-weight:720; }
.panel-subtitle { color:var(--muted); font-size:10px; margin-top:2px; }
.panel-body { padding:17px; }
.panel-link { color:var(--brand); font-size:11px; font-weight:650; }
.dashboard-layout { margin-top:16px; grid-template-columns:minmax(0,1.55fr) minmax(300px,.85fr); }

.task-list { display:grid; }
.task-row { display:grid; grid-template-columns:7px minmax(0,1fr) auto; gap:12px; align-items:center; padding:13px 16px; border-bottom:1px solid #edf0ec; transition:.15s; cursor:pointer; }
.task-row:last-child { border-bottom:0; }
.task-row:hover { background:#fafbf9; }
.task-priority { width:7px; height:34px; border-radius:999px; background:var(--accent); }
.task-priority.p1 { background:var(--danger); }
.task-priority.p2 { background:var(--warning); }
.task-title { font-size:12px; font-weight:680; }
.task-desc { font-size:10px; color:var(--muted); margin-top:3px; }
.task-meta { text-align:right; font-size:10px; color:var(--muted); }

.status { display:inline-flex; align-items:center; gap:6px; min-height:24px; padding:3px 8px; border-radius:999px; font-size:10px; font-weight:680; white-space:nowrap; }
.status::before { content:""; width:6px; height:6px; border-radius:50%; background:currentColor; }
.status-red { color:var(--danger); background:var(--danger-soft); }
.status-yellow { color:var(--warning); background:var(--warning-soft); }
.status-green { color:var(--success); background:var(--success-soft); }
.status-blue { color:var(--info); background:var(--info-soft); }
.status-gray { color:#66706b; background:#eef0ed; }
.status-orange { color:#a05b21; background:var(--accent-soft); }

.table-wrap { overflow:auto; }
table { width:100%; border-collapse:collapse; min-width:760px; }
th { height:40px; padding:0 13px; background:#f7f8f6; color:#727c77; font-size:9px; text-align:left; font-weight:750; letter-spacing:.055em; text-transform:uppercase; border-bottom:1px solid var(--border); white-space:nowrap; }
td { padding:12px 13px; border-bottom:1px solid #edf0ec; font-size:11px; vertical-align:middle; }
tbody tr { transition:.12s; }
tbody tr:hover { background:#fafbf9; }
tbody tr.clickable { cursor:pointer; }
.cell-main { font-size:11px; font-weight:680; }
.cell-sub { color:var(--muted); font-size:9.5px; margin-top:3px; }
.money { font-variant-numeric:tabular-nums; white-space:nowrap; font-weight:670; }
.muted { color:var(--muted); }
.text-danger { color:var(--danger); }
.text-success { color:var(--success); }
.text-warning { color:var(--warning); }

.tabs { display:flex; align-items:center; gap:4px; padding:4px; background:#e9ece8; border-radius:10px; width:max-content; margin-bottom:16px; }
.tab { height:31px; padding:0 12px; border:none; border-radius:7px; background:transparent; color:#67716c; font-size:11px; font-weight:650; }
.tab.active { background:#fff; color:var(--text); box-shadow:0 1px 5px rgba(20,40,31,.08); }
.tab-count { margin-left:5px; color:#929b96; }
.filterbar { display:flex; align-items:center; gap:8px; margin-bottom:13px; flex-wrap:wrap; }
.search-field { position:relative; min-width:250px; flex:1; max-width:420px; }
.search-field input { width:100%; height:36px; border:1px solid var(--border); border-radius:9px; background:#fff; padding:0 12px 0 34px; font-size:11px; outline:none; }
.search-field svg { position:absolute; left:11px; top:9px; color:#89938e; }
.select { height:36px; border:1px solid var(--border); border-radius:9px; background:#fff; padding:0 32px 0 11px; font-size:11px; color:#3f4945; outline:none; }

.form-card { background:#fff; border:1px solid var(--border); border-radius:var(--radius); box-shadow:var(--shadow-sm); padding:20px; }
.form-section + .form-section { border-top:1px solid var(--border); margin-top:20px; padding-top:20px; }
.section-title { font-size:14px; font-weight:740; margin-bottom:4px; }
.section-help { color:var(--muted); font-size:10.5px; margin-bottom:15px; }
.form-grid { display:grid; grid-template-columns:repeat(12,minmax(0,1fr)); gap:12px; }
.field { grid-column:span 4; }
.field.span-6 { grid-column:span 6; }
.field.span-8 { grid-column:span 8; }
.field.span-12 { grid-column:span 12; }
label { display:block; font-size:10px; font-weight:680; color:#5f6964; margin-bottom:6px; }
.input, textarea.input, select.input { width:100%; min-height:39px; border:1px solid var(--border-strong); border-radius:9px; background:#fff; padding:9px 11px; color:var(--text); outline:none; font-size:11px; transition:.15s; }
textarea.input { min-height:75px; resize:vertical; }
.input:focus { border-color:#8aab9c; box-shadow:0 0 0 3px rgba(31,90,70,.08); }
.input[readonly] { background:#f3f5f2; color:#65706a; }
.helper { color:var(--muted); font-size:9px; margin-top:5px; line-height:1.4; }
.required::after { content:" *"; color:var(--danger); }

.stepper { display:flex; align-items:center; gap:0; margin-bottom:20px; }
.step { display:flex; align-items:center; gap:8px; color:#89928e; font-size:10.5px; font-weight:650; }
.step-number { width:25px; height:25px; border-radius:50%; display:grid; place-items:center; border:1px solid var(--border-strong); background:#fff; }
.step.active { color:var(--brand); }
.step.active .step-number { background:var(--brand); color:#fff; border-color:var(--brand); }
.step.done .step-number { background:var(--success-soft); color:var(--success); border-color:#b9d8c7; }
.step-line { width:42px; height:1px; background:var(--border-strong); margin:0 10px; }

.item-editor { border:1px solid var(--border); border-radius:11px; overflow:hidden; margin-bottom:12px; }
.item-head { display:flex; align-items:center; justify-content:space-between; padding:11px 13px; background:#f7f8f6; border-bottom:1px solid var(--border); }
.item-index { font-size:11px; font-weight:700; }
.item-body { padding:14px; }
.item-calculation { display:flex; justify-content:flex-end; align-items:baseline; gap:10px; padding-top:12px; margin-top:12px; border-top:1px dashed var(--border); }
.item-base { color:var(--muted); font-size:10px; }
.item-total { font-size:16px; font-weight:760; }
.order-total { display:flex; align-items:flex-end; justify-content:flex-end; gap:30px; padding:15px 0 0; }
.total-label { color:var(--muted); font-size:10px; text-align:right; }
.total-value { font-size:28px; font-weight:780; letter-spacing:-.04em; }
.form-footer { position:sticky; bottom:0; display:flex; align-items:center; justify-content:space-between; gap:16px; margin:20px -20px -20px; padding:14px 20px; background:rgba(255,255,255,.93); backdrop-filter:blur(10px); border-top:1px solid var(--border); border-radius:0 0 var(--radius) var(--radius); }

.detail-layout { display:grid; grid-template-columns:minmax(0,1.45fr) minmax(290px,.55fr); gap:16px; }
.detail-hero { background:linear-gradient(135deg,#1d4f3e,#15382d); color:#fff; border-radius:var(--radius-lg); padding:20px; box-shadow:var(--shadow-md); margin-bottom:16px; }
.detail-hero-top { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; }
.order-number { font-size:12px; color:#b9d1c6; }
.order-customer { font-size:22px; font-weight:760; letter-spacing:-.03em; margin-top:5px; }
.order-contact { margin-top:5px; color:#b9d1c6; font-size:11px; }
.hero-stats { display:grid; grid-template-columns:repeat(3,1fr); margin-top:22px; border-top:1px solid rgba(255,255,255,.15); padding-top:15px; }
.hero-stat + .hero-stat { border-left:1px solid rgba(255,255,255,.15); padding-left:16px; }
.hero-label { color:#9db9ad; font-size:9px; text-transform:uppercase; letter-spacing:.08em; }
.hero-value { margin-top:5px; font-size:16px; font-weight:720; }
.side-stack { display:grid; gap:16px; align-content:start; }
.action-list { display:grid; gap:7px; }
.action-list .btn { justify-content:flex-start; width:100%; }
.timeline { display:grid; gap:0; }
.timeline-row { display:grid; grid-template-columns:16px 1fr; gap:10px; position:relative; padding-bottom:14px; }
.timeline-row:not(:last-child)::before { content:""; position:absolute; left:7px; top:13px; bottom:0; width:1px; background:var(--border-strong); }
.timeline-dot { width:15px; height:15px; border-radius:50%; border:4px solid #fff; box-shadow:0 0 0 1px #bfc9c3; background:var(--brand); z-index:1; }
.timeline-title { font-size:10.5px; font-weight:680; }
.timeline-meta { margin-top:2px; color:var(--muted); font-size:9px; }

.empty { padding:40px 20px; text-align:center; color:var(--muted); }
.empty-icon { width:44px; height:44px; margin:0 auto 10px; border-radius:12px; background:var(--surface-2); display:grid; place-items:center; color:#89938e; }
.empty-title { color:#4b5550; font-size:12px; font-weight:700; }
.empty-text { font-size:10px; margin-top:5px; }

.chart-bars { height:180px; display:flex; align-items:flex-end; gap:16px; padding:16px 8px 0; }
.chart-bar-wrap { flex:1; min-width:34px; display:flex; flex-direction:column; align-items:center; gap:7px; }
.chart-bar { width:100%; max-width:44px; min-height:4px; background:linear-gradient(180deg,#3b7c62,#1f5a46); border-radius:6px 6px 2px 2px; }
.chart-label { color:var(--muted); font-size:9px; white-space:nowrap; }
.progress { height:7px; border-radius:999px; background:#e7ebe7; overflow:hidden; }
.progress > span { display:block; height:100%; border-radius:inherit; background:var(--brand); }

.modal-backdrop { position:fixed; inset:0; z-index:90; background:rgba(10,20,16,.48); display:grid; place-items:center; padding:20px; animation:fadeIn .15s ease; }
.modal { display:flex; flex-direction:column; width:min(680px,100%); max-height:90vh; overflow:hidden; background:#fff; border-radius:16px; box-shadow:0 24px 80px rgba(0,0,0,.25); }
.modal > form { display:flex; flex:1 1 auto; flex-direction:column; min-height:0; }
.modal-head { flex:0 0 auto; display:flex; align-items:flex-start; justify-content:space-between; gap:16px; padding:18px 20px; border-bottom:1px solid var(--border); }
.modal-head h3 { margin:0; font-size:16px; }
.modal-head p { margin:4px 0 0; color:var(--muted); font-size:10px; }
.modal-body { min-height:0; overflow-y:auto; overscroll-behavior:contain; -webkit-overflow-scrolling:touch; padding:20px; }
.modal-footer { flex:0 0 auto; display:flex; justify-content:flex-end; gap:9px; padding:14px 20px; border-top:1px solid var(--border); background:#fff; }
body.modal-open { overflow:hidden; }

.toast { position:fixed; right:20px; bottom:20px; z-index:100; min-width:280px; max-width:420px; padding:12px 14px; background:#173b2f; color:#fff; border-radius:11px; box-shadow:var(--shadow-md); display:flex; align-items:center; gap:10px; animation:slideIn .22s ease; font-size:11px; }
.toast.error { background:#8e3f39; }
.toast svg { flex:0 0 auto; }
@keyframes slideIn { from { transform:translateY(12px); opacity:0; } }
@keyframes fadeIn { from { opacity:0; } }

.loading { min-height:260px; display:grid; place-items:center; color:var(--muted); }
.spinner { width:28px; height:28px; border-radius:50%; border:3px solid #dfe4de; border-top-color:var(--brand); animation:spin .7s linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }

.mobile-overlay { display:none; }
.hide { display:none !important; }

@media (max-width: 1200px) {
  .grid-4 { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .dashboard-layout, .detail-layout { grid-template-columns:1fr; }
  .side-stack { grid-template-columns:repeat(2,minmax(0,1fr)); }
}

@media (max-width: 900px) {
  :root { --sidebar: 230px; }
  .sidebar { transform:translateX(-100%); transition:.2s ease; box-shadow:var(--shadow-md); }
  body.sidebar-open .sidebar { transform:translateX(0); }
  .main { margin-left:0; }
  .mobile-menu { display:grid; }
  .mobile-overlay { display:block; position:fixed; inset:0; z-index:25; background:rgba(0,0,0,.28); opacity:0; pointer-events:none; transition:.2s; }
  body.sidebar-open .mobile-overlay { opacity:1; pointer-events:auto; }
  .global-search { display:none; }
  .topbar { padding:0 18px; }
  .content { padding:22px 18px 40px; }
  .field, .field.span-6, .field.span-8 { grid-column:span 12; }
}

@media (max-width: 640px) {
  .grid-4, .grid-3, .grid-2, .side-stack { grid-template-columns:1fr; }
  .page-head { align-items:flex-start; flex-direction:column; }
  .page-actions { width:100%; justify-content:flex-start; }
  .tabs { width:100%; overflow:auto; }
  .tab { flex:0 0 auto; }
  .metric-card { min-height:105px; }
  .hero-stats { grid-template-columns:1fr; gap:12px; }
  .hero-stat + .hero-stat { border-left:0; border-top:1px solid rgba(255,255,255,.15); padding-left:0; padding-top:12px; }
  .order-total { justify-content:space-between; }
  .form-footer { flex-direction:column; align-items:stretch; }
  .form-footer > div { display:flex; gap:8px; }
  .form-footer .btn { flex:1; }
}

/* Frontend v1 additions */
.login-shell { min-height:100vh; display:grid; grid-template-columns:minmax(360px,460px) 1fr; background:#f5f6f3; }
.login-panel { display:flex; flex-direction:column; justify-content:center; padding:48px; background:#fff; border-right:1px solid var(--border); }
.login-brand { display:flex; align-items:center; gap:13px; margin-bottom:42px; }
.login-brand .brand-mark { width:52px; height:52px; flex:0 0 52px; border-radius:14px; }
.login-title { margin:0; font-size:30px; letter-spacing:-.04em; }
.login-subtitle { margin:9px 0 26px; color:var(--muted); font-size:13px; line-height:1.6; }
.login-form { display:grid; gap:15px; }
.login-form .btn { width:100%; height:44px; font-size:13px; }
.login-note { margin-top:18px; color:#7d8782; font-size:10px; line-height:1.55; }
.login-visual { overflow:hidden; display:flex; align-items:center; justify-content:center; padding:38px 50px; background:linear-gradient(145deg,#172820 0%,#10251c 100%); color:#fff; }
.login-brand-story { width:min(760px,100%); display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; }
.login-bear-hero { display:block; width:clamp(290px,38vw,480px); max-width:100%; max-height:46vh; object-fit:contain; object-position:center; }
.login-story-copy { width:min(680px,100%); margin-top:8px; }
.login-story-kicker { color:#ed1b2f; font-size:13px; font-weight:820; letter-spacing:.2em; text-transform:uppercase; }
.login-story-copy h2 { margin:13px 0 12px; font-size:clamp(28px,2.65vw,42px); line-height:1.08; letter-spacing:-.045em; }
.login-story-copy p { margin:0 auto; max-width:590px; color:#c6cbc8; font-size:14px; line-height:1.6; }
.login-capabilities { display:flex; align-items:center; justify-content:center; flex-wrap:wrap; gap:0; margin-top:24px; color:#f3f5f4; font-size:11px; font-weight:720; letter-spacing:.06em; text-transform:uppercase; }
.login-capabilities span { padding:0 16px; border-left:1px solid rgba(237,27,47,.55); }
.login-capabilities span:first-child { border-left:0; }
.error-banner { padding:11px 13px; border-radius:9px; background:var(--danger-soft); color:var(--danger); font-size:11px; line-height:1.45; }
.success-banner { padding:11px 13px; border-radius:9px; background:var(--success-soft); color:var(--success); font-size:11px; line-height:1.45; }
.page-state { min-height:58vh; display:grid; place-items:center; }
.page-state-card { max-width:440px; text-align:center; padding:34px; }
.page-state-card h2 { margin:14px 0 8px; font-size:19px; }
.page-state-card p { margin:0; color:var(--muted); font-size:11px; line-height:1.6; }
.toolbar-spacer { flex:1; }
.stat-line { display:flex; justify-content:space-between; gap:12px; font-size:11px; padding:8px 0; border-bottom:1px solid #edf0ec; }
.stat-line:last-child { border-bottom:0; }
.stat-line span { color:var(--muted); }
.stat-line strong { text-align:right; }
.kv-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px 16px; }
.kv { padding:10px 0; border-bottom:1px solid #edf0ec; }
.kv-label { font-size:9px; color:var(--muted); text-transform:uppercase; letter-spacing:.05em; }
.kv-value { margin-top:4px; font-size:11px; font-weight:670; word-break:break-word; }
.section-stack { display:grid; gap:16px; }
.inline-actions { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.badge-number { min-width:26px; height:26px; display:inline-grid; place-items:center; border-radius:7px; background:var(--surface-2); color:var(--muted); font-size:10px; font-weight:700; }
.list-cards { display:grid; gap:10px; }
.list-card { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:14px; align-items:center; padding:14px; border:1px solid var(--border); border-radius:10px; background:#fff; transition:.15s; }
.list-card:hover { border-color:var(--border-strong); box-shadow:var(--shadow-sm); }
.list-card-title { font-size:12px; font-weight:700; }
.list-card-meta { margin-top:4px; color:var(--muted); font-size:10px; line-height:1.5; }
.list-card-right { text-align:right; }
.timeline-details { margin-top:4px; color:#7a847f; font-size:9.5px; line-height:1.45; }
.order-items-table td:nth-last-child(-n+2), .order-items-table th:nth-last-child(-n+2) { text-align:right; }
.api-hint { padding:10px 12px; background:#f7f8f6; border:1px dashed var(--border-strong); border-radius:9px; color:var(--muted); font-size:10px; line-height:1.5; }
.item-row-editor { border:1px solid var(--border); border-radius:10px; padding:14px; margin-bottom:10px; background:#fbfcfa; }
.item-row-editor-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:12px; }
.item-row-editor-title { font-size:11px; font-weight:700; }
.customer-search-results { max-height:220px; overflow:auto; border:1px solid var(--border); border-radius:9px; background:#fff; }
.customer-option { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:10px 12px; border-bottom:1px solid #edf0ec; cursor:pointer; }
.customer-option:last-child { border-bottom:0; }
.customer-option:hover { background:#f7f8f6; }
.customer-option.selected { background:var(--brand-soft); }
.customer-option-name { font-size:11px; font-weight:670; }
.customer-option-meta { margin-top:3px; color:var(--muted); font-size:9.5px; }
.form-alert { margin:0 0 14px; }
.muted { color:var(--muted); }
.nowrap { white-space:nowrap; }

@media (max-width: 850px) {
  .login-shell { grid-template-columns:1fr; }
  .login-visual { min-height:250px; order:-1; padding:22px 20px 20px; }
  .login-bear-hero { width:180px; max-height:145px; }
  .login-story-copy { margin-top:0; }
  .login-story-kicker { font-size:10px; letter-spacing:.16em; }
  .login-story-copy h2 { margin:7px 0 5px; font-size:20px; line-height:1.15; }
  .login-story-copy p { display:none; }
  .login-capabilities { margin-top:12px; font-size:8px; }
  .login-capabilities span { padding:0 8px; }
  .login-panel { padding:30px 22px; }
  .kv-grid { grid-template-columns:1fr; }
}

@media (max-width: 520px) {
  .login-visual { min-height:218px; padding:14px 16px 16px; }
  .login-bear-hero { width:145px; max-height:118px; }
  .login-story-copy h2 { font-size:18px; }
  .login-capabilities span { padding:0 6px; }
}

/* Frontend v1.1 — customer cards and return-aware order details */
.hero-stats-6 { grid-template-columns:repeat(3,minmax(0,1fr)); row-gap:15px; }
.hero-stats-6 .hero-stat:nth-child(n+4) { border-top:1px solid rgba(255,255,255,.15); padding-top:14px; }
.hero-stats-6 .hero-stat:nth-child(4) { border-left:0; padding-left:0; }
.hero-stats-4 { grid-template-columns:repeat(4,minmax(0,1fr)); }
.customer-hero { margin-bottom:16px; }
.customers-table { min-width:1120px; }
.row-chevron { width:28px; color:var(--muted); text-align:right; }
.list-card-note { margin-top:5px; color:var(--brand); font-size:9.5px; font-weight:650; line-height:1.45; }
.order-items-table { min-width:1040px; }

@media (max-width: 1200px) {
  .hero-stats-4 { grid-template-columns:repeat(2,minmax(0,1fr)); row-gap:14px; }
  .hero-stats-4 .hero-stat:nth-child(3) { border-left:0; padding-left:0; border-top:1px solid rgba(255,255,255,.15); padding-top:13px; }
  .hero-stats-4 .hero-stat:nth-child(4) { border-top:1px solid rgba(255,255,255,.15); padding-top:13px; }
}

@media (max-width: 640px) {
  .hero-stats-6, .hero-stats-4 { grid-template-columns:1fr; }
  .hero-stats-6 .hero-stat:nth-child(n+2),
  .hero-stats-4 .hero-stat:nth-child(n+2) { border-left:0; border-top:1px solid rgba(255,255,255,.15); padding-left:0; padding-top:12px; }
}

/* Frontend v1.2 — focused new order workflow */
.section-row-head { display:flex; justify-content:space-between; align-items:center; gap:14px; margin-bottom:12px; }
.selected-customer-card { display:grid; grid-template-columns:minmax(0,1fr) minmax(240px,320px); gap:18px; padding:16px; border:1px solid #cbdcd3; border-radius:12px; background:linear-gradient(135deg,#f6fbf8 0%,#eef7f2 100%); }
.selected-customer-main { min-width:0; }
.selected-customer-eyebrow { color:var(--brand); font-size:9px; font-weight:750; letter-spacing:.08em; text-transform:uppercase; }
.selected-customer-name { margin-top:5px; font-size:16px; font-weight:760; letter-spacing:-.025em; }
.selected-customer-meta { margin-top:5px; color:#53615b; font-size:10.5px; line-height:1.5; }
.selected-customer-note { margin-top:8px; color:var(--muted); font-size:10px; }
.selected-customer-side { display:flex; flex-direction:column; align-items:flex-end; justify-content:center; padding-left:18px; border-left:1px solid #cfddd5; text-align:right; }
.selected-customer-balance-label { color:var(--muted); font-size:9px; text-transform:uppercase; letter-spacing:.06em; }
.selected-customer-balance-value { margin-top:4px; color:var(--brand); font-size:22px; font-weight:780; letter-spacing:-.04em; }
.selected-customer-balance-help { max-width:260px; margin:3px 0 10px; color:var(--muted); font-size:9.5px; line-height:1.45; }
.calculation-hint { margin-top:4px; color:var(--muted); font-size:9.5px; font-weight:450; }
.item-calculation { display:grid; grid-template-columns:minmax(0,1fr) minmax(180px,.45fr); gap:12px; margin-top:13px; padding:12px 14px; border-radius:9px; background:#eef3ef; }
.item-calculation > div { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.item-calculation span { color:var(--muted); font-size:9.5px; }
.item-calculation strong { font-size:11px; }
.new-order-summary { margin-top:20px; padding:17px; border:1px solid var(--border); border-radius:12px; background:#f8faf7; }
.new-order-summary-title { margin-bottom:12px; font-size:13px; font-weight:750; }
.new-order-summary-grid { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:0; }
.new-order-summary-grid > div { min-height:52px; padding:0 16px; border-left:1px solid var(--border); display:flex; flex-direction:column; justify-content:center; }
.new-order-summary-grid > div:first-child { border-left:0; padding-left:0; }
.new-order-summary-grid span { color:var(--muted); font-size:9px; text-transform:uppercase; letter-spacing:.045em; }
.new-order-summary-grid strong { margin-top:5px; font-size:16px; letter-spacing:-.03em; }
.new-order-summary-total strong { color:var(--brand); font-size:19px; }
.new-order-summary-advance { background:#edf7f1; border-radius:9px; border-left:0 !important; margin-left:12px; padding:8px 12px !important; }
.new-order-summary-advance strong { color:var(--brand); }
.new-order-summary-advance small { margin-top:2px; color:var(--muted); font-size:8.5px; }

@media (max-width: 1100px) {
  .selected-customer-card { grid-template-columns:1fr; }
  .selected-customer-side { align-items:flex-start; padding:14px 0 0; border-left:0; border-top:1px solid #cfddd5; text-align:left; }
  .new-order-summary-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px 0; }
  .new-order-summary-grid > div:nth-child(odd) { border-left:0; padding-left:0; }
  .new-order-summary-advance { margin-left:0; }
}

@media (max-width: 640px) {
  .section-row-head { align-items:flex-start; flex-direction:column; }
  .section-row-head .btn { width:100%; }
  .item-calculation { grid-template-columns:1fr; }
  .item-calculation > div + div { padding-top:9px; border-top:1px solid var(--border); }
  .new-order-summary-grid { grid-template-columns:1fr; }
  .new-order-summary-grid > div { padding:10px 0; border-left:0; border-top:1px solid var(--border); }
  .new-order-summary-grid > div:first-child { border-top:0; padding-top:0; }
  .new-order-summary-advance { margin:0; padding:10px 12px !important; }
}

/* Frontend v1.3 — comfortable typography and card-based order items */
:root {
  --text: #111814;
  --muted: #56635d;
  --border: #d6ddd7;
  --border-strong: #bdc8c1;
  --radius: 14px;
  --radius-lg: 20px;
}

body { font-size: 15px; line-height: 1.5; }
.sidebar { padding: 24px 18px 18px; }
.brand { gap: 13px; padding: 0 8px 27px; }
.brand-mark { width: 42px; height: 42px; border-radius: 0; font-size: 15px; }
.brand-title { font-size: 18px; }
.brand-sub { font-size: 12px; line-height: 1.35; }
.nav { gap: 5px; }
.nav-section { padding: 18px 12px 7px; font-size: 11px; }
.nav-link { min-height: 46px; padding: 11px 13px; font-size: 14px; border-radius: 11px; }
.nav-icon { width: 19px; height: 19px; }
.user-card { padding: 12px; border-radius: 13px; }
.user-name { font-size: 13px; }
.user-role { font-size: 11px; }

.topbar { height: 74px; padding: 0 32px; }
.page-kicker { font-size: 12px; }
.page-title { font-size: 21px; }
.global-search { width: 280px; }
.global-search input { height: 40px; border-radius: 11px; padding-left: 36px; font-size: 13px; }
.global-search svg { top: 11px; }
.icon-button { width: 40px; height: 40px; border-radius: 11px; }

.content { padding: 30px 34px 58px; max-width: 1700px; }
.page-head { margin-bottom: 25px; }
.page-head h1 { font-size: 31px; line-height: 1.12; }
.page-head p { margin-top: 9px; font-size: 15px; line-height: 1.6; }
.btn { height: 42px; padding: 0 17px; border-radius: 10px; font-size: 14px; }
.btn-sm { height: 35px; padding: 0 12px; font-size: 12px; }

.metric-card { padding: 20px; min-height: 132px; }
.metric-label { font-size: 13px; }
.metric-value { margin-top: 15px; font-size: 29px; }
.metric-foot { padding-top: 8px; font-size: 12px; line-height: 1.45; }
.metric-icon { width: 35px; height: 35px; }

.panel { border-color: var(--border); }
.panel-head { min-height: 62px; padding: 0 20px; }
.panel-title { font-size: 15px; }
.panel-subtitle { font-size: 12px; }
.panel-link { font-size: 13px; }
.panel-body { padding: 20px; }

th { height: 46px; padding: 0 16px; color: #5d6a63; font-size: 11px; letter-spacing: .045em; }
td { padding: 15px 16px; font-size: 14px; }
.cell-main { font-size: 14px; }
.cell-sub { margin-top: 4px; color: #627069; font-size: 12px; }
.status { min-height: 27px; padding: 4px 10px; font-size: 12px; }

.section-title { font-size: 17px; }
.section-help { font-size: 12px; line-height: 1.55; }
.form-card { padding: 24px; }
.form-section + .form-section { margin-top: 24px; padding-top: 24px; }
.form-grid { gap: 15px; }
label { margin-bottom: 7px; color: #4d5b54; font-size: 12px; }
.input, textarea.input, select.input { min-height: 45px; padding: 11px 13px; border-radius: 10px; font-size: 14px; }
textarea.input { min-height: 92px; }
.helper { margin-top: 6px; font-size: 11px; }
.item-row-editor { padding: 18px; border-radius: 13px; margin-bottom: 14px; }
.item-row-editor-head { margin-bottom: 15px; }
.item-row-editor-title { font-size: 14px; }
.calculation-hint { font-size: 11px; }
.item-calculation { padding: 14px 16px; }
.item-calculation span { font-size: 12px; }
.item-calculation strong { font-size: 14px; }
.new-order-summary { padding: 21px; }
.new-order-summary-title { font-size: 16px; }
.new-order-summary-grid span { font-size: 11px; }
.new-order-summary-grid strong { font-size: 19px; }
.new-order-summary-total strong { font-size: 23px; }
.new-order-summary-advance small { font-size: 10px; }

.detail-layout { grid-template-columns: minmax(0, 1.6fr) minmax(310px, .55fr); gap: 20px; }
.detail-hero { padding: 25px; margin-bottom: 20px; }
.order-number { font-size: 13px; }
.order-customer { margin-top: 7px; font-size: 27px; }
.order-contact { margin-top: 7px; font-size: 13px; line-height: 1.5; }
.hero-stats { margin-top: 25px; padding-top: 18px; }
.hero-label { font-size: 11px; }
.hero-value { margin-top: 6px; font-size: 20px; }
.side-stack { gap: 20px; }
.stat-line { padding: 11px 0; font-size: 13px; }
.api-hint { padding: 14px 15px; color: #54625b; font-size: 12px; line-height: 1.6; }
.timeline-row { grid-template-columns: 18px 1fr; gap: 12px; padding-bottom: 18px; }
.timeline-row:not(:last-child)::before { left: 8px; top: 15px; }
.timeline-dot { width: 17px; height: 17px; }
.timeline-title { font-size: 13px; }
.timeline-meta, .timeline-details { font-size: 11px; line-height: 1.5; }
.list-cards { gap: 12px; }
.list-card { padding: 17px; border-radius: 12px; }
.list-card-title { font-size: 14px; }
.list-card-meta { margin-top: 5px; font-size: 12px; }
.list-card-note { margin-top: 7px; font-size: 11.5px; }

.order-product-list { display: grid; gap: 15px; padding: 20px; }
.order-product-card { padding: 19px; border: 1px solid var(--border); border-radius: 15px; background: #fff; box-shadow: 0 1px 1px rgba(18,31,26,.025); }
.order-product-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.order-product-title-wrap { min-width: 0; }
.order-product-title { color: var(--text); font-size: 17px; font-weight: 760; letter-spacing: -.02em; }
.order-product-meta { margin-top: 5px; color: #5c6962; font-size: 12px; line-height: 1.5; }
.order-product-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 17px; overflow: hidden; border: 1px solid #e0e6e1; border-radius: 12px; background: #f7f9f6; }
.order-product-metric { min-width: 0; padding: 14px 16px; }
.order-product-metric:nth-child(3n+2), .order-product-metric:nth-child(3n+3) { border-left: 1px solid #dde4de; }
.order-product-metric:nth-child(n+4) { border-top: 1px solid #dde4de; }
.order-product-metric span { display: block; color: #5d6a63; font-size: 11px; font-weight: 650; letter-spacing: .025em; text-transform: uppercase; }
.order-product-metric strong { display: block; margin-top: 6px; color: #17201c; font-size: 16px; font-weight: 760; line-height: 1.25; overflow-wrap: anywhere; }
.order-product-total strong { color: var(--brand); font-size: 18px; }
.order-product-comment { display: grid; grid-template-columns: 120px minmax(0,1fr); gap: 14px; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--border-strong); }
.order-product-comment span { color: #5d6a63; font-size: 12px; }
.order-product-comment strong { font-size: 13px; font-weight: 600; }

.selected-customer-card { padding: 20px; }
.selected-customer-eyebrow { font-size: 11px; }
.selected-customer-name { margin-top: 7px; font-size: 20px; }
.selected-customer-meta { margin-top: 7px; font-size: 12px; }
.selected-customer-note { margin-top: 10px; font-size: 11.5px; }
.selected-customer-balance-label { font-size: 11px; }
.selected-customer-balance-value { font-size: 27px; }
.selected-customer-balance-help { font-size: 11px; }

@media (max-width: 1460px) {
  .detail-layout { grid-template-columns: 1fr; }
  .side-stack { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .side-stack > .panel:last-child { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  .topbar { height: 68px; padding: 0 18px; }
  .content { padding: 24px 18px 44px; }
  .page-head h1 { font-size: 27px; }
  .order-product-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .order-product-metric:nth-child(3n+2), .order-product-metric:nth-child(3n+3) { border-left: 0; }
  .order-product-metric:nth-child(2n) { border-left: 1px solid #dde4de; }
  .order-product-metric:nth-child(n+3) { border-top: 1px solid #dde4de; }
}

@media (max-width: 700px) {
  .side-stack { grid-template-columns: 1fr; }
  .side-stack > .panel:last-child { grid-column: auto; }
  .order-product-head { flex-direction: column; align-items: flex-start; }
  .order-product-metrics { grid-template-columns: 1fr; }
  .order-product-metric, .order-product-metric:nth-child(n) { border-left: 0; }
  .order-product-metric:nth-child(n+2) { border-top: 1px solid #dde4de; }
  .order-product-comment { grid-template-columns: 1fr; gap: 4px; }
}


/* Frontend v1.4 — dashboard finance semantics and quiet sidebar scrolling */
.nav {
  flex: 1 1 auto;
  min-height: 0;
  overscroll-behavior: contain;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.nav::-webkit-scrollbar { width: 0; height: 0; display: none; }

@media (max-height: 900px) and (min-width: 901px) {
  .sidebar { padding-top: 16px; padding-bottom: 12px; }
  .brand { padding-bottom: 14px; }
  .nav-section { padding-top: 10px; padding-bottom: 5px; }
  .nav-link { min-height: 40px; padding-top: 8px; padding-bottom: 8px; }
  .sidebar-footer { padding-top: 10px; }
  .user-card { padding: 10px; }
}

/* Frontend v1.5 — actionable dashboard filters and draft deletion */
.metric-card-link {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  position: relative;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.metric-card-link:hover {
  color: inherit;
  transform: translateY(-2px);
  border-color: #b8c9bf;
  box-shadow: 0 10px 26px rgba(22, 42, 33, .09);
}
.metric-card-link:focus-visible {
  outline: 3px solid rgba(30, 104, 77, .22);
  outline-offset: 3px;
}
.metric-card-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 12px;
  color: var(--brand);
  font-size: 11.5px;
  font-weight: 720;
}
.metric-card-action svg { flex: 0 0 auto; }
.orders-view-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
  padding: 15px 17px;
  border: 1px solid #cbdcd3;
  border-radius: 12px;
  background: #f2f8f4;
}
.orders-view-banner strong {
  display: block;
  color: var(--brand);
  font-size: 13px;
}
.orders-view-banner span {
  display: block;
  margin-top: 4px;
  color: #53615b;
  font-size: 12px;
  line-height: 1.45;
}
.orders-view-reset {
  flex: 0 0 auto;
  color: var(--brand);
  font-size: 12px;
  font-weight: 720;
  text-decoration: none;
}
.orders-view-reset:hover { text-decoration: underline; }
.retention-notice {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid #d8c69f;
  border-radius: 12px;
  background: #fff9ed;
  color: #66532c;
}
.retention-notice svg { flex: 0 0 auto; margin-top: 1px; }
.retention-notice strong { display: block; font-size: 12.5px; }
.retention-notice span { display: block; margin-top: 4px; font-size: 11.5px; line-height: 1.45; }
.retention-cell { display: flex; align-items: center; justify-content: flex-end; gap: 10px; min-width: 210px; }
.retention-cell > span { color: var(--muted); font-size: 11px; font-weight: 650; white-space: nowrap; }
.input-readonly { cursor: default; }
.action-list .btn-danger {
  margin-top: 6px;
  border-color: #e3b4b0;
  background: #fffafa;
  color: var(--danger);
}
.action-list .btn-danger:hover {
  border-color: #cc8e88;
  background: #fdf0ef;
}

@media (max-width: 700px) {
  .orders-view-banner { align-items: flex-start; flex-direction: column; }
  .orders-view-reset { width: 100%; }
  .retention-cell { align-items: flex-start; flex-direction: column; min-width: 150px; }
  .retention-cell .btn { width: 100%; }
}

/* Frontend v1.6 — advance checkout, split payments and print actions */
.modal-wide { width: min(980px, 100%); }
.checkout-overview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.checkout-overview > div {
  padding: 15px 17px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
}
.checkout-overview span,
.checkout-totals span {
  display: block;
  color: #59675f;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .025em;
  text-transform: uppercase;
}
.checkout-overview strong {
  display: block;
  margin-top: 7px;
  color: var(--text);
  font-size: 22px;
}
.advance-application {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(210px, .7fr);
  gap: 18px;
  align-items: center;
  margin-bottom: 20px;
  padding: 16px;
  border: 1px solid #bcd5c8;
  border-radius: 13px;
  background: #f0f8f4;
}
.advance-switch {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0;
  cursor: pointer;
}
.advance-switch input {
  width: 19px;
  height: 19px;
  margin: 1px 0 0;
  accent-color: var(--brand);
}
.advance-switch strong,
.advance-switch small { display: block; }
.advance-switch strong { color: var(--text); font-size: 14px; }
.advance-switch small { margin-top: 5px; color: #5d6b64; font-size: 11.5px; line-height: 1.45; }
.payment-split-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 4px 0 10px;
}
.payment-split-head strong,
.payment-split-head span { display: block; }
.payment-split-head strong { font-size: 15px; }
.payment-split-head span { margin-top: 4px; color: var(--muted); font-size: 11.5px; }
.payment-split { display: grid; gap: 10px; }
.payment-split-row {
  display: grid;
  grid-template-columns: minmax(130px, .7fr) minmax(150px, .8fr) minmax(220px, 1.3fr) 42px;
  gap: 11px;
  align-items: end;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fbfcfb;
}
.payment-row-remove { align-self: end; color: var(--danger); }
.checkout-totals {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-top: 17px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
}
.checkout-totals > div { min-width: 0; padding: 13px 14px; }
.checkout-totals > div + div { border-left: 1px solid var(--border); }
.checkout-totals strong { display: block; margin-top: 6px; font-size: 16px; overflow-wrap: anywhere; }
.checkout-warning {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 9px;
  background: var(--brand-soft);
  color: var(--brand-2);
  font-size: 12px;
  font-weight: 650;
}
.checkout-warning.is-error { background: var(--danger-soft); color: var(--danger); }
.checkout-comment { margin-top: 18px; }
.list-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  flex-wrap: wrap;
  text-align: right;
}
.list-card-actions .btn { flex: 0 0 auto; }

@media (max-width: 800px) {
  .advance-application { grid-template-columns: 1fr; }
  .payment-split-row { grid-template-columns: 1fr 1fr; }
  .payment-split-row .field:nth-child(3) { grid-column: 1 / -1; }
  .payment-row-remove { grid-column: 2; justify-self: end; }
  .checkout-totals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .checkout-totals > div + div { border-left: 0; }
  .checkout-totals > div:nth-child(even) { border-left: 1px solid var(--border); }
  .checkout-totals > div:nth-child(n+3) { border-top: 1px solid var(--border); }
}

@media (max-width: 560px) {
  .checkout-overview { grid-template-columns: 1fr; }
  .payment-split-head { align-items: flex-start; flex-direction: column; }
  .payment-split-head .btn { width: 100%; }
  .payment-split-row { grid-template-columns: 1fr; }
  .payment-split-row .field:nth-child(3), .payment-row-remove { grid-column: auto; }
  .payment-row-remove { justify-self: end; }
  .checkout-totals { grid-template-columns: 1fr; }
  .checkout-totals > div:nth-child(n) { border-left: 0; border-top: 1px solid var(--border); }
  .checkout-totals > div:first-child { border-top: 0; }
  .list-card { grid-template-columns: 1fr; }
  .list-card-actions { justify-content: flex-start; text-align: left; }
}

/* Frontend v1.7 — procurement, receiving and stock operations */
.procurement-summary { margin-bottom: 20px; }
.procurement-groups, .supplier-order-list { display: grid; gap: 18px; margin-top: 20px; }
.procurement-order-card, .supplier-order-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.procurement-order-head, .supplier-order-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--border);
}
.procurement-order-number, .supplier-order-title { color: var(--text); font-size: 18px; font-weight: 780; line-height: 1.25; }
.procurement-order-customer, .supplier-order-sub { margin-top: 6px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.procurement-items, .supplier-items { display: grid; }
.procurement-item {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(440px, 1.35fr);
  gap: 20px;
  align-items: center;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}
.procurement-item:last-child { border-bottom: 0; }
.procurement-item-main strong, .supplier-item-row strong { display: block; color: var(--text); font-size: 15px; line-height: 1.35; }
.procurement-item-main span, .supplier-item-row span { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.procurement-quantities { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface-soft, #f7f9f6); }
.procurement-quantities > div { min-width: 0; padding: 12px 14px; }
.procurement-quantities > div + div { border-left: 1px solid var(--border); }
.procurement-quantities span { display: block; color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.procurement-quantities strong { display: block; margin-top: 6px; color: var(--text); font-size: 15px; }
.procurement-quantities .procurement-need { background: var(--warning-soft); }
.procurement-quantities .procurement-need strong { color: var(--warning); }
.procurement-order-foot { display: flex; align-items: center; gap: 20px; padding: 12px 22px; border-top: 1px solid var(--border); background: #fafbf9; color: var(--muted); font-size: 12px; }

.modal-section-title { color: var(--text); font-size: 14px; font-weight: 760; padding-top: 6px; }
.modal-procurement-list { display: grid; gap: 12px; }
.modal-procurement-item {
  display: grid;
  grid-template-columns: minmax(210px, 1.2fr) minmax(130px, .45fr) minmax(190px, .8fr);
  gap: 12px;
  align-items: end;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f9faf8;
}
.modal-procurement-item.order-supplier-item { grid-template-columns: minmax(0, 1fr) minmax(130px, .35fr); }
.modal-procurement-item.receive-item { grid-template-columns: minmax(190px, 1fr) repeat(3, minmax(125px, .55fr)); }
.modal-procurement-item > div:first-of-type { align-self: center; }
.modal-procurement-item strong { display: block; font-size: 14px; line-height: 1.35; }
.modal-procurement-item span { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.modal-procurement-item-main { min-width: 0; }
.modal-procurement-quantities { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); margin-top:12px; overflow:hidden; border:1px solid var(--border); border-radius:10px; background:#fff; }
.modal-procurement-quantities > div { min-width:0; padding:10px 11px; }
.modal-procurement-quantities > div + div { border-left:1px solid var(--border); }
.modal-procurement-quantities span { margin:0; font-size:9px; font-weight:750; text-transform:uppercase; letter-spacing:.035em; }
.modal-procurement-quantities strong { margin-top:5px; font-size:12px; overflow-wrap:anywhere; }
.modal-procurement-quantities > div:last-child { background:var(--warning-soft); }
.modal-procurement-quantities > div:last-child strong { color:var(--warning); }
.receiving-note { padding: 13px 15px; border: 1px solid #cfe2d8; border-radius: 11px; background: var(--brand-soft); color: var(--brand); font-size: 12px; line-height: 1.5; }

.supplier-progress-row { display: flex; align-items: center; gap: 12px; padding: 16px 22px 4px; }
.supplier-progress-row strong { min-width: 42px; color: var(--brand); font-size: 13px; text-align: right; }
.progress-track { flex: 1; height: 8px; overflow: hidden; border-radius: 99px; background: #e7ece8; }
.progress-value { height: 100%; border-radius: inherit; background: var(--brand); transition: width .25s ease; }
.supplier-items { padding: 8px 22px 2px; }
.supplier-item-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) repeat(3, minmax(90px, .35fr));
  gap: 14px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.supplier-item-row:last-child { border-bottom: 0; }
.supplier-item-row > div:not(:first-child) span { margin-top: 0; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.supplier-item-row > div:not(:first-child) strong { margin-top: 5px; }
.supplier-order-actions { display: flex; justify-content: flex-end; gap: 9px; padding: 16px 22px 20px; }

.stock-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(340px, .75fr); gap: 20px; margin-top: 20px; align-items: start; }
.stock-card-list { display: grid; gap: 13px; padding: 18px; }
.stock-balance-card { padding: 17px; border: 1px solid var(--border); border-radius: 13px; background: #fff; }
.stock-balance-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.stock-balance-head strong { display: block; font-size: 15px; line-height: 1.35; }
.stock-balance-head span { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.stock-state-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 14px; overflow: hidden; border: 1px solid var(--border); border-radius: 11px; background: #f8faf7; }
.stock-state-grid > div { padding: 12px 13px; }
.stock-state-grid > div:nth-child(3n+2), .stock-state-grid > div:nth-child(3n+3) { border-left: 1px solid var(--border); }
.stock-state-grid > div:nth-child(n+4) { border-top: 1px solid var(--border); }
.stock-state-grid span { display: block; color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .035em; }
.stock-state-grid strong { display: block; margin-top: 5px; font-size: 15px; }
.movement-list { max-height: 700px; overflow: auto; padding: 8px 18px 18px; }
.movement-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 11px; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--border); }
.movement-row:last-child { border-bottom: 0; }
.movement-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--brand-soft); color: var(--brand); }
.movement-main strong { display: block; font-size: 13px; line-height: 1.35; }
.movement-main span { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.movement-state { min-width: 120px; text-align: right; }
.movement-state span { display: block; color: var(--muted); font-size: 9.5px; }
.movement-state strong { display: block; margin-top: 5px; font-size: 14px; }

@media (max-width: 1180px) {
  .stock-layout { grid-template-columns: 1fr; }
  .procurement-item { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .procurement-order-head, .supplier-order-head { flex-direction: column; align-items: stretch; padding: 17px; }
  .procurement-order-head .inline-actions, .supplier-order-actions { flex-direction: column; }
  .procurement-order-head .btn, .supplier-order-actions .btn { width: 100%; }
  .procurement-item { padding: 16px 17px; }
  .procurement-quantities { grid-template-columns: 1fr; }
  .procurement-quantities > div + div { border-left: 0; border-top: 1px solid var(--border); }
  .procurement-order-foot { flex-direction: column; align-items: flex-start; gap: 5px; padding: 12px 17px; }
  .modal-procurement-item, .modal-procurement-item.order-supplier-item, .modal-procurement-item.receive-item { grid-template-columns: 1fr; }
  .supplier-items { padding-inline: 17px; }
  .supplier-item-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .supplier-item-row > div:first-child { grid-column: 1 / -1; }
  .supplier-order-actions { padding-inline: 17px; }
  .stock-state-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stock-state-grid > div:nth-child(3n+2), .stock-state-grid > div:nth-child(3n+3) { border-left: 0; }
  .stock-state-grid > div:nth-child(2n) { border-left: 1px solid var(--border); }
  .stock-state-grid > div:nth-child(n+3) { border-top: 1px solid var(--border); }
  .movement-row { grid-template-columns: 34px minmax(0, 1fr); }
  .movement-state { grid-column: 2; min-width: 0; text-align: left; }
}

@media (max-width: 700px) {
  .modal-backdrop { place-items:end center; padding:12px 0 0; }
  .modal, .modal-wide { width:100%; max-height:calc(100dvh - 12px); border-radius:18px 18px 0 0; }
  .modal-head { padding:16px; }
  .modal-body { padding:16px; }
  .modal-footer { padding:12px 16px calc(12px + env(safe-area-inset-bottom)); }
}

@media (max-width: 420px) {
  .modal-procurement-quantities { grid-template-columns:1fr; }
  .modal-procurement-quantities > div + div { border-top:1px solid var(--border); border-left:0; }
  .modal-footer { display:grid; grid-template-columns:1fr; }
  .modal-footer .btn { width:100%; }
}

@media (max-width: 480px) {
  .supplier-item-row { grid-template-columns: 1fr; }
  .supplier-item-row > div:first-child { grid-column: auto; }
  .stock-state-grid { grid-template-columns: 1fr; }
  .stock-state-grid > div:nth-child(n) { border-left: 0; border-top: 1px solid var(--border); }
  .stock-state-grid > div:first-child { border-top: 0; }
}
.form-grid > .span-12 { grid-column: 1 / -1; }

/* Frontend v1.8 — actionable supplier metrics and filtered supply registry */
.metric-card-link.is-selected {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(30, 104, 77, .12), 0 10px 26px rgba(22, 42, 33, .08);
}
.supplier-filter-context {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 18px;
  padding: 16px 20px;
  border: 1px solid #cfe2d8;
  border-radius: 14px;
  background: var(--brand-soft);
}
.supplier-filter-context strong {
  display: block;
  color: var(--brand);
  font-size: 14px;
  line-height: 1.35;
}
.supplier-filter-context span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.supplier-filter-context a {
  flex: 0 0 auto;
  color: var(--brand);
  font-size: 12px;
  font-weight: 750;
  text-decoration: none;
}
.supplier-filter-context a:hover { text-decoration: underline; }
.supplier-order-title-link {
  display: inline-flex;
  align-items: center;
  color: var(--text);
  text-decoration: none;
  transition: color .15s ease;
}
.supplier-order-title-link:hover { color: var(--brand); }
.supplier-order-title-link:focus-visible {
  outline: 3px solid rgba(30, 104, 77, .18);
  outline-offset: 4px;
  border-radius: 4px;
}
@media (max-width: 720px) {
  .supplier-filter-context { align-items: flex-start; flex-direction: column; }
  .supplier-filter-context a { align-self: stretch; padding-top: 2px; }
}

/* Frontend v1.9 — compact supplier registry with search and expandable rows */
.supplier-status-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}
.supplier-status-tab {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 66px;
  padding: 13px 16px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  color: var(--muted);
  text-decoration: none;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
.supplier-status-tab:hover { border-color: #aac8ba; transform: translateY(-1px); }
.supplier-status-tab.is-selected { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); box-shadow: 0 0 0 3px rgba(30, 104, 77, .08); }
.supplier-status-tab span { min-width: 0; font-size: 13px; font-weight: 730; }
.supplier-status-tab strong { flex: 0 0 auto; font-size: 24px; line-height: 1; color: var(--text); }
.supplier-status-tab.is-selected strong { color: var(--brand); }
.supplier-filter-context-compact { margin-top: 12px; padding: 11px 15px; border-radius: 11px; }
.supplier-filter-context-compact strong { font-size: 13px; }
.supplier-filter-context-compact span { margin-top: 2px; font-size: 11px; }
.supplier-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
}
.supplier-search {
  width: min(520px, 100%);
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
  color: var(--muted);
}
.supplier-search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(30, 104, 77, .1); }
.supplier-search input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 13px; }
.supplier-result-count { flex: 0 0 auto; color: var(--muted); font-size: 12px; }
.supplier-compact-table-head,
.supplier-compact-summary {
  display: grid;
  grid-template-columns: minmax(270px, 1.5fr) minmax(125px, .58fr) minmax(120px, .55fr) minmax(145px, .68fr) minmax(90px, .42fr) minmax(150px, .64fr);
  gap: 14px;
  align-items: center;
}
.supplier-compact-table-head {
  margin-top: 14px;
  padding: 0 17px 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 760;
  text-transform: uppercase;
  letter-spacing: .045em;
}
.supplier-compact-list {
  display: grid;
  gap: 9px;
}
.supplier-compact-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.supplier-compact-card[hidden] { display: none; }
.supplier-compact-summary {
  min-height: 78px;
  padding: 12px 16px;
  cursor: pointer;
  list-style: none;
  transition: background .15s ease;
}
.supplier-compact-summary::-webkit-details-marker { display: none; }
.supplier-compact-summary:hover { background: #fafcf9; }
.supplier-compact-card[open] .supplier-compact-summary { background: #f7faf7; border-bottom: 1px solid var(--border); }
.supplier-compact-identity { min-width: 0; }
.supplier-compact-identity strong { display: block; overflow: hidden; color: var(--text); font-size: 14px; font-weight: 780; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.supplier-compact-identity span { display: block; margin-top: 4px; overflow: hidden; color: var(--muted); font-size: 11px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.supplier-compact-order span,
.supplier-compact-date span,
.supplier-compact-progress span,
.supplier-compact-outstanding span { display: block; color: var(--muted); font-size: 9px; font-weight: 730; text-transform: uppercase; letter-spacing: .035em; }
.supplier-compact-order a { display: inline-block; margin-top: 5px; color: var(--brand); font-size: 13px; font-weight: 780; text-decoration: none; }
.supplier-compact-order a:hover { text-decoration: underline; }
.supplier-compact-date strong,
.supplier-compact-progress strong,
.supplier-compact-outstanding strong { display: block; margin-top: 5px; color: var(--text); font-size: 13px; line-height: 1.2; }
.supplier-compact-date small,
.supplier-compact-outstanding small { display: block; margin-top: 3px; color: var(--muted); font-size: 9.5px; }
.supplier-compact-outstanding.has-outstanding strong { color: var(--warning); }
.supplier-mini-progress { width: 100%; height: 5px; margin-top: 7px; overflow: hidden; border-radius: 99px; background: #e7ece8; }
.supplier-mini-progress span { height: 100%; display: block; border-radius: inherit; background: var(--brand); }
.supplier-compact-state { display: flex; align-items: center; justify-content: flex-end; gap: 10px; min-width: 0; }
.supplier-compact-state .status { white-space: nowrap; }
.supplier-expand-icon { display: grid; place-items: center; color: var(--muted); transition: transform .18s ease; }
.supplier-compact-card[open] .supplier-expand-icon { transform: rotate(90deg); }
.supplier-compact-details { background: #fcfdfb; }
.supplier-detail-head,
.supplier-detail-row {
  display: grid;
  grid-template-columns: minmax(260px, 1.4fr) repeat(4, minmax(100px, .55fr));
  gap: 14px;
  align-items: center;
}
.supplier-detail-head { padding: 10px 16px 7px; color: var(--muted); font-size: 9px; font-weight: 760; text-transform: uppercase; letter-spacing: .04em; }
.supplier-detail-row { padding: 10px 16px; border-top: 1px solid var(--border); }
.supplier-detail-row strong { display: block; color: var(--text); font-size: 12.5px; line-height: 1.3; }
.supplier-detail-row span { display: block; color: var(--muted); font-size: 9.5px; line-height: 1.35; }
.supplier-detail-product strong { font-size: 13px; }
.supplier-detail-product span { margin-top: 3px; }
.supplier-compact-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 11px 16px 13px; border-top: 1px solid var(--border); background: var(--surface); }
.supplier-compact-note { min-width: 0; overflow: hidden; color: var(--muted); font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }
.supplier-search-empty { margin-top: 12px; }

@media (max-width: 1180px) {
  .supplier-compact-table-head,
  .supplier-compact-summary { grid-template-columns: minmax(260px, 1.55fr) minmax(120px, .62fr) minmax(125px, .62fr) minmax(105px, .48fr) minmax(145px, .7fr); }
  .supplier-compact-table-head > :nth-child(3),
  .supplier-compact-date { display: none; }
}
@media (max-width: 860px) {
  .supplier-status-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .supplier-compact-table-head { display: none; }
  .supplier-compact-summary {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 14px;
    min-height: 0;
    padding: 14px;
  }
  .supplier-compact-identity { grid-column: 1; }
  .supplier-compact-state { grid-column: 2; grid-row: 1; }
  .supplier-compact-order,
  .supplier-compact-date,
  .supplier-compact-progress,
  .supplier-compact-outstanding { display: block; }
  .supplier-compact-order { grid-column: 1; }
  .supplier-compact-date { grid-column: 2; text-align: right; }
  .supplier-compact-progress { grid-column: 1; }
  .supplier-compact-outstanding { grid-column: 2; text-align: right; }
  .supplier-detail-head { display: none; }
  .supplier-detail-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 13px 14px; }
  .supplier-detail-product { grid-column: 1 / -1; }
  .supplier-compact-actions { align-items: stretch; flex-direction: column; }
  .supplier-compact-note { white-space: normal; }
  .supplier-compact-actions .inline-actions { width: 100%; }
  .supplier-compact-actions .btn { flex: 1; }
}
@media (max-width: 560px) {
  .supplier-status-tabs { gap: 8px; }
  .supplier-status-tab { min-height: 58px; padding: 11px 13px; }
  .supplier-status-tab strong { font-size: 21px; }
  .supplier-toolbar { align-items: stretch; flex-direction: column; }
  .supplier-search { width: 100%; }
  .supplier-result-count { align-self: flex-end; }
  .supplier-compact-summary { grid-template-columns: 1fr; }
  .supplier-compact-state,
  .supplier-compact-order,
  .supplier-compact-date,
  .supplier-compact-progress,
  .supplier-compact-outstanding { grid-column: 1; text-align: left; }
  .supplier-compact-state { grid-row: auto; justify-content: space-between; }
  .supplier-compact-order,
  .supplier-compact-date,
  .supplier-compact-progress,
  .supplier-compact-outstanding { display: grid; grid-template-columns: 105px minmax(0, 1fr); align-items: center; gap: 8px; }
  .supplier-compact-order a,
  .supplier-compact-date strong,
  .supplier-compact-progress strong,
  .supplier-compact-outstanding strong { margin-top: 0; }
  .supplier-mini-progress { grid-column: 1 / -1; }
  .supplier-detail-row { grid-template-columns: 1fr; }
  .supplier-detail-product { grid-column: auto; }
  .supplier-compact-actions .inline-actions { flex-direction: column; }
  .supplier-compact-actions .btn { width: 100%; }
}


/* Frontend v2.0 — reservation, waybills and issue workflow */
.fulfillment-flow { display:grid; grid-template-columns:repeat(var(--fulfillment-columns,4),minmax(0,1fr)); border:1px solid var(--border); border-radius:14px; overflow:hidden; background:#f8faf8; }
.fulfillment-step { position:relative; display:flex; align-items:center; gap:11px; min-height:76px; padding:14px 15px; color:var(--muted); text-decoration:none; }
.fulfillment-step + .fulfillment-step { border-left:1px solid var(--border); }
.fulfillment-step-number { display:grid; place-items:center; width:30px; height:30px; flex:0 0 auto; border-radius:50%; background:#e9ede9; color:#77827c; font-size:12px; font-weight:800; }
.fulfillment-step span { display:block; font-size:10px; font-weight:720; text-transform:uppercase; letter-spacing:.035em; }
.fulfillment-step strong { display:block; margin-top:5px; color:var(--text); font-size:13px; }
.fulfillment-step small { display:block; margin-top:4px; color:var(--muted); font-size:9px; line-height:1.35; text-transform:none; letter-spacing:0; }
.fulfillment-step.is-storage { background:#f7f5ff; color:#6d4ea2; }
.fulfillment-step.is-storage .fulfillment-step-number { background:#e9e2fb; color:#6d4ea2; }
.fulfillment-step.is-storage.is-current { box-shadow:inset 0 -3px 0 #8b6bb7; }
.fulfillment-step[href]:hover { background:#f3f7f4; }
.fulfillment-step.is-done { background:#f0f7f3; color:var(--success); }
.fulfillment-step.is-done .fulfillment-step-number { background:var(--success); color:#fff; }
.fulfillment-step.is-current { background:#fff8ed; color:var(--warning); }
.fulfillment-step.is-current .fulfillment-step-number { background:var(--warning-soft); color:var(--warning); box-shadow:0 0 0 3px rgba(154,106,32,.08); }
.reservation-list { display:grid; gap:9px; }
.reservation-row { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:12px 14px; border:1px solid var(--border); border-radius:10px; background:#fbfcfa; }
.reservation-row strong { display:block; font-size:12px; }
.reservation-row span:not(.status) { display:block; margin-top:4px; color:var(--muted); font-size:10px; }
.fulfillment-modal-note { margin-bottom:14px; padding:12px 14px; border:1px solid #cfe0d6; border-radius:10px; background:#f2f8f4; color:#315a49; font-size:11px; line-height:1.55; }
.fulfillment-item-list { display:grid; gap:10px; margin:12px 0 16px; }
.fulfillment-item-row { display:grid; grid-template-columns:minmax(220px,1fr) minmax(170px,.42fr); gap:16px; align-items:end; padding:14px; border:1px solid var(--border); border-radius:11px; background:#fbfcfa; }
.fulfillment-item-main { align-self:center; min-width:0; }
.fulfillment-item-main strong { display:block; font-size:13px; }
.fulfillment-item-main span { display:block; margin-top:5px; color:var(--muted); font-size:10px; line-height:1.45; }
.fulfillment-summary-strip { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:0; margin-bottom:16px; border:1px solid var(--border); border-radius:11px; overflow:hidden; background:#f7f9f6; }
.fulfillment-summary-strip > div { min-width:0; padding:13px 14px; }
.fulfillment-summary-strip > div + div { border-left:1px solid var(--border); }
.fulfillment-summary-strip span { display:block; color:var(--muted); font-size:9px; font-weight:720; text-transform:uppercase; letter-spacing:.04em; }
.fulfillment-summary-strip strong { display:block; margin-top:5px; overflow-wrap:anywhere; font-size:13px; }
.checkbox-line { display:flex !important; align-items:center; gap:9px; min-height:38px; padding:9px 11px; border:1px solid var(--border); border-radius:9px; background:#fafbf9; color:var(--text) !important; font-size:11px !important; font-weight:650 !important; text-transform:none !important; letter-spacing:0 !important; }
.checkbox-line input { width:16px; height:16px; accent-color:var(--brand); }
.waybill-order-card .list-card-actions { max-width:70%; }
.waybill-metrics { margin-bottom:16px; }
.waybill-filter-card { border:1px solid var(--border); text-align:left; color:inherit; cursor:pointer; }
.waybill-filter-card:hover { border-color:#a9beb3; transform:translateY(-1px); }
.waybill-toolbar { display:grid; grid-template-columns:minmax(260px,520px) 240px auto; gap:10px; align-items:center; margin:0 0 12px; }
.waybill-toolbar .supplier-search { margin:0; }
.waybill-toolbar > span { justify-self:end; color:var(--muted); font-size:11px; }
.waybill-registry-list { display:grid; gap:9px; }
.waybill-registry-card { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:16px; align-items:center; padding:13px 15px; border:1px solid var(--border); border-radius:12px; background:#fff; box-shadow:var(--shadow-sm); }
.waybill-registry-card[hidden] { display:none; }
.waybill-registry-main { display:grid; grid-template-columns:minmax(190px,1.2fr) minmax(100px,.65fr) minmax(150px,.8fr) minmax(70px,.45fr) minmax(95px,.52fr) auto; gap:14px; align-items:center; min-width:0; }
.waybill-registry-main > div { min-width:0; }
.waybill-registry-main span { display:block; color:var(--muted); font-size:9px; text-transform:uppercase; letter-spacing:.035em; }
.waybill-registry-main strong { display:block; margin-top:4px; overflow:hidden; font-size:12px; text-overflow:ellipsis; white-space:nowrap; }
.waybill-registry-number strong { margin:0; color:var(--text); font-size:14px; }
.waybill-registry-number span { margin-top:4px; text-transform:none; letter-spacing:0; }
.waybill-registry-number a { color:var(--brand); font-weight:750; }
.waybill-registry-status { display:flex; justify-content:flex-end; }
.waybill-registry-actions { display:flex; align-items:center; justify-content:flex-end; gap:7px; flex-wrap:wrap; max-width:430px; }

@media (max-width:1250px) {
  .fulfillment-flow { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .fulfillment-step:nth-child(odd) { border-left:0; }
  .fulfillment-step:nth-child(n+3) { border-top:1px solid var(--border); }
  .waybill-registry-card { grid-template-columns:1fr; }
  .waybill-registry-actions { max-width:none; justify-content:flex-start; }
  .waybill-registry-main { grid-template-columns:minmax(210px,1.2fr) repeat(4,minmax(90px,.6fr)) auto; }
}
@media (max-width:900px) {
  .fulfillment-item-row { grid-template-columns:1fr; }
  .fulfillment-summary-strip { grid-template-columns:1fr; }
  .fulfillment-summary-strip > div + div { border-left:0; border-top:1px solid var(--border); }
  .waybill-toolbar { grid-template-columns:1fr; }
  .waybill-toolbar > span { justify-self:start; }
  .waybill-registry-main { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .waybill-registry-number { grid-column:1 / -1; }
  .waybill-registry-status { justify-content:flex-start; }
  .waybill-order-card .list-card-actions { max-width:none; }
}
@media (max-width:560px) {
  .fulfillment-flow { grid-template-columns:1fr; }
  .fulfillment-step + .fulfillment-step { border-left:0; border-top:1px solid var(--border); }
  .waybill-registry-main { grid-template-columns:1fr; }
  .waybill-registry-actions { flex-direction:column; align-items:stretch; }
  .waybill-registry-actions .btn { width:100%; }
  .reservation-row { align-items:flex-start; flex-direction:column; }
}


/* Frontend v3.0 — global operations */
.autocomplete-wrap { position:relative; }
.search-input-shell { position:relative; }
.search-input-shell svg { position:absolute; left:12px; top:12px; color:var(--muted); z-index:2; }
.search-input-shell .input { padding-left:38px; }
.autocomplete-menu { position:absolute; z-index:90; top:calc(100% + 6px); left:0; right:0; max-height:330px; overflow:auto; background:#fff; border:1px solid var(--border-strong); border-radius:12px; box-shadow:0 18px 50px rgba(24,48,38,.18); padding:6px; }
.autocomplete-option { width:100%; border:0; background:#fff; text-align:left; border-radius:9px; padding:10px 11px; display:grid; gap:3px; color:var(--text); }
.autocomplete-option:hover { background:var(--brand-soft); }
.autocomplete-primary { font-size:13px; font-weight:740; }
.autocomplete-secondary { font-size:11px; color:#56625c; }
.autocomplete-meta { font-size:10px; color:var(--muted); }
.autocomplete-empty { padding:14px; color:var(--muted); font-size:11px; line-height:1.45; }
.selected-customer-inline { margin:10px 0 14px; padding:12px; border-radius:10px; background:var(--brand-soft); border:1px solid #bfd7cc; display:flex; align-items:center; gap:10px; }
.selected-customer-inline strong { font-size:13px; }
.selected-customer-inline span { color:var(--muted); font-size:11px; flex:1; }
.last-price-hint { margin-top:6px; font-size:10px; color:#6d7772; line-height:1.35; }
.last-price-hint strong { color:var(--brand); }

.distribution-note { display:flex; flex-direction:column; gap:4px; padding:13px; border-radius:10px; background:#fff7ed; border:1px solid #fed7aa; margin-bottom:14px; }
.distribution-note strong { font-size:12px; }
.distribution-note span { font-size:10.5px; color:#7c6250; }
.distribution-list { display:grid; gap:12px; }
.distribution-item { border:1px solid var(--border); border-radius:12px; padding:14px; }
.distribution-item.has-error { border-color:#d66a61; box-shadow:0 0 0 3px rgba(177,61,51,.08); }
.distribution-item-head { display:flex; justify-content:space-between; gap:12px; align-items:flex-start; margin-bottom:12px; }
.distribution-item-head strong { display:block; font-size:13px; }
.distribution-item-head span { display:block; color:var(--muted); font-size:10px; margin-top:3px; }
.distribution-sum { font-size:10px; font-weight:700; color:var(--brand); }
.distribution-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; }
.distribution-grid label { margin:0; padding:10px; background:#f8faf7; border-radius:10px; }
.distribution-grid label span { display:block; min-height:30px; font-size:10px; font-weight:700; color:#50605a; }
.distribution-location { margin-top:10px; }
.storage-notification-fields { margin-top:14px; padding:14px; border-radius:12px; background:#f5f3ff; border:1px solid #ddd6fe; }
.distribution-registry { display:grid; gap:8px; padding:12px; }
.distribution-registry-card { display:grid; grid-template-columns:minmax(0,1fr) auto auto auto; gap:14px; align-items:center; padding:12px 14px; border:1px solid var(--border); border-radius:11px; background:#fff; }
.distribution-registry-card.is-pending { border-color:#e2bc6e; background:#fffdf6; }
.distribution-registry-title { font-size:12px; font-weight:730; }
.distribution-registry-meta { font-size:10px; color:var(--muted); margin-top:3px; }
.distribution-registry-count { font-size:11px; font-weight:700; }
.distribution-registry-actions { display:flex; gap:7px; }

.view-switch { display:flex; gap:7px; }
.supplier-group-toolbar { display:flex; align-items:center; gap:14px; margin:15px 0 10px; }
.supplier-group-toolbar .supplier-search { flex:1; max-width:520px; }
.supplier-group-toolbar > span { color:var(--muted); font-size:10px; margin-left:auto; }
.supplier-group-list { display:grid; gap:9px; }
.supplier-group-card { border:1px solid var(--border); background:#fff; border-radius:12px; box-shadow:var(--shadow-sm); overflow:hidden; }
.supplier-group-card.is-open { border-color:#9bb9ac; }
.supplier-group-summary { display:grid; grid-template-columns:minmax(230px,1.4fr) repeat(3,minmax(100px,.6fr)) minmax(150px,.8fr) 28px; gap:12px; align-items:center; padding:13px 15px; cursor:pointer; }
.supplier-group-summary:hover { background:#fafbf9; }
.supplier-group-summary > div > span { display:block; font-size:9.5px; color:var(--muted); margin-bottom:3px; }
.supplier-group-summary > div > strong { font-size:12px; }
.supplier-group-order strong { display:block; font-size:13px; }
.supplier-group-order span { display:block; font-size:10px; color:var(--muted); margin-top:3px; }
.supplier-group-chevron { color:var(--muted); transition:.2s; }
.supplier-group-card.is-open .supplier-group-chevron { transform:rotate(90deg); }
.supplier-group-details { border-top:1px solid var(--border); padding:13px 15px 15px; background:#fbfcfa; }
.supplier-group-products { display:grid; gap:7px; margin-bottom:13px; }
.supplier-group-product { display:grid; grid-template-columns:minmax(210px,1.4fr) repeat(5,minmax(85px,.55fr)); gap:9px; align-items:center; padding:10px 11px; background:#fff; border:1px solid #e9ece8; border-radius:9px; }
.supplier-group-product > div > span { display:block; font-size:9px; color:var(--muted); }
.supplier-group-product > div > strong { font-size:11px; }
.supplier-group-documents { display:grid; gap:6px; }
.supplier-group-document { display:grid; grid-template-columns:minmax(230px,1.3fr) 100px 140px auto; gap:10px; align-items:center; padding:9px 11px; border-left:3px solid #b7c8bf; background:#fff; border-radius:7px; }
.supplier-doc-main strong { display:block; font-size:11.5px; }
.supplier-doc-main span { display:block; font-size:9.5px; color:var(--muted); margin-top:3px; }
.supplier-group-document > div > span { display:block; font-size:9px; color:var(--muted); }
.supplier-group-document > div > strong { font-size:11px; }
.supplier-doc-actions { display:flex; justify-content:flex-end; }
.supplier-group-footer { display:flex; flex-wrap:wrap; gap:8px; margin-top:12px; }

.global-v3-tasks { margin:14px 0 16px; }
.global-task-row { display:grid; grid-template-columns:7px minmax(0,1fr) 22px; gap:12px; align-items:center; padding:12px 15px; border-bottom:1px solid var(--border); color:inherit; }
.global-task-row:last-child { border-bottom:0; }
.global-task-row:hover { background:#fafbf9; }
.global-task-row strong { display:block; font-size:11.5px; }
.global-task-row span { display:block; color:var(--muted); font-size:9.5px; margin-top:3px; }

.storage-list, .internal-purchase-list { display:grid; gap:10px; margin-top:16px; }
.storage-card, .internal-purchase-card { background:#fff; border:1px solid var(--border); border-radius:12px; box-shadow:var(--shadow-sm); padding:14px; }
.storage-card-head { display:flex; justify-content:space-between; gap:12px; align-items:flex-start; }
.storage-card-head strong { display:block; font-size:13px; }
.storage-card-head span { display:block; font-size:10px; color:var(--muted); margin-top:3px; }
.storage-timeline { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:8px; margin-top:12px; }
.storage-timeline > div { padding:9px; background:#f7f8f6; border-radius:8px; }
.storage-timeline span { display:block; font-size:9px; color:var(--muted); }
.storage-timeline strong { display:block; font-size:11px; margin-top:3px; }
.storage-actions { display:flex; flex-wrap:wrap; gap:7px; margin-top:12px; }
.storage-charges { border-top:1px solid var(--border); margin-top:12px; padding-top:8px; display:grid; gap:6px; }
.storage-charge-row { display:grid; grid-template-columns:minmax(0,1fr) auto 100px auto; align-items:center; gap:10px; padding:8px; background:#fbfcfa; border-radius:8px; }
.storage-charge-row strong { display:block; font-size:10.5px; }
.storage-charge-row span { display:block; font-size:9px; color:var(--muted); margin-top:2px; }

.internal-purchase-card { display:grid; grid-template-columns:minmax(220px,1.2fr) repeat(4,minmax(100px,.55fr)) auto; align-items:center; gap:11px; }
.internal-purchase-card > div > strong { display:block; font-size:11.5px; }
.internal-purchase-card > div > span { display:block; color:var(--muted); font-size:9.5px; margin-top:3px; }
.internal-item-editor { border:1px solid var(--border); border-radius:10px; padding:12px; margin-top:9px; }

.catalog-search-page { margin-top:12px; }
.catalog-big-search { position:relative; display:block; max-width:720px; }
.catalog-big-search svg { position:absolute; z-index:2; left:13px; top:11px; color:var(--muted); }
.catalog-big-search .input { padding-left:40px; height:44px; font-size:13px; }
.catalog-result-list { margin-top:15px; display:grid; gap:7px; }
.catalog-result-row { display:grid; grid-template-columns:minmax(240px,1.4fr) repeat(4,minmax(110px,.5fr)); gap:12px; align-items:center; padding:12px; border:1px solid var(--border); border-radius:10px; }
.catalog-result-row strong { display:block; font-size:11.5px; }
.catalog-result-row span { display:block; color:var(--muted); font-size:9.5px; margin-top:3px; }

@media (max-width: 1100px) {
  .distribution-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .supplier-group-summary { grid-template-columns:minmax(190px,1.4fr) repeat(2,minmax(90px,.6fr)) minmax(130px,.8fr) 28px; }
  .supplier-group-summary > div:nth-child(4) { display:none; }
  .supplier-group-product { grid-template-columns:minmax(180px,1.3fr) repeat(3,minmax(80px,.55fr)); }
  .supplier-group-product > div:nth-child(4), .supplier-group-product > div:nth-child(5) { display:none; }
  .storage-timeline { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .internal-purchase-card { grid-template-columns:minmax(200px,1.3fr) repeat(3,minmax(90px,.6fr)) auto; }
  .internal-purchase-card > div:nth-child(4) { display:none; }
}

@media (max-width: 720px) {
  .distribution-grid { grid-template-columns:1fr; }
  .distribution-registry-card { grid-template-columns:1fr auto; }
  .distribution-registry-card > :nth-child(3) { grid-column:1; }
  .supplier-group-summary { grid-template-columns:minmax(0,1fr) auto; }
  .supplier-group-summary > div:not(.supplier-group-order):not(.supplier-group-chevron) { display:none; }
  .supplier-group-product { grid-template-columns:1fr 1fr; }
  .supplier-group-product > div:first-child { grid-column:1/-1; }
  .supplier-group-document { grid-template-columns:1fr auto; }
  .supplier-group-document > div:nth-child(2) { display:none; }
  .supplier-group-footer { flex-direction:column; }
  .storage-timeline { grid-template-columns:1fr 1fr; }
  .storage-charge-row { grid-template-columns:1fr auto; }
  .internal-purchase-card { grid-template-columns:1fr auto; }
  .internal-purchase-card > div:not(:first-child):not(:last-child) { display:none; }
  .catalog-result-row { grid-template-columns:1fr 1fr; }
  .catalog-result-row > div:first-child { grid-column:1/-1; }
}

/* RC2 unified product-item stabilization */
.input.is-readonly {
  background:#f3f5f3;
  color:#435047;
  cursor:not-allowed;
}
.internal-purchase-products {
  margin-top:8px;
  color:#34463d;
  font-size:10.5px;
  line-height:1.55;
}
.internal-receive-item {
  grid-template-columns:minmax(230px,1.4fr) repeat(4,minmax(125px,.7fr));
  align-items:end;
}
.internal-receive-item > div:first-child small {
  display:block;
  margin-top:5px;
  color:var(--muted);
  font-size:9.5px;
}
.internal-receive-item .distribution-sum {
  grid-column:1/-1;
  padding-top:3px;
}
.internal-receive-item.has-error {
  border-color:#d66a61;
  box-shadow:0 0 0 3px rgba(177,61,51,.08);
}
@media (max-width:1100px) {
  .internal-receive-item { grid-template-columns:1fr 1fr; }
  .internal-receive-item > div:first-child { grid-column:1/-1; }
}
@media (max-width:720px) {
  .internal-receive-item { grid-template-columns:1fr; }
}


/* RC3 — shortage decisions and order execution visibility */
.panel-action-group { display:flex; align-items:center; justify-content:flex-end; gap:10px; flex-wrap:wrap; }
.order-supply-strip { display:grid; grid-template-columns:repeat(4,minmax(105px,1fr)) auto; gap:0; align-items:stretch; margin:0 14px 14px; border:1px solid var(--border); border-radius:11px; overflow:hidden; background:#f7f9f7; }
.order-supply-strip.has-alert { border-color:#e0bd7d; background:#fffaf1; }
.order-supply-strip > div { min-width:0; padding:11px 12px; }
.order-supply-strip > div + div { border-left:1px solid var(--border); }
.order-supply-strip span { display:block; color:var(--muted); font-size:9px; text-transform:uppercase; letter-spacing:.035em; }
.order-supply-strip strong { display:block; margin-top:5px; font-size:12px; overflow-wrap:anywhere; }
.order-supply-strip .btn { align-self:center; margin:9px; white-space:nowrap; }
.receiving-note { padding:13px 14px; border:1px solid #cfe0d6; border-radius:11px; background:#f2f8f4; color:#315a49; font-size:11px; line-height:1.55; }
.receive-shortage-item { display:grid; grid-template-columns:minmax(230px,1.2fr) repeat(2,minmax(150px,.55fr)); gap:12px; align-items:end; }
.receive-shortage-item.has-error { border-color:#d66a61; box-shadow:0 0 0 3px rgba(177,61,51,.08); }
.receive-item-title { align-self:center; min-width:0; }
.receive-item-title strong { display:block; font-size:13px; }
.receive-item-title span { display:block; margin-top:5px; color:var(--muted); font-size:10px; }
.receive-shortage-summary { grid-column:1 / -1; display:grid; grid-template-columns:auto auto minmax(220px,1fr); gap:10px; align-items:center; padding:10px 12px; border-radius:9px; background:#fff7ed; border:1px solid #fed7aa; }
.receive-shortage-summary span { color:#8b5e20; font-size:10px; font-weight:750; text-transform:uppercase; letter-spacing:.035em; }
.receive-shortage-summary strong { color:#9a6a20; font-size:13px; }
.receive-shortage-summary small { color:#7c6250; font-size:10px; line-height:1.4; }
.receive-shortage-resolution { grid-column:1 / -1; display:grid; grid-template-columns:minmax(260px,1fr) minmax(180px,.6fr); gap:12px; padding:12px; border:1px solid #e4c27e; border-radius:10px; background:#fffdf7; }
.receive-shortage-resolution[hidden] { display:none; }
.receive-shortage-resolution .field[hidden] { display:none; }
.supplier-doc-actions { gap:7px; flex-wrap:wrap; }
@media (max-width:1100px) {
  .order-supply-strip { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .order-supply-strip > div:nth-child(odd) { border-left:0; }
  .order-supply-strip > div:nth-child(n+3) { border-top:1px solid var(--border); }
  .order-supply-strip .btn { grid-column:1 / -1; justify-self:start; }
  .receive-shortage-item { grid-template-columns:1fr 1fr; }
  .receive-item-title { grid-column:1 / -1; }
}
@media (max-width:700px) {
  .order-supply-strip, .receive-shortage-item, .receive-shortage-resolution { grid-template-columns:1fr; }
  .order-supply-strip > div + div { border-left:0; border-top:1px solid var(--border); }
  .order-supply-strip .btn, .receive-item-title, .receive-shortage-summary, .receive-shortage-resolution { grid-column:auto; }
  .receive-shortage-summary { grid-template-columns:1fr; }
}

/* RC3 — interactive warehouse and physical product card */
.stock-filter-card { border:1px solid var(--border); text-align:left; color:inherit; cursor:pointer; transition:.16s ease; }
.stock-filter-card:hover, .stock-filter-card.is-active { border-color:#84aa98; box-shadow:0 0 0 3px rgba(28,101,74,.07); transform:translateY(-1px); }
.stock-toolbar { display:flex; align-items:center; gap:14px; margin:14px 0 12px; }
.stock-toolbar .supplier-search { flex:1; max-width:620px; }
.stock-toolbar > span { margin-left:auto; color:var(--muted); font-size:11px; }
.stock-balance-link { padding:0; overflow:hidden; }
.stock-balance-link[hidden] { display:none; }
.stock-card-anchor { display:block; padding:14px; color:inherit; text-decoration:none; }
.stock-card-anchor:hover { background:#fafcf9; }
.stock-open-label { display:flex; align-items:center; justify-content:flex-end; gap:5px; margin-top:10px; color:var(--brand); font-size:10px; font-weight:750; }
.stock-detail-state-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:0; padding:14px; }
.stock-detail-state-grid > div { min-width:0; padding:14px; border:1px solid var(--border); margin:-1px 0 0 -1px; background:#fbfcfa; }
.stock-detail-state-grid span { display:block; color:var(--muted); font-size:9px; text-transform:uppercase; letter-spacing:.035em; }
.stock-detail-state-grid strong { display:block; margin-top:6px; font-size:14px; }
.stock-detail-layout { display:grid; grid-template-columns:minmax(0,1.15fr) minmax(360px,.85fr); gap:14px; margin-top:14px; align-items:start; }
.stock-detail-list, .stock-order-list { display:grid; gap:8px; padding:12px; }
.stock-detail-row { display:grid; grid-template-columns:minmax(230px,1.4fr) minmax(120px,.45fr) minmax(150px,.55fr); gap:12px; align-items:center; padding:11px 12px; border:1px solid var(--border); border-radius:10px; background:#fff; }
.stock-detail-row > div { min-width:0; }
.stock-detail-row strong { display:block; font-size:11.5px; overflow-wrap:anywhere; }
.stock-detail-row span { display:block; margin-top:4px; color:var(--muted); font-size:9.5px; line-height:1.35; }
.stock-movement-detail { grid-template-columns:minmax(220px,1.35fr) minmax(190px,.8fr) minmax(100px,.4fr); }
.stock-history-list { max-height:790px; overflow:auto; }
.stock-order-link { display:grid; grid-template-columns:minmax(220px,1.3fr) repeat(3,minmax(90px,.45fr)) 20px; gap:10px; align-items:center; padding:12px; border:1px solid var(--border); border-radius:10px; color:inherit; text-decoration:none; background:#fff; }
.stock-order-link:hover { border-color:#a8c0b4; background:#fafcf9; }
.stock-order-link > div { min-width:0; }
.stock-order-link strong { display:block; font-size:12px; }
.stock-order-link span { display:block; margin-top:4px; color:var(--muted); font-size:9.5px; }
@media (max-width:1200px) {
  .stock-detail-state-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .stock-detail-layout { grid-template-columns:1fr; }
  .stock-history-list { max-height:none; }
}
@media (max-width:760px) {
  .stock-toolbar { align-items:stretch; flex-direction:column; }
  .stock-toolbar > span { margin-left:0; }
  .stock-detail-state-grid { grid-template-columns:1fr; }
  .stock-detail-row, .stock-movement-detail, .stock-order-link { grid-template-columns:1fr; }
}

/* RC4 — order orchestrator, safe revisions and door configuration builder */
.workflow-summary {
  padding: 14px;
  border: 1px solid #cfe0d6;
  border-radius: 12px;
  background: linear-gradient(145deg, #f5faf7, #edf6f1);
}
.workflow-summary span {
  display: block;
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.workflow-summary strong { display: block; margin-top: 6px; font-size: 16px; }
.workflow-summary p { margin: 7px 0 0; color: #4d6258; font-size: 10.5px; line-height: 1.5; }

.door-group-editor,
.door-order-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.door-group-editor + .door-group-editor,
.door-order-card + .door-order-card { margin-top: 14px; }
.door-group-head,
.door-order-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: #f7faf7;
}
.door-group-title { font-size: 14px; font-weight: 800; }
.door-order-head span { display: block; color: var(--muted); font-size: 9.5px; }
.door-order-head strong { display: block; margin-top: 4px; font-size: 14px; }
.door-order-head > div:last-child { text-align: right; }
.door-group-editor > .form-grid { padding: 14px 16px 0; }
.door-config-list,
.door-accessory-list { display: grid; gap: 10px; padding: 14px 16px; }
.door-config-row,
.door-accessory-row {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: #fbfcfa;
}
.door-config-head,
.section-row-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.door-config-head { margin-bottom: 10px; }
.door-config-head strong { font-size: 11px; }
.door-config-total,
.door-group-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 10px;
  padding: 9px 11px;
  border-radius: 9px;
  background: #eef5f0;
}
.door-config-total span,
.door-group-total span { color: var(--muted); font-size: 10px; }
.door-config-total strong,
.door-group-total strong { font-size: 12px; }
.door-group-total { margin: 0; padding: 13px 16px; border-radius: 0; border-top: 1px solid var(--border); }
.door-group-editor > [data-add-door-config] { margin: 0 16px 14px; }
.door-extras-toggle {
  display: grid;
  grid-template-columns: 20px 1fr;
  column-gap: 9px;
  row-gap: 2px;
  align-items: center;
  margin: 0 16px 14px;
  padding: 12px;
  border: 1px solid #d8e2db;
  border-radius: 11px;
  background: #f8faf8;
  cursor: pointer;
}
.door-extras-toggle input { width: 17px; height: 17px; margin: 0; }
.door-extras-toggle span { font-size: 11.5px; font-weight: 750; }
.door-extras-toggle small { grid-column: 2; color: var(--muted); font-size: 9.5px; line-height: 1.4; }
.door-accessory-section { margin: 0 16px 14px; border: 1px solid #e6d8c5; border-radius: 12px; background: #fffaf3; overflow: hidden; }
.door-accessory-section > .section-row-head { padding: 12px; border-bottom: 1px solid #eadfce; }
.door-accessory-actions { display: flex; justify-content: flex-end; padding: 0 16px 14px; }
.door-order-section { padding: 12px 14px; }
.door-order-section + .door-order-section { border-top: 1px solid var(--border); }
.door-order-subtitle { margin-bottom: 8px; color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.door-order-row {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(140px, auto) minmax(110px, auto);
  gap: 12px;
  align-items: center;
  padding: 11px 0;
}
.door-order-row + .door-order-row { border-top: 1px dashed var(--border); }
.door-order-row > div { min-width: 0; }
.door-order-row strong { display: block; font-size: 11.5px; overflow-wrap: anywhere; }
.door-order-row span { display: block; margin-top: 4px; color: var(--muted); font-size: 9.5px; }
.door-order-row > div:last-child { text-align: right; }
.door-order-row.accessory { padding-left: 10px; border-left: 3px solid #dfb884; }

.revision-impact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.revision-impact-grid > div {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fbfcfa;
}
.revision-impact-grid span { display: block; color: var(--muted); font-size: 9px; text-transform: uppercase; }
.revision-impact-grid strong { display: block; margin-top: 6px; font-size: 14px; }
.version-list { display: grid; gap: 8px; }
.version-row {
  display: grid;
  grid-template-columns: minmax(260px, 1.4fr) minmax(120px, .5fr) minmax(120px, .5fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.version-row strong { display: block; font-size: 12px; }
.version-row span { display: block; margin-top: 4px; color: var(--muted); font-size: 9.5px; }

@media (max-width: 900px) {
  .door-order-row { grid-template-columns: 1fr auto; }
  .door-order-row > div:first-child { grid-column: 1 / -1; }
  .revision-impact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .version-row { grid-template-columns: 1fr 1fr; }
  .version-row > div:first-child { grid-column: 1 / -1; }
}
@media (max-width: 620px) {
  .door-group-head,
  .door-order-head,
  .door-config-head,
  .section-row-head { flex-direction: column; align-items: stretch; }
  .door-order-head > div:last-child { text-align: left; }
  .door-order-row,
  .revision-impact-grid,
  .version-row { grid-template-columns: 1fr; }
  .door-order-row > div:first-child,
  .version-row > div:first-child { grid-column: auto; }
  .door-accessory-actions .btn { width: 100%; }
}


/* RC15 — mobile localization and compact operational layout */
@media (max-width: 640px) {
  .topbar { gap: 12px; padding-inline: 14px; }
  .topbar .breadcrumb { flex: 1 1 auto; min-width: 0; }
  .topbar .page-kicker { display: none; }
  .topbar .page-title { font-size: 16px; line-height: 1.2; }

  .detail-hero { padding: 18px 16px; }
  .detail-hero-top { gap: 10px; }
  .order-customer { font-size: 24px; line-height: 1.18; overflow-wrap: anywhere; }
  .order-contact { line-height: 1.45; }
  .detail-hero .hero-stats-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; }
  .detail-hero .hero-stats-6 .hero-stat,
  .detail-hero .hero-stats-6 .hero-stat:nth-child(n) {
    min-width: 0;
    padding: 12px 12px 0 0;
    border-top: 1px solid rgba(255,255,255,.15);
    border-left: 0;
  }
  .detail-hero .hero-stats-6 .hero-stat:nth-child(-n+2) {
    padding-top: 0;
    border-top: 0;
  }
  .detail-hero .hero-stats-6 .hero-stat:nth-child(even) {
    padding-right: 0;
    padding-left: 12px;
    border-left: 1px solid rgba(255,255,255,.15);
  }
  .detail-hero .hero-stats-6 .hero-value { font-size: 18px; overflow-wrap: anywhere; }

  .stock-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px;
  }
  .stock-filter-grid .stock-filter-card {
    min-height: 102px;
    padding: 14px;
  }
  .stock-filter-grid .stock-filter-card:last-child { grid-column: 1 / -1; }
  .stock-filter-grid .metric-label { font-size: 11px; line-height: 1.35; }
  .stock-filter-grid .metric-value { margin-top: 10px; font-size: 24px; }
  .stock-filter-grid .metric-foot { font-size: 10px; line-height: 1.4; }

  .form-footer > div { flex-direction: column; align-items: stretch; width: 100%; }
  .form-footer .btn { width: 100%; min-width: 0; white-space: normal; text-align: center; }
}


/* RC15 — clickable internal-purchase registry and purchase detail */
.internal-purchase-card {
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.internal-purchase-card:hover {
  transform: translateY(-1px);
  border-color: #b7c9bf;
  box-shadow: 0 8px 22px rgba(22,42,33,.08);
  background: #fcfdfb;
}
.internal-purchase-number-link {
  display: inline-flex;
  align-items: center;
  color: var(--text);
  font-size: 12px;
  font-weight: 780;
  line-height: 1.25;
  text-decoration: underline;
  text-decoration-color: #a9bbb1;
  text-underline-offset: 3px;
}
.internal-purchase-number-link:hover { color: var(--brand); text-decoration-color: var(--brand); }
.internal-purchase-number-link:focus-visible { outline: 3px solid rgba(30,104,77,.2); outline-offset: 3px; border-radius: 4px; }
.internal-purchase-card-actions { cursor: default; }
.internal-purchase-detail-summary { margin-bottom: 16px; }
.metric-value-text { font-size: 17px; line-height: 1.25; overflow-wrap: anywhere; }
.internal-purchase-detail-status { margin-top: 17px; min-height: 34px; display: flex; align-items: center; }
.internal-purchase-detail-layout { display: grid; grid-template-columns: minmax(0,1.45fr) minmax(300px,.55fr); gap: 16px; }
.internal-purchase-detail-list { display: grid; gap: 11px; padding: 16px; }
.internal-purchase-detail-item { padding: 15px; border: 1px solid var(--border); border-radius: 12px; background: #fff; }
.internal-purchase-detail-item-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.internal-purchase-detail-item-head strong { display: block; font-size: 14px; }
.internal-purchase-detail-item-head span { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.internal-purchase-detail-metrics { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); margin-top: 14px; overflow: hidden; border: 1px solid #e2e7e3; border-radius: 10px; background: #f8faf7; }
.internal-purchase-detail-metrics > div { min-width: 0; padding: 12px 13px; }
.internal-purchase-detail-metrics > div:nth-child(3n+2), .internal-purchase-detail-metrics > div:nth-child(3n+3) { border-left: 1px solid #e1e6e2; }
.internal-purchase-detail-metrics > div:nth-child(n+4) { border-top: 1px solid #e1e6e2; }
.internal-purchase-detail-metrics span, .internal-purchase-meta-list span, .internal-purchase-detail-note span, .internal-purchase-detail-comment span { display: block; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .04em; }
.internal-purchase-detail-metrics strong { display: block; margin-top: 5px; font-size: 12px; overflow-wrap: anywhere; }
.internal-purchase-detail-comment { display: grid; grid-template-columns: 100px minmax(0,1fr); gap: 12px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border); }
.internal-purchase-detail-comment strong { font-size: 11px; font-weight: 600; }
.internal-purchase-meta-list { display: grid; gap: 0; padding: 8px 16px 14px; }
.internal-purchase-meta-list > div { display: grid; grid-template-columns: 120px minmax(0,1fr); gap: 14px; padding: 10px 0; border-bottom: 1px solid #edf0ed; }
.internal-purchase-meta-list > div:last-child { border-bottom: 0; }
.internal-purchase-meta-list strong { font-size: 11px; overflow-wrap: anywhere; }
.internal-purchase-detail-note { margin: 0 16px 16px; padding: 12px; border-radius: 9px; background: #f7f9f6; }
.internal-purchase-detail-note strong { display: block; margin-top: 5px; font-size: 11px; font-weight: 600; line-height: 1.5; }
@media (max-width: 1100px) {
  .internal-purchase-detail-layout { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .internal-purchase-detail-metrics { grid-template-columns: 1fr; }
  .internal-purchase-detail-metrics > div:nth-child(n) { border-left: 0; }
  .internal-purchase-detail-metrics > div:nth-child(n+2) { border-top: 1px solid #e1e6e2; }
  .internal-purchase-meta-list > div, .internal-purchase-detail-comment { grid-template-columns: 1fr; gap: 4px; }
}

/* RC15 — mobile global search and order action access */
.mobile-search-button,
.mobile-search-panel,
.mobile-order-actionbar,
.mobile-order-action-spacer { display: none; }

@media (max-width: 900px) {
  .desktop-global-search { display: none; }
  .mobile-search-button { display: grid; flex: 0 0 auto; }
  .mobile-search-panel {
    position: absolute;
    top: calc(100% + 1px);
    left: 0;
    right: 0;
    z-index: 22;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    background: rgba(245,246,243,.98);
    box-shadow: 0 12px 28px rgba(18,31,26,.12);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity .16s ease, transform .16s ease, visibility .16s ease;
  }
  .topbar.mobile-search-open .mobile-search-panel {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
  }
  .mobile-search-panel .mobile-global-search {
    display: block;
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
  }
  .mobile-search-panel .mobile-global-search input {
    height: 44px;
    padding-right: 12px;
    background: #fff;
    font-size: 14px;
  }
  .mobile-search-panel .mobile-global-search svg { top: 13px; }
  .mobile-search-panel > .icon-button { flex: 0 0 auto; width: 44px; height: 44px; }

  .desktop-workflow-panel { display: none; }
  .mobile-order-action-spacer {
    display: block;
    height: calc(84px + env(safe-area-inset-bottom));
  }
  .mobile-order-actionbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 70;
    display: grid;
    grid-template-columns: minmax(0,1fr) minmax(112px,auto);
    gap: 8px;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(207,214,207,.9);
    background: rgba(255,255,255,.97);
    box-shadow: 0 -12px 30px rgba(18,31,26,.14);
    backdrop-filter: blur(14px);
  }
  .mobile-order-actionbar.single { grid-template-columns: 1fr; }
  .mobile-order-actionbar .btn {
    min-width: 0;
    min-height: 48px;
    height: auto;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.25;
    white-space: normal;
    text-align: center;
  }
  .mobile-order-actionbar .mobile-order-primary span,
  .mobile-order-actionbar .mobile-order-more span {
    min-width: 0;
    overflow-wrap: anywhere;
  }
  .mobile-order-actionbar .mobile-order-more { background: #fff; }

  dialog.mobile-order-sheet {
    position: fixed;
    inset: auto 0 0 0;
    width: 100%;
    max-width: none;
    max-height: min(78vh, 680px);
    margin: 0;
    padding: 0 0 env(safe-area-inset-bottom);
    overflow: auto;
    border: 0;
    border-radius: 20px 20px 0 0;
    background: #fff;
    color: var(--text);
    box-shadow: 0 -20px 60px rgba(10,20,16,.24);
  }
  dialog.mobile-order-sheet::backdrop { background: rgba(10,20,16,.52); }
  .mobile-order-sheet-handle {
    width: 44px;
    height: 4px;
    margin: 9px auto 2px;
    border-radius: 999px;
    background: #cfd7d2;
  }
  .mobile-order-sheet-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 16px 14px;
    border-bottom: 1px solid var(--border);
  }
  .mobile-order-sheet-head > div { min-width: 0; }
  .mobile-order-sheet-head span {
    display: block;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.4;
  }
  .mobile-order-sheet-head strong {
    display: block;
    margin-top: 4px;
    font-size: 18px;
    line-height: 1.25;
    overflow-wrap: anywhere;
  }
  .mobile-order-sheet-head .icon-button { flex: 0 0 auto; }
  .mobile-order-sheet-actions {
    display: grid;
    gap: 8px;
    padding: 14px 16px 18px;
  }
  .mobile-order-sheet-actions .btn {
    width: 100%;
    min-height: 48px;
    height: auto;
    justify-content: flex-start;
    padding: 11px 14px;
    border-radius: 12px;
    white-space: normal;
    text-align: left;
    line-height: 1.35;
  }
}

@media (max-width: 420px) {
  .topbar { gap: 8px; padding-inline: 10px; }
  .topbar .page-title { font-size: 15px; }
  .topbar .top-actions { gap: 6px; }
  .mobile-order-actionbar { grid-template-columns: minmax(0,1fr) 108px; padding-inline: 10px; }
  .mobile-order-actionbar .btn { padding-inline: 10px; font-size: 12px; }
}

/* AYU v3.3 reports: one source for screen, XLSX, PDF and print. */
.reports-print-area { display:grid; gap:18px; }
.report-filter-card {
  display:grid;
  grid-template-columns:minmax(280px,1fr) minmax(160px,194px) minmax(160px,194px) auto;
  align-items:end;
  gap:12px;
  padding:18px;
  border:1px solid var(--border);
  border-radius:var(--radius);
  background:#fff;
  box-shadow:var(--shadow-sm);
}
.report-filter-field { min-width:0; }
.report-filter-field label { margin-bottom:7px; }
.report-generate { min-width:168px; }
.report-hero {
  display:grid;
  grid-template-columns:minmax(0,1fr) 260px;
  align-items:center;
  gap:28px;
  padding:24px;
  overflow:hidden;
  border-radius:var(--radius-lg);
  background:linear-gradient(135deg,#1d5a47,#123a2e);
  color:#fff;
  box-shadow:var(--shadow-md);
}
.report-kicker {
  color:#a9c7ba;
  font-size:11px;
  font-weight:760;
  letter-spacing:.09em;
  text-transform:uppercase;
}
.report-hero h2 { margin:8px 0 0; font-size:26px; letter-spacing:-.035em; }
.report-hero p { max-width:760px; margin:8px 0 0; color:#bdd2c9; font-size:13px; line-height:1.55; }
.report-period-card {
  display:grid;
  gap:7px;
  padding:16px;
  border:1px solid rgba(255,255,255,.18);
  border-radius:12px;
  background:rgba(255,255,255,.08);
}
.report-period-card span { color:#b9cec5; font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.06em; }
.report-period-card strong { font-size:16px; line-height:1.35; }
.report-period-card small { color:#b9cec5; font-size:10px; }
.report-kpi-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:14px; }
.report-metric { min-height:124px; }
.report-metric .metric-value { overflow-wrap:anywhere; }
.report-notice {
  padding:16px 18px;
  border:1px solid #e6cfaa;
  border-radius:12px;
  background:#fff9ef;
  color:#745329;
  font-size:12px;
  line-height:1.5;
}
.report-notice strong { display:block; margin-bottom:5px; }
.report-notice ul { margin:0; padding-left:18px; }
.report-sections { display:grid; gap:16px; }
.report-section .panel-head { min-height:68px; padding-block:10px; }
.report-row-count { flex:0 0 auto; font-size:11px; }
.report-table { min-width:920px; }
.report-table th { position:sticky; top:0; z-index:1; }
.report-table td { max-width:330px; overflow-wrap:anywhere; }
.report-cell-number { font-variant-numeric:tabular-nums; white-space:nowrap; text-align:right; }
.report-source-link { color:var(--brand); font-weight:720; text-decoration:none; }
.report-source-link:hover { text-decoration:underline; }

@media (max-width: 1100px) {
  .report-filter-card { grid-template-columns:minmax(260px,1fr) repeat(2,minmax(150px,190px)); }
  .report-generate { grid-column:1 / -1; }
}

@media (max-width: 760px) {
  .report-filter-card { grid-template-columns:1fr; padding:14px; border-radius:14px; }
  .report-filter-select, .report-generate { grid-column:auto; }
  .report-generate { width:100%; }
  .report-hero { grid-template-columns:1fr; gap:16px; padding:18px; border-radius:18px; }
  .report-hero h2 { font-size:22px; }
  .report-period-card { width:100%; }
  .report-kpi-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
  .report-metric { min-height:112px; padding:15px; }
  .report-metric .metric-value { font-size:22px; }
  .report-section .panel-head { align-items:flex-start; }
}

@media (max-width: 460px) {
  .report-kpi-grid { grid-template-columns:1fr; }
  .report-metric { min-height:104px; }
}

@media print {
  body.printing-report { background:#fff; }
  body.printing-report * { visibility:hidden !important; }
  body.printing-report .reports-print-area,
  body.printing-report .reports-print-area * { visibility:visible !important; }
  body.printing-report .reports-print-area {
    position:absolute;
    inset:0;
    display:block;
    width:100%;
    color:#111;
  }
  body.printing-report .report-filter-card { display:none !important; }
  body.printing-report .report-hero,
  body.printing-report .report-kpi-grid,
  body.printing-report .report-notice,
  body.printing-report .report-section { margin-bottom:12px; box-shadow:none; }
  body.printing-report .report-hero { color:#fff; print-color-adjust:exact; -webkit-print-color-adjust:exact; }
  body.printing-report .report-kpi-grid { grid-template-columns:repeat(4,1fr); }
  body.printing-report .report-metric { min-height:0; break-inside:avoid; }
  body.printing-report .report-section { break-inside:auto; border-color:#aaa; }
  body.printing-report .report-table-wrap { overflow:visible; }
  body.printing-report .report-table { min-width:0; font-size:8px; }
  body.printing-report .report-table th,
  body.printing-report .report-table td { padding:6px; font-size:8px; }
}
