:root {
  --navy: #163A56; --navy-2: #1f4a6c; --dark: #0B1724; --sea: #1f5a85; --brand-orange: #FF7A33; --brand-orange-dark: #E8621B; --sea-light: #e9f0f6; --ink: #1d2733; --muted: #5d6b7a;
  --line: #dde3ea; --bg: #f4f6f9; --card: #fff; --green: #1e8e3e; --yellow: #d9a400; --orange: #e8710a; --red: #c5221f;
  --radius: 10px; --shadow: 0 1px 3px rgba(11,37,69,.08), 0 1px 2px rgba(11,37,69,.04);
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--sea); text-decoration: none; } a:hover { text-decoration: underline; }
code { font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; background: #eef2f6; padding: 1px 5px; border-radius: 4px; }
h1 { font-size: 1.6rem; margin: 0 0 .5rem; color: var(--navy); } h2 { font-size: 1.2rem; margin: 0 0 .75rem; color: var(--navy); }
h3 { font-size: 1.05rem; margin: 1rem 0 .5rem; color: var(--navy); } h4 { margin: 1rem 0 .4rem; font-size: .95rem; }
.topbar { display: flex; align-items: center; gap: 1.5rem; background: var(--dark); color: #fff; padding: .6rem 1.5rem; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .6rem; color: #fff; font-weight: 600; }
.brand:hover { text-decoration: none; }
.brand small { display: block; font-weight: 400; font-size: .75rem; opacity: .75; }
.logo { background: var(--brand-orange); color: #fff; font-weight: 800; border-radius: 6px; padding: .2rem .45rem; letter-spacing: .5px; }
.mainnav { display: flex; gap: .25rem; flex: 1; flex-wrap: wrap; }
.mainnav a { color: #c9d6e6; padding: .4rem .7rem; border-radius: 6px; }
.mainnav a.active, .mainnav a:hover { background: var(--navy-2); color: #fff; text-decoration: none; box-shadow: inset 0 -3px 0 var(--brand-orange); }
.logout { display: flex; align-items: center; gap: .6rem; margin: 0; }
.who { font-size: .85rem; opacity: .85; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.demo-banner { background: #fff4e5; color: #8a4b00; text-align: center; font-size: .8rem; padding: .3rem; border-bottom: 1px solid #f5d3a3; }
.container { max-width: 1280px; margin: 1.5rem auto; padding: 0 1.25rem; }
.footer { max-width: 1280px; margin: 2rem auto; padding: 1rem 1.25rem; color: var(--muted); font-size: .8rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; border-top: 1px solid var(--line); }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem 1.5rem; margin-bottom: 1.25rem; border: 1px solid var(--line); }
.narrow { max-width: 460px; margin: 2rem auto; } .narrow-wide { max-width: 820px; margin-left: auto; margin-right: auto; }
.center { text-align: center; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 1.25rem; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.25rem; }
.grid2 > .card, .grid3 > .card { margin-bottom: 0; } .grid2, .grid3 { margin-bottom: 1.25rem; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.hero { background: linear-gradient(135deg, var(--navy), var(--sea)); color: #fff; border-radius: var(--radius); padding: 3rem 2.5rem; margin-bottom: 1.5rem; }
.hero h1 { color: #fff; font-size: 2.2rem; } .hero h1 span { color: #9fd3ff; } .hero p { max-width: 720px; font-size: 1.05rem; opacity: .95; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.btn { display: inline-block; background: var(--brand-orange); color: var(--dark); border: 1px solid var(--brand-orange); border-radius: 8px; padding: .55rem 1rem; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--brand-orange-dark); color: var(--dark); text-decoration: none; }
.btn.secondary { background: #fff; color: var(--navy); border-color: #fff; }
.btn.ghost { background: transparent; color: var(--navy); border-color: var(--navy); } .btn.ghost:hover { background: var(--sea-light); } .hero .btn.ghost, .topbar .btn.ghost { color: #fff; border-color: rgba(255,255,255,.6); }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; } .btn.danger:hover { color: #fff; } .btn.small { padding: .25rem .6rem; font-size: .82rem; }
form.inline, .inline { display: inline; margin: 0; } .right { float: right; }
label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: .75rem; color: var(--navy); }
input, select, textarea { display: block; width: 100%; margin-top: .25rem; padding: .5rem .6rem; border: 1px solid #c4ced9; border-radius: 7px; font: inherit; font-weight: 400; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid #9fc7e8; border-color: var(--sea); }
input[type=checkbox], input[type=radio] { display: inline; width: auto; margin: 0 .4rem 0 0; }
label.check, label.radio { font-weight: 400; display: flex; align-items: flex-start; gap: .2rem; } label.check input, label.radio input { margin-top: .3rem; }
.radio-row { display: flex; gap: 1.5rem; flex-wrap: wrap; margin-bottom: .5rem; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.25rem .5rem; margin: 0 0 1.25rem; }
legend { font-weight: 700; color: var(--navy); padding: 0 .4rem; }
fieldset.alliance { border-color: #f0c27a; background: #fffaf2; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; } .row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
.row-actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.field-error { display: block; color: var(--red); font-weight: 500; font-size: .8rem; margin-top: .2rem; }
.alert { border-radius: 8px; padding: .75rem 1rem; margin: 0 0 1rem; border: 1px solid; overflow: hidden; }
.alert.error { background: #fdecea; border-color: #f5c2bf; color: #8c1d18; } .alert.warn { background: #fff6e0; border-color: #f2d48f; color: #6d4c00; }
.alert.info { background: var(--sea-light); border-color: #bcd8ee; color: #0e3d61; } .alert.ok { background: #e6f4ea; border-color: #b7dfc2; color: #0d5a26; }
.small { font-size: .82rem; } .muted { color: var(--muted); } .lead { font-size: 1.1rem; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); display: flex; flex-direction: column; font-size: .85rem; color: var(--muted); }
.kpi .num { font-size: 1.6rem; font-weight: 700; color: var(--navy); } .kpi.hl { border-color: var(--orange); background: #fff8f0; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; } .table th { text-align: left; color: var(--muted); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .3px; border-bottom: 2px solid var(--line); padding: .5rem; }
.table td { border-bottom: 1px solid var(--line); padding: .55rem .5rem; vertical-align: top; } .table.compact td { padding: .35rem .5rem; }
.table .num, .num { text-align: right; } .table .btn { white-space: nowrap; } .table tr.flagged { background: #fffaf0; } .table tr.dim { opacity: .65; } .table tr.emergency-row { background: #fff1f0; }
.table-wrap { overflow-x: auto; } td.actions { white-space: nowrap; }
input.cell, select.cell { padding: .2rem .35rem; margin: 0; font-size: .85rem; min-width: 90px; }
.badge { display: inline-flex; align-items: center; gap: .35rem; font-size: .78rem; font-weight: 600; padding: .15rem .55rem; border-radius: 99px; white-space: nowrap; }
.badge .dot { width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.f-green { background: #e6f4ea; color: var(--green); } .f-yellow { background: #fff6d6; color: #9a7400; } .f-orange { background: #fdeee0; color: #b45309; } .f-none { background: #eef2f6; color: var(--muted); }
.status { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; padding: .1rem .45rem; border-radius: 4px; background: #eef2f6; color: var(--muted); }
.s-published, .s-active, .s-confirmed, .s-sent { background: #e6f4ea; color: var(--green); } .s-review, .s-pending, .s-open, .s-processing, .s-outbox-only { background: #fff6d6; color: #8a6700; }
.s-failed, .s-rejected, .s-suspended, .s-declined { background: #fdecea; color: var(--red); }
.cond { display: inline-block; min-width: 1.6rem; text-align: center; font-weight: 700; border-radius: 4px; padding: 0 .3rem; background: #eef2f6; }
.cond.c-A { background: #dbeafe; color: #1e40af; } .cond.c-B { background: #e0f2fe; color: #075985; } .cond.c-C { background: #fef3c7; color: #92400e; } .cond.c-D { background: #f3e8ff; color: #6b21a8; }
.flag { display: inline-block; background: #fff1e0; color: #8a4b00; border-radius: 4px; padding: 0 .35rem; margin: 0 .2rem .2rem 0; font-size: .75rem; }
.flag.f-duplicate_merged { background: #eef2f6; color: var(--muted); } .ok-mark { color: var(--green); font-weight: 700; }
.tag { display: inline-block; font-size: .7rem; font-weight: 700; background: var(--sea-light); color: var(--sea); padding: 0 .35rem; border-radius: 4px; } .tag.red { background: #fdecea; color: var(--red); }
.chips { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .5rem; } .chip { background: var(--navy); color: #fff; border-radius: 99px; padding: .15rem .65rem; font-size: .8rem; }
.chip.light { background: var(--sea-light); color: var(--navy); } .chip.red { background: var(--red); }
.tabs { display: flex; gap: .25rem; margin-bottom: 1rem; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tabs a { padding: .5rem .9rem; border-bottom: 3px solid transparent; color: var(--muted); font-weight: 600; } .tabs a.active { color: var(--navy); border-color: var(--sea); }
.toolbar { display: flex; gap: 1rem; align-items: flex-end; flex-wrap: wrap; margin: 1rem 0; } .toolbar a.active { font-weight: 700; color: var(--navy); }
.inline-label { margin: 0; font-weight: 500; font-size: .82rem; } .inline-label input, .inline-label select { width: 180px; }
.dropzone { display: flex; align-items: center; justify-content: center; text-align: center; border: 2px dashed #9fb8cf; border-radius: var(--radius); padding: 2rem; background: #f8fbfd; cursor: pointer; font-weight: 400; position: relative; margin-bottom: 1rem; }
.dropzone.over { background: var(--sea-light); border-color: var(--sea); } .dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; height: 100%; }
.help { margin-top: 1rem; color: var(--muted); } .empty { color: var(--muted); padding: 1.5rem; text-align: center; background: #f8fafc; border-radius: 8px; }
.quicksearch { display: flex; gap: .5rem; flex: 1; max-width: 720px; } .quicksearch input { margin: 0; }
.ai-form textarea { font-size: 1rem; } .filter-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .25rem 1rem; align-items: end; }
.filter-form fieldset.conds { display: flex; gap: .5rem; padding: .3rem .6rem; margin: 0 0 .75rem; }
.interpretation { background: var(--sea-light); border-radius: 8px; padding: .75rem 1rem; margin-bottom: 1rem; }
.fit { font-weight: 700; font-size: .72rem; text-transform: uppercase; border-radius: 4px; padding: 0 .3rem; } .fit-exact { background: #e6f4ea; color: var(--green); } .fit-likely { background: var(--sea-light); color: var(--sea); } .fit-possible { background: #fff6d6; color: #8a6700; }
.stackbar { display: flex; height: 18px; border-radius: 99px; overflow: hidden; margin: .5rem 0 1rem; background: #eef2f6; }
.stackbar .seg.f-green { background: var(--green); } .stackbar .seg.f-yellow { background: var(--yellow); } .stackbar .seg.f-orange { background: var(--orange); }
.hbar { display: grid; grid-template-columns: 130px 1fr 50px; gap: .5rem; align-items: center; font-size: .85rem; margin-bottom: .35rem; }
.hbar .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .hbar .bar { background: #eef2f6; height: 10px; border-radius: 99px; overflow: hidden; } .hbar .bar span { display: block; height: 100%; background: var(--sea); border-radius: 99px; } .hbar .val { text-align: right; color: var(--muted); }
ul.plain { list-style: none; padding: 0; margin: 0; } ul.plain li { padding: .3rem 0; border-bottom: 1px solid var(--line); }
.dl { display: grid; grid-template-columns: 150px 1fr; gap: .4rem 1rem; margin: 0; } .dl dt { color: var(--muted); font-size: .85rem; } .dl dd { margin: 0; }
.inline-form { display: flex; gap: .4rem; margin-top: .4rem; } .inline-form input { margin: 0; }
.inquiry { border: 1px solid var(--line); border-radius: 8px; padding: .75rem 1rem; margin-bottom: .75rem; } .inquiry.emergency { border-color: var(--orange); background: #fffaf3; }
.inq-head { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; } .inq-form { display: flex; gap: .6rem; align-items: flex-end; flex-wrap: wrap; } .inq-form label { margin: 0; } .inq-form input { width: auto; }
.founding .steps { display: flex; gap: .5rem; } .step { flex: 1; text-align: center; padding: .4rem; border-radius: 6px; background: #eef2f6; color: var(--muted); font-size: .85rem; } .step.done { background: var(--green); color: #fff; }
.qr { display: block; margin: 1rem auto; border: 1px solid var(--line); border-radius: 8px; } .secret { display: block; word-break: break-all; margin: .5rem 0 1rem; }
.spinner { width: 36px; height: 36px; border: 4px solid var(--sea-light); border-top-color: var(--sea); border-radius: 50%; margin: 1rem auto; animation: spin 1s linear infinite; } @keyframes spin { to { transform: rotate(360deg); } }
details.mail { border-bottom: 1px solid var(--line); padding: .5rem 0; } details.mail pre { white-space: pre-wrap; background: #f8fafc; padding: .75rem; border-radius: 6px; font-size: .85rem; }
.danger-zone summary { color: var(--red); cursor: pointer; } .prose { max-width: 820px; }
.toggle-block[hidden] { display: none; }
@media (max-width: 720px) { .row2, .row3, .grid2 { grid-template-columns: 1fr; } .hero { padding: 2rem 1.25rem; } .hero h1 { font-size: 1.6rem; } .dl { grid-template-columns: 1fr; } .quicksearch { flex-direction: column; } }

/* ---- v2 additions ---- */
.tabs a.active { border-color: var(--brand-orange); }
.cs { display: inline-block; font-size: .75rem; font-weight: 700; padding: .12rem .5rem; border-radius: 4px; white-space: nowrap; }
.cs-cleared { background: #e6f4ea; color: var(--green); } .cs-review_required { background: #fff6d6; color: #8a6700; } .cs-blocked { background: #fdecea; color: var(--red); }
.cs-screening_unavailable { background: #f3e8ff; color: #6b21a8; } .cs-not_screened, .cs-not_applicable, .cs-pending { background: #eef2f6; color: var(--muted); }
.state { display: inline-block; font-size: .75rem; font-weight: 700; padding: .12rem .5rem; border-radius: 4px; background: var(--sea-light); color: var(--navy); }
.state-compliance_hold, .state-blocked { background: #fdecea; color: var(--red); } .state-committed, .state-execution, .state-closed { background: #e6f4ea; color: var(--green); }
.state-no_commit, .state-cancelled { background: #eef2f6; color: var(--muted); }
.ind { border-radius: var(--radius); padding: 1.25rem 1.5rem; margin-bottom: 1.25rem; border: 2px solid; }
.ind h2 { margin: 0 0 .3rem; } .ind-availability_indicated { border-color: var(--green); background: #f1faf3; } .ind-no_availability { border-color: var(--brand-orange); background: #fff7ee; }
.ind-verification { border-color: var(--sea); background: var(--sea-light); } .ind-committed { border-color: var(--green); background: #e6f4ea; } .ind-no_commit, .ind-closed { border-color: var(--line); background: #f8fafc; }
.steps-flow { display: flex; flex-wrap: wrap; gap: .3rem; margin: .5rem 0 1rem; } .steps-flow span { font-size: .75rem; padding: .25rem .55rem; border-radius: 99px; background: #eef2f6; color: var(--muted); }
.steps-flow span.done { background: #e6f4ea; color: var(--green); } .steps-flow span.current { background: var(--brand-orange); color: #fff; }
.blockers { margin: .3rem 0 0 1rem; padding: 0; color: var(--red); font-size: .82rem; } .gate-ok { color: var(--green); font-weight: 600; font-size: .85rem; }
.decl { background: #f8fafc; border: 1px solid var(--line); border-radius: 8px; padding: 1rem 1.25rem; font-size: .9rem; }
.check-cat { border: 1px solid var(--line); border-radius: 8px; padding: .75rem 1rem; margin-bottom: .6rem; }
.check-cat h4 { margin: 0 0 .3rem; display: flex; justify-content: space-between; gap: .5rem; }
.worldmap { width: 100%; height: auto; background: #dce9f4; border-radius: 8px; }
.worldmap .land { fill: #f7f9fb; stroke: #b8c7d6; stroke-width: .5; } .worldmap circle { fill: var(--sea); stroke: #fff; stroke-width: 1; opacity: .9; } .worldmap circle.e247 { fill: var(--brand-orange); }
.legend { display: flex; gap: 1rem; font-size: .8rem; color: var(--muted); } .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: .3rem; vertical-align: -1px; }
.perm-grid { display: flex; flex-wrap: wrap; gap: .25rem .75rem; } .perm-grid label { font-weight: 400; font-size: .8rem; margin: 0; display: flex; gap: .25rem; }
fieldset.compact { padding: .6rem 1rem .2rem; }
.notice { border-left: 4px solid var(--brand-orange); background: #fff7ee; padding: .75rem 1rem; border-radius: 0 8px 8px 0; margin-bottom: 1rem; font-size: .9rem; }
textarea { min-height: 2.5rem; }

/* ---- v3 branding & imagery ---- */
.brand img { display: block; height: 54px; width: auto; }
.portal-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: #c9d6e6; border-left: 1px solid rgba(255,255,255,.25); padding-left: .7rem; }
.mainnav a.active, .mainnav a:hover { background: rgba(255,255,255,.08); }
.hero.photo { position: relative; overflow: hidden; background: var(--dark) url('/static/img/hero-tanker.jpg') center/cover no-repeat; min-height: 360px; display: flex; flex-direction: column; justify-content: center; }
.hero.photo::before { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(11,23,36,.92) 0%, rgba(11,23,36,.75) 50%, rgba(11,23,36,.2) 100%); }
.hero.photo > * { position: relative; }
.hero .hero-signet { width: 64px; height: auto; margin-bottom: .5rem; border-radius: 14px; } .page-banner img.signet { border-radius: 10px; }
.hero h1 span { color: var(--brand-orange); }
.split { display: grid; grid-template-columns: 1.1fr .9fr; gap: 1.25rem; align-items: stretch; margin-bottom: 1.25rem; }
.split .photo-card { border-radius: var(--radius); overflow: hidden; min-height: 280px; background: center/cover no-repeat; position: relative; }
.photo-card.warehouse { background-image: url('/static/img/warehouse.jpg'); }
.photo-card.tanker { background-image: url('/static/img/hero-tanker.jpg'); }
.photo-card figcaption { position: absolute; bottom: 0; left: 0; right: 0; padding: .4rem .7rem; font-size: .7rem; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.6)); }
.photo-card figcaption a { color: #fff; text-decoration: underline; }
.page-banner { border-radius: var(--radius); height: 120px; background: var(--dark) center/cover no-repeat; margin-bottom: 1.25rem; position: relative; overflow: hidden; }
.page-banner::before { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(11,23,36,.85), rgba(11,23,36,.25)); }
.page-banner .inner { position: relative; display: flex; align-items: center; gap: 1rem; height: 100%; padding: 0 1.5rem; color: #fff; font-weight: 600; font-size: 1.15rem; }
.page-banner img.signet { width: 54px; height: auto; }
.page-banner.tanker { background-image: url('/static/img/hero-tanker.jpg'); } .page-banner.warehouse { background-image: url('/static/img/warehouse.jpg'); background-position: center 30%; }
.login-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 0; max-width: 980px; margin: 1.5rem auto; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--line); background: #fff; }
.login-wrap .login-photo { background: var(--dark) url('/static/img/hero-tanker.jpg') center/cover; position: relative; min-height: 420px; }
.login-wrap .login-photo::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11,23,36,.35), rgba(11,23,36,.85)); }
.login-wrap .login-photo .inner { position: absolute; left: 1.5rem; right: 1.5rem; bottom: 1.5rem; color: #fff; }
.login-wrap .login-photo img { width: 220px; height: auto; margin-bottom: .75rem; }
.login-wrap .login-form { padding: 2rem; }
.credit { font-size: .7rem; color: var(--muted); }
@media (max-width: 820px) { .split, .login-wrap { grid-template-columns: 1fr; } .login-wrap .login-photo { min-height: 200px; } .portal-label { display: none; } }
