/* BorderOne portal — styled after the live BorderOne v1 app (CustomApp theme tokens). */
:root {
  --page: #f0f5fa; --card: #ffffff; --ink: #002245; --muted: #5e758d; --faint: #abbad0;
  --line: #e3eaf1; --soft: #f0f6fc; --field: #c7d5ea;
  --brand: #0067e7; --brand-2: #008de4; --brand-100: #ebf6fd; --brand-200: #cce8fa;
  --ok: #119460; --ok-100: #ecfbf5; --warn: #e47d09; --warn-100: #fffaeb; --bad: #d13f31; --bad-100: #fef2f1;
  --font: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--page); color: var(--ink); font-family: var(--font); font-size: 14px; line-height: 20px; }
h1, h2, h3, p { margin: 0; }
h2 { font-size: 16px; line-height: 24px; font-weight: 700; }
h3 { font-size: 14px; line-height: 20px; font-weight: 700; }
a { color: var(--brand); }
[hidden] { display: none !important; }
.small { font-size: 12px; line-height: 16px; }
.muted { color: var(--muted); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 5px; }
.card-pad { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: 700 14px/20px var(--font); height: 40px; padding: 0 16px;
  border-radius: 5px; background: var(--brand); color: #fff; border: 1px solid var(--brand); cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--brand-2); border-color: var(--brand-2); }
.btn:focus-visible, .input:focus-visible, .link:focus-visible, .icon-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.btn[disabled] { opacity: .6; cursor: default; }
.btn.wide { width: 100%; height: 48px; font-size: 16px; }
.btn.sm { height: 32px; padding: 0 12px; }
.btn.plain { background: #fff; color: var(--ink); border-color: var(--field); }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > label { font-weight: 700; font-size: 12px; line-height: 16px; }
.input { font: 400 14px/20px var(--font); color: var(--ink); border: 1px solid var(--field); border-radius: 4px; padding: 9px 10px; background: #fff; width: 100%; }
.input::placeholder { color: var(--faint); }
.msg { border-radius: 4px; padding: 9px 12px; font-weight: 500; }
.msg.bad { background: var(--bad-100); color: var(--bad); }
.msg.ok { background: var(--ok-100); color: var(--ok); }
.chip { display: inline-block; font-weight: 700; font-size: 11px; line-height: 14px; padding: 3px 8px; border-radius: 4px; }
.chip.test { background: var(--brand-100); color: var(--brand); }
.wordmark { height: 15px; width: auto; display: block; }
.wordmark-text { font-weight: 600; font-size: 17px; letter-spacing: .2em; line-height: 1; text-transform: uppercase; }
.powered { display: flex; align-items: center; gap: 8px; color: var(--ink); }
.powered img { height: 20px; width: auto; }
.powered img.wordmark { height: 10px; }
.wordmark.tall { height: 34px; }

/* sign in + welcome */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: center; padding: 40px 24px; }
.auth-img { justify-self: end; width: 90%; max-width: 420px; height: auto; }
.auth-form { max-width: 400px; width: 100%; display: flex; flex-direction: column; gap: 16px; align-items: center; }
.auth-form .card { width: 100%; }
.auth-form .wordmark { height: 26px; }
.auth-form .wordmark-text { font-size: 28px; }
.auth-form .wordmark.tall { height: 72px; }
@media (max-width: 720px) { .auth { grid-template-columns: 1fr; padding: 24px 16px; } .auth-img { display: none; } .auth-form { margin: 0 auto; } }

/* the shell */
.appbar { background: var(--card); border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; padding: 10px 16px; }
.appbar-l { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.appbar-r { display: flex; align-items: center; gap: 12px; }
.vr { width: 1px; height: 22px; background: var(--line); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--brand-200); color: var(--brand); font-weight: 700; display: grid; place-items: center; font-size: 12px; }
.link { background: none; border: 0; padding: 0; font: 700 14px/20px var(--font); color: var(--brand); cursor: pointer; }
.shell { display: grid; grid-template-columns: 208px minmax(0, 1fr); min-height: calc(100vh - 53px); }
.side { background: var(--card); border-right: 1px solid var(--line); padding: 12px 8px; display: flex; flex-direction: column; gap: 2px; }
.side a, .side span.item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 5px; color: var(--muted); font-weight: 500; text-decoration: none; }
.side a.on { background: var(--brand-100); color: var(--brand); font-weight: 700; }
.side span.item { opacity: .55; }
.ico { width: 16px; height: 16px; border: 1.5px solid currentColor; border-radius: 3px; flex: none; }
.main { padding: 18px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.hi { font-size: 26px; line-height: 34px; }
.hi b { font-weight: 800; }
.hi u { text-decoration-color: var(--brand-200); text-decoration-thickness: 4px; font-weight: 800; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.between { justify-content: space-between; }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); }
@media (max-width: 720px) { .shell { grid-template-columns: minmax(0, 1fr); } .side { display: none; } }

/* shipments: list, form, sticky actions */
.card-head { padding: 12px 14px; }
.card > .msg { margin: 0 14px 12px; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 12px; line-height: 16px; color: var(--muted); font-weight: 700; padding: 8px 14px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--soft); }
.tbl td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .strong { font-weight: 700; }
.tbl-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
form#form { display: flex; flex-direction: column; gap: 14px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.span2 { grid-column: 1 / -1; }
textarea.input { resize: vertical; }
select.input { height: 40px; }
h4 { margin: 0; font-size: 13px; line-height: 20px; font-weight: 700; }
.sub { border-top: 1px solid var(--line); padding-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.rep { border: 1px solid var(--line); border-radius: 5px; padding: 12px; margin-top: 10px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.rep > .grid, .rep > .grp { width: 100%; }
.house { background: var(--soft); align-items: stretch; gap: 14px; }
.house .rep { background: #fff; }
.hc-row { display: flex; flex-direction: column; gap: 8px; border: 1px solid var(--line); border-radius: 5px; padding: 10px; background: #fff; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.check input { width: 16px; height: 16px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; padding: 12px 0; }
.btn.danger { color: var(--bad); border-color: var(--bad); margin-left: auto; }
@media (max-width: 720px) {
  .tbl thead { display: none; }
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100%; }
  .tbl tr { padding: 10px 14px; border-bottom: 1px solid var(--line); }
  .tbl td { border: 0; padding: 2px 0; display: flex; justify-content: space-between; gap: 12px; }
  .tbl td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: 12px; }
  .tbl-actions { justify-content: flex-start; padding-top: 8px; }
  .actions { position: sticky; bottom: 0; background: var(--page); border-top: 1px solid var(--line); padding: 10px 0; z-index: 2; }
  .btn.danger { margin-left: 0; }
}
.notes { margin: 0; padding: 8px 12px 8px 28px; background: var(--brand-100); border-radius: 4px; color: var(--ink); }
.notes li { margin: 2px 0; }
.input.sm { height: 32px; padding: 4px 8px; font-size: 13px; width: auto; }

/* Countries page */
.country-form, .country-on { display: flex; flex-direction: column; gap: 12px; border-top: 1px solid var(--line); padding-top: 14px; }
.country-form h4, .country-on h4, .card-pad > h4 { margin: 0; font-size: 14px; }
.country-form select.input, .country-form textarea.input { max-width: 420px; }
.country-form .field .input { max-width: 420px; }
.sheet-errors { margin: 0 14px 12px; padding: 0 0 0 18px; color: var(--bad); font-size: 13px; max-height: 220px; overflow: auto; }
.sheet-errors li { margin: 2px 0; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
.key-form { margin: 0 14px 12px; gap: 8px; }
.key-form .input { max-width: 420px; }
.new-key { margin: 0 14px 12px; padding: 12px; border: 1px solid var(--brand-200); background: var(--brand-100); border-radius: 4px; }
.new-key p { margin: 0 0 8px; }
.new-key .row { gap: 8px; }
.card-note { margin: 0 14px 12px; }
.doc { padding: 0 14px 14px; }
.doc pre { background: #f6f7f9; border: 1px solid var(--field); border-radius: 4px; padding: 10px 12px; overflow: auto; font: 12px/18px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.doc code { font: 12px/18px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: #f6f7f9; padding: 1px 4px; border-radius: 3px; }
.connect { max-width: 620px; margin: 40px auto; padding: 0 16px; }
.connect-card { padding-bottom: 16px; }
.connect-line { margin: 0 14px 12px; font-size: 15px; }
.connect-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0 14px 12px; }
.connect-cols h4 { margin: 0 0 6px; font-size: 12px; font-weight: 700; }
.connect-cols ul { margin: 0; padding-left: 18px; }
.connect-card > #ask > p.muted, .connect-card > #ask > p.msg { margin: 0 14px 12px; }
.connect-card > #ask > p#started { font-weight: 500; }
.connect-actions { margin: 0 14px; gap: 8px; }
@media (max-width: 520px) { .connect-cols { grid-template-columns: 1fr; } }

