/* NextCape – Vendor Operations. Ink navy + deep teal, quiet and corporate. */
:root {
  --bg: #f3f5f7; --card: #fff; --line: #e2e6eb; --line2: #eef1f4;
  --text: #0c1b2a; --muted: #5b6b7c; --soft: #93a1af;
  --brand: #0e7c7b; --brand-d: #0a6261; --brand-l: #e7f3f2; --teal: #2bb3a8; --navy: #0c1b2a; --navy-2: #13263a; --navy-3: #1c3349;
  --ok: #157a52; --ok-l: #e6f4ee; --warn: #a16207; --warn-l: #fbf3e2; --bad: #c0362c; --bad-l: #fbebea; --info: #0e7c7b; --info-l: #e7f3f2;
  --r: 10px; --shadow: 0 1px 2px rgba(12,27,42,.05);
  --side: 244px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { font: 14px/1.5 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; line-height: 1.25; margin: 0 0 4px; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 16px; margin: 0 0 12px; font-weight: 600; }
h3 { font-size: 14px; margin: 18px 0 8px; font-weight: 600; }
p { margin: 0 0 10px; }
code { font: 12.5px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--line2); padding: 1px 6px; border-radius: 6px; }
.muted { color: var(--muted); } .small { font-size: 12px; } .center { text-align: center; } .strong { font-weight: 600; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.up { color: var(--bad); font-weight: 600; } .down { color: var(--ok); font-weight: 600; } .bad-t { color: var(--bad); font-weight: 600; }
.hint { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }

/* brand */
.brand { display: flex; align-items: center; gap: 11px; color: var(--navy); }
.brand:hover { text-decoration: none; }
.nc-mark { flex: none; }
.nc-lockup { display: flex; flex-direction: column; line-height: 1.1; }
.nc-word { font-size: 15px; font-weight: 700; letter-spacing: .14em; color: var(--navy); }
.nc-sub { font-size: 10.5px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-top: 3px; }

/* sidebar – dark ink */
.side { position: fixed; inset: 0 auto 0 0; width: var(--side); background: var(--navy); display: flex; flex-direction: column; padding: 20px 14px; z-index: 30; }
.side .brand { padding: 2px 8px 22px; margin-bottom: 8px; border-bottom: 1px solid var(--navy-3); }
.side .nc-word { color: #fff; }
.side .nc-sub { color: #8fa3b8; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 8px; color: #c4d0dc; font-weight: 500; position: relative; }
.side nav a svg { color: #7f94a8; flex: none; }
.side nav a:hover { background: var(--navy-2); color: #fff; text-decoration: none; }
.side nav a.on { background: var(--navy-3); color: #fff; }
.side nav a.on::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--teal); }
.side nav a.on svg { color: var(--teal); }
.side-foot { margin-top: auto; border-top: 1px solid var(--navy-3); padding-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.send-state { font-size: 12px; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; }
.send-state i { width: 8px; height: 8px; border-radius: 50%; }
.send-state.off { background: var(--navy-2); color: #c4d0dc; } .send-state.off i { background: #e0a43b; }
.send-state.on { background: rgba(43,179,168,.15); color: #9fe3da; } .send-state.on i { background: var(--teal); }
.me { padding: 0 10px; display: flex; flex-direction: column; color: #fff; }
.me span { color: #8fa3b8; font-size: 12px; }
.me-links { padding: 0 10px; display: flex; gap: 14px; font-size: 13px; }
.me-links a { color: #9fe3da; }
.topbar { display: none; }

/* main */
.main { margin-left: var(--side); padding: 26px 32px 40px; max-width: calc(1440px + var(--side)); }
.main.bare { margin: 0 auto; max-width: 480px; padding: 6vh 16px 40px; }
.foot { color: var(--soft); font-size: 12px; margin-top: 30px; }
.main.bare .foot { text-align: center; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head > div:first-child { min-width: 0; flex: 1 1 360px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.back { font-size: 13px; color: var(--muted); display: inline-block; margin-bottom: 6px; }

/* cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; margin-bottom: 16px; box-shadow: var(--shadow); min-width: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card .pad { padding: 16px 20px 0; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; align-items: start; }
.grid2 > .card { margin-bottom: 0; }
.grid2 + .grid2, .grid2 + .card, .card + .grid2 { margin-top: 16px; }
.lockbox { border-color: #f1d9a6; background: linear-gradient(0deg, #fff, #fffaf0); }
.okbox { border-color: #b8e6d4; background: linear-gradient(0deg, #fff, #f2fbf7); }
.warnbox { border-color: #f1d9a6; background: var(--warn-l); }
.warnbox ul, .lockbox ul { margin: 0 0 10px; padding-left: 18px; }
.danger-zone { border-color: #f5c2bd; }
.danger-edge { border-left: 4px solid var(--bad); }
.confirm-card { max-width: 720px; }

/* tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; color: var(--text); display: flex; flex-direction: column; box-shadow: var(--shadow); position: relative; }
.tile:hover { text-decoration: none; border-color: #c9d3ea; }
.tile span { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.tile b { font-size: 24px; letter-spacing: -.02em; margin-top: 2px; }
.tile small { color: var(--muted); font-size: 12px; }
.tile.on { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-l); }
.tile.ok b { color: var(--ok); } .tile.warn b { color: var(--warn); } .tile.bad b { color: var(--bad); } .tile.mute b { color: var(--soft); }

/* forms */
label { display: flex; flex-direction: column; gap: 5px; font-weight: 500; font-size: 13px; margin-bottom: 12px; color: #334155; }
input, select, textarea { font: inherit; color: var(--text); background: #fff; border: 1px solid #d5dbe7; border-radius: 9px; padding: 8px 11px; min-height: 38px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-l); }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; min-height: 0; accent-color: var(--brand); flex: none; margin: 2px 0 0; }
label.check { flex-direction: row; align-items: flex-start; gap: 10px; font-weight: 400; color: var(--text); }
label.radio { flex-direction: row; align-items: flex-start; gap: 10px; font-weight: 400; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; flex: 1 1 260px; cursor: pointer; }
label.radio:has(input:checked) { border-color: var(--brand); background: var(--brand-l); }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.form-row > label { flex: 1 1 200px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.filters { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; padding: 14px 16px; }
.filters label { margin: 0; flex: 0 1 190px; }
.filters label.grow { flex: 1 1 260px; }
.inline-form { margin: -4px 0 16px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600; font-size: 13.5px; padding: 8px 14px; min-height: 38px; border-radius: 9px; border: 1px solid #d5dbe7; background: #fff; color: #1e293b; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--line2); text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-d); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.danger:hover { background: #b42318; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.small { min-height: 30px; padding: 5px 10px; font-size: 12.5px; }
.btn.wide { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; background: #f8fafc; border-bottom: 1px solid var(--line); padding: 10px 12px; white-space: nowrap; position: sticky; top: 0; }
.tbl th a { color: inherit; }
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--line2); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: #fafbff; }
.tbl .num { text-align: right; }
.tbl .cb { width: 34px; padding-right: 0; }
.tbl tr.dim td { color: var(--soft); }
.tbl tr.sub td { background: #fcfcfd; padding-top: 0; }
.tbl tr.warn-row td { background: #fff9ef; }
.tbl tr.sel td { background: var(--brand-l); }
.tbl.compact td, .tbl.compact th { padding: 7px 10px; }
.tbl td select, .tbl td input:not([type=checkbox]) { min-height: 32px; padding: 5px 8px; min-width: 120px; }
.empty { text-align: center; color: var(--muted); padding: 34px 12px !important; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; flex-wrap: wrap; }
.pager span:last-child { display: flex; gap: 6px; }

/* badges */
.badge { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.badge.ok { background: var(--ok-l); color: var(--ok); } .badge.warn { background: var(--warn-l); color: var(--warn); }
.badge.bad { background: var(--bad-l); color: var(--bad); } .badge.info { background: var(--info-l); color: var(--info); }
.badge.mute { background: var(--line2); color: var(--muted); }
.tag { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; background: var(--brand-l); color: var(--brand); padding: 1px 6px; border-radius: 5px; }

/* flash */
.flash { padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; border: 1px solid; font-weight: 500; }
.flash.ok { background: var(--ok-l); border-color: #b8e6d4; color: #0b6b49; }
.flash.bad { background: var(--bad-l); border-color: #f5c2bd; color: #a3261b; }
.flash.warn { background: var(--warn-l); border-color: #f1d9a6; color: #8a5a12; }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs a { padding: 9px 14px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.on { color: var(--brand); border-color: var(--brand); }

/* auth */
.auth { display: flex; flex-direction: column; align-items: center; }
.auth-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.auth-brand .nc-word { font-size: 22px; }
.auth-brand .nc-sub { font-size: 11.5px; }
.main.bare::before { content: ""; position: fixed; inset: 0 0 auto 0; height: 4px; background: linear-gradient(90deg, var(--navy), var(--brand) 60%, var(--teal)); }
.auth-card { width: 100%; padding: 26px 28px; }
.auth-card h1 { text-align: center; margin-bottom: 16px; font-size: 20px; }

/* key-value */
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 6px 12px; margin: 0; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }
.list { list-style: none; margin: 0 0 12px; padding: 0; }
.list li { padding: 8px 0; border-bottom: 1px solid var(--line2); display: flex; gap: 6px; flex-wrap: wrap; align-items: baseline; }
.list li .muted { margin-left: auto; }
.kvp { display: inline-block; margin-right: 8px; }

/* bulk bar */
.bulk { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 14px; position: sticky; top: 8px; z-index: 5; border-color: var(--brand); }
.bulk-margin { display: inline-flex; gap: 6px; align-items: center; }
.bulk-margin input { width: 110px; min-height: 30px; padding: 4px 8px; }

/* importer */
.file-drop { border: 2px dashed #c9d3ea; border-radius: var(--r); padding: 30px; text-align: center; cursor: pointer; background: #fafbff; color: var(--muted); font-weight: 400; }
.file-drop:hover, .file-drop.over { border-color: var(--brand); background: var(--brand-l); }
.file-drop input { display: none; }
.file-drop b { color: var(--brand); }
.map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 0 12px; }
.map-grid label.req span::after { content: " *"; color: var(--bad); }
.progress { height: 10px; background: var(--line2); border-radius: 99px; overflow: hidden; margin: 10px 0; }
.progress i { display: block; height: 100%; width: 0; background: var(--brand); transition: width .2s; }
.result-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 12px 0; }

/* steps + vendor codes */
.steps-line { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.steps-line .s { flex: 1 1 160px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 10px 14px; display: flex; align-items: center; gap: 10px; color: var(--muted); font-weight: 600; flex-wrap: wrap; }
.steps-line .s b { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--line2); color: var(--muted); font-size: 12px; }
.steps-line .s small { width: 100%; font-weight: 400; font-size: 12px; margin-left: 36px; margin-top: -6px; }
.steps-line .s.done { color: var(--ok); } .steps-line .s.done b { background: var(--ok); color: #fff; }
.steps-line .s.now { color: var(--brand); border-color: var(--brand); } .steps-line .s.now b { background: var(--brand); color: #fff; }
.codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; margin-bottom: 10px; }
.code { flex-direction: row; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-weight: 400; margin: 0; }
.code:has(input:checked) { border-color: var(--brand); background: var(--brand-l); }
.code.off { opacity: .6; }
.code span { display: flex; flex-direction: column; }
.code small { color: var(--muted); font-size: 12px; }
.keybox { font-size: 11.5px; word-break: break-all; background: #f8fafb; }
details summary { cursor: pointer; color: var(--muted); margin-top: 8px; }
ol.how { margin: 8px 0 0; padding-left: 20px; color: #334155; }
ol.how li { margin-bottom: 4px; }

/* mobile */
@media (max-width: 900px) {
  .side { transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px rgba(0,0,0,.15); }
  .side.open { transform: none; }
  .topbar { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 20; background: var(--navy); padding: 10px 16px; }
  .topbar .nc-word { font-size: 14px; color: #fff; }
  .menu-btn { border: 1px solid var(--navy-3); background: var(--navy-2); color: #fff; border-radius: 8px; width: 36px; height: 36px; font-size: 18px; cursor: pointer; }
  .send-pill { margin-left: auto; font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 99px; background: var(--navy-2); color: #e9c27a; }
  .send-pill.on { background: rgba(43,179,168,.15); color: #9fe3da; }
  .main { margin-left: 0; padding: 18px 16px 30px; }
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  .filters label, .filters label.grow { flex: 1 1 100%; }
  .tile b { font-size: 20px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .table-wrap > .tbl:not(.compact) { min-width: 760px; }
}
