/* Logistics marketplace — neutral working-name theme. Logical properties keep RTL and LTR symmetric. */
:root {
  --ink: #14212b; --ink-2: #3b4a56; --muted: #66737d; --line: #dfe3e6; --line-2: #eef1f3;
  --bg: #f6f5f2; --card: #ffffff; --accent: #0f5c63; --accent-ink: #ffffff; --accent-soft: #e3f0f0;
  --signal: #b8560b; --signal-soft: #fbeee2; --ok: #1f6b3a; --ok-soft: #e4f2e8; --bad: #a3271f; --bad-soft: #fbe7e5;
  --info-soft: #e8eef6; --radius: 10px; --shadow: 0 1px 2px rgba(20,33,43,.06), 0 2px 8px rgba(20,33,43,.04);
  --font: system-ui, -apple-system, "Segoe UI", "Noto Sans Arabic", "Noto Sans", Tahoma, Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { font-size: 15px; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.55; }
[dir="rtl"] body { line-height: 1.7; }
a { color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid #f2b705; outline-offset: 2px; }
h1 { font-size: 1.6rem; margin: 0 0 .4rem; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; margin: 0 0 .75rem; }
h3 { font-size: 1rem; margin: 1rem 0 .5rem; }
.skip { position: absolute; inset-inline-start: -9999px; }
.skip:focus { inset-inline-start: 1rem; top: .5rem; background: #fff; padding: .5rem 1rem; z-index: 10; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.envbar { background: repeating-linear-gradient(-45deg, #fff4d6, #fff4d6 12px, #fdebb8 12px, #fdebb8 24px);
  color: #6b4a00; text-align: center; font-size: .82rem; padding: .2rem 1rem; font-weight: 600; }

/* header */
.top { background: var(--ink); color: #e8edf0; }
.top-inner { max-width: 1280px; margin: 0 auto; padding: .6rem 1rem; display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.brand { display: flex; gap: .55rem; align-items: center; color: #fff; text-decoration: none; font-weight: 700; }
.brand-mark { width: 22px; height: 22px; border-radius: 6px; background: linear-gradient(135deg, #2aa3a8 0 50%, #f2b705 50% 100%); }
.primary { display: flex; gap: .2rem; flex-wrap: wrap; }
.primary a { color: #cfd8de; text-decoration: none; padding: .35rem .65rem; border-radius: 6px; }
.primary a:hover { background: rgba(255,255,255,.08); color: #fff; }
.top-tools { margin-inline-start: auto; display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.top-tools .lang { color: #fff; font-weight: 600; text-decoration: none; border: 1px solid rgba(255,255,255,.3); padding: .2rem .6rem; border-radius: 6px; }
.top-tools select { background: #22323e; color: #fff; border: 1px solid #3a4c59; border-radius: 6px; padding: .3rem .4rem; max-width: 340px; }
.who { color: #aab6be; font-size: .9rem; }
.linkbtn { background: none; border: 0; color: #cfd8de; cursor: pointer; font: inherit; text-decoration: underline; }
.orgbar { background: #1d2d39; font-size: .88rem; color: #c4ced5; }
.orgbar .top-inner { padding: .35rem 1rem; gap: .5rem; }
.orgbar .roles { margin-inline-start: auto; color: #9fb0bb; }
.orgbar .chip { background: rgba(255,255,255,.1); color: #fff; border-color: transparent; }
.orgbar .chip.status-pending { background: var(--signal); }
.orgbar .chip.status-verified { background: #2b7a4b; }
.orgbar .chip.demo, .chip.demo { background: #6d4aa8; color: #fff; border-color: transparent; }

/* layout */
.page { max-width: 1280px; margin: 0 auto; padding: 1.25rem 1rem 3rem; }
.pagehead { margin-bottom: 1rem; }
.crumbs { color: var(--muted); font-size: .88rem; margin: 0 0 .3rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; margin-bottom: 1rem; box-shadow: var(--shadow); }
.card.narrow, .narrow { max-width: 720px; }
.auth { max-width: 440px; margin: 2rem auto; }
.cols { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 1rem; align-items: start; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 1rem; }
.sectionhead { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .6rem; }
.sectionhead h1, .sectionhead h2 { margin: 0; }
section { margin-bottom: 1.25rem; }
.foot { color: var(--muted); font-size: .82rem; border-top: 1px solid var(--line); }

/* forms */
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.card { padding-top: 2.6rem; position: relative; }
fieldset.card > legend { font-size: 1.05rem; font-weight: 700; padding: 0; position: absolute; top: 1rem; inset-inline-start: 1.2rem; }
.field { margin-bottom: .85rem; }
.field > label, .field > legend, .field .label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .25rem; }
input[type=text], input:not([type]), input[type=email], input[type=password], input[type=number], input[type=date], input[type=datetime-local], select, textarea {
  width: 100%; font: inherit; padding: .5rem .6rem; border: 1px solid #c8cfd4; border-radius: 7px; background: #fff; color: var(--ink); }
textarea { resize: vertical; }
.formtbl input, .formtbl select { padding: .35rem .4rem; min-width: 7rem; }
.formtbl input.num { min-width: 5rem; }
.formtbl input.narrow { min-width: 4rem; width: 5rem; }
.dims { display: flex; gap: .25rem; }
.dims input { min-width: 3.5rem !important; }
.has-error input, .has-error select, .has-error textarea, [aria-invalid=true] { border-color: var(--bad); background: #fffafa; }
.field-error { color: var(--bad); font-size: .85rem; margin: .25rem 0 0; font-weight: 600; }
.hint { color: var(--muted); font-size: .85rem; margin: .25rem 0 .5rem; }
.req { color: var(--bad); }
.check { display: flex; gap: .45rem; align-items: center; font-weight: 400 !important; margin: .2rem 0; }
.check.inline { display: inline-flex; margin-inline-end: 1rem; }
.static { margin: .45rem 0; }
.actions { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin-top: .5rem; }
.actions.sticky { position: sticky; bottom: 0; background: rgba(246,245,242,.95); padding: .75rem 0; border-top: 1px solid var(--line); }
.inline-form { display: flex; gap: .35rem; align-items: center; flex-wrap: wrap; margin-top: .35rem; }
.inline-form input, .inline-form select { width: auto; min-width: 8rem; padding: .3rem .45rem; }
.inline-grid { display: grid; grid-template-columns: 1fr 1fr auto; gap: .5rem; align-items: end; margin-top: .75rem; }
.crossborder { border-inline-start: 4px solid var(--signal); padding-inline-start: 1rem; margin-top: .5rem; }
.crossborder.is-hidden { display: none; }
.services { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .5rem; margin-bottom: 1rem; }
.svc { border: 1px solid var(--line); border-radius: 8px; padding: .55rem .7rem; display: flex; gap: .5rem; align-items: flex-start; }
.svc label { display: flex; flex-direction: column; }
.svc.off { opacity: .6; background: #fafafa; }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: .4rem; border: 1px solid #c3cbd1; background: #fff; color: var(--ink);
  border-radius: 8px; padding: .5rem .95rem; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; line-height: 1.2; }
.btn:hover { border-color: var(--ink-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: #0b4a50; }
.btn.danger { color: var(--bad); border-color: #e3b5b1; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.small { padding: .3rem .6rem; font-size: .85rem; }
.btn.wide { width: 100%; justify-content: center; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* tables */
.tablewrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tbl th, .tbl td { text-align: start; padding: .55rem .6rem; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.tbl thead th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); border-bottom: 1px solid var(--line); }
[dir="rtl"] .tbl thead th { text-transform: none; letter-spacing: 0; font-size: .85rem; }
.tbl.compact th, .tbl.compact td { padding: .35rem .5rem; }
.num { font-variant-numeric: tabular-nums; text-align: end !important; white-space: nowrap; }
.mono { font-family: var(--mono); font-size: .85em; }
.small { font-size: .85rem; }
.compare th[scope=row] { color: var(--ink-2); font-weight: 600; width: 220px; background: #fafbfb; }
.compare thead th { text-transform: none; font-size: .95rem; color: var(--ink); letter-spacing: 0; min-width: 190px; }
.compare thead th.flagged { background: var(--signal-soft); }
.compare thead th.ok { background: var(--accent-soft); }
.compare tr.sum td, .compare tr.sum th { background: #f3f7f7; border-top: 2px solid var(--line); }
.compare td.bad { background: var(--bad-soft); color: var(--bad); font-weight: 600; }
.rank { display: inline-block; background: var(--accent); color: #fff; border-radius: 6px; padding: 0 .4rem; margin-inline-end: .35rem; }
tr.optional { color: var(--muted); }

/* chips, badges */
.chip { display: inline-block; font-size: .78rem; padding: .05rem .5rem; border-radius: 999px; border: 1px solid var(--line); background: #f5f7f8; color: var(--ink-2); white-space: nowrap; }
.chip.warn { background: var(--signal-soft); border-color: #f0cfae; color: var(--signal); }
.badge { display: inline-block; font-size: .78rem; font-weight: 700; padding: .1rem .55rem; border-radius: 6px; background: #eef1f3; color: var(--ink-2); vertical-align: middle; }
.badge.s-published, .badge.s-open, .badge.s-invited, .badge.s-submitted, .badge.s-active { background: var(--info-soft); color: #234a7a; }
.badge.s-awarded, .badge.s-selected, .badge.s-verified, .badge.s-ok { background: var(--ok-soft); color: var(--ok); }
.badge.s-draft, .badge.s-pending { background: var(--signal-soft); color: var(--signal); }
.badge.s-flag, .badge.s-rejected, .badge.s-declined, .badge.s-revoked, .badge.s-withdrawn, .badge.s-suspended { background: var(--bad-soft); color: var(--bad); }
.badge.s-superseded, .badge.s-not_selected, .badge.s-closed, .badge.s-inactive { background: #eceeef; color: var(--muted); }
.badge.s-simulated { background: var(--signal-soft); color: var(--signal); }
.badge.s-not_configured { background: #eceeef; color: var(--muted); }
.badge.s-internal { background: var(--ok-soft); color: var(--ok); }
h1 .badge { font-size: .85rem; }
.count { display: inline-block; min-width: 1.6rem; text-align: center; background: var(--ink); color: #fff; border-radius: 999px; font-size: .8rem; padding: 0 .45rem; margin-inline-start: .3rem; }

/* flashes */
.flashes { margin-bottom: 1rem; }
.flash { border-radius: 8px; padding: .65rem .9rem; margin: 0 0 .6rem; border: 1px solid transparent; }
.flash.success { background: var(--ok-soft); border-color: #bfe0c9; color: #164f2b; }
.flash.error { background: var(--bad-soft); border-color: #f0c3bf; color: #7a1d17; }
.flash.warning { background: var(--signal-soft); border-color: #f0cfae; color: #7a3a07; }
.flash.info { background: var(--info-soft); border-color: #c9d6e8; color: #20406b; }
.issues { border-inline-start: 5px solid var(--bad); }
.issues h2 { color: var(--bad); }
.issues ul { margin: 0; padding-inline-start: 1.2rem; }

/* dashboard */
.queues { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.queue h3 { margin-top: 0; display: flex; align-items: center; gap: .35rem; }
.queue.attention { border-color: var(--signal); box-shadow: 0 0 0 2px var(--signal-soft); }
.qlist, .plain, .notifs, .orglist { list-style: none; margin: 0; padding: 0; }
.qlist li, .plain li, .notifs li { padding: .45rem 0; border-top: 1px solid var(--line-2); display: flex; flex-wrap: wrap; gap: .25rem .6rem; align-items: baseline; }
.notifs li.unread a { font-weight: 700; }
.lane { font-size: .85rem; color: var(--ink-2); }
.muted { color: var(--muted); }
.empty { color: var(--muted); font-style: italic; margin: .4rem 0; }
.orgpick { width: 100%; text-align: start; display: flex; flex-direction: column; gap: .15rem; padding: .75rem 1rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; font: inherit; margin-bottom: .5rem; }
.orgpick:hover { border-color: var(--accent); }

/* detail */
.nextstep { border-inline-start: 6px solid var(--accent); }
.nextstep .label { margin: 0; font-size: .8rem; text-transform: uppercase; color: var(--muted); letter-spacing: .05em; }
.nextstep .big { font-size: 1.15rem; font-weight: 700; margin: .2rem 0 .6rem; }
.award { border-inline-start: 6px solid var(--ok); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .6rem 1.2rem; margin: 0 0 .75rem; }
.facts div { border-bottom: 1px dashed var(--line); padding-bottom: .35rem; }
.facts dt { font-size: .8rem; color: var(--muted); }
.facts dd { margin: .1rem 0 0; font-weight: 600; }
.lifecycle { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .4rem; }
.lifecycle li { border: 1px solid var(--line); border-radius: 8px; padding: .5rem .6rem; background: #fafbfb; display: flex; flex-direction: column; font-size: .88rem; }
.lifecycle li span { color: var(--muted); font-size: .78rem; }
.lifecycle li.done { background: var(--ok-soft); border-color: #bfe0c9; }
.lifecycle li.current { background: var(--signal-soft); border-color: #f0cfae; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: .45rem 0 .45rem 0; border-top: 1px solid var(--line-2); }
.timeline .when { font-family: var(--mono); font-size: .8rem; color: var(--muted); margin-inline-end: .5rem; }
.errcode { font-size: 3rem; font-weight: 800; color: var(--line); margin: 0; }
.demo-help { margin-top: 1rem; font-size: .9rem; }
.demo-help ul { padding-inline-start: 1.2rem; }

@media (max-width: 900px) {
  .cols, .grid3 { grid-template-columns: 1fr; }
  .grid2 { grid-template-columns: 1fr; }
  .lifecycle { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inline-grid { grid-template-columns: 1fr; }
  .top-tools { margin-inline-start: 0; width: 100%; }
  .orgbar .roles { margin-inline-start: 0; width: 100%; }
}
