@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/bc/outfit-600.woff2") format("woff2");
}
@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/bc/outfit-700.woff2") format("woff2");
}
@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("/fonts/bc/outfit-800.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/bc/plex-400.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/bc/plex-500.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/bc/plex-600.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/bc/plex-700.woff2") format("woff2");
}

:root {
  --ink: #0c1a36;
  --navy: #1a3c8a;
  --navy-deep: #0f2a5c;
  --navy-mid: #2a4f9e;
  --mist: #e8eef8;
  --paper: #f7f8fb;
  --white: #ffffff;
  --text: #152033;
  --muted: #5a6a82;
  --line: #d8e0ec;
  --danger: #b42318;
  --success: #067647;
  --warn: #b54708;
  --nav-h: 64px;
  --font: "IBM Plex Sans", "Helvetica Neue", sans-serif;
  --display: "Outfit", "Helvetica Neue", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--text);
  min-height: 100vh;
  background:
    linear-gradient(180deg, #dfe7f4 0%, var(--paper) 42%, var(--paper) 100%);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--navy); text-decoration: none; }
a:hover { color: var(--navy-deep); }

.app-shell {
  position: relative;
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
  background:
    linear-gradient(165deg, #12306f 0%, var(--navy) 38%, #1e4aa0 100%);
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 16px);
  overflow: hidden;
}

.app-shell::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 280px;
  background:
    radial-gradient(ellipse 90% 70% at 85% -10%, rgba(255, 255, 255, 0.18), transparent 55%),
    radial-gradient(ellipse 60% 50% at 8% 20%, rgba(120, 170, 255, 0.22), transparent 50%);
  pointer-events: none;
}

.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 22px 20px 8px;
}

.topbar h1 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.85rem;
  line-height: 1;
  letter-spacing: -0.04em;
  color: #fff;
  font-weight: 800;
}

.topbar-actions { display: flex; align-items: center; gap: 2px; margin-top: 4px; }
.topbar .link,
.topbar button.link {
  font-weight: 600;
  font-size: 0.86rem;
  color: rgba(255, 255, 255, 0.88);
  background: none;
  border: none;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
}
.topbar .link:hover,
.topbar button.link:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.content {
  position: relative;
  z-index: 2;
  margin-top: 18px;
  padding: 22px 18px 28px;
  min-height: calc(100vh - 120px);
  background: var(--white);
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -8px 28px rgba(8, 24, 60, 0.12);
  animation: sheet-in 0.45s var(--ease) both;
}

@keyframes sheet-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

.page-lede {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

/* —— Home dashboard —— */
.home-hero {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  margin-bottom: 16px;
  animation: fade-up 0.4s var(--ease) both;
}
.home-kicker {
  margin: 0 0 4px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--navy);
}
.home-title {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.55rem, 5vw, 1.85rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  color: var(--ink);
  line-height: 1.1;
}
.home-lede { margin: 8px 0 0; max-width: none; }
.home-hero-cta {
  width: 100%;
  padding: 13px 16px;
  white-space: nowrap;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 18px;
  animation: fade-up 0.45s var(--ease) 0.06s both;
}
.kpi-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 12px 13px;
  box-shadow: 0 4px 14px rgba(12, 26, 54, 0.04);
  min-width: 0;
}
.kpi-card--accent {
  grid-column: 1 / -1;
  background: linear-gradient(145deg, #12306f 0%, var(--navy) 55%, #2a56a8 100%);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 10px 24px rgba(26, 60, 138, 0.22);
  padding: 16px 14px;
}
.kpi-label {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.25;
}
.kpi-card--accent .kpi-label { color: rgba(255, 255, 255, 0.72); font-size: 0.74rem; }
.kpi-value {
  margin: 8px 0 0;
  font-family: var(--display);
  font-size: clamp(1.2rem, 5vw, 1.55rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.kpi-card--accent .kpi-value {
  font-size: clamp(1.9rem, 7vw, 2.35rem);
  color: #fff;
}
.kpi-cur {
  font-size: 0.42em;
  font-weight: 700;
  margin-left: 5px;
  opacity: 0.85;
  vertical-align: 0.15em;
}

.home-section { margin-bottom: 20px; animation: fade-up 0.45s var(--ease) 0.1s both; }
.home-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.home-section-title {
  margin: 0;
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.home-section-link {
  font-size: 0.86rem;
  font-weight: 650;
  color: var(--navy);
}

.pipe-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.pipe-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  border-top: 3px solid var(--line);
  box-shadow: 0 4px 14px rgba(12, 26, 54, 0.04);
}
.pipe--draft { border-top-color: #98a4b6; }
.pipe--ok { border-top-color: var(--navy); }
.pipe--ship { border-top-color: #c47f17; }
.pipe--done { border-top-color: var(--success); }
.pipe-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--muted);
}
.pipe-value {
  display: block;
  margin-top: 6px;
  font-family: var(--display);
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.action-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  color: inherit;
  box-shadow: 0 4px 14px rgba(12, 26, 54, 0.04);
  transition: border-color 0.15s ease, transform 0.15s var(--ease), box-shadow 0.15s ease;
}
.action-card:hover {
  text-decoration: none;
  color: inherit;
  border-color: #b8c7e0;
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(12, 26, 54, 0.08);
}
.action-card strong {
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 750;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.action-ico {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--mist);
  color: var(--navy);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.85rem;
  margin-bottom: 4px;
}

.home-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 16px;
  color: inherit;
  box-shadow: 0 4px 14px rgba(12, 26, 54, 0.04);
}
.home-card:hover { text-decoration: none; color: inherit; }
.home-card--warn {
  background: #fff8ef;
  border-color: #f0d7b0;
}
.home-card--warn h3 {
  margin: 2px 0 4px;
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 750;
  color: var(--ink);
}
.home-card-label {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--warn);
}
.home-card-go {
  font-weight: 650;
  color: var(--navy);
  white-space: nowrap;
  font-size: 0.9rem;
}
.home-card--list {
  display: block;
  padding: 4px 8px;
  margin-bottom: 0;
}
.recent-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 8px;
  border-bottom: 1px solid var(--line);
  color: inherit;
}
.recent-row:last-child { border-bottom: none; }
.recent-row:hover {
  text-decoration: none;
  color: inherit;
  background: linear-gradient(90deg, var(--mist), transparent 90%);
}
.recent-row strong {
  display: block;
  font-size: 0.98rem;
  color: var(--ink);
}
.recent-row .meta { display: block; margin-top: 2px; }
.recent-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}
.recent-price {
  font-weight: 700;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
  font-size: 0.92rem;
}
.empty--compact { padding: 28px 12px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 15px 16px;
  font-size: 0.98rem;
  font-weight: 650;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.15s var(--ease), box-shadow 0.15s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(0.985); }
.btn-primary {
  background: var(--navy);
  color: #fff;
  box-shadow: 0 8px 18px rgba(26, 60, 138, 0.22);
}
.btn-primary:hover { background: var(--navy-deep); color: #fff; }
.btn-soft { background: var(--mist); color: var(--navy); }
.btn-soft:hover { background: #d7e2f4; color: var(--navy-deep); }
.btn-ghost {
  background: transparent;
  color: var(--navy);
  border: 1px solid var(--line);
}
.btn-danger {
  background: transparent;
  color: var(--danger);
  font-weight: 650;
  width: auto;
  padding: 0;
  box-shadow: none;
}
.btn-sm { width: auto; padding: 8px 12px; font-size: 0.88rem; }
.btn + .btn { margin-top: 10px; }

.field {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 11px;
  padding: 13px 14px;
  font-size: 1rem;
  background: var(--white);
  margin-bottom: 10px;
  color: var(--text);
  font-family: inherit;
}
.field:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(26, 60, 138, 0.14);
}
.field::placeholder { color: #98a4b6; }

.select-wrap {
  position: relative;
  margin-bottom: 10px;
}
.select-wrap .field {
  margin-bottom: 0;
  appearance: none;
  -webkit-appearance: none;
  padding-right: 42px;
  background-color: var(--white);
  cursor: pointer;
}
.select-wrap::after {
  content: "";
  position: absolute;
  right: 16px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
}
.form-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 14px 12px;
  margin-bottom: 14px;
  box-shadow: 0 4px 14px rgba(12, 26, 54, 0.04);
}
.form-card .section-title { margin-top: 0; }
.form-hint {
  margin: 0 0 12px;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.45;
}
.form-hint--tight { margin-top: -2px; margin-bottom: 12px; font-size: 0.82rem; }
.form-hint a { font-weight: 650; }
.form-actions {
  display: grid;
  gap: 10px;
  margin-top: 4px;
}
.form-actions .btn + .btn { margin-top: 0; margin-left: 0; }
label.lbl {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  margin: 8px 0 5px;
  font-weight: 600;
}

.list { display: grid; gap: 0; margin-top: 10px; }
.row-item {
  display: block;
  padding: 15px 2px;
  border-bottom: 1px solid var(--line);
  color: inherit;
}
.row-item:hover {
  text-decoration: none;
  color: inherit;
  background: linear-gradient(90deg, var(--mist), transparent 85%);
}
.row-item h3 {
  margin: 0 0 3px;
  font-size: 1.05rem;
  font-weight: 650;
  color: var(--text);
}
.row-item .meta { color: var(--muted); font-size: 0.9rem; }
.row-item .price {
  color: var(--navy);
  font-weight: 700;
  margin-top: 5px;
  font-variant-numeric: tabular-nums;
}

.card {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 14px 2px;
  margin-bottom: 0;
}
.card h3 { margin: 0 0 4px; font-size: 1.05rem; }
.card .meta { color: var(--muted); font-size: 0.9rem; }
.card .price { color: var(--navy); font-weight: 700; margin-top: 4px; }
.card-link { display: block; color: inherit; }
.card-link:hover { text-decoration: none; }

.nudge {
  display: block;
  margin-top: 18px;
  padding: 16px 0 0;
  border-top: 1px solid var(--line);
  background: none;
  color: inherit;
  animation: fade-up 0.5s var(--ease) 0.2s both;
}
.nudge:hover { text-decoration: none; color: inherit; }
.nudge h3 {
  margin: 0 0 4px;
  font-family: var(--display);
  font-size: 1.15rem;
  color: var(--ink);
  font-weight: 750;
  letter-spacing: -0.02em;
}
.nudge .meta { margin: 0; color: var(--muted); font-size: 0.9rem; }
.nudge-arrow {
  display: inline-block;
  margin-top: 10px;
  color: var(--navy);
  font-weight: 650;
  font-size: 0.9rem;
}

.section-title {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  margin: 18px 0 8px;
}

.alert {
  border-radius: 10px;
  padding: 12px 14px;
  margin: 0 0 12px;
  font-size: 0.92rem;
}
.alert-success { background: #e8f6ee; color: var(--success); }
.alert-danger { background: #fdecea; color: var(--danger); }
.alert-warning { background: #fff6e5; color: var(--warn); }

.bottom-nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: min(430px, 100%);
  height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px));
  background: #fff;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  z-index: 20;
}
.bottom-nav--delivery { grid-template-columns: repeat(3, 1fr); }
.bottom-nav a,
.bottom-nav .nav-logout {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 600;
  color: #667589;
  text-decoration: none;
  gap: 3px;
  border-radius: 10px;
  background: none;
  border: none;
  font-family: inherit;
  cursor: pointer;
}
.bottom-nav a:hover,
.bottom-nav .nav-logout:hover {
  background: rgba(26, 60, 138, 0.06);
  text-decoration: none;
}
.bottom-nav a.active { color: var(--navy); font-weight: 700; }
.bottom-nav .nav-ico {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
}
.bottom-nav svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Login */
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 18px;
  background:
    radial-gradient(ellipse 80% 50% at 90% 0%, rgba(90, 140, 230, 0.35), transparent 55%),
    linear-gradient(160deg, #0f2a5c 0%, #1a3c8a 42%, #2a56a8 100%);
}

.login-compose {
  width: min(400px, 100%);
  animation: fade-up 0.45s var(--ease) both;
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.login-brand {
  margin-bottom: 28px;
  padding: 0 2px;
  color: #fff;
}
.login-brand .eyebrow {
  margin: 0 0 12px;
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 650;
  color: rgba(255, 255, 255, 0.72);
}
.login-brand h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2.6rem, 11vw, 3.2rem);
  line-height: 0.92;
  letter-spacing: -0.05em;
  font-weight: 800;
  color: #fff;
}
.login-brand .sub {
  margin: 14px 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 1.05rem;
  line-height: 1.45;
  max-width: 26ch;
}

.login-panel {
  background: var(--white);
  border: none;
  border-radius: 18px;
  padding: 24px 20px 26px;
  box-shadow: 0 20px 48px rgba(8, 24, 60, 0.28);
}
.login-panel .panel-title {
  margin: 0 0 16px;
  font-family: var(--display);
  font-size: 1.35rem;
  color: var(--ink);
  font-weight: 750;
  letter-spacing: -0.02em;
}

.hint {
  margin-top: 14px;
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.45;
  background: var(--paper);
  border-radius: 10px;
  padding: 12px;
}
.hint strong { color: var(--text); }

.article-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
  background: var(--white);
}
.article-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  gap: 8px;
}
.article-head .left {
  color: var(--navy);
  font-weight: 700;
  font-family: var(--display);
}
.row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.totals {
  background: var(--mist);
  border-radius: 12px;
  padding: 14px;
  margin: 14px 0;
}
.totals .line {
  display: flex;
  justify-content: space-between;
  margin: 6px 0;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.totals .line.strong {
  color: var(--navy);
  font-size: 1.12rem;
  font-weight: 750;
  font-family: var(--display);
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #c8d4ea;
}

.badge {
  display: inline-flex;
  align-items: center;
  background: var(--mist);
  color: var(--navy);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 0.74rem;
  font-weight: 700;
}
.badge-warn { background: #fff1e0; color: var(--warn); }
.badge-muted { background: #eef1f5; color: var(--muted); }

.empty {
  text-align: center;
  color: var(--muted);
  padding: 40px 12px;
}
.empty strong {
  display: block;
  margin-bottom: 6px;
  color: var(--navy);
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 750;
}

.muted { color: var(--muted); font-size: 0.9rem; }
.product-pick {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--navy);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}
.status-form select.field { margin-bottom: 0; }
.grid-actions { display: grid; gap: 8px; margin-top: 12px; }

.search-wrap { position: relative; margin-bottom: 6px; }
.search-wrap .field {
  margin-bottom: 0;
  padding-left: 40px;
  background: var(--paper);
  border-color: transparent;
}
.search-wrap .field:focus {
  background: var(--white);
  border-color: var(--navy);
}
.search-wrap::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 50%;
  width: 13px;
  height: 13px;
  transform: translateY(-50%);
  border: 1.7px solid var(--muted);
  border-radius: 50%;
  box-shadow: 7px 7px 0 -6.5px var(--muted);
  pointer-events: none;
}

/* Side nav — mobile hidden */
.side-nav { display: none; }
.app-main { position: relative; min-width: 0; }

.logo-block { margin-bottom: 18px; }
.logo-preview {
  margin: 0 0 12px;
  padding: 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
}
.logo-preview img {
  display: block;
  max-height: 72px;
  max-width: min(220px, 100%);
  object-fit: contain;
}
.logo-remove {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--muted);
  font-weight: 600;
  margin: 0 0 10px;
  cursor: pointer;
}
.logo-remove input { width: auto; margin: 0; }
.field-file {
  padding: 10px 12px;
  background: var(--paper);
  border-style: dashed;
}
.logo-hint { margin: -2px 0 8px; }

/* ========== Desktop ========== */
@media (min-width: 960px) {
  :root { --side-w: 248px; }

  body {
    background:
      radial-gradient(1100px 520px at 10% -20%, rgba(26, 60, 138, 0.12), transparent 55%),
      linear-gradient(180deg, #e4ebf6 0%, var(--paper) 40%, var(--paper) 100%);
  }

  .app-shell {
    display: grid;
    grid-template-columns: var(--side-w) minmax(0, 1fr);
    max-width: 1280px;
    margin: 24px auto;
    min-height: calc(100vh - 48px);
    border-radius: 22px;
    overflow: hidden;
    background: var(--white);
    box-shadow: 0 20px 50px rgba(12, 26, 54, 0.12);
    padding-bottom: 0;
  }

  .app-shell::before { display: none; }

  .side-nav {
    display: flex;
    flex-direction: column;
    background:
      linear-gradient(175deg, #102a5c 0%, var(--navy) 55%, #1e4aa0 100%);
    color: #fff;
    padding: 28px 18px 20px;
    position: relative;
    z-index: 3;
  }

  .side-brand { margin-bottom: 28px; padding: 0 8px; }
  .side-logo {
    font-family: var(--display);
    font-size: 1.55rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: #fff;
    line-height: 1;
  }
  .side-logo:hover { color: #fff; }
  .side-tag {
    margin: 8px 0 0;
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.62);
    font-weight: 650;
  }

  .side-links {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
  }
  .side-links a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border-radius: 11px;
    color: rgba(255, 255, 255, 0.78);
    font-weight: 600;
    font-size: 0.94rem;
    transition: background 0.15s ease, color 0.15s ease;
  }
  .side-links a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    text-decoration: none;
  }
  .side-links a.active {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
  }
  .side-links .nav-ico {
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
  }
  .side-links svg {
    width: 19px;
    height: 19px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.85;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .side-foot {
    margin-top: 20px;
    padding: 16px 8px 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
  }
  .side-user {
    margin: 0 0 8px;
    font-size: 0.88rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
  }
  .side-logout {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-family: inherit;
    font-size: 0.86rem;
    font-weight: 600;
    padding: 0;
    cursor: pointer;
  }
  .side-logout:hover { color: #fff; }

  .app-main {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 48px);
    background: var(--white);
  }

  .topbar {
    padding: 28px 40px 0;
    background: transparent;
    position: static;
  }
  .topbar h1 {
    color: var(--ink);
    font-size: 1.75rem;
    letter-spacing: -0.035em;
  }
  .topbar-actions--mobile { display: none; }

  .content {
    margin-top: 0;
    padding: 24px 40px 48px;
    min-height: 0;
    flex: 1;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    animation: none;
    max-width: 980px;
  }

  .bottom-nav { display: none; }

  /* Home desktop */
  .home-hero {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
  }
  .home-hero-cta { width: auto; min-width: 160px; }
  .home-lede { max-width: 40ch; }
  .home-title { font-size: 2rem; }
  .home-card {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .kpi-grid {
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 14px;
    margin-bottom: 26px;
  }
  .kpi-card--accent { grid-column: auto; }
  .kpi-card { padding: 18px; }
  .kpi-label { font-size: 0.74rem; }
  .kpi-value { font-size: 1.7rem; }
  .kpi-card--accent .kpi-value { font-size: 2.1rem; }

  .pipe-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
  }
  .action-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
  }
  .home-section { margin-bottom: 28px; }
  .home-card--list { padding: 6px 12px; }

  /* Lists & forms */
  .btn { width: auto; min-width: 200px; }
  .btn + .btn { margin-top: 0; margin-left: 10px; }
  .grid-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
  }
  .grid-actions .btn { margin: 0; }

  .search-wrap { max-width: 420px; }

  .list { max-width: 720px; }
  .row-item {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    column-gap: 24px;
    padding: 16px 8px;
    align-items: center;
  }
  .row-item h3 { grid-column: 1; grid-row: 1; }
  .row-item .meta { grid-column: 1; grid-row: 2; }
  .row-item .price {
    grid-column: 2;
    grid-row: 1 / span 2;
    margin-top: 0;
    text-align: right;
    align-self: center;
  }

  #bc-form { max-width: 640px; }
  .article-card { max-width: none; }
  .form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
  }
  .form-actions .btn { width: auto; min-width: 200px; }
  .content > form { max-width: 640px; }
  .content > .btn.btn-primary { margin-bottom: 8px; }

  /* Login split */
  .login-page {
    display: grid;
    place-items: stretch;
    padding: 0;
    background:
      linear-gradient(160deg, #0f2a5c 0%, #1a3c8a 50%, #2a56a8 100%);
  }
  .login-compose {
    width: 100%;
    max-width: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
    animation: none;
  }
  .login-brand {
    margin: 0;
    padding: 64px 56px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background:
      radial-gradient(ellipse 70% 50% at 20% 30%, rgba(120, 170, 255, 0.28), transparent 55%);
  }
  .login-brand h1 {
    font-size: clamp(3rem, 5vw, 4rem);
  }
  .login-brand .sub {
    font-size: 1.15rem;
    max-width: 28ch;
  }
  .login-panel {
    margin: 0;
    border-radius: 0;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 56px 64px;
    max-width: none;
  }
  .login-panel form { max-width: 400px; }
  .login-panel .btn { width: 100%; min-width: 0; }
  .login-panel .hint { max-width: 400px; }
}

@media (min-width: 1200px) {
  .content { max-width: 1080px; padding-left: 48px; padding-right: 48px; }
}

