:root {
  color-scheme: light;
  --navy:#0a1a2c; --ink:#142943; --muted:#52647a; --blue:#145dce;
  --blue-deep:#0f4ba8; --line:#dce5ef; --paper:#f1f5fa; --white:#fff;
  --radius:16px; --shadow:0 12px 35px #0e2b5011;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color:var(--ink); background:var(--paper); line-height:1.55;
}
*, *::before, *::after {box-sizing:border-box}
body {margin:0; min-width:290px}
h1,h2,h3,p {margin:0}
h1,h2,h3 {line-height:1.13; letter-spacing:-.03em}
h1 {font-size:clamp(2rem,4vw,3rem)}
h2 {font-size:1.45rem}
h3 {font-size:1.18rem}
a {color:var(--blue-deep)}
button,input,select {font:inherit}
button,a {touch-action:manipulation}
button {cursor:pointer}
[hidden] {display:none!important}
:focus-visible {outline:3px solid #377ef1; outline-offset:3px}
.loading {display:grid; place-items:center; min-height:100vh; color:var(--muted)}
.brand {display:inline-flex; align-items:center; gap:13px; font-size:1.13rem; font-weight:700; letter-spacing:-.03em; text-decoration:none; white-space:nowrap; color:inherit}
.brand img {width:66px; height:61px; object-fit:contain; display:block}
.brand span {border-left:1px solid #ffffff53; padding-left:13px; font-size:1.28rem; letter-spacing:-.025em}
.login {display:grid; grid-template-columns:minmax(0,1.3fr) minmax(410px,1fr); min-height:100vh; min-height:100svh}
.login-hero {background:#0b1c2f; color:white; position:relative; isolation:isolate; display:grid; grid-template-rows:auto 1fr; min-height:630px; padding:clamp(28px,5.3vw,82px); overflow:hidden}
.login-hero::before {content:""; position:absolute; inset:0; z-index:-1; background:linear-gradient(180deg,#071525a8 0%,#091c3455 41%,#071525e8 89%),url('/assets/login-truck.webp') center 53%/cover}
.login-hero::after {content:""; position:absolute; inset:auto 0 0; height:5px; background:linear-gradient(90deg,#77aafa,#2264d6 63%,#173b6d)}
.hero-copy {align-self:end; max-width:650px; padding-bottom:35px}
.hero-copy h1 {font-size:clamp(2.6rem,6.2vw,6.3rem); max-width:11ch; letter-spacing:-.065em; line-height:.97; margin:18px 0}
.hero-copy p {font-size:clamp(1rem,1.6vw,1.2rem); color:#e0e9f4; max-width:62ch}
.eyebrow {color:var(--blue-deep); text-transform:uppercase; font-weight:750; font-size:.8rem; letter-spacing:.12em}
.login-hero .brand img {width:83px; height:77px}
.login-right {display:grid; place-items:center; background:#fff; padding:44px clamp(28px,6vw,100px)}
.login-panel {width:min(100%,410px)}
.login-panel h2 {font-size:clamp(2rem,4vw,3rem); margin:9px 0}
.login-panel .muted {margin-bottom:28px}
.stack {display:grid; gap:16px}
.field {display:grid; gap:6px; font-weight:650; color:var(--ink); font-size:.94rem}
.control {width:100%; min-height:45px; border:1px solid #c8d6e5; border-radius:9px; padding:10px 12px; color:var(--ink); background:#fff}
select.control {appearance:none; padding-right:34px; background:linear-gradient(45deg,transparent 50%,#5f7792 50%) calc(100% - 17px) 50%/6px 6px no-repeat,linear-gradient(135deg,#5f7792 50%,transparent 50%) calc(100% - 11px) 50%/6px 6px no-repeat,#fff}
.password-wrap {display:grid; grid-template-columns:1fr auto; gap:8px; align-items:center}
.button {display:inline-flex; justify-content:center; align-items:center; gap:8px; min-height:43px; padding:9px 15px; border:1px solid transparent; border-radius:9px; background:var(--blue); color:white; font-weight:700; text-decoration:none; white-space:nowrap; line-height:1.3}
.button:hover {background:var(--blue-deep)}
.button.secondary {background:white; border-color:#cdd9e7; color:var(--ink)}
.button.secondary:hover {background:#edf4fe}
.button.subtle {background:#e8f1ff; color:var(--blue-deep)}
.button.subtle:hover {background:#dceaff}
.button:disabled {opacity:.55; cursor:wait}
.button.small {min-height:36px; font-size:.875rem; padding:6px 11px}
.error {color:#9e2525; background:#fff0ef; border-radius:8px; padding:9px 12px; font-size:.94rem}
.muted {color:var(--muted)}
.topbar {background:var(--navy); color:white; padding:0 clamp(16px,4vw,62px)}
.topbar-inner {min-height:75px; max-width:1600px; margin:auto; display:flex; align-items:center; gap:clamp(17px,4vw,62px)}
.nav {display:flex; align-self:stretch; gap:6px; align-items:stretch}
.nav a {display:grid; place-items:center; padding:0 13px; border-bottom:3px solid transparent; color:#d5e0ef; text-decoration:none; font-weight:650; white-space:nowrap; font-size:.94rem}
.nav a:hover,.nav a[aria-current=page] {color:white; border-bottom-color:#6caaff}
.account {margin-left:auto; position:relative}
.account summary {list-style:none; cursor:pointer; display:flex; align-items:center; gap:8px; font-weight:650; white-space:nowrap}
.account summary::-webkit-details-marker {display:none}
.avatar {display:grid; place-items:center; width:34px; height:34px; background:#233e62; border:1px solid #637d9d; border-radius:50%; font-size:.82rem}
.account-menu {position:absolute; z-index:5; right:0; top:calc(100% + 13px); background:white; color:var(--ink); padding:12px; border:1px solid var(--line); border-radius:10px; min-width:240px; box-shadow:var(--shadow); display:grid; gap:7px}
.account-menu p {overflow-wrap:anywhere; font-size:.87rem; padding:3px}
.shell {max-width:1450px; width:100%; padding:35px clamp(17px,4vw,60px) 68px; margin:auto}
.shell.edit-shell {max-width:1220px}
.intro {display:grid; gap:9px; margin-bottom:23px}
.intro p {max-width:74ch}
.dash-hero {display:grid; grid-template-columns:minmax(0,1fr) 220px; overflow:hidden; min-height:246px; padding:34px clamp(24px,4vw,57px); gap:26px; border-radius:20px; background:radial-gradient(ellipse at 87% 35%,#123c71,#0a203d 48%,#0a1a2e 80%); color:white; margin-bottom:23px}
.dash-hero > div:first-child {align-self:center; display:grid; justify-items:start; gap:10px}
.dash-hero p {color:#d8e6f8}
.dash-hero .eyebrow {color:#96c4ff}
.dash-hero h1 {font-size:clamp(2.4rem,4.7vw,4.3rem); letter-spacing:-.055em}
.adr-sign {align-self:center; justify-self:center; display:grid; justify-items:center; align-content:center; width:142px; height:142px; border:2px solid #5584b7; border-radius:13px; transform:rotate(45deg); box-shadow:0 0 0 15px #4881bb24,0 0 0 30px #4776a319; background:#1b4371}
.adr-sign div {transform:rotate(-45deg); text-align:center; font-size:1.7rem; font-weight:800; line-height:1.2; letter-spacing:.05em}
.adr-sign small {display:block; font-size:.99rem; color:#bcd8fa; font-weight:650}
.cards {display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:15px; margin-bottom:20px}
.card,.surface {background:#fff; border:1px solid var(--line); border-radius:var(--radius); box-shadow:var(--shadow)}
.card {padding:23px; display:grid; justify-items:start; align-content:start; gap:10px}
.card .button {margin-top:7px}
.card-icon {height:43px; width:43px; border-radius:11px; display:grid; place-items:center; background:#e9f2ff; color:#164e9b}
.card-icon svg {width:23px; height:23px}
.note {padding:13px 15px; border:1px solid #cbdcf5; border-left:4px solid #2e70cc; border-radius:9px; background:#eaf3ff; color:#26496e; font-size:.93rem; margin-bottom:16px}
.toolbar {display:flex; align-items:flex-start; justify-content:space-between; gap:15px; flex-wrap:wrap; margin-bottom:17px}
.segment {display:flex;align-items:center;padding:4px;background:#e2eaf5;border:0;border-radius:11px;gap:3px;margin:0}
.segment label {position:relative;cursor:pointer}
.segment input {position:absolute;inset:0;opacity:0;width:100%;height:100%;margin:0;cursor:pointer}
.segment span {display:block;padding:7px 12px;border-radius:8px;font-weight:700;font-size:.91rem;color:var(--muted)}
.segment input:checked + span {background:white;color:var(--blue-deep);box-shadow:0 2px 6px #142b5020}
.segment input:focus-visible + span {outline:2px solid var(--blue);outline-offset:1px}
.sr-only {position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.editor-frame {border:1px solid var(--line); border-radius:var(--radius); background:white; width:100%; min-height:730px; box-shadow:var(--shadow); display:block}
.status {min-height:26px; margin-top:5px; color:var(--muted); font-size:.91rem}
.filters {display:grid; grid-template-columns:2fr 1fr; align-items:end; gap:12px; padding:19px}
.check {display:flex; align-items:center; gap:7px; padding:9px 4px; font-weight:650; white-space:nowrap}
.check input {width:17px; height:17px; accent-color:var(--blue)}
.table-wrap {overflow:auto}
.data-table {width:100%; border-collapse:collapse; text-align:left; font-size:.94rem}
.data-table th {background:#eff4fa; color:#3e5470; white-space:nowrap}
.data-table th,.data-table td {padding:11px 15px; border-bottom:1px solid #e6edf4; vertical-align:top}
.data-table tbody tr:hover {background:#f5f9fe}
.un-number {font-weight:750; white-space:nowrap; font-variant-numeric:tabular-nums}
.entry {display:block; min-width:220px; max-width:63ch}
.table-foot {display:flex; gap:10px; justify-content:space-between; align-items:center; padding:12px 16px}
.table-foot .pager {display:flex; gap:7px}
.source-list {margin:8px 0 0; padding-left:21px}
.admin-grid {display:grid; grid-template-columns:minmax(265px,335px) minmax(0,1fr); gap:15px}
.admin-form {padding:20px}
.admin-form h2 {margin-bottom:17px}
.admin-actions {display:flex; flex-wrap:wrap; gap:5px}
.admin-table {align-self:start}
.dialog-head {display:flex; justify-content:space-between; gap:18px; align-items:flex-start; margin-bottom:15px}
dialog {width:min(92vw,640px); max-height:90vh; overflow:auto; color:var(--ink); padding:25px; border:none; border-radius:16px; box-shadow:0 30px 90px #04132760}
dialog::backdrop {background:#07192cb5}
dialog.preview {width:min(94vw,920px)}
.preview iframe {border:1px solid var(--line); width:100%; height:65vh; margin-bottom:13px}
.modal-actions {display:flex; flex-wrap:wrap; gap:8px; margin-top:15px}
.detail-grid {display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:1px; background:var(--line); border:1px solid var(--line); margin:17px 0 0; border-radius:9px; overflow:hidden}
.detail-grid div {padding:10px; background:#fff; min-width:0}
.detail-grid dt {font-size:.83rem; color:var(--muted)}
.detail-grid dd {margin:3px 0 0; font-weight:650; overflow-wrap:anywhere}
#toast {position:fixed; z-index:12; bottom:20px; right:20px; padding:12px 16px; border-radius:9px; background:var(--navy); color:white; box-shadow:var(--shadow)}
@media(max-width:850px) {
  .login {grid-template-columns:1fr 1fr}
  .login-hero {padding:34px 25px}
  .login-right {padding:35px 24px}
  .topbar-inner {gap:12px}
  .nav a {padding:0 7px}
  .account-name {display:none}
  .cards {grid-template-columns:repeat(2,minmax(0,1fr))}
  .admin-grid {grid-template-columns:1fr}
}
@media(max-width:620px) {
  .login {grid-template-columns:1fr}
  .login-hero {min-height:270px; grid-template-rows:auto 1fr}
  .hero-copy {padding-bottom:0}
  .hero-copy h1 {font-size:2.9rem; max-width:14ch; margin:9px 0}
  .login-right {padding:29px 20px 46px; place-items:start center}
  .topbar-inner {flex-wrap:wrap; padding-top:12px}
  .topbar .brand {margin-right:auto}
  .account {order:1}
  .nav {order:2; flex:1 0 100%; overflow:auto; min-height:43px}
  .nav a {padding:0 10px}
  .dash-hero {grid-template-columns:1fr; min-height:0; padding:25px 20px}
  .adr-sign {display:none}
  .cards,.filters {grid-template-columns:1fr}
  .table-foot {flex-wrap:wrap}
  .shell {padding-top:23px}
  dialog {padding:16px}
}

.pdf-render-frame {position:fixed;left:-2000px;top:0;width:900px;height:1100px;border:0;pointer-events:none}
.history {margin-top:24px}
.history h2 {padding:18px 18px 10px;margin:0;font-size:1.24rem}
.history-actions {display:flex;flex-wrap:wrap;justify-content:flex-end;gap:6px}

.segment label span {min-width:44px;text-align:center;font-size:1.28rem;padding:5px 10px}
.products-surface {overflow:hidden}
.product-toolbar {display:grid;grid-template-columns:minmax(0,420px) auto;align-items:end;justify-content:space-between;gap:9px 16px;padding:18px 20px}
#product-status {grid-column:1/-1;font-size:.88rem}
.products-table {table-layout:fixed}
.products-table th,.products-table td {padding:12px 20px}
.products-table th:first-child {width:21%}
.products-table th:nth-child(3) {width:20%}
.products-table th:last-child {width:165px;text-align:right}
.products-table td {overflow-wrap:anywhere}
.products-table tbody tr:last-child td {border-bottom:0}
.product-cell-label {display:none}
@media(max-width:680px) {
  .product-toolbar {grid-template-columns:minmax(0,1fr) auto;gap:10px;padding:15px}
  .products-table thead {position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
  .products-table,.products-table tbody,.products-table td {display:block}
  .products-table tr {display:grid;gap:8px;padding:15px;border-top:1px solid var(--line)}
  .products-table td {padding:0;border-bottom:0}
  .product-cell-label {display:block;color:var(--muted);font-size:.8rem;font-weight:650}
  .products-table .history-actions {justify-content:flex-start}
}
@media(max-width:390px) {
  .product-toolbar {grid-template-columns:minmax(0,1fr);justify-items:start}
  .product-toolbar .field {width:100%}
}
.preview-actions {margin:0 0 12px}
.pdf-preview-pages {background:#e8eef5;overflow:auto;max-height:62vh;border:1px solid var(--line);border-radius:8px;padding:8px}
.pdf-preview-pages img {display:block;width:min(100%,793px);height:auto;margin:0 auto 8px;background:white}
.pdf-preview-pages img:last-child {margin-bottom:0}

.product-environmental {display:block;margin-top:3px;font-size:.88rem}
.product-weights {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,165px),1fr));gap:12px}
.product-nem {border:1px solid var(--line);border-radius:8px;padding:8px 12px 12px}
.product-nem legend {font-weight:700;padding:0 6px}
