/* Admin / dispatcher layout */
.topbar { position: sticky; top: 0; z-index: 900; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 14px; padding: 0 16px; height: 58px; }
.topbar nav { display: flex; gap: 2px; overflow-x: auto; flex: 1; scrollbar-width: none; }
.topbar nav::-webkit-scrollbar { display: none; }
.topbar nav a { padding: 8px 12px; border-radius: 8px; color: #374151; font-weight: 600; white-space: nowrap; font-size: 14px; }
.topbar nav a:hover { background: #f3f4f6; text-decoration: none; }
.topbar nav a.on { background: var(--brand-soft); color: var(--brand); }
.topbar .who { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; white-space: nowrap; }
main.page { padding: 18px 16px 48px; max-width: 1400px; margin: 0 auto; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar input[type=date] { width: auto; }
.toolbar input[type=search] { width: 230px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.seg button { border: 0; background: transparent; padding: 8px 12px; font: inherit; font-weight: 600; cursor: pointer; color: #374151; min-height: 38px; }
.seg button.on { background: var(--brand); color: #fff; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 12px; font-weight: 700; font-size: 13px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.chip.on { outline: 2px solid var(--ink); }
.chip b { font-size: 15px; }
.bulk { position: sticky; top: 64px; z-index: 50; background: var(--ink); color: #fff; border-radius: 12px; padding: 10px 12px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.bulk select { width: auto; min-width: 180px; color: var(--ink); }
.ord td { cursor: pointer; }
.ord td.sel, .ord td.drv { cursor: default; }
.ord .oname { font-weight: 800; }
.ord .sub { color: var(--muted); font-size: 13px; }
.ord select { min-height: 34px; padding: 5px 8px; font-size: 14px; max-width: 190px; }
.flag { display: inline-block; font-size: 12px; font-weight: 700; color: var(--warn); }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; font-size: 14px; }
.kv > div:nth-child(odd) { color: var(--muted); font-weight: 600; }
.timeline { list-style: none; padding: 0; margin: 0; font-size: 13px; }
.timeline li { padding: 6px 0; border-bottom: 1px dashed var(--line); display: flex; gap: 10px; }
.timeline li span:first-child { color: var(--muted); width: 92px; flex: none; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 14px; box-shadow: var(--shadow); }
.stat .n { font-size: 26px; font-weight: 800; }
.stat .l { color: var(--muted); font-size: 13px; font-weight: 600; }
.map-layout { display: grid; grid-template-columns: 320px 1fr; gap: 12px; height: calc(100vh - 110px); min-height: 480px; }
.map-side { overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
#map { border-radius: var(--r); border: 1px solid var(--line); height: 100%; min-height: 420px; background: #e8eef3; }
.drv-item { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; }
.drv-item.on { outline: 2px solid var(--brand); }
.drv-item .t { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.drv-item .s { color: var(--muted); font-size: 13px; margin-top: 2px; }
.pin { width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 800; font-size: 13px; display: flex; align-items: center; justify-content: center; border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.35); }
.pin.stale { background: #6b7280; }
.opin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.help { background: #fffbea; border: 1px solid #f5e1a4; border-radius: 10px; padding: 12px; font-size: 14px; }
.copy { display: flex; gap: 6px; }
.copy input { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }
.section { margin-top: 22px; }
@media (max-width: 900px) {
  .map-layout { grid-template-columns: 1fr; height: auto; }
  .map-side { max-height: 260px; }
  #map { height: 60vh; }
  .ord .hide-sm { display: none; }
  .topbar .who span { display: none; }
}
tr.grp td { background: #f7f3f5; font-weight: 800; font-size: 15px; color: var(--brand); border-top: 2px solid #f1d5e0; cursor: default !important; }
.ord .chip { margin-top: 6px; padding: 3px 9px; font-size: 12px; }
/* v1.2: place search, team & roles */
#side { display: flex; flex-direction: column; gap: 8px; }
.place-find, .map-find { position: relative; }
.pf-list { position: absolute; left: 0; right: 0; top: 100%; z-index: 30; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(16,24,40,.15); max-height: 300px; overflow-y: auto; margin-top: 4px; }
.map-find .pf-list { z-index: 1200; }
.pf-item { display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: #fff; padding: 9px 11px; font: inherit; cursor: pointer; }
.pf-item:hover { background: var(--brand-soft); }
.pf-item:last-child { border-bottom: 0; }
.pf-item small { color: var(--muted); }
.pf-ic { font-size: 18px; line-height: 1.2; }
.pf-picked { margin-top: 6px; background: var(--ok-soft); color: var(--ok); border-radius: 8px; padding: 6px 10px; font-size: 13px; }
.pf-picked .check { color: var(--ink); font-size: 13px; }
.card.off { opacity: .6; }
.role-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.role-card { text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font: inherit; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.role-card small { color: var(--muted); }
.role-card.on { border-color: var(--brand); background: var(--brand-soft); }
.role-card.add { border-style: dashed; color: var(--muted); justify-content: center; }
.perm { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 8px; font-weight: 500; font-size: 15px; color: var(--ink); margin: 0 0 4px; background: #f8f9fb; }
.perm input { width: 18px; height: 18px; min-height: 0; }
.role-checks { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; }
.role-checks .check { font-size: 14px; }
table.matrix th.c, table.matrix td.c { text-align: center; white-space: nowrap; }
table.matrix td.c input { width: 18px; height: 18px; min-height: 0; }
table.matrix tr.grp td { background: #f3f4f6; font-weight: 800; text-transform: uppercase; font-size: 12px; letter-spacing: .04em; color: var(--muted); }
.small-list { margin: 6px 0 0; padding-left: 18px; font-size: 13px; color: #374151; }
