:root {
  color-scheme: dark;
  --bg: #091520;
  --panel: #111e2b;
  --border: #263749;
  --text: #edf3fc;
  --muted: #a4b4c8;
  --subtle: #7d92aa;
  --cyan: #79caff;
  --green: #36ce90;
  --red: #ff515c;
  --gold: #f5cb7f;
  font-family: "Segoe UI", Inter, Arial, sans-serif;
  font-size: 14px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--text); background: radial-gradient(ellipse at 35% 0, #10213288, transparent 62%), var(--bg); }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button, select { cursor: pointer; }
button, a { touch-action: manipulation; }
button { color: inherit; }
button:disabled { opacity: .4; cursor: not-allowed; }
button, a, input, select, textarea { outline-offset: 4px; }
:focus-visible { outline: 2px solid var(--cyan); }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 25px; font-weight: 650; }
h2 { font-size: 16px; font-weight: 700; }
p { line-height: 1.5; }
small { font-size: 12px; }
svg.icon { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; vertical-align: middle; }
[data-icon] { display: inline-flex; align-items: center; flex-shrink: 0; }
.green { color: var(--green); }
.red { color: var(--red); }
.gold { color: var(--gold); }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.app-header { height: 80px; border-bottom: 1px solid #243548; display: flex; align-items: center; gap: 30px; padding: 0 28px 0 32px; background: linear-gradient(110deg, #101e2c9c, #0c1724cc); }
.brand { display: flex; align-items: center; gap: 17px; width: 349px; flex-shrink: 0; padding: 0; border: 0; background: transparent; text-align: left; color: #d1e3f8; }
.brand-crystal { width: 46px; height: 61px; filter: drop-shadow(0 1px 7px #7fb3d622); }
.brand-copy > span { display: block; font-family: Georgia, "Times New Roman", serif; font-size: 31px; line-height: 1.15; letter-spacing: 1.4px; white-space: nowrap; font-weight: 400; }
.brand-copy small { display: block; font-size: 8px; letter-spacing: 3px; margin-top: 5px; color: #97b5d1; white-space: nowrap; }
.global-search { height: 46px; display: flex; align-items: center; gap: 12px; flex: 1; border: 1px solid #2a3b50; border-radius: 9px; background: linear-gradient(120deg, #11202f, #172231); padding: 0 14px; color: #b0c2d9; min-width: 200px; box-shadow: inset 0 1px #ffffff02; }
.global-search input { width: 100%; border: 0; background: none; color: var(--text); outline: 0; min-width: 0; }
input::placeholder { color: #9cafc6; opacity: 1; }
kbd { background: #26384c; border-radius: 5px; padding: 4px 9px; color: #b7cce1; font: inherit; font-size: 12px; }
.system-state { display: flex; align-items: center; gap: 14px; padding-left: 15px; border-left: 1px solid #24364a; white-space: nowrap; }
.system-state i { width: 14px; height: 14px; border-radius: 50%; background: #37ca8e; box-shadow: 0 0 16px #36ce902f; }
.system-state strong { display: block; color: #79e4b7; font-size: 13px; font-weight: 500; }
.system-state small { display: block; font-size: 11px; margin-top: 4px; color: #aebfd4; }
.header-date { display: flex; align-items: center; gap: 12px; border-left: 1px solid #2c3c51; padding-left: 27px; min-width: 158px; line-height: 1.6; font-size: 13px; }
.header-date .icon { width: 25px; height: 25px; color: #d1e7ff; }
.header-date small { display: block; font-size: 12px; text-transform: capitalize; color: var(--muted); }
.profile-button { display: flex; align-items: center; gap: 12px; border: 0; background: none; padding: 0; }
.profile-button > [data-icon="user"] { border: 1px solid #42556c; border-radius: 50%; padding: 7px; background: #192b3d; color: #bcdbf5; }
.small-icon .icon { width: 14px; height: 14px; }
.primary-nav { display: grid; grid-template-columns: 1.2fr repeat(7, 1fr); gap: 14px; padding: 16px 22px 22px; }
.primary-nav button { position: relative; display: flex; gap: 15px; align-items: center; justify-content: center; height: 58px; border: 1px solid #203244; border-radius: 10px; background: linear-gradient(110deg, #132231, #14202e); font-size: 13px; transition: border-color .18s, background .18s, transform .18s; }
.primary-nav button:hover { background: #1a3045; border-color: #486881; transform: translateY(-1px); }
.primary-nav button.active { border-color: #67d7ff; background: linear-gradient(110deg, #17435a, #1b2e49); box-shadow: inset 0 0 14px #52bbff08; }
.primary-nav .icon { width: 25px; height: 25px; color: #d1e6fb; }
.count-badge { min-width: 29px; height: 29px; padding: 0 7px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: linear-gradient(135deg, #ff8586, #fa424f); color: #391820; font-size: 13px; font-weight: 600; box-shadow: 0 0 0 1px #ff83853d; flex-shrink: 0; }
#app-main { padding: 0 22px 0; }
.view { animation: view-in .28s ease both; }
.overview-grid { display: grid; grid-template-columns: minmax(0, 2.68fr) minmax(340px, 1fr); gap: 16px 17px; align-items: stretch; }
.panel { border: 1px solid var(--border); border-radius: 12px; background: linear-gradient(125deg, #122330a6, #14202ef0); padding: 17px 19px; box-shadow: 0 7px 22px #00000013; min-width: 0; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 35px; margin-bottom: 13px; }
.panel-heading h2 { display: flex; align-items: center; gap: 14px; color: #cce6ff; font-size: 16px; letter-spacing: .25px; }
.panel-heading h2 .icon { width: 27px; height: 27px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; color: #d4e6fc; border: 1px solid #354a62; border-radius: 8px; background: linear-gradient(120deg, #203349, #162333); padding: 9px 12px; font-size: 12px; line-height: 1.2; white-space: nowrap; box-shadow: 0 2px 6px #0000001a; transition: background .16s, border-color .16s; }
.button:hover { background: #294158; border-color: #617e9d; }
.button .icon { width: 16px; height: 16px; }
.button.small { padding: 8px 10px; font-size: 11px; border-radius: 7px; }
.button.primary { color: #daf3ff; background: #1d5270; border-color: #4597b5; }
.button.ghost-red { border-color: #73373e; background: #3b202a57; color: #ffb6bc; padding: 12px; margin-left: auto; }
.button.danger-button { color: #ffbec2; border-color: #753e4c; }
.text-button { display: inline-flex; align-items: center; gap: 10px; padding: 0; border: 0; background: none; color: #83caff; text-align: left; font-size: 13px; }
.text-button:hover { color: #c5ecff; }
.text-button .icon { width: 16px; height: 16px; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; border: 1px solid #33485f; border-radius: 7px; background: #162638; width: 31px; height: 33px; color: #c6d9ed; }
.icon-button:hover { border-color: var(--cyan); }
.icon-button .icon { width: 17px; height: 17px; }
.urgent-panel { padding: 14px; border-color: #7e303e; background: linear-gradient(115deg, #2c1e28, #231c27 55%, #1a202c); }
.urgent-heading { display: flex; align-items: center; gap: 16px; height: 66px; padding: 0 8px 9px 4px; }
.urgent-heading h1 { color: var(--red); font-size: 21px; font-weight: 750; letter-spacing: .65px; white-space: nowrap; }
.urgent-heading p { color: #c5cde5; font-size: 13px; margin-top: 2px; }
.flame-icon .icon { width: 39px; height: 47px; fill: var(--red); stroke-width: 1; color: var(--red); }
.urgent-heading > .count-badge { margin-left: -5px; }
.table-frame { border: 1px solid #354052; border-radius: 11px; background: #111c29; overflow: hidden; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { color: #b4c0d3; text-transform: uppercase; font-size: 11px; font-weight: 550; white-space: nowrap; background: #192433a8; letter-spacing: .15px; padding: 12px; text-align: left; }
td { border-top: 1px solid #263447; padding: 13px 12px; line-height: 1.4; }
tbody tr { transition: background .14s; }
tbody tr:hover { background: #2335495c; }
.urgent-table th { height: 40px; padding: 10px 11px; }
.urgent-table td { height: 62px; padding: 9px 11px; vertical-align: middle; }
.urgent-table th:first-child { width: 96px; }
.urgent-table td:nth-child(2) { min-width: 140px; }
.urgent-table td:nth-child(3) { max-width: 240px; }
.urgent-table td:nth-child(4) { min-width: 137px; }
.urgent-table th:nth-child(5) { width: 110px; }
.urgent-table td:nth-child(6) { white-space: nowrap; }
.urgent-table td:last-child { width: 108px; white-space: nowrap; }
.order-number { font-weight: 650; color: var(--red); }
.cell-title { display: block; color: #f0f4fd; font-weight: 500; }
.cell-sub { display: flex; align-items: center; gap: 4px; color: #a8b9cf; margin-top: 4px; font-size: 12px; }
.cell-sub .icon { width: 12px; height: 12px; color: #9bacc3; }
.cell-product { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; overflow: hidden; }
.status { display: inline-block; border-radius: 7px; padding: 7px 10px; font-size: 11px; line-height: 1.2; white-space: nowrap; color: #c9e8ff; background: #21384e; }
.status.red { color: #ff8d98; background: #51232f96; }
.status.amber { color: #ffd478; background: #63441e66; }
.status.green { color: #7de3ba; background: #184b3b80; }
.delay { display: inline-block; min-width: 71px; text-align: center; color: #ff8b96; background: #51242d80; padding: 7px 9px; border-radius: 8px; font-size: 14px; font-weight: 550; }
.actions { display: flex; gap: 7px; align-items: center; }
.overview-rail { display: grid; grid-template-rows: 1fr 1fr; gap: 16px; }
.stock-card, .sales-card { padding: 17px 16px; }
.sales-card { padding: 15px 16px; }
.sales-card .metric-rows > div { padding: 5px 0; }
.stock-card .panel-heading { margin-bottom: 14px; }
.stock-alerts { border: 1px solid #2a3b50; border-radius: 11px; overflow: hidden; background: #0c192687; margin-bottom: 17px; }
.stock-alert { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 0; border-bottom: 1px solid #26384a; padding: 9px 12px; min-height: 41px; background: none; text-align: left; font-size: 12px; }
.stock-alert:last-child { border-bottom: 0; }
.stock-alert:hover { background: #1e3348; }
.alert-dot { width: 24px; height: 24px; display: inline-flex; border-radius: 50%; align-items: center; justify-content: center; color: white; background: #ef4b5b; font-weight: 700; font-size: 13px; box-shadow: inset 0 1px 4px #ffffff45; flex-shrink: 0; }
.alert-amber { color: #ffc257; }
.alert-amber .alert-dot { background: #ffba31; }
.alert-blue { color: #c8e7ff; }
.alert-blue .alert-dot { background: #4fbcff; }
.stock-alert .small-icon { margin-left: auto; }
.sales-card .panel-heading { margin-bottom: 10px; }
.sales-total { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 5px 0 12px; }
.sales-total > strong { font-size: 36px; font-weight: 700; line-height: 1.2; white-space: nowrap; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.sales-total > small { text-align: right; font-size: 11px; line-height: 1.4; }
.sales-change { color: var(--green); text-align: right; font-size: 16px; font-weight: 650; }
.sales-change small { display: block; font-size: 11px; font-weight: 400; color: #a3c3dd; margin-top: 4px; }
.period-chip { background: #172636; padding: 8px 10px; border: 1px solid #34465e; border-radius: 7px; font-size: 11px; white-space: nowrap; }
.metric-rows { margin: 0; }
.metric-rows > div { display: flex; justify-content: space-between; gap: 9px; font-size: 12px; padding: 7px 0; border-top: 1px solid #29394c; }
.metric-rows dt { color: #a3bed8; }
.metric-rows dd { margin: 0; text-align: right; }
.net-profit { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; padding-top: 8px; border-top: 1px solid #314337; color: #61e2ab; font-size: 12px; }
.net-profit strong { font-size: 19px; }
.net-profit small { font-size: 10px; color: #9ab9ad; margin-left: 5px; }
.net-profit i { display: inline-block; width: 6px; height: 6px; background: var(--green); border-radius: 50%; margin-right: 6px; }
.finance-card, .carrier-card { min-height: 287px; }
.finance-card { padding: 14px 20px 12px; }
.finance-card .panel-heading { margin-bottom: 1px; }
.chart-legend { display: flex; justify-content: flex-end; align-items: center; gap: 20px; min-height: 25px; }
.legend-button { display: inline-flex; align-items: center; gap: 7px; padding: 3px 0; border: 0; background: none; font-size: 12px; color: #c0ccdd; }
.legend-button i { background: var(--series-color); width: 8px; height: 8px; border-radius: 50%; }
.legend-button[aria-pressed="false"] { opacity: .35; }
.line-chart { width: 100%; height: 205px; position: relative; }
.finance-card .line-chart { height: 197px; }
.line-chart.large { height: 310px; }
.line-chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart-grid { stroke: #24394a; stroke-width: 1; }
.chart-axis { fill: #a5b8cf; font: 11px "Segoe UI", sans-serif; }
.chart-line { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; animation: line-in .8s ease both; }
.chart-end-label { font: 600 11px "Segoe UI", sans-serif; paint-order: stroke; stroke: #101e2b; stroke-width: 5px; stroke-linejoin: round; }
.chart-point { stroke-width: 1.3; transition: r .15s; }
.chart-point:hover { r: 5; }
.chart-tooltip { position: fixed; z-index: 15; background: #192b3ef5; padding: 11px 14px; border: 1px solid #47647c; border-radius: 8px; pointer-events: none; box-shadow: 0 8px 24px #0007; font-size: 12px; min-width: 160px; }
.chart-tooltip b { display: block; margin-bottom: 6px; }
.chart-tooltip div { display: flex; justify-content: space-between; gap: 25px; line-height: 1.8; }
.carrier-card { padding: 15px 18px; }
.carrier-card .panel-heading { margin-bottom: 8px; }
.carrier-card .sales-total { margin-bottom: 10px; }
.carrier-row { display: grid; grid-template-columns: 26px 1fr auto auto; gap: 9px; align-items: center; min-height: 33px; border-bottom: 1px solid #243448; font-size: 12px; }
.carrier-row:last-child { border-bottom: 0; }
.carrier-row > small { font-size: 11px; color: #a3b3c8; min-width: 37px; text-align: right; }
.carrier-row > strong { font-weight: 500; }
.carrier-symbol { color: #d4e9fa; display: inline-flex; }
.carrier-symbol .icon { width: 20px; height: 20px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; padding: 5px 0 2px; }
.page-heading h1 { margin: 6px 0; }
.page-heading p { font-size: 13px; color: var(--muted); }
.page-actions { display:flex;flex-wrap:wrap;align-items:center;gap:8px; }
.record-editor-form { display:grid;gap:18px; }
.editor-section { display:grid;gap:12px;border:0;border-top:1px solid var(--border);padding:17px 0 0;min-width:0; }
.editor-section legend { padding:0 8px 0 0;color:#cce6ff;font-weight:600; }
.editor-grid { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px; }
.record-editor-form label { display:grid;gap:7px;color:#c3d6e9;font-size:12px;min-width:0; }
.record-editor-form input,.record-editor-form select,.record-editor-form textarea { width:100%; }
.record-editor-form textarea { min-height:78px;resize:vertical; }
.editor-grid .wide,.editor-section .wide { grid-column:1/-1; }
.editor-lines { display:grid;gap:12px; }
.editor-line { display:grid;gap:10px;border:1px solid var(--border);border-radius:9px;padding:12px;background:#0d1b29; }
.editor-line-actions { display:flex;justify-content:flex-end;gap:8px; }
.editor-check { display:flex!important;align-items:center;gap:9px!important; }
.editor-check input { width:16px;height:16px;margin:0; }
.editor-feedback { color:var(--red);font-size:13px;line-height:1.5; }
.editor-total { padding:12px;border:1px solid var(--border);border-radius:8px;color:var(--gold); }
.editor-hint { color:var(--muted);font-size:12px;line-height:1.6; }
.record-editor-form [readonly] { opacity:.7; }
@media(max-width:540px){.editor-grid{grid-template-columns:1fr;}.editor-grid .wide{grid-column:auto;}.page-actions{width:100%;}.page-actions .button{flex:1;}}
.eyebrow { font-size: 10px; letter-spacing: 1.7px; color: #81b5d6; }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 16px; }
input, select, textarea { border: 1px solid #354961; border-radius: 7px; background: #0e1c2b; color: #d9e6f5; padding: 9px 12px; min-width: 0; }
select { font-size: 12px; }
.toolbar > input { min-width: 230px; }
.input-with-icon { display: flex; align-items: center; border: 1px solid #354961; border-radius: 7px; padding-left: 11px; color: var(--muted); background: #0e1c2b; min-width: 300px; }
.input-with-icon .icon { width: 18px; height: 18px; }
.input-with-icon input { border: 0; background: none; width: 100%; }
.toolbar-caption { margin-left: auto; color: var(--muted); font-size: 12px; }
.compact-label { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); }
.forecast-explanation { display: flex; align-items: center; gap: 10px; padding: 11px 13px; background: #16364a66; border: 1px solid #2a4a60; border-radius: 8px; margin-bottom: 15px; font-size: 12px; color: #b9d9f0; }
.forecast-explanation .icon { width: 18px; height: 18px; }
.stats-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 15px; margin-bottom: 20px; }
.stat-card { background: linear-gradient(120deg, #142a3b, #12202e); border: 1px solid #2a3d50; border-radius: 10px; padding: 18px; }
.stat-card > span { color: #a5bed5; font-size: 12px; display: block; }
.stat-card > strong { display: block; font-size: 29px; margin: 9px 0 5px; }
.stat-card > small { color: #8fa5ba; font-size: 11px; }
.logistics-grid { display: grid; grid-template-columns: minmax(0,1.05fr) minmax(0,1fr); gap: 17px; }
.panel-description { color: #a8bbce; font-size: 12px; margin: 9px 0 18px; }
.section-gap { margin-top: 20px; }
.data-source { display: flex; gap: 9px; color: #8da7bb; font-size: 12px; line-height: 1.6; margin-top: 18px; }
.data-source .icon { width: 17px; height: 17px; }
.set-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 18px; }
.set-visual { height: 105px; border-radius: 9px; display: flex; align-items: center; justify-content: center; background: radial-gradient(ellipse, #30485888, #0a1725); margin-bottom: 17px; }
.set-visual .icon { width: 54px; height: 54px; color: #9ec0d9; stroke-width: 1; }
.set-title { font-size: 19px; margin-bottom: 8px; }
.set-components { margin: 15px 0; padding: 0; list-style: none; }
.set-components li { display: flex; justify-content: space-between; border-top: 1px solid #293b4f; padding: 10px 0; font-size: 12px; color: #b7cadd; }
.empty-state { padding: 40px 18px; color: #a6bed4; text-align: center; }
.empty-state h2 { margin: 12px 0 7px; }
.empty-state .icon { width: 40px; height: 40px; }
.empty-row { padding: 30px; text-align: center; color: var(--muted); }
.settings-form { display: grid; gap: 16px; align-content: start; }
.settings-form label, .edit-form label { display: grid; gap: 7px; font-size: 12px; color: #c3d6e9; }
.settings-form .button { justify-self: start; }
.cost-settings-grid { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;margin-bottom:22px; }
.cost-panel .panel-description { margin-bottom:15px; }
.cost-entry-form { padding:16px 0;margin-bottom:16px;border-bottom:1px solid var(--border);gap:12px; }
.cost-fields { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px; }
.cost-checkbox { display:flex!important;align-items:center;gap:9px!important; }
.cost-checkbox input { width:16px;height:16px;min-height:0;margin:0; }
.cost-form-actions { display:flex;flex-wrap:wrap;gap:10px;align-items:center; }
.cost-feedback { font-size:12px;min-height:18px;line-height:1.5;color:var(--green); }
.cost-feedback.error { color:#ffacb5; }
.cost-mode-notice { padding:12px 15px;border:1px solid var(--border);border-radius:9px;background:#132638; }
.cost-panel td { overflow-wrap:anywhere; }
@media(max-width:1100px){.cost-settings-grid{grid-template-columns:1fr;}}
@media(max-width:540px){.cost-fields{grid-template-columns:1fr;}.cost-panel{padding:15px;}.cost-form-actions .button{flex:1;}}
.setting-action { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 20px 0; border-bottom: 1px solid #2a3d50; }
.setting-action small { display: block; color: var(--muted); margin-top: 5px; }
.app-footer { display: flex; justify-content: space-between; gap: 15px; color: #7991a8; font-size: 10px; padding: 13px 3px 0; }
.app-footer i { display: inline-block; width: 5px; height: 5px; background: #83b6d0; border-radius: 50%; margin-right: 6px; }
.app-dialog { width: min(760px, calc(100% - 30px)); max-height: calc(100vh - 50px); overflow: auto; background: #111f2e; border: 1px solid #425c74; border-radius: 14px; color: var(--text); padding: 22px; box-shadow: 0 24px 90px #0009; }
.app-dialog::backdrop { background: #020a14bc; backdrop-filter: blur(6px); }
.app-dialog[open] { animation: view-in .2s ease; }
.dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 20px; }
.dialog-header h2 { font-size: 20px; }
.dialog-meta { display: flex; gap: 20px; color: #aec3d8; margin-bottom: 18px; font-size: 12px; flex-wrap: wrap; }
.detail-items { background: #0c1825; border-radius: 10px; padding: 5px 15px; margin: 15px 0; }
.detail-row { display: flex; justify-content: space-between; gap: 15px; align-items: center; padding: 13px 0; border-bottom: 1px solid #26384c; }
.detail-row:last-child { border: 0; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 19px; flex-wrap: wrap; }
.scan-form { display: flex; gap: 10px; margin: 15px 0; }
.scan-form input { flex: 1; font-size: 18px; font-family: ui-monospace, Consolas, monospace; padding: 14px; }
.scan-status { padding: 16px; border: 1px solid #334d64; border-radius: 9px; background: #132b3d; margin: 15px 0; font-size: 13px; }
.scan-status.error { color: #ffb7bd; background: #4e202b; border-color: #ae3b50; }
.scan-status.success { color: #86edbc; background: #153d30; border-color: #337854; }
.scan-status strong { font-size: 20px; display: block; margin-bottom: 5px; }
.edit-form { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.edit-form .wide { grid-column: 1/-1; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { border-bottom: 1px solid #283c50; padding: 10px 0; font-size: 12px; }
.timeline li small { color: var(--muted); display: block; margin-top: 4px; }
.toast { position: fixed; bottom: 23px; left: 50%; transform: translate(-50%,20px); opacity: 0; pointer-events: none; background: #203e50; border: 1px solid #5e9cbb; padding: 13px 22px; border-radius: 10px; color: #e6f5ff; box-shadow: 0 5px 30px #0008; z-index: 20; max-width: calc(100% - 30px); transition: opacity .2s, transform .2s; }
.toast.visible { opacity: 1; transform: translate(-50%,0); }
.noscript { padding: 30px; }
.connection-panel { max-width: 1000px; margin: 20px auto 35px; display: grid; grid-template-columns: 1fr 1fr; gap: 42px; padding: 30px; }
.connection-panel h1 { margin: 9px 0 15px; }
.connection-panel p, .connection-guide li { color: var(--muted); font-size: 13px; line-height: 1.65; }
.connection-panel .settings-form { margin-top: 20px; }
.connection-message { border: 1px solid #3c647e; background: #13364a; padding: 12px 16px; border-radius: 8px; color: #bee3fc !important; margin: 16px 0; font-size: 13px; }
.connection-message.error { border-color: #9a4f46; background: #432524; color: #ffd1c8 !important; }
.connection-actions { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 22px; }
.connection-guide { border-left: 1px solid var(--border); padding-left: 30px; }
.connection-guide ol { padding-left: 20px; margin: 20px 0; }
.connection-guide li { margin-bottom: 15px; }
.connection-guide .text-button { display: block; margin-top: 18px; }
.connection-guide hr { border: 0; border-top: 1px solid var(--border); margin: 24px 0; }
.connection-guide p { margin-bottom: 14px; }
.live-notice { margin: 0 0 18px; }
.is-saving { cursor: progress; }
.is-saving .dialog-actions .primary { opacity: .5; pointer-events: none; }
@media(max-width:700px){.connection-panel{grid-template-columns:1fr;gap:25px;padding:22px}.connection-guide{border-left:0;border-top:1px solid var(--border);padding:25px 0 0}}
@keyframes view-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes line-in { from { opacity: .25; } to { opacity: 1; } }
@media (min-width: 1550px) { .app-header { gap: 35px; } .overview-grid { grid-template-columns: minmax(0,2.68fr) minmax(390px,1fr); } .urgent-table td { height: 68px; } .line-chart { height: 235px; } }
@media (max-width: 1350px) {
  .app-header { gap: 20px; padding: 0 22px; }
  .brand { width: 290px; gap: 12px; }
  .brand-copy > span { font-size: 26px; }
  .brand-copy small { font-size: 7px; letter-spacing: 2px; }
  .header-date { min-width: 140px; padding-left: 17px; }
  .system-state { gap: 10px; padding-left: 0; border: 0; }
  .system-state small { font-size: 10px; }
  .primary-nav { gap: 10px; }
  .primary-nav button { gap: 9px; font-size: 12px; }
  .urgent-heading { gap: 11px; }
  .urgent-heading h1 { font-size: 18px; }
  .urgent-heading p { font-size: 11px; }
  .urgent-heading .ghost-red { font-size: 10px; padding: 10px 8px; }
  .urgent-heading > .count-badge { display: none; }
  .overview-grid { grid-template-columns: minmax(0,2.45fr) minmax(320px,1fr); }
  .urgent-table table { font-size: 11px; }
  .urgent-table th { font-size: 9px; }
  .urgent-table td { padding: 9px 7px; }
  .urgent-table td:nth-child(2) { min-width: 110px; }
  .urgent-table td:nth-child(4) { min-width: 100px; }
  .status { font-size: 10px; padding: 7px 8px; }
  .panel-heading h2 { font-size: 14px; gap: 10px; }
  .panel-heading h2 .icon { width: 23px; }
  .stock-card .small { display: none; }
}
@media (max-width: 1100px) {
  .system-state { display: none; }
  .app-header { gap: 25px; }
  .overview-grid { grid-template-columns: minmax(0,1fr) 310px; }
  .urgent-heading .ghost-red { display: none; }
  .urgent-table { overflow-x: auto; }
  .urgent-table table { min-width: 710px; }
  .urgent-panel { min-width: 0; }
  .panel-heading h2 { font-size: 13px; }
  .finance-card .panel-heading { flex-wrap: wrap; }
  .logistics-grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .app-header { height: auto; min-height: 84px; flex-wrap: wrap; gap: 14px; padding: 12px 18px; }
  .brand { width: auto; margin-right: auto; }
  .global-search { order: 5; flex-basis: 100%; height: 42px; }
  .header-date { border-left: 0; min-width: auto; }
  .primary-nav { display: flex; overflow-x: auto; padding: 14px 16px 18px; gap: 9px; }
  .primary-nav button { flex: 0 0 140px; height: 53px; }
  #app-main { padding: 0 16px 15px; }
  .overview-grid { grid-template-columns: 1fr; }
  .overview-rail { grid-template-columns: 1fr 1fr; grid-template-rows: auto; }
  .urgent-panel { grid-row: 1; }
  .urgent-heading .ghost-red { display: inline-flex; margin-left: auto; }
  .finance-card { grid-row: 3; }
  .stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .set-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .page-heading { flex-wrap: wrap; }
}
@media (max-width: 540px) {
  .brand-copy > span { font-size: 22px; }
  .brand-copy small { font-size: 6px; letter-spacing: 1.2px; }
  .brand-crystal { width: 35px; height: 48px; }
  .header-date { display: none; }
  .profile-button .small-icon { display: none; }
  .overview-rail { grid-template-columns: 1fr; }
  .urgent-heading { height: auto; min-height: 74px; }
  .urgent-heading h1 { font-size: 16px; }
  .urgent-heading p { font-size: 10px; }
  .urgent-heading .ghost-red { display: none; }
  .flame-icon .icon { width: 28px; }
  .finance-card .panel-heading h2 { font-size: 12px; }
  .chart-legend { gap: 12px; justify-content: flex-start; flex-wrap: wrap; }
  .stats-grid { gap: 9px; }
  .stat-card { padding: 13px; }
  .stat-card strong { font-size: 24px; }
  .set-grid { grid-template-columns: 1fr; }
  .edit-form { grid-template-columns: 1fr; }
  .edit-form .wide { grid-column: auto; }
  .toolbar > * { width: 100%; }
  .input-with-icon { min-width: 0; }
  .app-footer { flex-direction: column; gap: 5px; }
  .scan-form { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

body.admin-locked #app-main { padding: clamp(32px,10vh,100px) 20px; }
body.admin-locked .connection-panel { display: block; width: min(100%,480px); margin: 0 auto; padding: clamp(24px,5vw,40px); }
body.admin-locked .connection-panel h1 { margin-top: 12px; }
body.admin-locked .connection-actions { display: flex; flex-wrap: wrap; gap: 12px 20px; margin-top: 20px; }

.product-thumbnail { width: 44px; height: 44px; object-fit: contain; border-radius: 6px; background: #122536; float: left; margin-right: 10px; }
.set-visual img { display: block; width: 100%; height: 100%; max-height: 150px; object-fit: contain; border-radius: inherit; }
.set-purchase-note { margin: 14px 0; padding: 12px; border: 1px solid #97734366; border-radius: 8px; background: #9b6f2114; font-size: 12px; }
.set-purchase-note b { color: var(--gold); }
.set-purchase-note ul { margin: 8px 0; padding-left: 18px; }
.set-purchase-note li { margin: 5px 0; }
.set-purchase-note small { color: var(--muted); }

