/* Medloggi · mesma família visual do Painel de Motoristas */
:root {
  --bg: #eceff1; --surface: #fff; --surface-2: #f4f6f7; --ink: #12202b; --muted: #586775; --line: #d5dce1;
  --c1: #0a6b6b; --c2: #b4540a; --good: #1d7a4b; --warn: #9a5f06; --bad: #b3261e; --navy: #10202c;
  --N: #2f5fb3; --C: #b4540a; --S: #1d7a4b;
  --fd: "Barlow Condensed", "Arial Narrow", sans-serif; --fb: "IBM Plex Sans", system-ui, sans-serif; --fm: "IBM Plex Mono", ui-monospace, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root {
  --bg: #0d1419; --surface: #141d24; --surface-2: #19242d; --ink: #e5ecf0; --muted: #94a4b1; --line: #26343f;
  --c1: #3dbfb6; --c2: #f0a24c; --good: #4cc38a; --warn: #e3b04b; --bad: #ff7b72; --navy: #0a1116; --N: #7aa7ff; --C: #f0a24c; --S: #4cc38a; color-scheme: dark; } }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 14px/1.45 var(--fb); }
h1, h2, p { margin: 0; }
h1 { font-family: var(--fd); font-size: 34px; line-height: 1.05; }
h2 { font-family: var(--fd); font-size: 19px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; }
.eyebrow, .lbl, .field > span { font-family: var(--fm); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.note { color: var(--muted); font-size: 12.5px; }
input, select { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 7px 10px; min-height: 36px; max-width: 100%; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.field.grow { flex: 3; }
.btn { font: inherit; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 36px; padding: 7px 14px; border-radius: 6px; border: 1px solid var(--c1); background: var(--c1); color: var(--surface); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); font-weight: 500; }
.btn.danger { background: transparent; color: var(--bad); border-color: var(--bad); }
.btn.ok { background: var(--good); border-color: var(--good); }
.btn.big { min-height: 48px; font-size: 16px; }
.btn.sm { min-height: 28px; padding: 3px 10px; font-size: 12.5px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.link { all: unset; cursor: pointer; text-decoration: underline; }
:is(.btn, input, select, button, summary, .link):focus-visible { outline: 2px solid var(--c1); outline-offset: 2px; }
.msg { font-size: 13px; padding: 8px 10px; border-radius: 6px; border: 1px solid var(--line); }
.msg.err { color: var(--bad); border-color: var(--bad); }
.msg.ok { color: var(--good); border-color: var(--good); }

.login { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; background: var(--navy); }
.loginbox { width: min(380px, 100%); background: var(--surface); border-radius: 12px; padding: 28px 24px; display: flex; flex-direction: column; gap: 14px; }

.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100%; }
.side { background: var(--navy); color: #dfe8ee; padding: 18px 14px; display: flex; flex-direction: column; gap: 16px; position: sticky; top: 0; height: 100vh; }
.side .field { flex: none; }
.side .field > span { color: #8ea3b3; }
.side select, .side input { background: #1b2b38; color: #e5ecf0; border-color: #2a3c4a; }
.brand b { display: block; font-family: var(--fd); font-size: 28px; letter-spacing: .04em; color: #f0a24c; }
.brand span { font-family: var(--fm); font-size: 10.5px; color: #8ea3b3; text-transform: uppercase; letter-spacing: .08em; }
.navlist { display: flex; flex-direction: column; gap: 4px; }
.navlist button { all: unset; cursor: pointer; padding: 10px 12px; border-radius: 8px; font-weight: 500; }
.navlist button:hover { background: #1b2b38; }
.navlist button[aria-selected="true"] { background: #e5ecf0; color: var(--navy); font-weight: 600; }
.navlist button:focus-visible { outline: 2px solid #3dbfb6; }
.sidefoot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; font-size: 12.5px; }
.who { color: #8ea3b3; } .who .link { color: #dfe8ee; }
.conn { display: flex; align-items: center; gap: 8px; color: #8ea3b3; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #5b6b78; }
.dot.on { background: #4cc38a; } .dot.off { background: #ff7b72; }

.main { padding: 20px max(16px, 2vw) 40px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.tela { display: flex; flex-direction: column; gap: 14px; }
.pagehead { display: flex; flex-wrap: wrap; gap: 12px 20px; justify-content: space-between; align-items: flex-end; }
.acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.phead { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.grid2 { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); align-items: start; }
@media (min-width: 1100px) { .grid2.wide { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); } }
.list { display: flex; flex-direction: column; gap: 6px; }
.item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; }
.item b { font-weight: 600; } .item small { display: block; color: var(--muted); }

.tipos { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.tipos label { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; cursor: pointer; font-weight: 600; display: flex; gap: 8px; align-items: center; }
.tipos label:has(input:checked) { border-color: var(--c1); background: color-mix(in srgb, var(--c1) 12%, transparent); }
.tipos input { accent-color: var(--c1); }

.screen { border: 3px solid var(--line); border-radius: 12px; background: var(--surface-2); min-height: 250px; padding: 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; }
.screen .st { font-family: var(--fd); font-weight: 700; font-size: clamp(40px, 6.4vw, 92px); line-height: .95; text-transform: uppercase; overflow-wrap: anywhere; }
.screen .who2 { font-family: var(--fd); font-weight: 700; font-size: clamp(22px, 3vw, 34px); text-transform: uppercase; }
.screen .sub { color: var(--muted); font-size: 15px; }
.screen.ok { border-color: var(--good); background: color-mix(in srgb, var(--good) 12%, var(--surface)); } .screen.ok .st { color: var(--good); }
.screen.N { border-color: var(--N); background: color-mix(in srgb, var(--N) 12%, var(--surface)); } .screen.N .st { color: var(--N); }
.screen.C { border-color: var(--C); background: color-mix(in srgb, var(--C) 13%, var(--surface)); } .screen.C .st { color: var(--C); }
.screen.S { border-color: var(--S); background: color-mix(in srgb, var(--S) 12%, var(--surface)); } .screen.S .st { color: var(--S); }
.screen.warn { border-color: var(--warn); background: color-mix(in srgb, var(--warn) 13%, var(--surface)); } .screen.warn .st { color: var(--warn); }
.screen.bad { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, var(--surface)); } .screen.bad .st { color: var(--bad); }
.screen.wait .st { color: var(--muted); }
.scan { display: flex; gap: 8px; flex-wrap: wrap; }
.scan input { flex: 1; min-width: 200px; font-family: var(--fm); font-size: 17px; min-height: 48px; }
.scan select, .scan .btn { min-height: 48px; }
.kpirow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.kpirow div { background: var(--surface-2); border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; }
.kpirow b { font-family: var(--fd); font-size: 36px; line-height: 1; }
.bad { color: var(--bad); }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 10px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--c1); border-radius: 10px; padding: 10px 14px 12px; display: flex; flex-direction: column; }
.kpi b { font-family: var(--fd); font-size: 40px; line-height: 1; font-variant-numeric: tabular-nums; }
.kpi.w { border-top-color: var(--warn); } .kpi.b { border-top-color: var(--bad); } .kpi.g { border-top-color: var(--good); } .kpi.o { border-top-color: var(--c2); }

.tablewrap { overflow: auto; border: 1px solid var(--line); border-radius: 8px; max-height: 480px; }
.tablewrap.tall { max-height: 62vh; }
table { border-collapse: collapse; width: 100%; }
th, td { padding: 7px 10px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; font-variant-numeric: tabular-nums; vertical-align: top; }
td.wrap, td.st { white-space: normal; min-width: 150px; }
thead th { position: sticky; top: 0; background: var(--surface-2); font-family: var(--fm); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 500; z-index: 1; }
.num { text-align: right; }
.code { font-family: var(--fm); font-size: 12.5px; }
tbody tr:hover > * { background: var(--surface-2); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 1px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.ok, .pill.liberado { color: var(--good); background: color-mix(in srgb, var(--good) 14%, transparent); }
.pill.sem_info, .pill.forcado, .pill.aberto { color: var(--warn); background: color-mix(in srgb, var(--warn) 16%, transparent); }
.pill.fora_rota, .pill.duplicado, .pill.cancelado { color: var(--bad); background: color-mix(in srgb, var(--bad) 13%, transparent); }
.tag { font-family: var(--fm); font-size: 11px; padding: 1px 7px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--line); }
.tag.N { color: var(--N); } .tag.C { color: var(--C); } .tag.S { color: var(--S); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border: 1px solid var(--line); background: var(--surface-2); border-radius: 999px; font-size: 12.5px; }
.chip button { all: unset; cursor: pointer; color: var(--muted); padding: 0 3px; }
.codes { font-family: var(--fm); font-size: 12px; color: var(--muted); max-height: 300px; overflow: auto; line-height: 1.8; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tabs button { font: inherit; font-weight: 500; color: var(--muted); background: none; border: 0; border-bottom: 3px solid transparent; margin-bottom: -1px; padding: 9px 14px; cursor: pointer; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--c1); }
.sw { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
details.panel summary { cursor: pointer; font-weight: 600; }
dialog { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); padding: 0; width: min(900px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(5, 12, 18, .55); }
.dlg { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 12px; }
.x { all: unset; cursor: pointer; font-size: 24px; color: var(--muted); padding: 0 6px; }
.toast { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); background: var(--ink); color: var(--surface); padding: 10px 16px; border-radius: 8px; font-weight: 500; z-index: 50; }
body.noadm .adm { display: none !important; }
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; }
  .navlist { flex-direction: row; flex-wrap: wrap; }
  .sidefoot { margin-top: 0; }
}
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.tile { border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; display: flex; flex-direction: column; background: var(--surface-2); }
.tile b { font-family: var(--fd); font-size: 22px; line-height: 1; }
.tile small { color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile.N { border-left: 4px solid var(--N); } .tile.C { border-left: 4px solid var(--C); } .tile.S { border-left: 4px solid var(--S); }
.tile.ult { outline: 2px solid var(--c1); }
.offbox { background: #3a2a10; color: #f0c674; border: 1px solid #6b4e1a; border-radius: 8px; padding: 8px 10px; font-size: 12.5px; }
.offbox b { color: #ffd98a; }
.pill.local { color: var(--warn); background: color-mix(in srgb, var(--warn) 16%, transparent); }
.brand .logo { background: #fff; border-radius: 10px; padding: 8px 10px; display: grid; place-items: center; }
.brand .logo img { width: 100%; height: auto; display: block; }
.brand span { display: block; margin-top: 6px; }
.loginlogo { width: 100%; max-width: 300px; height: auto; align-self: center; }
