:root {
  --ink: #202020;
  --muted: #6f6f73;
  --paper: #f3f3f3;
  --card: #ffffff;
  --line: #ececef;
  --green: #2f8126;
  --green-dark: #24681d;
  --purple: #9a57ff;
  --purple-dark: #7130d0;
  --lime: #d6ff75;
  --amber: #d89013;
  --red: #ec3f35;
  --shadow: 0 10px 30px rgba(28, 28, 31, .035);
  font-family: Inter, Arial, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  font-size: 14px;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--paper); }
button, input, textarea { font: inherit; }
button { color: inherit; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(1.75rem, 3.2vw, 2.6rem); letter-spacing: -.04em; line-height: 1; }
h2 { margin-bottom: 0; font-size: 1.08rem; letter-spacing: -.02em; }

.topbar { height: 76px; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .96); position: sticky; top: 0; z-index: 10; backdrop-filter: blur(16px); }
.brand { color: inherit; text-decoration: none; display: flex; align-items: center; gap: 11px; font-weight: 750; }
.brand-mark { width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center; background: linear-gradient(145deg, #d130ef 0%, #9b35e5 45%, #42106f 100%); color: white; font-weight: 900; letter-spacing: -.05em; }
.brand-mark.small { width: 42px; height: 42px; border-radius: 12px; font-size: .82rem; }
.topbar-actions { display: flex; align-items: center; gap: 16px; }
.refresh-state { font-size: .76rem; color: var(--muted); }

.app-shell { min-height: calc(100vh - 76px); display: grid; grid-template-columns: 150px minmax(0, 1fr); max-width: none; margin: 0; }
.tabs { display: flex; flex-direction: column; overflow-y: auto; border-right: 1px solid var(--line); gap: 6px; padding: 20px 10px; background: white; scrollbar-width: none; }
.tab { border: 0; border-radius: 26px; background: transparent; padding: 13px 12px; white-space: nowrap; cursor: pointer; font-weight: 650; text-align: left; color: var(--muted); }
.tab:hover { color: var(--ink); background: #f5f5f5; }
.tab.active { color: white; background: var(--ink); }
.content { min-width: 0; padding: 24px clamp(16px, 2.5vw, 36px) 44px; }
.panel { display: none; padding-top: 0; }
.panel.active { display: block; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 22px; margin-bottom: 20px; }
.eyebrow { margin-bottom: 8px; color: var(--purple); text-transform: uppercase; letter-spacing: .12em; font-size: .7rem; font-weight: 850; }
.muted, .hint { color: var(--muted); }
.hint { font-size: .88rem; margin: -14px 0 20px; }

.button, .chip { border: 1px solid var(--line); border-radius: 8px; background: var(--card); padding: 8px 12px; cursor: pointer; font-weight: 700; transition: .15s ease; }
.button { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.button:hover, .chip:hover { border-color: var(--purple); transform: translateY(-1px); }
.button.primary { background: var(--purple); border-color: var(--purple); color: white; }
.button.primary:hover { background: var(--purple-dark); }
.button.ghost { background: transparent; }
.button.compact { padding: 8px 12px; }
.button.danger { color: var(--red); }
.button:disabled { cursor: wait; opacity: .55; transform: none; }
.chip { padding: 7px 11px; border-radius: 26px; font-size: .8rem; }
.chip.active { color: white; border-color: var(--purple); background: var(--purple); }
.report-view-switch { display: flex; gap: 7px; margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.period-controls { display: flex; flex-direction: column; align-items: end; gap: 8px; }
.preset-group, .date-range, .action-row { display: flex; align-items: center; gap: 8px; }
input { border: 1px solid var(--line); border-radius: 8px; background: var(--card); padding: 7px 9px; color: var(--ink); min-width: 0; }
input:focus { outline: 3px solid rgba(154, 87, 255, .14); border-color: var(--purple); }

.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 11px; margin-bottom: 11px; }
.summary-group { margin-bottom: 22px; }
.summary-group-head { min-height: 34px; display: flex; align-items: baseline; gap: 12px; padding: 0 4px 9px; border-bottom: 1px solid var(--line); margin-bottom: 11px; }
.summary-group-head h2 { font-size: .92rem; text-transform: uppercase; letter-spacing: .08em; }
.summary-group-head span { color: var(--muted); font-size: .75rem; }
.summary-metrics { margin-bottom: 0; }
.summary-operations-metrics { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.summary-stock-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.summary-finance-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pfc-metrics { grid-template-columns: repeat(5, 1fr); }
.fbo-metrics { grid-template-columns: repeat(6, 1fr); }
.employee-metrics { grid-template-columns: repeat(6, 1fr); }
.metric { min-height: 118px; border: 1px solid var(--line); background: var(--card); padding: 17px; display: flex; flex-direction: column; border-radius: 22px; }
.metric.featured { color: white; background: var(--ink); border-color: var(--ink); }
.metric span { color: var(--muted); font-size: .82rem; font-weight: 700; }
.metric.featured span, .metric.featured small { color: #d9d9dc; }
.metric strong { font-size: clamp(1.65rem, 2.5vw, 2.45rem); letter-spacing: -.05em; margin: auto 0 2px; }
.metric small { color: var(--muted); }
.task-open-line { min-height: 54px; display: flex; align-items: baseline; gap: 10px 16px; padding: 13px 17px; margin-bottom: 16px; border: 1px solid #ddd0ef; border-radius: 18px; background: #f8f2ff; }
.task-open-line span { color: var(--muted); font-size: .82rem; font-weight: 700; }
.task-open-line strong { font-size: 1.05rem; }
.task-open-line small { margin-left: auto; color: var(--muted); }
.payout-metric { min-height: 142px; }
.payout-lines { display: grid; gap: 5px; margin: auto 0 4px; }
.payout-lines div { display: grid; grid-template-columns: 72px 1fr; align-items: baseline; gap: 7px; }
.payout-lines div small { color: #d9d9dc; font-weight: 700; }
.payout-lines strong { margin: 0; font-size: clamp(1.2rem, 1.8vw, 1.75rem); text-align: right; }

.report-grid { display: grid; grid-template-columns: 1.65fr 1fr; gap: 11px; margin-bottom: 11px; }
.card { border: 1px solid var(--line); background: var(--card); border-radius: 26px; box-shadow: var(--shadow); overflow: hidden; }
.card-head { min-height: 52px; padding: 14px 17px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.card-head .muted { font-size: .75rem; }
.breakdown { display: grid; grid-template-columns: 1fr 1fr; }
.breakdown-row { padding: 12px 17px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; gap: 3px 12px; }
.breakdown-row:nth-child(odd) { border-right: 1px solid var(--line); }
.breakdown-row:nth-last-child(-n+2) { border-bottom: 0; }
.breakdown-row strong { font-size: .9rem; }
.breakdown-row span { color: var(--muted); font-size: .77rem; }
.breakdown-row b { grid-row: span 2; align-self: center; font-size: 1.05rem; }
.rank-list { min-height: 180px; }
.rank-row { padding: 11px 17px; display: grid; grid-template-columns: 24px 1fr auto; gap: 9px; align-items: center; border-bottom: 1px solid var(--line); }
.rank-row:last-child { border-bottom: 0; }
.rank-number { color: var(--muted); font-size: .75rem; }
.rank-row small { display: block; color: var(--muted); margin-top: 3px; }
.empty-state { color: var(--muted); display: grid; place-items: center; }

.table-card { margin-top: 11px; }
.table-scroll { overflow-x: auto; }
.filterable-table-scroll { max-height: 620px; overflow: auto; scrollbar-gutter: stable; }
.filterable-table thead { position: sticky; top: 0; z-index: 3; }
.data-table-controls { min-height: 52px; display: flex; align-items: center; gap: 8px 12px; padding: 9px 13px; border-bottom: 1px solid var(--line); background: #fafafa; }
.data-table-controls label { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: .76rem; font-weight: 700; }
.data-table-page-size { min-width: 72px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: white; font: inherit; }
.data-table-count { margin-left: auto; color: var(--muted); font-size: .76rem; }
.data-table-pager { display: flex; align-items: center; gap: 8px; }
.data-table-pager > span { min-width: 54px; color: var(--muted); font-size: .76rem; font-weight: 750; text-align: center; }
.table-filter-row th { padding: 6px; background: #f2f2f4; }
.table-filter-input { width: 100%; min-width: 88px; padding: 6px 8px; border-radius: 6px; color: var(--ink); background: white; font-size: .72rem; font-weight: 500; letter-spacing: 0; text-transform: none; }
.table-filter-date { min-width: 132px; }
.table-filter-select { min-width: 120px; }
.table-filter-number { min-width: 72px; text-align: right; }
table { border-collapse: collapse; width: 100%; min-width: 760px; }
th, td { padding: 10px 13px; text-align: left; border-bottom: 1px solid var(--line); font-size: .8rem; vertical-align: top; }
th { color: var(--muted); font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; background: #fafafa; }
tbody tr:last-child td { border-bottom: 0; }
.payroll-paid-row { background: #f7fbf6; }
.payroll-paid-row td { color: var(--muted); }
.out-of-order-row { background: #fff4f1; }
.out-of-order-row:hover, .out-of-order-row:focus { background: #ffe9e4; }
td.number, th.number { text-align: right; }
.table-actions { display: flex; justify-content: end; gap: 6px; }
.table-actions .button { padding: 6px 9px; font-size: .76rem; }
.table-link { appearance: none; border: 0; border-bottom: 1px dashed currentColor; background: none; padding: 0; color: var(--purple-dark); cursor: pointer; font: inherit; font-weight: 750; text-align: left; }
.table-link:hover, .table-link:focus-visible { color: var(--purple); border-bottom-style: solid; outline: none; }
.quantity-change { font-weight: 850; }
.quantity-change.positive { color: var(--green); }
.quantity-change.negative { color: var(--red); }
.status { display: inline-flex; align-items: center; gap: 6px; border-radius: 20px; padding: 5px 9px; background: #e8f3e6; color: var(--green); font-size: .72rem; font-weight: 750; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.offline, .status.rejected, .status.blocked { color: var(--red); background: #f8e8e4; }
.status.unknown { color: #806316; background: #f7edcf; }
.status.closed { color: var(--purple-dark); background: #f0e7ff; }
.box-row, .task-row, .performance-row, .inventory-row { cursor: pointer; transition: background .15s ease; }
.box-row:hover, .box-row:focus, .task-row:hover, .task-row:focus, .performance-row:hover, .performance-row:focus, .inventory-row:hover, .inventory-row:focus { background: #f7f1ff; outline: none; }
.employee-report-controls { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 14px; padding: 15px 17px; border: 1px solid var(--line); border-radius: 20px; background: white; }
.employee-report-controls .eyebrow { margin-bottom: 4px; }
.employee-report-controls .muted { font-size: .78rem; }
.employee-chart-card { margin-bottom: 11px; }
.employee-chart-legend { display: flex; flex-wrap: wrap; justify-content: end; gap: 8px 16px; color: var(--muted); font-size: .74rem; }
.employee-chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.employee-chart-legend span::before { content: ""; width: 16px; height: 3px; border-radius: 3px; background: var(--chart-color); box-shadow: 0 0 0 2px white, 0 0 0 3px var(--chart-color); }
.employee-operations-chart { min-height: 300px; padding: 4px 14px 10px; overflow-x: auto; }
.employee-operations-chart svg { display: block; width: 100%; min-width: 720px; height: auto; }
.chart-grid { stroke: #ececef; stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart-axis-label { fill: var(--muted); font-size: 11px; }
.chart-axis-title { fill: var(--muted); font-size: 12px; font-weight: 700; }
.employee-chart-line { fill: none; stroke-width: 2.5; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.chart-point { cursor: help; stroke: white; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.employee-chart-empty { min-height: 300px; }

.enrollment-card { background: var(--green); color: white; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 22px; margin-bottom: 13px; border-radius: 24px; }
.enrollment-card .eyebrow { color: var(--lime); }
.enrollment-card p { color: #d4e9df; }
.enrollment-card code { display: block; max-width: 650px; overflow-wrap: anywhere; font-size: .75rem; }
.enrollment-card img { background: white; padding: 10px; border-radius: 6px; }
.hidden { display: none !important; }
.application-card { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 26px; padding: 22px; margin-bottom: 13px; color: white; background: linear-gradient(135deg, var(--purple), var(--purple-dark)); border-radius: 26px; box-shadow: var(--shadow); }
.application-copy { max-width: 760px; }
.application-copy .eyebrow { color: white; }
.application-copy h2 { font-size: clamp(1.3rem, 2.5vw, 1.95rem); margin-bottom: 9px; }
.application-copy p:not(.eyebrow) { color: #d4e9df; line-height: 1.55; }
.application-copy .button { text-decoration: none; background: var(--lime); border-color: var(--lime); color: var(--green-dark); }
.application-copy code { max-width: min(520px, 100%); overflow-wrap: anywhere; color: #d4e9df; font-size: .72rem; }
.application-qr { display: grid; justify-items: center; gap: 8px; color: #d4e9df; font-size: .72rem; }
.application-qr img { padding: 9px; background: white; border-radius: 6px; }
.device-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 11px; }
.device-card { padding: 17px; border: 1px solid var(--line); background: var(--card); border-radius: 23px; }
.device-card-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 18px; }
.device-card dl { display: grid; grid-template-columns: 1fr auto; margin: 0; gap: 11px; font-size: .82rem; }
.device-card dt { color: var(--muted); }
.device-card dd { margin: 0; text-align: right; }
.device-card-actions { display: flex; justify-content: flex-end; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }

.notice { border-left: 4px solid var(--amber); background: #fff7df; padding: 11px 13px; margin: -6px 0 16px; font-size: .84rem; }
.storage-head { align-items: center; }
.storage-search { width: min(820px, 66vw); display: flex; gap: 8px; }
.storage-search input { flex: 1; min-width: 180px; padding: 10px 12px; }
.storage-metrics { grid-template-columns: repeat(5, 1fr); }
.storage-locations, .storage-location-groups { display: grid; gap: 15px; }
.storage-location-actions { display: flex; justify-content: flex-end; margin-bottom: 10px; }
.storage-row-group { overflow: hidden; border: 1px solid var(--line); border-radius: 24px; background: white; box-shadow: var(--shadow); }
.storage-row-group > summary { min-height: 72px; display: grid; grid-template-columns: auto auto 1fr 14px; align-items: center; gap: 12px 18px; padding: 14px 18px; cursor: pointer; list-style: none; }
.storage-row-group > summary::-webkit-details-marker, .storage-shelf-group > summary::-webkit-details-marker { display: none; }
.storage-row-group[open] > summary { border-bottom: 1px solid var(--line); }
.storage-row-name { display: flex; align-items: baseline; gap: 8px; }
.storage-row-name small { color: var(--muted); font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.storage-row-name strong { font-size: 1.4rem; letter-spacing: -.04em; }
.storage-row-type { width: fit-content; padding: 5px 9px; border-radius: 20px; color: var(--green-dark); background: #e8f3e6; font-size: .72rem; font-weight: 800; }
.storage-row-type.pallet { color: var(--purple-dark); background: #f0e7ff; }
.storage-row-type.mixed { color: #76520e; background: #fff0c8; }
.storage-row-type.other { color: #806316; background: #f7edcf; }
.storage-row-summary { justify-self: end; color: var(--muted); font-size: .78rem; }
.storage-row-chevron, .storage-shelf-chevron { width: 9px; height: 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .15s ease; }
.storage-row-group[open] > summary .storage-row-chevron, .storage-shelf-group[open] > summary .storage-shelf-chevron { transform: rotate(225deg); }
.storage-shelf-groups { display: grid; gap: 10px; padding: 12px; background: #fafafa; }
.storage-row-group:not([open]) > .storage-shelf-groups { display: none; }
.storage-shelf-group { overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: white; }
.storage-shelf-group > summary { min-height: 56px; display: grid; grid-template-columns: auto 1fr 14px; align-items: center; gap: 12px 18px; padding: 11px 14px; cursor: pointer; list-style: none; }
.storage-shelf-group[open] > summary { border-bottom: 1px solid var(--line); }
.storage-shelf-name { display: flex; align-items: baseline; gap: 7px; }
.storage-shelf-name small { color: var(--muted); font-size: .66rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.storage-shelf-name strong { font-size: 1.08rem; }
.storage-shelf-summary { justify-self: end; color: var(--muted); font-size: .75rem; }
.storage-shelf-group:not([open]) > .storage-location-list { display: none; }
.storage-location-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.storage-shelf-group .storage-location-list { padding: 10px; background: #fafafa; }
.storage-location-tile { min-height: 154px; display: flex; flex-direction: column; align-items: flex-start; padding: 17px; border: 1px solid var(--line); border-radius: 22px; color: var(--ink); background: white; box-shadow: var(--shadow); cursor: pointer; text-align: left; transition: .15s ease; }
.storage-location-tile:hover, .storage-location-tile:focus { border-color: var(--purple); transform: translateY(-2px); outline: 3px solid rgba(154, 87, 255, .1); }
.storage-location-tile > strong { margin: 5px 0 12px; font-size: 1.55rem; letter-spacing: -.04em; }
.storage-location-tile > span:not(.storage-location-label) { color: var(--muted); font-size: .75rem; }
.storage-location-tile > b { margin-top: auto; font-size: 1.05rem; }
.storage-location-tile > small { margin-top: 4px; color: var(--muted); font-size: .66rem; }
.storage-catalog { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.storage-location { overflow: hidden; border: 1px solid var(--line); background: var(--card); border-radius: 26px; box-shadow: var(--shadow); }
.storage-location-head { min-height: 94px; display: grid; grid-template-columns: minmax(190px, 1fr) auto auto; align-items: center; gap: 28px; padding: 18px 20px; color: white; background: var(--ink); }
.storage-location-label { display: block; margin-bottom: 4px; color: #bdbdc2; font-size: .66rem; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.storage-location-head h2 { font-size: 1.65rem; letter-spacing: -.04em; }
.storage-location-summary { display: flex; align-items: baseline; gap: 7px; }
.storage-location-summary strong { font-size: 2rem; letter-spacing: -.05em; }
.storage-location-summary span { color: #bdbdc2; font-size: .76rem; }
.storage-inventory-meta { display: grid; justify-items: end; gap: 6px; }
.storage-inventory-meta small { color: #bdbdc2; }
.storage-product-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); }
.storage-product-card { min-height: 180px; display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; gap: 15px; padding: 17px; background: white; }
.storage-product-photo { width: 112px; height: 146px; align-self: center; display: grid; place-items: center; overflow: hidden; border-radius: 17px; background: linear-gradient(145deg, #f7f1ff, #f0f0f3); }
.storage-product-photo img { width: 100%; height: 100%; display: block; object-fit: cover; }
.storage-photo-placeholder { max-width: 60px; color: var(--muted); text-align: center; font-size: .7rem; font-weight: 700; }
.storage-product-main { min-width: 0; display: flex; flex-direction: column; }
.storage-product-title { min-height: 38px; margin: 3px 0 7px; font-weight: 800; line-height: 1.35; }
.storage-product-title a { color: inherit; text-decoration-color: #cdb1f8; text-underline-offset: 3px; }
.storage-product-title a:hover { color: var(--purple-dark); }
.storage-product-link { width: fit-content; margin-top: 6px; color: var(--purple-dark); font-size: .72rem; font-weight: 750; text-underline-offset: 3px; }
.storage-product-main code { width: fit-content; max-width: 100%; overflow-wrap: anywhere; color: var(--muted); font-size: .73rem; }
.storage-product-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 13px; }
.storage-product-tags span { padding: 4px 7px; color: #4e4e53; background: #f2f2f4; border-radius: 6px; font-size: .68rem; font-weight: 700; }
.storage-product-tags .pending { color: #76540c; background: #fff1c9; }
.storage-cell-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.storage-cell-tags span { padding: 4px 7px; color: var(--purple-dark); background: #f3ebff; border-radius: 6px; font-size: .68rem; font-weight: 750; }
.storage-product-volume { display: flex; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 12px; color: var(--muted); font-size: .73rem; }
.storage-product-volume b { color: var(--ink); text-align: right; }
.storage-product-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 9px; }
.storage-quantity { align-self: start; min-width: 54px; display: grid; justify-items: end; color: var(--purple-dark); }
.storage-quantity strong { font-size: 1.8rem; letter-spacing: -.06em; line-height: 1; }
.storage-quantity span { color: var(--muted); font-size: .68rem; font-weight: 700; }
.storage-empty { min-height: 180px; display: grid; place-items: center; padding: 30px; color: var(--muted); text-align: center; }
.storage-limit { margin: 0; }
.storage-location-dialog .storage-product-grid { background: var(--line); }
.tariff-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.tariff-item { border: 1px solid var(--line); background: var(--card); padding: 14px; border-radius: 18px; display: grid; grid-template-columns: 1fr 125px; gap: 10px; align-items: center; }
.tariff-item label { font-weight: 700; }
.tariff-section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 19px 2px 10px; }
.tariff-section-head h2 { margin: 2px 0 0; }
.tariff-editor-head > div > .muted { display: block; margin-top: 5px; font-size: .75rem; }
.tariff-date-control { display: grid; gap: 4px; color: var(--muted); font-size: .7rem; font-weight: 750; }
.tariff-date-control input { min-width: 145px; }
.employee-tariffs-card { margin-top: 18px; padding-bottom: 2px; }
.employee-tariff-controls { display: flex; align-items: end; gap: 10px; }
.employee-tariff-controls select { min-width: 230px; }
.employee-tariff-controls label { display: grid; gap: 4px; color: var(--muted); font-size: .7rem; font-weight: 750; }
.employee-tariff-controls input { min-width: 145px; }
.employee-tariff-notice { margin: 0 17px 12px; }
.employee-tariff-dates { min-height: 29px; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 0 17px 12px; color: var(--muted); font-size: .72rem; }
.employee-tariff-date { padding: 5px 8px; border: 1px solid var(--line); color: var(--purple-dark); background: #f7f1ff; border-radius: 8px; font: inherit; font-weight: 750; cursor: pointer; }
.employee-tariff-date.active { color: white; border-color: var(--purple); background: var(--purple); }
.employee-tariffs-card .tariff-grid { padding: 0 17px; }
.tariff-source { display: block; margin-top: 3px; color: var(--muted); font-size: .68rem; font-weight: 500; }
.tariff-source.custom { color: var(--purple-dark); font-weight: 750; }
.tariff-actions { padding-right: 17px; }
.tariff-history-card { margin-top: 14px; }
.tariff-history-head { margin-top: 14px; border-top: 1px solid var(--line); }
.tariff-history-card td small, .employee-tariffs-card td small { color: var(--muted); }
.employee-tariff-empty { min-height: 100px; grid-column: 1 / -1; }
.money-input { display: flex; align-items: center; gap: 7px; }
.money-input input { width: 100%; text-align: right; }
.form-footer { margin-top: 16px; display: flex; justify-content: end; }

.instruction-lead { display: grid; grid-template-columns: minmax(220px, .7fr) 1.3fr; align-items: center; gap: 22px; padding: 20px 22px; margin-bottom: 12px; color: white; background: var(--ink); border-radius: 26px; }
.instruction-lead .eyebrow { color: var(--lime); }
.instruction-checks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.instruction-checks span { min-height: 62px; display: flex; align-items: center; padding: 13px 15px 13px 34px; position: relative; background: rgba(255, 255, 255, .08); border-radius: 17px; font-size: .8rem; font-weight: 750; }
.instruction-checks span::before { content: ""; width: 9px; height: 9px; position: absolute; left: 15px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 4px rgba(214, 255, 117, .12); }
.instruction-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.instruction-card { display: grid; grid-template-columns: 48px 1fr; gap: 15px; padding: 20px; border: 1px solid var(--line); background: var(--card); border-radius: 26px; box-shadow: var(--shadow); }
.instruction-number { width: 48px; height: 48px; display: grid; place-items: center; color: white; background: var(--purple); border-radius: 15px; font-weight: 850; }
.instruction-card h2 { margin-bottom: 13px; font-size: 1.2rem; }
.instruction-card code { padding: 2px 5px; color: var(--purple-dark); background: #f3ebff; border-radius: 5px; font-size: .82em; }
.instruction-list { margin: 0; padding-left: 20px; color: #404044; line-height: 1.55; }
.instruction-list li { padding-left: 4px; margin-bottom: 8px; }
.instruction-list li:last-child { margin-bottom: 0; }
.instruction-list li::marker { color: var(--purple); font-weight: 850; }
.instruction-copy { color: var(--muted); line-height: 1.55; }
.instruction-warning { margin-top: 14px; padding: 11px 13px; color: #76540c; background: #fff7df; border-left: 4px solid var(--amber); border-radius: 0 12px 12px 0; font-size: .82rem; line-height: 1.5; }
.instruction-footer { display: grid; grid-template-columns: .75fr 1.25fr; gap: 24px; padding: 21px 23px; margin-top: 12px; border: 1px solid #ddd0ef; background: #f8f2ff; border-radius: 26px; }
.compact-list { display: grid; grid-template-columns: 1fr 1fr; column-gap: 25px; }

.toast { position: fixed; right: 24px; bottom: 24px; max-width: min(380px, calc(100vw - 30px)); background: var(--ink); color: white; border-radius: 9px; padding: 13px 17px; box-shadow: var(--shadow); transform: translateY(30px); opacity: 0; pointer-events: none; transition: .2s ease; z-index: 30; }
.toast.show { transform: none; opacity: 1; }
.toast.error { background: var(--red); }

.box-dialog { width: min(1020px, calc(100vw - 32px)); max-height: min(760px, calc(100vh - 32px)); padding: 0; overflow-y: auto; color: var(--ink); background: white; border: 0; border-radius: 26px; box-shadow: 0 30px 100px rgba(27, 20, 38, .22); }
.box-dialog::backdrop { background: rgba(24, 22, 28, .48); backdrop-filter: blur(4px); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 19px 21px; border-bottom: 1px solid var(--line); }
.dialog-actions { display: flex; align-items: center; gap: 8px; }
.dialog-actions form { margin: 0; }
.box-dialog-meta { display: flex; flex-wrap: wrap; gap: 9px 22px; padding: 13px 21px; background: #faf8fd; color: var(--muted); font-size: .8rem; }
.box-dialog .table-scroll { max-height: 520px; }
.box-dialog .box-detail-head { padding-top: 17px; padding-bottom: 9px; }
.box-dialog .box-history-scroll { max-height: 235px; }

.history-page { min-height: 100vh; background: var(--paper); }
.history-page .topbar { position: static; }
.history-shell { width: min(1320px, 100%); margin: 0 auto; padding: 28px clamp(12px, 3vw, 36px) 48px; }
.history-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.history-head h1 { margin-bottom: 8px; }
.history-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; margin-bottom: 14px; }
.history-summary .metric { min-height: 104px; }
.history-table { overflow: hidden; }
.history-empty { padding: 34px 20px; color: var(--muted); text-align: center; }

.login-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: linear-gradient(145deg, #b55cff, #4a147c); }
.login-card { width: min(390px, 100%); background: var(--card); padding: clamp(24px, 6vw, 38px); border-radius: 24px; box-shadow: 0 30px 80px rgba(0, 0, 0, .22); }
.login-card .brand-mark { margin-bottom: 22px; }
.login-card h1 { font-size: 2.15rem; margin-bottom: 10px; }
.login-card .site-label { color: var(--purple); font-size: 1.15rem; font-weight: 800; margin: -2px 0 10px; }
.stack-form { display: grid; gap: 13px; margin-top: 21px; }
.stack-form label { display: grid; gap: 7px; font-size: .78rem; font-weight: 750; }
.stack-form input { padding: 12px; }
.alert { background: #f8e8e4; color: #8c3026; padding: 11px 13px; border-radius: 7px; margin-top: 18px; font-size: .84rem; }
.alert.success { color: var(--green-dark); background: #e8f3e6; }

.seller-login-page { background: radial-gradient(circle at 20% 15%, #d6ff75 0, transparent 28%), linear-gradient(145deg, #30124c, #111); }
.seller-site-label { color: var(--muted); font-size: .78rem; font-weight: 750; }
.seller-shell { width: min(1380px, 100%); margin: 0 auto; padding: 26px clamp(12px, 3vw, 38px) 50px; }
.seller-hero { min-height: 220px; display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(210px, .5fr); align-items: end; gap: 30px; padding: clamp(24px, 4vw, 46px); color: white; background: linear-gradient(125deg, #1f1d22 0%, #281337 62%, #7130d0 100%); border-radius: 32px; overflow: hidden; position: relative; }
.seller-hero::after { content: ""; width: 280px; height: 280px; position: absolute; right: -85px; top: -130px; border: 52px solid rgba(214, 255, 117, .18); border-radius: 50%; }
.seller-hero .eyebrow { color: var(--lime); }
.seller-hero h1 { max-width: 780px; font-size: clamp(2.25rem, 5vw, 4.8rem); }
.seller-hero p:not(.eyebrow) { max-width: 660px; margin: 18px 0 0; color: #d8d4dc; line-height: 1.55; }
.seller-hero-total { display: grid; justify-items: end; align-self: center; position: relative; z-index: 1; }
.seller-hero-total strong { font-size: clamp(4rem, 8vw, 7.5rem); letter-spacing: -.08em; line-height: .85; }
.seller-hero-total span { margin-top: 12px; color: var(--lime); font-weight: 800; }
.seller-shell > .alert { margin: 14px 0 0; }
.seller-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 11px; margin-top: 12px; }
.seller-date { font-size: clamp(1.05rem, 2vw, 1.55rem) !important; letter-spacing: -.02em !important; }
.seller-upload-card { display: grid; grid-template-columns: minmax(240px, .7fr) minmax(380px, 1.3fr); gap: 36px; padding: 25px; margin-top: 12px; border: 1px solid #ddd0ef; background: #f8f2ff; border-radius: 26px; }
.seller-upload-card h2 { margin-bottom: 10px; font-size: 1.45rem; }
.seller-upload-card p.muted { margin-bottom: 0; line-height: 1.55; }
.seller-upload-form { display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 10px; }
.seller-upload-form label { display: grid; gap: 7px; color: var(--muted); font-size: .76rem; font-weight: 750; }
.seller-upload-form label:first-child { grid-row: span 2; }
.seller-upload-form textarea { width: 100%; min-height: 120px; resize: vertical; padding: 11px; color: var(--ink); background: white; border: 1px solid var(--line); border-radius: 10px; }
.seller-upload-form textarea:focus { outline: 3px solid rgba(154, 87, 255, .14); border-color: var(--purple); }
.seller-file input { width: 100%; padding: 9px; background: white; }
.seller-stock-card { margin-top: 12px; }
.seller-stock-card .card-head > div .eyebrow { margin-bottom: 4px; }
.seller-stock-table { min-width: 1040px; }
.seller-product { min-width: 280px; display: grid; grid-template-columns: 48px minmax(0, 1fr); align-items: center; gap: 11px; }
.seller-product img, .seller-product-placeholder { width: 48px; height: 58px; display: grid; place-items: center; object-fit: cover; color: var(--muted); background: #f1edf5; border-radius: 9px; font-size: .62rem; text-align: center; }
.seller-product a, .seller-product strong { color: var(--ink); font-weight: 800; line-height: 1.3; text-decoration-color: #cdb1f8; }
.seller-product small { display: block; margin-top: 5px; color: var(--muted); }
.seller-unit-count { color: var(--purple-dark); font-size: 1.1rem; font-weight: 900; }
.seller-admin-shell { max-width: 1480px; }
.seller-admin-create { display: grid; grid-template-columns: minmax(220px, .55fr) minmax(500px, 1.45fr); gap: 28px; padding: 22px; border: 1px solid #ddd0ef; background: #f8f2ff; border-radius: 24px; }
.seller-admin-create p { margin: 9px 0 0; line-height: 1.5; }
.seller-create-form { display: grid; grid-template-columns: 1.2fr 1fr 1fr auto; align-items: end; gap: 10px; }
.seller-create-form label { display: grid; gap: 6px; color: var(--muted); font-size: .75rem; font-weight: 750; }
.seller-create-form input { padding: 10px; background: white; }
.seller-admin-list { margin-top: 12px; }
.seller-inline-form { min-width: 300px; display: flex; gap: 7px; }
.seller-inline-form input { flex: 1; }

@media (max-width: 1000px) {
  .app-shell { grid-template-columns: 120px minmax(0, 1fr); }
  .tab { padding: 12px 9px; font-size: .78rem; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .summary-operations-metrics, .summary-finance-metrics { grid-template-columns: 1fr 1fr; }
  .summary-stock-metrics { grid-template-columns: 1fr 1fr; }
  .fbo-metrics { grid-template-columns: repeat(3, 1fr); }
  .storage-metrics { grid-template-columns: repeat(3, 1fr); }
  .storage-location-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .storage-product-grid { grid-template-columns: 1fr; }
  .storage-catalog { grid-template-columns: 1fr; }
  .report-grid { grid-template-columns: 1fr; }
  .device-grid { grid-template-columns: 1fr 1fr; }
  .instruction-grid { grid-template-columns: 1fr; }
  .seller-metrics { grid-template-columns: 1fr 1fr; }
  .seller-upload-card, .seller-admin-create { grid-template-columns: 1fr; }
  .seller-create-form { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 700px) {
  .topbar { height: 62px; padding: 0 13px; }
  .brand > span:last-child, .refresh-state { display: none; }
  .brand-mark.small { width: 38px; height: 38px; }
  .app-shell { min-height: calc(100vh - 62px); display: block; }
  .tabs { position: sticky; top: 62px; z-index: 9; flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 6px 8px; }
  .tab { padding: 9px 12px; font-size: .78rem; text-align: center; }
  .content { padding: 18px 8px 30px; }
  .panel { padding-top: 0; }
  .section-head { align-items: stretch; flex-direction: column; gap: 16px; }
  .storage-search { width: 100%; flex-wrap: wrap; }
  .storage-search input { flex-basis: 100%; }
  .employee-report-controls { align-items: stretch; flex-direction: column; }
  .period-controls { align-items: stretch; }
  .preset-group { overflow-x: auto; }
  .date-range { flex-wrap: wrap; }
  .date-range input { flex: 1; }
  .data-table-controls { align-items: stretch; flex-wrap: wrap; }
  .data-table-count { width: 100%; order: 3; margin-left: 0; }
  .data-table-pager { margin-left: auto; }
  .metrics { grid-template-columns: 1fr 1fr; gap: 8px; }
  .summary-group-head { align-items: flex-start; flex-direction: column; gap: 4px; }
  .fbo-metrics { grid-template-columns: 1fr 1fr; }
  .task-open-line { align-items: flex-start; flex-direction: column; }
  .task-open-line small { margin-left: 0; }
  .metric { min-height: 104px; padding: 14px; }
  .metric strong { font-size: 1.7rem; }
  .storage-metrics { grid-template-columns: 1fr 1fr; }
  .storage-location-list { grid-template-columns: 1fr 1fr; }
  .storage-row-group > summary { grid-template-columns: 1fr auto; gap: 8px 12px; }
  .seller-site-label { display: none; }
  .seller-shell { padding: 12px 8px 30px; }
  .seller-hero { min-height: 0; grid-template-columns: 1fr; padding: 25px 20px; border-radius: 24px; }
  .seller-hero h1 { font-size: 2.5rem; }
  .seller-hero-total { justify-items: start; }
  .seller-hero-total strong { font-size: 4.2rem; }
  .seller-metrics { grid-template-columns: 1fr 1fr; gap: 8px; }
  .seller-upload-card { gap: 20px; padding: 18px; }
  .seller-upload-form { grid-template-columns: 1fr; }
  .seller-upload-form label:first-child { grid-row: auto; }
  .seller-create-form { grid-template-columns: 1fr; }
  .storage-row-type { justify-self: end; }
  .storage-row-summary { grid-column: 1 / -1; grid-row: 2; justify-self: start; }
  .storage-row-chevron { grid-column: 2; grid-row: 2; justify-self: end; }
  .storage-shelf-group > summary { grid-template-columns: auto 1fr 12px; gap: 8px; }
  .storage-shelf-summary { justify-self: end; text-align: right; }
  .storage-location-head { grid-template-columns: 1fr auto; gap: 12px; padding: 16px; }
  .storage-location-summary { justify-self: end; }
  .storage-location-summary span { display: none; }
  .storage-inventory-meta { grid-column: 1 / -1; grid-template-columns: auto 1fr; justify-items: start; align-items: center; }
  .storage-product-card { grid-template-columns: 86px minmax(0, 1fr) auto; gap: 11px; padding: 13px; }
  .storage-product-photo { width: 86px; height: 116px; }
  .breakdown { grid-template-columns: 1fr; }
  .breakdown-row:nth-child(odd) { border-right: 0; }
  .breakdown-row:nth-last-child(2) { border-bottom: 1px solid var(--line); }
  .device-grid, .tariff-grid { grid-template-columns: 1fr; }
  .employee-tariff-head { align-items: stretch; flex-direction: column; }
  .tariff-editor-head { align-items: stretch; flex-direction: column; }
  .tariff-date-control input { width: 100%; }
  .employee-tariff-controls { align-items: stretch; flex-direction: column; }
  .employee-tariff-controls select, .employee-tariff-controls input { width: 100%; min-width: 0; }
  .enrollment-card { flex-direction: column; align-items: start; }
  .enrollment-card img { align-self: center; width: min(220px, 100%); height: auto; }
  .application-card { grid-template-columns: 1fr; }
  .application-card .action-row { align-items: start; flex-direction: column; }
  .application-qr { justify-self: center; }
  .application-qr img { width: min(190px, 100%); height: auto; }
  .action-row { flex-wrap: wrap; }
  .tariff-item { grid-template-columns: 1fr 120px; }
  .box-dialog { width: calc(100vw - 16px); max-height: calc(100vh - 16px); border-radius: 22px; }
  .instruction-lead, .instruction-footer { grid-template-columns: 1fr; }
  .history-head { align-items: stretch; flex-direction: column; }
  .history-summary { grid-template-columns: 1fr; }
  .instruction-checks { grid-template-columns: 1fr; }
  .instruction-card { grid-template-columns: 40px 1fr; padding: 16px; }
  .instruction-number { width: 40px; height: 40px; border-radius: 12px; }
  .compact-list { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
  .metrics { grid-template-columns: 1fr; }
  .metric { min-height: 112px; }
  .storage-metrics { grid-template-columns: 1fr 1fr; }
  .storage-metrics .metric { min-height: 98px; }
  .storage-metrics .metric:first-child { grid-column: 1 / -1; }
  .storage-product-card { grid-template-columns: 72px minmax(0, 1fr); }
  .storage-product-photo { width: 72px; height: 96px; }
  .dialog-actions { align-items: stretch; flex-direction: column; }
  .storage-quantity { grid-column: 1; grid-row: 2; justify-self: center; align-self: center; }
}
