/* ==============================================================================
   🎨 MAIS CÂMERAS — DESIGN SYSTEM PREMIUM (SaaS)
   Dark-first, mobile-first. Fundo cinza-azulado #0F172A, laranja de marca.
   ============================================================================== */

/* ------------------------------------------------------------------------ */
/* 1. TOKENS                                                                    */
/* ------------------------------------------------------------------------ */
:root {
  --bg: #0F172A;            /* fundo principal (slate-900) */
  --bg-deep: #0B1120;       /* fundo mais profundo */
  --surface: #16203A;       /* cards / elevado */
  --surface-2: #1E293B;     /* elevado 2 / inputs */
  --surface-3: #243249;     /* hover / costuras */
  --border: #26354D;
  --border-strong: #33445F;

  --primary: #FF5A00;
  --primary-soft: #FF6A1F;
  --primary-ghost: rgba(255, 90, 0, 0.14);
  --primary-glow: rgba(255, 90, 0, 0.35);

  --blue: #2563EB;          /* gravação contínua */
  --blue-ghost: rgba(37, 99, 235, 0.16);

  --danger: #EF4444;
  --danger-ghost: rgba(239, 68, 68, 0.14);
  --success: #22C55E;
  --success-ghost: rgba(34, 197, 94, 0.14);
  --warn: #F59E0B;

  --text: #F1F5F9;
  --text-muted: #94A3B8;
  --text-dim: #64748B;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.2);
  --transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);

  --sidebar-w: 244px;
  --header-h: 64px;
  --bottomnav-h: 62px;
}

[data-theme="light"] {
  --bg: #F1F5F9;
  --bg-deep: #E2E8F0;
  --surface: #FFFFFF;
  --surface-2: #F8FAFC;
  --surface-3: #EFF3F9;
  --border: #E2E8F0;
  --border-strong: #CBD5E1;
  --text: #0F172A;
  --text-muted: #475569;
  --text-dim: #94A3B8;
  --shadow: 0 6px 24px rgba(15, 23, 42, 0.12);
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.08);
}

/* ------------------------------------------------------------------------ */
/* 2. BASE                                                                       */
/* ------------------------------------------------------------------------ */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-tap-highlight-color: transparent; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
  transition: background 0.3s ease;
}

img { max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; }
a { color: var(--primary); text-decoration: none; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ------------------------------------------------------------------------ */
/* 3. COMPONENTES BASE                                                         */
/* ------------------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 13.5px;
  font-weight: 700;
  transition: var(--transition);
  user-select: none;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary-soft), var(--primary));
  color: #fff;
  box-shadow: 0 4px 16px var(--primary-glow);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 22px var(--primary-glow); }
.btn-primary:active { transform: scale(0.97); }
.btn-ghost {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.btn-ghost:hover { background: var(--surface-3); color: var(--text); border-color: var(--border-strong); }
.btn-sm { padding: 7px 12px; font-size: 12.5px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.icon-btn {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  background: transparent;
  transition: var(--transition);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 18px;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 14px;
}
.card-head h3 { font-size: 15px; font-weight: 800; }
.card-desc { font-size: 13px; color: var(--text-muted); margin-bottom: 14px; line-height: 1.55; }

.field { margin-bottom: 16px; }
.field-label {
  display: block; font-size: 12.5px; font-weight: 700;
  color: var(--text-muted); margin-bottom: 7px;
}
.field-row { display: flex; align-items: center; justify-content: space-between; }
.field-link { font-size: 11.5px; font-weight: 600; }
.field-hint { font-size: 12px; color: var(--text-dim); margin-top: 7px; line-height: 1.5; }
.field-input, .select {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: var(--transition);
}
.field-input:focus, .select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-ghost);
}
.select { appearance: none; }
.input-btn-row { display: flex; gap: 8px; }
.input-btn-row .field-input { flex: 1; }
.input-btn-row .btn { flex-shrink: 0; }

.chips-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips-row::-webkit-scrollbar { display: none; }

.chip {
  padding: 7px 14px;
  border-radius: 24px;
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  display: inline-flex; align-items: center; gap: 7px;
  transition: var(--transition);
  flex-shrink: 0;
}
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 3px 12px var(--primary-glow);
}
.chip .chip-count {
  background: rgba(255,255,255,0.22); border-radius: 10px;
  font-size: 11px; padding: 1px 7px; font-weight: 800;
}

.seg-control {
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}
.seg-btn {
  padding: 7px 12px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  transition: var(--transition);
}
.seg-btn:hover { color: var(--text); }
.seg-btn.active { background: var(--surface-3); color: var(--text); box-shadow: var(--shadow-sm); }

.pulse-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); animation: pulse 1.8s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(34,197,94,0.6); }
  70% { box-shadow: 0 0 0 7px rgba(34,197,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: blink 1s infinite alternate; }
@keyframes blink { from { opacity: 0.3; } to { opacity: 1; } }
.motion-pulse { animation: motionPulse 1.4s infinite; }
@keyframes motionPulse {
  0% { box-shadow: 0 0 0 0 rgba(255,90,0,0.75); }
  70% { box-shadow: 0 0 0 10px rgba(255,90,0,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,90,0,0); }
}

html, body { height: 100%; }

/* ------------------------------------------------------------------------ */
/* 4. TELA DE LOGIN                                                             */
/* ------------------------------------------------------------------------ */
.auth-screen {
  position: relative;
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px 16px;
  background:
    radial-gradient(ellipse at 18% -8%, rgba(255,90,0,0.16), transparent 55%),
    radial-gradient(ellipse at 95% 110%, rgba(37,99,235,0.20), transparent 55%),
    linear-gradient(165deg, #0F172A 0%, #020617 100%);
}
[data-theme="light"] .auth-screen {
  background:
    radial-gradient(ellipse at 18% -8%, rgba(255,90,0,0.10), transparent 55%),
    radial-gradient(ellipse at 95% 110%, rgba(37,99,235,0.12), transparent 55%),
    linear-gradient(165deg, #E2E8F0 0%, #CBD5E1 100%);
}
/* Camada de profundidade: lente / circuito tecnológico sutil */
.auth-deco { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.auth-deco::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 84% 10%, rgba(255,90,0,0.10), transparent 36%),
    radial-gradient(circle at 84% 10%, transparent 46%, rgba(255,255,255,0.05) 47%, transparent 53%),
    radial-gradient(circle at 84% 10%, transparent 76%, rgba(255,255,255,0.045) 77%, transparent 84%),
    radial-gradient(circle at 8% 95%, rgba(37,99,235,0.12), transparent 40%);
}
.auth-deco::after {
  content: ""; position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='460' height='460'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.05' stroke-width='1'%3E%3Cpath d='M40 40h80M40 40v80M220 120h120M340 120v140M220 120v60M340 260H160M160 260v120M60 340h80M460 300v120M460 420h120'/%3E%3C/g%3E%3Cg fill='%23ffffff' fill-opacity='.06'%3E%3Ccircle cx='40' cy='40' r='3'/%3E%3Ccircle cx='220' cy='120' r='3'/%3E%3Ccircle cx='340' cy='260' r='3'/%3E%3Ccircle cx='160' cy='380' r='3'/%3E%3Ccircle cx='460' cy='300' r='3'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 460px 460px;
  opacity: 0.6;
}
.auth-card {
  position: relative; z-index: 1;
  width: 100%; max-width: 400px;
  padding: 38px 32px;
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.02)),
    rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow: 0 24px 60px rgba(2,6,23,0.60), inset 0 1px 0 rgba(255,255,255,0.06);
}
[data-theme="light"] .auth-card {
  background: rgba(255,255,255,0.74);
  border-color: rgba(15,23,42,0.10);
  box-shadow: 0 24px 60px rgba(15,23,42,0.18);
}
.auth-brand { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 20px; }
.auth-logo {
  height: 52px; width: auto; display: inline-block;
}
.auth-badge {
  font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--text-muted);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  padding: 5px 10px; border-radius: 8px;
}
.auth-title { font-size: 26px; font-weight: 900; text-align: center; letter-spacing: -0.5px; line-height: 1.15; }
.auth-subtitle { font-size: 13.5px; color: var(--text-muted); text-align: center; margin: 8px 0 24px; }
.auth-esq { font-size: 12.5px; font-weight: 700; color: var(--primary); }
.auth-esq:hover { text-decoration: underline; }
.input-affix { position: relative; }
.input-affix .field-input { padding-right: 46px; }
.input-eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-dim); border-radius: 9px;
  transition: var(--transition);
}
.input-eye:hover { color: var(--text); background: var(--surface-3); }
.input-eye:active { color: var(--primary); }
.btn-lg { padding: 14px 18px; font-size: 15px; border-radius: 12px; }
.bt-ic { display: inline-flex; }
.bt-spin {
  display: none;
  width: 17px; height: 17px; border-radius: 50%;
  border: 2.5px solid rgba(255,255,255,0.35); border-top-color: #fff;
  animation: spin 0.7s linear infinite;
}
.btn.is-loading .bt-spin { display: inline-block; }
.btn.is-loading .bt-ic { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.auth-hint {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  font-size: 12px; color: var(--text-muted);
  margin-top: 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px; padding: 9px 12px; text-align: center;
  line-height: 1.45;
}
.auth-hint svg { flex-shrink: 0; color: var(--blue); }
.auth-rodape { display: flex; gap: 8px; margin-top: 18px; }
.auth-rodape a {
  flex: 1;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 10px;
  border-radius: 10px;
  font-size: 12.5px; font-weight: 700;
  color: var(--text-muted);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.10);
  transition: var(--transition);
}
.auth-rodape a:hover { color: var(--text); border-color: rgba(255,255,255,0.22); transform: translateY(-1px); }
.auth-terms { text-align: center; font-size: 11.5px; margin-top: 16px; }
.auth-terms a { font-weight: 600; }
.auth-terms a:hover { text-decoration: underline; }
.auth-copy { display: block; margin-top: 6px; color: var(--text-dim); font-size: 11px; }

/* Tela de bloqueio (contrato suspenso) */
.block-icon {
  width: 64px; height: 64px;
  margin: 0 auto 18px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 18px;
  color: #FCA5A5;
  background: var(--danger-ghost);
  border: 1px solid rgba(239,68,68,0.4);
  box-shadow: 0 0 0 8px rgba(239,68,68,0.08);
}
.block-motivo {
  background: var(--warn);
  color: #0F172A;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 14px;
}
.block-info {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.6;
  text-align: center;
  margin: 0 0 18px;
  white-space: pre-line;
}
.auth-link-central {
  display: block;
  text-align: center;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--primary);
  margin: 16px 0;
}
.auth-link-central:hover { text-decoration: underline; }
.auth-alert-area { margin-bottom: 16px; }
.auth-alert {
  background: var(--danger-ghost);
  border: 1px solid rgba(239,68,68,0.4);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 12.5px;
  color: #FECACA;
  animation: shake 0.35s ease-in-out;
}
[data-theme="light"] .auth-alert { color: #B91C1C; }
.auth-alert b { display: block; margin-bottom: 4px; font-size: 13px; }
.auth-alert .btn { margin-top: 10px; width: 100%; }
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%,60% { transform: translateX(-5px); }
  40%,80% { transform: translateX(5px); }
}

/* Banner fixo de instalação do PWA (tela de login) */
.pwa-banner {
  position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  z-index: 90;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center; gap: 10px;
  padding: 12px 12px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid var(--border-strong);
  box-shadow: 0 12px 34px rgba(2,6,23,0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.pwa-banner-ic { font-size: 22px; line-height: 1; }
.pwa-banner-text strong { display: block; font-size: 13px; }
.pwa-banner-text span { display: block; font-size: 11.5px; color: var(--text-muted); margin-top: 2px; line-height: 1.4; }
.pwa-banner .btn { white-space: nowrap; }
.pwa-banner-x {
  color: var(--text-dim); font-size: 18px; line-height: 1;
  width: 28px; height: 28px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
}
.pwa-banner-x:hover { color: var(--text); background: var(--surface-2); }
@media (max-width: 640px) {
  .pwa-banner {
    grid-template-columns: auto 1fr auto;
  }
  .pwa-banner .btn { grid-column: 1 / -1; width: 100%; }
}

/* ------------------------------------------------------------------------ */
/* 5. APP SHELL / SIDEBAR / HEADER                                              */
/* ------------------------------------------------------------------------ */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-deep);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 200;
  padding: calc(20px + env(safe-area-inset-top, 0px)) 14px 20px;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}
.sidebar-brand { display: flex; align-items: center; justify-content: center; padding: 8px 0 20px; }
.sidebar-logo { height: 34px; }

.sidebar-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px;
  border-radius: 10px;
  font-size: 13.5px; font-weight: 600;
  color: var(--text-muted);
  transition: var(--transition);
  text-align: left;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--primary-ghost); color: var(--primary); }
.nav-item.active svg { color: var(--primary); }

.sidebar-foot { border-top: 1px solid var(--border); padding-top: 14px; display: flex; flex-direction: column; gap: 12px; }
.sidebar-user-name { font-size: 13px; font-weight: 800; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user-contract { font-size: 11.5px; color: var(--text-dim); }
.btn-logout {
  padding: 10px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-muted); font-size: 12.5px; font-weight: 700;
  transition: var(--transition);
}
.btn-logout:hover { background: var(--danger-ghost); border-color: rgba(239,68,68,0.4); color: var(--danger); }
.btn-install {
  padding: 10px; border-radius: 10px; display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--primary); font-size: 12.5px; font-weight: 700; cursor: pointer;
  transition: var(--transition);
}
.btn-install:hover { background: var(--primary-ghost); border-color: rgba(255,90,0,0.4); }

.fiber-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--success-ghost);
  border: 1px solid rgba(34,197,94,0.3);
  color: var(--success);
  font-size: 12px; font-weight: 700;
  padding: 7px 12px; border-radius: 24px;
  width: max-content;
}
.fiber-chip-small { padding: 5px 10px; font-size: 11px; }

.sidebar-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  z-index: 190; opacity: 0; visibility: hidden; transition: var(--transition);
}

.app-main {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex; flex-direction: column;
  min-height: 100vh;
  min-width: 0;
}

.app-header {
  position: sticky; top: 0; z-index: 150;
  height: calc(var(--header-h) + env(safe-area-inset-top, 0px));
  display: flex; align-items: center; justify-content: space-between;
  padding: env(safe-area-inset-top, 0px) 22px 0;
  background: rgba(15,23,42,0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
[data-theme="light"] .app-header { background: rgba(255,255,255,0.85); }

.header-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.menu-btn { display: none; }
.header-title { font-size: 16px; font-weight: 800; letter-spacing: -0.2px; }
.header-subtitle { display: block; font-size: 11.5px; color: var(--text-dim); font-weight: 600; }
.header-right { display: flex; align-items: center; gap: 8px; }

.header-user { display: flex; align-items: center; gap: 10px; padding-left: 10px; border-left: 1px solid var(--border); }
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-soft), var(--primary));
  color: #fff; font-weight: 900; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
}
.header-user-text { display: flex; flex-direction: column; line-height: 1.2; }
.header-user-name { font-size: 13px; font-weight: 800; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.header-user-contract { font-size: 11.5px; color: var(--text-dim); }

/* Sino de notificações */
.bell-wrap { position: relative; }
@keyframes bellRing {
  0% { transform: rotate(0); }
  20% { transform: rotate(15deg); }
  40% { transform: rotate(-15deg); }
  60% { transform: rotate(10deg); }
  80% { transform: rotate(-10deg); }
  100% { transform: rotate(0); }
}
.bell-ring {
  animation: bellRing 0.8s ease;
}
.bell-badge {
  position: absolute; top: 2px; right: 2px;
  min-width: 17px; height: 17px;
  background: var(--danger); color: #fff;
  border-radius: 10px; font-size: 10px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px; border: 2px solid var(--bg);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
}
.notif-panel {
  position: absolute; right: 0; top: 48px;
  width: 320px; max-width: calc(100vw - 32px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 8px 0;
  z-index: 300;
  max-height: 70vh; overflow-y: auto;
}
.notif-head { padding: 10px 16px; font-size: 13px; font-weight: 800; border-bottom: 1px solid var(--border); }
.notif-item {
  display: flex; gap: 10px; padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px; cursor: pointer;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--surface-2); }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }
.notif-dot.nd-offline { background: var(--danger); }
.notif-dot.nd-motion { background: var(--primary); }
.notif-dot.nd-storage { background: var(--warn); }
.notif-title { font-weight: 700; color: var(--text); }
.notif-meta { font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.notif-empty { padding: 24px 16px; text-align: center; color: var(--text-dim); font-size: 12.5px; }

/* ------------------------------------------------------------------------ */
/* 6. VIEW CONTAINER                                                             */
/* ------------------------------------------------------------------------ */
.view-container { flex: 1; padding: 24px 22px 40px; max-width: 1280px; width: 100%; margin: 0 auto; }
.view { display: none; }
.view.active { display: block; animation: fadeIn 0.25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.view-head { margin-bottom: 20px; }
.view-head h2 { font-size: 22px; font-weight: 900; letter-spacing: -0.4px; }
.view-sub { font-size: 13.5px; color: var(--text-muted); margin-top: 3px; }
.view-head-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.live-toolbar-label, .rec-toolbar-label { font-size: 11.5px; font-weight: 800; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.6px; }

/* ------------------------------------------------------------------------ */
/* 7. DASHBOARD                                                                 */
/* ------------------------------------------------------------------------ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px; margin-bottom: 22px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex; align-items: center; gap: 14px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.stat-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.stat-icon {
  width: 46px; height: 46px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.st-online { background: var(--success-ghost); color: var(--success); }
.st-motion { background: var(--primary-ghost); color: var(--primary); }
.st-rec { background: var(--blue-ghost); color: var(--blue); }
.st-fiber { background: var(--primary-ghost); color: var(--primary); }
.stat-num { font-size: 26px; font-weight: 900; letter-spacing: -0.5px; line-height: 1.1; display: block; }
.stat-label { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.stat-num.st-ok { font-size: 20px; color: var(--success); }

.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.dash-cameras { display: flex; flex-direction: column; gap: 9px; }
.dash-cam-row {
  display: flex; align-items: center; gap: 11px;
  padding: 10px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--border);
  cursor: pointer; transition: var(--transition);
}
.dash-cam-row:hover { border-color: var(--border-strong); background: var(--surface-3); }
.dash-cam-thumb {
  width: 54px; height: 40px; border-radius: 8px;
  background: #000 center/cover no-repeat;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-dim); position: relative; overflow: hidden; flex-shrink: 0;
}
.dash-cam-thumb.online::after {
  content: ''; position: absolute; top: 4px; left: 4px;
  width: 7px; height: 7px; border-radius: 50%; background: var(--success);
}
.dash-cam-info { min-width: 0; flex: 1; }
.dash-cam-name { font-size: 13.5px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cam-status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; flex-shrink: 0; }
.cam-status-dot.on { background: var(--success); box-shadow: 0 0 0 3px rgba(46, 204, 113, .16); }
.cam-status-dot.off { background: var(--danger); }
.dash-cam-extra { font-size: 11.5px; color: var(--text-dim); }
.dash-cam-status { font-size: 11px; font-weight: 800; flex-shrink: 0; }
.dash-cam-status.on { color: var(--success); }
.dash-cam-status.off { color: var(--danger); }

.dash-events { display: flex; flex-direction: column; gap: 9px; }
.event-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--border);
  cursor: pointer; transition: var(--transition);
}
.event-item:hover { border-color: var(--border-strong); background: var(--surface-3); }
.event-item.is-live { border-color: rgba(255,90,0,0.4); }
.event-item.cont { opacity: .72; }
.event-item.motion { background: rgba(255,90,0,0.06); border-left: 3px solid var(--primary); }
.event-time {
  font-size: 12px; font-weight: 900; color: var(--primary);
  background: var(--primary-ghost);
  padding: 4px 8px; border-radius: 7px; flex-shrink: 0; font-variant-numeric: tabular-nums;
}
.event-time.cont { color: var(--blue); background: var(--blue-ghost); }
.event-info { flex: 1; min-width: 0; }
.event-title {
  font-size: 13px; font-weight: 700;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; text-overflow: ellipsis;
}
.event-classe {
  display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 99px;
  font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em;
  vertical-align: 1px;
}
.event-classe.pessoa { color: #2e7d32; background: rgba(46, 125, 50, .16); }
.event-classe.veiculo { color: #b26a00; background: rgba(178, 106, 0, .16); }
.event-classe.animal { color: #1565c0; background: rgba(21, 101, 192, .16); }
.event-classe.outro { color: var(--text-dim); background: var(--surface-3); }
.event-meta { font-size: 11.5px; color: var(--text-dim); }
.event-thumb {
  display: block; margin-top: 8px; width: 100%; max-height: 150px;
  object-fit: cover; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface-3);
}
.event-play {
  flex-shrink: 0; width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-3); color: var(--text);
  transition: var(--transition);
}
.event-play:hover { background: var(--primary); color: #fff; }
.empty-state { color: var(--text-dim); font-size: 13px; text-align: center; padding: 26px 12px; }

/* ------------------------------------------------------------------------ */
/* 8. AO VIVO                                                                   */
/* ------------------------------------------------------------------------ */
.live-toolbar { display: flex; align-items: center; gap: 10px; }

.live-grid { display: none; }
.live-desktop { display: block; }
.live-grid {
  display: grid; gap: 14px;
  margin-bottom: 14px;
}
.live-grid.grid-auto { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.live-grid.grid-2x2 { grid-template-columns: repeat(2, 1fr); }
.live-grid.grid-3x3 { grid-template-columns: repeat(3, 1fr); }
.live-grid.grid-4x4 { grid-template-columns: repeat(4, 1fr); }
.live-grid.grid-5x5 { grid-template-columns: repeat(5, 1fr); }

.live-cell {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: var(--transition);
}
.live-cell:hover { border-color: var(--border-strong); }
.live-cell.live-focus { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-ghost), 0 0 24px rgba(255,148,30,.35); }
.live-video { width: 100%; height: 100%; object-fit: contain; }
.live-cell-top {
  position: absolute; top: 8px; left: 8px; right: 8px;
  display: flex; justify-content: space-between; align-items: flex-start;
  pointer-events: none; z-index: 2;
}
.live-name-badge {
  background: rgba(11, 17, 32, 0.72);
  backdrop-filter: blur(6px);
  color: var(--text);
  font-size: 11px; font-weight: 800;
  padding: 5px 9px; border-radius: 7px;
  display: inline-flex; align-items: center; gap: 6px;
  max-width: 70%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.live-name-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success); flex-shrink: 0; }
.live-name-badge.offline .dot { background: var(--danger); }
.live-name-badge.offline { color: #FECACA; }
.live-live-badge {
  background: var(--danger);
  color: #fff; font-size: 10px; font-weight: 900; letter-spacing: 0.5px;
  padding: 4px 8px; border-radius: 6px;
  display: inline-flex; align-items: center; gap: 5px;
}
.quality-badge {
  background: rgba(11,17,32,0.72); backdrop-filter: blur(6px);
  color: var(--text-muted); font-size: 10px; font-weight: 700;
  padding: 4px 8px; border-radius: 6px;
}
.motion-indicator {
  position: absolute; bottom: 10px; right: 10px;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,90,0,0.16);
  border: 2px solid var(--primary);
  color: var(--primary);
  display: none; align-items: center; justify-content: center;
  z-index: 3;
  pointer-events: none;
}
.motion-indicator.show { display: flex; animation: motionPulse 1.4s infinite; }
.live-cell-offline {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; color: var(--text-dim);
  background: #0A0F1C;
}
.live-cell-actions {
  position: absolute; right: 8px; bottom: 8px;
  display: flex; gap: 6px; z-index: 3;
  pointer-events: auto;
}
.lc-btn {
  width: 32px; height: 32px; border-radius: 8px;
  background: rgba(11,17,32,0.72); backdrop-filter: blur(6px);
  color: var(--text); display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.lc-btn:hover { background: var(--primary); color: #fff; }

.pagination-bar {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  margin-top: 6px;
}
.pag-indicator { font-size: 12.5px; font-weight: 800; color: var(--text-muted); min-width: 120px; text-align: center; }

/* Mobile carrossel */
.live-mobile { display: none; }
.carousel-wrap { overflow: hidden; border-radius: var(--radius); }
.live-carousel {
  display: flex;
  scroll-snap-type: x mandatory;
  overflow-x: auto;
  scrollbar-width: none;
  border-radius: var(--radius);
  scroll-behavior: smooth;
}
.live-carousel::-webkit-scrollbar { display: none; }
.carousel-slide {
  flex: 0 0 100%;
  scroll-snap-align: center;
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
}
.carousel-slide video { width: 100%; height: 100%; object-fit: contain; }
.carousel-slide .live-name-overlay {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  background: rgba(11,17,32,0.72); backdrop-filter: blur(6px);
  color: var(--text); font-size: 12px; font-weight: 800;
  padding: 5px 10px; border-radius: 8px;
}
.carousel-slide .motion-indicator { bottom: 14px; right: 14px; }
.carousel-dots { display: flex; justify-content: center; gap: 6px; padding: 10px 0 4px; }
.carousel-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--border-strong); transition: var(--transition); }
.carousel-dot.active { background: var(--primary); width: 20px; border-radius: 4px; }
.mobile-cam-name { text-align: center; font-size: 15px; font-weight: 800; padding: 8px 0 2px; }
.carousel-controls { display: flex; justify-content: center; gap: 10px; padding: 12px 0 16px; }
.carousel-controls .btn { flex: 1; max-width: 170px; }
.thumb-strip {
  display: flex; gap: 8px; overflow-x: auto;
  padding-bottom: 6px; scrollbar-width: none;
}
.thumb-strip::-webkit-scrollbar { display: none; }
.thumb-item {
  flex-shrink: 0;
  width: 92px; height: 58px;
  border-radius: 9px;
  background: #000;
  border: 2px solid var(--border);
  position: relative; overflow: hidden; cursor: pointer;
  transition: var(--transition);
}
.thumb-item video { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.thumb-item.active { border-color: var(--primary); }
.thumb-item .thumb-label {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: rgba(11,17,32,0.7);
  font-size: 9.5px; font-weight: 700;
  padding: 2px 4px; text-align: center;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ------------------------------------------------------------------------ */
/* 9. GRAVAÇÕES                                                                 */
/* ------------------------------------------------------------------------ */
.rec-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.rec-toolbar .chips-row { flex: 1; }
.rec-meta-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.rec-cam-name { font-size: 14px; font-weight: 800; }
.rec-day-label { font-size: 12px; color: var(--text-muted); font-weight: 700; }

.rec-player-card {
  position: relative;
  background: #000;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  aspect-ratio: 21 / 9;
  overflow: hidden;
  margin-bottom: 14px;
  display: flex; align-items: center; justify-content: center;
}
.rec-player { width: 100%; height: 100%; object-fit: contain; }
.rec-player-empty {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  color: var(--text-dim); font-size: 13.5px;
}
.rec-player-overlay {
  position: absolute; top: 12px; left: 12px; z-index: 3;
}
.rec-now-badge {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(239,68,68,0.9); color: #fff;
  font-size: 11px; font-weight: 900;
  padding: 6px 10px; border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.scrubber-card { margin-bottom: 18px; }
.scrubber-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.scrubber-title { font-size: 12.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); }
.scrubber {
  position: relative;
  height: 62px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
}
.scrubber-seg {
  position: absolute;
  top: 0; bottom: 0;
  background: rgba(37,99,235,0.28);
  border-right: 1px solid var(--bg);
}
.scrubber-seg.motion { background: rgba(255,90,0,0.45); }
.scrubber-seg.live { background: linear-gradient(90deg, rgba(239,68,68,0.55), rgba(239,68,68,0.35)); animation: blink 1.2s infinite alternate; }
.scrubber-ticks {
  position: absolute; left: 0; right: 0; bottom: 0; height: 14px;
  display: flex; justify-content: space-between;
  font-size: 8.5px; color: var(--text-dim);
  padding: 0 4px 2px;
}
.scrubber-now {
  position: absolute; top: 0; bottom: 0; width: 2px;
  background: #fff;
  box-shadow: 0 0 6px rgba(255,255,255,0.6);
  pointer-events: none;
}
.scrubber-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 9px; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-muted); font-weight: 600; }
.legend-swatch { width: 14px; height: 9px; border-radius: 3px; }
.sw-cont { background: var(--blue); opacity: 0.8; }
.sw-motion { background: var(--primary); }
.sw-live { background: var(--danger); }

.event-list { display: flex; flex-direction: column; gap: 9px; }
.chip-count {
  background: var(--surface-3); color: var(--text-muted);
  font-size: 11.5px; font-weight: 800;
  padding: 4px 10px; border-radius: 20px;
}

/* ------------------------------------------------------------------------ */
/* 10. CONFIGURAÇÕES                                                             */
/* ------------------------------------------------------------------------ */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.card-wide { grid-column: 1 / -1; }
.set-cam-select-wrap { margin-bottom: 4px; }

.toggle {
  width: 44px; height: 25px;
  border-radius: 20px;
  background: var(--surface-3);
  position: relative; cursor: pointer;
  transition: var(--transition);
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.toggle-knob {
  position: absolute; top: 2px; left: 2px;
  width: 19px; height: 19px;
  border-radius: 50%;
  background: #fff;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}
.toggle.on { background: var(--primary); border-color: var(--primary); }
.toggle.on .toggle-knob { left: 21px; }

.slider-block { margin: 14px 0 4px; }
.slider-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.sens-label { font-size: 13px; font-weight: 800; color: var(--primary); }
input[type="range"] {
  width: 100%; height: 6px; border-radius: 4px;
  appearance: none; -webkit-appearance: none;
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary) 50%, var(--surface-3) 50%, var(--surface-3) 100%);
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--primary);
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--primary); border: 3px solid #fff; cursor: pointer;
}
.sens-scale { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--text-dim); font-weight: 600; margin-top: 4px; }

.mask-list { display: flex; flex-direction: column; gap: 8px; }
.mask-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--surface-2); border: 1px solid var(--border);
  padding: 10px 12px; border-radius: 10px;
  font-size: 13px; font-weight: 600;
}
.mask-item small { color: var(--text-dim); font-weight: 600; }
.mask-del { color: var(--text-dim); font-size: 12px; font-weight: 800; }
.mask-del:hover { color: var(--danger); }
.mask-none { color: var(--text-dim); font-size: 12.5px; text-align: center; padding: 18px 0; }

/* ------------------------------------------------------------------------ */
/* 11. SUPORTE                                                                  */
/* ------------------------------------------------------------------------ */
.support-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.support-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  color: var(--text);
  transition: var(--transition);
}
.support-card:hover { border-color: var(--border-strong); transform: translateY(-2px); box-shadow: var(--shadow-sm); color: var(--text); }
.support-icon {
  width: 50px; height: 50px; border-radius: 14px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.sc-whatsapp .support-icon { background: var(--success-ghost); color: var(--success); }
.support-card:nth-child(2) .support-icon { background: var(--blue-ghost); color: var(--blue); }
.support-card:nth-child(3) .support-icon { background: var(--primary-ghost); color: var(--primary); }
.support-card:nth-child(4) .support-icon { background: var(--surface-3); color: var(--text-muted); }
.support-card h3 { font-size: 15px; font-weight: 800; }
.support-card p { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.support-arrow { margin-left: auto; color: var(--text-dim); font-weight: 800; }

/* ------------------------------------------------------------------------ */
/* 12. BOTTOM NAV (MOBILE)                                                      */
/* ------------------------------------------------------------------------ */
.bottom-nav {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0;
  height: calc(var(--bottomnav-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(15,23,42,0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  z-index: 180;
}
.bn-item {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px;
  font-size: 10.5px; font-weight: 700;
  color: var(--text-dim);
  transition: var(--transition);
}
.bn-item.active { color: var(--primary); }
.bn-item.active svg { filter: drop-shadow(0 0 6px var(--primary-glow)); }

/* ------------------------------------------------------------------------ */
/* 13. MODAIS                                                                   */
/* ------------------------------------------------------------------------ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(2, 6, 15, 0.72);
  backdrop-filter: blur(5px);
  display: flex; align-items: center; justify-content: center;
  padding: 18px;
  animation: fadeIn 0.18s ease;
}
.modal-card {
  width: 100%; max-width: 460px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow);
  animation: modalUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 92vh; overflow-y: auto;
}
@keyframes modalUp { from { opacity: 0; transform: translateY(18px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.modal-head h3 { font-size: 16px; font-weight: 900; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.modal-actions .btn:first-child { margin-right: auto; }

.modal-player-full {
  width: 100%; max-width: 900px;
  background: #000;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.modal-player-top {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px;
  background: rgba(11,17,32,0.9);
}
.fplayer-cam { font-size: 13px; font-weight: 800; color: var(--text); margin-right: 10px; }
.fplayer-time { font-size: 12px; font-weight: 700; color: var(--text-muted); }
.modal-player-foot {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 12px 16px;
  background: rgba(11,17,32,0.9);
}
.fplayer-meta { font-size: 12px; color: var(--text-muted); }

.modal-mask-card { max-width: 640px; }
.mask-canvas-wrap {
  position: relative;
  background: #000;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  width: 100%;
}
.mask-canvas { display: block; width: 100%; max-height: 56vh; }
.mask-canvas-placeholder {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-dim); font-size: 13px; text-align: center; padding: 20px;
  pointer-events: none;
}
.mask-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.mask-tools { display: flex; gap: 6px; }
.mask-tool {
  padding: 7px 12px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text-muted); font-size: 12.5px; font-weight: 700; cursor: pointer;
  transition: var(--transition);
}
.mask-tool:hover { color: var(--text); }
.mask-tool.active { background: var(--primary-ghost); color: var(--primary); border-color: var(--primary); }
.mask-toolbar-actions { display: flex; gap: 6px; }

.mask-example {
  display: flex; flex-direction: column; gap: 10px; margin-top: 16px;
  padding: 14px; border-radius: 10px; background: var(--surface-2); border: 1px dashed var(--border-strong);
}
.mask-example-title { font-size: 11.5px; font-weight: 900; text-transform: uppercase; letter-spacing: .4px; color: var(--text-muted); }
.mask-example svg { width: 100%; height: auto; border-radius: 8px; background: #0A0F1C; }

/* Modal de visualização rápida de evento (push) */
.modal-evento-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  max-width: 420px;
  width: 92%;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0,0,0,.55);
  position: relative;
}
.modal-evento-close {
  position: absolute; top: 10px; right: 10px; z-index: 10;
  width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid rgba(0,0,0,.5); background: rgba(0,0,0,.55);
  color: #fff; font-size: 18px; font-weight: 900; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.modal-evento-close:hover { background: rgba(0,0,0,.8); }
.modal-evento-img-wrap {
  position: relative;
  background: #0A0F1C;
  border-bottom: 1px solid var(--border);
}
.modal-evento-img {
  display: block; width: 100%; aspect-ratio: 16 / 10;
  object-fit: cover; background: #0A0F1C;
}
.modal-evento-badge-classe {
  position: absolute; bottom: 10px; left: 10px;
  background: rgba(0,0,0,.65); backdrop-filter: blur(6px);
  color: #fff; border-radius: 8px; padding: 4px 10px;
  font-size: 12px; font-weight: 800; border: 1px solid rgba(255,255,255,.12);
}
.modal-evento-live-dot {
  position: absolute; top: 10px; left: 10px;
  background: var(--danger); color: #fff;
  border-radius: 8px; padding: 4px 10px;
  font-size: 11px; font-weight: 900; display: flex; align-items: center; gap: 5px;
}
.modal-evento-body { padding: 16px 18px 18px; }
.modal-evento-title { font-size: 16px; font-weight: 900; color: var(--text); margin: 0 0 6px; line-height: 1.25; }
.modal-evento-meta { font-size: 12.5px; color: var(--text-muted); margin-bottom: 16px; line-height: 1.5; }
.modal-evento-actions { display: flex; gap: 10px; }
.btn-evento-action { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 12px 14px; border-radius: 10px; font-size: 13px; font-weight: 800; border: none; cursor: pointer; transition: var(--transition); }
.btn-evento-action.btn-primary { background: var(--primary); color: #fff; }
.btn-evento-action.btn-primary:hover { filter: brightness(1.1); }
.btn-evento-action.btn-ghost { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn-evento-action.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }

@media (max-width: 640px) {
  .modal-evento-card { width: 96%; max-width: none; border-radius: 14px; }
  .modal-evento-actions { flex-direction: column; }
  .btn-evento-action { max-width: none; }
}

.support-faq { margin-top: 28px; }
.support-faq h3 { font-size: 14.5px; font-weight: 900; margin-bottom: 12px; }
.support-faq details {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; margin-bottom: 8px; cursor: pointer;
}
.support-faq summary { cursor: pointer; font-size: 13px; font-weight: 800; color: var(--text); }
.support-faq details[open] summary { margin-bottom: 6px; color: var(--primary); }
.support-faq details p { font-size: 12.5px; color: var(--text-muted); margin-top: 4px; line-height: 1.5; }

.terms-body { max-height: 55vh; overflow-y: auto; font-size: 13px; color: var(--text-muted); line-height: 1.6; padding-right: 4px; }
.terms-body h4 { color: var(--text); font-size: 13.5px; margin: 14px 0 4px; font-weight: 800; }
.terms-body p { margin-bottom: 4px; }
.terms-body strong { color: var(--text); }

/* ------------------------------------------------------------------------ */
/* 14. TOAST                                                                     */
/* ------------------------------------------------------------------------ */
.toast {
  position: fixed;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  right: 24px;
  max-width: 340px;
  background: var(--surface-3);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-left: 4px solid var(--primary);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 13px; font-weight: 600;
  box-shadow: var(--shadow);
  z-index: 2000;
  opacity: 0; transform: translateY(12px);
  transition: var(--transition);
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* ------------------------------------------------------------------------ */
/* 15. RESPONSIVO                                                                */
/* ------------------------------------------------------------------------ */
@media (max-width: 1023px) {
  .sidebar { transform: translateX(-100%); box-shadow: 2px 0 30px rgba(0,0,0,0.4); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop.show { opacity: 1; visibility: visible; }
  .app-main { margin-left: 0; }
  .menu-btn { display: inline-flex; }
  .drag-hint { display: inline-flex; }
}

@media (max-width: 820px) {
  .live-grid.grid-3x3, .live-grid.grid-4x4, .live-grid.grid-5x5, .live-grid.grid-2x2 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
  .dash-grid { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  body { padding-bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom, 12px)); }
  .bottom-nav { display: flex; }
  .app-header { padding: env(safe-area-inset-top, 0px) 12px 0; height: calc(56px + env(safe-area-inset-top, 0px)); }
  .header-user-text { display: none; }
  .header-cam-count, #header-cam-count { display: none; }
  .fiber-chip-small span:last-child { display: none; }
  .view-container { padding: 16px 12px 28px; }
  .view-head h2 { font-size: 19px; }

  .live-desktop { display: none; }
  .live-mobile { display: block; }
  .live-toolbar { display: none; }

  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-num { font-size: 22px; }
  .stat-icon { width: 40px; height: 40px; }

  .rec-player-card { aspect-ratio: 16 / 9; }
  .modal-player-full { max-height: 94vh; }
  .modal-player-top, .modal-player-foot { padding: 10px 12px; }

  .toast { left: 16px; right: 16px; bottom: calc(var(--bottomnav-h) + 12px + env(safe-area-inset-bottom, 0px)); max-width: none; justify-content: center; }

  .auth-card { width: 92%; max-width: 420px; padding: 28px 20px; }
  .auth-logo { height: 46px; }
  .auth-title { font-size: 22px; }
  .auth-rodape { flex-direction: column; }
}

/* ============================================================
   COMPARTILHAR ACESSO
   ============================================================ */
.share-limite {
  font-size: 12px; font-weight: 700; color: var(--primary);
  background: var(--toolbar); border: 1px solid var(--border);
  border-radius: 999px; padding: 4px 10px; white-space: nowrap;
}
.share-setores {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 8px;
}
.share-chip {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 600; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 999px; padding: 7px 12px; cursor: pointer;
  transition: border-color .15s, color .15s;
}
.share-chip:hover { border-color: var(--border-strong); }
.share-chip input { accent-color: var(--primary); }
.share-chip:has(input:checked) {
  border-color: var(--primary); color: var(--primary);
  background: var(--toolbar);
}
.share-list { display: flex; flex-direction: column; gap: 10px; }
.share-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px;
}
.share-row-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.share-row-main strong { font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-row-user { font-size: 12px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-row-actions { display: flex; gap: 8px; flex-shrink: 0; }
.share-row-actions .btn-danger-sm {
  background: var(--danger-ghost); color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.4);
  padding: 7px 12px; font-size: 12.5px; border-radius: 10px; font-weight: 700; cursor: pointer;
}
.share-row-actions .btn-danger-sm:hover { background: var(--danger); color: #fff; }
.share-row-actions .btn-ghost { font-weight: 700; }