/* Accist Atta — tokens e componentes da área logada e do master (escuro, família SINAPSE). */
:root {
  color-scheme: dark;
  --bg: #071014; --side: #0b161b; --panel: #0e1a1f; --panel2: #13232a; --line: #1f343c;
  --ink: #e6eef1; --muted: #8fa3ad; --teal: #2bc5da; --teal-ink: #04262c; --violet: #a99bea;
  --ok: #4ade80; --ok-bg: #0f2618; --warn: #fbbf24; --warn-bg: #2a200b; --bad: #f87171; --bad-bg: #2d1313; --info: #8db7ff; --info-bg: #132544;
  --display: "Archivo", system-ui, sans-serif; --sans: "IBM Plex Sans", system-ui, "Segoe UI", sans-serif; --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
}
* { box-sizing: border-box }
html, body { height: 100% }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.55 var(--sans) }
a { color: var(--teal); text-decoration: none } a:hover { text-decoration: underline }
h1, h2, h3, h4 { font-family: var(--display); margin: 0; line-height: 1.25; text-wrap: balance }
code, .mono { font-family: var(--mono); font-size: 12.5px }
button, input, select, textarea { font: inherit; color: inherit }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px }

/* Moldura: barra de cima + menu lateral retrátil (ícones) + conteúdo; no celular o menu vira gaveta. */
.shell { display: grid; grid-template-columns: 228px 1fr; grid-template-rows: 56px 1fr; grid-template-areas: "top top" "side main"; min-height: 100%; transition: grid-template-columns .18s ease }
.shell.min { grid-template-columns: 64px 1fr }
.topbar { grid-area: top; position: sticky; top: 0; z-index: 36; display: flex; align-items: center; gap: 10px; padding: 0 14px 0 10px; background: var(--side); border-bottom: 1px solid var(--line) }
.topbar .brand { padding: 0 4px }
.topbar .spacer { flex: 1 }
.brand .tag { font: 600 10px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: #f0b46b; border: 1px solid #5a4325; border-radius: 999px; padding: 1px 7px; align-self: center }
.iconbtn { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 8px; border: 0; background: none; color: var(--muted); cursor: pointer }
.iconbtn:hover { background: var(--panel); color: var(--ink) }
.ic { width: 20px; height: 20px; flex: none }
.ic.sm { width: 14px; height: 14px }
.orgname { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 28vw }
.topbar select { background: var(--panel); border: 1px solid var(--line); border-radius: 7px; padding: 5px 8px; max-width: 28vw }
.usermenu { position: relative }
.userbtn { display: flex; align-items: center; gap: 8px; border: 1px solid transparent; background: none; border-radius: 999px; padding: 3px 10px 3px 3px; cursor: pointer; color: var(--ink) }
.userbtn:hover, .userbtn[aria-expanded="true"] { background: var(--panel); border-color: var(--line) }
.avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--teal), var(--violet)); color: #071014; font: 700 12.5px var(--sans) }
.uname { font-size: 13px; max-width: 160px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.dropdown { position: absolute; right: 0; top: calc(100% + 6px); min-width: 230px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 16px 40px -12px #000; padding: 6px; z-index: 40; display: flex; flex-direction: column }
.dropdown[hidden] { display: none }
.dropdown .who { display: flex; flex-direction: column; padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; font-size: 12px; color: var(--muted) }
.dropdown .who b { color: var(--ink); font-size: 13.5px }
.dropdown a { padding: 8px 10px; border-radius: 7px; color: var(--ink) }
.dropdown a:hover { background: var(--panel2); text-decoration: none }
.side { grid-area: side; background: var(--side); border-right: 1px solid var(--line); padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 56px; height: calc(100vh - 56px); overflow-y: auto; overflow-x: hidden }
.nav { display: flex; align-items: center; gap: 12px; padding: 9px 11px; border-radius: 8px; color: var(--muted); cursor: pointer; white-space: nowrap }
.nav .lbl { flex: 1; overflow: hidden; text-overflow: ellipsis }
.nav:hover { background: var(--panel); color: var(--ink); text-decoration: none }
.nav.on { background: var(--panel2); color: var(--ink) }
.nav.on .ic { color: var(--teal) }
.shell.min .nav { justify-content: center; padding: 9px 0; position: relative }
.shell.min .nav .lbl { display: none }
.shell.min .nav .badge { position: absolute; top: 2px; right: 6px; padding: 0 5px }
.scrim { display: none }
.brand { display: flex; align-items: baseline; gap: 6px; padding: 2px 8px 16px }
.brand small { font: 600 12px var(--sans); color: var(--muted) }
.brand b { font: 800 24px var(--display); letter-spacing: -.04em; background: linear-gradient(100deg, var(--teal), var(--violet)); -webkit-background-clip: text; background-clip: text; color: transparent }
.brand.master b { background: linear-gradient(100deg, #f0b46b, var(--violet)); -webkit-background-clip: text; background-clip: text }
.badge { font: 500 10.5px var(--mono); background: var(--violet); color: #140f2e; border-radius: 999px; padding: 0 7px }

main { grid-area: main; padding: 22px 26px 60px; min-width: 0 }
.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap }
.top h1 { font-size: 22px; font-weight: 700 }
.sub { color: var(--muted); font-size: 12.5px; margin-top: 3px }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px }

.btn { display: inline-flex; align-items: center; gap: 6px; font: 500 13px var(--sans); padding: 7px 13px; border-radius: 7px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); cursor: pointer; white-space: nowrap }
.btn:hover { border-color: #2e4b55; text-decoration: none }
.btn.pri { background: var(--teal); border-color: var(--teal); color: var(--teal-ink); font-weight: 600 }
.btn.vio { border-color: var(--violet); color: var(--violet); background: transparent }
.btn.danger { border-color: #6b2a2a; color: #ff9b9b }
.btn.sm { padding: 4px 9px; font-size: 12px }
.btn:disabled { opacity: .5; cursor: default }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px }
.panel h3 { font: 600 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px }
.stat b { display: block; font: 700 22px var(--display); font-variant-numeric: tabular-nums }
.stat span { font: 500 11px var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .05em }

.tbl { width: 100%; border-collapse: collapse; font-size: 13px }
.tblwrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--panel) }
.tbl th { text-align: left; color: var(--muted); font: 500 10.5px var(--mono); text-transform: uppercase; letter-spacing: .05em; padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap }
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle }
.tbl tr:last-child td { border-bottom: 0 }
.tbl tr.click { cursor: pointer } .tbl tr.click:hover td { background: #102028 }
.tbl td.m { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap }
.small { font-size: 12px; color: var(--muted) }

.chip { font: 500 11.5px var(--mono); padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); cursor: pointer; background: none }
.chip.on { border-color: var(--teal); color: var(--teal) }
.pill { display: inline-block; font: 500 10.5px var(--mono); padding: 2px 8px; border-radius: 999px; white-space: nowrap; background: var(--panel2); color: var(--ink) }
.pill.ok { background: var(--ok-bg); color: var(--ok) } .pill.warn { background: var(--warn-bg); color: var(--warn) } .pill.bad { background: var(--bad-bg); color: var(--bad) } .pill.info { background: var(--info-bg); color: var(--info) } .pill.vio { background: #211d3a; color: var(--violet) }
.pill.live::before { content: "● "; animation: blink 1.4s infinite }
@keyframes blink { 50% { opacity: .25 } }
@media (prefers-reduced-motion: reduce) { .pill.live::before { animation: none } }

label.f { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted) }
input.i, select.i, textarea.i { background: var(--bg); border: 1px solid var(--line); border-radius: 7px; padding: 8px 10px; color: var(--ink); width: 100%; font-size: 13.5px }
textarea.i { min-height: 80px; resize: vertical }
input.i:focus, select.i:focus, textarea.i:focus { border-color: var(--teal); outline: none }
.check { display: flex; gap: 8px; align-items: center; font-size: 13px; cursor: pointer }

.center { min-height: 100%; display: grid; place-items: center; padding: 24px 16px }
.card { width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 24px; display: flex; flex-direction: column; gap: 12px }
.card .brand { padding: 0 }
.err { background: var(--bad-bg); color: var(--bad); border-radius: 7px; padding: 8px 10px; font-size: 13px }
.note { background: var(--info-bg); color: var(--info); border-radius: 7px; padding: 8px 10px; font-size: 13px }
.empty { color: var(--muted); text-align: center; padding: 34px 10px; font-size: 13.5px }
.toast { position: fixed; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); right: 18px; background: var(--panel2); border: 1px solid var(--line); border-radius: 9px; padding: 10px 14px; font-size: 13px; z-index: 50; box-shadow: 0 10px 30px -10px #000; max-width: 380px }
.toast.bad { border-color: #6b2a2a }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap }
.tabs a { padding: 8px 12px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px }
.tabs a.on { color: var(--ink); border-bottom-color: var(--teal); text-decoration: none }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13px } .kv dt { color: var(--muted) } .kv dd { margin: 0 }
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: grid; place-items: center; z-index: 40; padding: 16px }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 20px; width: 100%; max-width: 520px; max-height: 90vh; overflow: auto; display: flex; flex-direction: column; gap: 12px }

@media (max-width: 860px) {
  .shell, .shell.min { grid-template-columns: 1fr; grid-template-areas: "top" "main" }
  .side { grid-area: auto; position: fixed; top: 56px; left: 0; bottom: 0; width: 260px; height: auto; z-index: 35; transform: translateX(-100%); transition: transform .2s ease; box-shadow: 12px 0 40px -20px #000 }
  .shell.open .side { transform: none }
  .shell.min .nav { justify-content: flex-start; padding: 9px 11px }
  .shell.min .nav .lbl { display: inline }
  .shell.min .nav .badge { position: static }
  .shell.open .scrim { display: block; position: fixed; inset: 56px 0 0 0; background: rgba(0,0,0,.5); z-index: 34 }
  .uname, .orgname { display: none }
  main { padding: 16px 14px 50px }
  .top h1 { font-size: 19px }
  .grid2, .grid3 { grid-template-columns: 1fr }
  .modal { padding: 16px }
}
@media (prefers-reduced-motion: reduce) { .shell, .side { transition: none } }
