/* Tema escuro, mesmos tokens dos outros painéis do grupo (menu-gateway/kiosk),
   para os sistemas parecerem a mesma família. Sem framework, sem build. */
:root {
  --bg: #0f1420;
  --panel: #1a2130;
  --panel-2: #222b3d;
  --line: #2d3852;
  --text: #e6ebf5;
  --muted: #8a97b0;
  --accent: #3b82f6;
  --green: #22c55e;
  --yellow: #eab308;
  --red: #ef4444;
  --orange: #f59e0b;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}
header {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .9rem 1.1rem; background: var(--panel); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.brand { display: flex; align-items: center; gap: .55rem; }
.brand .dot { width: 11px; height: 11px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
h1 { font-size: 1.1rem; margin: 0; }
h2 { font-size: 1.05rem; margin: 0 0 .6rem; }
h3 { margin: 1.2rem 0 .4rem; color: var(--muted); font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; }
.sub { color: var(--muted); font-size: .84rem; }
main { max-width: 860px; margin: 0 auto; padding: 1rem 1rem 5rem; }

input, select, button, textarea {
  font: inherit; padding: .6rem .7rem; border-radius: 9px;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text);
}
input, select, textarea { width: 100%; }
textarea { min-height: 90px; resize: vertical; }
button { background: var(--accent); border-color: var(--accent); cursor: pointer; font-weight: 600; width: auto; }
button:hover { filter: brightness(1.1); }
button.ghost { background: transparent; border-color: var(--line); color: var(--text); font-weight: 500; }
button.danger { background: transparent; border-color: var(--red); color: #fca5a5; font-weight: 500; }
button:disabled { opacity: .5; cursor: not-allowed; }
label { display: block; font-size: .8rem; color: var(--muted); margin: .7rem 0 .2rem; }

#entrada { max-width: 380px; margin: 14vh auto; display: grid; gap: .9rem; padding: 0 1rem; text-align: center; }

.tabs { display: flex; gap: .4rem; margin-bottom: 1rem; flex-wrap: wrap; }
.tabs button { background: transparent; border-color: var(--line); color: var(--muted); font-weight: 500; }
.tabs button.on { background: var(--panel-2); color: var(--text); border-color: var(--accent); }

.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: .85rem .95rem; margin-bottom: .6rem;
}
.card.clic { cursor: pointer; }
.card.clic:hover { border-color: var(--accent); }
.linha { display: flex; align-items: center; gap: .6rem; justify-content: space-between; }
.grid { display: grid; gap: .6rem; grid-template-columns: 1fr 1fr; }
@media (max-width: 560px) { .grid { grid-template-columns: 1fr; } }

.pill {
  display: inline-block; padding: .16rem .5rem; border-radius: 999px;
  font-size: .72rem; font-weight: 600; border: 1px solid var(--line); color: var(--muted);
  white-space: nowrap;
}
.pill.aberto        { color: #93c5fd; border-color: #1d4ed8; }
.pill.triagem       { color: #c4b5fd; border-color: #6d28d9; }
.pill.em_andamento  { color: #fde68a; border-color: #a16207; }
.pill.aguardando    { color: #fdba74; border-color: #c2410c; }
.pill.resolvido     { color: #86efac; border-color: #15803d; }
.pill.fechado       { color: var(--muted); }
.pill.cancelado     { color: #fca5a5; border-color: #b91c1c; }
.pill.critica { color: #fca5a5; border-color: var(--red); }
.pill.alta    { color: #fdba74; border-color: var(--orange); }
.pill.media   { color: #93c5fd; border-color: var(--accent); }
.pill.baixa   { color: var(--muted); }
.pill.atrasado { color: #fca5a5; border-color: var(--red); background: rgba(239,68,68,.1); }

.proto { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); font-size: .8rem; }

/* Timeline */
.ev { border-left: 2px solid var(--line); padding: .1rem 0 .9rem .8rem; margin-left: .35rem; position: relative; }
.ev::before {
  content: ''; position: absolute; left: -5px; top: .35rem;
  width: 8px; height: 8px; border-radius: 50%; background: var(--line);
}
.ev.interno { border-left-color: var(--yellow); }
.ev.interno::before { background: var(--yellow); }
.ev .quem { font-size: .78rem; color: var(--muted); }
.ev .texto { margin-top: .15rem; white-space: pre-wrap; }
.tag-interno { color: var(--yellow); font-size: .7rem; font-weight: 700; }
.tag-bot { color: #a5b4fc; font-size: .7rem; font-weight: 700; }

.toast {
  position: fixed; left: 50%; bottom: 1.2rem; transform: translateX(-50%);
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
  padding: .6rem .9rem; border-radius: 10px; z-index: 50; max-width: 90vw;
}
.toast.ok  { border-color: var(--green); }
.toast.err { border-color: var(--red); }
.empty { color: var(--muted); text-align: center; padding: 2rem 1rem; }
.acoes { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .7rem; }
[hidden] { display: none !important; }
