/* ══════════════════════════════════════════════════════════════════════════════
   NotAgil Dashboard Web — Design System Moderno, Adaptativo e Sem Zoom
   ══════════════════════════════════════════════════════════════════════════════ */

:root {
  --bg: #07071A;
  --bg-elev: #0E0E24;
  --bg-card: rgba(17, 17, 42, 0.88);
  --bg-card-solid: #11112A;
  --bg-glass: rgba(15, 16, 39, 0.78);
  --border: rgba(124, 77, 255, 0.22);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --primary: #7C4DFF;
  --primary-soft: rgba(124, 77, 255, 0.16);
  --cyan: #00E5FF;
  --cyan-soft: rgba(0, 229, 255, 0.14);
  --green: #69F0AE;
  --green-soft: rgba(105, 240, 174, 0.14);
  --amber: #FFD740;
  --amber-soft: rgba(255, 215, 64, 0.15);
  --orange: #FF9800;
  --orange-soft: rgba(255, 152, 0, 0.15);
  --red: #FF5252;
  --red-soft: rgba(255, 82, 82, 0.15);
  --text: #EEEEFF;
  --text-2: #A2A4CC;
  --text-3: #7678A3;
  --radius: 16px;
  --radius-sm: 10px;
  --font-base: 15px;
  --kpi-cols: 4;
  --card-cols: 2;
  --content-max-width: 1360px;
  --app-vh: 1vh;
}

*, *::before, *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  font-size: var(--font-base);
  line-height: 1.45;
  overflow-x: hidden;
  /* Bloqueio total de zoom em CSS + prevenção de bounce */
  touch-action: pan-x pan-y;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(620px circle at 12% 8%, rgba(124, 77, 255, 0.18), transparent 60%),
    radial-gradient(560px circle at 88% 12%, rgba(0, 229, 255, 0.12), transparent 58%),
    radial-gradient(600px circle at 50% 96%, rgba(105, 240, 174, 0.08), transparent 62%);
  z-index: 0;
}

.app-root {
  position: relative;
  z-index: 1;
  min-height: calc(var(--app-vh) * 100);
}

/* ── Boot Screen ────────────────────────────────────────────────────────── */
.boot-screen {
  min-height: calc(var(--app-vh) * 100);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
}
.boot-logo-wrap {
  width: 78px;
  height: 78px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(124, 77, 255, 0.25), rgba(0, 229, 255, 0.16));
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
}
.boot-logo { border-radius: 14px; }
.boot-title { font-size: 1.35rem; font-weight: 800; letter-spacing: -0.02em; }
.boot-sub { color: var(--text-2); font-size: 0.9rem; }
.boot-bar {
  width: 180px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
  margin-top: 6px;
}
.boot-bar-fill {
  width: 45%;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--cyan));
  border-radius: 999px;
  animation: bootSlide 1.1s ease-in-out infinite;
}
@keyframes bootSlide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(300%); }
}

/* ── Login Web App ──────────────────────────────────────────────────────── */
.login-shell {
  min-height: calc(var(--app-vh) * 100);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(20px, env(safe-area-inset-top)) 18px max(24px, env(safe-area-inset-bottom));
}
.login-card {
  position: relative;
  width: 100%;
  max-width: 446px;
  background: linear-gradient(165deg, rgba(20, 21, 52, 0.9), rgba(11, 12, 31, 0.94));
  backdrop-filter: blur(26px);
  -webkit-backdrop-filter: blur(26px);
  border: 1px solid rgba(124, 77, 255, 0.32);
  border-radius: 26px;
  padding: 26px 26px 22px;
  box-shadow:
    0 28px 80px rgba(0, 0, 0, 0.62),
    0 0 0 1px rgba(0, 229, 255, 0.08) inset,
    0 1px 0 rgba(255, 255, 255, 0.1) inset;
  overflow: hidden;
}
.login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 14%;
  right: 14%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), var(--cyan), transparent);
  opacity: 0.9;
}
.login-sec-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(105, 240, 174, 0.1);
  border: 1px solid rgba(105, 240, 174, 0.28);
  color: var(--green);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin-bottom: 16px;
  max-width: 100%;
}
.login-sec-badge span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
.login-logo-ring {
  padding: 4px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(124, 77, 255, 0.45), rgba(0, 229, 255, 0.32));
  box-shadow: 0 10px 28px rgba(124, 77, 255, 0.35);
  flex-shrink: 0;
}
.login-brand img {
  display: block;
  width: 52px;
  height: 52px;
  border-radius: 14px;
}
.login-brand h1 {
  margin: 0;
  font-size: 1.42rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  background: linear-gradient(90deg, #FFFFFF, #CFEFFF);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.login-brand p {
  margin: 2px 0 0;
  font-size: 0.84rem;
  color: var(--text-2);
}
.login-hint {
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.11), rgba(124, 77, 255, 0.1));
  border: 1px solid rgba(0, 229, 255, 0.24);
  color: var(--text-2);
  border-radius: 14px;
  padding: 11px 13px;
  font-size: 0.81rem;
  margin-bottom: 18px;
  line-height: 1.45;
}
.login-hint strong { color: var(--text); }
.field {
  margin-bottom: 15px;
}
.field label {
  display: block;
  font-size: 0.79rem;
  font-weight: 700;
  color: var(--text-2);
  margin-bottom: 7px;
  letter-spacing: 0.01em;
}
.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.input-icon-left {
  position: absolute;
  left: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  pointer-events: none;
  transition: color 0.16s;
}
.input-wrap:focus-within .input-icon-left {
  color: var(--cyan);
}
.input, .select {
  width: 100%;
  background: rgba(6, 7, 22, 0.88);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 13px;
  padding: 12px 14px;
  font-size: 16px; /* >= 16px impede auto-zoom em iOS Safari ao focar input! */
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}
.input-with-icon {
  padding-left: 42px;
}
.input:focus, .select:focus {
  border-color: var(--cyan);
  background: rgba(8, 10, 30, 0.96);
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.16);
}
.input-pass { padding-right: 52px; }
.eye-btn {
  position: absolute;
  right: 7px;
  width: 38px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-2);
  padding: 0;
  cursor: pointer;
  border-radius: 10px;
  transition: color 0.16s, background 0.16s, border-color 0.16s, transform 0.12s;
}
.eye-btn:hover {
  color: var(--cyan);
  background: rgba(0, 229, 255, 0.12);
  border-color: rgba(0, 229, 255, 0.34);
}
.eye-btn.is-visible {
  color: var(--cyan);
  background: rgba(0, 229, 255, 0.16);
  border-color: rgba(0, 229, 255, 0.42);
}
.eye-btn:active {
  transform: scale(0.92);
}
.login-submit-btn {
  margin-top: 4px;
  padding: 13px 18px;
  font-size: 0.95rem;
  border-radius: 13px;
}
.login-pwa-wrap {
  margin-top: 12px;
}
.login-pwa-btn {
  width: 100%;
  padding: 11px 14px;
  border-radius: 12px;
}
.login-foot-note {
  margin-top: 16px;
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-3);
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 12px;
  padding: 12px 18px;
  font-weight: 800;
  font-size: 0.92rem;
  cursor: pointer;
  transition: transform 0.12s, opacity 0.15s, background 0.15s;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, var(--primary), #00B8D4);
  color: #fff;
  box-shadow: 0 10px 26px rgba(124, 77, 255, 0.35);
}
.btn-ghost {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid var(--border-subtle);
  padding: 8px 13px;
  font-size: 0.83rem;
}
.btn-cyan {
  background: var(--cyan-soft);
  color: var(--cyan);
  border: 1px solid rgba(0, 229, 255, 0.35);
  padding: 8px 13px;
  font-size: 0.83rem;
}
.alert-error {
  background: var(--red-soft);
  border: 1px solid rgba(255, 82, 82, 0.4);
  color: #FFB3B3;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.84rem;
  font-weight: 600;
  margin-bottom: 14px;
}

/* ── Shell do Dashboard + Menu Flutuante Adaptativo ─────────────────────── */
.dash-shell {
  min-height: calc(var(--app-vh) * 100);
  display: flex;
  flex-direction: column;
}
html[data-dock="left"] .dash-shell {
  padding-left: 102px;
  padding-bottom: 28px;
}
html[data-dock="bottom"] .dash-shell {
  padding-left: 0;
  padding-bottom: calc(96px + env(safe-area-inset-bottom));
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  background: rgba(7, 7, 26, 0.76);
  border-bottom: 1px solid var(--border-subtle);
  padding: max(12px, env(safe-area-inset-top)) 18px 12px;
}
.topbar-inner {
  max-width: var(--content-max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}
.topbar-brand img {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  flex-shrink: 0;
}
.topbar-company {
  font-weight: 800;
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-sub {
  font-size: 0.76rem;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  display: inline-block;
  box-shadow: 0 0 10px var(--green);
}
.live-dot.reconnecting { background: var(--amber); box-shadow: 0 0 10px var(--amber); }

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.main-content {
  width: 100%;
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 18px 18px 24px;
  flex: 1;
}
html[data-device="xs-phone"] .main-content {
  padding: 12px 12px 20px;
}

/* ── MENU FLUTUANTE (Dock Glassmórfico Responsivo) ──────────────────────── */
.floating-dock {
  position: fixed;
  z-index: 40;
  background: rgba(15, 16, 40, 0.88);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(124, 77, 255, 0.34);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  display: flex;
  gap: 6px;
  padding: 8px;
}
html[data-dock="left"] .floating-dock {
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  flex-direction: column;
  border-radius: 24px;
  width: 72px;
  align-items: center;
}
html[data-dock="bottom"] .floating-dock {
  left: 50%;
  bottom: max(12px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  flex-direction: row;
  border-radius: 26px;
  max-width: calc(100vw - 24px);
  padding: 6px 10px;
}

.dock-item {
  border: 0;
  background: transparent;
  color: var(--text-2);
  border-radius: 16px;
  padding: 9px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  min-width: 56px;
  font-size: 0.68rem;
  font-weight: 700;
  transition: background 0.16s, color 0.16s, transform 0.12s;
}
html[data-dock="bottom"] .dock-item {
  min-width: 72px;
  padding: 8px 12px;
}
html[data-device="xs-phone"] .dock-item {
  min-width: 62px;
  padding: 7px 8px;
  font-size: 0.65rem;
}
.dock-item svg {
  width: 21px;
  height: 21px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.dock-item.active {
  background: linear-gradient(135deg, rgba(124, 77, 255, 0.34), rgba(0, 229, 255, 0.22));
  color: var(--cyan);
  box-shadow: inset 0 0 0 1px rgba(0, 229, 255, 0.35);
}
.dock-item:active { transform: scale(0.94); }

/* ── Grids, Cards, Pills & Controls ─────────────────────────────────────── */
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.page-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.page-sub {
  margin: 3px 0 0;
  color: var(--text-2);
  font-size: 0.84rem;
}

.period-bar {
  display: inline-flex;
  background: var(--bg-card-solid);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 3px;
  gap: 3px;
}
.period-btn {
  border: 0;
  background: transparent;
  color: var(--text-2);
  padding: 6px 11px;
  border-radius: 9px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}
.period-btn.active {
  background: var(--cyan-soft);
  color: var(--cyan);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(var(--kpi-cols), minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 15px;
  position: relative;
  overflow: hidden;
}
.kpi-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent, var(--cyan));
  opacity: 0.7;
}
.kpi-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.kpi-value {
  font-size: 1.45rem;
  font-weight: 800;
  margin: 6px 0 3px;
  letter-spacing: -0.02em;
  word-break: break-word;
}
html[data-device="xs-phone"] .kpi-value { font-size: 1.18rem; }
.kpi-sub {
  font-size: 0.76rem;
  color: var(--accent, var(--text-2));
  font-weight: 600;
}

.two-col {
  display: grid;
  grid-template-columns: repeat(var(--card-cols), minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.panel-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
}
.pill-green { background: var(--green-soft); color: var(--green); }
.pill-cyan { background: var(--cyan-soft); color: var(--cyan); }
.pill-amber { background: var(--amber-soft); color: var(--amber); }
.pill-orange { background: var(--orange-soft); color: var(--orange); }
.pill-red { background: var(--red-soft); color: var(--red); }
.pill-purple { background: var(--primary-soft); color: #CBB2FF; }
.pill-muted { background: rgba(255, 255, 255, 0.07); color: var(--text-2); }

/* ── Chips, Filtros & Busca ─────────────────────────────────────────────── */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.toolbar .input {
  flex: 1;
  min-width: 210px;
  padding: 10px 13px;
}
.toolbar .select {
  width: auto;
  min-width: 170px;
  padding: 10px 12px;
}
.chips {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.chip {
  border: 1px solid var(--border-subtle);
  background: var(--bg-card-solid);
  color: var(--text-2);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}
.chip.active {
  background: var(--cyan);
  color: #050611;
  border-color: var(--cyan);
}

/* ── Cards de Funcionários e Atividades ─────────────────────────────────── */
.emp-grid {
  display: grid;
  grid-template-columns: repeat(var(--card-cols), minmax(0, 1fr));
  gap: 12px;
}
.emp-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: border-color 0.16s, transform 0.14s;
  text-align: left;
  color: inherit;
  width: 100%;
}
.emp-card:hover { border-color: rgba(0, 229, 255, 0.45); transform: translateY(-2px); }
.emp-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.emp-name { font-size: 1.04rem; font-weight: 800; }
.emp-role { font-size: 0.78rem; color: var(--text-2); }
.emp-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 10px;
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.activity-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 14px;
}
.activity-card.critico { border-color: rgba(255, 82, 82, 0.4); }
.activity-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 7px;
}
.activity-time {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--text-3);
}
.activity-title {
  font-weight: 800;
  font-size: 0.96rem;
  margin-bottom: 3px;
}
.activity-resumo {
  font-size: 0.83rem;
  color: var(--text-2);
}
.diff-box {
  margin-top: 9px;
  padding: 10px 11px;
  background: rgba(7, 7, 26, 0.75);
  border: 1px solid rgba(255, 152, 0, 0.3);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.diff-head {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--orange);
  text-transform: uppercase;
}
.diff-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 0.8rem;
}
.diff-old {
  background: var(--red-soft);
  color: var(--red);
  padding: 2px 7px;
  border-radius: 6px;
  font-weight: 700;
}
.diff-new {
  background: var(--green-soft);
  color: var(--green);
  padding: 2px 7px;
  border-radius: 6px;
  font-weight: 700;
}
.items-box {
  margin-top: 8px;
  padding: 8px 10px;
  background: rgba(7, 7, 26, 0.65);
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  font-size: 0.78rem;
  color: var(--text-2);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ── Produtos (Tabela Desktop + Cards Celular Adaptativos) ──────────────── */
.prod-table-wrap {
  width: 100%;
  overflow-x: auto;
}
.prod-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}
.prod-table th {
  text-align: left;
  padding: 10px 12px;
  color: var(--text-2);
  font-size: 0.74rem;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-subtle);
}
.prod-table td {
  padding: 11px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: middle;
}
.prod-table tr:hover td { background: rgba(255, 255, 255, 0.025); }
.prod-cards {
  display: none;
  flex-direction: column;
  gap: 10px;
}
html[data-device="xs-phone"] .prod-table-wrap,
html[data-device="phone"] .prod-table-wrap { display: none; }
html[data-device="xs-phone"] .prod-cards,
html[data-device="phone"] .prod-cards { display: flex; }

.prod-mobile-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 13px;
}
.prod-mobile-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 8px;
}
.prod-mobile-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
}
.prod-stat-lbl { font-size: 0.68rem; color: var(--text-3); }
.prod-stat-val { font-size: 0.88rem; font-weight: 800; }

/* ── Mini Lista + Gráfico SVG ───────────────────────────────────────────── */
.mini-list { display: flex; flex-direction: column; gap: 8px; }
.mini-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 11px;
  border-radius: 11px;
  background: rgba(7, 7, 26, 0.55);
  border: 1px solid var(--border-subtle);
}
.mini-row.clickable { cursor: pointer; }
.mini-row.clickable:hover { border-color: rgba(0, 229, 255, 0.4); }
.chart-svg { width: 100%; height: 150px; display: block; }

/* ── Lazy Load Sentinel & Skeletons ─────────────────────────────────────── */
.sentinel {
  text-align: center;
  padding: 16px;
  color: var(--text-2);
  font-size: 0.82rem;
}
.skeleton {
  height: 76px;
  border-radius: 14px;
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.09) 50%, rgba(255,255,255,0.04) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
  margin-bottom: 10px;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.empty-box {
  text-align: center;
  padding: 34px 20px;
  color: var(--text-2);
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

/* ── Toasts ─────────────────────────────────────────────────────────────── */
.toast-root {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  right: 16px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(360px, calc(100vw - 32px));
}
.toast {
  background: #141633;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 11px 14px;
  border-radius: 12px;
  font-size: 0.84rem;
  font-weight: 600;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.2s, transform 0.2s;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-ok { border-color: rgba(105, 240, 174, 0.45); }
.toast-err { border-color: rgba(255, 82, 82, 0.45); }

/* ── Modais Glassmórficos (Login Loading + Instalador PWA) ──────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(5, 6, 18, 0.76);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  animation: fadeIn 0.18s ease-out;
}
.modal-backdrop[hidden] { display: none; }
.modal-card {
  position: relative;
  width: 100%;
  max-width: 430px;
  background: linear-gradient(165deg, rgba(21, 22, 54, 0.97), rgba(11, 12, 31, 0.98));
  border: 1px solid rgba(124, 77, 255, 0.38);
  border-radius: 24px;
  padding: 26px 24px 22px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.68), 0 0 0 1px rgba(0, 229, 255, 0.1) inset;
  max-height: calc(var(--app-vh) * 90);
  overflow-y: auto;
}
.modal-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-2);
  font-size: 0.95rem;
  cursor: pointer;
}
.modal-close-btn:hover { color: var(--text); border-color: rgba(0, 229, 255, 0.4); }

/* ── Modal de Loading / Fila de Sincronização no Login ──────────────────── */
.sync-modal { text-align: center; }
.sync-orb {
  position: relative;
  width: 82px;
  height: 82px;
  margin: 4px auto 16px;
  display: grid;
  place-items: center;
}
.sync-orb img {
  border-radius: 12px;
  position: relative;
  z-index: 2;
  box-shadow: 0 8px 24px rgba(124, 77, 255, 0.4);
}
.sync-orb-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2.5px solid transparent;
  border-top-color: var(--cyan);
  border-right-color: var(--primary);
  animation: spinOrb 1.05s linear infinite;
}
.sync-orb-ring-2 {
  inset: 7px;
  border-top-color: transparent;
  border-right-color: transparent;
  border-bottom-color: var(--green);
  border-left-color: var(--cyan);
  animation: spinOrb 1.65s linear infinite reverse;
}
@keyframes spinOrb {
  to { transform: rotate(360deg); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.sync-modal-title {
  margin: 0 0 6px;
  font-size: 1.18rem;
  font-weight: 800;
}
.sync-modal-sub {
  margin: 0 0 16px;
  font-size: 0.82rem;
  color: var(--text-2);
}
.sync-progress-wrap {
  margin-bottom: 14px;
}
.sync-progress-track {
  height: 6px;
  width: 100%;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  position: relative;
}
.sync-progress-bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--cyan), var(--green));
  transition: width 0.35s ease;
}
.sync-progress-bar.indeterminate {
  width: 42%;
  animation: bootSlide 1.15s ease-in-out infinite;
}
.sync-progress-meta {
  margin-top: 7px;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--cyan);
}
.sync-device-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(0, 229, 255, 0.11);
  border: 1px solid rgba(0, 229, 255, 0.28);
  color: var(--cyan);
  font-size: 0.76rem;
  font-weight: 700;
  margin-bottom: 14px;
  max-width: 100%;
}
.sync-device-pill[hidden] { display: none; }
.sync-device-pill span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sync-steps {
  list-style: none;
  margin: 0;
  padding: 12px 13px;
  border-radius: 14px;
  background: rgba(7, 7, 26, 0.65);
  border: 1px solid var(--border-subtle);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.sync-step {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  color: var(--text-3);
  transition: color 0.2s;
}
.sync-step-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  flex-shrink: 0;
}
.sync-step.active {
  color: var(--text);
  font-weight: 700;
}
.sync-step.active .sync-step-dot {
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
}
.sync-step.done {
  color: var(--green);
  font-weight: 600;
}
.sync-step.done .sync-step-dot {
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
}
.sync-modal-actions {
  margin-top: 14px;
}

/* ── <notagil-pwa-install> Banner Flutuante & Modal Cross-Device ────────── */
.pwa-float-banner {
  position: fixed;
  right: 16px;
  bottom: 18px;
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 11px;
  max-width: min(390px, calc(100vw - 24px));
  padding: 10px 12px;
  border-radius: 18px;
  background: rgba(16, 18, 44, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 229, 255, 0.35);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.58);
}
html[data-dock="bottom"] .pwa-float-banner {
  left: 12px;
  right: 12px;
  bottom: calc(86px + env(safe-area-inset-bottom));
  margin: 0 auto;
}
.pwa-float-icon {
  border-radius: 11px;
  flex-shrink: 0;
}
.pwa-float-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.pwa-float-copy strong { font-size: 0.84rem; color: var(--text); }
.pwa-float-copy span {
  font-size: 0.72rem;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pwa-float-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.pwa-btn-sm { padding: 7px 11px; font-size: 0.78rem; border-radius: 10px; }
.pwa-close-x {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 0;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-2);
  cursor: pointer;
}
.pwa-hero { text-align: center; margin-bottom: 14px; }
.pwa-hero-icon-wrap {
  position: relative;
  display: inline-block;
  margin-bottom: 10px;
}
.pwa-hero-icon-wrap img {
  border-radius: 18px;
  box-shadow: 0 12px 32px rgba(124, 77, 255, 0.42);
}
.pwa-hero-badge {
  position: absolute;
  right: -8px;
  bottom: -4px;
  padding: 2px 7px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  color: #050611;
  font-size: 0.65rem;
  font-weight: 900;
}
.pwa-hero h2 { margin: 0 0 6px; font-size: 1.24rem; font-weight: 800; }
.pwa-hero p { margin: 0; font-size: 0.82rem; color: var(--text-2); }
.pwa-features {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}
.pwa-native-box {
  background: rgba(7, 7, 26, 0.7);
  border: 1px solid rgba(0, 229, 255, 0.25);
  border-radius: 14px;
  padding: 14px;
  text-align: center;
}
.pwa-native-box p { margin: 0 0 12px; font-size: 0.82rem; color: var(--text-2); }
.pwa-steps {
  background: rgba(7, 7, 26, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 13px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pwa-steps-head {
  font-size: 0.77rem;
  font-weight: 800;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.pwa-step-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.pwa-step-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--cyan);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.pwa-step-title { font-size: 0.84rem; font-weight: 800; color: var(--text); }
.pwa-step-desc { font-size: 0.76rem; color: var(--text-2); margin-top: 2px; }
.pwa-modal-footer { margin-top: 12px; }

/* ── Computadores Conectados (Telemetria por Empresa) ───────────────────── */
.devices-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 10px;
}
.device-chip-card {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  border-radius: 13px;
  background: rgba(7, 7, 26, 0.6);
  border: 1px solid var(--border-subtle);
}
.device-icon-box {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, rgba(124, 77, 255, 0.24), rgba(0, 229, 255, 0.16));
  border: 1px solid rgba(0, 229, 255, 0.28);
  color: var(--cyan);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.device-name {
  font-weight: 800;
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.device-model {
  font-size: 0.77rem;
  color: var(--cyan);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.device-meta {
  font-size: 0.71rem;
  color: var(--text-3);
  margin-top: 2px;
}

/* ── Lazy Loading Premium (Skeletons Geométricos + Reveal + Progresso) ──── */
.skeleton-head {
  height: 52px;
  border-radius: 14px;
  margin-bottom: 14px;
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.09) 50%, rgba(255,255,255,0.04) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
}
.skeleton-kpi-grid {
  display: grid;
  grid-template-columns: repeat(var(--kpi-cols), minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.skeleton-kpi {
  height: 98px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.09) 50%, rgba(255,255,255,0.04) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
}
.skeleton-card {
  height: 156px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.09) 50%, rgba(255,255,255,0.04) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
}
.skeleton-row {
  height: 46px;
  border-radius: 10px;
  margin-bottom: 8px;
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.09) 50%, rgba(255,255,255,0.04) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
}
.sk-line {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(255,255,255,0.05) 25%, rgba(255,255,255,0.12) 50%, rgba(255,255,255,0.05) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.15s infinite;
}
.sk-line.sk-sm { height: 9px; margin-top: 6px; opacity: 0.7; }
.sk-w-70 { width: 70%; }
.sk-w-60 { width: 60%; }
.sk-w-40 { width: 40%; }
.sk-pill {
  height: 22px;
  width: 78px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255,255,255,0.05) 25%, rgba(255,255,255,0.12) 50%, rgba(255,255,255,0.05) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.15s infinite;
}

.lazy-reveal {
  opacity: 0;
  transform: translateY(8px);
  animation: lazyRevealIn 0.28s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: var(--stagger, 0ms);
}
@keyframes lazyRevealIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (prefers-reduced-motion: reduce) {
  .lazy-reveal { animation: none; opacity: 1; transform: none; }
}

.lazy-progress-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 13px;
  padding: 10px 13px;
  margin-bottom: 12px;
}
.lazy-progress-wrap[hidden] { display: none; }
.lazy-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-2);
  font-weight: 700;
  margin-bottom: 7px;
}
.lazy-progress-track {
  height: 5px;
  width: 100%;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}
.lazy-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--cyan), var(--green));
  transition: width 0.35s ease;
}

.lazy-sentinel-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 18px 12px;
  color: var(--text-2);
  font-size: 0.82rem;
}
.lazy-loading-inline {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--cyan);
  font-weight: 700;
}
.lazy-spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(0, 229, 255, 0.22);
  border-top-color: var(--cyan);
  animation: spinOrb 0.75s linear infinite;
}
.lazy-more-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.lazy-more-hint { font-size: 0.76rem; color: var(--text-3); }
.lazy-more-btn { padding: 8px 16px; font-size: 0.81rem; }

.scroll-top-fab {
  position: fixed;
  right: 18px;
  bottom: 24px;
  z-index: 45;
  border: 1px solid rgba(0, 229, 255, 0.4);
  background: rgba(16, 18, 44, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--cyan);
  border-radius: 999px;
  padding: 9px 15px;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.52);
}
.scroll-top-fab[hidden] { display: none; }
html[data-dock="bottom"] .scroll-top-fab {
  bottom: calc(90px + env(safe-area-inset-bottom));
}

html[data-device="xs-phone"] .login-card {
  padding: 20px 16px 18px;
  border-radius: 20px;
}
html[data-device="xs-phone"] .login-sec-badge {
  font-size: 0.64rem;
}
