/*
* /school-techs - School Technicians dashboard (app/Views/techs/index.php).
* Desktop first: groups three across, buildings and integrators in thirds,
* busiest schools in three columns. Every grid falls to one column on a
* phone. Same palette and status tones as the check-in page.
*/

:root {
    --bg: #F3F5F9;
    --card: #FFFFFF;
    --ink: #0E1525;
    --ink-2: #3A4252;
    --muted: #5B6474;
    --line: #E3E7EE;
    --line-soft: #EEF1F5;
    --link: #1F4FB8;
    --link-hover: #163C8C;
    --zero-bg: #EEF1F5;
    --mine-bg: #FDE8EA; --mine-fg: #B42335;
    --open-bg: #FFF1DB; --open-fg: #8A5300;
    --cb-bg: #E3F0FF;   --cb-fg: #1F5FA8;
    --over-bg: #FDF0F1;
}

/*Status tones*/
.t-active   { --tbg: #E3F5EA; --tfg: #0F6E40; --tdot: #2ECC71; }
.t-transit  { --tbg: #FFF1DB; --tfg: #8A5300; --tdot: #F5A623; }
.t-meeting  { --tbg: #EFEAFE; --tfg: #5B33C4; --tdot: #9B6DFF; }
.t-out      { --tbg: #FDE8EA; --tfg: #B42335; --tdot: #E74C3C; }
.t-vacation { --tbg: #E3F0FF; --tfg: #1F5FA8; --tdot: #3EA8FF; }
.t-pending  { --tbg: #EEF1F5; --tfg: #5B6474; --tdot: #C3C9D4; }

*, *::before, *::after { box-sizing: border-box; }
body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--ink);
    font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.35;
    font-variant-numeric: tabular-nums;
}
a { color: var(--link); }
a:hover { color: var(--link-hover); }
:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; }
h1, h2, h3, p { margin: 0; }
img.logo { display: block; flex: none; object-fit: contain; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; }
.dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: #2ECC71; }

/* ---------- header ---------- */
.top { background: var(--card); border-bottom: 1px solid var(--line); }
.top-in {
    max-width: 1400px; margin: 0 auto; padding: 12px 32px; min-height: 68px;
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.top-in .brand { width: 34px; height: 38px; }
.title { display: flex; flex-direction: column; gap: 2px; }
.title h1 { font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.period { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.soon { padding: 2px 7px; border-radius: 6px; background: #FFF1DB; color: #8A5300; font-size: 11px; font-weight: 800; letter-spacing: .04em; }
.updated { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }

/* ---------- layout ---------- */
main { max-width: 1400px; margin: 0 auto; padding: 24px 32px 32px; display: flex; flex-direction: column; gap: 24px; }
.sec { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.sec-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 0 4px; }
.sec-head h2 { font-size: 20px; font-weight: 800; }
.sub { font-size: 13px; color: var(--muted); }
.legend { margin-left: auto; display: inline-flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 4px; }
.legend .i-mine { color: var(--mine-fg); }
.legend .i-cb { color: var(--cb-fg); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr)); gap: 16px; align-items: start; }
.cards.even { align-items: stretch; }
.empty { padding: 20px; text-align: center; color: var(--muted); }

/* ---------- a person ---------- */
.person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar {
    flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
    font-size: 12px; font-weight: 800; background: var(--tbg); color: var(--tfg); box-shadow: inset 0 0 0 2px var(--tdot);
}
.who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.who .name { font-size: 15px; font-weight: 600; color: inherit; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who a.name:hover { color: var(--link); text-decoration: underline; }
.where { display: flex; align-items: center; gap: 5px; min-width: 0; overflow: hidden; white-space: nowrap; font-size: 13px; color: var(--muted); }
.where .state { flex: none; font-weight: 700; color: var(--tfg); }
.where .at, .where .to { flex: none; display: inline-flex; align-items: center; gap: 4px; font-weight: 600; color: var(--ink-2); }
.where .to { color: #8A5300; }
.where .at img, .where .to img { width: 16px; height: 16px; }
.where .ago { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.act {
    flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
    color: var(--ink-2); background: var(--bg);
}
.act:hover { background: #E6EAF0; color: var(--ink); }

/* ---------- counts ---------- */
.chips { margin-left: auto; display: flex; gap: 4px; }
.chip {
    display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 34px;
    padding: 4px 6px; border-radius: 8px; font-size: 13px; font-weight: 800;
}
.chip.mine { background: var(--mine-bg); color: var(--mine-fg); }
.chip.open { background: var(--open-bg); color: var(--open-fg); align-items: baseline; gap: 3px; }
.chip.cb   { background: var(--cb-bg); color: var(--cb-fg); }
.chip.zero { background: var(--zero-bg); color: var(--muted); }
.chip.open small { font-size: 10px; font-weight: 700; }
.over-tag { flex: none; padding: 2px 6px; border-radius: 5px; background: #B42335; color: #FFFFFF; font-size: 10px; font-weight: 800; letter-spacing: .04em; }

/* ---------- group cards ---------- */
.group { overflow: hidden; display: flex; flex-direction: column; }
.group .band { height: 6px; background: var(--g); }
.group-head { display: flex; align-items: center; gap: 8px; padding: 12px 16px 6px; white-space: nowrap; }
.gtag { padding: 4px 9px; border-radius: 6px; background: var(--g); color: var(--gi); font-size: 13px; font-weight: 800; letter-spacing: .06em; }
.gsum { margin-left: auto; font-size: 13px; font-weight: 600; color: var(--muted); }
.group .person { padding: 8px 12px 8px 16px; }
.schools { margin-top: 6px; border-top: 1px solid var(--line-soft); }
.srow { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 4px 12px 4px 16px; }
.srow + .srow { border-top: 1px solid #F0F2F6; }
.srow.over { background: var(--over-bg); }
.srow img.logo { width: 26px; height: 26px; }
.srow .lbl { font-size: 15px; font-weight: 800; }

/* ---------- buildings & district ---------- */
.fixed { padding: 14px 12px 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.fixed-head { display: flex; align-items: center; gap: 10px; }
.fixed-head img.logo { width: 30px; height: 30px; }
.fixed-head h3 { font-size: 15px; font-weight: 800; }
.kind { margin-left: auto; padding: 3px 8px; border-radius: 6px; background: #E6EAF0; color: var(--ink-2); font-size: 11px; font-weight: 800; letter-spacing: .04em; }
.big-chips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: auto; }
.big-chips .chip { padding: 6px 0; border-radius: 9px; font-size: 15px; }
.note { margin-top: auto; padding: 8px 10px; border-radius: 9px; background: var(--bg); font-size: 13px; color: var(--ink-2); }

/* ---------- busiest schools ---------- */
.busy { padding: 16px 16px 12px; display: flex; flex-direction: column; gap: 8px; }
.busy .sec-head { padding: 0 2px 4px; }
.rank-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 4px 28px; }
.rank-col { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rrow { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 2px 8px; border-radius: 10px; }
.rrow.over { background: var(--over-bg); }
.rrow .n { flex: none; width: 18px; text-align: right; font-size: 12px; font-weight: 700; color: var(--muted); }
.rrow img.logo { width: 24px; height: 24px; }
.rrow .lbl { flex: none; width: 52px; font-size: 14px; font-weight: 800; }
.rtag { flex: none; min-width: 30px; text-align: center; padding: 2px 5px; border-radius: 5px; font-size: 10px; font-weight: 800; background: var(--g, #E6EAF0); color: var(--gi, #3A4252); }
.rrow .site { flex: none; width: 8px; }
.bar { flex: 1; min-width: 60px; height: 8px; border-radius: 4px; background: var(--line-soft); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 4px; background: #5E7CFF; }
.bar.warm i { background: #E89B2E; }
.bar.hot i { background: #D63A4A; }
.load { flex: none; width: 50px; text-align: right; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.rrow.over .load { color: #B42335; }

/* ---------- footer ---------- */
.foot { max-width: 1400px; margin: 0 auto; padding: 0 32px 28px; display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.foot a { color: var(--muted); }
.foot .classic { margin-left: auto; }

@media (max-width: 640px) {
    .top-in, main, .foot { padding-left: 16px; padding-right: 16px; }
    .updated, .legend { margin-left: 0; }
}
