:root {
  --navy: #073d72;
  --blue: #07559a;
  --sky: #0798cf;
  --red: #ef2b24;
  --yellow: #ffc928;
  --ink: #172231;
  --muted: #66758a;
  --line: #dbe3ec;
  --soft: #f4f7fa;
  --white: #fff;
  --green: #16845b;
  --amber: #c87809;
  --danger: #c83232;
  --shadow: 0 14px 36px rgba(22, 46, 74, .09);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--ink); background: var(--soft); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.eyebrow { margin: 0 0 6px; color: var(--blue); font-size: .74rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(1.7rem, 3vw, 2.35rem); letter-spacing: -.035em; }
h2 { margin-bottom: 5px; font-size: 1.15rem; }
label { display: grid; gap: 7px; color: #344257; font-size: .86rem; font-weight: 700; }
input, select, textarea { width: 100%; border: 1px solid #cbd6e2; border-radius: 10px; padding: 11px 12px; color: var(--ink); background: var(--white); outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--sky); box-shadow: 0 0 0 3px rgba(7, 152, 207, .13); }
.button { border: 0; border-radius: 10px; padding: 11px 17px; font-weight: 800; transition: .18s ease; }
.button:hover { transform: translateY(-1px); }
.button.primary { color: #fff; background: linear-gradient(135deg, var(--blue), var(--navy)); box-shadow: 0 7px 17px rgba(7, 61, 114, .2); }
.button.secondary { color: var(--navy); background: #e7eef6; }
.button.small { padding: 7px 10px; font-size: .8rem; }
.login-view { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 12% 15%, rgba(7,152,207,.18), transparent 35%), linear-gradient(145deg, #f8fbfe 0%, #dfeaf4 100%); }
.login-card { width: min(440px, 100%); padding: 38px; border: 1px solid rgba(255,255,255,.8); border-radius: 24px; background: rgba(255,255,255,.94); box-shadow: 0 28px 70px rgba(15,52,87,.17); }
.login-logo { width: 240px; max-height: 112px; object-fit: contain; object-position: left center; margin-bottom: 24px; }
.express-login { display: block; width: 150px; height: 66px; object-fit: contain; margin: 28px auto -8px; opacity: .82; }
.stack { display: grid; gap: 16px; }
.form-error { min-height: 18px; margin: -4px 0; color: var(--danger); font-size: .84rem; }
.topbar { height: 76px; position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 10px 24px; color: #fff; background: linear-gradient(110deg, #063664, #07599d); box-shadow: 0 7px 22px rgba(4,45,85,.22); }
.brand-lockup { display: flex; align-items: center; gap: 16px; font-weight: 800; }
.brand-lockup img { width: 152px; height: 56px; object-fit: contain; padding: 3px 8px; border-radius: 9px; background: #fff; }
.topbar-actions { display: flex; align-items: center; gap: 16px; }
.location-picker { display: flex; align-items: center; gap: 8px; color: #e8f4ff; font-size: .75rem; }
.location-picker select { min-width: 210px; padding: 8px 30px 8px 10px; border: 1px solid rgba(255,255,255,.24); color: #fff; background: rgba(255,255,255,.12); }
.location-picker option { color: var(--ink); }
.user-chip { display: flex; align-items: center; gap: 9px; }
.user-chip > span { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; color: var(--navy); background: var(--yellow); font-weight: 900; }
.user-chip div { display: grid; }
.user-chip small { color: #cde3f6; text-transform: capitalize; }
.icon-button { border: 1px solid rgba(255,255,255,.25); border-radius: 9px; padding: 8px 10px; color: #fff; background: transparent; }
.layout { min-height: calc(100vh - 76px); display: grid; grid-template-columns: 222px 1fr; }
.sidebar { position: sticky; top: 76px; height: calc(100vh - 76px); display: flex; flex-direction: column; gap: 5px; padding: 22px 14px; background: #fff; border-right: 1px solid var(--line); }
.nav-item { display: flex; align-items: center; gap: 11px; border: 0; border-radius: 10px; padding: 12px 13px; color: #4c5b6e; background: transparent; text-align: left; font-weight: 750; }
.nav-item span { width: 22px; color: var(--blue); font-size: 1.1rem; text-align: center; }
.nav-item:hover { background: #f0f5fa; }
.nav-item.active { color: #fff; background: linear-gradient(135deg, var(--blue), var(--navy)); }
.nav-item.active span { color: #fff; }
.sidebar-footer { margin-top: auto; padding: 14px; border-top: 1px solid var(--line); }
.sidebar-footer img { width: 100%; height: 62px; object-fit: contain; }
.content { min-width: 0; padding: 30px clamp(18px, 3vw, 42px) 60px; }
.page { display: none; max-width: 1460px; margin: auto; }
.active-page { display: block; }
.page-heading, .section-heading { display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.page-heading { margin-bottom: 25px; }
.section-heading { margin: 28px 0 14px; }
.page-heading p, .section-heading p { margin-bottom: 0; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(160px, 1fr)); gap: 14px; }
.kpi { min-height: 112px; padding: 18px; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: 0 8px 22px rgba(20,54,88,.05); }
.kpi small { display: block; margin-bottom: 10px; color: var(--muted); font-weight: 700; }
.kpi strong { font-size: 1.65rem; letter-spacing: -.03em; }
.kpi p { margin: 7px 0 0; color: var(--muted); font-size: .8rem; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 6px 10px; color: var(--navy); background: #e7f1fa; font-size: .78rem; font-weight: 800; }
.status-pill.good { color: var(--green); background: #e5f6ef; }
.status-pill.warn { color: var(--amber); background: #fff2d9; }
.status-pill.danger { color: var(--danger); background: #fee9e9; }
.tank-grid { display: grid; grid-template-columns: repeat(3, minmax(260px, 1fr)); gap: 15px; }
.tank-card { position: relative; overflow: hidden; min-height: 222px; padding: 19px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow); }
.tank-card.inactive { opacity: .62; background: #eef2f5; box-shadow: none; }
.tank-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.tank-head h3 { margin-bottom: 3px; }
.tank-sku { color: var(--blue); font-size: .8rem; font-weight: 850; }
.tank-number { min-width: 42px; height: 42px; display: grid; place-items: center; border-radius: 11px; color: #fff; background: var(--navy); font-weight: 900; }
.tank-value { margin: 22px 0 11px; }
.tank-value strong { font-size: 2rem; letter-spacing: -.04em; }
.tank-value span { margin-left: 5px; color: var(--muted); }
.progress { height: 9px; overflow: hidden; border-radius: 999px; background: #e5ebf1; }
.progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--sky), var(--blue)); }
.progress.low span { background: linear-gradient(90deg, #efab23, #e14b33); }
.tank-meta { display: flex; justify-content: space-between; gap: 12px; margin-top: 14px; color: var(--muted); font-size: .77rem; }
.inventory-grid { display: grid; grid-template-columns: repeat(3, minmax(260px, 1fr)); gap: 15px; }
.inventory-item { padding: 18px; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: 0 7px 20px rgba(20,54,88,.05); }
.inventory-item .item-title { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.inventory-item .conversion { min-height: 49px; margin-top: 12px; padding: 10px 12px; border-radius: 10px; color: var(--navy); background: #edf5fb; }
.conversion strong { font-size: 1.3rem; }
.notes-field { margin-top: 18px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.result-panel { margin-top: 20px; padding: 19px; border: 1px solid #9ddbc5; border-radius: 15px; background: #eaf8f2; }
.upload-card, .projection-card { display: flex; align-items: center; gap: 18px; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow); }
.upload-card > div:first-child { margin-right: auto; }
.file-picker input { position: absolute; opacity: 0; pointer-events: none; }
.file-picker span { display: block; min-width: 200px; border: 1px dashed #9bb1c5; border-radius: 10px; padding: 11px 13px; color: var(--blue); text-align: center; }
.table-card { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 8px 23px rgba(20,54,88,.05); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 15px; border-bottom: 1px solid #e7edf3; text-align: left; white-space: nowrap; }
th { color: #5d6d80; background: #f5f8fb; font-size: .74rem; letter-spacing: .05em; text-transform: uppercase; }
td { font-size: .87rem; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fbfdff; }
.projection-card { display: block; margin-top: 25px; }
.projection-card .section-heading { margin-top: 0; }
.projection-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.projection-input { display: grid; grid-template-columns: 1fr 110px; align-items: center; gap: 10px; padding: 10px; border-radius: 10px; background: var(--soft); }
.settings-tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 18px; padding-bottom: 2px; }
.settings-tab { border: 1px solid var(--line); border-radius: 9px; padding: 9px 14px; color: #536276; background: #fff; font-weight: 800; }
.settings-tab.active { border-color: var(--blue); color: #fff; background: var(--blue); }
.settings-panel { display: none; }
.settings-panel.active { display: block; }
.settings-card { margin-bottom: 16px; padding: 20px; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.settings-grid { display: grid; grid-template-columns: repeat(3, minmax(180px, 1fr)); gap: 14px; }
.settings-row { display: grid; grid-template-columns: minmax(120px, 1.5fr) repeat(5, minmax(90px, .7fr)) auto; gap: 9px; align-items: end; padding: 11px 0; border-bottom: 1px solid var(--line); }
.settings-row:last-child { border-bottom: 0; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 30; max-width: 380px; transform: translateY(140%); border-radius: 12px; padding: 13px 16px; color: #fff; background: var(--navy); box-shadow: 0 14px 35px rgba(0,0,0,.22); transition: transform .25s ease; }
.toast.show { transform: translateY(0); }
.toast.error { background: var(--danger); }
@media (max-width: 1100px) {
  .tank-grid, .inventory-grid, .projection-grid { grid-template-columns: repeat(2, minmax(240px, 1fr)); }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .settings-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 780px) {
  .topbar { height: auto; align-items: flex-start; padding: 9px 12px; }
  .brand-lockup span, .user-chip div, .location-picker span { display: none; }
  .brand-lockup img { width: 112px; height: 48px; }
  .location-picker select { min-width: 130px; max-width: 170px; }
  .layout { display: block; }
  .sidebar { position: sticky; top: 66px; z-index: 9; width: 100%; height: auto; flex-direction: row; overflow-x: auto; padding: 7px; border-right: 0; border-bottom: 1px solid var(--line); }
  .nav-item { min-width: max-content; padding: 9px 11px; }
  .nav-item span, .sidebar-footer { display: none; }
  .content { padding: 20px 13px 50px; }
  .page-heading { align-items: flex-start; }
  .page-heading .button { white-space: nowrap; }
  .tank-grid, .inventory-grid, .projection-grid, .kpi-grid, .settings-grid { grid-template-columns: 1fr; }
  .upload-card { align-items: stretch; flex-direction: column; }
  .upload-card > div:first-child { margin-right: 0; }
  .file-picker span { min-width: 0; }
}
