/* Resupply shell geometry and shared SOCAR palette; no source-app dependency. */
:root {
  --bg: #fafbfc;
  --surface: #ffffff;
  --border: #e5e8ec;
  --border-strong: #d3d8de;
  --text: #1a2332;
  --text-secondary: #5c6b7f;
  --text-muted: #8b97a6;
  --hover: #f2f4f7;
  --row-hover: #f7f9fb;
  --accent: #0072ab;
  --accent-hover: #005f8f;
  --accent-soft: #eaf5fb;
  --brand-blue: #00adef;
  --positive: #1a7f42;
  --negative: #c8102e;
  --warning: #b45d0e;
  --result-tint: #f4f6f8;
  --headline-tint: #eaedf1;
  --landed-tint: #e3eef5;
  --benchmark-tint: #fef9c3;
  --settled-tint: #f5f0e6;
  --override-tint: #fff3b0;
  --override-field-tint: #fffef6;
  --radius-lg: 8px;
  --radius-md: 6px;
  --resupply-global-width: 72px;
  --resupply-module-width: 240px;
  --resupply-shell-width: calc(var(--resupply-global-width) + var(--resupply-module-width));
}

@font-face {
  font-family: "Inter";
  src: url("/assets/InterVariable.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; background: var(--bg); }
body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: var(--accent); }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
h1, h2, h3, h4, p { margin-top: 0; }
h1 { margin-bottom: 6px; font-size: 20px; line-height: 1.3; font-weight: 650; letter-spacing: -.01em; }
h2 { margin-bottom: 10px; font-size: 15px; font-weight: 650; }
h3 { margin-bottom: 8px; font-size: 13px; font-weight: 650; }
p { margin-bottom: 12px; }
.icon { width: 18px; height: 18px; flex: 0 0 auto; vertical-align: middle; }
.skip-link { position: fixed; z-index: 1200; top: 8px; left: 12px; padding: 8px 12px; background: var(--surface); border: 1px solid var(--accent); border-radius: var(--radius-md); transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }

.sidebar { position: fixed; inset: 0 auto 0 0; background: var(--surface); border-right: 1px solid var(--border); z-index: 1001; }
.resupply-sidebar { display: grid; width: var(--resupply-shell-width); grid-template-columns: var(--resupply-global-width) var(--resupply-module-width); padding: 0; overflow: hidden; }
.resupply-global-rail { display: flex; min-width: 0; flex-direction: column; align-items: center; padding: 14px 6px; border-right: 1px solid var(--border); background: var(--bg); }
.resupply-global-destinations { display: flex; width: 100%; min-height: 0; flex: 1 1 auto; flex-direction: column; align-items: center; gap: 7px; }
.resupply-global-action { display: flex; width: 58px; min-height: 52px; flex-direction: column; align-items: center; justify-content: center; gap: 5px; padding: 4px; border: 0; border-radius: var(--radius-md); background: transparent; color: var(--text-muted); text-align: center; text-decoration: none; cursor: pointer; transition: color 120ms ease, background 120ms ease; }
.resupply-global-action:hover { background: var(--hover); color: var(--text); }
.resupply-global-action.is-active { background: var(--accent-soft); color: var(--accent); }
.resupply-global-action span { width: 100%; overflow: hidden; font-size: 9px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.resupply-module-sidebar { display: flex; min-width: 0; height: 100vh; height: 100dvh; flex-direction: column; overflow: hidden; background: var(--surface); }
.resupply-brand-lockup { display: flex; align-items: center; justify-content: space-between; min-height: 84px; margin: 0 14px; padding: 14px 2px; border-bottom: 1px solid var(--border); }
.resupply-brand-link { display: flex; min-width: 0; flex-direction: column; text-decoration: none; }
.resupply-module-kicker { color: var(--text-muted); font-size: 9.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.resupply-product-name { margin-top: 4px; color: var(--text); font-size: 16px; font-weight: 650; line-height: 1.25; }
.resupply-module-note { margin-top: 2px; color: var(--text-muted); font-size: 10.5px; line-height: 1.35; }
.resupply-drawer-close { display: none; width: 34px; height: 34px; flex: 0 0 auto; border: 0; border-radius: var(--radius-md); background: transparent; color: var(--text-muted); }
.resupply-module-navigation { min-height: 0; flex: 1 1 auto; overflow-y: auto; }
.resupply-navigation { padding: 7px 0 12px; }
.resupply-nav-group { margin: 0; padding: 8px 12px 2px; }
.resupply-nav-heading { margin: 0; padding: 0 7px 5px; color: var(--text-muted); font-size: 9.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.resupply-nav-link { display: flex; align-items: center; gap: 9px; width: 100%; min-height: 32px; padding: 6px 9px; border: 0; border-left: 2px solid transparent; border-radius: var(--radius-md); background: transparent; color: var(--text-secondary); font-size: 12.5px; text-decoration: none; cursor: pointer; }
.resupply-nav-link:hover { background: var(--hover); color: var(--text); }
.resupply-nav-link.is-active { border-left-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.resupply-nav-link .icon { width: 14px; height: 14px; color: var(--text-muted); }
.resupply-nav-link.is-active .icon { color: var(--accent); }
.sidebar-footer { flex: 0 0 auto; margin: 0 16px; padding: 14px 0 18px; border-top: 1px solid var(--border); color: var(--text-secondary); font-size: 10.5px; }
.sidebar-footer .eyebrow { font-size: 9px; }
.sidebar-footer p { margin: 5px 0 8px; line-height: 1.55; }
.sidebar-disclaimer { display: block; margin-top: 10px; color: var(--text-muted); font-size: 9.5px; }
.resupply-mobile-bar, .resupply-drawer-backdrop { display: none; }

.content-area { display: flex; min-width: 0; min-height: 100vh; margin-left: var(--resupply-shell-width); padding: 0 28px; flex-direction: column; }
.workspace-bar { display: flex; min-height: 52px; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 20px; padding: 12px 0; margin-bottom: 22px; border-bottom: 1px solid var(--border); font-size: 10.5px; color: var(--text-secondary); }
.workspace-label { letter-spacing: .01em; }
.workspace-label > span { padding: 0 7px; color: var(--border-strong); }
.feed-status { display: flex; align-items: center; gap: 7px; min-width: 0; max-width: 100%; color: var(--text-secondary); }
.feed-status-text { overflow-wrap: anywhere; }
.status-dot { width: 6px; height: 6px; flex: 0 0 auto; background: var(--text-muted); border-radius: 50%; }
.feed-status[data-tone="positive"] .status-dot, .feed-status[data-tone="success"] .status-dot, .feed-status[data-tone="available"] .status-dot { background: var(--positive); }
.feed-status[data-tone="warning"] .status-dot, .feed-status[data-tone="retained"] .status-dot { background: var(--warning); }
.feed-status[data-tone="error"] .status-dot, .feed-status[data-tone="negative"] .status-dot, .feed-status[data-tone="unavailable"] .status-dot { background: var(--negative); }
.page-content { flex: 1 1 auto; min-width: 0; width: 100%; padding-bottom: 24px; scroll-margin-top: 68px; }
.content-footer { padding: 14px 0 18px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 10px; }
.page-header { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 20px; padding-bottom: 16px; margin-bottom: 20px; border-bottom: 1px solid var(--border); }
.page-header p { max-width: 900px; margin: 6px 0 0; font-size: 12.5px; color: var(--text-secondary); }
.eyebrow { color: var(--text-muted); font-size: 10px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; }
.muted { color: var(--text-secondary); }
.positive { color: var(--positive); }
.negative { color: var(--negative); }
.numeric, .num { text-align: right; font-variant-numeric: tabular-nums; }
.no-wrap { white-space: nowrap; }

.panel { min-width: 0; margin-bottom: 18px; padding: 18px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.auth-page { width: min(100% - 32px, 560px); margin: 12vh auto; }
.auth-page .panel { padding: 28px; }
.auth-page h2 { margin-top: 24px; }
.panel-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.panel-header h2, .panel-header h3, .panel-header p { margin: 0; }
.toolbar { display: flex; align-items: end; flex-wrap: wrap; gap: 10px 14px; margin-bottom: 16px; }
.toolbar > * { min-width: 0; max-width: 100%; }
.toolbar .field { flex: 0 1 180px; }
.field { display: flex; min-width: 0; flex-direction: column; gap: 5px; }
.field > label, label.field > span:first-child { color: var(--text-secondary); font-size: 11px; font-weight: 600; }
.field small { color: var(--text-secondary); font-size: 10px; line-height: 1.4; }
.field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: 14px; margin-bottom: 16px; }
.field-wide { grid-column: 1 / -1; }
input, select, textarea { min-width: 0; max-width: 100%; padding: 7px 9px; border: 1px solid var(--border-strong); border-radius: 4px; background: var(--surface); color: var(--text); font-size: 12px; line-height: 1.5; }
.field input, .field select, .field textarea { width: 100%; }
input[type="number"], input[type="date"], input[type="month"], input[type="datetime-local"] { font-variant-numeric: tabular-nums; }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--accent); }
textarea { min-height: 86px; resize: vertical; }
input:disabled, select:disabled, textarea:disabled { background: var(--hover); color: var(--text-secondary); }
input[readonly], textarea[readonly] { background: var(--result-tint); }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--negative); }
.override-field, .field.is-override input, .field.is-override select, .field.is-override textarea { background: var(--override-field-tint); border-color: var(--border-strong); }
.is-edited, .override-cell, .data-table td.override-cell { background: var(--override-tint); }
.btn { display: inline-flex; width: auto; min-height: 32px; align-items: center; justify-content: center; gap: 6px; padding: 6px 11px; border: 1px solid var(--border-strong); border-radius: var(--radius-md); background: var(--surface); color: var(--text-secondary); font-size: 12px; font-weight: 550; text-decoration: none; cursor: pointer; }
.btn:hover:not(:disabled) { background: var(--hover); color: var(--text); }
.btn-primary { border-color: var(--accent); background: var(--accent); color: var(--surface); }
.btn-primary:hover:not(:disabled) { border-color: var(--accent-hover); background: var(--accent-hover); color: var(--surface); }
.btn-danger { color: var(--negative); }
.btn-small { min-height: 26px; padding: 3px 8px; font-size: 11px; }
.form-actions { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 9px; padding-top: 14px; margin-top: 16px; border-top: 1px solid var(--border); }
fieldset { min-width: 0; margin: 0 0 16px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-md); }
legend { padding: 0 5px; font-size: 12px; font-weight: 600; }

.table-wrap { max-width: 100%; min-width: 0; overflow-x: auto; overscroll-behavior-x: contain; border: 1px solid var(--border); border-radius: var(--radius-md); }
.data-table { width: 100%; border-collapse: separate; border-spacing: 0; text-align: left; font-size: 11.5px; font-variant-numeric: tabular-nums; }
.data-table caption { padding: 10px 12px; text-align: left; color: var(--text-secondary); font-size: 11px; }
.data-table th, .data-table td { padding: 8px 10px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table th:last-child, .data-table td:last-child { border-right: 0; }
.data-table tbody tr:last-child > * { border-bottom: 0; }
.data-table thead th { background: var(--bg); color: var(--text-secondary); font-size: 10px; font-weight: 650; white-space: nowrap; }
.data-table tbody th { font-weight: 550; }
.data-table tbody tr:hover > * { background: var(--row-hover); }
.data-table td.numeric, .data-table th.numeric, .data-table td.num, .data-table th.num { text-align: right; white-space: nowrap; }
.data-table .result-cell { background: var(--result-tint); }
.data-table .headline-cell { background: var(--headline-tint); font-weight: 650; }
.data-table .landed-cell { background: var(--landed-tint); }
.data-table .benchmark-cell { background: var(--benchmark-tint); }
.data-table .settled-cell { background: var(--settled-tint); }
.data-table tbody tr:hover .result-cell { background: var(--headline-tint); }
.data-table tbody tr:hover .headline-cell { background: var(--headline-tint); }
.data-table tbody tr:hover .override-cell { background: var(--override-tint); }
.data-table .cell-note { display: block; margin-top: 3px; color: var(--text-secondary); font-size: 9.5px; font-weight: 400; white-space: normal; }
.data-table button.cell-button { width: 100%; padding: 0; border: 0; background: transparent; color: inherit; text-align: inherit; font: inherit; font-variant-numeric: tabular-nums; }
.matrix-table th, .matrix-table td { min-width: 100px; padding: 9px 11px; text-align: right; white-space: nowrap; }
.matrix-table th:first-child, .matrix-table td:first-child { position: sticky; left: 0; z-index: 1; min-width: 145px; text-align: left; background: var(--surface); border-right-color: var(--border-strong); }
.matrix-table thead th { position: sticky; top: 0; z-index: 2; background: var(--bg); }
.matrix-table thead th:first-child { z-index: 3; background: var(--bg); }
.matrix-table .unavailable { color: var(--text-muted); font-weight: 400; }
.matrix-table .selected-cell { box-shadow: inset 0 0 0 2px var(--accent); }

.detail-grid { display: grid; min-width: 0; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 18px; }
.detail-grid > * { min-width: 0; }
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 0; margin: 0 0 18px; border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; background: var(--surface); }
.metric { min-width: 0; padding: 14px 16px; border-right: 1px solid var(--border); }
.metric:last-child { border-right: 0; }
.metric-label { display: block; color: var(--text-secondary); font-size: 10px; margin-bottom: 5px; }
.metric-value { display: block; font-size: 22px; line-height: 1.3; font-weight: 600; font-variant-numeric: tabular-nums; }
.metric-note { display: block; margin-top: 4px; color: var(--text-muted); font-size: 10px; }
.breakdown { margin: 0; font-variant-numeric: tabular-nums; }
.breakdown > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border); }
.breakdown dt { color: var(--text-secondary); }
.breakdown dd { margin: 0; text-align: right; }
.breakdown .total { padding: 10px 8px; margin: 4px -8px 0; background: var(--headline-tint); font-weight: 650; }
.badge { display: inline-flex; align-items: center; max-width: 100%; padding: 2px 6px; border: 1px solid var(--border); border-radius: 4px; color: var(--text-secondary); background: var(--result-tint); font-size: 9.5px; font-weight: 550; line-height: 1.5; vertical-align: middle; }
.badge-warning { color: var(--warning); background: var(--override-field-tint); }
.badge-positive { color: var(--positive); }
.badge-negative { color: var(--negative); }
.notice, .error { margin-bottom: 16px; padding: 11px 13px; border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 4px; background: var(--accent-soft); font-size: 12px; overflow-wrap: anywhere; }
.notice p:last-child, .error p:last-child { margin-bottom: 0; }
.notice.warning { border-left-color: var(--warning); background: var(--override-field-tint); }
.error { border-left-color: var(--negative); background: var(--surface); color: var(--negative); }
.empty-state { margin: 18px 0; padding: 32px 22px; border: 1px dashed var(--border-strong); border-radius: var(--radius-md); background: var(--surface); color: var(--text-secondary); }
.empty-state h2, .empty-state h3 { color: var(--text); }
.empty-state p { max-width: 720px; }
.prose { max-width: 920px; line-height: 1.7; }
.prose h2 { margin-top: 24px; }
.prose li { margin-bottom: 6px; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }
pre { max-width: 100%; overflow-x: auto; padding: 12px; border-radius: 4px; background: var(--result-tint); }
summary { cursor: pointer; font-weight: 550; }
details[open] > summary { margin-bottom: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

@media (max-width: 1200px) and (min-width: 992px) {
  .content-area { padding-right: 20px; padding-left: 20px; }
}

@media (max-width: 991px) {
  .resupply-mobile-bar { position: fixed; inset: 0 0 auto; z-index: 1000; display: flex; align-items: center; min-height: 52px; padding: 8px 12px; border-bottom: 1px solid var(--border); background: var(--surface); }
  .resupply-mobile-toggle { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; flex: 0 0 auto; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); color: var(--text-secondary); }
  .resupply-mobile-context { display: flex; min-width: 0; align-items: center; gap: 6px; margin-left: 10px; overflow: hidden; color: var(--text-muted); font-size: 11px; white-space: nowrap; }
  .resupply-mobile-context > span { overflow: hidden; text-overflow: ellipsis; }
  .resupply-mobile-module { color: var(--text); font-weight: 650; flex: 0 0 auto; }
  .sidebar.resupply-sidebar { z-index: 1102; width: min(var(--resupply-shell-width), calc(100vw - 28px)); grid-template-columns: var(--resupply-global-width) minmax(0, 1fr); height: 100vh; height: 100dvh; visibility: hidden; transform: translateX(-102%); transition: transform .18s ease, visibility .18s; box-shadow: 18px 0 34px rgba(26, 35, 50, .16); }
  .sidebar.resupply-sidebar.is-open { transform: translateX(0); visibility: visible; }
  .resupply-drawer-close { display: inline-flex; align-items: center; justify-content: center; }
  .resupply-drawer-backdrop { position: fixed; inset: 0; z-index: 1101; display: block; background: rgba(26, 35, 50, .35); opacity: 0; pointer-events: none; transition: opacity .18s ease; }
  .resupply-drawer-backdrop.is-open { opacity: 1; pointer-events: auto; }
  body.resupply-drawer-open { overflow: hidden; }
  .content-area { margin-left: 0; padding: 52px 20px 0; }
  .workspace-bar { margin-bottom: 18px; }
}

@media (max-width: 600px) {
  .content-area { padding-right: 12px; padding-left: 12px; }
  .panel { padding: 13px; }
  .workspace-bar { align-items: flex-start; flex-direction: column; gap: 5px; padding: 10px 0; }
  .page-header { margin-bottom: 16px; }
  .toolbar .field { flex: 1 1 140px; }
  .data-table th, .data-table td { padding: 7px 8px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric { padding: 12px; border-bottom: 1px solid var(--border); }
  .metric-value { font-size: 19px; }
  .form-actions { justify-content: flex-start; }
  .mobile-group { display: none; }
  .mobile-group + span { display: none; }
}

@media (max-height: 600px) {
  .sidebar-footer { padding: 8px 0; }
  .sidebar-disclaimer, .sidebar-footer p { display: none; }
  .resupply-brand-lockup { min-height: 74px; padding-top: 10px; padding-bottom: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

@media print {
  .resupply-shell, .workspace-bar, .skip-link, .form-actions { display: none; }
  .content-area { margin: 0; padding: 0; }
  .table-wrap { overflow: visible; }
  .panel { break-inside: avoid; }
}
