:root {
  /* Royal blue accents on neutral graphite / pearl surfaces. */
  --brand-blue: #1555eb;
  --brand-blue-dark: #123fbb;
  color-scheme: dark;
  --bg: #111318;
  --bg-soft: #171a21;
  --panel: #1b1e25;
  --panel-raised: #252a34;
  --panel-soft: #16191f;
  --line: #323844;
  --line-strong: #505968;
  --text: #e5e7ec;
  --text-strong: #f7f8fa;
  --muted: #acb3bf;
  --muted-2: #9ba4b2;
  --accent: #9db6ff;
  --accent-strong: #688df5;
  --accent-soft: rgba(104, 141, 245, .12);
  --green: #80c8a8;
  --green-soft: rgba(92, 166, 133, .12);
  --red: #ed9ba5;
  --red-soft: rgba(200, 104, 119, .12);
  --amber: #dec184;
  --amber-soft: rgba(193, 153, 80, .12);
  --purple: #b9a7dc;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .22);
  --shadow-md: 0 16px 40px rgba(0, 0, 0, .24);
  --radius: 14px;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f5f7;
  --bg-soft: #edeff3;
  --panel: #ffffff;
  --panel-raised: #f8f9fb;
  --panel-soft: #f6f7f9;
  --line: #dce0e6;
  --line-strong: #aeb7c5;
  --text: #303641;
  --text-strong: #1c222c;
  --muted: #626c7a;
  --muted-2: #626c7a;
  --accent: var(--brand-blue);
  --accent-strong: var(--brand-blue-dark);
  --accent-soft: #edf1fd;
  --green: #287457;
  --green-soft: #eaf4ef;
  --red: #b54756;
  --red-soft: #faedef;
  --amber: #876424;
  --amber-soft: #f8f1e4;
  --purple: #745b9c;
  --shadow-sm: 0 1px 3px rgba(24, 29, 38, .05);
  --shadow-md: 0 12px 32px rgba(24, 29, 38, .09);
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body {
  min-height: 100%; margin: 0; background: var(--bg);
  color: var(--text); font: 14px/1.5 Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--text-strong); }

/* App navigation */
nav.app-nav {
  display: flex; gap: 5px; align-items: center; height: 62px; padding: 0 22px;
  position: sticky; top: 0; z-index: 50; background: rgba(22, 25, 31, .96);
  border-bottom: 1px solid var(--line); backdrop-filter: blur(18px);
  box-shadow: var(--shadow-sm);
}
html[data-theme="light"] nav.app-nav { background: rgba(255, 255, 255, .9); }
.nav-symbols { position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }
nav a { color: var(--muted); text-decoration: none; }
nav .brand {
  display: flex; align-items: center; gap: 10px; min-width: max-content; margin-right: 18px;
  color: var(--text-strong); font-weight: 760; letter-spacing: -.015em;
}
.brand-mark {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px;
  color: #fff; font-weight: 800; background: var(--brand-blue);
  box-shadow: 0 3px 10px rgba(21, 85, 235, .14);
}
.nav-link, nav .menu-label, .nav-icon {
  min-height: 36px; display: inline-flex; align-items: center; gap: 7px; padding: 0 11px;
  border: 1px solid transparent; border-radius: 9px; color: var(--muted); cursor: pointer;
  font-weight: 590; white-space: nowrap; transition: .16s ease;
}
.nav-top-icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-link:hover, nav .menu-label:hover, .nav-icon:hover,
.nav-link.active, nav .menu.active > .menu-label, nav .menu.open > .menu-label {
  color: var(--accent); background: var(--accent-soft); border-color: var(--line-strong);
}
nav .spacer { flex: 1; }
.nav-user { color: var(--muted); padding: 0 8px; white-space: nowrap; }
.nav-icon { width: 36px; justify-content: center; padding: 0; background: transparent; }
#theme-toggle { font-size: 16px; }
nav .menu { position: relative; height: 62px; display: flex; align-items: center; }
nav .menu .dropdown {
  display: none; position: absolute; top: 54px; left: 0; z-index: 60;
  width: min(590px, calc(100vw - 32px)); padding: 10px;
  background: color-mix(in srgb, var(--panel-raised) 96%, transparent);
  border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 24px 64px rgba(0, 0, 0, .34);
  backdrop-filter: blur(22px); transform-origin: top left;
}
nav .menu[data-align="end"] .dropdown { left: auto; right: 0; transform-origin: top right; }
nav .menu .dropdown.mega-menu-compact { width: min(540px, calc(100vw - 32px)); }
nav .menu .dropdown.mega-menu-wide { width: min(690px, calc(100vw - 32px)); }
nav .menu.open .dropdown { display: block; animation: mega-menu-in .14s ease-out; }
@keyframes mega-menu-in {
  from { opacity: 0; transform: translateY(-5px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.menu-caret { display: inline-block; margin-left: 1px; transition: transform .16s ease; }
nav .menu.open .menu-caret { transform: rotate(180deg); }
.mega-head {
  display: flex; align-items: baseline; gap: 10px; padding: 8px 10px 11px;
  border-bottom: 1px solid var(--line); margin-bottom: 6px;
}
.mega-head strong { color: var(--text-strong); font-size: 13px; font-weight: 680; }
.mega-kicker { color: var(--accent); font-size: 10px; line-height: 1; font-weight: 780; letter-spacing: .12em; text-transform: uppercase; }
.mega-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
nav .menu .dropdown a.mega-item {
  display: grid; grid-template-columns: 38px minmax(0, 1fr); align-items: center; gap: 10px;
  min-height: 62px; padding: 9px 10px; border: 1px solid transparent; border-radius: 11px;
  color: var(--muted); transition: background .14s ease, border-color .14s ease, transform .14s ease;
}
nav .menu .dropdown a.mega-item:hover,
nav .menu .dropdown a.mega-item:focus-visible {
  color: var(--text-strong); background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 22%, transparent);
  outline: none; transform: translateY(-1px);
}
.mega-icon {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px;
  color: var(--mega-icon-color, var(--accent));
  background: color-mix(in srgb, var(--mega-icon-color, var(--accent)) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--mega-icon-color, var(--accent)) 24%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #fff 3%, transparent);
}
.mega-icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mega-icon.tone-blue { --mega-icon-color: #60a5fa; }
.mega-icon.tone-cyan { --mega-icon-color: #22d3ee; }
.mega-icon.tone-teal { --mega-icon-color: #2dd4bf; }
.mega-icon.tone-green { --mega-icon-color: #34d399; }
.mega-icon.tone-amber { --mega-icon-color: #fbbf24; }
.mega-icon.tone-orange { --mega-icon-color: #fb923c; }
.mega-icon.tone-red { --mega-icon-color: #fb7185; }
.mega-icon.tone-violet { --mega-icon-color: #a78bfa; }
.mega-icon.tone-indigo { --mega-icon-color: #818cf8; }
html[data-theme="light"] .mega-icon.tone-blue { --mega-icon-color: var(--brand-blue); }
html[data-theme="light"] .mega-icon.tone-cyan { --mega-icon-color: #0891b2; }
html[data-theme="light"] .mega-icon.tone-teal { --mega-icon-color: #0f766e; }
html[data-theme="light"] .mega-icon.tone-green { --mega-icon-color: #059669; }
html[data-theme="light"] .mega-icon.tone-amber { --mega-icon-color: #b45309; }
html[data-theme="light"] .mega-icon.tone-orange { --mega-icon-color: #c2410c; }
html[data-theme="light"] .mega-icon.tone-red { --mega-icon-color: #e11d48; }
html[data-theme="light"] .mega-icon.tone-violet { --mega-icon-color: #7c3aed; }
html[data-theme="light"] .mega-icon.tone-indigo { --mega-icon-color: #4f46e5; }
.mega-item > span:last-child { min-width: 0; }
.mega-item strong { display: block; color: inherit; font-size: 12px; line-height: 1.25; font-weight: 680; }
.mega-item small { display: block; overflow: hidden; margin-top: 3px; color: var(--muted-2); font-size: 10px; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }

main { width: min(1440px, 100%); margin: 0 auto; padding: 30px 28px 64px; }
h1, h2, h3 { color: var(--text-strong); letter-spacing: -.02em; }
h1 { font-size: clamp(24px, 2vw, 31px); line-height: 1.15; margin: 4px 0 18px; }
h2 { font-size: 17px; margin: 24px 0 10px; }
h3 { font-size: 14px; margin: 16px 0 8px; }
p { margin: 8px 0 14px; }
.eyebrow { color: var(--accent); font-size: 11px; font-weight: 760; letter-spacing: .13em; text-transform: uppercase; }
.page-title { margin: 3px 0 4px; }
.page-subtitle { max-width: 750px; margin: 0; color: var(--muted); font-size: 14px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.header-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.breadcrumb { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; margin-bottom: 13px; }
.breadcrumb:hover { color: var(--accent); }

/* Panels, cards and metrics */
.panel {
  background: linear-gradient(180deg, rgba(255,255,255,.018), transparent 70%), var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px;
  margin-bottom: 18px; box-shadow: var(--shadow-sm);
}
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 14px; }
.panel-head h2 { margin: 0 0 3px; }
.panel-head p { margin: 0; color: var(--muted); font-size: 13px; }
.cards, .dashboard-kpis { display: grid; grid-template-columns: repeat(4, minmax(160px, 1fr)); gap: 12px; }
.card, .metric-card {
  min-height: 112px; position: relative; overflow: hidden; padding: 16px 17px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  color: inherit; text-decoration: none; box-shadow: var(--shadow-sm); transition: .18s ease;
}
.card:hover, a.metric-card:hover { transform: translateY(-2px); border-color: var(--line-strong); box-shadow: var(--shadow-md); }
.card .num, .metric-card .num { color: var(--text-strong); font-size: 25px; line-height: 1.05; font-weight: 760; letter-spacing: -.035em; }
.card .lbl, .metric-card .lbl { margin-top: 8px; color: var(--muted); font-size: 12px; font-weight: 620; }
.metric-card .meta { margin-top: 5px; color: var(--muted-2); font-size: 11px; }
.metric-card::after { content: ""; position: absolute; inset: auto -22px -31px auto; width: 90px; height: 90px; border-radius: 50%; background: var(--accent-soft); }
.metric-card.success::after { background: var(--green-soft); }
.metric-card.warning::after { background: var(--amber-soft); }
.metric-card.danger::after { background: var(--red-soft); }
.work-queue { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 18px 0; }
.queue-card { display: flex; align-items: center; gap: 14px; min-height: 78px; padding: 14px 16px; color: inherit; text-decoration: none; background: var(--panel); border: 1px solid var(--line); border-radius: 13px; transition: .16s ease; }
.queue-card:hover { border-color: var(--accent); background: var(--accent-soft); color: inherit; }
.queue-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--accent-soft); font-size: 20px; }
.queue-card strong { display: block; color: var(--text-strong); font-size: 17px; }
.queue-card span { color: var(--muted); font-size: 12px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.18fr) minmax(340px, .82fr); gap: 18px; align-items: start; }
.stack { display: grid; gap: 18px; }
.dashboard-jump-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: -6px 0 18px; }
.dashboard-jump-nav a { padding: 7px 11px; color: var(--muted); background: var(--panel-soft); border: 1px solid var(--line); border-radius: 999px; text-decoration: none; font-size: 11px; font-weight: 700; }
.dashboard-jump-nav a:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.dashboard-section { scroll-margin-top: 78px; margin-top: 24px; }
.unified-kpis { grid-template-columns: repeat(4, minmax(180px, 1fr)); }
.dashboard-summary-strip { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 1px; margin: 12px 0 20px; overflow: hidden; background: var(--line); border: 1px solid var(--line); border-radius: 12px; }
.dashboard-summary-strip article { min-width: 0; padding: 11px 14px; background: var(--panel-soft); }
.dashboard-summary-strip span, .dashboard-summary-strip small { display: block; color: var(--muted); font-size: 10px; }
.dashboard-summary-strip strong { display: block; margin: 3px 0 2px; overflow: hidden; color: var(--text-strong); font-size: 17px; text-overflow: ellipsis; white-space: nowrap; }
.management-grid { margin-top: 0; }
.management-panel { margin-bottom: 0; }
.management-panel .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.management-panel .cards-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.management-panel .card { min-height: 100px; }
.management-panel .card .meta { margin-top: 4px; color: var(--muted-2); font-size: 10px; }
.compact-cards .card { min-height: 86px; }
.management-note { margin: 11px 2px 0; color: var(--muted); font-size: 11px; line-height: 1.55; }

/* Dashboard analytics */
.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; }
.analytics-panel { padding: 22px; }
.analytics-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 18px; }
.analytics-head h2 { margin: 2px 0 3px; font-size: 20px; }
.analytics-head p { margin: 0; color: var(--muted); font-size: 12px; }
.period-controls { display: grid; justify-items: end; gap: 9px; }
.period-presets { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.period-chip { display: inline-flex; align-items: center; min-height: 34px; padding: 6px 11px; color: var(--muted); background: var(--panel-soft); border: 1px solid var(--line); border-radius: 9px; text-decoration: none; font-size: 11px; font-weight: 680; transition: .15s ease; }
.period-chip:hover { color: var(--text-strong); border-color: var(--line-strong); }
.period-chip.active { color: var(--accent); background: var(--accent-soft); border-color: rgba(83, 160, 242, .32); }
.custom-period-form { display: flex; align-items: end; gap: 7px; }
.custom-period-form label { display: grid; gap: 3px; color: var(--muted-2); font-size: 9px; font-weight: 740; letter-spacing: .06em; text-transform: uppercase; }
.custom-period-form input { width: 132px; min-height: 32px; padding: 5px 8px; font-size: 11px; }
.analytics-kpis { margin-bottom: 16px; }
.analytics-kpis .metric-card { min-height: 106px; background: var(--panel-soft); }
.trend.positive { color: var(--green); }
.trend.negative { color: var(--red); }
.analytics-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.chart-card { min-width: 0; padding: 17px; background: var(--panel-soft); border: 1px solid var(--line); border-radius: 13px; }
.chart-card-wide { grid-column: 1 / -1; }
.chart-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.chart-head h3 { margin: 0 0 2px; color: var(--text-strong); font-size: 13px; }
.chart-head p { margin: 0; color: var(--muted-2); font-size: 11px; }
.chart-legend { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.chart-legend i { width: 8px; height: 8px; border-radius: 3px; background: linear-gradient(180deg, var(--accent), var(--accent-strong)); box-shadow: 0 0 0 3px var(--accent-soft); }
.column-chart { display: grid; grid-template-columns: repeat(var(--chart-columns), minmax(66px, 1fr)); gap: 7px; min-width: calc(var(--chart-columns) * 66px); overflow: hidden; }
.chart-column { min-width: 0; display: grid; grid-template-rows: 18px 170px 34px; gap: 5px; text-align: center; }
.chart-value { overflow: hidden; color: var(--muted); font-size: 9px; font-weight: 650; white-space: nowrap; text-overflow: ellipsis; }
.chart-track { position: relative; display: flex; align-items: flex-end; justify-content: center; min-height: 170px; overflow: hidden; border-bottom: 1px solid var(--line-strong); background: repeating-linear-gradient(to top, transparent 0, transparent 41px, rgba(126, 154, 187, .08) 42px); border-radius: 6px 6px 0 0; }
.chart-bar { width: min(42px, 70%); height: max(3px, var(--bar-height)); border-radius: 7px 7px 2px 2px; background: linear-gradient(180deg, var(--accent), var(--accent-strong)); box-shadow: 0 7px 20px rgba(51, 133, 222, .16); transition: filter .15s ease; }
.chart-column:hover .chart-bar { filter: brightness(1.18); }
.chart-label { color: var(--muted); font-size: 9px; line-height: 1.25; white-space: nowrap; }
.chart-label small { display: block; margin-top: 3px; color: var(--muted-2); font-size: 8px; }
.horizontal-chart { display: grid; gap: 13px; }
.horizontal-row { min-width: 0; }
.horizontal-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 5px; font-size: 11px; }
.horizontal-meta span { overflow: hidden; color: var(--text); font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.horizontal-meta strong { flex: 0 0 auto; color: var(--text-strong); font-size: 10px; }
.horizontal-track { height: 7px; overflow: hidden; background: rgba(119, 145, 177, .11); border-radius: 999px; }
.horizontal-bar { width: var(--bar-width); height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent-strong), var(--accent)); }
.horizontal-bar.product { background: var(--purple); }
.chart-empty { display: grid; place-items: center; min-height: 110px; color: var(--muted); font-size: 11px; }
.source-breakdown { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 17px; padding-top: 12px; border-top: 1px solid var(--line); }
.source-breakdown span { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 10px; }
.source-breakdown strong { color: var(--text); }
.source-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.source-dot.source-2 { background: var(--purple); }
.dashboard-section-head { margin: 24px 0 12px; }
.dashboard-section-head h2 { margin-top: 0; }

/* Tables */
.table-shell { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-soft); }
table { width: 100%; border-collapse: collapse; background: transparent; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); background: var(--panel-soft); font-size: 11px; font-weight: 740; letter-spacing: .045em; text-transform: uppercase; }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .12s ease; }
tbody tr:hover td, tr:hover td { background: rgba(105, 146, 195, .06); }
td.r, th.r { text-align: right; }
.table-main { color: var(--text-strong); font-weight: 650; }
.table-sub { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.row-action { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: var(--panel-raised); border: 1px solid var(--line); text-decoration: none; }
.empty-state { padding: 25px !important; text-align: center; color: var(--muted); }
.product-row.low-stock td { background: linear-gradient(90deg, rgba(224, 86, 91, .035), transparent); }
.product-cell { display: flex; align-items: center; gap: 12px; min-width: 270px; }
.variant-summary { margin-top: 6px; }
.variant-summary > summary {
  width: fit-content;
  cursor: pointer;
  color: var(--accent);
  font-size: 12px;
}
.variant-summary-list {
  display: grid;
  gap: 4px;
  margin-top: 7px;
  min-width: 250px;
}
.variant-summary-list a {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
}
.variant-summary-list a:hover { border-color: var(--accent); }
.variant-summary-list span { color: var(--muted); text-align: right; }
.product-thumb, .product-thumb-placeholder { width: 42px; height: 42px; flex: 0 0 42px; border-radius: 10px; border: 1px solid var(--line); object-fit: cover; background: var(--panel-raised); }
.product-thumb-placeholder { display: grid; place-items: center; color: var(--muted-2); font-weight: 750; }
.po-product { display: flex; align-items: center; gap: 11px; min-width: 230px; }
.po-product > div { min-width: 0; }
.po-product a { display: block; line-height: 1.3; }
.po-product small { display: block; margin-top: 3px; color: var(--muted); }
.po-edit-panel { margin-top: 10px; }
.po-edit-panel > summary { width: max-content; cursor: pointer; list-style: none; }
.po-edit-panel > summary::-webkit-details-marker { display: none; }
.po-header-form { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(220px, .7fr); gap: 14px; margin-top: 16px; }
.po-header-form label > span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 12px; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; }
.po-header-form select, .po-header-form input, .po-header-form textarea { width: 100%; }
.po-header-wide { grid-column: 1 / -1; }
.po-header-form .po-check { display: flex; align-items: center; gap: 9px; }
.po-header-form .po-check input { width: auto; }
.po-lines-shell { margin-top: 12px; }
.po-qty-input { width: 72px; text-align: right; }
.po-cost-input { width: 94px; text-align: right; }
.po-date-input { min-width: 142px; }
.po-line-actions { white-space: nowrap; }
.po-line-actions button { padding: 5px 9px; font-size: 12px; }
.po-line-actions .po-delete { color: var(--red); }
.po-add-line { display: grid; grid-template-columns: auto minmax(230px, 1fr) 90px 160px 150px auto; align-items: end; gap: 9px; margin-top: 10px; }
@media (max-width: 900px) {
  .po-header-form { grid-template-columns: 1fr; }
  .po-header-wide { grid-column: auto; }
  .po-add-line { grid-template-columns: 1fr 1fr; }
}
.sku-code { display: inline-block; color: var(--accent); font: 700 11px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .02em; }
.stock-value { color: var(--text-strong); font-size: 18px; font-weight: 760; }
.stock-meta { display: block; color: var(--muted); font-size: 11px; }
.stock-low .stock-value { color: var(--red); }
.document-lines-shell { overflow-x: auto; }
.document-lines-shell table { width: 100%; }
.quote-lines-shell table { min-width: 1320px; }
.order-lines-shell table { min-width: 1540px; }
.blanket-lines-shell table { min-width: 1480px; }
.document-lines-shell th { white-space: nowrap; }
.document-lines-shell td:first-child { min-width: 230px; }
.document-lines-shell td:nth-child(2) { min-width: 135px; }
.line-money-input { width: 82px; text-align: right; }
.price-cell, .grundpreis-cell, .internal-price-cell, .contribution-cell { white-space: nowrap; }
.grundpreis-cell { min-width: 118px; }
.grundpreis-control { display: inline-flex; align-items: center; justify-content: flex-end; gap: 5px; }
.grundpreis-control .gp-input { width: 70px; min-height: 36px; font-size: 12px; text-align: right; }
.grundpreis-control small, .internal-price-cell small, .contribution-cell small { display: block; color: var(--muted-2); font-size: 9px; font-weight: 600; }
.grundpreis-control small { display: inline; color: var(--muted); }
.internal-price-cell { color: var(--amber); font-weight: 680; }
.contribution-cell { min-width: 122px; }
.contribution-cell strong { display: block; color: var(--green); font-size: 13px; }
.contribution-cell strong.negative { color: var(--red); }
.contribution-cell small { margin-top: 2px; }

/* Forms and buttons */
input, select, textarea {
  width: auto; min-height: 40px; padding: 8px 11px; color: var(--text); background: var(--panel-soft);
  border: 1px solid var(--line); border-radius: 9px; font: inherit; transition: .15s ease;
}
input::placeholder, textarea::placeholder { color: var(--muted-2); }
input:hover, select:hover, textarea:hover { border-color: var(--line-strong); }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--accent-soft); border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
input[type="checkbox"], input[type="radio"] { width: 17px; min-height: 17px; accent-color: var(--accent-strong); }
input[type="file"] { padding: 7px; }
button, .btn {
  min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 15px; border: 1px solid transparent; border-radius: 9px; cursor: pointer;
  color: #fff; background: var(--brand-blue); font: 650 13px/1.2 inherit;
  text-decoration: none; box-shadow: 0 3px 10px rgba(21, 85, 235, .18); transition: .15s ease;
}
button:hover, .btn:hover { transform: translateY(-1px); filter: brightness(1.07); color: #fff; }
button.secondary, .btn.secondary { color: var(--text); background: var(--panel-raised); border-color: var(--line); box-shadow: none; }
button.danger, .btn.danger { color: var(--red); background: var(--red-soft); border-color: rgba(227, 92, 107, .2); box-shadow: none; }
.btn-sm, button.btn-sm { min-height: 32px; padding: 5px 10px; font-size: 11px; }
form.inline { display: inline; }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar form { display: flex; gap: 8px; }
.filter-panel { display: flex; align-items: center; gap: 10px; padding: 12px; margin-bottom: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 13px; }
.filter-panel form { display: flex; flex: 1; gap: 9px; align-items: center; }
.search-input { flex: 1; min-width: 240px; }
.filter-select { min-width: 210px; }
.filter-chip { display: inline-flex; align-items: center; min-height: 35px; padding: 6px 11px; color: var(--muted); background: var(--panel-raised); border: 1px solid var(--line); border-radius: 999px; text-decoration: none; font-size: 12px; font-weight: 620; }
.filter-chip.active { color: var(--amber); background: var(--amber-soft); border-color: rgba(224, 168, 53, .2); }
.form-section { padding: 20px 0; border-top: 1px solid var(--line); }
.form-section:first-child { padding-top: 2px; border-top: 0; }
.form-section-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 15px; }
.section-index { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; color: var(--accent); background: var(--accent-soft); font-size: 11px; font-weight: 800; }
.form-section-head h2 { margin: 0 0 2px; font-size: 16px; }
.form-section-head p { margin: 0; color: var(--muted); font-size: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 13px; }
.field { grid-column: span 4; display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .025em; }
.field.span-2 { grid-column: span 8; }
.field.span-full { grid-column: 1 / -1; }
.field input, .field select, .field textarea { width: 100%; color: var(--text); font-size: 14px; font-weight: 500; letter-spacing: 0; }
.field-hint { color: var(--muted-2); font-size: 11px; font-weight: 500; }
.input-group { display: grid; grid-template-columns: 1fr 110px; gap: 8px; }
.check-card { grid-column: span 6; min-height: 76px; display: flex; gap: 10px; align-items: flex-start; padding: 12px; background: var(--panel-soft); border: 1px solid var(--line); border-radius: 10px; color: var(--text); cursor: pointer; }
.check-card strong { display: block; color: var(--text-strong); font-size: 13px; }
.check-card span { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.form-actions { position: sticky; bottom: 14px; z-index: 8; display: flex; align-items: center; justify-content: space-between; gap: 15px; margin: 18px -8px -8px; padding: 12px; background: rgba(27, 30, 37, .96); border: 1px solid var(--line); border-radius: 12px; backdrop-filter: blur(14px); box-shadow: var(--shadow-md); }
html[data-theme="light"] .form-actions { background: rgba(255,255,255,.94); }

/* Product detail */
.product-hero { display: flex; align-items: center; gap: 16px; min-width: 0; }
.product-hero-image, .product-hero-placeholder { width: 68px; height: 68px; flex: 0 0 68px; border-radius: 16px; border: 1px solid var(--line); object-fit: cover; background: var(--panel-raised); }
.product-hero-placeholder { display: grid; place-items: center; color: var(--accent); font-size: 20px; font-weight: 800; }
.product-title-wrap { min-width: 0; }
.product-title-wrap h1 { margin: 3px 0 5px; overflow-wrap: anywhere; }
.product-meta-line { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.product-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 11px; margin-bottom: 18px; }
.summary-tile { padding: 14px 15px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.summary-tile .label { color: var(--muted); font-size: 11px; font-weight: 680; }
.summary-tile .value { margin-top: 4px; color: var(--text-strong); font-size: 19px; font-weight: 750; letter-spacing: -.02em; }
.summary-tile .sub { margin-top: 2px; color: var(--muted-2); font-size: 11px; }
.summary-tile.alert .value { color: var(--red); }
.product-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(330px, .65fr); gap: 18px; align-items: start; }
.side-stack { display: grid; gap: 18px; }
.side-stack .panel { margin-bottom: 0; }
.compact-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px; color: var(--muted); background: rgba(134, 156, 184, .12); border: 1px solid rgba(134, 156, 184, .10); font-size: 11px; font-weight: 680; line-height: 1.25; }
.badge.green { color: var(--green); background: var(--green-soft); border-color: rgba(70, 194, 135, .15); }
.badge.red { color: var(--red); background: var(--red-soft); border-color: rgba(229, 90, 106, .15); }
.badge.amber { color: var(--amber); background: var(--amber-soft); border-color: rgba(225, 168, 53, .15); }
.muted { color: var(--muted); }
.error { padding: 11px 13px; margin-bottom: 14px; color: var(--red); background: var(--red-soft); border: 1px solid rgba(229,90,106,.2); border-radius: 10px; }
.notice { padding: 11px 13px; margin-bottom: 14px; border-radius: 10px; }
.notice.success { color: var(--green); background: var(--green-soft); }
.notice.warning { color: var(--amber); background: var(--amber-soft); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 8px 14px; }
.kv .k { color: var(--muted); }

/* Kundenstamm: Adressen und Ansprechpartner sind die einzigen Identitätsquellen */
.customer-page-head { align-items: center; }
.customer-address-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.customer-master-panel { min-width: 0; }
.customer-master-panel .panel-head h2 { margin: 2px 0 3px; font-size: 19px; }
.count-pill { display: grid; place-items: center; min-width: 32px; height: 28px; padding: 0 9px; color: var(--accent); background: var(--accent-soft); border: 1px solid rgba(83,160,242,.26); border-radius: 999px; font-size: 12px; font-weight: 760; }
.address-card { padding: 14px; margin: 0 0 12px; background: var(--panel-soft); border: 1px solid var(--line); border-radius: 12px; }
.address-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.address-card-head strong { display: block; color: var(--text-strong); }
.address-card-head small { display: block; margin-top: 2px; color: var(--muted); }
.address-form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 10px; }
.address-form-grid[hidden] { display: none; }
.address-form-grid .customer-field { grid-column: span 5; }
.address-form-grid .field-wide { grid-column: span 7; }
.address-form-grid .field-zip { grid-column: span 2; }
.address-form-grid .field-city, .address-form-grid .field-country { grid-column: span 5; }
.customer-field { display: grid; align-content: start; gap: 4px; min-width: 0; }
.customer-field > span { color: var(--muted); font-size: 10px; font-weight: 720; letter-spacing: .04em; text-transform: uppercase; }
.customer-field input, .customer-field select, .customer-field textarea { width: 100%; }
.address-card-actions { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 8px; margin-top: 12px; }
.address-card-actions button { min-height: 34px; padding: 6px 10px; font-size: 12px; }
.check-line { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.structured-add { margin-top: 13px; padding-top: 12px; border-top: 1px solid var(--line); }
.structured-add > summary { cursor: pointer; color: var(--accent); font-weight: 680; list-style: none; }
.structured-add > summary::-webkit-details-marker { display: none; }
.structured-add .address-card { margin: 12px 0 0; }
.contact-grid { display: grid; grid-template-columns: minmax(160px,1fr) minmax(115px,.7fr) minmax(195px,1.2fr) minmax(135px,.82fr) minmax(135px,.82fr) auto; gap: 9px; align-items: center; }
.contact-grid-head { padding: 0 8px 6px; color: var(--muted); font-size: 10px; font-weight: 720; letter-spacing: .05em; text-transform: uppercase; }
.contact-row { padding: 9px 8px; border-top: 1px solid var(--line); }
.contact-row input { width: 100%; }
.contact-row-new { margin-top: 9px; padding-top: 14px; background: var(--panel-soft); border: 1px dashed var(--line-strong); border-radius: 10px; }
.contact-actions { display: flex; gap: 6px; white-space: nowrap; }
.contact-actions button { min-height: 36px; padding: 6px 9px; font-size: 11px; }
.danger-text { color: var(--red) !important; }
.customer-settings-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 12px; }
.customer-settings-grid .customer-field { grid-column: span 3; }
.customer-settings-grid .field-wide { grid-column: span 6; }
.customer-settings-grid .field-full { grid-column: 1 / -1; }
.customer-settings-actions { display: flex; align-items: center; gap: 12px; }
.customer-create-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 2px; }
.ship-like-bill { min-height: 42px; padding: 10px 12px; margin-bottom: 12px; background: var(--accent-soft); border: 1px solid rgba(83,160,242,.22); border-radius: 10px; color: var(--text); }
.compact { min-height: 72px; padding: 18px !important; }
.lines-form td { padding: 5px 7px; }
.lines-form input { width: 100%; }
.login-wrap { max-width: 390px; margin: 9vh auto; }
.login-wrap .panel { padding: 27px; box-shadow: var(--shadow-md); }

/* Existing interactive elements */
#sku-box { position: absolute; z-index: 80; max-width: 600px; max-height: 340px; overflow-y: auto; background: var(--panel-raised); color: var(--text); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: var(--shadow-md); font-size: 13px; }
#sku-box .sku-item { padding: 9px 12px; cursor: pointer; border-bottom: 1px solid var(--line); }
#sku-box .sku-item:last-child { border-bottom: 0; }
#sku-box .sku-item.active, #sku-box .sku-item:hover { background: var(--accent-soft); }
#sku-box .sku-id { font-weight: 750; color: var(--accent); margin-right: 6px; }
#sku-box .sku-meta { float: right; color: var(--muted); margin-left: 12px; }
.sku-title { font-size: 12px; color: var(--green); margin-top: 3px; }
.sku-title .sku-stock { font-weight: 750; margin-left: 6px; }
.sku-title .sku-stock.ok { color: var(--green); }
.sku-title .sku-stock.mid { color: var(--amber); }
.sku-title .sku-stock.low { color: var(--red); }
tr.prow { cursor: pointer; }
tr.prow:hover td { background: var(--accent-soft); }
tr.prow-open td { background: var(--accent-soft); }
tr.prow-detail td { background: var(--panel-soft); padding: 0; }
.prow-box { padding: 10px 14px; }
table.prow-tbl { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; font-size: 12.5px; }
table.prow-tbl th { background: var(--panel-soft); color: var(--muted); padding: 5px 9px; }
table.prow-tbl td { padding: 5px 9px; border-top: 1px solid var(--line); }
.modal-bg { display: none; position: fixed; inset: 0; z-index: 1000; background: rgba(3,7,12,.76); align-items: center; justify-content: center; padding: 20px; }
.modal-box { background: var(--panel-raised); border: 1px solid var(--line); border-radius: 15px; width: min(820px, 96vw); max-height: 92vh; display: flex; flex-direction: column; box-shadow: var(--shadow-md); overflow: hidden; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); font-size: 16px; }
.modal-x { cursor: pointer; font-size: 26px; line-height: 1; color: var(--muted); padding: 0 6px; }
.modal-x:hover { color: var(--red); }
.pdf-frame { width: 100%; height: 64vh; border: 0; background: var(--bg-soft); flex: 1 1 auto; }
.mail-form { padding: 14px 18px; border-top: 1px solid var(--line); }
.mail-form label { display: block; color: var(--muted); margin-bottom: 4px; }
details > summary { color: var(--text-strong); }
details.addr-edit > summary { list-style: none; cursor: pointer; }
details.addr-edit > summary::-webkit-details-marker { display: none; }
details.addr-edit > summary::marker { content: ""; }
details.addr-edit[open] > summary { margin-bottom: 4px; }

/* CRM */
.crm-kpis { display: grid; grid-template-columns: repeat(3, minmax(160px, 220px)); gap: 12px; margin-bottom: 18px; }
.crm-kpis .card { min-height: 94px; }
.crm-kpis .card.risk { border-color: rgba(255,132,145,.4); background: linear-gradient(145deg, var(--red-soft), var(--panel)); }
.crm-toolbar { justify-content: flex-end; margin-bottom: 18px; }
.crm-toolbar label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.crm-toolbar select { min-width: 150px; }
.crm-dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(340px, .75fr); gap: 18px; align-items: start; }
.crm-calendar-panel, .crm-task-panel { min-width: 0; }
.crm-calendar-head { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px; margin-bottom: 14px; text-align: center; }
.crm-calendar-head h2 { margin: 1px 0 0; font-size: 20px; }
.crm-calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--line); gap: 1px; }
.crm-weekday { padding: 7px 5px; background: var(--panel-soft); color: var(--muted); text-align: center; font-size: 10px; font-weight: 760; letter-spacing: .08em; text-transform: uppercase; }
.crm-day { min-height: 112px; padding: 8px; background: var(--panel); overflow: hidden; }
.crm-day.outside { background: var(--panel-soft); opacity: .52; }
.crm-day.today { box-shadow: inset 0 0 0 2px var(--accent-strong); }
.crm-day-number { width: 25px; height: 25px; display: grid; place-items: center; margin-bottom: 5px; color: var(--muted); font-size: 11px; font-weight: 720; border-radius: 8px; }
.crm-day.today .crm-day-number { color: #fff; background: var(--accent-strong); }
.crm-day-items { display: grid; gap: 4px; }
.crm-calendar-item { display: block; min-width: 0; overflow: hidden; padding: 4px 6px; color: var(--text); background: var(--accent-soft); border-left: 3px solid var(--accent); border-radius: 5px; text-decoration: none; font-size: 10px; line-height: 1.25; white-space: nowrap; text-overflow: ellipsis; }
.crm-calendar-item span { color: var(--muted); font-weight: 760; }
.crm-calendar-item.high { background: var(--red-soft); border-color: var(--red); }
.crm-calendar-item.done { opacity: .52; text-decoration: line-through; }
.crm-customer-grid, .crm-record-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.crm-customer-grid { padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.crm-record-grid { padding-top: 4px; }
.crm-entry-form { display: grid; gap: 10px; padding: 14px; background: var(--panel-soft); border: 1px solid var(--line); border-radius: 12px; }
.crm-entry-form label { display: grid; gap: 4px; min-width: 0; }
.crm-entry-form label > span { color: var(--muted); font-size: 10px; font-weight: 720; letter-spacing: .04em; text-transform: uppercase; }
.crm-entry-form input, .crm-entry-form select, .crm-entry-form textarea { width: 100%; }
.crm-entry-form button { justify-self: start; }
.crm-form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.crm-section-title { display: flex; justify-content: space-between; align-items: center; margin: 17px 0 9px; }
.crm-section-title h3 { margin: 0; font-size: 15px; }
.crm-follow-list, .crm-timeline { display: grid; gap: 8px; }
.crm-task-panel .crm-follow-list { max-height: 690px; overflow-y: auto; padding-right: 3px; }
.crm-follow-card, .crm-timeline-entry { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 10px; padding: 12px; background: var(--panel-soft); border: 1px solid var(--line); border-radius: 11px; }
.crm-follow-card.is-high { border-left: 3px solid var(--red); }
.crm-follow-card.is-overdue { background: linear-gradient(110deg, var(--red-soft), var(--panel-soft) 42%); }
.crm-follow-card.is-done { opacity: .58; }
.crm-follow-card.is-done .crm-follow-title { text-decoration: line-through; }
.crm-follow-title { color: var(--text-strong); font-weight: 720; text-decoration: none; }
.crm-follow-title .badge { margin-left: 6px; }
.crm-meta { margin-top: 2px; color: var(--muted); font-size: 11px; }
.crm-follow-card p, .crm-timeline-entry p { margin: 7px 0 0; color: var(--text); font-size: 12px; white-space: pre-line; }
.crm-check-button { display: grid; place-items: center; width: 30px; min-height: 30px; padding: 0; border-radius: 50%; background: var(--panel); border-color: var(--line-strong); color: var(--green); }
.crm-delete { min-width: 29px; min-height: 29px; padding: 2px 7px; }
.crm-kind-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; color: var(--accent); background: var(--accent-soft); font-weight: 780; }
.crm-recent-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
.crm-recent-card { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: center; padding: 11px; color: var(--text); background: var(--panel-soft); border: 1px solid var(--line); border-radius: 10px; text-decoration: none; }
.crm-recent-card:hover { border-color: var(--line-strong); }
.crm-recent-card strong, .crm-recent-card small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.crm-recent-card small { color: var(--muted); margin-top: 2px; }
.text-risk { color: var(--red); font-weight: 720; }

@media (max-width: 1100px) {
  .dashboard-kpis, .cards { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid, .product-layout, .crm-dashboard-grid { grid-template-columns: 1fr; }
  .product-summary { grid-template-columns: repeat(2, 1fr); }
  .field { grid-column: span 6; }
  .field.span-2 { grid-column: span 12; }
  nav.app-nav { gap: 2px; padding-inline: 12px; }
  .brand-text { display: none; }
  nav .brand { margin-right: 5px; }
  .nav-link, nav .menu-label { padding-inline: 8px; }
  .nav-top-icon { display: none; }
  .analytics-head { flex-direction: column; }
  .period-controls { justify-items: start; }
  .period-presets { justify-content: flex-start; }
  .customer-address-grid { grid-template-columns: 1fr; }
  .unified-kpis, .dashboard-summary-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .management-panel .cards-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  nav.app-nav {
    overflow-x: auto; overflow-y: visible; height: 56px;
    backdrop-filter: none; -webkit-backdrop-filter: none;
  }
  nav .menu { height: 56px; }
  nav .menu .dropdown,
  nav .menu[data-align="end"] .dropdown {
    position: fixed; top: 58px; left: 10px; right: 10px; width: auto;
    max-height: calc(100dvh - 70px); overflow-y: auto; transform-origin: top center;
  }
  nav .menu .dropdown.mega-menu-compact,
  nav .menu .dropdown.mega-menu-wide { width: auto; }
  .mega-grid { grid-template-columns: 1fr; }
  .mega-head { align-items: flex-start; flex-direction: column; gap: 4px; }
  .mega-item small { white-space: normal; }
  .nav-user, .nav-admin { display: none; }
  main { padding: 22px 14px 48px; }
  .page-head { flex-direction: column; gap: 14px; }
  .header-actions { justify-content: flex-start; }
  .dashboard-kpis, .cards, .work-queue, .grid2 { grid-template-columns: 1fr; }
  .unified-kpis, .dashboard-summary-strip, .management-panel .cards, .management-panel .cards-3 { grid-template-columns: 1fr; }
  .filter-panel, .filter-panel form { align-items: stretch; flex-direction: column; }
  .filter-panel .btn, .filter-panel button, .filter-panel input, .filter-panel select { width: 100%; }
  .product-summary { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .field, .field.span-2, .field.span-full, .check-card { grid-column: 1; }
  .product-hero { align-items: flex-start; }
  .product-hero-image, .product-hero-placeholder { width: 52px; height: 52px; flex-basis: 52px; border-radius: 12px; }
  .panel { padding: 15px; }
  .form-actions { position: static; margin-inline: 0; }
  .kv { grid-template-columns: 1fr; }
  th, td { padding: 9px 10px; }
  .analytics-panel { padding: 15px; }
  .analytics-grid { grid-template-columns: 1fr; }
  .chart-card-wide { grid-column: 1; overflow-x: auto; }
  .column-chart { overflow: visible; }
  .custom-period-form { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .custom-period-form label, .custom-period-form input { width: 100%; }
  .custom-period-form button { grid-column: 1 / -1; width: 100%; }
  .address-form-grid .customer-field, .address-form-grid .field-wide,
  .address-form-grid .field-zip, .address-form-grid .field-city,
  .address-form-grid .field-country { grid-column: 1 / -1; }
  .address-card-actions { grid-template-columns: 1fr 1fr; }
  .address-card-actions .check-line { grid-column: 1 / -1; }
  .address-card-actions > span { display: none; }
  .contact-grid { grid-template-columns: 1fr; }
  .contact-grid-head { display: none; }
  .contact-actions { display: grid; grid-template-columns: 1fr auto; }
  .customer-settings-grid .customer-field,
  .customer-settings-grid .field-wide { grid-column: 1 / -1; }
  .crm-kpis, .crm-customer-grid, .crm-record-grid, .crm-recent-grid { grid-template-columns: 1fr; }
  .crm-toolbar { align-items: stretch; }
  .crm-toolbar label { justify-content: space-between; }
  .crm-calendar { min-width: 720px; }
  .crm-calendar-panel { overflow-x: auto; }
  .crm-form-row { grid-template-columns: 1fr; }
}
