/* Groupex Operations – shared styles (from the Jennings Clan framework).
   Neutral, professional look. Light and dark follow the phone/PC setting. */
:root {
  color-scheme: light;
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #eef0f3;
  --line: #dadee5;
  --ink: #16202c;
  --ink-2: #4a5563;
  --ink-3: #7c8796;
  --accent: #1e3a5f;
  --accent-ink: #ffffff;
  --gold: #c9a227;
  --accent-soft: #e3eaf3;
  --good: #1d7a43;
  --good-soft: #e2f3e8;
  --warn: #9a6200;
  --warn-soft: #fbf0d9;
  --bad: #b3261e;
  --bad-soft: #fbe5e3;
  --s1: #2a78d6;   /* chart: fully recorded */
  --s2: #eb6834;   /* chart: pay only */
  --s3: #1baf7a;   /* chart: estimated / second measure */
  --s4: #8a5cd1;   /* chart: fourth series */
  --grid: #e6e9ee;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 20, 19, .06), 0 2px 8px rgba(20, 20, 19, .04);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #11151b;
    --surface: #181e26;
    --surface-2: #212833;
    --line: #303946;
    --ink: #eef1f5;
    --ink-2: #bcc5d1;
    --ink-3: #8a95a4;
    --accent: #4a7fbd;
    --accent-soft: #1c2b40;
    --good: #5cc98a;
    --good-soft: #17301f;
    --warn: #e5b04a;
    --warn-soft: #34290f;
    --bad: #f08a83;
    --bad-soft: #3a1a18;
    --s1: #3987e5;
    --s2: #d95926;
    --s3: #199e70;
    --s4: #9b70e0;
    --grid: #262e39;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.45 var(--font);
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
}
@media (min-width: 900px) { body { padding-bottom: 32px; } }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 1.45rem; letter-spacing: -.01em; }
h2 { font-size: 1.1rem; }
h3 { font-size: .95rem; }
.muted { color: var(--ink-2); }
.small { font-size: .85rem; }
.tiny { font-size: .78rem; color: var(--ink-3); }
.num { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}
.topbar-in {
  max-width: 1180px; margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; gap: 14px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; }
.brand:hover { text-decoration: none; }
.brand svg { width: 30px; height: 30px; flex: none; }
.crumb { color: var(--ink-2); font-weight: 600; }
.crumb::before { content: "/"; margin-right: 10px; color: var(--ink-3); font-weight: 400; }
.topnav { margin-left: auto; display: none; gap: 4px; }
.topnav a {
  padding: 7px 12px; border-radius: 999px; color: var(--ink-2); font-weight: 500;
}
.topnav a:hover { background: var(--surface-2); text-decoration: none; }
.topnav a.on { background: var(--accent-soft); color: var(--accent); }
@media (min-width: 900px) { .topnav { display: flex; } }
.top-right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
@media (min-width: 900px) { .top-right { margin-left: 8px; } }
.iconbtn {
  width: 36px; height: 36px; border-radius: 999px; display: grid; place-items: center;
  color: var(--ink-2); border: 1px solid var(--line); background: var(--surface);
}
.iconbtn:hover { background: var(--surface-2); text-decoration: none; }
.iconbtn svg { width: 18px; height: 18px; }

/* ---------- bottom tab bar (phone) ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: var(--surface); border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
@media (min-width: 900px) { .tabbar { display: none; } }
.tabbar a {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: .7rem; color: var(--ink-3); padding: 4px 0; font-weight: 500;
}
.tabbar a:hover { text-decoration: none; }
.tabbar a.on { color: var(--accent); }
.tabbar svg { width: 22px; height: 22px; }
.tabbar .plus {
  width: 48px; height: 48px; border-radius: 16px; background: var(--accent); color: #fff;
  display: grid; place-items: center; margin-top: -18px; box-shadow: 0 4px 14px rgba(30, 58, 95, .35);
}
.tabbar .plus svg { width: 26px; height: 26px; }

/* ---------- layout ---------- */
.wrap { max-width: 1180px; margin: 0 auto; padding: 18px 16px 28px; }
.narrow { max-width: 640px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: 1fr; }
.g3 { grid-template-columns: 1fr; }
@media (min-width: 720px) { .g2 { grid-template-columns: 1fr 1fr; } .g3 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .g3 { grid-template-columns: 1fr 1fr 1fr; } }
.span2 { grid-column: 1 / -1; }
@media (min-width: 1000px) { .span2 { grid-column: span 2; } }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow); min-width: 0;
}
.card h2 { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.card h2 small { font-weight: 400; font-size: .8rem; color: var(--ink-3); }
.section-title { margin: 26px 0 10px; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); font-weight: 600; }

/* ---------- KPI tiles ---------- */
.kpis { display: grid; gap: 10px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 720px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.kpi .label { font-size: .78rem; color: var(--ink-2); font-weight: 500; }
.kpi .value { font-size: 1.55rem; font-weight: 700; letter-spacing: -.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: .78rem; color: var(--ink-3); margin-top: 2px; }
.kpi.hero { grid-column: 1 / -1; background: var(--accent); color: #fff; border-color: transparent; }
.kpi.hero .label, .kpi.hero .sub { color: rgba(255, 255, 255, .85); }
.kpi.hero .value { font-size: 2.2rem; }
@media (min-width: 720px) { .kpi.hero { grid-column: span 2; } }

/* ---------- forms ---------- */
label { display: block; font-size: .82rem; font-weight: 600; color: var(--ink-2); margin-bottom: 4px; }
input, select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-height: 44px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
textarea { min-height: 80px; resize: vertical; }
input[type=checkbox] { width: 20px; height: 20px; min-height: 0; accent-color: var(--accent); vertical-align: middle; }
.field { margin-bottom: 14px; }
.fields { display: grid; gap: 0 12px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.fields input, .fields select { min-width: 0; }
.fields .full { grid-column: 1 / -1; }
.hint { font-size: .78rem; color: var(--ink-3); margin-top: 4px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; color: var(--ink); font-size: .9rem; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 14px 2px; margin: 0 0 14px; }
legend { padding: 0 6px; font-weight: 700; font-size: .85rem; }
.calc { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; font-weight: 600; margin-bottom: 14px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; border-radius: 10px; padding: 10px 16px; min-height: 44px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn.primary { background: var(--accent); color: #fff; border-color: transparent; }
.btn.primary:hover { filter: brightness(1.05); }
.btn.danger { color: var(--bad); }
.btn.small { min-height: 34px; padding: 6px 12px; font-size: .85rem; }
.btn.block { width: 100%; }
.btn svg { width: 18px; height: 18px; }

/* ---------- pills, filters ---------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filters select { width: auto; min-height: 38px; padding: 6px 10px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--surface); }
.seg a { padding: 7px 12px; font-size: .85rem; color: var(--ink-2); }
.seg a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.seg a:hover { text-decoration: none; }
.pill { display: inline-block; font-size: .72rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.pill.good { background: var(--good-soft); color: var(--good); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.info { background: var(--accent-soft); color: var(--accent); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* ---------- flash ---------- */
.flash { border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; font-weight: 500; }
.flash.ok { background: var(--good-soft); color: var(--good); }
.flash.error { background: var(--bad-soft); color: var(--bad); }
.note { background: var(--warn-soft); color: var(--ink); border-radius: 10px; padding: 12px 14px; font-size: .9rem; }
.note.info { background: var(--accent-soft); }
.note strong { color: inherit; }

/* ---------- tables & lists ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { text-align: left; font-size: .75rem; color: var(--ink-3); font-weight: 600; padding: 8px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--surface-2); }
.total-row td { font-weight: 700; border-top: 2px solid var(--line); }

.list { display: grid; gap: 8px; }
.item {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; color: var(--ink);
}
.item:hover { text-decoration: none; border-color: var(--accent); }
.item .t { font-weight: 600; }
.item .m { font-size: .8rem; color: var(--ink-2); }
.item .amt { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.item .flags { grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- charts ---------- */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .axis text, .chart text.lbl { fill: var(--ink-3); font-size: 11px; font-family: var(--font); }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .baseline { stroke: var(--line); stroke-width: 1; }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .hit:hover + .hl, .chart .hl.on { opacity: 1; }
.tip {
  position: absolute; pointer-events: none; z-index: 5; background: var(--ink); color: var(--surface);
  font-size: .78rem; padding: 7px 10px; border-radius: 8px; white-space: nowrap; opacity: 0; transition: opacity .1s;
  transform: translate(-50%, calc(-100% - 10px)); line-height: 1.35;
}
.tip b { font-weight: 700; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .8rem; color: var(--ink-2); margin-bottom: 8px; }
.empty { color: var(--ink-3); font-size: .9rem; padding: 26px 0; text-align: center; }

/* ---------- stat rows ---------- */
.stat-rows { display: grid; gap: 0; }
.stat-rows > div { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.stat-rows > div:last-child { border-bottom: 0; }
.stat-rows span:last-child { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }

.records { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }
@media (min-width: 720px) { .records { grid-template-columns: repeat(3, 1fr); } }
.record { background: var(--surface-2); border-radius: 12px; padding: 12px; }
.record .k { font-size: .75rem; color: var(--ink-2); }
.record .v { font-size: 1.15rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.record .d { font-size: .75rem; color: var(--ink-3); }

.meter { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; display: flex; gap: 2px; }
.meter span { display: block; height: 100%; }

/* ---------- home tiles ---------- */
.hero-home { padding: 8px 0 18px; }
.hero-home h1 { font-size: 1.8rem; }
.tiles { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .tiles { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .tiles { grid-template-columns: 1fr 1fr 1fr; } }
.tile {
  display: flex; flex-direction: column; gap: 12px; color: var(--ink); min-height: 190px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px; box-shadow: var(--shadow);
  transition: transform .12s, border-color .12s;
}
.tile:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-2px); }
.tile .logo { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; }
.tile .logo svg { width: 32px; height: 32px; }
.tile h2 { margin: 0; font-size: 1.2rem; }
.tile .lines { font-size: .88rem; color: var(--ink-2); display: grid; gap: 2px; }
.tile .go { margin-top: auto; font-weight: 600; color: var(--accent); font-size: .9rem; }
.tile.soon { opacity: .75; border-style: dashed; box-shadow: none; }
.tile.soon:hover { transform: none; border-color: var(--line); }
.tile.soon .go { color: var(--ink-3); }

.auth { max-width: 380px; margin: 8vh auto 0; }
.auth .brand { justify-content: center; margin-bottom: 22px; font-size: 1.2rem; }
.auth .brand svg { width: 48px; height: 48px; }

.open-block { border: 2px solid var(--accent); }
.loading { opacity: .6; pointer-events: none; }

/* ---------- select & delete several blocks ---------- */
.item .pick { display: none; }
.selecting .item { grid-template-columns: auto 1fr auto; cursor: pointer; }
.selecting .item .pick { display: block; grid-row: 1 / span 2; pointer-events: none; }
.selecting .item .flags { grid-column: 2 / -1; }
.item.chosen { border-color: var(--bad); background: var(--bad-soft); }
.selbar {
  display: none; position: fixed; left: 50%; transform: translateX(-50%); z-index: 40;
  bottom: calc(84px + env(safe-area-inset-bottom)); width: min(560px, calc(100% - 24px));
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 8px 10px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .18); align-items: center; gap: 8px;
}
.selbar.on { display: flex; }
.selbar #selcount { flex: 1; text-align: center; color: var(--ink-2); }
@media (min-width: 900px) { .selbar { bottom: 20px; } }

/* keep the PC menu on one line */
.topnav a, .crumb, .brand, .topnav .btn { white-space: nowrap; }
@media (max-width: 1150px) {
  .crumb { display: none; }
  .topnav a { padding: 7px 9px; font-size: .92rem; }
}

/* two-choice toggle (Logistics / Fresh) */
.segbtn { display: block; text-align: center; padding: 10px 8px; cursor: pointer; color: var(--ink-2); font-weight: 500; }
input:checked + .segbtn { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.statebar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.statebar a { flex: 1; min-width: 130px; text-decoration: none; }
.statebar .kpi { padding: 10px 12px; }
.statebar .kpi .value { font-size: 1.3rem; }
.selbar { flex-wrap: wrap; justify-content: center; }
.selbar #selcount { flex-basis: 100%; order: -1; margin-bottom: 2px; }
[hidden] { display: none !important; }

/* home tile picture */
.tile-img { width: 72px; height: 72px; border-radius: 18px; object-fit: cover; box-shadow: var(--shadow); }
/* notification bell */
.bell { position: relative; }
.bell .badge { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--bad); color: #fff; font-size: .68rem; font-weight: 700; display: grid; place-items: center; }
.bell .badge.soon { background: var(--warn); }
/* vehicle cards */
.vcard { display: grid; grid-template-columns: 88px 1fr; gap: 14px; align-items: center; color: var(--ink); }
.vcard:hover { text-decoration: none; }
.vthumb { width: 88px; height: 66px; border-radius: 12px; object-fit: cover; background: var(--surface-2); display: grid; place-items: center; color: var(--ink-3); }
.vthumb svg { width: 34px; height: 34px; }
.vhero { width: 100%; max-height: 260px; object-fit: cover; border-radius: var(--radius); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.hbar { height: 10px; border-radius: 999px; background: var(--s1); min-width: 2px; }
.timeline { display: grid; gap: 8px; }
.tabs { display: flex; gap: 6px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 18px 0 10px; position: sticky; top: 62px; z-index: 10; background: var(--bg); padding: 6px 0; }
.tabs a { padding: 7px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); font-size: .88rem; font-weight: 500; }
.tabs a:hover { text-decoration: none; border-color: var(--accent); }
.defect { font-size: .82rem; padding: 4px 0; border-top: 1px dashed var(--line); }
.tabs a.on { background: var(--accent); color: #fff; border-color: transparent; }
.tabs a.on .pill { background: rgba(255,255,255,.25); color: #fff; }
details > summary { cursor: pointer; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
.item form { margin: 0; }
.tabs a { flex: 0 0 auto; white-space: nowrap; }
.brand .logo-img { width: 34px; height: 34px; flex: none; border-radius: 50%; }
.auth .brand .logo-img { width: 72px; height: 72px; }
/* document viewer */
.docview { display: grid; gap: 10px; overflow-x: auto; }
.docview img { width: 100%; max-width: 900px; margin: 0 auto; display: block; background: #fff; border-radius: 8px; box-shadow: var(--shadow); border: 1px solid var(--line); cursor: zoom-in; }
.docview.zoom img { width: 200%; max-width: none; cursor: zoom-out; }
.docview iframe { width: 100%; height: 75vh; border: 1px solid var(--line); border-radius: 8px; }
.quickdocs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.fields input[type=date] { padding-left: 8px; padding-right: 6px; font-size: .95rem; }
/* compact document rows */
.docrow { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px 8px 8px 10px; }
.docrow:hover { border-color: var(--accent); }
.docrow-main { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; color: var(--ink); }
.docrow-main:hover { text-decoration: none; }
.docrow-text { display: flex; flex-direction: column; min-width: 0; }
.docrow-text .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.docrow-text .m { font-size: .78rem; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.docicon { flex: none; width: 40px; height: 40px; border-radius: 9px; display: grid; place-items: center; font-size: .66rem; font-weight: 800; letter-spacing: .03em; background: var(--surface-2); color: var(--ink-2); }
.docicon.pdf { background: var(--bad-soft); color: var(--bad); }
.docicon.img { background: var(--accent-soft); color: var(--accent); }
.docrow .del { width: 34px; height: 34px; min-height: 0; color: var(--ink-3); font-size: .9rem; }
.docrow .del:hover { color: var(--bad); }
.docrow form { margin: 0; }
/* never let a bare icon blow up inside text */
.item svg, .t svg { width: 18px; height: 18px; vertical-align: -3px; }
/* back link at the top of sub-pages */
.backlink { display: inline-flex; align-items: center; gap: 2px; margin: -4px 0 10px -6px; padding: 6px 10px 6px 4px; border-radius: 999px; color: var(--accent); font-weight: 600; font-size: .92rem; }
.backlink:hover { background: var(--accent-soft); text-decoration: none; }
.backlink svg { width: 20px; height: 20px; }
.docview-head .backlink { margin: 0; }
.docrename { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: -4px 0 4px; padding: 10px; background: var(--surface-2); border-radius: 0 0 12px 12px; }
.docrename select { flex: 0 1 200px; min-height: 38px; padding: 6px 10px; }
.docrename input { flex: 1 1 220px; min-height: 38px; padding: 6px 10px; }
.docrow .del svg { width: 16px; height: 16px; }
/* documents grouped by job */
.docthumb { flex: none; width: 40px; height: 40px; border-radius: 9px; object-fit: cover; background: var(--surface-2); }
.docgroup { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.docgroup[open] { border-color: var(--accent); }
.docgroup > summary { display: flex; align-items: center; gap: 12px; padding: 8px 12px 8px 10px; cursor: pointer; }
.docgroup .chev { margin-left: auto; color: var(--ink-3); transition: transform .15s; }
.docgroup[open] .chev { transform: rotate(180deg); }
.docgroup-body { padding: 4px 10px 10px; border-top: 1px solid var(--line); padding-top: 10px; }
.docgroup-body .docrow { background: var(--surface-2); border-color: transparent; }
.thumbstack { flex: none; display: flex; width: 64px; height: 40px; position: relative; }
.thumbstack img, .thumbstack .docicon { width: 40px; height: 40px; border-radius: 9px; object-fit: cover; border: 2px solid var(--surface); position: absolute; top: 0; }
.thumbstack img:nth-child(1) { left: 0; z-index: 3; }
.thumbstack img:nth-child(2) { left: 12px; z-index: 2; }
.thumbstack img:nth-child(3) { left: 24px; z-index: 1; }
/* job gallery */
.gallery { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .gallery { grid-template-columns: 1fr 1fr; } }
.gallery figure { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.gallery figure img { display: block; width: 100%; height: auto; cursor: zoom-in; background: #fff; }
.gallery figure.zoom { grid-column: 1 / -1; }
.gallery figcaption { display: flex; justify-content: space-between; gap: 10px; padding: 8px 12px; font-size: .82rem; color: var(--ink-2); }
.list > * { min-width: 0; }
.docgroup { overflow: hidden; }
.docgroup > summary .docrow-text { flex: 1; }
.docgroup > summary::-webkit-details-marker { display: none; }
.docgroup > summary { list-style: none; }
/* vehicle photo: one shape (4:3) everywhere, plus the crop tool */
.vhero { aspect-ratio: 4 / 3; max-height: none; height: auto; }
.vhero-wrap { position: relative; }
.vhero-wrap .photo-edit { position: absolute; right: 10px; bottom: 10px; background: rgba(0,0,0,.55); color: #fff; border: 0; }
.vhero-wrap .photo-edit:hover { background: rgba(0,0,0,.75); }
.cropframe { position: relative; width: 100%; aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--radius); background: #fff;
             touch-action: none; cursor: grab; box-shadow: var(--shadow); border: 1px solid var(--line); user-select: none; }
.cropframe:active { cursor: grabbing; }
.cropframe img { position: absolute; left: 50%; top: 50%; max-width: none; transform-origin: center center; pointer-events: none; }
.cropctl { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-size: 1.3rem; color: var(--ink-2); }
.cropctl input { flex: 1; min-height: 0; padding: 0; accent-color: var(--accent); border: 0; background: none; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line); cursor: pointer; padding: 0; }
.swatch.on { outline: 3px solid var(--accent); outline-offset: 2px; }
/* vehicle page header: photo at a modest size beside the name */
.vhead { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 20px; align-items: center; }
.vhead.nophoto { grid-template-columns: 1fr; }
@media (max-width: 600px) {
  .vhead { grid-template-columns: minmax(0, 42%) minmax(0, 1fr); gap: 12px; align-items: start; }
  .vhead .photo-edit span, .vhead .photo-edit { font-size: 0; padding: 6px; }
  .vhead .photo-edit svg { width: 16px; height: 16px; }
  .vhead h1 { font-size: 1.25rem; }
  .vhead .plate.lg { font-size: 1rem; }
}
.vhead .photo-edit { font-size: .78rem; padding: 4px 9px; min-height: 0; right: 8px; bottom: 8px; }
/* family */
.avatar { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: .95rem; }
.avatar.sm { width: 26px; height: 26px; font-size: .78rem; }
.checkline { display: flex; gap: 10px; align-items: center; font-size: .95rem; color: var(--ink); font-weight: 500; margin: 6px 0; }
.checkline input { width: auto; min-height: 0; }
.modpick { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0 12px; }
.swatchpick input { display: none; }
.swatchpick span { display: block; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
.swatchpick input:checked + span { box-shadow: 0 0 0 3px var(--accent); }
.peoplebar { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; scrollbar-width: none; }
.peoplebar a { flex: none; display: flex; align-items: center; gap: 6px; padding: 5px 12px 5px 5px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 600; font-size: .9rem; }
.peoplebar a.on { border-color: var(--accent); background: var(--accent-soft); }
.peoplebar a:hover { text-decoration: none; }
/* profile photos (pets, family) */
.cropframe.round::after { content: ""; position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 999px rgba(0,0,0,.45); pointer-events: none; }
.cropempty { position: absolute; inset: 0; display: grid; place-items: center; background: var(--surface-2); cursor: pointer; }
.cropempty input { display: none; }
.cropmini.round { width: 76px; height: 76px; border-radius: 50%; }
img.avatar { object-fit: cover; background: var(--surface-2); }
.avatar.lg { width: 48px; height: 48px; font-size: 1.3rem; }
.avatar.xl { width: 96px; height: 96px; font-size: 2.4rem; }
.photowrap { position: relative; display: inline-block; justify-self: start; }
.photowrap .photo-edit { position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%); background: rgba(0,0,0,.6); color: #fff; border: 0;
  font-size: .78rem; padding: 4px 10px; min-height: 0; white-space: nowrap; }
.photowrap .photo-edit:hover { background: rgba(0,0,0,.8); }
.photowrap .photo-edit svg { width: 14px; height: 14px; }
.vhead .photowrap .photo-edit { font-size: .78rem; padding: 4px 10px; width: max-content; right: auto; }


/* ---------- Groupex additions ---------- */
.brand .logo-img { border-radius: 9px; }
.auth .brand .logo-img { border-radius: 18px; }
.tile .soon-tag { align-self: flex-start; }
.syscheck > div { display: grid; grid-template-columns: 24px 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.syscheck > div:last-child { border-bottom: 0; }
.syscheck .ok { color: var(--good); font-weight: 800; }
.syscheck .no { color: var(--bad); font-weight: 800; }
.syscheck .k { font-weight: 600; }
.syscheck .v { font-size: .82rem; color: var(--ink-2); word-break: break-all; }
