@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&display=swap");

:root {
  --ink: #17211f;
  --muted: #68736f;
  --surface: #ffffff;
  --canvas: #f3f5f1;
  --line: #dfe5df;
  --green: #165c56;
  --green-soft: #dcece6;
  --blue: #1e5c8a;
  --blue-soft: #dceaf3;
  --orange: #a75114;
  --orange-soft: #f5e5d7;
  --red: #a43c3c;
  --red-soft: #f2dede;
  font-family: "IBM Plex Sans", sans-serif;
  letter-spacing: 0;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; letter-spacing: 0; }
body { margin: 0; min-width: 0; min-height: 100vh; background-color: var(--canvas); background-image: linear-gradient(rgba(23, 33, 31, 0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(23, 33, 31, 0.035) 1px, transparent 1px); background-size: 32px 32px; }
button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
.muted { color: var(--muted); margin: 4px 0 0; }
.eyebrow { color: var(--green); font-size: 12px; font-weight: 700; margin: 0 0 8px; text-transform: uppercase; }
.brand { align-items: center; display: inline-flex; gap: 10px; min-width: 0; }
.brand img { height: 52px; object-fit: contain; width: 52px; }
.brand span { display: grid; line-height: 1.1; }
.brand strong { font-size: 19px; }
.brand small { color: var(--muted); font-size: 12px; margin-top: 4px; }

.login-layout { display: grid; grid-template-columns: minmax(480px, 1.08fr) minmax(430px, 0.92fr); min-height: 100vh; }
.login-brand-panel { background-color: #18283d; background-image: linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px); background-size: 40px 40px; color: white; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; padding: clamp(30px, 5vw, 72px); position: relative; }
.login-brand-panel::after { background: #18a99a; bottom: -150px; content: ""; height: 310px; position: absolute; right: -95px; transform: rotate(-12deg); width: 44%; }
.login-brand-panel .brand strong { color: white; }
.login-brand-panel .brand small { color: #a9c4c0; }
.login-brand-top { align-items: center; display: flex; justify-content: space-between; position: relative; z-index: 1; }
.environment-badge { align-items: center; border: 1px solid rgba(255, 255, 255, 0.2); color: #c7d8d5; display: inline-flex; font-size: 11px; gap: 6px; min-height: 30px; padding: 0 10px; }
.environment-badge svg { height: 14px; width: 14px; }
.login-message { max-width: 700px; position: relative; z-index: 1; }
.login-message .eyebrow { color: #69d4c8; }
.login-message h1 { font-size: clamp(40px, 5.2vw, 72px); line-height: 1.01; margin: 0; max-width: 12ch; }
.mobile-title { display: none; }
.login-message > p:last-child { color: #c7d4d1; font-size: 18px; line-height: 1.55; max-width: 43ch; }
.login-brand-footer { align-items: end; color: #a9bfbc; display: flex; font-size: 12px; gap: 18px; position: relative; z-index: 1; }
.signal-strip { align-items: end; display: flex; gap: 7px; height: 54px; position: relative; z-index: 1; }
.signal-strip span { background: #69d4c8; display: block; height: 20%; width: 7px; }
.signal-strip span:nth-child(2) { height: 40%; }
.signal-strip span:nth-child(3) { height: 65%; }
.signal-strip span:nth-child(4) { height: 82%; }
.signal-strip span:nth-child(5) { height: 100%; }
.login-form-panel { align-items: center; background-color: #f5f7f4; background-image: linear-gradient(rgba(23, 33, 31, 0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(23, 33, 31, 0.03) 1px, transparent 1px); background-size: 32px 32px; display: flex; justify-content: center; padding: clamp(32px, 6vw, 88px); }
.login-form { border-left: 4px solid var(--green); display: grid; gap: 22px; max-width: 450px; padding: 10px 0 10px 34px; width: 100%; }
.login-form-heading { margin-bottom: 6px; }
.login-form h2 { font-size: clamp(30px, 3vw, 40px); line-height: 1.1; margin: 0; }
.login-form label { display: grid; font-size: 14px; font-weight: 600; gap: 8px; }
.input-wrap { align-items: center; background: var(--surface); border: 1px solid #bdc9c2; display: flex; height: 54px; padding: 0 14px; }
.input-wrap:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px rgba(22, 92, 86, 0.12); }
.input-wrap svg { color: var(--muted); height: 19px; width: 19px; }
.input-wrap input { background: transparent; border: 0; color: var(--ink); height: 100%; min-width: 0; outline: 0; padding: 0 0 0 12px; width: 100%; }
.password-toggle { align-items: center; background: transparent; border: 0; color: var(--muted); display: inline-flex; height: 40px; justify-content: center; padding: 0; width: 40px; }
.password-toggle:hover { color: var(--green); }
.password-toggle svg { height: 18px; width: 18px; }
.primary-button, .secondary-button { align-items: center; border: 0; display: inline-flex; justify-content: center; min-height: 48px; padding: 0 18px; }
.primary-button { background: var(--green); color: white; gap: 10px; }
.primary-button:hover { background: #104a45; }
.primary-button:disabled { cursor: wait; opacity: 0.65; }
.primary-button svg { height: 18px; width: 18px; }
.form-error { background: var(--red-soft); border-left: 3px solid var(--red); color: #742929; margin: -6px 0; padding: 10px 12px; }
.login-assurance { align-items: center; color: var(--muted); display: flex; font-size: 11px; gap: 7px; justify-content: center; }
.login-assurance svg { color: var(--green); height: 14px; width: 14px; }

.app-shell { display: grid; grid-template-columns: 244px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: #f9faf7; border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 26px 18px 18px; }
.sidebar nav { display: grid; gap: 5px; margin-top: 42px; }
.nav-item { align-items: center; display: grid; gap: 11px; grid-template-columns: 21px 1fr auto; min-height: 44px; padding: 0 11px; }
.nav-item svg { height: 19px; width: 19px; }
.nav-item.active { background: var(--green); color: white; }
.nav-item.disabled { color: #8a9490; cursor: default; }
.nav-item small { font-size: 10px; }
.sidebar-footer { align-items: center; border-top: 1px solid var(--line); color: var(--muted); display: flex; font-size: 12px; justify-content: space-between; margin-top: auto; padding-top: 16px; }
.icon-button { align-items: center; background: transparent; border: 1px solid var(--line); color: var(--ink); display: inline-flex; height: 38px; justify-content: center; padding: 0; width: 38px; }
.icon-button:hover { background: var(--surface); border-color: #aeb8b2; }
.icon-button svg { height: 18px; width: 18px; }
.mobile-header { display: none; }
.dashboard-main { margin: 0 auto; max-width: 1480px; padding: 42px clamp(24px, 4vw, 64px) 70px; width: 100%; }
.dashboard-header { align-items: end; display: flex; justify-content: space-between; margin-bottom: 28px; }
.dashboard-header h1 { font-size: clamp(29px, 3vw, 42px); line-height: 1.1; margin: 0; }
.sync-status { align-items: center; background: var(--surface); border: 1px solid var(--line); display: flex; font-size: 12px; gap: 8px; min-height: 36px; padding: 0 12px; }
.sync-status span { background: #8b9590; border-radius: 50%; height: 8px; width: 8px; }
.sync-status.online span { background: #24906f; }
.sync-status.stale span { background: #d57b24; }
.metrics-grid { display: grid; gap: 14px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.metric-card { background: var(--surface); border: 1px solid var(--line); border-top: 3px solid currentColor; display: grid; min-height: 180px; padding: 20px; }
.metric-card.green { color: var(--green); }
.metric-card.blue { color: var(--blue); }
.metric-card.orange { color: var(--orange); }
.metric-card.red { color: var(--red); }
.metric-heading { align-items: center; display: flex; font-size: 14px; font-weight: 600; gap: 9px; }
.metric-icon { align-items: center; background: currentColor; display: inline-flex; height: 30px; justify-content: center; width: 30px; }
.metric-icon svg { color: white; height: 16px; width: 16px; }
.metric-value { align-self: end; color: var(--ink); font-size: clamp(24px, 2.2vw, 36px); line-height: 1; white-space: nowrap; }
.metric-detail { color: var(--muted); font-size: 13px; margin-top: 8px; }
.operations-section { margin-top: 42px; }
.section-heading h2 { font-size: 22px; margin: 0 0 16px; }
.operation-row { align-items: center; background: rgba(255, 255, 255, 0.72); border-bottom: 1px solid var(--line); border-top: 1px solid var(--line); display: grid; gap: 14px; grid-template-columns: 38px 1fr auto; min-height: 78px; padding: 12px 16px; }
.operation-icon { align-items: center; background: var(--red-soft); color: var(--red); display: inline-flex; height: 38px; justify-content: center; width: 38px; }
.operation-icon svg { height: 19px; width: 19px; }
.operation-row div { display: grid; gap: 4px; }
.operation-row div span { color: var(--muted); font-size: 13px; }
.dashboard-error { align-items: center; background: #fff5e9; border: 1px solid #edc9a5; display: grid; gap: 14px; grid-template-columns: 30px 1fr auto; margin-bottom: 20px; padding: 14px 16px; }
.dashboard-error[hidden] { display: none; }
.dashboard-error p { color: var(--muted); margin: 3px 0 0; }
.secondary-button { background: var(--surface); border: 1px solid #b8c1bc; color: var(--ink); }
.history-section { border-top: 1px solid var(--line); margin-top: 46px; padding-top: 34px; scroll-margin-top: 24px; }
.history-heading { align-items: end; display: flex; gap: 24px; justify-content: space-between; }
.history-heading h2 { font-size: 24px; margin: 0; }
.history-filter { align-items: end; display: flex; gap: 10px; }
.history-filter label { color: var(--muted); display: grid; font-size: 11px; font-weight: 600; gap: 4px; }
.history-filter input { background: var(--surface); border: 1px solid #b8c1bc; color: var(--ink); height: 38px; padding: 0 9px; }
.period-presets { border: 1px solid #b8c1bc; display: flex; height: 38px; }
.period-presets button { background: var(--surface); border: 0; border-right: 1px solid var(--line); color: var(--muted); font-size: 12px; padding: 0 10px; }
.period-presets button:last-child { border-right: 0; }
.period-presets button.active { background: var(--green); color: white; }
.history-submit { gap: 7px; min-height: 38px; }
.history-submit svg { height: 15px; width: 15px; }
.history-message { color: var(--muted); padding: 34px 0 8px; }
.history-message.error { color: var(--red); }
.history-totals { display: grid; gap: 14px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 24px; }
.history-totals article { background: var(--surface); border-left: 3px solid var(--green); display: grid; min-height: 122px; min-width: 0; padding: 16px 18px; }
.history-totals span { color: var(--muted); font-size: 12px; font-weight: 600; }
.history-totals strong { align-self: end; font-size: 25px; }
.history-totals small { color: var(--muted); font-size: 11px; margin-top: 5px; overflow-wrap: anywhere; }
.history-list-heading { align-items: end; display: flex; justify-content: space-between; margin: 30px 0 10px; }
.history-list-heading span { color: var(--muted); font-size: 12px; }
.history-list { border-top: 1px solid var(--line); max-height: 420px; overflow: auto; }
.history-row { align-items: center; border-bottom: 1px solid var(--line); display: grid; gap: 14px; grid-template-columns: 64px minmax(120px, 1fr) 112px 74px; min-height: 47px; }
.history-row time { color: var(--muted); font-size: 12px; text-transform: capitalize; }
.history-row progress { appearance: none; background: var(--green-soft); border: 0; height: 8px; width: 100%; }
.history-row progress::-webkit-progress-bar { background: var(--green-soft); }
.history-row progress::-webkit-progress-value { background: var(--green); }
.history-row progress::-moz-progress-bar { background: var(--green); }
.history-row strong { font-size: 13px; text-align: right; }
.history-row > span { color: var(--muted); font-size: 11px; text-align: right; }
.campaigns-section { border-top: 1px solid var(--line); margin-top: 46px; padding-top: 34px; scroll-margin-top: 24px; }
.campaigns-section .section-heading h2 { margin-bottom: 0; }
.campaign-totals { background: var(--surface); border-bottom: 1px solid var(--line); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 24px; }
.campaign-totals > div { border-right: 1px solid var(--line); display: grid; gap: 7px; padding: 16px 18px; }
.campaign-totals > div:last-child { border-right: 0; }
.campaign-totals span { color: var(--muted); font-size: 11px; }
.campaign-totals strong { font-size: 25px; }
.campaign-totals .pending strong { color: var(--orange); }
.campaign-layout { display: grid; gap: 30px; grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr); }
.campaign-list, .winner-list { border-top: 1px solid var(--line); }
.campaign-row { border-bottom: 1px solid var(--line); display: grid; gap: 10px; padding: 16px 4px; }
.campaign-row-heading { align-items: center; display: flex; gap: 12px; justify-content: space-between; }
.campaign-badges { display: flex; gap: 6px; }
.campaign-badges small, .winner-state small { border: 1px solid var(--line); font-size: 10px; padding: 3px 7px; }
.campaign-badges .status-active { background: var(--green-soft); border-color: #aed2c5; color: var(--green); }
.campaign-badges .status-closed { color: var(--muted); }
.campaign-period { color: var(--muted); font-size: 11px; text-transform: capitalize; }
.campaign-metrics { display: flex; flex-wrap: wrap; gap: 14px; }
.campaign-metrics span { color: var(--muted); font-size: 11px; }
.campaign-metrics strong { color: var(--ink); font-size: 13px; }
.campaign-row p { color: var(--muted); font-size: 11px; line-height: 1.4; margin: 0; }
.winner-row { align-items: center; border-bottom: 1px solid var(--line); display: grid; gap: 11px; grid-template-columns: 34px minmax(0, 1fr) auto; min-height: 76px; padding: 10px 4px; }
.winner-icon { align-items: center; background: var(--orange-soft); color: var(--orange); display: inline-flex; height: 34px; justify-content: center; width: 34px; }
.winner-icon svg { height: 17px; width: 17px; }
.winner-row > div { display: grid; gap: 2px; min-width: 0; }
.winner-row > div > strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.winner-row > div > span, .winner-row time { color: var(--muted); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.winner-state { justify-items: end; }
.winner-state .status-pending { background: var(--orange-soft); border-color: #e6c3a4; color: var(--orange); }
.winner-state .status-withdrawn { background: var(--green-soft); border-color: #aed2c5; color: var(--green); }
.inventory-section { border-top: 1px solid var(--line); margin-top: 46px; padding-top: 34px; scroll-margin-top: 24px; }
.inventory-heading { align-items: end; display: flex; gap: 24px; justify-content: space-between; }
.inventory-heading h2 { font-size: 24px; margin: 0; }
.inventory-tools { align-items: end; display: flex; gap: 10px; }
.inventory-search { align-items: center; background: var(--surface); border: 1px solid #b8c1bc; display: flex; height: 38px; padding: 0 10px; width: 230px; }
.inventory-search svg { color: var(--muted); height: 15px; width: 15px; }
.inventory-search input { background: transparent; border: 0; height: 100%; min-width: 0; outline: 0; padding-left: 8px; width: 100%; }
.inventory-filters { border: 1px solid #b8c1bc; display: flex; height: 38px; }
.inventory-filters button { background: var(--surface); border: 0; border-right: 1px solid var(--line); color: var(--muted); font-size: 12px; padding: 0 10px; }
.inventory-filters button:last-child { border-right: 0; }
.inventory-filters button.active { background: var(--green); color: white; }
.inventory-totals { display: grid; gap: 1px; grid-template-columns: repeat(6, minmax(0, 1fr)); margin-top: 24px; background: var(--line); border: 1px solid var(--line); }
.inventory-totals > div { background: var(--surface); display: grid; gap: 8px; min-width: 0; padding: 15px; }
.inventory-totals span { color: var(--muted); font-size: 10px; }
.inventory-totals strong { font-size: 23px; }
.inventory-totals .danger strong { color: var(--red); }
.inventory-totals .warning strong { color: var(--orange); }
.inventory-list-heading { align-items: end; display: flex; justify-content: space-between; margin: 30px 0 10px; }
.inventory-list-heading span { color: var(--muted); font-size: 11px; }
.inventory-list { border-top: 1px solid var(--line); }
.inventory-row { align-items: center; border-bottom: 1px solid var(--line); display: grid; gap: 14px; grid-template-columns: minmax(220px, 1.3fr) 110px minmax(190px, 0.8fr) 125px; min-height: 70px; padding: 10px 4px; }
.inventory-identity, .inventory-stock { display: grid; gap: 3px; min-width: 0; }
.inventory-identity strong { line-height: 1.25; }
.inventory-identity span, .inventory-stock span, .inventory-expiry { color: var(--muted); font-size: 10px; }
.inventory-stock strong { font-size: 18px; }
.inventory-badges { display: flex; flex-wrap: wrap; gap: 5px; }
.inventory-badge { border: 1px solid var(--line); font-size: 9px; padding: 3px 6px; }
.inventory-badge.danger { background: var(--red-soft); border-color: #dfb7b7; color: var(--red); }
.inventory-badge.warning { background: var(--orange-soft); border-color: #e6c3a4; color: var(--orange); }
.inventory-badge.neutral { background: var(--blue-soft); border-color: #b6cfdf; color: var(--blue); }
.inventory-expiry { text-align: right; text-transform: capitalize; }
.cash-section { border-top: 1px solid var(--line); margin-top: 46px; padding-top: 34px; scroll-margin-top: 24px; }
.cash-heading { align-items: end; display: flex; gap: 24px; justify-content: space-between; }
.cash-heading h2 { font-size: 24px; margin: 0; }
.cash-session-status { align-items: center; background: var(--surface); border: 1px solid var(--line); display: inline-flex; font-size: 11px; gap: 7px; min-height: 34px; padding: 0 11px; }
.cash-session-status svg { height: 15px; width: 15px; }
.cash-session-status.open { background: var(--green-soft); border-color: #aed2c5; color: var(--green); }
.cash-session-status.closed { color: var(--muted); }
.cash-totals { display: grid; gap: 12px; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 24px; }
.cash-totals article { background: var(--surface); border-top: 3px solid var(--blue); display: grid; min-height: 116px; min-width: 0; padding: 15px 17px; }
.cash-totals article.featured { border-color: var(--green); }
.cash-totals article.outflow { border-color: var(--red); }
.cash-totals article.inflow { border-color: var(--orange); }
.cash-totals span { color: var(--muted); font-size: 11px; font-weight: 600; }
.cash-totals strong { align-self: end; font-size: 23px; white-space: nowrap; }
.cash-totals small { color: var(--muted); font-size: 10px; margin-top: 4px; }
.cash-layout { display: grid; gap: 34px; grid-template-columns: minmax(0, 1fr) 230px; }
.cash-payment-list { border-top: 1px solid var(--line); }
.cash-payment-row { align-items: center; border-bottom: 1px solid var(--line); display: grid; gap: 12px; grid-template-columns: 150px minmax(100px, 1fr) 110px 36px; min-height: 52px; }
.cash-payment-row strong { font-size: 12px; }
.cash-payment-row progress { appearance: none; background: var(--blue-soft); border: 0; height: 8px; width: 100%; }
.cash-payment-row progress::-webkit-progress-bar { background: var(--blue-soft); }
.cash-payment-row progress::-webkit-progress-value { background: var(--blue); }
.cash-payment-row progress::-moz-progress-bar { background: var(--blue); }
.cash-payment-row span { font-size: 12px; font-weight: 600; text-align: right; }
.cash-payment-row small { color: var(--muted); font-size: 10px; text-align: right; }
.cash-session-panel { align-self: start; background: #18283d; color: white; display: grid; margin-top: 30px; min-height: 210px; padding: 20px; }
.cash-panel-icon { align-items: center; background: #18a99a; display: inline-flex; height: 34px; justify-content: center; width: 34px; }
.cash-panel-icon svg { height: 17px; width: 17px; }
.cash-session-panel p { color: #a9c4c0; font-size: 11px; margin: 16px 0 3px; }
.cash-session-panel > strong { font-size: 22px; }
.cash-session-panel > span:not(.cash-panel-icon) { color: #d2ddda; font-size: 12px; margin-top: 4px; }
.cash-session-panel small { align-self: end; color: #a9c4c0; font-size: 9px; line-height: 1.4; margin-top: 20px; }
.delivery-credit-section { border-top: 1px solid var(--line); margin-top: 46px; padding-top: 34px; scroll-margin-top: 24px; }
.delivery-credit-heading { align-items: end; display: flex; gap: 24px; justify-content: space-between; }
.delivery-credit-heading h2 { font-size: 24px; margin: 0; }
.privacy-note { align-items: center; color: var(--green); display: inline-flex; font-size: 10px; gap: 6px; }
.privacy-note svg { height: 15px; width: 15px; }
.delivery-credit-layout { display: grid; gap: 14px; grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr); margin-top: 24px; }
.delivery-panel, .credit-panel { background: var(--surface); border: 1px solid var(--line); min-width: 0; padding: 20px; }
.delivery-panel { border-top: 3px solid var(--orange); }
.credit-panel { border-top: 3px solid var(--blue); }
.delivery-panel-heading { align-items: center; display: flex; gap: 10px; }
.delivery-panel-heading > span { align-items: center; background: var(--canvas); color: var(--ink); display: inline-flex; height: 34px; justify-content: center; width: 34px; }
.delivery-panel-heading svg { height: 17px; width: 17px; }
.delivery-panel-heading div { display: grid; gap: 2px; }
.delivery-panel-heading small { color: var(--muted); font-size: 9px; }
.delivery-primary { align-items: baseline; border-bottom: 1px solid var(--line); display: flex; gap: 7px; margin-top: 22px; padding-bottom: 16px; }
.delivery-primary > strong { font-size: 38px; line-height: 1; }
.delivery-primary > span { color: var(--muted); font-size: 12px; }
.delivery-primary > small { color: var(--ink); font-size: 13px; font-weight: 600; margin-left: auto; }
.delivery-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.delivery-stats > div { border-right: 1px solid var(--line); display: grid; gap: 5px; min-width: 0; padding: 16px 12px 0; }
.delivery-stats > div:first-child { padding-left: 0; }
.delivery-stats > div:last-child { border-right: 0; padding-right: 0; }
.delivery-stats span, .credit-primary span, .credit-settled span { color: var(--muted); font-size: 9px; }
.delivery-stats strong { font-size: 17px; overflow-wrap: anywhere; }
.delivery-stats small, .credit-primary small, .credit-settled small { color: var(--muted); font-size: 8px; line-height: 1.3; }
.delivery-stats .urgent strong { color: var(--red); }
.credit-primary { border-bottom: 1px solid var(--line); display: grid; gap: 6px; margin-top: 22px; padding-bottom: 18px; }
.credit-primary strong { color: var(--blue); font-size: 30px; line-height: 1; }
.credit-settled { display: grid; grid-template-columns: 1fr 1fr; }
.credit-settled > div { border-right: 1px solid var(--line); display: grid; gap: 6px; min-width: 0; padding: 17px 14px 0 0; }
.credit-settled > div:last-child { border-right: 0; padding-left: 14px; padding-right: 0; }
.credit-settled strong { font-size: 18px; overflow-wrap: anywhere; }

@media (max-width: 1180px) {
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .login-message h1 { font-size: 46px; }
  .history-heading { align-items: start; display: grid; }
  .campaign-layout { grid-template-columns: 1fr; }
  .inventory-heading { align-items: start; display: grid; }
  .inventory-totals { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cash-totals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .delivery-credit-layout { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .login-layout { display: block; }
  .login-brand-panel { min-height: 218px; padding: 18px 20px 22px; }
  .login-brand-panel::after { bottom: -105px; height: 180px; right: -70px; width: 52%; }
  .login-brand-panel .brand img { height: 42px; width: 42px; }
  .login-brand-panel .brand strong { font-size: 16px; }
  .login-brand-panel .brand small { font-size: 10px; margin-top: 2px; }
  .environment-badge { border: 0; font-size: 0; min-height: 32px; padding: 0; width: 32px; }
  .environment-badge svg { height: 19px; width: 19px; }
  .login-message { margin-top: 22px; }
  .desktop-title { display: none; }
  .mobile-title { display: inline; }
  .login-message h1 { font-size: 31px; line-height: 1.05; max-width: 12ch; }
  .login-message .eyebrow { font-size: 10px; margin-bottom: 6px; }
  .login-message > p:last-child { font-size: 13px; line-height: 1.4; margin: 10px 0 0; max-width: 29ch; }
  .login-brand-footer { display: none; }
  .login-form-panel { align-items: start; min-height: calc(100vh - 218px); padding: 30px 20px 38px; }
  .login-form { border-left: 0; gap: 18px; max-width: none; padding: 0; }
  .login-form-heading { border-left: 3px solid var(--green); margin-bottom: 2px; padding-left: 13px; }
  .login-form h2 { font-size: 29px; }
  .login-form .muted { font-size: 13px; }
  .app-shell { display: block; }
  .sidebar { display: none; }
  .mobile-header { align-items: center; background: #18283d; border-bottom: 3px solid #18a99a; display: flex; height: 58px; justify-content: space-between; margin: 0 -16px; padding: 0 14px; }
  .mobile-header .brand { gap: 9px; }
  .mobile-header .brand img { height: 42px; width: 42px; }
  .mobile-header .brand strong { color: white; font-size: 16px; }
  .mobile-header .brand small { color: #a9c4c0; font-size: 10px; margin-top: 2px; }
  .mobile-header .icon-button { border-color: rgba(255, 255, 255, 0.22); color: white; height: 36px; width: 36px; }
  .mobile-header .icon-button:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.38); }
  .dashboard-main { padding: 0 16px 44px; }
  .dashboard-header { align-items: start; background: rgba(255, 255, 255, 0.72); border-bottom: 1px solid var(--line); display: grid; gap: 10px; margin: 0 -16px 18px; padding: 18px 16px 16px; }
  .dashboard-header .eyebrow, .dashboard-header .muted { display: none; }
  .dashboard-header h1 { font-size: 24px; line-height: 1.15; }
  .sync-status { background: transparent; border: 0; justify-self: start; min-height: auto; padding: 0; }
  .metrics-grid { grid-template-columns: 1fr 1fr; }
  .metric-card { min-height: 132px; padding: 13px; }
  .metric-heading { font-size: 12px; gap: 7px; }
  .metric-icon { height: 27px; width: 27px; }
  .metric-icon svg { height: 14px; width: 14px; }
  .metric-value { font-size: 22px; }
  .metric-detail { font-size: 11px; margin-top: 6px; }
  .operations-section { margin-top: 30px; }
  .history-section { margin-top: 32px; padding-top: 26px; }
  .campaigns-section { margin-top: 32px; padding-top: 26px; }
  .inventory-section { margin-top: 32px; padding-top: 26px; }
  .cash-section { margin-top: 32px; padding-top: 26px; }
  .delivery-credit-section { margin-top: 32px; padding-top: 26px; }
  .history-heading h2 { font-size: 20px; }
  .history-filter { align-items: stretch; display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .period-presets { grid-column: 1 / -1; }
  .period-presets button { flex: 1; }
  .history-filter input { min-width: 0; width: 100%; }
  .history-submit { grid-column: 1 / -1; }
  .history-totals { grid-template-columns: 1fr 1fr; }
  .history-totals article:last-child { grid-column: 1 / -1; }
  .history-row { gap: 9px; grid-template-columns: 48px minmax(65px, 1fr) 92px; }
  .history-row > span { display: none; }
  .history-list-heading span { display: none; }
  .campaign-totals { grid-template-columns: 1fr 1fr; }
  .campaign-totals > div:nth-child(2) { border-right: 0; }
  .campaign-totals > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .campaign-layout { gap: 8px; }
  .campaign-row-heading { align-items: start; }
  .winner-row > div > strong { line-height: 1.25; overflow: visible; text-overflow: clip; white-space: normal; }
  .inventory-heading h2 { font-size: 20px; }
  .inventory-tools { align-items: stretch; display: grid; width: 100%; }
  .inventory-search { width: 100%; }
  .inventory-filters button { flex: 1; }
  .inventory-totals { grid-template-columns: 1fr 1fr; }
  .inventory-row { align-items: start; gap: 7px 10px; grid-template-columns: minmax(0, 1fr) 76px; padding: 12px 2px; }
  .inventory-stock { justify-items: end; }
  .inventory-badges { grid-column: 1 / -1; }
  .inventory-expiry { grid-column: 1 / -1; text-align: left; }
  .cash-heading h2 { font-size: 20px; }
  .cash-layout { gap: 12px; grid-template-columns: 1fr; }
  .cash-session-panel { margin-top: 0; min-height: 180px; }
  .cash-payment-row { gap: 7px; grid-template-columns: minmax(84px, 1fr) 72px 31px; padding: 9px 0; }
  .cash-payment-row progress { grid-column: 1 / -1; grid-row: 2; }
  .cash-payment-row span { white-space: nowrap; }
  .delivery-credit-heading h2 { font-size: 20px; }
  .delivery-credit-layout { margin-top: 18px; }
  .delivery-panel, .credit-panel { padding: 15px; }
  .delivery-stats { grid-template-columns: 1fr 1fr; }
  .delivery-stats > div { border-bottom: 1px solid var(--line); }
  .delivery-stats > div:nth-child(2) { border-right: 0; padding-right: 0; }
  .delivery-stats > div:nth-child(3) { padding-left: 0; }
  .delivery-stats > div:nth-child(n+3) { border-bottom: 0; }
  .section-heading h2 { font-size: 19px; line-height: 1.25; }
  .dashboard-error { grid-template-columns: 28px 1fr; }
  .dashboard-error button { grid-column: 1 / -1; }
}

@media (max-width: 360px) {
  .metrics-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 138px; }
  .metric-value { font-size: 24px; }
  .login-message h1 { font-size: 30px; }
  .history-totals { grid-template-columns: 1fr; }
  .history-totals article:last-child { grid-column: auto; }
  .history-row { gap: 7px; grid-template-columns: 52px minmax(36px, 1fr) 88px; }
  .history-row time { font-size: 10px; white-space: nowrap; }
  .cash-totals { grid-template-columns: 1fr; }
  .delivery-credit-heading { align-items: start; display: grid; gap: 8px; }
  .delivery-primary { align-items: start; display: grid; }
  .delivery-primary > small { margin-left: 0; }
  .credit-settled { grid-template-columns: 1fr; }
  .credit-settled > div { border-bottom: 1px solid var(--line); border-right: 0; padding-right: 0; }
  .credit-settled > div:last-child { border-bottom: 0; padding-left: 0; }
}