:root {
    --ink: #17221d;
    --muted: #68736d;
    --line: #e3e9e5;
    --canvas: #f6f8f6;
    --paper: #ffffff;
    --green: #1e6a4c;
    --green-dark: #173f30;
    --green-soft: #eaf4ed;
    --red: #9d3232;
    --red-soft: #fff0f0;
    --shadow: 0 14px 42px rgba(25, 56, 42, .075);
    --sidebar-width: 252px;
    --sidebar-collapsed-width: 82px;
}

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

* { box-sizing: border-box; }
html { color-scheme: light; }
body { margin: 0; background: var(--canvas); color: var(--ink); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.auth-body { min-height: 100vh; display: grid; place-items: center; padding: 28px; background: radial-gradient(circle at 15% 15%, #e6f1e9 0, transparent 30%), var(--canvas); }
.auth-shell { width: min(1040px, 100%); display: grid; grid-template-columns: .9fr 1.1fr; border: 1px solid var(--line); border-radius: 24px; overflow: hidden; background: var(--paper); box-shadow: var(--shadow); }
.login-shell { max-width: 920px; }
.auth-intro { background: var(--green-dark); color: #fff; padding: clamp(38px, 6vw, 72px); display: flex; flex-direction: column; justify-content: center; }
.auth-intro h1 { font-size: clamp(32px, 4vw, 50px); line-height: 1.02; letter-spacing: -.05em; margin: 22px 0 16px; }
.auth-intro p { color: #bdd3c7; line-height: 1.7; margin: 0; }
.auth-intro .eyebrow { color: #b9d7c7; margin-top: 34px; }
.brand-mark { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 17px; background: #fff; color: var(--green-dark); font-weight: 900; letter-spacing: -.07em; box-shadow: inset 0 -7px 0 #d9e8de; }
.brand-mark.compact { width: 42px; height: 42px; border-radius: 12px; font-size: 13px; }
.check-list { list-style: none; padding: 0; margin: 30px 0 0; display: grid; gap: 13px; color: #d6e6de; font-size: 14px; }
.check-list li::before { content: "✓"; color: #8fd0ae; margin-right: 10px; font-weight: 900; }
.auth-card { padding: clamp(30px, 5vw, 60px); }
.card-heading { margin-bottom: 25px; }
.card-heading h2 { margin: 7px 0; font-size: 28px; letter-spacing: -.04em; }
.card-heading p { color: var(--muted); margin: 0; line-height: 1.55; font-size: 14px; }
.eyebrow { display: block; color: var(--green); text-transform: uppercase; letter-spacing: .13em; font-size: 10px; font-weight: 850; }
.stack-form { display: grid; gap: 16px; }
.stack-form fieldset { border: 1px solid var(--line); border-radius: 14px; padding: 18px; display: grid; gap: 13px; }
.stack-form legend { padding: 0 7px; color: var(--green-dark); font-size: 13px; font-weight: 800; }
.stack-form label > span { display: block; margin-bottom: 7px; color: var(--muted); font-size: 11px; font-weight: 750; }
.stack-form input { width: 100%; height: 46px; border: 1px solid #d5ded8; border-radius: 10px; padding: 0 13px; color: var(--ink); background: #fbfcfb; outline: 0; }
.stack-form input:focus { border-color: #6ea287; box-shadow: 0 0 0 3px rgba(30, 106, 76, .10); }
.primary-button, .secondary-button { border-radius: 10px; padding: 11px 16px; font-weight: 800; border: 1px solid transparent; }
.primary-button { background: var(--green); color: #fff; border-color: var(--green); }
.primary-button:hover { background: var(--green-dark); }
.secondary-button { background: #fff; color: var(--ink); border-color: #d6ded9; }
.full-button { width: 100%; min-height: 48px; }
.password-note, .small-note { color: var(--muted); font-size: 11px; line-height: 1.5; margin: 0; }
.small-note { text-align: center; margin-top: 16px; }
.alert { border-radius: 11px; padding: 13px 15px; margin-bottom: 18px; font-size: 12px; line-height: 1.5; }
.alert strong { display: block; margin-bottom: 4px; }
.alert ul { margin: 5px 0 0; padding-left: 18px; }
.alert-error { color: var(--red); background: var(--red-soft); border: 1px solid #f0caca; }
.alert-success { color: var(--green-dark); background: var(--green-soft); border: 1px solid #c8dfd1; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 80; width: var(--sidebar-width); padding: 18px 14px 16px; background: linear-gradient(180deg, #173f30 0%, #123529 100%); color: #fff; display: flex; flex-direction: column; overflow-x: hidden; overflow-y: auto; transition: width .18s ease, transform .2s ease; }
.sidebar-brand { display: flex; align-items: center; gap: 11px; min-height: 48px; padding: 0 5px 18px; }
.sidebar-brand strong, .sidebar-brand span { display: block; }
.sidebar-brand span { color: #a9c0b4; font-size: 12px; }
.brand-copy { min-width: 0; flex: 1; white-space: nowrap; }
.sidebar-collapse { width: 30px; height: 30px; display: grid; place-items: center; flex: 0 0 30px; border: 1px solid rgba(255,255,255,.12); border-radius: 9px; background: rgba(255,255,255,.055); color: #dceae2; font-size: 20px; line-height: 1; }
.sidebar-collapse:hover { background: rgba(255,255,255,.11); color: #fff; }
.sidebar nav { display: grid; gap: 5px; }
.nav-group { border-radius: 10px; }
.nav-group summary { min-height: 36px; display: flex; align-items: center; justify-content: space-between; padding: 7px 10px; color: #91ad9e; font-size: 9px; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; cursor: pointer; list-style: none; }
.nav-group summary::-webkit-details-marker { display: none; }
.nav-group summary::after { content: '›'; font-size: 17px; line-height: 1; transform: rotate(0); transition: transform .16s ease; }
.nav-group[open] summary::after { transform: rotate(90deg); }
.nav-group summary:hover, .nav-group summary:focus-visible { color: #fff; background: rgba(255,255,255,.05); outline: none; }
.nav-group-items { display: grid; gap: 3px; padding: 0 0 7px; }
.sidebar nav a { position: relative; color: #c1d1c8; text-decoration: none; padding: 9px 10px; border-radius: 10px; font-size: 12px; min-height: 42px; display: flex; align-items: center; gap: 11px; white-space: nowrap; }
.sidebar nav a.active { background: rgba(255, 255, 255, .12); color: #fff; box-shadow: inset 3px 0 0 #8fd0ae; }
.sidebar nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.sidebar nav .nav-standalone { margin-bottom: 4px; font-weight: 800; }
.nav-icon { width: 20px; height: 20px; display: grid; place-items: center; flex: 0 0 20px; }
.nav-icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav-icon svg path:first-child { vector-effect: non-scaling-stroke; }
.nav-label { overflow: hidden; text-overflow: ellipsis; }
.mobile-menu-toggle, .mobile-menu-close { display: none; }
.sidebar-overlay { display: none; }
.sidebar-user { margin-top: auto; padding: 16px 6px 0; border-top: 1px solid rgba(255,255,255,.1); display: flex; align-items: center; gap: 10px; }
.sidebar-user strong, .sidebar-user small { display: block; }
.sidebar-user strong { font-size: 13px; }
.sidebar-user small { color: #9db3a8; font-size: 10px; margin-top: 2px; }
.avatar { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: #d8eadf; color: var(--green-dark); font-size: 11px; font-weight: 900; }
.main-area { margin-left: var(--sidebar-width); min-height: 100vh; transition: margin-left .18s ease; }
.topbar { height: 70px; padding: 0 28px; background: rgba(255,255,255,.94); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 18px; position: sticky; top: 0; z-index: 50; backdrop-filter: blur(14px); }
.topbar-title { min-width: 0; flex: 1; }
.topbar strong, .topbar span { display: block; }
.topbar strong { font-size: 14px; }
.topbar span { color: var(--muted); font-size: 10px; margin-top: 3px; }
.topbar-status { display: flex; align-items: center; gap: 7px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px; background: #fbfcfb; color: var(--muted); font-size: 9px; font-weight: 800; white-space: nowrap; }
.topbar-status i { width: 7px; height: 7px; border-radius: 50%; background: #22a66a; box-shadow: 0 0 0 3px rgba(34,166,106,.12); }
.topbar-status span { margin: 0; color: inherit; font-size: inherit; }
.content { width: 100%; max-width: 1500px; padding: 28px; margin: 0 auto; container: swd-content / inline-size; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.page-heading h1 { margin: 6px 0 7px; font-size: clamp(30px, 4vw, 42px); line-height: 1; letter-spacing: -.055em; }
.page-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.status-pill { display: inline-flex; align-items: center; border-radius: 999px; padding: 7px 10px; background: var(--green-dark); color: #fff; font-size: 10px; font-weight: 800; white-space: nowrap; }
.status-pill.soft { color: var(--green-dark); background: var(--green-soft); }
.status-pill.muted { color: #68736d; background: #edf0ee; }
.metrics-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.metric-card, .panel { background: var(--paper); border: 1px solid var(--line); border-radius: 15px; box-shadow: 0 8px 28px rgba(25,56,42,.05); }
.metric-card { padding: 20px; }
.metric-card > span, .metric-card small { color: var(--muted); font-size: 10px; }
.metric-card strong { display: block; margin: 10px 0 4px; font-size: 31px; letter-spacing: -.05em; }
.dashboard-grid { display: grid; grid-template-columns: 1.5fr .75fr; gap: 18px; margin-bottom: 18px; }
.dashboard-live-status { display: flex; align-items: center; gap: 8px; margin: -8px 0 18px; color: var(--muted); font-size: 13px; }
.dashboard-live-status small { margin-left: auto; }
.dashboard-live-dot { width: 9px; height: 9px; border-radius: 999px; background: #22c55e; box-shadow: 0 0 0 4px rgba(34, 197, 94, .14); }
.dashboard-live-status.is-offline .dashboard-live-dot { background: #ef4444; box-shadow: 0 0 0 4px rgba(239, 68, 68, .14); }
.panel { padding: 22px; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.panel-heading > * { min-width: 0; }
.panel-heading h2 { margin: 6px 0 0; font-size: 17px; line-height: 1.35; }
.product-facts { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 20px; }
.product-facts span { padding: 5px 8px; border: 1px solid var(--line); border-radius: 999px; background: #f8faf8; color: var(--muted); font-size: 9px; font-weight: 700; }
.cost-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.cost-grid div { border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.cost-grid span, .cost-grid strong { display: block; }
.cost-grid span { color: var(--muted); font-size: 9px; }
.cost-grid strong { margin-top: 5px; font-size: 16px; }
.cost-grid .highlight { background: var(--green-dark); border-color: var(--green-dark); color: #fff; }
.cost-grid .highlight span { color: #bad0c4; }
.panel-note { color: var(--muted); font-size: 10px; line-height: 1.55; margin: 16px 0 0; }
.technology-cost-panel { margin-bottom: 18px; }
.technology-cost-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.technology-cost-grid > div { padding: 16px; border: 1px solid var(--line); border-radius: 11px; background: #fbfcfb; }
.technology-cost-grid span, .technology-cost-grid strong, .technology-cost-grid small { display: block; }
.technology-cost-grid span { color: var(--muted); font-size: 9px; font-weight: 750; }
.technology-cost-grid strong { margin: 8px 0 4px; font-size: 23px; letter-spacing: -.04em; }
.technology-cost-grid small { color: var(--muted); font-size: 9px; line-height: 1.4; }
.technology-cost-grid .technology-cost-net { background: var(--green-dark); color: #fff; border-color: var(--green-dark); }
.technology-cost-grid .technology-cost-net span, .technology-cost-grid .technology-cost-net small { color: #bad0c4; }
.dashboard-heading { align-items: center; }
.dashboard-heading-actions { display: flex; align-items: center; gap: 10px; }
.dashboard-privacy-toggle { min-height: 40px; white-space: nowrap; }
.dashboard-heading .dashboard-live-status { margin: 0; padding: 10px 13px; border: 1px solid var(--line); border-radius: 999px; background: #fff; }
.dashboard-heading .dashboard-live-status small { margin-left: 6px; padding-left: 10px; border-left: 1px solid var(--line); }
.dashboard-filter { display: flex; align-items: end; gap: 10px; padding: 14px; margin-bottom: 16px; }
.dashboard-filter label { min-width: 150px; }
.dashboard-filter label > span { display: block; margin: 0 0 6px 2px; color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; }
.dashboard-filter input, .dashboard-filter select { width: 100%; height: 42px; padding: 0 11px; border: 1px solid #d5ded8; border-radius: 9px; color: var(--ink); background: #fbfcfb; }
.dashboard-filter-channel { flex: 1; }
.dashboard-filter .primary-button, .dashboard-filter .secondary-button { min-height: 42px; white-space: nowrap; }
.dashboard-financial-overview { margin-bottom: 16px; overflow: hidden; border-color: #cfe2d7; background: linear-gradient(145deg, #ffffff 0%, #f3faf6 58%, #edf7f1 100%); }
.dashboard-financial-overview .dashboard-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 12px; }
.dashboard-financial-overview .dashboard-kpi { box-shadow: none; }
.dashboard-cost-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding-top: 2px; }
.dashboard-financial-status { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0 0 10px; }
.dashboard-financial-status span { min-width: 0; padding: 10px 12px; border: 1px solid rgba(30,106,76,.12); border-radius: 10px; background: rgba(255,255,255,.72); color: var(--muted); font-size: 10px; line-height: 1.35; }
.dashboard-financial-status b { display: block; margin-bottom: 2px; color: var(--ink); font-size: 16px; line-height: 1.1; }
.dashboard-cost-strip span { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border: 1px solid rgba(30,106,76,.12); border-radius: 10px; background: rgba(255,255,255,.72); color: var(--muted); font-size: 11px; }
.dashboard-cost-strip b { color: var(--ink); font-size: 11px; }
.dashboard-cost-strip i { color: var(--green-dark); font-size: 13px; font-style: normal; font-weight: 850; }
.dashboard-cost-bars { display: grid; gap: 8px; margin-top: 14px; padding: 14px; border: 1px solid rgba(30,106,76,.12); border-radius: 12px; background: rgba(255,255,255,.7); }
.dashboard-cost-bars > div { display: grid; grid-template-columns: minmax(110px, .65fr) minmax(140px, 2fr) minmax(70px, auto); align-items: center; gap: 10px; }
.dashboard-cost-bars span { color: var(--muted); font-size: 11px; font-weight: 750; }
.dashboard-cost-bars > div > b { height: 8px; overflow: hidden; border-radius: 999px; background: #e6eee9; }
.dashboard-cost-bars > div > b > i { display: block; width: var(--cost-width); height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--green), #62a982); }
.dashboard-cost-bars strong { font-size: 13px; text-align: right; }
.dashboard-official-finance { margin-bottom: 16px; }
.dashboard-open-orders { margin-bottom: 16px; overflow: hidden; border-color: #cbded3; background: linear-gradient(135deg, #f8fcfa 0%, #fff 72%); }
.dashboard-open-orders .panel-heading { align-items: end; margin-bottom: 14px; }
.dashboard-open-orders .panel-heading h2 { margin-bottom: 2px; }
.dashboard-open-orders .panel-note { margin: 0; font-size: 11px; }
.dashboard-period-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; }
.dashboard-period-summary article { min-width: 0; min-height: 118px; padding: 17px; border: 1px solid #d6e2db; border-radius: 15px; background: #fff; box-shadow: 0 9px 28px rgba(25,56,42,.055); }
.dashboard-period-summary span, .dashboard-period-summary strong, .dashboard-period-summary small { display: block; }
.dashboard-period-summary span { color: var(--muted); font-size: 11px; font-weight: 850; line-height: 1.35; text-transform: uppercase; letter-spacing: .055em; }
.dashboard-period-summary strong { margin: 11px 0 6px; overflow: hidden; color: var(--ink); font-size: clamp(28px, 2.5vw, 36px); line-height: 1; letter-spacing: -.05em; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-period-summary small { color: var(--muted); font-size: 10px; line-height: 1.4; }
.dashboard-period-summary-sales { border-color: #bcdccc !important; background: linear-gradient(145deg, #fff, #eef9f3) !important; }
.dashboard-period-summary-sales strong { color: var(--green-dark); }
.dashboard-period-summary-pending { border-color: #efd7aa !important; background: linear-gradient(145deg, #fff, #fffbf2) !important; }
.dashboard-period-summary-pending strong { color: #9a5f00; }
.dashboard-subheading { margin: 0 0 10px; }
.dashboard-open-order-grid { display: grid; grid-template-columns: repeat(3, minmax(190px, 1fr)); gap: 12px; }
.dashboard-open-order-grid article { position: relative; min-height: 108px; padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.dashboard-open-order-grid article:not(.dashboard-open-order-total)::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 3px; border-radius: 12px 0 0 12px; background: #d7e4dc; }
.dashboard-open-order-grid .dashboard-open-order-active { border-color: #efd7aa; background: linear-gradient(150deg, #fff 0%, #fffbf2 100%); }
.dashboard-open-order-grid .dashboard-open-order-active::before { background: #e99b16 !important; }
.dashboard-open-order-grid .dashboard-open-order-active strong { color: #9a5f00; }
.dashboard-open-order-grid .dashboard-open-order-empty { opacity: .62; }
.dashboard-open-order-grid span, .dashboard-open-order-grid strong, .dashboard-open-order-grid small { display: block; }
.dashboard-open-order-grid span { overflow: hidden; color: var(--muted); font-size: 11px; font-weight: 850; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.dashboard-open-order-grid strong { margin: 8px 0 5px; font-size: 31px; line-height: 1; letter-spacing: -.05em; }
.dashboard-open-order-grid small { color: var(--muted); font-size: 10px; line-height: 1.4; }
.dashboard-open-order-grid b { display: block; margin-top: 8px; color: var(--ink); font-size: 10px; }
.dashboard-open-order-grid .dashboard-open-order-total { border-color: var(--green-dark); background: linear-gradient(145deg, var(--green-dark), #236f53); color: #fff; }
.dashboard-open-order-grid .dashboard-open-order-total span, .dashboard-open-order-grid .dashboard-open-order-total small { color: #c9e2d5; }
body.financial-values-hidden [data-financial-value] { position: relative; color: transparent !important; text-shadow: none !important; user-select: none; }
body.financial-values-hidden [data-financial-value]::after { content: '••••'; position: absolute; inset: 50% auto auto 0; color: var(--ink); letter-spacing: .08em; transform: translateY(-50%); }
.technology-cost-net [data-financial-value]::after, .dashboard-open-order-total [data-financial-value]::after { color: #fff !important; }
.dashboard-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.dashboard-kpi { min-width: 0; padding: 18px; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 7px 24px rgba(25,56,42,.045); }
.dashboard-kpi > span, .dashboard-kpi small { display: block; color: var(--muted); font-size: 10px; line-height: 1.4; }
.dashboard-kpi > span { font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.dashboard-kpi strong { display: block; margin: 9px 0 5px; overflow: hidden; color: var(--ink); font-size: clamp(24px, 2.1vw, 31px); letter-spacing: -.05em; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-kpi-positive { background: linear-gradient(145deg, #fff, #eef8f1); border-color: #cfe5d6; }
.dashboard-kpi-positive strong { color: var(--green); }
.dashboard-analytics { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(340px, .85fr); gap: 16px; margin-bottom: 16px; }
.dashboard-analytics > *, .dashboard-operations > * { min-width: 0; }
.dashboard-chart-card { min-width: 0; }
.dashboard-chart-card .panel-heading { margin-bottom: 12px; }
.dashboard-period-badge { padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); font-size: 9px; font-weight: 800; }
.dashboard-chart-legend { display: flex; gap: 18px; margin-bottom: 10px; color: var(--muted); font-size: 9px; }
.dashboard-chart-legend span { display: flex; align-items: center; gap: 6px; }
.dashboard-chart-legend i, .channel-legend i { width: 9px; height: 9px; flex: 0 0 9px; border-radius: 50%; }
.legend-sales { background: var(--green); }.legend-profit { background: #e99b16; }
.dashboard-canvas-wrap { position: relative; width: 100%; height: 285px; }
.dashboard-canvas-wrap canvas { width: 100%; height: 100%; }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 11px; }
.chart-empty[hidden] { display: none; }
.channel-chart-layout { display: grid; grid-template-columns: minmax(150px, 180px) minmax(0, 1fr); gap: 20px; align-items: center; min-height: 285px; }
.dashboard-donut { width: 174px; aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; background: #edf1ee; }
.dashboard-donut::before { content: ''; grid-area: 1 / 1; width: 60%; aspect-ratio: 1; border-radius: 50%; background: #fff; }
.dashboard-donut > div { z-index: 1; grid-area: 1 / 1; text-align: center; }
.dashboard-donut strong, .dashboard-donut span { display: block; }.dashboard-donut strong { font-size: 27px; letter-spacing: -.05em; }.dashboard-donut span { color: var(--muted); font-size: 9px; }
.channel-legend { width: 100%; min-width: 0; display: grid; gap: 0; }
.channel-legend > div { min-width: 0; display: grid; grid-template-columns: 12px minmax(0, 1fr) minmax(24px, auto) 42px; align-items: center; gap: 7px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 10px; }
.channel-legend > div > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.channel-legend i { background: var(--channel-color, #1e6a4c); }.channel-legend i[style*="--channel-index:1"] { --channel-color: #e99b16; }.channel-legend i[style*="--channel-index:2"] { --channel-color: #3c84d8; }.channel-legend i[style*="--channel-index:3"] { --channel-color: #73aee9; }.channel-legend i[style*="--channel-index:4"] { --channel-color: #9674d6; }.channel-legend i[style*="--channel-index:5"] { --channel-color: #d96c91; }
.channel-legend small { color: var(--muted); text-align: right; }
.dashboard-operations { display: grid; grid-template-columns: minmax(250px, .7fr) minmax(350px, 1fr) minmax(420px, 1.2fr); gap: 16px; margin-bottom: 16px; }
.dashboard-actions-card > a { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 2px; border-top: 1px solid var(--line); text-decoration: none; }
.dashboard-actions-card > a:hover b { color: var(--green); }.dashboard-actions-card b, .dashboard-actions-card small { display: block; }.dashboard-actions-card b { font-size: 10px; }.dashboard-actions-card small { margin-top: 4px; color: var(--muted); font-size: 8px; }.dashboard-actions-card > a > strong { min-width: 35px; color: var(--green); font-size: 20px; text-align: right; }
.order-flow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin: 22px 0 18px; }
.order-flow a { position: relative; display: grid; justify-items: center; gap: 6px; color: var(--ink); text-decoration: none; }.order-flow a:not(:last-child)::after { content: ''; position: absolute; top: 18px; left: calc(50% + 22px); width: calc(100% - 44px); height: 3px; background: #cfe1d7; }.order-flow i { z-index: 1; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: var(--green-soft); color: var(--green); font-size: 11px; font-style: normal; font-weight: 900; }.order-flow span { color: var(--muted); font-size: 9px; }.order-flow strong { font-size: 22px; letter-spacing: -.04em; }
.dashboard-sync-note { display: flex; align-items: center; gap: 9px; padding: 12px; border-radius: 10px; background: var(--green-soft); color: var(--green-dark); font-size: 9px; }
.dashboard-products-card { min-width: 0; grid-column: 1 / -1; }.dashboard-products-card .panel-heading a { color: var(--green); font-size: 9px; font-weight: 800; text-decoration: none; }.dashboard-products-card table { min-width: 540px; }.dashboard-products-card td:first-child { max-width: 240px; }
.dashboard-capacity-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 18px; }
.dashboard-capacity-summary div { padding: 13px 9px; border-radius: 10px; background: #f5f8f6; text-align: center; }
.dashboard-capacity-summary strong, .dashboard-capacity-summary span { display: block; }
.dashboard-capacity-summary strong { font-size: 20px; letter-spacing: -.04em; }
.dashboard-capacity-summary span { margin-top: 4px; color: var(--muted); font-size: 8px; }
.dashboard-capacity-warning { display: block; margin-top: 12px; padding: 10px; border-radius: 9px; background: #fff3d9; color: #805c12; font-size: 9px; font-weight: 800; text-align: center; text-decoration: none; }
.dashboard-technology-panel { margin-bottom: 0; }
.dashboard-reconciliation-panel { margin-bottom: 16px; border-color: #d9c98d; background: linear-gradient(145deg, #fff, #fffbeb); }
.dashboard-reconciliation-panel .panel-note { margin: -4px 0 16px; }
.dashboard-reconciliation-grid { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.next-panel h2 { margin: 8px 0; font-size: 22px; letter-spacing: -.035em; }
.next-panel p { color: var(--muted); line-height: 1.6; font-size: 12px; }
.next-panel ol { margin: 20px 0 0; padding-left: 18px; display: grid; gap: 10px; color: #43534b; font-size: 12px; }
.table-panel { overflow: hidden; }
.responsive-table { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 11px; }
th, td { text-align: left; padding: 12px; border-top: 1px solid var(--line); }
th { color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-size: 8px; background: #f8faf8; }
.button-link { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.text-button { border: 0; background: transparent; color: var(--green); padding: 0; font-size: 11px; font-weight: 800; }
.danger-link { color: var(--red); }
.stack-actions { display: grid; gap: 9px; margin-top: 20px; }
.empty-copy { color: var(--muted); font-size: 12px; }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.filter-chip { text-decoration: none; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 7px 11px; color: var(--muted); font-size: 10px; font-weight: 800; }
.filter-chip.active { background: var(--green-dark); border-color: var(--green-dark); color: #fff; }
.products-table { min-width: 1050px; }
.products-table td:first-child { min-width: 260px; }
.cell-note { display: block; color: var(--muted); font-size: 9px; margin-top: 4px; }
.profit-positive { color: var(--green); font-weight: 850; }
.profit-negative { color: var(--red); font-weight: 850; }
.sales-profit-filter { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 10px; align-items: end; margin-bottom: 16px; padding: 14px; }
.sales-profit-filter label > span { display: block; margin: 0 0 6px 2px; color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; }
.sales-profit-filter input, .sales-profit-filter select { width: 100%; height: 40px; border: 1px solid #d5ded8; border-radius: 9px; padding: 0 10px; background: #fff; }
.sales-profit-filter-channel, .sales-profit-filter-search { grid-column: span 2; }
.sales-profit-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.sales-profit-alerts { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.sales-profit-alert { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; padding: 11px 13px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.sales-profit-alert span { color: var(--muted); font-size: 9px; font-weight: 750; }
.sales-profit-alert strong { font-size: 20px; }
.sales-profit-alert.is-warning { border-color: #f4d38b; background: #fffaf0; }
.sales-profit-alert.is-danger { border-color: #fecaca; background: #fff7f7; color: #991b1b; }
.sales-profit-panel .panel-note { margin: -4px 0 16px; }
.profitability-table { min-width: 2200px; }
.profit-diagnostic summary { cursor: pointer; color: #9a6700; font-weight: 800; white-space: nowrap; }
.profit-diagnostic ul { margin: 8px 0 0; padding-left: 16px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.profitability-table th:first-child, .profitability-table td:first-child { position: sticky; left: 0; z-index: 1; min-width: 300px; background: #fff; box-shadow: 1px 0 0 var(--line); }
.profitability-table th:first-child { z-index: 2; background: #f8faf8; }
.archived-row { opacity: .66; }
.row-actions { display: flex; align-items: center; gap: 11px; white-space: nowrap; }
.row-actions a { color: var(--green); text-decoration: none; font-weight: 800; }
.row-actions form { margin: 0; }
.empty-state { padding: 58px 24px; text-align: center; }
.empty-state h2 { margin: 0 0 8px; }
.empty-state p { color: var(--muted); margin: 0 0 20px; }
.back-link { color: var(--green); text-decoration: none; font-size: 11px; font-weight: 800; }
.product-form { display: grid; gap: 18px; }
.form-section { padding: 22px; }
.form-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 18px; align-items: start; }
.form-main { display: grid; gap: 18px; }
.form-grid { display: grid; gap: 13px; }
.form-grid.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.three-columns { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.four-columns { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-grid label > span { display: block; margin-bottom: 7px; color: var(--muted); font-size: 10px; font-weight: 750; }
.form-grid input, .form-grid select, .form-grid textarea { width: 100%; border: 1px solid #d5ded8; border-radius: 9px; padding: 0 11px; color: var(--ink); background: #fbfcfb; outline: 0; }
.form-grid input, .form-grid select { height: 43px; }
.form-grid textarea { min-height: 110px; padding-top: 11px; resize: vertical; }
.form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus, .compact-input:focus { border-color: #6ea287; box-shadow: 0 0 0 3px rgba(30, 106, 76, .10); }
.wide-field { grid-column: 1 / -1; }
.pdf-mode-options { border: 1px solid var(--line); border-radius: 12px; padding: 15px; display: grid; gap: 10px; }
.pdf-mode-options legend { padding: 0 6px; color: var(--muted); font-size: 10px; font-weight: 800; }
.form-grid .pdf-mode-option { display: grid; grid-template-columns: 20px 1fr; gap: 10px; align-items: start; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfb; cursor: pointer; }
.form-grid .pdf-mode-option input { width: 16px; height: 16px; margin: 2px 0 0; padding: 0; }
.form-grid .pdf-mode-option span { display: grid; gap: 4px; margin: 0; color: var(--ink); font-size: 11px; }
.form-grid .pdf-mode-option small { color: var(--muted); font-size: 9px; line-height: 1.5; }
.price-field input { border-color: #79a98f; background: #f1f8f3; font-weight: 850; }
.section-gap { margin-top: 14px; }
.cost-sidebar { position: sticky; top: 94px; padding: 22px; }
.cost-sidebar h2 { font-size: 38px; margin: 7px 0 1px; letter-spacing: -.055em; }
.cost-sidebar > p { color: var(--muted); font-size: 10px; margin-top: 0; }
.cost-list { margin: 22px 0 0; display: grid; gap: 10px; }
.cost-list div { display: flex; justify-content: space-between; gap: 16px; padding-bottom: 9px; border-bottom: 1px solid var(--line); font-size: 11px; }
.cost-list dt { color: var(--muted); }
.cost-list dd { margin: 0; font-weight: 850; }
.cost-list .total-line { margin-top: 5px; padding-top: 12px; border-top: 2px solid var(--green-dark); }
.cost-list .total-line dd { color: var(--green); }
.left-note { text-align: left; }
.pricing-table { min-width: 1650px; }
.pricing-heading-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; justify-content: flex-end; }
.fee-average { border-radius: 999px; padding: 7px 10px; background: var(--green-soft); color: var(--green-dark); font-size: 10px; font-weight: 850; white-space: nowrap; }
.compact-input { width: 100px; height: 34px; border: 1px solid #d5ded8; border-radius: 8px; padding: 0 8px; outline: 0; }
.inline-compact { display: inline-flex; align-items: center; gap: 4px; width: 90px; height: 34px; border: 1px solid #d5ded8; border-radius: 8px; padding: 0 7px; background: #fff; }
.inline-compact input { width: 58px; border: 0; outline: 0; background: transparent; }
.check-label { display: inline-flex; align-items: center; gap: 6px; font-weight: 750; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 4px 0 22px; }
.inside-actions { padding: 22px 0 0; border-top: 1px solid var(--line); margin-top: 20px; }
.inline-number { display: inline-flex; align-items: center; gap: 6px; height: 39px; min-width: 150px; border: 1px solid #d5ded8; border-radius: 8px; padding: 0 10px; background: #fbfcfb; }
.inline-number input { width: 105px; border: 0; outline: 0; background: transparent; }
.history-list { padding: 8px 22px; }
.history-item { display: grid; grid-template-columns: 13px 1fr; gap: 13px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.history-item:last-child { border-bottom: 0; }
.history-dot { width: 10px; height: 10px; margin-top: 4px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.history-item strong { font-size: 13px; }
.history-item p { color: var(--muted); font-size: 10px; margin: 5px 0; }
.history-item small { color: #42524a; font-size: 10px; }

.production-metrics { grid-template-columns: repeat(5, 1fr); }
.metric-alert { border-color: #e7b2b2; background: #fff8f8; }
.metric-alert strong { color: var(--red); }
.production-table { min-width: 1280px; }
.production-table td:nth-child(2) { min-width: 260px; }
.production-table td:nth-child(7) { min-width: 150px; }
.priority-pill { display: inline-flex; border-radius: 999px; padding: 6px 9px; font-size: 9px; font-weight: 850; background: #edf0ee; color: var(--muted); }
.priority-alta { background: #fff3d9; color: #805c12; }
.priority-urgente { background: var(--red-soft); color: var(--red); }
.status-fila { background: #edf0ee; color: #52615a; }
.status-imprimindo { background: var(--green-dark); color: #fff; }
.status-pausado { background: #fff3d9; color: #805c12; }
.status-concluido { background: var(--green-soft); color: var(--green-dark); }
.status-cancelado { background: var(--red-soft); color: var(--red); }
.due-late { color: var(--red) !important; font-weight: 850; }
.production-actions { display: flex; flex-wrap: wrap; gap: 9px 12px; align-items: center; min-width: 210px; }
.production-actions a { color: var(--green); text-decoration: none; font-weight: 800; }
.production-actions a.primary-button { color: #fff; }
.production-actions form { margin: 0; }
.inline-production-form { display: flex; gap: 7px; align-items: center; }
.inline-production-form select { max-width: 142px; height: 34px; border: 1px solid #d5ded8; border-radius: 8px; padding: 0 7px; background: #fff; font-size: 10px; }
.production-result-metrics { grid-template-columns: repeat(5, 1fr); }
.result-note { margin-top: 0; }
.completion-panel { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.completion-panel strong { font-size: 14px; }
.completion-panel p { color: var(--muted); font-size: 11px; margin: 5px 0 0; }
.completion-panel form { margin: 0; }

.printer-metrics { grid-template-columns: repeat(6, 1fr); }
.metric-warning { border-color: #ead29a; background: #fffaf0; }
.metric-warning strong { color: #805c12; }
.list-toolbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.printers-table { min-width: 1180px; }
.printers-table td:first-child { min-width: 190px; }
.printers-table td:nth-child(3) { min-width: 250px; }
.printer-status-disponivel, .printer-status-nao_conectada { background: var(--green-soft); color: var(--green-dark); }
.printer-status-imprimindo { background: var(--green-dark); color: #fff; }
.printer-status-manutencao { background: #fff3d9; color: #805c12; }
.printer-status-offline { background: #edf0ee; color: #52615a; }
.printer-actions { display: grid; gap: 9px; min-width: 210px; }
.printer-actions > a { color: var(--green); text-decoration: none; font-weight: 800; }
.printer-actions form { margin: 0; }
.inline-printer-status { display: flex; align-items: center; gap: 8px; }
.inline-printer-status select { height: 34px; border: 1px solid #d5ded8; border-radius: 8px; padding: 0 7px; background: #fff; font-size: 10px; }
.archive-panel { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.archive-panel strong { font-size: 13px; }
.archive-panel p { color: var(--muted); font-size: 11px; margin: 5px 0 0; }
.archive-panel form { margin: 0; }

.inventory-table { min-width: 1100px; }
.inventory-table td:first-child { min-width: 240px; }
.sales-table { min-width: 1500px; }
.sales-table td:first-child { min-width: 150px; }
.order-items-editor { display: grid; gap: 8px; }
.order-item-row { display: grid; grid-template-columns: minmax(320px, 2fr) repeat(3, minmax(130px, .65fr)); gap: 10px; }
.order-item-row select, .order-item-row input { width: 100%; height: 42px; border: 1px solid #d5ded8; border-radius: 9px; padding: 0 10px; background: #fbfcfb; }
.order-item-heading { color: var(--muted); text-transform: uppercase; letter-spacing: .07em; font-size: 8px; font-weight: 800; }
.date-filter { display: flex; align-items: flex-end; gap: 9px; flex-wrap: wrap; }
.date-filter label span { display: block; color: var(--muted); font-size: 9px; margin-bottom: 5px; }
.date-filter input { height: 40px; border: 1px solid #d5ded8; border-radius: 9px; padding: 0 10px; background: #fff; }
.integration-copy { font-size: 12px; line-height: 1.7; }
.purchase-items-table { min-width: 1650px; }
.purchase-items-table td:nth-child(2) { min-width: 230px; }
.purchase-items-table td:nth-child(3), .purchase-items-table td:nth-child(4) { min-width: 230px; }
.purchase-items-table input, .purchase-items-table select { width: 100%; min-width: 120px; height: 38px; border: 1px solid #d5ded8; border-radius: 8px; padding: 0 8px; background: #fbfcfb; color: var(--ink); }
.checkbox-row { display: flex !important; align-items: center; gap: 8px; min-height: 43px; color: var(--ink) !important; }
.checkbox-row input { width: auto; height: auto; }
.integration-steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 20px; }
.integration-steps span { background: var(--green-soft); color: var(--green-dark); padding: 11px 8px; border-radius: 9px; font-size: 9px; font-weight: 800; text-align: center; }
.pilot-settings-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(230px, .6fr); gap: 18px; margin-top: 18px; align-items: end; }
.pilot-action { display: flex; align-items: end; }
.pilot-action button { min-height: 43px; }
.pilot-sync-form { display: grid; gap: 8px; }
.pilot-sync-form button { min-height: 46px; }
.pilot-sync-form button:disabled { opacity: .55; cursor: not-allowed; }
.pilot-sync-form small { color: var(--muted); font-size: 9px; line-height: 1.45; }
.status-agendada, .status-novo { background: #edf0ee; color: #52615a; }
.status-em_andamento, .status-em_producao { background: #fff3d9; color: #805c12; }
.status-concluida, .status-pronto, .status-enviado { background: var(--green-soft); color: var(--green-dark); }
.status-cancelada, .status-reembolsado { background: var(--red-soft); color: var(--red); }

.planning-metrics { grid-template-columns: repeat(7, 1fr); }
.planning-alert-panel { margin-bottom: 18px; }
.compact-empty { padding: 24px; }
.compact-empty h3 { margin: 0 0 6px; font-size: 15px; }
.compact-empty p { margin: 0; }
.alert-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
.planning-alert { border: 1px solid var(--line); border-left: 4px solid #d9a532; border-radius: 11px; padding: 14px; background: #fffaf0; }
.planning-alert.danger { border-left-color: var(--red); background: #fff8f8; }
.planning-alert strong, .planning-alert span, .planning-alert small { display: block; }
.planning-alert strong { font-size: 11px; }
.planning-alert span { margin-top: 5px; font-size: 12px; }
.planning-alert small { margin-top: 5px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.planning-alert a { display: inline-block; margin-top: 10px; color: var(--green); font-size: 10px; font-weight: 800; text-decoration: none; }
.printer-load-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
.printer-load-card { padding: 15px; border: 1px solid var(--line); border-radius: 11px; background: #fbfcfb; }
.printer-load-card > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.printer-load-card > small, .printer-load-card > span { color: var(--muted); font-size: 9px; }
.printer-load-card p { margin: 14px 0 6px; font-size: 11px; }
.printer-load-card p b { font-size: 16px; }
.printer-blocked { background: #f3f4f3; opacity: .72; }
.daily-capacity-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.daily-capacity-grid article { padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfb; }
.daily-capacity-grid span, .daily-capacity-grid small { display: block; color: var(--muted); font-size: 8px; }
.daily-capacity-grid strong { display: block; margin: 7px 0; font-size: 18px; }
.capacity-bar { height: 6px; margin-bottom: 8px; overflow: hidden; border-radius: 999px; background: #e8eeea; }
.capacity-bar i { display: block; height: 100%; border-radius: inherit; background: var(--green); }
.planning-table { min-width: 1580px; }
.planning-table td:nth-child(2) { min-width: 250px; }
.risk-pill { display: inline-flex; border-radius: 999px; padding: 6px 9px; font-size: 9px; font-weight: 850; white-space: nowrap; }
.risk-atrasado, .risk-risco, .risk-bloqueado { color: var(--red); background: var(--red-soft); }
.risk-atencao { color: #805c12; background: #fff3d9; }
.risk-no_prazo { color: var(--green-dark); background: var(--green-soft); }
.risk-sem_prazo { color: #52615a; background: #edf0ee; }
.suggestion-note { color: var(--green); font-weight: 800; }
.planning-printer-choice select { max-width: 180px; height: 34px; margin-bottom: 7px; border: 1px solid #d5ded8; border-radius: 8px; padding: 0 7px; background: #fff; font-size: 9px; }
.planning-settings-panel { margin-top: 18px; }
.compact-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)) auto; gap: 14px; align-items: end; }
.planning-settings-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) auto; }
.compact-form-grid label > span, .compact-form-grid label > small { display: block; color: var(--muted); font-size: 9px; }
.compact-form-grid input { width: 100%; height: 42px; margin: 6px 0; border: 1px solid #d5ded8; border-radius: 9px; padding: 0 10px; }
.compact-form-grid .form-actions { padding: 0; }

.assistant-heading { margin-bottom: 18px; }
.assistant-status { display: inline-flex; align-items: center; gap: 7px; border-radius: 999px; padding: 9px 13px; font-size: 9px; font-weight: 850; text-transform: uppercase; letter-spacing: .05em; }
.assistant-status::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.assistant-status.local { color: var(--green-dark); background: var(--green-soft); }
.assistant-metrics { grid-template-columns: repeat(4, 1fr); }
.assistant-layout { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(290px, .7fr); gap: 18px; align-items: start; }
.assistant-chat-panel { padding-bottom: 0; overflow: hidden; }
.assistant-messages { min-height: 340px; max-height: 590px; overflow-y: auto; display: grid; align-content: start; gap: 14px; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.assistant-message { display: flex; gap: 11px; max-width: 88%; }
.assistant-message-user { justify-self: end; flex-direction: row-reverse; }
.assistant-avatar { flex: 0 0 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--green-dark); color: #fff; font-size: 10px; font-weight: 900; }
.assistant-message-user .assistant-avatar { background: #e5eae7; color: var(--ink); }
.assistant-message > div:last-child { padding: 11px 13px; border-radius: 4px 13px 13px 13px; background: var(--green-soft); }
.assistant-message-user > div:last-child { border-radius: 13px 4px 13px 13px; background: #f0f2f1; }
.assistant-message strong { font-size: 10px; }
.assistant-message p { margin: 5px 0 0; font-size: 11px; line-height: 1.65; white-space: normal; }
.assistant-message small { display: block; margin-top: 7px; color: var(--muted); font-size: 8px; }
.assistant-composer { padding: 17px 0 2px; }
.assistant-composer > label { display: block; margin-bottom: 7px; color: var(--muted); font-size: 9px; font-weight: 800; }
.assistant-composer > div { display: grid; grid-template-columns: 1fr auto; gap: 9px; align-items: end; }
.assistant-composer textarea { width: 100%; resize: vertical; min-height: 74px; border: 1px solid #d5ded8; border-radius: 11px; padding: 11px; background: #fbfcfb; color: var(--ink); font: inherit; font-size: 11px; line-height: 1.5; }
.assistant-composer > small { display: block; margin-top: 7px; color: var(--muted); font-size: 8px; }
.assistant-sidebar { display: grid; gap: 18px; }
.assistant-suggestion-list { display: grid; gap: 8px; }
.assistant-suggestion-list form { margin: 0; }
.assistant-suggestion-list button { width: 100%; text-align: left; border: 1px solid var(--line); border-radius: 10px; padding: 11px; background: #fbfcfb; color: var(--ink); cursor: pointer; }
.assistant-suggestion-list button:hover { border-color: var(--green); background: var(--green-soft); }
.assistant-suggestion-list strong, .assistant-suggestion-list span { display: block; }
.assistant-suggestion-list strong { font-size: 10px; }
.assistant-suggestion-list span { margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.4; }
.assistant-connection-card p { color: var(--muted); font-size: 10px; line-height: 1.65; }
.assistant-connection-card dl { margin: 15px 0 0; }
.assistant-connection-card dl div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 9px; }
.assistant-connection-card dt { color: var(--muted); }
.assistant-connection-card dd { margin: 0; font-weight: 800; }

.mobile-quick-nav { display: none; }

@media (min-width: 721px) {
    body.sidebar-collapsed .sidebar { width: var(--sidebar-collapsed-width); padding-inline: 12px; }
    body.sidebar-collapsed .main-area { margin-left: var(--sidebar-collapsed-width); }
    body.sidebar-collapsed .sidebar-brand { justify-content: center; padding-inline: 0; }
    body.sidebar-collapsed .brand-copy,
    body.sidebar-collapsed .sidebar-user-copy,
    body.sidebar-collapsed .nav-group summary,
    body.sidebar-collapsed .nav-label { display: none; }
    body.sidebar-collapsed .sidebar-collapse { position: absolute; top: 68px; right: 8px; width: 26px; height: 26px; font-size: 17px; background: #214c3b; }
    body.sidebar-collapsed .nav-group-items { display: grid; padding: 0; }
    body.sidebar-collapsed .sidebar nav { gap: 2px; padding-top: 34px; }
    body.sidebar-collapsed .sidebar nav a { justify-content: center; min-height: 44px; padding: 10px; }
    body.sidebar-collapsed .sidebar nav a::after { content: attr(data-nav-label); position: fixed; left: 72px; z-index: 120; max-width: 220px; padding: 7px 9px; border-radius: 7px; background: #102d23; color: #fff; box-shadow: var(--shadow); font-size: 10px; pointer-events: none; opacity: 0; transform: translateX(-4px); transition: opacity .12s ease, transform .12s ease; }
    body.sidebar-collapsed .sidebar nav a:hover::after,
    body.sidebar-collapsed .sidebar nav a:focus-visible::after { opacity: 1; transform: translateX(0); }
    body.sidebar-collapsed .sidebar-user { justify-content: center; padding-inline: 0; }
}

@media (max-width: 1450px) {
    .dashboard-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
    .metrics-grid { grid-template-columns: repeat(2, 1fr); }
    .dashboard-grid { grid-template-columns: 1fr; }
    .auth-shell { grid-template-columns: 1fr; }
    .auth-intro { padding: 38px; }
    .form-layout { grid-template-columns: 1fr; }
    .cost-sidebar { position: static; }
    .form-grid.four-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .production-metrics { grid-template-columns: repeat(2, 1fr); }
    .production-result-metrics { grid-template-columns: repeat(2, 1fr); }
    .printer-metrics { grid-template-columns: repeat(2, 1fr); }
    .integration-steps { grid-template-columns: repeat(2, 1fr); }
    .planning-metrics { grid-template-columns: repeat(2, 1fr); }
    .alert-list, .printer-load-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .daily-capacity-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .compact-form-grid { grid-template-columns: 1fr 1fr; }
    .assistant-layout { grid-template-columns: 1fr; }
    .assistant-metrics { grid-template-columns: repeat(2, 1fr); }
    .pilot-settings-grid { grid-template-columns: 1fr; }
    .technology-cost-grid { grid-template-columns: repeat(2, 1fr); }
    .dashboard-kpis { grid-template-columns: repeat(3, 1fr); }
    .dashboard-financial-overview .dashboard-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-cost-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-analytics { grid-template-columns: 1fr; }
    .dashboard-operations { grid-template-columns: 1fr 1fr; }
    .dashboard-products-card { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
    html, body { width: 100%; max-width: 100%; overflow-x: hidden; }
    .main-area, .content, .page-heading, .panel, .metric-card, .table-panel, .responsive-table, form, fieldset { min-width: 0; max-width: 100%; }
    .panel, .metric-card, .page-heading, .panel-heading, td, th, p, strong, small, a, label, dd { overflow-wrap: anywhere; }
    .auth-body { padding: 14px; }
    body.mobile-menu-open { overflow: hidden; }
    .sidebar { position: fixed; inset: 0 auto 0 0; width: min(86vw, 330px); padding: 18px 14px 18px; z-index: 1002; transform: translateX(-105%); transition: transform .2s ease; box-shadow: 18px 0 50px rgba(8, 27, 19, .28); }
    .mobile-menu-open .sidebar { transform: translateX(0); }
    .sidebar-overlay { position: fixed; inset: 0; z-index: 1001; border: 0; background: rgba(8, 24, 17, .55); }
    .mobile-menu-open .sidebar-overlay { display: block; }
    .sidebar nav { display: grid; overflow: visible; padding-top: 4px; }
    .sidebar-user { display: flex; }
    .sidebar-brand { padding: 0 2px 18px; }
    .sidebar-collapse { display: none; }
    .mobile-menu-close { display: grid; place-items: center; width: 44px; height: 44px; margin-left: auto; border: 0; border-radius: 10px; background: rgba(255,255,255,.08); color: #fff; font-size: 25px; }
    .main-area { margin-left: 0; }
    .topbar { height: 64px; padding: 0 12px; gap: 9px; z-index: 900; }
    .mobile-menu-toggle { display: grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--green-dark); font-size: 20px; }
    .topbar-title { min-width: 0; flex: 1; }
    .topbar-title strong, .topbar-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .topbar-status { display: none; }
    .logout-form .secondary-button { min-width: 44px; min-height: 42px; padding: 8px 10px; }
    .content { padding: 22px 14px 92px; }
    .mobile-quick-nav { position: fixed; inset: auto 10px 10px; z-index: 850; min-height: 62px; display: grid; grid-template-columns: repeat(auto-fit, minmax(56px, 1fr)); align-items: center; padding: 6px; border: 1px solid rgba(211,221,215,.9); border-radius: 17px; background: rgba(255,255,255,.96); box-shadow: 0 16px 46px rgba(18,53,41,.18); backdrop-filter: blur(15px); }
    .mobile-quick-nav a, .mobile-quick-nav button { min-width: 0; min-height: 48px; display: grid; place-items: center; align-content: center; gap: 3px; border: 0; border-radius: 11px; background: transparent; color: var(--muted); text-decoration: none; }
    .mobile-quick-nav a.active { background: var(--green-soft); color: var(--green-dark); }
    .mobile-quick-nav span { font-size: 18px; line-height: 1; }
    .mobile-quick-nav small { max-width: 100%; overflow: hidden; font-size: 8px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
    .page-heading { align-items: flex-start; flex-direction: column; }
    .cost-grid { grid-template-columns: repeat(2, 1fr); }
    .form-grid.two-columns, .form-grid.three-columns, .form-grid.four-columns { grid-template-columns: 1fr; }
    .wide-field { grid-column: auto; }
    .form-actions { flex-direction: column-reverse; }
    .form-actions > * { width: 100%; }
    .production-metrics { grid-template-columns: repeat(2, 1fr); }
    .printer-metrics { grid-template-columns: repeat(2, 1fr); }
    .list-toolbar { align-items: flex-start; flex-direction: column; }
    .archive-panel { align-items: flex-start; flex-direction: column; }
    .order-item-heading { display: none; }
    .order-item-row { grid-template-columns: 1fr 1fr; padding: 12px; border: 1px solid var(--line); border-radius: 11px; }
    .order-item-row select { grid-column: 1 / -1; }
    .date-filter { width: 100%; }
    .alert-list, .printer-load-grid, .compact-form-grid, .daily-capacity-grid { grid-template-columns: 1fr; }
    .assistant-composer > div { grid-template-columns: 1fr; }
    .assistant-composer button { width: 100%; }
    .dashboard-heading-actions { width: 100%; align-items: stretch; display: grid; grid-template-columns: auto 1fr; }
    .dashboard-heading .dashboard-live-status { width: 100%; min-width: 0; border-radius: 11px; }
    .dashboard-heading .dashboard-live-status span:not(.dashboard-live-dot) { display: none; }
    .dashboard-filter { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; gap: 7px; padding: 10px; }
    .dashboard-filter label { width: 100%; min-width: 0; }
    .dashboard-filter label > span { margin-bottom: 3px; font-size: 7px; }
    .dashboard-filter input, .dashboard-filter select { height: 36px; padding-inline: 8px; font-size: 11px; }
    .dashboard-filter-channel { grid-column: 1 / -1; }
    .dashboard-filter .primary-button, .dashboard-filter .secondary-button { min-height: 36px; padding: 7px 9px; font-size: 10px; }
    .dashboard-kpis { grid-template-columns: repeat(2, 1fr); }
    .dashboard-financial-overview { padding: 14px; }
    .dashboard-financial-overview .dashboard-kpis { gap: 8px; }
    .dashboard-financial-overview .dashboard-kpi { padding: 13px; }
    .dashboard-cost-strip { gap: 6px; }
    .dashboard-financial-status { grid-template-columns: 1fr; }
    .dashboard-cost-strip span { align-items: flex-start; flex-direction: column; }
    .dashboard-cost-bars { padding: 10px; }
    .dashboard-cost-bars > div { grid-template-columns: minmax(85px, .8fr) minmax(80px, 1.4fr) auto; gap: 7px; }
    .dashboard-open-order-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
    .dashboard-open-order-grid article { padding: 12px; }
    .channel-chart-layout { grid-template-columns: 1fr; justify-items: center; }
    .channel-legend { width: 100%; }
    .dashboard-operations { grid-template-columns: 1fr; }
    .dashboard-products-card { grid-column: auto; }
    .sales-profit-filter { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; padding: 10px; }
    .sales-profit-filter-channel { grid-column: 1 / -1; }
    .sales-profit-filter-search { grid-column: 1 / -1; }
    .sales-profit-filter .primary-button, .sales-profit-filter .secondary-button { width: 100%; min-height: 38px; padding: 8px; font-size: 10px; }
    .sales-profit-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sales-profit-alerts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .profitability-table { min-width: 0; }
    .profitability-table thead { display: none; }
    .profitability-table, .profitability-table tbody, .profitability-table tr, .profitability-table td { display: block; width: 100%; }
    .profitability-table tr { margin: 0 0 12px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
    .profitability-table td { position: static !important; min-width: 0 !important; display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 10px 12px; border-top: 1px solid var(--line); box-shadow: none !important; text-align: right; }
    .profitability-table td:first-child { display: block; padding: 14px 12px; border-top: 0; text-align: left; }
    .profitability-table td:not(:first-child)::before { content: attr(data-label); flex: 1; color: var(--muted); font-size: 8px; font-weight: 800; text-align: left; text-transform: uppercase; letter-spacing: .05em; }
    .responsive-table { width: 100%; overflow-x: hidden; }
    .mobile-card-table:not(.profitability-table) { min-width: 0 !important; border-collapse: separate; border-spacing: 0 10px; }
    .mobile-card-table:not(.profitability-table) thead { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
    .mobile-card-table:not(.profitability-table),
    .mobile-card-table:not(.profitability-table) tbody,
    .mobile-card-table:not(.profitability-table) tr,
    .mobile-card-table:not(.profitability-table) td { display: block; width: 100%; }
    .mobile-card-table:not(.profitability-table) tr { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
    .mobile-card-table:not(.profitability-table) td { min-width: 0 !important; max-width: 100% !important; display: grid; grid-template-columns: minmax(88px, .7fr) minmax(0, 1.3fr); gap: 12px; align-items: start; padding: 10px 12px; border-top: 1px solid var(--line); text-align: right; white-space: normal; }
    .mobile-card-table:not(.profitability-table) td:first-child { border-top: 0; }
    .mobile-card-table:not(.profitability-table) td::before { content: attr(data-label); color: var(--muted); font-size: 8px; font-weight: 850; line-height: 1.4; text-align: left; text-transform: uppercase; letter-spacing: .05em; }
    .mobile-card-table:not(.profitability-table) td[colspan] { display: block; text-align: left; }
    .mobile-card-table:not(.profitability-table) td[colspan]::before { content: none; }
    .mobile-card-table:not(.profitability-table) td > * { min-width: 0; max-width: 100%; justify-self: end; }
    .mobile-card-table:not(.profitability-table) td > strong,
    .mobile-card-table:not(.profitability-table) td > .cell-note { text-align: right; }
    .mobile-card-table:not(.profitability-table) .row-actions,
    .mobile-card-table:not(.profitability-table) .printer-actions,
    .mobile-card-table:not(.profitability-table) .production-actions { min-width: 0; justify-content: flex-end; }
    .mobile-card-table:not(.profitability-table) input,
    .mobile-card-table:not(.profitability-table) select,
    .mobile-card-table:not(.profitability-table) .inline-number { min-width: 0; max-width: 100%; }
    .completion-panel, .publication-list > div, .operations-definition-list > div, .assistant-connection-card dl div, .pdf-progress-heading { align-items: flex-start; flex-direction: column; }
    .completion-panel > *, .publication-list > div > *, .operations-definition-list dd, .assistant-connection-card dd { width: 100%; max-width: 100%; text-align: left; }
}

/*
 * Dashboard responsiveness follows the usable content area, not only the
 * browser viewport. This matters on TV, tablets and desktop zoom because the
 * fixed sidebar can remove 252px before the dashboard grid is laid out.
 */
@container swd-content (max-width: 1180px) {
    .dashboard-operations { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-capacity-card { grid-column: 1 / -1; }
    .dashboard-financial-overview .dashboard-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .dashboard-period-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@container swd-content (max-width: 950px) {
    .dashboard-analytics { grid-template-columns: minmax(0, 1fr); }
    .dashboard-operations { grid-template-columns: minmax(0, 1fr); }
    .dashboard-capacity-card { grid-column: auto; }
    .dashboard-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .technology-cost-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@container swd-content (max-width: 760px) {
    .dashboard-heading { align-items: flex-start; flex-direction: column; }
    .dashboard-heading-actions { width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: stretch; }
    .dashboard-heading .dashboard-live-status { width: 100%; min-width: 0; border-radius: 11px; }
    .dashboard-filter { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; }
    .dashboard-filter label { width: 100%; min-width: 0; }
    .dashboard-filter-channel { grid-column: 1 / -1; }
    .dashboard-kpis, .dashboard-financial-overview .dashboard-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-cost-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-open-order-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .channel-chart-layout { grid-template-columns: minmax(0, 1fr); justify-items: center; }
    .channel-legend { width: 100%; }
}

@container swd-content (max-width: 520px) {
    .dashboard-heading-actions { grid-template-columns: minmax(0, 1fr); }
    .dashboard-privacy-toggle { width: 100%; }
    .dashboard-filter .primary-button, .dashboard-filter .secondary-button { width: 100%; }
    .dashboard-cost-bars > div { grid-template-columns: minmax(80px, .8fr) minmax(70px, 1.4fr) auto; gap: 7px; }
    .technology-cost-grid { grid-template-columns: minmax(0, 1fr); }
    .dashboard-capacity-summary { grid-template-columns: minmax(0, 1fr); }
    .dashboard-period-summary { grid-template-columns: minmax(0, 1fr); }
    .dashboard-open-order-grid { grid-template-columns: minmax(0, 1fr); }
    .dashboard-period-summary article, .dashboard-open-order-grid article { min-height: 0; }
    .dashboard-open-orders .panel-heading { align-items: stretch; flex-direction: column; }
    .dashboard-open-orders .panel-heading .button-link { width: 100%; min-height: 42px; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
    .sidebar, .nav-group summary::after { transition: none; }
}

@media (max-width: 440px) {
    .metrics-grid { grid-template-columns: 1fr; }
    .auth-card, .auth-intro { padding: 26px 20px; }
    .cost-grid { grid-template-columns: 1fr; }
    .production-metrics { grid-template-columns: 1fr; }
    .printer-metrics { grid-template-columns: 1fr; }
    .order-item-row { grid-template-columns: 1fr; }
    .order-item-row select { grid-column: auto; }
    .integration-steps { grid-template-columns: 1fr; }
    .planning-metrics { grid-template-columns: 1fr; }
    .assistant-metrics { grid-template-columns: 1fr; }
    .technology-cost-grid { grid-template-columns: 1fr; }
    .dashboard-official-finance .technology-cost-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-official-finance .technology-cost-grid > div { padding: 12px; }
    .dashboard-official-finance .technology-cost-grid strong { font-size: 18px; }
    .dashboard-kpis { grid-template-columns: 1fr; }
    .dashboard-financial-overview .dashboard-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sales-profit-metrics { grid-template-columns: 1fr; }
    .sales-profit-alerts { grid-template-columns: 1fr; }
    .order-flow { grid-template-columns: repeat(2, 1fr); gap: 16px; }
    .order-flow a::after { display: none; }
}

/*
 * SWD interface system — 2026-09
 * One calm visual language across commercial, production, inventory and
 * finance. These rules intentionally sit last so legacy screens inherit the
 * new shell without changing any operational calculation or form action.
 */
:root {
    --ink: #17211c;
    --muted: #66736c;
    --line: #dce5df;
    --canvas: #f3f6f3;
    --paper: #ffffff;
    --green: #176b4c;
    --green-dark: #123f30;
    --green-soft: #eaf5ee;
    --amber: #b66b00;
    --amber-soft: #fff7e8;
    --red: #a63434;
    --red-soft: #fff2f2;
    --shadow-soft: 0 8px 28px rgba(20, 55, 40, .055);
    --shadow: 0 18px 48px rgba(20, 55, 40, .09);
}

body { background: linear-gradient(180deg, #f7f9f7 0, var(--canvas) 360px); }
.sidebar { background: linear-gradient(180deg, #164333 0%, #0e3326 100%); }
.sidebar nav { gap: 6px; }
.sidebar nav .nav-standalone {
    min-height: 48px;
    margin-bottom: 10px;
    background: rgba(255,255,255,.055);
    border: 1px solid rgba(255,255,255,.08);
    font-size: 13px;
}
.sidebar nav .nav-standalone.active { background: rgba(255,255,255,.15); }
.nav-group { border-top: 1px solid rgba(255,255,255,.075); border-radius: 0; padding-top: 5px; }
.nav-group summary { min-height: 32px; padding-inline: 9px; }
.nav-group-items { padding-bottom: 8px; }
.topbar { height: 66px; padding-inline: clamp(18px, 2.2vw, 34px); box-shadow: 0 1px 0 rgba(18,63,48,.02); }
.content { max-width: 1660px; padding: clamp(22px, 2.2vw, 34px); }

.page-heading { align-items: center; margin-bottom: 22px; }
.page-heading h1 { margin: 5px 0 7px; font-size: clamp(30px, 3.2vw, 43px); }
.page-heading p { max-width: 760px; font-size: 13px; line-height: 1.55; }
.eyebrow { color: #1b7252; letter-spacing: .15em; }

.panel, .metric-card {
    border-color: var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow-soft);
}
.panel { margin-bottom: 18px; padding: clamp(18px, 1.7vw, 26px); }
.panel-heading { align-items: center; margin-bottom: 18px; }
.panel-heading h2 { margin-top: 5px; font-size: clamp(17px, 1.35vw, 21px); letter-spacing: -.025em; }
.panel-heading p { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }

.metrics-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 205px), 1fr));
    gap: 12px;
    margin-bottom: 18px;
}
.metric-card { min-width: 0; min-height: 132px; padding: 18px; }
.metric-card > span { display: block; font-weight: 850; letter-spacing: .055em; text-transform: uppercase; }
.metric-card strong { margin: 12px 0 7px; overflow: hidden; font-size: clamp(25px, 2.1vw, 34px); line-height: 1; text-overflow: ellipsis; white-space: nowrap; }
.metric-card small { display: block; line-height: 1.4; }
.metric-success, .dashboard-kpi-positive { border-color: #bcdcca; background: linear-gradient(145deg, #fff, #edf8f1); }
.metric-success strong { color: var(--green); }
.metric-warning { border-color: #ecd49f; background: var(--amber-soft); }
.metric-alert { border-color: #e8baba; background: var(--red-soft); }

.primary-button, .secondary-button, .danger-button {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    line-height: 1.2;
}
.primary-button { box-shadow: 0 7px 18px rgba(23,107,76,.13); }
.primary-button:focus-visible, .secondary-button:focus-visible, .danger-button:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
    outline: 3px solid rgba(23,107,76,.2);
    outline-offset: 2px;
}

.filter-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.filter-chip { min-height: 36px; display: inline-flex; align-items: center; padding: 0 13px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--muted); font-size: 10px; font-weight: 800; text-decoration: none; }
.filter-chip.active { border-color: var(--green-dark); background: var(--green-dark); color: #fff; }
.form-section, .dashboard-filter, .sales-profit-filter { background: rgba(255,255,255,.92); }
.date-filter { padding: 9px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.78); }

.table-panel { padding: 0; }
.table-panel > .panel-heading, .table-panel > .panel-note { margin-inline: clamp(18px, 1.7vw, 26px); }
.table-panel > .panel-heading { margin-top: clamp(18px, 1.7vw, 26px); }
.table-panel > .responsive-table { border-top: 1px solid var(--line); }
.responsive-table { scrollbar-width: thin; scrollbar-color: #b9c9c0 transparent; }
table { font-size: 11px; }
th { position: sticky; top: 0; z-index: 2; padding: 11px 14px; background: #f4f7f5; color: #68746e; }
td { padding: 14px; vertical-align: middle; }
tbody tr { transition: background .14s ease; }
tbody tr:hover { background: #f8fbf9; }
.cell-note { line-height: 1.45; }
.row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 13px; }
.row-actions a { color: var(--green); font-weight: 800; text-decoration: none; }

.status-pill { min-height: 27px; align-items: center; padding: 6px 10px; }
.empty-state { padding: clamp(34px, 7vw, 76px) 24px; text-align: center; }
.empty-state h2 { margin: 0 0 8px; font-size: 22px; }
.empty-state p { max-width: 520px; margin: 0 auto 18px; color: var(--muted); line-height: 1.55; }

/* Dashboard: summary first, detail on demand, readable without oversized cards. */
.page-dashboard .content { max-width: 1720px; }
.dashboard-audit-details { padding: 0; overflow: hidden; }
.dashboard-audit-details > summary { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 22px; cursor: pointer; list-style: none; }
.dashboard-audit-details > summary::-webkit-details-marker { display: none; }
.dashboard-audit-details > summary strong, .dashboard-audit-details > summary small { display: block; }
.dashboard-audit-details > summary strong { margin-top: 5px; font-size: 16px; }
.dashboard-audit-details > summary small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.dashboard-audit-details[open] > summary { border-bottom: 1px solid var(--line); background: #fffaf0; }
.dashboard-audit-content { padding: 20px 22px 22px; }
.dashboard-period-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.dashboard-period-summary article { min-height: 116px; padding: 17px 18px; }
.dashboard-period-summary strong { font-size: clamp(27px, 2.2vw, 35px); }
.dashboard-open-order-grid { grid-template-columns: repeat(auto-fit, minmax(185px, 1fr)); }
.dashboard-open-order-grid article { min-height: 104px; }
.dashboard-financial-overview .dashboard-kpis { grid-template-columns: repeat(auto-fit, minmax(205px, 1fr)); }
.dashboard-kpi { min-height: 126px; padding: 18px; }
.dashboard-kpi strong { font-size: clamp(25px, 2vw, 32px); }
.dashboard-cost-strip span { min-height: 48px; }
.dashboard-financial-status span { min-height: 58px; }
.dashboard-reconciliation-panel { background: #fffdf7; }
.dashboard-close-summary { border-style: dashed; box-shadow: none; }

/* Commercial screens keep money and action status visually dominant. */
.page-sales .production-metrics,
.page-product_sales .sales-profit-metrics,
.page-expenses .production-metrics,
.page-cash_flow .production-metrics,
.page-reports .production-metrics { grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); }
.sales-profit-filter { gap: 10px; }
.sales-profit-alerts { gap: 10px; }
.sales-profit-alert { min-height: 78px; border-radius: 14px; }

/* Inventory and purchasing screens use a quieter background and clearer stock states. */
.page-filaments .metric-card:nth-child(2),
.page-packaging .metric-card:nth-child(3) { border-color: #bcdcca; background: linear-gradient(145deg,#fff,#eff8f2); }
.page-filaments .inventory-table td:nth-child(3),
.page-packaging .inventory-table td:nth-child(4) { background: #fbfdfb; }
.page-purchases .form-section { padding-block: 16px; }

/* Production: preserve density, but make the queue scannable. */
.page-production .production-metrics,
.page-production_planning .planning-metrics { grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); }
.page-production .production-table tbody tr { border-left: 3px solid transparent; }
.page-production .production-table tbody tr:hover { border-left-color: var(--green); }

/* Integration and catalog screens communicate flow instead of technical bulk. */
.page-integrations .dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.page-integrations .integration-steps { margin-top: 16px; }
.page-catalog_multichannel .catalog-flow article { box-shadow: none; }
.page-catalog_multichannel .catalog-health-panel { border-color: #bcdcca; }

@media (max-width: 1080px) {
    .page-integrations .dashboard-grid { grid-template-columns: 1fr; }
    .page-heading { align-items: flex-start; }
    .dashboard-period-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
    body { background: var(--canvas); }
    .content { padding: 18px 12px 92px; }
    .page-heading { gap: 14px; margin-bottom: 18px; }
    .page-heading h1 { font-size: 31px; }
    .page-heading > a, .page-heading > button { width: 100%; }
    .panel { padding: 16px; border-radius: 15px; }
    .metric-card { min-height: 112px; padding: 15px; border-radius: 15px; }
    .metrics-grid, .production-metrics, .printer-metrics,
    .page-sales .production-metrics,
    .page-product_sales .sales-profit-metrics,
    .page-expenses .production-metrics,
    .page-cash_flow .production-metrics,
    .page-reports .production-metrics,
    .page-production .production-metrics,
    .page-production_planning .planning-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
    }
    .metric-card strong { font-size: clamp(23px, 8vw, 30px); white-space: normal; }
    .table-panel { padding: 12px; overflow: visible; }
    .table-panel > .panel-heading, .table-panel > .panel-note { margin-inline: 0; }
    .table-panel > .panel-heading { margin-top: 0; }
    .table-panel > .responsive-table { border-top: 0; }
    .mobile-card-table:not(.profitability-table) { border-spacing: 0 10px; }
    .mobile-card-table:not(.profitability-table) tr { box-shadow: 0 5px 18px rgba(20,55,40,.04); }
    .mobile-card-table:not(.profitability-table) td { grid-template-columns: minmax(92px,.75fr) minmax(0,1.25fr); }
    .dashboard-period-summary, .dashboard-open-order-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-period-summary article, .dashboard-open-order-grid article { min-height: 106px; }
    .dashboard-period-summary strong { font-size: clamp(25px, 8vw, 32px); white-space: normal; }
    .dashboard-financial-overview .dashboard-kpis { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .dashboard-kpi { min-height: 116px; }
    .dashboard-kpi strong { white-space: normal; }
    .date-filter { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); }
    .date-filter button { grid-column: 1 / -1; }
}

@media (max-width: 420px) {
    .metrics-grid, .production-metrics, .printer-metrics,
    .page-sales .production-metrics,
    .page-product_sales .sales-profit-metrics,
    .page-expenses .production-metrics,
    .page-cash_flow .production-metrics,
    .page-reports .production-metrics,
    .page-production .production-metrics,
    .page-production_planning .planning-metrics,
    .dashboard-period-summary,
    .dashboard-open-order-grid,
    .dashboard-financial-overview .dashboard-kpis { grid-template-columns: 1fr; }
    .metric-card, .dashboard-period-summary article, .dashboard-open-order-grid article, .dashboard-kpi { min-height: 0; }
}
.usage-progress { height: 12px; overflow: hidden; border-radius: 999px; background: #e5e7eb; margin-top: 16px; }
.usage-progress > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #16a34a, #f59e0b 82%, #dc2626); transition: width .25s ease; }
.alert-warning { background: #fff7ed; color: #9a3412; border: 1px solid #fed7aa; }
.pdf-organizer-panel { max-width: 900px; }
.pdf-organizer-steps { margin: 0 0 22px; padding-left: 22px; color: var(--muted); line-height: 1.7; }
.pdf-organizer-steps li + li { margin-top: 7px; }
.pdf-organizer-panel input[type="file"] { min-height: 48px; padding: 10px; background: #fbfcfb; }
.pdf-upload-summary { padding: 12px 14px; border: 1px solid #cfe1d7; border-radius: 10px; background: var(--green-soft); color: var(--green-dark); font-size: 10px; font-weight: 700; }
.pdf-upload-summary.is-error { border-color: #fed7aa; background: #fff7ed; color: #9a3412; }
.pdf-progress { display: grid; gap: 9px; padding: 14px; border: 1px solid #cfe1d7; border-radius: 10px; background: #f7fbf8; }
.pdf-progress[hidden] { display: none; }
.pdf-progress.is-error { border-color: #fecaca; background: #fff7f7; color: #991b1b; }
.pdf-progress-heading { display: flex; justify-content: space-between; gap: 16px; color: var(--ink); font-size: 11px; }
.pdf-progress progress { width: 100%; height: 10px; accent-color: var(--green-dark); }
.pdf-progress small { color: var(--muted); font-size: 9px; }
.privacy-note { margin-top: 20px; padding: 13px 15px; border: 1px solid #cfe1d7; border-radius: 10px; background: var(--green-soft); color: var(--green-dark); font-size: 10px; line-height: 1.55; }
.operations-metrics { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.operations-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.operations-grid .panel { min-width: 0; margin-bottom: 0; }
.operations-health-list > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.operations-health-list > div:first-child { border-top: 0; }
.operations-health-list strong, .operations-health-list small { display: block; }
.operations-health-list small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.operations-health-impact { min-width: 180px; text-align: right; }
.operations-health-impact .status-pill { display: inline-flex; }
.operations-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.operations-actions form { margin: 0; }
.operations-actions button { width: 100%; }
.operations-definition-list { margin: 0; }
.operations-definition-list > div { display: flex; justify-content: space-between; gap: 18px; padding: 12px 0; border-top: 1px solid var(--line); }
.operations-definition-list > div:first-child { border-top: 0; }
.operations-definition-list dt { color: var(--muted); }
.operations-definition-list dd { margin: 0; font-weight: 800; text-align: right; }
.catalog-status-summary { display: flex; flex-wrap: wrap; gap: 9px; margin: -4px 0 18px; }
.catalog-status-summary span { display: inline-flex; align-items: center; gap: 7px; padding: 8px 10px; border-radius: 999px; background: var(--green-soft); color: var(--green-dark); font-size: 9px; }
.catalog-status-summary b { font-size: 13px; }
.catalog-heading { margin-bottom: 18px; }
.catalog-flow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.catalog-flow article { display: flex; align-items: center; gap: 12px; min-height: 82px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: var(--shadow-soft); }
.catalog-flow article > span { display: grid; flex: 0 0 34px; width: 34px; height: 34px; place-items: center; border-radius: 50%; background: var(--green-soft); color: var(--green-dark); font-weight: 900; }
.catalog-flow strong, .catalog-flow small { display: block; }
.catalog-flow small { margin-top: 4px; color: var(--muted); line-height: 1.4; }
.catalog-metrics { margin-bottom: 18px; }
.catalog-health-panel { border-color: #cfe1d7; background: linear-gradient(135deg,#fff 0%,#f5fbf7 100%); }
.catalog-health-metrics { margin: 16px 0 12px; }
.catalog-channel-health { display: flex; flex-wrap: wrap; gap: 8px; }
.catalog-channel-health span { padding: 8px 10px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: 9px; }
.catalog-health-issues { margin-top: 13px; }
.catalog-health-issues summary { color: var(--green-dark); font-weight: 800; cursor: pointer; }
.catalog-health-issues li { margin: 8px 0; color: var(--muted); font-size: 10px; }
.catalog-template-panel { display: grid; grid-template-columns: minmax(260px,1fr) minmax(420px,1.5fr); gap: 18px; align-items: center; }
.catalog-template-panel h2 { margin: 3px 0 6px; }
.catalog-template-panel p { margin: 0; color: var(--muted); }
.catalog-template-facts { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 8px; }
.catalog-template-facts span { padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 10px; }
.catalog-template-facts b { display: block; margin-bottom: 4px; color: var(--muted); font-size: 8px; text-transform: uppercase; }
.catalog-actions-panel { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.catalog-remove-panel { display: flex; align-items: center; justify-content: space-between; gap: 24px; border-color: #fecaca; background: #fffafa; }
.catalog-remove-panel h2 { margin: 3px 0 6px; }
.catalog-remove-panel p { max-width: 760px; margin: 0; color: var(--muted); }
.danger-button { min-height: 42px; padding: 0 16px; border: 1px solid #b42318; border-radius: 10px; color: #fff; background: #b42318; font: inherit; font-weight: 800; cursor: pointer; }
.danger-button:hover { background: #8f1c13; }
.catalog-actions-panel h2, .catalog-publish-panel h2 { margin: 3px 0 6px; }
.catalog-actions-panel p, .catalog-publish-panel p { margin: 0; color: var(--muted); }
.catalog-editor { display: grid; gap: 18px; }
.catalog-editor .panel { margin-bottom: 0; }
.catalog-lines { width: 100%; min-height: 150px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; line-height: 1.6; }
.catalog-channel-profile-list { display: grid; gap: 10px; }
.catalog-channel-profile { border: 1px solid var(--line); border-radius: 13px; background: #fbfcfb; overflow: hidden; }
.catalog-channel-profile summary { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 15px 17px; cursor: pointer; list-style: none; }
.catalog-channel-profile summary::-webkit-details-marker { display: none; }
.catalog-channel-profile summary > span:first-child { display: grid; gap: 3px; }
.catalog-channel-profile summary small { color: var(--muted); font-size: 10px; font-weight: 600; }
.catalog-channel-profile[open] summary { border-bottom: 1px solid var(--line); background: #f5faf7; }
.catalog-channel-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; padding: 17px; }
.catalog-channel-fields label { display: grid; gap: 7px; min-width: 0; }
.catalog-channel-fields .wide-field { grid-column: 1 / -1; }
.catalog-channel-errors { margin: 0; padding: 0 17px 17px; color: var(--red); font-size: 11px; font-weight: 700; }
.catalog-channel-checks { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.catalog-channel-checks span { padding: 4px 7px; border-radius: 999px; font-size: 8px; font-weight: 800; }
.catalog-channel-checks .ready { color: var(--green-dark); background: var(--green-soft); }
.catalog-channel-checks .blocked { color: #875900; background: #fff4d8; }
.channel-selector { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 18px 0; }
.channel-selector label { display: flex; align-items: center; gap: 9px; min-height: 48px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; background: #fbfcfb; cursor: pointer; }
.channel-selector input { width: 18px; height: 18px; }
.publication-list { display: grid; gap: 8px; margin-top: 18px; }
.publication-list > div { display: flex; align-items: center; justify-content: space-between; padding: 11px 0; border-top: 1px solid var(--line); }
.status-pill.warning { background: #fff7ed; color: #9a3412; }
.catalog-batch-filters { display: grid; grid-template-columns: minmax(240px, 1fr) 180px 180px auto; gap: 10px; align-items: end; margin-bottom: 16px; }
.catalog-batch-filters label > span { display: block; margin: 0 0 6px 2px; color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; }
.catalog-batch-filters input, .catalog-batch-filters select { width: 100%; height: 42px; padding: 0 11px; border: 1px solid #d5ded8; border-radius: 9px; color: var(--ink); background: #fbfcfb; }
.catalog-batch-config { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.catalog-batch-config fieldset { min-width: 0; margin: 0; padding: 14px; border: 1px solid var(--line); border-radius: 12px; }
.catalog-batch-config legend { padding: 0 7px; font-size: 10px; font-weight: 900; }
.catalog-check-all { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; color: var(--green-dark); font-size: 10px; }
.catalog-choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.catalog-choice-grid.fields { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.catalog-choice-grid label { display: flex; align-items: center; gap: 7px; min-width: 0; padding: 9px; border: 1px solid var(--line); border-radius: 9px; background: #fbfcfb; font-size: 10px; cursor: pointer; }
.catalog-choice-grid input, [data-catalog-item], [data-catalog-select-visible] { width: 17px; height: 17px; accent-color: var(--green-dark); }
.catalog-selection-bar { position: sticky; top: 76px; z-index: 8; display: grid; grid-template-columns: minmax(270px, 1fr) auto auto; gap: 14px; align-items: center; margin-bottom: 14px; padding: 12px 14px; border: 1px solid #cfe1d7; border-radius: 12px; background: rgba(247,251,248,.97); box-shadow: var(--shadow-soft); backdrop-filter: blur(10px); }
.catalog-selection-bar label { display: flex; align-items: center; gap: 9px; font-size: 10px; }
.catalog-selection-bar > span { color: var(--muted); font-size: 10px; }
.catalog-batch-error { margin: -5px 0 13px; padding: 10px 12px; border: 1px solid #fecaca; border-radius: 9px; background: #fff7f7; color: #991b1b; font-size: 10px; font-weight: 800; }
.catalog-batch-error[hidden], [data-catalog-row][hidden] { display: none; }
.catalog-preview-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.catalog-preview-pills { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 9px; }
.catalog-preview-pills span { padding: 7px 10px; border-radius: 999px; background: var(--green-soft); color: var(--green-dark); font-size: 9px; font-weight: 800; }
.catalog-preview-summary > div + div { padding-left: 18px; border-left: 1px solid var(--line); }
.catalog-preview-summary .eyebrow { display: block; }
.catalog-preview-summary + .table-panel { margin-top: 18px; }
.catalog-preview-summary + .table-panel table { min-width: 800px; }
.catalog-preview-summary + .table-panel .status-pill { display: inline-flex; }
.catalog-preview-summary + .table-panel .cell-note { max-width: 480px; }
.catalog-preview-notice { display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: center; margin-top: 18px; border-color: #cfe1d7; background: #f7fbf8; }
.catalog-preview-notice strong { color: var(--green-dark); }
.catalog-preview-notice p { margin: 5px 0 0; color: var(--muted); }

@media (max-width: 1180px) {
    .operations-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .catalog-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
    .operations-grid { grid-template-columns: 1fr; }
    .operations-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .operations-health-item { align-items: flex-start !important; flex-direction: column; }
    .operations-health-impact { min-width: 0; text-align: left; }
    .operations-actions { display: grid; grid-template-columns: 1fr; }
    .catalog-flow, .channel-selector, .catalog-channel-fields { grid-template-columns: 1fr; }
    .catalog-channel-fields .wide-field { grid-column: auto; }
    .catalog-actions-panel, .catalog-remove-panel { align-items: stretch; flex-direction: column; }
    .catalog-template-panel, .catalog-template-facts { grid-template-columns: 1fr; }
    .catalog-batch-filters, .catalog-batch-config, .catalog-selection-bar, .catalog-preview-summary, .catalog-preview-notice { grid-template-columns: 1fr; }
    .catalog-choice-grid, .catalog-choice-grid.fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .catalog-selection-bar { position: static; }
    .catalog-preview-summary > div + div { padding: 18px 0 0; border-left: 0; border-top: 1px solid var(--line); }
}

@media (max-width: 440px) {
    .operations-metrics { grid-template-columns: 1fr; }
    .catalog-choice-grid, .catalog-choice-grid.fields { grid-template-columns: 1fr; }
}

/* Final cascade: shared layout rules must remain after module-specific CSS. */
body { background: linear-gradient(180deg, #f7f9f7 0, var(--canvas) 360px); }
.sidebar { background: linear-gradient(180deg, #164333 0%, #0e3326 100%); }
.sidebar nav .nav-standalone { min-height: 48px; margin-bottom: 10px; background: rgba(255,255,255,.055); border: 1px solid rgba(255,255,255,.08); font-size: 13px; }
.sidebar nav .nav-standalone.active { background: rgba(255,255,255,.15); }
.nav-group { border-top: 1px solid rgba(255,255,255,.075); border-radius: 0; padding-top: 5px; }
.topbar { height: 66px; padding-inline: clamp(18px, 2.2vw, 34px); }
.content { max-width: 1660px; padding: clamp(22px, 2.2vw, 34px); }
.page-heading { align-items: center; margin-bottom: 22px; }
.page-heading h1 { margin: 5px 0 7px; font-size: clamp(30px, 3.2vw, 43px); }
.page-heading p { max-width: 760px; font-size: 13px; line-height: 1.55; }
.panel, .metric-card { border-color: var(--line); border-radius: 18px; box-shadow: var(--shadow-soft); }
.panel { margin-bottom: 18px; padding: clamp(18px, 1.7vw, 26px); }
.panel-heading { align-items: center; margin-bottom: 18px; }
.panel-heading h2 { margin-top: 5px; font-size: clamp(17px, 1.35vw, 21px); letter-spacing: -.025em; }
.metrics-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 205px), 1fr)); gap: 12px; margin-bottom: 18px; }
.metric-card { min-width: 0; min-height: 132px; padding: 18px; }
.metric-card > span { display: block; font-weight: 850; letter-spacing: .055em; text-transform: uppercase; }
.metric-card strong { margin: 12px 0 7px; overflow: hidden; font-size: clamp(25px, 2.1vw, 34px); line-height: 1; text-overflow: ellipsis; white-space: nowrap; }
.metric-card small { display: block; line-height: 1.4; }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.filter-chip { min-height: 36px; display: inline-flex; align-items: center; padding: 0 13px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--muted); font-size: 10px; font-weight: 800; text-decoration: none; }
.filter-chip.active { border-color: var(--green-dark); background: var(--green-dark); color: #fff; }
.primary-button, .secondary-button, .danger-button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; border-radius: 11px; line-height: 1.2; }
.table-panel { padding: 0; }
.table-panel > .panel-heading, .table-panel > .panel-note { margin-inline: clamp(18px, 1.7vw, 26px); }
.table-panel > .panel-heading { margin-top: clamp(18px, 1.7vw, 26px); }
.table-panel > .responsive-table { border-top: 1px solid var(--line); }
th { position: sticky; top: 0; z-index: 2; padding: 11px 14px; background: #f4f7f5; color: #68746e; }
td { padding: 14px; vertical-align: middle; }
tbody tr:hover { background: #f8fbf9; }
.row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 13px; }
.empty-state { padding: clamp(34px, 7vw, 76px) 24px; text-align: center; }
.page-dashboard .content { max-width: 1720px; }
.dashboard-period-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.dashboard-period-summary article { min-height: 116px; padding: 17px 18px; }
.dashboard-period-summary strong { font-size: clamp(27px, 2.2vw, 35px); }
.dashboard-open-order-grid { grid-template-columns: repeat(auto-fit, minmax(185px, 1fr)); }
.dashboard-open-order-grid article { min-height: 104px; }
.dashboard-financial-overview .dashboard-kpis { grid-template-columns: repeat(auto-fit, minmax(205px, 1fr)); }
.dashboard-kpi { min-height: 126px; padding: 18px; }
.dashboard-kpi strong { font-size: clamp(25px, 2vw, 32px); }
.page-sales .production-metrics, .page-product_sales .sales-profit-metrics, .page-expenses .production-metrics, .page-cash_flow .production-metrics, .page-reports .production-metrics, .page-production .production-metrics, .page-production_planning .planning-metrics { grid-template-columns: repeat(auto-fit, minmax(min(100%, 205px), 1fr)); }
.page-integrations .dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

@media (max-width: 1080px) {
    .page-integrations .dashboard-grid { grid-template-columns: 1fr; }
    .page-heading { align-items: flex-start; }
    .dashboard-period-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
    body { background: var(--canvas); }
    .content { padding: 18px 12px 92px; }
    .page-heading { gap: 14px; margin-bottom: 18px; }
    .page-heading h1 { font-size: 31px; }
    .page-heading > a, .page-heading > button { width: 100%; }
    .panel { padding: 16px; border-radius: 15px; }
    .metric-card { min-height: 112px; padding: 15px; border-radius: 15px; }
    .metrics-grid, .production-metrics, .printer-metrics, .page-sales .production-metrics, .page-product_sales .sales-profit-metrics, .page-expenses .production-metrics, .page-cash_flow .production-metrics, .page-reports .production-metrics, .page-production .production-metrics, .page-production_planning .planning-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
    .metric-card strong { font-size: clamp(23px, 8vw, 30px); white-space: normal; }
    .table-panel { padding: 12px; overflow: visible; }
    .table-panel > .panel-heading, .table-panel > .panel-note { margin-inline: 0; }
    .table-panel > .panel-heading { margin-top: 0; }
    .table-panel > .responsive-table { border-top: 0; }
    .dashboard-period-summary, .dashboard-open-order-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-period-summary article, .dashboard-open-order-grid article { min-height: 106px; }
    .dashboard-period-summary strong, .dashboard-kpi strong { white-space: normal; }
    .dashboard-financial-overview .dashboard-kpis { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 420px) {
    .metrics-grid, .production-metrics, .printer-metrics, .page-sales .production-metrics, .page-product_sales .sales-profit-metrics, .page-expenses .production-metrics, .page-cash_flow .production-metrics, .page-reports .production-metrics, .page-production .production-metrics, .page-production_planning .planning-metrics, .dashboard-period-summary, .dashboard-open-order-grid, .dashboard-financial-overview .dashboard-kpis { grid-template-columns: 1fr; }
    .metric-card, .dashboard-period-summary article, .dashboard-open-order-grid article, .dashboard-kpi { min-height: 0; }
}
