/* ==========================================================================
   Portal Invictus Dev — folha de estilo unica (sem build, sem CDN)
   Ordem: 1 tokens · 2 base · 3 utilitarios · 4 casca (sidebar/topo/relogios)
          5 componentes · 6 telas de login/MF2 · 7 animacoes · 8 celular
   ========================================================================== */

/* ------------------------------------------------- 1. tokens (cores etc.) */
:root {
  --bg:        #0B0F1A;
  --bg-2:      #0E1422;
  --bg-3:      #141C2D;
  --bg-4:      #1A2439;
  --line:      rgba(255, 255, 255, .075);
  --line-2:    rgba(255, 255, 255, .14);
  --text:      #E9EDF5;
  --text-2:    #AEB9CC;
  --muted:     #7E8AA0;
  --brand:     #245EE3;
  --brand-2:   #4C82FF;
  --brand-3:   #71A3FF;
  --brand-dim: rgba(36, 94, 227, .14);
  --ok:        #2BB673;
  --ok-dim:    rgba(43, 182, 115, .13);
  --warn:      #E9A23B;
  --warn-dim:  rgba(233, 162, 59, .14);
  --err:       #E4574C;
  --err-dim:   rgba(228, 87, 76, .14);
  --radius:    14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --sidebar-w: 256px;
  --sidebar-w-min: 74px;
  --topbar-h:  62px;
  --shadow:    0 1px 2px rgba(0,0,0,.3), 0 8px 28px -8px rgba(0,0,0,.55);
  --shadow-lg: 0 24px 64px -16px rgba(0,0,0,.7);
  --font:      'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono:      'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --ease:      cubic-bezier(.22, .61, .36, 1);
}

/* ------------------------------------------------------------- 2. base */
*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* fundo com brilho discreto, sem atrapalhar a leitura */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(900px 520px at 12% -8%,  rgba(36, 94, 227, .16), transparent 70%),
    radial-gradient(700px 460px at 98% 4%,   rgba(113, 163, 255, .08), transparent 70%);
}

h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.02em; line-height: 1.25; }
h1 { font-size: 1.45rem; }
h2 { font-size: 1.12rem; }
h3 { font-size: 1rem; }
p  { margin: 0 0 .7em; }
p:last-child { margin-bottom: 0; }

a { color: var(--brand-3); text-decoration: none; }
a:hover { color: #9CC0FF; }

hr { border: 0; border-top: 1px solid var(--line); margin: 1.1rem 0; }

::selection { background: rgba(36, 94, 227, .38); }

:focus-visible {
  outline: 2px solid var(--brand-2);
  outline-offset: 2px;
  border-radius: 6px;
}

/* barra de rolagem discreta (desktop) */
@media (pointer: fine) {
  * { scrollbar-width: thin; scrollbar-color: var(--bg-4) transparent; }
  *::-webkit-scrollbar { width: 9px; height: 9px; }
  *::-webkit-scrollbar-track { background: transparent; }
  *::-webkit-scrollbar-thumb { background: var(--bg-4); border-radius: 8px; }
  *::-webkit-scrollbar-thumb:hover { background: #24304a; }
}

/* ------------------------------------------------------ 3. utilitarios */
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.dim { color: var(--text-2); }
.small { font-size: .82rem; }
.tiny { font-size: .74rem; }
.strong { font-weight: 700; }
.upper { text-transform: uppercase; letter-spacing: .08em; }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.hidden { display: none !important; }
.row { display: flex; align-items: center; gap: .6rem; }
.row-wrap { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.between { display: flex; align-items: center; justify-content: space-between; gap: .8rem; }
.col { display: flex; flex-direction: column; gap: .6rem; }
.grow { flex: 1 1 auto; min-width: 0; }
.gap-sm { gap: .4rem; }
.gap-lg { gap: 1rem; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2rem; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.icon { width: 18px; height: 18px; flex: none; stroke-width: 1.8; }
.icon-sm { width: 15px; height: 15px; flex: none; stroke-width: 1.9; }

/* ------------------------------------- 4. casca: sidebar, topo, relogios */
.app {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100dvh;
}
.app.is-narrow { --sidebar-w: var(--sidebar-w-min); }

/* --- sidebar --- */
.sidebar {
  grid-column: 1;
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #0C121F, #0A0F1B);
  border-right: 1px solid var(--line);
  z-index: 40;
}
.sidebar__brand {
  display: grid;
  place-items: center;
  height: var(--topbar-h);
  padding: .55rem;
  border-bottom: 1px solid var(--line);
  flex: none;
}
.sidebar__brand a {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: .3rem;
  border-radius: var(--radius-sm);
  transition: background .16s var(--ease);
}
.sidebar__brand a:hover { background: rgba(255, 255, 255, .05); }
/* A logo ocupa ~70% da largura da sidebar, centralizada, com folga igual
   dos quatro lados. A altura do topo limita para não estourar. */
.sidebar__brand img {
  width: 70%;
  max-width: 70%;
  max-height: calc(var(--topbar-h) - 1.7rem);
  height: auto;
  object-fit: contain;
  display: block;
}
.sidebar__brand .mark {
  width: 34px;
  height: 34px;
  max-width: none;
  display: none;
}
.app.is-narrow .sidebar__brand img { display: none; }
.app.is-narrow .sidebar__brand .mark { display: block; }
.app.is-narrow .sidebar__brand { padding: .5rem; }

.sidebar__nav {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: .75rem .6rem 1rem;
}
.nav-group { margin-bottom: .2rem; }
.nav-group__title {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: #5D6980;
  font-weight: 700;
  padding: .9rem .65rem .35rem;
}
.app.is-narrow .nav-group__title { text-align: center; font-size: .6rem; padding: .8rem 0 .3rem; }

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: .68rem;
  padding: .58rem .65rem;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: .89rem;
  font-weight: 600;
  transition: background .16s var(--ease), color .16s var(--ease);
}
.nav-link:hover { background: rgba(255,255,255,.045); color: var(--text); }
.nav-link .icon { color: #6C7A93; transition: color .16s var(--ease); }
.nav-link:hover .icon { color: var(--brand-3); }
.nav-link.is-active { background: var(--brand-dim); color: #DCE7FF; }
.nav-link.is-active .icon { color: var(--brand-3); }
.nav-link.is-active::before {
  content: '';
  position: absolute;
  left: -.6rem;
  top: 50%;
  translate: 0 -50%;
  width: 3px;
  height: 20px;
  border-radius: 0 3px 3px 0;
  background: var(--brand-2);
}
.nav-link__badge {
  margin-left: auto;
  font-family: var(--mono);
  font-size: .68rem;
  font-weight: 700;
  padding: .06rem .38rem;
  border-radius: 99px;
  background: var(--bg-4);
  color: var(--text-2);
}
.nav-link.is-soon { opacity: .42; cursor: default; }
.nav-link.is-soon:hover { background: none; color: var(--text-2); }
.app.is-narrow .nav-link { justify-content: center; padding: .6rem 0; }
.app.is-narrow .nav-link__text,
.app.is-narrow .nav-link__badge { display: none; }
.app.is-narrow .nav-link.is-active::before { left: 0; }

.sidebar__foot {
  flex: none;
  padding: .6rem;
  border-top: 1px solid var(--line);
}

/* --- topo --- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: .7rem;
  height: var(--topbar-h);
  padding: 0 1.1rem;
  background: rgba(11, 15, 26, .82);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.topbar__title { font-size: 1rem; font-weight: 700; letter-spacing: -.01em; }
.topbar__sub { font-size: .72rem; color: var(--muted); }
.topbar__spacer { flex: 1 1 auto; }

.icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.028);
  color: var(--text-2);
  cursor: pointer;
  transition: background .16s var(--ease), color .16s var(--ease), border-color .16s;
}
.icon-btn:hover { background: rgba(255,255,255,.07); color: var(--text); border-color: var(--line-2); }
.icon-btn.is-on { background: var(--brand-dim); border-color: rgba(76,130,255,.36); color: #CFE0FF; }

.bell-dot {
  position: absolute;
  top: 4px; right: 4px;
  min-width: 17px; height: 17px;
  padding: 0 4px;
  display: grid; place-items: center;
  font-family: var(--mono);
  font-size: .62rem; font-weight: 700;
  color: #fff;
  background: var(--err);
  border: 2px solid #0B0F1A;
  border-radius: 99px;
}

/* --- barra de relogios --- */
.clocks { display: flex; align-items: center; gap: .3rem; }
.clock {
  display: flex;
  align-items: center;
  gap: .45rem;
  padding: .3rem .55rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(255,255,255,.022);
  white-space: nowrap;
}
.clock__icon {
  width: 22px; height: 22px; flex: none;
  display: grid; place-items: center;
  border-radius: 6px;
  background: var(--bg-4);
  color: var(--brand-3);
}
.clock__icon .icon-sm { width: 13px; height: 13px; }
.clock__body { display: flex; flex-direction: column; line-height: 1.12; }
.clock__city {
  font-size: .6rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em;
  color: var(--muted);
}
.clock__time {
  font-family: var(--mono);
  font-size: .86rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
  color: var(--text);
}
.clock__time .sep { animation: pisca 2s steps(1, end) infinite; }
.clock--dia .clock__icon { color: var(--warn); }
.clock--noite .clock__icon { color: var(--brand-3); }

/* --- conteudo --- */
.main { grid-column: 2; display: flex; flex-direction: column; min-width: 0; }
.content {
  flex: 1 1 auto;
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 1.35rem 1.35rem 3rem;
}
.page-head { margin-bottom: 1.25rem; }
.page-head h1 { margin-bottom: .2rem; }
.page-head p { color: var(--muted); font-size: .88rem; }

/* ------------------------------------------------------ 5. componentes */
.card {
  background: linear-gradient(180deg, rgba(255,255,255,.028), rgba(255,255,255,.012));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card__head {
  display: flex; align-items: center; gap: .6rem;
  padding: .9rem 1.05rem;
  border-bottom: 1px solid var(--line);
}
.card__head h2, .card__head h3 { font-size: .95rem; }
.card__body { padding: 1.05rem; }
.card__foot {
  padding: .8rem 1.05rem;
  border-top: 1px solid var(--line);
  background: rgba(0,0,0,.16);
  border-radius: 0 0 var(--radius) var(--radius);
}
.card--flat { box-shadow: none; background: rgba(255,255,255,.02); }

/* metrica do painel */
.stat { position: relative; overflow: hidden; }
.stat__label {
  font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em;
  color: var(--muted);
}
.stat__value {
  font-family: var(--mono);
  font-size: 1.7rem; font-weight: 700;
  letter-spacing: -.035em;
  line-height: 1.1;
  margin-top: .3rem;
}
.stat__hint { font-size: .76rem; color: var(--muted); margin-top: .25rem; }
.stat__icon {
  position: absolute; top: .9rem; right: .95rem;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: var(--radius-sm);
  background: var(--brand-dim);
  color: var(--brand-3);
}

/* botoes */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .45rem;
  padding: .58rem 1rem;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: .875rem; font-weight: 700;
  color: var(--text);
  background: var(--bg-4);
  cursor: pointer;
  text-align: center;
  transition: filter .16s var(--ease), background .16s var(--ease),
              border-color .16s var(--ease), transform .08s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { filter: brightness(1.14); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.btn--primary {
  background: linear-gradient(180deg, var(--brand-2), var(--brand));
  color: #fff;
  box-shadow: 0 1px 0 rgba(255,255,255,.14) inset, 0 8px 22px -10px rgba(36,94,227,.9);
}
.btn--ghost { background: transparent; border-color: var(--line-2); color: var(--text-2); }
.btn--ghost:hover { background: rgba(255,255,255,.05); color: var(--text); }
.btn--danger { background: transparent; border-color: rgba(228,87,76,.42); color: #FF9E96; }
.btn--danger:hover { background: var(--err-dim); }
.btn--ok { background: transparent; border-color: rgba(43,182,115,.42); color: #6EE7AE; }
.btn--ok:hover { background: var(--ok-dim); }
.btn--sm { padding: .34rem .68rem; min-height: 34px; font-size: .8rem; }
.btn--block { width: 100%; }
.btn--lg { min-height: 50px; font-size: .95rem; padding: .7rem 1.3rem; }

/* formulario */
.field { display: flex; flex-direction: column; gap: .35rem; margin-bottom: 1rem; }
.field > label, .label {
  font-size: .8rem; font-weight: 700; color: var(--text-2);
}
.field__help { font-size: .76rem; color: var(--muted); }
.field__error { font-size: .78rem; color: #FF9E96; font-weight: 600; }
.input, .select, .textarea {
  width: 100%;
  padding: .62rem .8rem;
  min-height: 44px;
  font-family: inherit;
  font-size: .92rem;
  color: var(--text);
  background: rgba(0,0,0,.28);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease), background .16s;
  -webkit-appearance: none;
  appearance: none;
}
.input::placeholder, .textarea::placeholder { color: #5C6880; }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--brand-2);
  background: rgba(0,0,0,.4);
  box-shadow: 0 0 0 3px rgba(36,94,227,.2);
}
.input[aria-invalid="true"] { border-color: var(--err); }
.textarea { min-height: 96px; resize: vertical; line-height: 1.55; }
.select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237E8AA0' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .6rem center;
  background-size: 17px;
  padding-right: 2.2rem;
}
.input-group { display: flex; align-items: stretch; }
.input-group .input { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group__suffix {
  display: inline-flex; align-items: center;
  padding: 0 .7rem;
  font-size: .78rem; color: var(--muted);
  background: rgba(255,255,255,.035);
  border: 1px solid var(--line-2);
  border-left: 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  white-space: nowrap;
}
.input-group__prefix {
  display: inline-flex; align-items: center;
  padding: 0 .7rem;
  font-size: .82rem; font-weight: 700; color: var(--text-2);
  background: rgba(255,255,255,.035);
  border: 1px solid var(--line-2);
  border-right: 0;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}
.input-group__prefix + .input { border-radius: 0; }
.input-group__prefix + .input:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

/* interruptor liga/desliga */
.switch { display: flex; align-items: flex-start; gap: .7rem; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch__track {
  position: relative;
  width: 44px; height: 25px; flex: none;
  margin-top: 1px;
  border-radius: 99px;
  background: var(--bg-4);
  border: 1px solid var(--line-2);
  transition: background .2s var(--ease), border-color .2s var(--ease);
}
.switch__track::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 19px; height: 19px;
  border-radius: 50%;
  background: #8794AB;
  transition: translate .2s var(--ease), background .2s var(--ease);
}
.switch input:checked + .switch__track { background: var(--brand); border-color: var(--brand-2); }
.switch input:checked + .switch__track::after { translate: 19px 0; background: #fff; }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--brand-2); outline-offset: 2px; }
.switch__text { display: flex; flex-direction: column; gap: .1rem; }
.switch__text b { font-size: .86rem; font-weight: 700; }
.switch__text span { font-size: .76rem; color: var(--muted); }

/* caixa de selecao */
.check { display: flex; align-items: flex-start; gap: .6rem; cursor: pointer; }
.check input { position: absolute; opacity: 0; width: 0; height: 0; }
.check__box {
  width: 21px; height: 21px; flex: none;
  margin-top: 1px;
  border: 1.6px solid var(--line-2);
  border-radius: 6px;
  background: rgba(0,0,0,.3);
  display: grid; place-items: center;
  transition: background .15s var(--ease), border-color .15s var(--ease);
}
.check__box svg { width: 13px; height: 13px; opacity: 0; scale: .6; transition: all .15s var(--ease); color: #fff; }
.check input:checked + .check__box { background: var(--brand); border-color: var(--brand-2); }
.check input:checked + .check__box svg { opacity: 1; scale: 1; }
.check input:focus-visible + .check__box { outline: 2px solid var(--brand-2); outline-offset: 2px; }
.check__text { display: flex; flex-direction: column; gap: .05rem; min-width: 0; }
.check__text b { font-size: .85rem; font-weight: 700; }
.check__text span { font-size: .75rem; color: var(--muted); }

/* escolher arquivo — botao proprio, em portugues.
   O <input type=file> de verdade fica escondido atras; assim o texto nao
   depende do idioma do navegador ("Choose file" / "Bestand kiezen"). */
.arquivo { display: flex; flex-direction: column; gap: .5rem; }
.arquivo input[type="file"] {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.arquivo__botao {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .5rem;
  width: 100%;
  min-height: 52px;
  padding: .7rem 1rem;
  border: 1.6px dashed var(--line-2);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, .22);
  color: var(--text-2);
  font-family: inherit; font-size: .88rem; font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: border-color .16s var(--ease), background .16s var(--ease),
              color .16s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.arquivo__botao:hover {
  border-color: var(--brand-2);
  background: rgba(36, 94, 227, .1);
  color: var(--text);
}
.arquivo input[type="file"]:focus-visible + .arquivo__botao {
  outline: 2px solid var(--brand-2);
  outline-offset: 2px;
}
.arquivo.tem-arquivo .arquivo__botao {
  border-style: solid;
  border-color: rgba(43, 182, 115, .5);
  background: var(--ok-dim);
  color: #A8ECCB;
}
.arquivo__lista { display: flex; flex-direction: column; gap: .3rem; }
.arquivo__item {
  display: flex; align-items: center; gap: .5rem;
  padding: .42rem .6rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line);
  font-size: .8rem;
}
.arquivo__item .icon-sm { color: var(--brand-3); flex: none; }
.arquivo__item b { font-weight: 600; min-width: 0; }
.arquivo__item span { margin-left: auto; color: var(--muted); font-size: .72rem;
  font-family: var(--mono); flex: none; }
.arquivo__limpar {
  align-self: flex-start;
  background: none; border: 0; padding: .3rem 0;
  color: var(--muted); font-family: inherit; font-size: .76rem;
  text-decoration: underline; cursor: pointer;
}
.arquivo__limpar:hover { color: #FF9E96; }

/* etiquetas */
.tag {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .16rem .5rem;
  font-size: .72rem; font-weight: 700;
  border-radius: 99px;
  border: 1px solid var(--line-2);
  color: var(--text-2);
  background: rgba(255,255,255,.035);
  white-space: nowrap;
}
.tag--ok    { color: #6EE7AE; background: var(--ok-dim);    border-color: rgba(43,182,115,.36); }
.tag--warn  { color: #F5C271; background: var(--warn-dim);  border-color: rgba(233,162,59,.36); }
.tag--err   { color: #FF9E96; background: var(--err-dim);   border-color: rgba(228,87,76,.36); }
.tag--brand { color: #ADC9FF; background: var(--brand-dim); border-color: rgba(76,130,255,.36); }
.tag__dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* avatar */
.avatar {
  width: 34px; height: 34px; flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  font-size: .76rem; font-weight: 800;
  color: #fff;
  letter-spacing: .02em;
  box-shadow: 0 0 0 1px rgba(255,255,255,.14) inset;
}
.avatar--sm { width: 28px; height: 28px; font-size: .68rem; }
.avatar--lg { width: 46px; height: 46px; font-size: .95rem; }

/* tabela */
.table-wrap {
  position: relative;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
/* Sombrinha na direita avisando que a tabela desliza para o lado. */
.table-wrap::after {
  content: '';
  position: sticky;
  top: 0; right: 0;
  float: right;
  width: 26px;
  height: 100%;
  margin-left: -26px;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(11, 15, 26, .85));
}
@media (min-width: 861px) { .table-wrap::after { display: none; } }
.table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.table th {
  text-align: left;
  font-size: .7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em;
  color: var(--muted);
  padding: .6rem .8rem;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  background: rgba(0,0,0,.14);
}
.table td {
  padding: .72rem .8rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .14s var(--ease); }
.table tbody tr:hover { background: rgba(255,255,255,.024); }
.table td.right, .table th.right { text-align: right; }

/* vazio */
.empty { padding: 2.4rem 1.2rem; text-align: center; }
.empty__icon {
  width: 46px; height: 46px;
  margin: 0 auto .8rem;
  display: grid; place-items: center;
  border-radius: 14px;
  background: var(--bg-3);
  color: var(--muted);
}
.empty h3 { font-size: .95rem; margin-bottom: .25rem; }
.empty p { color: var(--muted); font-size: .84rem; max-width: 38ch; margin-inline: auto; }

/* aviso / alerta em caixa */
.alert {
  display: flex; align-items: flex-start; gap: .65rem;
  padding: .8rem .95rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-2);
  background: rgba(255,255,255,.03);
  font-size: .86rem;
}
.alert .icon { margin-top: 1px; }
.alert--ok   { border-color: rgba(43,182,115,.38); background: var(--ok-dim);   color: #A8ECCB; }
.alert--warn { border-color: rgba(233,162,59,.38); background: var(--warn-dim); color: #F7D9A8; }
.alert--err  { border-color: rgba(228,87,76,.38);  background: var(--err-dim);  color: #FFC0BA; }
.alert--info { border-color: rgba(76,130,255,.38); background: var(--brand-dim); color: #C9DBFF; }
.alert b { font-weight: 800; }

/* aviso flutuante (flash) */
.flash {
  position: fixed;
  z-index: 90;
  left: 50%;
  bottom: calc(1rem + env(safe-area-inset-bottom));
  translate: -50% 0;
  width: min(440px, calc(100vw - 1.6rem));
  display: flex; align-items: flex-start; gap: .65rem;
  padding: .8rem .95rem;
  border-radius: var(--radius);
  background: #10182A;
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-lg);
  font-size: .87rem; font-weight: 600;
  animation: sobe .35s var(--ease) both;
}
.flash--sucesso { border-color: rgba(43,182,115,.5); }
.flash--sucesso .flash__icon { color: var(--ok); }
.flash--erro { border-color: rgba(228,87,76,.5); }
.flash--erro .flash__icon { color: var(--err); }
.flash--alerta { border-color: rgba(233,162,59,.5); }
.flash--alerta .flash__icon { color: var(--warn); }
.flash__close {
  margin-left: auto;
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-block: -5px;
  background: none;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
}
.flash__close:hover { background: rgba(255,255,255,.07); }
.flash__close:hover { color: var(--text); }

/* painel de notificacoes */
.pop {
  position: absolute;
  top: calc(100% + .5rem);
  right: 0;
  width: min(380px, calc(100vw - 1.6rem));
  background: #0F1728;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 60;
  overflow: hidden;
  animation: desce .18s var(--ease) both;
}
.pop__head {
  display: flex; align-items: center; gap: .5rem;
  padding: .75rem .9rem;
  border-bottom: 1px solid var(--line);
}
.pop__head h3 { font-size: .88rem; }
.pop__list { max-height: min(60dvh, 440px); overflow-y: auto; overscroll-behavior: contain; }
.pop__foot { padding: .6rem .9rem; border-top: 1px solid var(--line); background: rgba(0,0,0,.2); }

.notif {
  display: flex; gap: .65rem;
  padding: .75rem .9rem;
  border-bottom: 1px solid var(--line);
  transition: background .14s var(--ease);
}
.notif:last-child { border-bottom: 0; }
.notif:hover { background: rgba(255,255,255,.028); }
.notif.is-unread { background: rgba(36,94,227,.07); }
.notif__icon {
  width: 30px; height: 30px; flex: none;
  display: grid; place-items: center;
  border-radius: 9px;
  background: var(--bg-4);
  color: var(--brand-3);
}
.notif--sucesso .notif__icon { color: var(--ok); background: var(--ok-dim); }
.notif--alerta  .notif__icon { color: var(--warn); background: var(--warn-dim); }
.notif--erro    .notif__icon { color: var(--err); background: var(--err-dim); }
.notif__title { font-size: .85rem; font-weight: 700; }
.notif__body { font-size: .79rem; color: var(--text-2); margin-top: .1rem; }
.notif__time { font-size: .7rem; color: var(--muted); margin-top: .2rem; font-family: var(--mono); }

/* menu do usuario */
.user-btn {
  display: flex; align-items: center; gap: .55rem;
  padding: .3rem .55rem .3rem .3rem;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: rgba(255,255,255,.028);
  cursor: pointer;
  color: var(--text);
  font-family: inherit;
  transition: background .16s var(--ease), border-color .16s;
}
.user-btn:hover { background: rgba(255,255,255,.07); border-color: var(--line-2); }
.user-btn__text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  text-align: left;
}
.user-btn__name { font-size: .82rem; font-weight: 700; max-width: 140px; }
.user-btn__role { font-size: .68rem; color: var(--muted); }
.menu { padding: .35rem; }
.menu__item {
  display: flex; align-items: center; gap: .55rem;
  width: 100%;
  padding: .55rem .6rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  font-family: inherit; font-size: .85rem; font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  text-align: left;
  transition: background .14s var(--ease), color .14s;
}
.menu__item:hover { background: rgba(255,255,255,.055); color: var(--text); }
.menu__item--danger { color: #FF9E96; }
.menu__item--danger:hover { background: var(--err-dim); }
.menu__sep { height: 1px; background: var(--line); margin: .3rem 0; }

/* abas */
.tabs { display: flex; gap: .3rem; overflow-x: auto; -webkit-overflow-scrolling: touch;
        padding-bottom: 2px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none;
  padding: .5rem .85rem;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: rgba(255,255,255,.022);
  color: var(--text-2);
  font-family: inherit; font-size: .83rem; font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background .16s var(--ease), color .16s, border-color .16s;
}
.tab:hover { background: rgba(255,255,255,.06); color: var(--text); }
.tab.is-active {
  background: var(--brand-dim); color: #DCE7FF;
  border-color: rgba(76,130,255,.42);
}

/* codigo para copiar */
.copy-box {
  display: flex; align-items: center; gap: .5rem;
  padding: .55rem .7rem;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--line-2);
  background: rgba(0,0,0,.3);
  font-family: var(--mono);
  font-size: .86rem;
  word-break: break-all;
}
.copy-box button { flex: none; }

/* ------------------------------------------- 6. telas de login e MF2 */
.auth {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  padding-block: max(1.25rem, env(safe-area-inset-top)) max(1.25rem, env(safe-area-inset-bottom));
}
.auth__bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.auth__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: .5;
}
.auth__orb--1 {
  width: 46vmax; height: 46vmax;
  top: -16vmax; left: -12vmax;
  background: radial-gradient(circle, rgba(36,94,227,.75), transparent 68%);
  animation: flutua1 22s ease-in-out infinite;
}
.auth__orb--2 {
  width: 38vmax; height: 38vmax;
  bottom: -14vmax; right: -10vmax;
  background: radial-gradient(circle, rgba(113,163,255,.5), transparent 68%);
  animation: flutua2 27s ease-in-out infinite;
}
.auth__orb--3 {
  width: 26vmax; height: 26vmax;
  top: 46%; left: 52%;
  background: radial-gradient(circle, rgba(76,130,255,.34), transparent 68%);
  animation: flutua3 19s ease-in-out infinite;
}
.auth__grid {
  position: absolute;
  inset: -2px;
  background-image:
    linear-gradient(rgba(255,255,255,.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.028) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(ellipse 85% 65% at 50% 45%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 85% 65% at 50% 45%, #000 20%, transparent 78%);
}

.auth__card {
  position: relative;
  z-index: 2;
  width: min(430px, 100%);
  padding: 1.9rem 1.7rem 1.6rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(18,26,44,.9), rgba(12,17,30,.94));
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255,255,255,.04) inset;
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  animation: entra .55s var(--ease) both;
}
/* fio de luz correndo na borda de cima */
.auth__card::before {
  content: '';
  position: absolute;
  top: -1px; left: 12%; right: 12%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--brand-2), transparent);
  animation: brilho 3.6s var(--ease) infinite;
}
.auth__logo {
  display: block;
  height: 30px;
  width: auto;
  margin: 0 auto 1.4rem;
  animation: entra .55s .05s var(--ease) both;
}
.auth__title { text-align: center; font-size: 1.3rem; margin-bottom: .25rem; }
.auth__sub {
  text-align: center;
  color: var(--muted);
  font-size: .86rem;
  margin-bottom: 1.5rem;
}
.auth__form > * { animation: entra .5s var(--ease) both; }
.auth__form > *:nth-child(1) { animation-delay: .10s; }
.auth__form > *:nth-child(2) { animation-delay: .16s; }
.auth__form > *:nth-child(3) { animation-delay: .22s; }
.auth__form > *:nth-child(4) { animation-delay: .28s; }
.auth__form > *:nth-child(5) { animation-delay: .34s; }
.auth__foot {
  margin-top: 1.3rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: .76rem;
  line-height: 1.7;
  color: var(--muted);
}
/* Area boa para o dedo nos links pequenos do rodape. */
.auth__foot a,
.auth__foot button {
  display: inline-block;
  min-height: 34px;
  padding: .42rem .3rem;
}
.auth__steps {
  display: flex; align-items: center; justify-content: center;
  gap: .4rem;
  margin-bottom: 1.2rem;
}
.auth__step {
  width: 26px; height: 3px;
  border-radius: 99px;
  background: var(--bg-4);
  transition: background .3s var(--ease);
}
.auth__step.is-done { background: var(--ok); }
.auth__step.is-now { background: var(--brand-2); width: 40px; }

/* --- 6 caixas do codigo --- */
.otp {
  display: flex;
  justify-content: center;
  gap: .5rem;
  margin: .3rem 0 1.2rem;
}
.otp__box {
  width: 48px;
  height: 60px;
  padding: 0;
  text-align: center;
  font-family: var(--mono);
  font-size: 1.6rem;
  font-weight: 500;
  color: var(--text);
  background: rgba(0,0,0,.36);
  border: 1.6px solid var(--line-2);
  border-radius: 12px;
  caret-color: var(--brand-2);
  transition: border-color .16s var(--ease), background .16s var(--ease),
              box-shadow .16s var(--ease), scale .12s var(--ease);
  -webkit-appearance: none;
  appearance: none;
}
.otp__box::-webkit-outer-spin-button,
.otp__box::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.otp__box:focus {
  outline: none;
  border-color: var(--brand-2);
  background: rgba(36,94,227,.12);
  box-shadow: 0 0 0 3px rgba(36,94,227,.22);
}
.otp__box.is-filled {
  border-color: rgba(76,130,255,.6);
  background: rgba(36,94,227,.1);
  animation: digito .22s var(--ease);
}
.otp.is-wrong { animation: tremor .4s var(--ease); }
.otp.is-wrong .otp__box { border-color: var(--err); background: var(--err-dim); }
.otp.is-ok .otp__box { border-color: var(--ok); background: var(--ok-dim); }

/* contador do TOTP */
.totp-timer {
  display: flex; align-items: center; justify-content: center;
  gap: .5rem;
  font-size: .78rem;
  color: var(--muted);
}
.totp-timer__ring { width: 24px; height: 24px; flex: none; rotate: -90deg; }
.totp-timer__ring circle { fill: none; stroke-width: 3; }
.totp-timer__ring .bg { stroke: var(--bg-4); }
.totp-timer__ring .fg {
  stroke: var(--brand-2);
  stroke-linecap: round;
  transition: stroke-dashoffset .95s linear, stroke .3s;
}
.totp-timer.is-late .totp-timer__ring .fg { stroke: var(--warn); }
.totp-timer__num { font-family: var(--mono); font-weight: 700; color: var(--text-2); }

/* QR do autenticador */
.qr {
  width: 176px; height: 176px;
  margin: 0 auto;
  padding: 9px;
  background: #fff;
  border-radius: 12px;
  display: block;
  box-shadow: var(--shadow);
}
.secret {
  font-family: var(--mono);
  font-size: .9rem;
  letter-spacing: .1em;
  word-break: break-all;
  text-align: center;
  color: var(--brand-3);
}
.steps-list { counter-reset: p; list-style: none; padding: 0; margin: 0; }
.steps-list li {
  position: relative;
  counter-increment: p;
  padding-left: 2rem;
  margin-bottom: .6rem;
  font-size: .85rem;
  color: var(--text-2);
}
.steps-list li::before {
  content: counter(p);
  position: absolute;
  left: 0; top: 0;
  width: 21px; height: 21px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--brand-dim);
  color: var(--brand-3);
  font-family: var(--mono);
  font-size: .72rem;
  font-weight: 700;
}
.steps-list li:last-child { margin-bottom: 0; }

/* --------------------------------------------------- 7. animacoes */
@keyframes entra {
  from { opacity: 0; transform: translateY(12px) scale(.985); }
  to   { opacity: 1; transform: none; }
}
@keyframes sobe {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}
@keyframes desce {
  from { opacity: 0; transform: translateY(-7px) scale(.985); }
  to   { opacity: 1; transform: none; }
}
@keyframes digito {
  0%   { scale: 1; }
  45%  { scale: 1.11; }
  100% { scale: 1; }
}
@keyframes tremor {
  0%, 100% { translate: 0 0; }
  18% { translate: -7px 0; }
  38% { translate: 6px 0; }
  58% { translate: -4px 0; }
  78% { translate: 3px 0; }
}
@keyframes pisca { 0%, 49% { opacity: 1; } 50%, 100% { opacity: .28; } }
@keyframes brilho {
  0%, 100% { opacity: .25; }
  50% { opacity: 1; }
}
@keyframes flutua1 {
  0%, 100% { translate: 0 0; scale: 1; }
  50% { translate: 7vmax 5vmax; scale: 1.12; }
}
@keyframes flutua2 {
  0%, 100% { translate: 0 0; scale: 1; }
  50% { translate: -6vmax -6vmax; scale: 1.16; }
}
@keyframes flutua3 {
  0%, 100% { translate: -50% -50%; }
  50% { translate: -58% -42%; }
}
@keyframes girando { to { rotate: 360deg; } }
.spin { animation: girando .8s linear infinite; }

/* HTMX: mostra que esta carregando */
.htmx-indicator { opacity: 0; transition: opacity .2s; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }

/* quem prefere menos movimento */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001s !important;
  }
  html { scroll-behavior: auto; }
}


/* ======================================================================
   CONTROLES PRÓPRIOS — nada aqui usa o visual padrão do navegador.
   Motivo: o <select>, o input de arquivo e o preenchimento automático
   mudam de cara (e de idioma) conforme o sistema do usuário. Aqui tudo
   fica igual em qualquer aparelho, escuro e em português.
   ====================================================================== */

/* --- preenchimento automático (autofill): sem fundo branco/amarelo --- */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
select:-webkit-autofill {
  -webkit-text-fill-color: var(--text);
  -webkit-background-clip: text;
  caret-color: var(--text);
  /* o truque: a sombra interna cobre o fundo que o navegador força */
  box-shadow: 0 0 0 1000px rgba(6, 10, 20, .98) inset;
  transition: background-color 9999s ease-in-out 0s;
}
input:-webkit-autofill:focus {
  box-shadow: 0 0 0 1000px rgba(6, 10, 20, .98) inset,
              0 0 0 3px rgba(36, 94, 227, .2);
}
input:autofill { background: rgba(0, 0, 0, .28); color: var(--text); }

/* --- barra de rolagem escura em tudo, inclusive listas internas --- */
* { scrollbar-width: thin; scrollbar-color: #24304A transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: #24304A;
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover { background: #33415F; background-clip: content-box; }
*::-webkit-scrollbar-corner { background: transparent; }

/* --- seletor próprio (substitui o <select>) --- */
.combo { position: relative; }
/* o <select> de verdade continua no formulário, só que invisível:
   assim o envio, o "required" e o teclado do celular seguem funcionando */
.combo__nativo {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  opacity: 0;
  pointer-events: none;
}
.combo__botao {
  display: flex;
  align-items: center;
  gap: .6rem;
  width: 100%;
  min-height: 44px;
  padding: .62rem .8rem;
  font-family: inherit;
  font-size: .92rem;
  text-align: left;
  color: var(--text);
  background: rgba(0, 0, 0, .28);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease),
              background .16s var(--ease);
}
.combo__botao:hover { border-color: #2C3A57; }
.combo__botao:focus-visible,
.combo.is-aberto .combo__botao {
  outline: none;
  border-color: var(--brand-2);
  background: rgba(0, 0, 0, .4);
  box-shadow: 0 0 0 3px rgba(36, 94, 227, .2);
}
.combo__valor { flex: 1 1 auto; min-width: 0; overflow: hidden;
                text-overflow: ellipsis; white-space: nowrap; }
.combo__valor.is-vazio { color: #5C6880; }
.combo__seta { flex: none; width: 17px; height: 17px; color: var(--muted);
               transition: rotate .18s var(--ease); }
.combo.is-aberto .combo__seta { rotate: 180deg; }

.combo__painel {
  position: absolute;
  z-index: 70;
  top: calc(100% + .35rem);
  left: 0;
  right: 0;
  background: #0F1728;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: desce .16s var(--ease) both;
}
.combo__painel[hidden] { display: none; }
.combo--acima .combo__painel { top: auto; bottom: calc(100% + .35rem); }

.combo__busca { padding: .55rem; border-bottom: 1px solid var(--line); position: relative; }
.combo__busca input {
  width: 100%;
  padding: .5rem .7rem .5rem 2.1rem;
  min-height: 38px;
  font-family: inherit;
  font-size: .88rem;
  color: var(--text);
  background: rgba(0, 0, 0, .34);
  border: 1px solid var(--line-2);
  border-radius: 9px;
}
.combo__busca input::placeholder { color: #5C6880; }
.combo__busca input:focus { outline: none; border-color: var(--brand-2); }
.combo__busca svg { position: absolute; left: 1.15rem; top: 50%; translate: 0 -50%;
                    width: 15px; height: 15px; color: var(--muted); pointer-events: none; }

.combo__lista {
  list-style: none;
  margin: 0;
  padding: .3rem;
  max-height: min(44dvh, 320px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.combo__grupo {
  padding: .6rem .6rem .25rem;
  font-size: .66rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: #5D6980;
}
.combo__item {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .55rem .6rem;
  border-radius: 9px;
  font-size: .89rem;
  color: var(--text-2);
  cursor: pointer;
  transition: background .12s var(--ease), color .12s var(--ease);
}
.combo__item:hover, .combo__item.is-marcado {
  background: rgba(255, 255, 255, .06);
  color: var(--text);
}
.combo__item.is-escolhido { background: var(--brand-dim); color: #DCE7FF; font-weight: 700; }
.combo__item .check-mark { margin-left: auto; width: 15px; height: 15px;
                           color: var(--brand-3); opacity: 0; flex: none; }
.combo__item.is-escolhido .check-mark { opacity: 1; }
.combo__vazio { padding: 1rem .6rem; text-align: center; font-size: .84rem;
                color: var(--muted); }

/* --- cor: quadrado próprio, sem a caixa do sistema --- */
.cor {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .6rem;
}
.cor input[type="color"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  border: 0;
  padding: 0;
}
.cor__amostra {
  width: 46px;
  height: 44px;
  flex: none;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-2);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .35) inset;
  pointer-events: none;
}
.cor__codigo {
  font-family: var(--mono);
  font-size: .8rem;
  color: var(--text-2);
  text-transform: uppercase;
  pointer-events: none;
}
.cor:hover .cor__amostra { border-color: var(--brand-2); }
.cor input[type="color"]:focus-visible ~ .cor__amostra {
  outline: 2px solid var(--brand-2);
  outline-offset: 2px;
}

/* --- data e hora --- */
input[type="date"], input[type="time"], input[type="datetime-local"] {
  color-scheme: dark;                 /* calendário do navegador em escuro */
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
  filter: invert(62%) sepia(12%) saturate(500%) hue-rotate(185deg);
  cursor: pointer;
  opacity: .9;
}
input[type="date"]::-webkit-calendar-picker-indicator:hover { opacity: 1; }
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }

/* --- miniatura das fotos escolhidas --- */
.arquivo__miniaturas {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(62px, 1fr));
  gap: .4rem;
}
.arquivo__mini {
  position: relative;
  aspect-ratio: 1;
  border-radius: 9px;
  overflow: hidden;
  border: 1px solid var(--line-2);
  background: rgba(0, 0, 0, .3);
}
.arquivo__mini img { width: 100%; height: 100%; object-fit: cover; display: block; }
.arquivo__mini span {
  position: absolute;
  inset: auto 0 0 0;
  padding: .12rem .25rem;
  font-size: .58rem;
  font-family: var(--mono);
  color: #fff;
  background: rgba(0, 0, 0, .72);
  text-align: center;
}

/* --- grade de formulário com rótulos alinhados --- */
.form-grid { display: grid; gap: 1rem; align-items: start; }
.form-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
/* Cada célula é uma coluna de 3 linhas: rótulo, campo e ajuda.
   Assim os campos ficam no mesmo topo mesmo com rótulo de 1 ou 2 linhas. */
.form-grid > .campo:not(.switch) {
  display: grid;
  grid-template-rows: auto auto 1fr;   /* rótulo · campo · ajuda */
  gap: .35rem;
  min-width: 0;
  margin: 0;
}
/* interruptores ficam no próprio ritmo, sem entrar na grade de 3 linhas */
.form-grid > .switch { align-self: start; margin: 0; padding: .3rem 0; }
.form-grid > .campo:not(.switch) > label {
  display: flex;
  align-items: flex-end;
  min-height: 2.6em;            /* cabe rótulo de duas linhas */
  font-size: .8rem;
  font-weight: 700;
  color: var(--text-2);
  line-height: 1.3;
}
.form-grid > .campo:not(.switch) > .field__help {
  font-size: .74rem;
  color: var(--muted);
  line-height: 1.4;
}
.form-grid .input-group { min-width: 0; }
.form-grid .input-group .input { min-width: 0; }

@media (max-width: 1100px) {
  .form-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .form-grid--4, .form-grid--3, .form-grid--2 { grid-template-columns: minmax(0, 1fr); }
  .form-grid > .campo:not(.switch) > label { min-height: 0; }
}


/* --- prévias do site lado a lado (computador + celular) --- */
.previas {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}
.previa__moldura {
  border: 8px solid #1A2133;
  background: #000;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.previa__moldura--pc { border-radius: 12px; }
.previa__moldura--cel { border-radius: 24px; }
.previa__tela { position: relative; width: 100%; aspect-ratio: 1440 / 900; overflow: hidden; }
/* O site é desenhado em 1440px e encolhido com scale — assim a prévia do
   computador mostra o layout de computador de verdade, não o de celular. */
.previa__frame--pc {
  position: absolute; top: 0; left: 0;
  width: 1440px; height: 900px;
  border: 0; display: block; background: #fff;
  transform-origin: top left;
}
.previa__frame--cel {
  width: 100%; height: 520px;
  border: 0; display: block; background: #fff;
}
@media (max-width: 1100px) {
  .previas { grid-template-columns: minmax(0, 1fr); }
  .previa--celular { max-width: 330px; margin-inline: auto; }
  .previa__frame--cel { height: 460px; }
}

/* --- lista de dados (rótulo à esquerda, valor à direita) --- */
.dados { display: flex; flex-direction: column; }
.dados__item {
  display: flex; align-items: baseline; gap: 1rem;
  padding: .5rem 0;
  border-bottom: 1px solid var(--line);
  font-size: .86rem;
}
.dados__item:last-child { border-bottom: 0; }
.dados__rot { flex: none; width: 108px; color: var(--muted); font-size: .78rem; }
.dados__val { flex: 1 1 auto; min-width: 0; word-break: break-word; }
@media (max-width: 480px) {
  .dados__item { flex-direction: column; gap: .1rem; padding: .45rem 0; }
  .dados__rot { width: auto; }
}

/* --- gráfico de barras das visitas --- */
.barras {
  display: flex; align-items: flex-end; gap: 3px;
  height: 92px; padding-top: 1.1rem;
}
.barras__col {
  flex: 1 1 0; min-width: 0;
  display: flex; flex-direction: column; align-items: center; gap: .25rem;
  height: 100%;
}
.barras__barra {
  width: 100%;
  min-height: 3px;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, var(--brand-2), var(--brand));
  position: relative;
  margin-top: auto;
  transition: filter .15s var(--ease);
}
.barras__col:hover .barras__barra { filter: brightness(1.25); }
.barras__n {
  position: absolute; top: -1.05rem; left: 50%; translate: -50% 0;
  font-size: .62rem; font-weight: 700; color: var(--text-2);
}
.barras__dia { font-size: .58rem; color: var(--muted); flex: none; }
@media (max-width: 480px) { .barras__dia { display: none; } }

/* ---------------------------------------------------- 8. celular */

/* gaveta (sidebar no celular) */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 39;
  background: rgba(4, 7, 14, .68);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  display: none;
  animation: aparece .2s var(--ease) both;
}
@keyframes aparece { from { opacity: 0; } to { opacity: 1; } }

/* tablet: sidebar estreita automaticamente */
@media (max-width: 1100px) and (min-width: 861px) {
  .app { --sidebar-w: var(--sidebar-w-min); }
  .app .nav-link { justify-content: center; padding: .6rem 0; }
  .app .nav-link__text, .app .nav-link__badge { display: none; }
  .app .nav-group__title { text-align: center; font-size: .6rem; padding: .8rem 0 .3rem; }
  .app .sidebar__brand img { display: none; }
  .app .sidebar__brand .mark { display: block; }
  .app .sidebar__brand { padding: .5rem; }
  .app .nav-link.is-active::before { left: 0; }
}

@media (max-width: 860px) {
  body { font-size: 15px; }

  .app { grid-template-columns: minmax(0, 1fr); }

  /* sidebar vira gaveta que entra pela esquerda */
  .sidebar {
    position: fixed;
    top: 0; bottom: 0; left: 0;
    width: min(282px, 84vw);
    height: 100dvh;
    translate: -102% 0;
    transition: translate .26s var(--ease);
    box-shadow: var(--shadow-lg);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .app.drawer-open .sidebar { translate: 0 0; }
  .app.drawer-open .drawer-backdrop { display: block; }
  /* no celular a gaveta mostra sempre o texto, mesmo no modo estreito */
  .app.is-narrow { --sidebar-w: 256px; }
  .app.is-narrow .sidebar__brand img { display: block; }
  .app.is-narrow .sidebar__brand .mark { display: none; }
  .app.is-narrow .sidebar__brand { padding: .55rem; }
  .app.is-narrow .nav-link { justify-content: flex-start; padding: .58rem .65rem; }
  .app.is-narrow .nav-link__text, .app.is-narrow .nav-link__badge { display: block; }
  .app.is-narrow .nav-group__title { text-align: left; font-size: .68rem; padding: .9rem .65rem .35rem; }

  .main { grid-column: 1; }

  /* topo em duas linhas: acoes em cima, relogios embaixo */
  .topbar {
    height: auto;
    min-height: 56px;
    padding: .5rem .8rem;
    padding-top: max(.5rem, env(safe-area-inset-top));
    flex-wrap: wrap;
    row-gap: .5rem;
  }
  .topbar__title { font-size: .95rem; }
  .topbar__sub { display: none; }

  .clocks {
    order: 3;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: .4rem;
    padding-bottom: 1px;
    scroll-snap-type: x proximity;
  }
  .clocks::-webkit-scrollbar { display: none; }
  .clock { flex: 1 0 auto; min-width: 104px; scroll-snap-align: start; }

  .content { padding: 1rem .9rem 3.5rem; }
  .page-head { margin-bottom: 1rem; }
  h1 { font-size: 1.24rem; }

  /* o texto do usuario sai; sobra o avatar */
  .user-btn__text { display: none; }
  .user-btn { padding: .28rem; border-radius: 50%; }

  .card__body, .card__head { padding: .9rem; }
  .card__foot { padding: .75rem .9rem; }

  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); gap: .8rem; }

  .stat__value { font-size: 1.5rem; }

  /* menus/painel viram folha colada embaixo, mais facil com o dedo */
  .pop {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0; right: 0;
    width: 100%;
    max-height: 82dvh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    border-left: 0; border-right: 0; border-bottom: 0;
    padding-bottom: env(safe-area-inset-bottom);
    animation: sobe .24s var(--ease) both;
  }
  .pop__list { max-height: 60dvh; }
  .pop--menu .menu__item { padding: .75rem .8rem; font-size: .9rem; }

  .auth__card { padding: 1.5rem 1.15rem 1.3rem; border-radius: 18px; }
  .auth__title { font-size: 1.18rem; }
  .otp { gap: .36rem; }
  .otp__box { width: 100%; max-width: 50px; height: 56px; font-size: 1.4rem; }

  .btn { min-height: 44px; }
  .btn--sm { min-height: 38px; }

  .table th, .table td { padding: .6rem .65rem; }

  .flash { width: calc(100vw - 1.4rem); }
}

/* celular pequeno (iPhone SE, 320-360px) */
@media (max-width: 400px) {
  .content { padding: .85rem .7rem 3.5rem; }
  .auth { padding: .8rem; }
  .auth__card { padding: 1.3rem .95rem 1.1rem; }
  .otp { gap: .28rem; }
  .otp__box { height: 52px; font-size: 1.25rem; border-radius: 10px; }
  /* Em 320px os 3 relogios so cabem sem o icone de sol/lua. */
  .clocks { gap: .3rem; }
  .clock { min-width: 0; flex: 1 1 0; padding: .26rem .34rem; gap: 0; }
  .clock__icon { display: none; }
  .clock__body { align-items: center; width: 100%; }
  .clock__city { font-size: .52rem; letter-spacing: .04em; }
  .clock__time { font-size: .76rem; }
  .stat__value { font-size: 1.35rem; }
  .btn { font-size: .84rem; padding: .55rem .8rem; }
  .qr { width: 152px; height: 152px; }
}

/* celular deitado (pouca altura) */
@media (max-height: 520px) and (max-width: 950px) {
  .auth { align-items: flex-start; padding-top: .8rem; }
  .auth__logo { height: 24px; margin-bottom: .9rem; }
  .auth__card { padding: 1.1rem 1rem; }
  .otp__box { height: 46px; font-size: 1.15rem; }
  .qr { width: 128px; height: 128px; }
}

/* mouse-menos (toque): area de clique maior */
@media (hover: none) {
  .nav-link { padding: .68rem .65rem; }
  .menu__item { padding: .7rem .7rem; }
  .icon-btn { width: 40px; height: 40px; }
  /* Links de texto tambem precisam de area para o dedo (minimo ~32px). */
  .page-head a,
  .auth__foot a,
  .auth__foot button,
  .card__body a:not(.btn),
  details > summary { display: inline-block; padding-block: .42rem; }
  .table td a:not(.btn) { padding-block: .3rem; }
}

/* impressao: sem casca */
@media print {
  .sidebar, .topbar, .flash, .pop, .drawer-backdrop { display: none !important; }
  body::before, .auth__bg { display: none !important; }
  .app { display: block; }
  body { background: #fff; color: #111; }
  .card { border-color: #ddd; box-shadow: none; }
}
