:root {
  --bg: #0b1220;
  --panel: #152033;
  --panel-2: #1d2b42;
  --line: #2a3a55;
  --text: #e8eef8;
  --muted: #94a5bf;
  --green: #4ade80;
  --green-dark: #166534;
  --red: #f87171;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--green); text-decoration: none; }
header { display: flex; align-items: center; gap: 1.5rem; padding: 1rem 5vw; border-bottom: 1px solid var(--line); background: #0d1626; position: sticky; top: 0; z-index: 5; flex-wrap: wrap; }
.brand { font-weight: 800; font-size: 1.35rem; color: var(--green); letter-spacing: -.03em; }
.brand span { color: var(--muted); font-size: .8rem; }
nav { display: flex; gap: 1rem; flex: 1; }
nav a { color: var(--muted); font-size: .95rem; }
nav a:hover { color: var(--text); }
#session { display: flex; align-items: center; gap: .75rem; }
.who { color: var(--muted); font-size: .9rem; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
main { max-width: 1100px; margin: 0 auto; padding: 2rem 5vw 5rem; }
h1, h2, h3 { margin: 0 0 .75rem; }
h1 { font-size: 2.4rem; letter-spacing: -.04em; }
.hero { background: linear-gradient(135deg, #123524, #152033); border: 1px solid #23543a; border-radius: 18px; padding: 2.5rem; margin-bottom: 2rem; }
.hero p { color: var(--muted); max-width: 640px; line-height: 1.6; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 1.25rem; }
.narrow { max-width: 460px; margin: 3rem auto; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; }
.product { display: flex; flex-direction: column; gap: .5rem; }
.product .thumb { height: 90px; border-radius: 10px; background: var(--panel-2); display: grid; place-items: center; font-size: 2rem; overflow: hidden; }
.product .thumb img { width: 100%; height: 100%; object-fit: cover; }
.product h3 { font-size: 1.05rem; margin: .4rem 0 0; }
.product p { font-size: .86rem; color: var(--muted); min-height: 2.4em; margin: 0; }
.row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.muted { color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.25rem 0; }
button, .button { font: inherit; cursor: pointer; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); padding: .55rem .9rem; border-radius: 9px; }
button:hover, .button:hover { border-color: var(--green); }
button.primary, .button.primary { background: var(--green); border-color: var(--green); color: #06240f; font-weight: 700; }
button.ghost { background: transparent; }
button.danger { color: var(--red); }
button:disabled { opacity: .5; cursor: not-allowed; }
.chip.active { background: var(--green-dark); border-color: var(--green); color: #dcfce7; }
label { display: block; font-size: .86rem; color: var(--muted); margin: .8rem 0 .3rem; }
input, textarea, select { width: 100%; font: inherit; color: var(--text); background: #0f1929; border: 1px solid var(--line); border-radius: 9px; padding: .65rem .75rem; }
textarea { min-height: 84px; resize: vertical; }
.stack { display: grid; gap: .75rem; }
.list { display: grid; gap: .75rem; }
.line-item { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .75rem 0; border-bottom: 1px solid var(--line); }
.qty { display: flex; align-items: center; gap: .5rem; }
.qty button { padding: .2rem .55rem; }
.badge { font-size: .75rem; padding: .2rem .55rem; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); text-transform: capitalize; }
.badge.paid, .badge.confirmed, .badge.delivered { color: #bbf7d0; border-color: var(--green-dark); background: #123524; }
.badge.failed, .badge.cancelled { color: #fecaca; border-color: #7f1d1d; background: #36161a; }
.timeline { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.timeline li { padding-left: 1rem; border-left: 2px solid var(--line); }
.timeline li::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--green); margin-left: -1.2rem; margin-right: .6rem; }
.error { border-color: #7f1d1d; }
#toast { position: fixed; right: 1.25rem; bottom: 1.25rem; display: grid; gap: .5rem; z-index: 20; }
#toast div { background: var(--panel-2); border: 1px solid var(--green); border-radius: 10px; padding: .8rem 1rem; box-shadow: 0 10px 30px #0008; }
#toast div.bad { border-color: var(--red); }
code { background: var(--panel-2); padding: .1rem .35rem; border-radius: 5px; }
/* Dashboards, tables, tracking and chat (ported from the PHP app). */
.tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 1.25rem; padding-bottom: .6rem; border-bottom: 1px solid var(--line); }
.tabs a { color: var(--muted); font-size: .88rem; padding: .35rem .7rem; border-radius: 8px; }
.tabs a:hover { background: var(--panel-2); color: var(--text); }
.tabs a.active { background: var(--green-dark); color: #dcfce7; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; align-items: start; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; }
.stat-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 1rem; display: grid; gap: .35rem; }
.stat-card span { color: var(--muted); font-size: .8rem; text-transform: capitalize; }
.stat-card b { font-size: 1.5rem; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th, td { text-align: left; padding: .6rem .5rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-size: .75rem; text-transform: uppercase; }
td select, td input { min-width: 110px; padding: .4rem .5rem; }
.low-stock { color: var(--red); font-weight: 700; }
.badge.assigned, .badge.picked_up, .badge.in_transit, .badge.placed { color: #bfdbfe; border-color: #1e40af; background: #152238; }
label.check { display: flex; align-items: center; gap: .5rem; color: var(--text); }
label.check input { width: auto; }
.progress { height: 10px; border-radius: 999px; background: var(--panel-2); overflow: hidden; margin: .75rem 0; }
.progress span { display: block; height: 100%; background: var(--green); }
.steps { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; margin: 0; }
.steps li { font-size: .78rem; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: .25rem .6rem; }
.steps li.done { background: var(--green-dark); color: #dcfce7; border-color: var(--green); }
.steps li.current { border-color: var(--green); color: var(--text); }
.map { height: 300px; border-radius: 12px; background: var(--panel-2); z-index: 0; }
.map-empty { display: grid; place-items: center; height: 100%; color: var(--muted); font-size: .85rem; }
@media (max-width: 640px) { header { gap: .75rem; } main { padding-top: 1.25rem; } h1 { font-size: 1.9rem; } }
