/* impeccable-disable overused-font -- Inter body + JetBrains Mono EDGE/CAM/YOLO labels are intentional system type stack */
/* impeccable-disable codex-grid-background -- EdgeSecurity blueprint hero grid is intentional system motif, not generic decoration */
/* impeccable-disable layout-transition -- Sidebar uses contain:layout isolation; max-width/padding are for accessible label reveal with staggered transform/opacity */
:root {
  --navy-900: #080d1a;
  --navy-800: #0c1526;
  --navy-700: #101d33;
  --blue: #2f6fed;
  --cyan: #22d3ee;
  --bg: #eef1f6;
  --card: #fff;
  --text: #0f172a;
  --muted: #5b6d82;
  --border: #e5e9f0;
  --green: #16a34a;
  --red: #dc2626;
  --amber: #d97706;
  --purple: #7c3aed;
  --radius: 14px;
}
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body {
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
} /* impeccable-disable-line overused-font -- Inter is project system-stack, not a styling crutch */
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
  border: 0;
}
a {
  text-decoration: none;
  color: inherit;
}
.app-shell {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  contain: layout;
  width: 250px;
  flex-shrink: 0;
  background: var(--navy-900);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sb-logo {
  color: #fff;
  font-size: 1.1875rem;
  font-weight: 800;
  padding: 4px 8px 26px;
}
.sb-logo span,
.brand-title span {
  color: var(--cyan);
}
.sb-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.sb-item,
.sb-logout {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 11px;
  padding: 11px 14px;
  border-radius: 9px;
  color: #94a3b8;
  background: transparent;
  width: 100%;
  text-align: left;
  font-size: 0.875rem;
  font-weight: 600;
}
.sb-item:hover,
.sb-logout:hover {
  background: var(--navy-700);
  color: #e2e8f0;
}
.sb-item.active {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 6px 16px -6px rgba(47, 111, 237, 0.7);
}
.sb-item .ico,
.sb-logout .ico {
  width: 18px;
  min-width: 18px;
  text-align: center;
  font-size: 1.125rem;
  line-height: 1;
}
.sb-user {
  color: #cbd5e1;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 15px 8px 5px;
  font-size: 0.75rem;
}
.sb-user strong {
  display: block;
  color: #fff;
  font-size: 0.8125rem;
}
.sb-logout {
  margin-top: 5px;
}
.content {
  flex: 1;
  padding: 28px 30px 60px;
  min-width: 0;
}
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
}
.page-head h1 {
  font-size: 1.75rem;
  letter-spacing: -0.02em;
  font-weight: 800;
}
.page-head p {
  color: var(--muted);
  font-size: 0.84375rem;
  margin-top: 4px;
}
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 20px;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 17px 20px;
  border-bottom: 1px solid var(--border);
}
.card-head h2 {
  font-size: 1.02rem;
  font-weight: 700;
}
.card-head p {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 3px;
}
.link {
  font-size: 0.78125rem;
  color: var(--blue);
  font-weight: 700;
}
.btn {
  padding: 11px 16px;
  min-height: 44px;
  border-radius: 9px;
  font-size: 0.8125rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.btn-primary {
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  color: #fff;
}
.btn-secondary {
  background: #e9eef6;
  color: #334155;
}
.btn-danger {
  background: #fee2e2;
  color: #b91c1c;
}
.btn-small {
  padding: 7px 10px;
  font-size: 0.71875rem;
}
.btn-full {
  width: 100%;
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
.stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 19px;
}
.stat .label {
  font-size: 0.75rem;
  color: var(--muted);
}
.stat .value {
  font-size: 1.75rem;
  font-weight: 800;
  margin-top: 7px;
}
.stat .hint {
  font-size: 0.6875rem;
  color: var(--muted);
  margin-top: 5px;
}
.dashboard-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 20px;
}
.camera-stage {
  height: 365px;
  background: var(--navy-800);
  display: flex;
  align-items: center;
  justify-content: center;
}
.camera-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: #cbd5e1;
  text-align: center;
}
.camera-icon {
  width: 68px;
  height: 68px;
  border-radius: 16px;
  background: var(--navy-700);
  display: grid;
  place-items: center;
  font-size: 1.875rem;
  color: var(--cyan);
}
.camera-placeholder span {
  font-size: 0.75rem;
  color: #64748b;
}
.camera-placeholder .btn {
  margin-top: 10px;
}
.live {
  background: var(--green);
  color: #fff;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 700;
}
.list {
  padding: 4px 20px;
}
.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.list-item:last-child {
  border-bottom: 0;
}
.list-item strong {
  font-size: 0.8125rem;
}
.list-item span {
  font-size: 0.71875rem;
  color: var(--muted);
}
.level {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 700;
}
.critical {
  background: #fee2e2;
  color: #b91c1c;
}
.high {
  background: #fef3c7;
  color: #a16207;
}
.normal {
  background: #dcfce7;
  color: #15803d;
}
.table-wrap {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
}
th {
  text-align: left;
  padding: 12px 16px;
  font-size: 0.71875rem;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td {
  padding: 13px 16px;
  font-size: 0.78125rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tr:last-child td {
  border-bottom: 0;
}
.badge {
  display: inline-block;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 700;
}
.green {
  background: #dcfce7;
  color: #15803d;
}
.red {
  background: #fee2e2;
  color: #b91c1c;
}
.amber {
  background: #fef3c7;
  color: #a16207;
}
.blue {
  background: #dbeafe;
  color: #1d4ed8;
}
.camera-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
.camera-card-small {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.cam-thumb {
  height: 160px;
  background: linear-gradient(135deg, #0c1526, #16233d);
  display: grid;
  place-items: center;
  color: #64748b;
}
.cam-info {
  padding: 14px;
}
.cam-info h3 {
  font-size: 0.875rem;
}
.cam-info p {
  font-size: 0.71875rem;
  color: var(--muted);
  margin-top: 4px;
}
.cam-actions {
  display: flex;
  gap: 7px;
  margin-top: 12px;
}
.cam-status {
  font-size: 0.625rem;
  font-weight: 700;
}
.filter-card {
  padding: 20px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.filter-card select,
.filter-card input,
.filters input,
.settings-card input,
.settings-card select {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 0.78125rem;
  min-height: 38px;
}
.filter-card select,
.filter-card input {
  min-width: 170px;
}
.report-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}
.chart-card {
  padding-bottom: 10px;
}
.chart-card canvas {
  width: 100%;
  height: 280px;
  display: block;
}
.filters {
  padding: 20px;
  display: flex;
  align-items: end;
  gap: 15px;
  flex-wrap: wrap;
}
.filters label,
.settings-card label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
}
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.settings-card {
  padding: 20px;
}
.settings-card h2 {
  font-size: 0.9375rem;
  margin-bottom: 18px;
}
.settings-card label {
  margin-bottom: 14px;
}
.switch-line {
  flex-direction: row !important;
  align-items: center;
}
.switch-line input {
  width: auto;
}
.modal {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.62);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 100;
}
.modal.hidden {
  display: none;
}
.modal-box {
  width: min(620px, 100%);
  background: #fff;
  border-radius: 16px;
  padding: 24px;
}
.modal-box h2 {
  font-size: 1.125rem;
  margin-bottom: 18px;
}
.modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.modal-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
}
.modal-grid input,
.modal-grid select {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}
.checks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 5px;
}
.checks label {
  font-weight: 500;
}
.toast {
  position: fixed;
  right: 22px;
  top: 22px;
  background: var(--navy-900);
  color: #fff;
  padding: 12px 17px;
  border-radius: 10px;
  font-size: 0.78125rem;
  z-index: 200;
  box-shadow: 0 14px 28px rgba(2, 6, 23, 0.18);
  display: none;
}
.toast.show {
  display: block;
}
.empty {
  padding: 32px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1.5;
}
.table-wrap > .empty-state {
  padding: 24px 20px;
}
.list > .empty-state {
  padding: 24px 0;
}
.login-body {
  background: #060a14;
}
.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.15fr 560px;
  background: #070a14;
  position: relative;
  overflow: hidden;
}
.login-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      900px 600px at 18% 18%,
      rgba(47, 111, 237, 0.22),
      transparent 62%
    ),
    radial-gradient(
      760px 520px at 92% 92%,
      rgba(34, 211, 238, 0.13),
      transparent 60%
    ),
    linear-gradient(180deg, #070c1a 0%, #0a1226 55%, #070c1a 100%);
  pointer-events: none;
  z-index: 0;
}
.login-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 56%,
    rgba(248, 250, 252, 0.035) 100%
  );
  pointer-events: none;
  z-index: 0;
}
.login-hero {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
  padding: 64px 56px 42px;
  color: #e2e8f0;
  min-width: 0;
}
.login-hero-top {
  display: flex;
  align-items: center;
  gap: 12px;
}
.login-hero-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #0f1b33;
  border: 1px solid rgba(255, 255, 255, 0.09);
  display: grid;
  place-items: center;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
}
.login-hero-mark img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}
.login-hero-brand {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
}
.login-hero-brand span {
  color: #22d3ee;
}
.login-hero-copy {
  max-width: 620px;
  margin-top: 36px;
}
.login-hero-copy h2 {
  font-size: clamp(2rem, 3vw, 2.75rem);
  line-height: 0.92;
  letter-spacing: -0.048em;
  font-weight: 800;
  color: #fff;
}
.login-hero-copy h2 i {
  font-style: normal;
  color: #7dd3fc;
}
.login-hero-copy > p {
  margin-top: 16px;
  color: #b8cce6;
  line-height: 1.62;
  font-size: 1.06rem;
  max-width: 52ch;
}
.login-hero-points {
  margin-top: 30px;
  display: grid;
  gap: 16px;
}
.login-hero-point {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.login-hero-point .ico {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.11);
  display: grid;
  place-items: center;
  color: #7dd3fc;
  font-size: 1.35rem;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
}
.login-hero-point strong {
  display: block;
  color: #fff;
  font-size: 0.92rem;
  letter-spacing: -0.015em;
  line-height: 1.25;
}
.login-hero-point span {
  display: block;
  color: #a8bdd8;
  font-size: 0.88rem;
  margin-top: 4px;
  line-height: 1.55;
}
.login-hero-foot {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  color: #859ab6;
  font-size: 0.76rem;
}
.login-hero-foot .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.14);
  animation: heroPulse 2.2s ease infinite;
}
@keyframes heroPulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.08);
    opacity: 0.9;
  }
}
.login-hero::after {
  content: "";
  position: absolute;
  right: 6%;
  top: 22%;
  width: min(420px, 38%);
  height: 52%;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.055) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(
    560px 360px at 38% 42%,
    black 42%,
    transparent 72%
  );
  -webkit-mask-image: radial-gradient(
    560px 360px at 38% 42%,
    black 42%,
    transparent 72%
  );
  opacity: 0.42;
  pointer-events: none;
  z-index: 0;
}
.login-hero > * {
  position: relative;
  z-index: 1;
}
.login-hero-copy::after {
  content: "";
  display: block;
  margin-top: 22px;
  width: 100%;
  height: 64px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='520' height='64' viewBox='0 0 520 64'%3E%3Cg fill='none' stroke='%237dd3fc' stroke-width='1.15' stroke-linecap='round' opacity='0.14'%3E%3Crect x='1' y='14' width='92' height='36' rx='10'/%3E%3Crect x='214' y='14' width='92' height='36' rx='10'/%3E%3Crect x='426' y='14' width='92' height='36' rx='10'/%3E%3Cpath d='M93 32 H214'/%3E%3Cpath d='M306 32 H426'/%3E%3Ccircle cx='158' cy='32' r='2.8' fill='%237dd3fc' stroke='none' opacity='0.9'/%3E%3Ccircle cx='370' cy='32' r='2.8' fill='%237dd3fc' stroke='none' opacity='0.9'/%3E%3C/g%3E%3Ctext x='47' y='34' text-anchor='middle' font-family='JetBrains Mono, monospace' font-size='7.2' fill='%23a8bdd8' opacity='0.55'%3EEDGE%3C/text%3E%3Ctext x='260' y='34' text-anchor='middle' font-family='JetBrains Mono, monospace' font-size='7.2' fill='%23a8bdd8' opacity='0.55'%3ECAM%3C/text%3E%3Ctext x='472' y='34' text-anchor='middle' font-family='JetBrains Mono, monospace' font-size='7.2' fill='%23a8bdd8' opacity='0.55'%3EYOLO%3C/text%3E%3C/svg%3E")
    no-repeat left center;
  background-size: 520px 64px;
  opacity: 0.95;
}
@media (max-width: 980px) {
  .login-hero::after,
  .login-hero-copy::after {
    display: none;
  }
}

.login-panel {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  padding: 48px 40px;
  background: linear-gradient(180deg, #eef1f6 0%, #e6eaf2 100%);
}
.login-card {
  width: min(480px, 100%);
  background: #fff;
  border: 1px solid #e5e9f0;
  border-radius: 20px;
  padding: 28px 26px 22px;
  box-shadow:
    0 14px 28px rgba(2, 6, 23, 0.12),
    0 2px 8px rgba(15, 23, 42, 0.06),
    inset 0 1px 0 rgba(34, 211, 238, 0.14);
  animation: loginIn 0.52s cubic-bezier(0.16, 1, 0.3, 1) both;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.login-card-head {
  gap: 14px;
  align-items: flex-start;
}
.login-card-head > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
#auth-subtitle {
  margin: 0;
  line-height: 1.4;
}
#login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
#login-form .login-field {
  margin-bottom: 0;
}
#login-form .form-error {
  min-height: 0;
  margin: -4px 0 2px;
}
#login-form .check {
  margin: 2px 0 2px;
}
.login-card .login-foot {
  margin-top: 2px;
}
@keyframes loginIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.login-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}
.login-card-head h1 {
  font-size: 1.42rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #0f172a;
  line-height: 1;
}
.login-card-head .badge {
  padding: 6px 9px;
  border-radius: 999px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #475569;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.login-card > p {
  color: #64748b;
  font-size: 0.78rem;
  margin: 6px 0 20px;
  line-height: 1.5;
}
.login-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: #334155;
  font-size: 0.76rem;
  font-weight: 650;
  margin-bottom: 14px;
}
.login-field input {
  padding: 12px 13px;
  border-radius: 11px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #0f172a;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background-color 0.18s ease;
}
.login-field input::placeholder {
  color: #94a3b8;
}
.login-field input:focus {
  outline: none;
  border-color: #93b4ff;
  box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.14);
  background: #fff;
}
.login-card .check {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  font-size: 0.73rem;
  color: #64748b;
  font-weight: 500;
  margin: 2px 0 14px;
}
.login-card .check input {
  width: 16px;
  height: 16px;
  accent-color: #0f172a;
}
.form-error {
  color: #dc2626;
  font-size: 0.74rem;
  min-height: 18px;
  line-height: 1.4;
}
.login-card .btn-primary {
  background: #0f172a;
  color: #fff;
  min-height: 44px;
  border-radius: 11px;
  box-shadow: 0 8px 20px rgba(2, 6, 23, 0.18);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background-color 0.18s ease;
}
.login-card .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(2, 6, 23, 0.22);
  background: #111d33;
}
.login-card .btn-primary:active {
  transform: translateY(0) scale(0.985);
}
.login-foot {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #e2e8f0;
  text-align: center;
  color: #64748b;
  font-size: 0.75rem;
}
@media (max-width: 980px) {
  .login-screen {
    grid-template-columns: 1fr;
  }
  .login-hero {
    flex-direction: column;
    gap: 14px;
    min-height: auto;
    padding: 22px 18px 18px;
    justify-content: flex-start;
  }
  .login-hero-copy {
    margin-top: 14px;
  }
  .login-hero-copy h2 {
    font-size: 1.85rem;
  }
  .login-hero-copy > p {
    font-size: 0.92rem;
  }
  .login-hero-points {
    margin-top: 16px;
    display: flex;
    flex-direction: row;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }
  .login-hero-points::-webkit-scrollbar {
    display: none;
  }
  .login-hero-point {
    flex: 0 0 auto;
    min-width: 168px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    padding: 8px 12px;
    gap: 8px;
  }
  .login-hero-point .ico {
    width: 26px;
    height: 26px;
    flex: 0 0 26px;
    font-size: 0.95rem;
  }
  .login-hero-point strong {
    font-size: 0.78rem;
  }
  .login-hero-point span {
    display: none;
  }
  .login-hero::after,
  .login-hero-copy::after {
    display: none;
  }
  .login-panel {
    padding: 22px 16px;
  }
  .login-card {
    width: min(480px, 100%);
  }
}
@media (prefers-reduced-motion: reduce) {
  .login-card {
    animation: none;
  }
  .login-hero-foot .dot {
    animation: none;
  }
}
@media (max-width: 1100px) {
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .camera-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .dashboard-grid,
  .report-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 820px) {
  .app-shell {
    flex-direction: column;
  }
  .sidebar {
    contain: layout;
    width: 100%;
    height: auto;
    position: relative;
    padding: 10px;
    flex-direction: row;
  }
  .sb-logo,
  .sb-user {
    display: none;
  }
  .sb-nav {
    flex-direction: row;
    overflow: auto;
  }
  .sb-item {
    white-space: nowrap;
  }
  .sb-logout {
    width: auto;
    white-space: nowrap;
  }
  .content {
    padding: 20px 15px;
  }
  .camera-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }
  .page-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .login-screen {
    gap: 35px;
  }
  .login-brand {
    display: none;
  }
}
@media (max-width: 520px) {
  .stat-grid {
    grid-template-columns: 1fr;
  }
  .modal-grid {
    grid-template-columns: 1fr;
  }
  .login-card {
    width: 100%;
    max-width: 370px;
  }
  .filter-card > * {
    width: 100%;
  }
}
body.dark {
  --bg: #0b1220;
  --card: #111827;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --border: #253247;
}
body.dark .btn-secondary {
  background: #243047;
  color: #e5e7eb;
}
body.dark input,
body.dark select {
  background: #0f172a;
  color: #e5e7eb;
}
html.font-small {
  --font-scale: 0.875;
}
html.font-normal {
  --font-scale: 1;
}
html.font-large {
  --font-scale: 1.125;
}
html.font-xlarge {
  --font-scale: 1.3125;
}
/* V6: alinhamento e espaçamento consistente */
.card-head {
  min-height: 62px;
}
.card-head > div {
  min-width: 0;
}
.card-head h2,
.card-head p {
  line-height: 1.35;
}
.empty,
.empty-state {
  padding: 32px 24px !important;
  line-height: 1.5;
}
.list {
  padding: 6px 20px;
}
.table-wrap {
  padding: 0;
}
.stat {
  min-width: 0;
}
.stat .value {
  line-height: 1.1;
}
.content > .card:last-child {
  margin-bottom: 0;
}
.camera-stage {
  position: relative;
}
.camera-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.device-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
}
.device-row:last-child {
  border-bottom: 0;
}
.device-row > span {
  min-width: 0;
}
.device-row strong,
.device-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}
.device-row small {
  color: var(--muted);
  font-size: 0.6875rem;
  margin-top: 3px;
}
.camera-permission-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}
.form-notice {
  padding: 10px 12px;
  margin-bottom: 15px;
  border: 1px solid rgba(34, 211, 238, 0.25);
  background: rgba(34, 211, 238, 0.08);
  color: #475569;
  border-radius: 8px;
  font-size: 0.75rem;
  line-height: 1.45;
}
.modal-box .card-head {
  margin: -24px -24px 20px;
}
.modal-box {
  padding: 24px;
}
@media (max-width: 650px) {
  .camera-permission-grid {
    grid-template-columns: 1fr;
  }
  .modal-box .card-head {
    margin: -24px -24px 18px;
  }
}

/* V6.1 Refinamento de UI: layout responsivo, profundidade, contraste e barra lateral fluida */
:root {
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 10px 28px rgba(15, 23, 42, 0.09);
  --shadow-lg: 0 22px 55px rgba(15, 23, 42, 0.14);
  --focus: 0 0 0 3px rgba(34, 211, 238, 0.18);
  --font-scale: 1;
}

/* Correção do bug "Tamanho da fonte": todo font-size do CSS passou a ser
   declarado em rem, e o html define o tamanho base multiplicado por
   --font-scale (alterado pelas classes body.font-* acima). Assim, trocar
   o tamanho da fonte em Configurações escala proporcionalmente TODO o
   texto do sistema (títulos, tabelas, botões, cards), não só o body. */
html {
  font-size: calc(16px * var(--font-scale));
}
html {
  scroll-behavior: smooth;
}
body {
  overflow-x: hidden;
}
button,
a,
input,
select {
  transition:
    background-color 0.22s ease,
    color 0.22s ease,
    border-color 0.22s ease,
    box-shadow 0.22s ease,
    transform 0.22s ease,
    opacity 0.22s ease;
}

.app-shell {
  align-items: stretch;
}
.sidebar {
  contain: layout;
  width: 260px;
  padding: 18px 13px;
  box-shadow: 10px 0 35px rgba(2, 6, 23, 0.16);
  z-index: 50;
  transition:
    inline-size 0.32s cubic-bezier(0.22, 0.61, 0.36, 1),
    padding 0.32s ease,
    box-shadow 0.32s ease;
  overflow: hidden;
}
.sb-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 42px;
  margin-bottom: 22px;
}
.sb-logo {
  padding: 4px 7px;
  font-size: 1.1875rem;
  white-space: nowrap;
  overflow: hidden;
}
.sb-brand-full {
  display: inline;
}
.sb-toggle {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
  display: grid;
  place-items: center;
  font-size: 1.25rem;
}
.sb-toggle:hover {
  background: rgba(34, 211, 238, 0.14);
  color: #fff;
  transform: translateX(-1px);
}
.sidebar.collapsed {
  width: 78px;
  padding-left: 11px;
  padding-right: 11px;
}
.sidebar.collapsed .sb-top {
  justify-content: flex-end;
}
.sidebar.collapsed .sb-logo {
  padding: 4px 0;
  text-align: center;
  min-height: 36px;
}
.sidebar.collapsed .sb-brand-full {
  display: none;
}
.sidebar.collapsed .sb-toggle {
  position: static;
  width: 34px;
  height: 34px;
  transform: none;
}
.sidebar.collapsed .sb-toggle i {
  transform: rotate(180deg);
}
.sidebar.collapsed .sb-nav {
  margin-top: 0;
}
.sb-item,
.sb-logout {
  position: relative;
  overflow: hidden;
  min-height: 42px;
  box-shadow: inset 0 0 0 1px transparent;
}
.sb-item:hover,
.sb-logout:hover {
  transform: translateX(2px);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    0 5px 14px rgba(0, 0, 0, 0.12);
}
.sb-item.active {
  transform: none;
}
.sidebar.collapsed .sb-item,
.sidebar.collapsed .sb-logout {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
  gap: 0;
}
.sidebar.collapsed .sb-label,
.sidebar.collapsed .sb-user {
  display: none;
}
.sidebar.collapsed .sb-item .ico,
.sidebar.collapsed .sb-logout .ico {
  font-size: 1.25rem;
}
.sidebar.collapsed .sb-logout {
  margin-top: 7px;
}

.content {
  padding: 30px clamp(16px, 3vw, 34px) 60px;
  animation: pageEnter 0.62s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.page-head {
  animation: riseIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.06s both;
}
.card,
.stat {
  box-shadow: var(--shadow-sm);
  transition:
    transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.32s ease,
    border-color 0.32s ease,
    filter 0.32s ease;
}
.card {
  position: relative;
  overflow: hidden;
}
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(
    520px 220px at 20% 0%,
    rgba(47, 111, 237, 0.07),
    transparent 60%
  );
  transition: opacity 0.35s ease;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow:
    var(--shadow-md),
    0 0 0 1px rgba(47, 111, 237, 0.08);
}
.card:hover::after {
  opacity: 1;
}
.stat:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow:
    var(--shadow-md),
    0 0 0 1px rgba(34, 211, 238, 0.1);
}
.card-head {
  background: linear-gradient(180deg, rgba(148, 163, 184, 0.035), transparent);
}
.content > .card {
  animation: cardIn 0.62s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.content > .card:nth-child(2) {
  animation-delay: 0.07s;
}
.content > .card:nth-child(3) {
  animation-delay: 0.13s;
}
.content > .card:nth-child(4) {
  animation-delay: 0.19s;
}
.content > .card:nth-child(5) {
  animation-delay: 0.25s;
}
.content > .card:nth-child(6) {
  animation-delay: 0.31s;
}
.stat-grid .stat {
  animation: statPop 0.58s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.stat-grid .stat:nth-child(1) {
  animation-delay: 0.04s;
}
.stat-grid .stat:nth-child(2) {
  animation-delay: 0.1s;
}
.stat-grid .stat:nth-child(3) {
  animation-delay: 0.16s;
}
.stat-grid .stat:nth-child(4) {
  animation-delay: 0.22s;
}
.dashboard-grid,
.report-grid {
  animation: cardIn 0.62s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
}
.list-item,
.device-row {
  transition:
    transform 0.24s cubic-bezier(0.22, 1, 0.36, 1),
    background-color 0.22s ease;
}
.list-item:hover,
.device-row:hover {
  transform: translateX(3px);
  background: rgba(47, 111, 237, 0.035);
  border-radius: 9px;
}
tbody tr {
  transition:
    background-color 0.18s ease,
    transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}
tbody tr:hover {
  transform: translateX(2px);
}

.btn {
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}
.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.13);
}
.btn:active {
  transform: translateY(0) scale(0.985);
}
.btn-primary {
  box-shadow: 0 8px 20px rgba(47, 111, 237, 0.22);
}
.btn-primary:hover {
  box-shadow: 0 12px 25px rgba(47, 111, 237, 0.3);
}
.btn-secondary {
  border: 1px solid var(--border);
}
.btn-danger {
  border: 1px solid rgba(220, 38, 38, 0.12);
}

.stat {
  border-color: color-mix(in srgb, var(--border) 86%, transparent);
}
.table-wrap,
.list {
  background: transparent;
}
tbody tr {
  transition: background-color 0.18s ease;
}
tbody tr:hover {
  background: rgba(47, 111, 237, 0.045);
}

input:focus,
select:focus,
button:focus-visible,
a:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}
input::placeholder {
  color: var(--muted);
  opacity: 0.72;
}

.modal {
  backdrop-filter: blur(5px);
  animation: fadeIn 0.2s ease both;
}
.modal-box,
.modal-card {
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.25s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}
.modal-box .card-head {
  background: transparent;
}
.permission-check {
  border: 1px solid transparent;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease;
}
.permission-check:hover {
  border-color: rgba(34, 211, 238, 0.35);
  transform: translateY(-1px);
}

/* Tema escuro: sem ilhas brancas em modais/formulários */
body.dark .modal-box,
body.dark .modal-card {
  background: #111827;
  color: #e5e7eb;
  border: 1px solid #26354d;
}
body.dark .modal-box .card-head {
  border-color: #26354d;
}
body.dark .modal-box h2,
body.dark .modal-card h2 {
  color: #f8fafc;
}
body.dark .modal-grid label,
body.dark .form-grid label {
  color: #cbd5e1;
}
body.dark .modal-grid input,
body.dark .modal-grid select,
body.dark .form-grid input,
body.dark .form-grid select,
body.dark .filter-card select,
body.dark .filter-card input,
body.dark .filters input,
body.dark .settings-card input,
body.dark .settings-card select,
body.dark .camera-controls select {
  background: #0b1220;
  color: #e5e7eb;
  border-color: #334155;
}
body.dark .permission-box {
  border-color: #334155;
  background: #0d1627;
}
body.dark .permission-check {
  background: #172235;
  color: #dbeafe;
  border-color: #26354d;
}
body.dark .permission-check:hover {
  background: #1b2a42;
  border-color: rgba(34, 211, 238, 0.45);
}
body.dark .form-error {
  color: #fda4af;
}
body.dark .empty,
body.dark .empty-state {
  color: #a7b4c8;
}
body.dark .btn-secondary {
  border-color: #334155;
}
body.dark .status-pill {
  background: #1e293b;
  color: #cbd5e1;
}
body.dark .camera-error {
  background: #2a1519;
  border-color: #7f1d1d;
  color: #fecaca;
}
body.dark .ai-warning {
  color: #fbbf24;
}
body.dark .card-head {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent);
}
body.dark .modal-box .card-head p {
  color: #94a3b8;
}

/* Melhor comportamento responsivo */
@media (max-width: 1100px) {
  .content {
    padding-left: 22px;
    padding-right: 22px;
  }
  .dashboard-grid,
  .report-grid {
    gap: 16px;
  }
}
@media (max-width: 560px) {
  .stat-grid {
    grid-template-columns: 1fr;
  }
  .card-head {
    padding: 15px 16px;
    align-items: flex-start;
    gap: 12px;
  }
  .card-head > .link,
  .card-head > .btn {
    flex: 0 0 auto;
  }
  .list {
    padding: 5px 16px;
  }
  .list-item {
    align-items: flex-start;
  }
  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  th,
  td {
    padding: 11px 12px;
  }
  .modal {
    padding: 10px;
  }
  .modal-box,
  .modal-card {
    max-height: calc(100vh - 20px);
    border-radius: 14px;
  }
  .modal-user-card {
    max-height: calc(100vh - 20px);
  }
  .camera-stage {
    height: 300px;
  }
  .camera-stage-real {
    margin: 0 12px;
    min-height: 300px;
  }
  .camera-error {
    margin: 0 12px 14px;
  }
}

@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes pageEnter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes statPop {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    .content,
    .page-head,
    .card,
    .stat {
      animation: none !important;
    }
  }

  /* V6.2 Barra lateral com ocultação automática sensível à sessão: sem botão manual. */
  @media (min-width: 821px) {
    .sidebar {
      contain: layout;
      width: 78px;
      padding-left: 11px;
      padding-right: 11px;
      transition:
        inline-size 0.36s cubic-bezier(0.22, 0.61, 0.36, 1),
        padding 0.36s ease,
        box-shadow 0.36s ease;
    }
    .sidebar:hover,
    .sidebar:focus-within {
      width: 260px;
      padding-left: 13px;
      padding-right: 13px;
    }
    .sidebar .sb-top {
      min-height: 42px;
      margin-bottom: 22px;
      justify-content: center;
    }
    .sidebar .sb-logo {
      display: none;
    }
    .sidebar .sb-item,
    .sidebar .sb-logout {
      justify-content: center;
      padding-left: 0;
      padding-right: 0;
      gap: 0;
    }
    .sidebar .sb-label,
    .sidebar .sb-user {
      opacity: 0;
      visibility: hidden;
      max-width: 0;
      overflow: hidden;
      transition:
        opacity 0.16s ease,
        max-width 0.28s ease,
        visibility 0s linear 0.28s;
    }
    .sidebar:hover .sb-item,
    .sidebar:hover .sb-logout,
    .sidebar:focus-within .sb-item,
    .sidebar:focus-within .sb-logout {
      justify-content: flex-start;
      padding-left: 14px;
      padding-right: 14px;
      gap: 11px;
    }
    .sidebar:hover .sb-label {
      opacity: 1;
      visibility: visible;
      max-width: 180px;
      transition:
        opacity 0.22s ease 0.08s,
        max-width 0.3s ease,
        visibility 0s;
    }
    .sidebar:hover .sb-user {
      opacity: 1;
      visibility: visible;
      max-width: 220px;
      transition:
        opacity 0.22s ease 0.08s,
        max-width 0.3s ease,
        visibility 0s;
    }
    .sidebar .sb-item .ico,
    .sidebar .sb-logout .ico {
      font-size: 1.25rem;
      min-width: 20px;
    }
    .sidebar:hover .sb-item .ico,
    .sidebar:hover .sb-logout .ico,
    .sidebar:focus-within .sb-item .ico,
    .sidebar:focus-within .sb-logout .ico {
      font-size: 1.125rem;
    }
    .sidebar:hover .sb-user {
      padding-left: 8px;
    }
  }
  @media (max-width: 820px) {
    .sidebar .sb-logo {
      display: none !important;
    }
  }

  /* V6.4 Barra lateral desktop: expansão apenas ao passar o mouse, sem logo e sem botão manual. */
  @media (min-width: 821px) {
    .sidebar {
      contain: layout;
      width: 72px !important;
      padding-left: 9px !important;
      padding-right: 9px !important;
      transition:
        inline-size 520ms cubic-bezier(0.22, 1, 0.36, 1),
        padding 420ms cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 320ms ease,
        background-color 320ms ease;
      will-change: inline-size;
    }
    .sidebar .sb-top {
      height: 8px;
      min-height: 8px;
      margin: 0 0 10px;
      padding: 0;
    }
    .sidebar .sb-label,
    .sidebar .sb-user {
      opacity: 0 !important;
      visibility: hidden !important;
      max-width: 0 !important;
      pointer-events: none;
      transform: translateX(-10px);
      filter: blur(3px);
      transition:
        opacity 200ms ease,
        transform 420ms cubic-bezier(0.22, 1, 0.36, 1),
        filter 280ms ease,
        max-width 420ms cubic-bezier(0.22, 1, 0.36, 1),
        visibility 0s linear 420ms;
    }
    .sidebar .sb-item,
    .sidebar .sb-logout {
      justify-content: center !important;
      padding-left: 0 !important;
      padding-right: 0 !important;
      gap: 0 !important;
      transition:
        background-color 220ms ease,
        color 220ms ease,
        padding 420ms cubic-bezier(0.22, 1, 0.36, 1),
        gap 420ms cubic-bezier(0.22, 1, 0.36, 1),
        transform 340ms cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 220ms ease;
    }
    .sidebar .sb-item .ico,
    .sidebar .sb-logout .ico {
      font-size: 1.25rem;
      min-width: 20px;
      transition:
        transform 460ms cubic-bezier(0.22, 1, 0.36, 1),
        font-size 320ms ease,
        color 220ms ease;
    }
    .sidebar:hover,
    .sidebar:focus-within {
      width: 260px !important;
      padding-left: 13px !important;
      padding-right: 13px !important;
      transition:
        inline-size 480ms cubic-bezier(0.22, 1, 0.36, 1),
        padding 380ms cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 320ms ease;
    }
    .sidebar:hover .sb-top {
      height: 8px;
      min-height: 8px;
    }
    .sidebar:hover .sb-label,
    .sidebar:hover .sb-user,
    .sidebar:focus-within .sb-label,
    .sidebar:focus-within .sb-user {
      opacity: 1 !important;
      visibility: visible !important;
      max-width: 220px !important;
      pointer-events: auto;
      transform: translateX(0);
      filter: blur(0);
      transition:
        opacity 240ms ease,
        transform 460ms cubic-bezier(0.22, 1, 0.36, 1),
        filter 320ms ease,
        max-width 420ms cubic-bezier(0.22, 1, 0.36, 1),
        visibility 0s;
    }
    .sidebar:hover .sb-item,
    .sidebar:hover .sb-logout,
    .sidebar:focus-within .sb-item,
    .sidebar:focus-within .sb-logout {
      justify-content: flex-start !important;
      padding-left: 14px !important;
      padding-right: 14px !important;
      gap: 11px !important;
    }
    .sidebar:hover .sb-item .ico,
    .sidebar:hover .sb-logout .ico,
    .sidebar:focus-within .sb-item .ico,
    .sidebar:focus-within .sb-logout .ico {
      font-size: 1.125rem;
    }
    .sidebar:hover .sb-nav .sb-item:nth-child(1) .sb-label {
      transition-delay: 28ms;
    }
    .sidebar:hover .sb-nav .sb-item:nth-child(2) .sb-label {
      transition-delay: 56ms;
    }
    .sidebar:hover .sb-nav .sb-item:nth-child(3) .sb-label {
      transition-delay: 84ms;
    }
    .sidebar:hover .sb-nav .sb-item:nth-child(4) .sb-label {
      transition-delay: 112ms;
    }
    .sidebar:hover .sb-nav .sb-item:nth-child(5) .sb-label {
      transition-delay: 140ms;
    }
    .sidebar:hover .sb-nav .sb-item:nth-child(6) .sb-label {
      transition-delay: 168ms;
    }
    .sidebar:hover .sb-nav .sb-item:nth-child(7) .sb-label {
      transition-delay: 196ms;
    }
    .sidebar:hover .sb-nav .sb-item:nth-child(8) .sb-label {
      transition-delay: 224ms;
    }
    .sidebar:hover .sb-user {
      transition-delay: 260ms;
    }
    .sidebar:hover .sb-logout .sb-label {
      transition-delay: 285ms;
    }
    .sidebar .sb-item:hover .ico {
      transform: scale(1.08);
    }
    .sidebar .sb-item.active .ico {
      transform: scale(1.04);
    }
  }
  @media (max-width: 820px) {
    .sidebar .sb-top {
      display: none !important;
    }
    .sidebar .sb-logo {
      display: none !important;
    }
  }

  ::selection {
    background: rgba(47, 111, 237, 0.22);
  }
  :focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 2px;
  }
  *::-webkit-scrollbar {
    height: 8px;
    width: 8px;
  }
  *::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
  }
  *::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
  }

  .live {
    animation: aiPulse 2s ease infinite;
  }
  @keyframes aiPulse {
    0%,
    100% {
      opacity: 1;
    }
    50% {
      opacity: 0.85;
    }
  }
  @media (prefers-reduced-motion: reduce) {
    .live {
      animation: none;
    }
  }

  .setup-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 9px;
    border-radius: 999px;
    background: #fef3c7;
    border: 1px solid #fde68a;
    color: #92400e;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }
  .spinner-sm {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
  }
  @keyframes spin {
    to {
      transform: rotate(360deg);
    }
  }
  .login-field input[aria-invalid="true"] {
    border-color: #fca5a5;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
  }

  /* ── OVERDRIVE: sistema de movimento para todas as páginas e cada botão ── */
  :root {
    --od-ease: cubic-bezier(0.16, 1, 0.3, 1);
    --od-ease2: cubic-bezier(0.22, 1, 0.36, 1);
    --od-fast: 0.22s;
    --od-med: 0.42s;
  }
  .btn {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    will-change: transform;
    transition:
      transform var(--od-fast) var(--od-ease),
      box-shadow 0.28s ease,
      filter 0.28s ease,
      background-color 0.22s ease,
      border-color 0.22s ease,
      opacity 0.22s ease;
  }
  .btn::before {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-105%);
    background: linear-gradient(
      100deg,
      transparent 30%,
      rgba(255, 255, 255, 0.22) 50%,
      transparent 70%
    );
    opacity: 0;
    transition:
      transform 0.58s var(--od-ease),
      opacity 0.28s ease;
    pointer-events: none;
  }
  .btn:hover::before {
    transform: translateX(105%);
    opacity: 1;
  }
  .btn:active {
    transform: scale(0.97);
  }
  .btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
  }
  .btn:disabled::before {
    display: none;
  }
  .btn-primary {
    background: linear-gradient(90deg, var(--blue), var(--cyan));
    background-size: 200% 100%;
    background-position: 0% 0%;
    transition:
      transform var(--od-fast) var(--od-ease),
      box-shadow 0.28s ease,
      background-position 0.52s var(--od-ease),
      filter 0.28s ease;
  }
  .btn-primary:hover {
    background-position: 100% 0%;
    filter: saturate(1.08) brightness(1.02);
    box-shadow:
      0 10px 28px rgba(47, 111, 237, 0.28),
      0 4px 14px rgba(34, 211, 238, 0.18);
  }
  .btn-primary:active {
    filter: saturate(0.96);
  }
  .btn-secondary:hover {
    filter: brightness(1.02);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.1);
  }
  .btn-danger:hover {
    filter: brightness(1.03);
    box-shadow: 0 8px 20px rgba(220, 38, 38, 0.18);
  }
  .btn-small {
    transition-duration: 0.18s;
  }
  .btn-small::before {
    display: none;
  }
  .page-head .btn {
    animation: odBtnIn 0.54s var(--od-ease) both;
  }
  .page-head .btn:nth-child(2) {
    animation-delay: 0.08s;
  }
  .page-head p {
    transition: opacity 0.32s ease;
  }
  .card {
    --od-accent: var(--blue);
  }
  .card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(
      90deg,
      transparent,
      var(--cyan),
      var(--blue),
      transparent
    );
    opacity: 0;
    transform: scaleX(0.72);
    transform-origin: center;
    transition:
      opacity 0.38s ease,
      transform 0.52s var(--od-ease);
    pointer-events: none;
    z-index: 1;
  }
  .card:hover::before {
    opacity: 0.92;
    transform: scaleX(1);
  }
  .card-head .badge,
  .card-head .status-pill,
  .card-head .live {
    transition:
      transform 0.28s var(--od-ease),
      box-shadow 0.28s ease,
      filter 0.28s ease;
  }
  .card:hover .card-head .badge {
    transform: translateY(-1px);
  }
  .stat {
    position: relative;
    overflow: hidden;
  }
  .stat::after {
    content: "";
    position: absolute;
    inset: auto -30% -30% auto;
    width: 120px;
    height: 120px;
    background: radial-gradient(
      circle at center,
      rgba(47, 111, 237, 0.08),
      transparent 70%
    );
    opacity: 0;
    transform: scale(0.8);
    transition:
      opacity 0.42s ease,
      transform 0.52s var(--od-ease);
    pointer-events: none;
  }
  .stat:hover::after {
    opacity: 1;
    transform: scale(1);
  }
  .stat .value {
    transition:
      transform 0.32s var(--od-ease),
      color 0.22s ease;
  }
  .stat:hover .value {
    transform: translateY(-1px) scale(1.02);
  }
  .table-wrap {
    position: relative;
  }
  thead th {
    position: relative;
  }
  thead th::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: linear-gradient(
      90deg,
      transparent,
      rgba(47, 111, 237, 0.22),
      transparent
    );
    opacity: 0;
    transition: opacity 0.32s ease;
  }
  .card:hover thead th::after {
    opacity: 1;
  }
  tbody tr {
    will-change: transform;
  }
  .filter-card,
  .filters,
  .settings-card label {
    transition:
      transform 0.22s var(--od-ease),
      box-shadow 0.22s ease;
  }
  .filter-card:focus-within {
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  }
  .filters label:focus-within,
  .settings-card label:focus-within {
    transform: translateY(-1px);
  }
  .filter-card select,
  .filter-card input,
  .filters input,
  .filters select,
  .settings-card select,
  .settings-card input {
    transition:
      border-color 0.2s ease,
      box-shadow 0.2s ease,
      background-color 0.2s ease,
      transform 0.2s var(--od-ease);
  }
  .filter-card select:hover,
  .filter-card input:hover {
    transform: translateY(-1px);
  }
  .login-hero-point {
    animation: odPointIn 0.62s var(--od-ease) both;
  }
  .login-hero-point:nth-child(1) {
    animation-delay: 0.06s;
  }
  .login-hero-point:nth-child(2) {
    animation-delay: 0.14s;
  }
  .login-hero-point:nth-child(3) {
    animation-delay: 0.22s;
  }
  .login-hero-mark {
    animation: odFloat 4.2s ease-in-out infinite;
  }
  .login-hero-copy h2 {
    animation: odTitleIn 0.72s var(--od-ease) both;
  }
  .login-card {
    transition:
      transform 0.32s var(--od-ease),
      box-shadow 0.32s ease;
  }
  .login-card:hover {
    transform: translateY(-2px);
  }
  .modal {
    transition:
      backdrop-filter 0.28s ease,
      opacity 0.28s ease;
  }
  .modal-box,
  .modal-card {
    will-change: transform, opacity;
  }
  .toast {
    will-change: transform, opacity;
    animation: odToastIn 0.42s var(--od-ease) both;
  }
  .toast:not(.show) {
    animation: none;
    opacity: 0;
    transform: translateY(-6px);
  }
  @keyframes odBtnIn {
    from {
      opacity: 0;
      transform: translateY(8px) scale(0.98);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }
  @keyframes odPointIn {
    from {
      opacity: 0;
      transform: translateY(10px) scale(0.98);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }
  @keyframes odTitleIn {
    from {
      opacity: 0;
      transform: translateY(10px);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }
  @keyframes odFloat {
    0%,
    100% {
      transform: translateY(0);
    }
    50% {
      transform: translateY(-4px);
    }
  }
  @keyframes odToastIn {
    from {
      opacity: 0;
      transform: translateY(-8px) scale(0.98);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }
  @keyframes odLivePulse {
    0%,
    100% {
      box-shadow: 0 0 0 0 rgba(22, 163, 74, 0);
    }
    50% {
      box-shadow: 0 0 0 6px rgba(22, 163, 74, 0.14);
    }
  }
  .live {
    animation:
      aiPulse 2s ease infinite,
      odLivePulse 2s ease infinite;
  }
  @media (prefers-reduced-motion: reduce) {
    .btn::before,
    .card::before,
    .stat::after,
    thead th::after {
      display: none !important;
    }
    .btn,
    .card,
    .stat {
      transition-duration: 0.001ms !important;
    }
    .login-hero-point,
    .login-hero-mark,
    .login-hero-copy h2,
    .page-head .btn,
    .toast {
      animation: none !important;
    }
  }

  /* ── ENCANTO: pequenos detalhes de alegria e personalidade ── */

  .btn .bx,
  .btn .ico {
    transition: transform 0.28s var(--od-ease);
  }
  .btn:hover .bx,
  .btn:hover .ico {
    transform: translateY(-1px) rotate(-3deg) scale(1.06);
  }
  .btn:active .bx,
  .btn:active .ico {
    transform: scale(0.92);
  }
  .card-head h2 {
    transition:
      letter-spacing 0.22s var(--od-ease),
      color 0.22s ease;
  }
  .card:hover .card-head h2 {
    letter-spacing: -0.02em;
  }
  .stat:hover .value {
    transform: translateY(-1px) scale(1.02);
  }

  .toast.show {
    animation: delightPop 0.52s var(--od-ease) both;
  }
  .login-hero-point:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.11) !important;
    transition:
      transform 0.22s var(--od-ease),
      background-color 0.22s ease;
  }
  .login-card:hover {
    transform: translateY(-2px);
  }
  @keyframes delightFloat {
    0%,
    100% {
      transform: translateY(0);
    }
    50% {
      transform: translateY(-4px);
    }
  }
  @keyframes delightPop {
    0% {
      opacity: 0;
      transform: translateY(-8px) scale(0.96);
    }
    60% {
      transform: translateY(2px) scale(1.01);
    }
    100% {
      opacity: 1;
      transform: none;
    }
  }
  @media (prefers-reduced-motion: reduce) {
    .empty-state::before,
    .empty::before {
      animation: none !important;
    }
  }

  /* ── COLORIZAÇÃO: cor estratégica para áreas monocromáticas ── */
  .stat:nth-child(6n + 1) {
    background:
      linear-gradient(180deg, rgba(47, 111, 237, 0.07), transparent 58%),
      var(--card);
    border-color: rgba(47, 111, 237, 0.18);
  }
  .stat:nth-child(6n + 1) .label {
    color: #2f6fed;
  }
  .stat:nth-child(6n + 2) {
    background:
      linear-gradient(180deg, rgba(34, 211, 238, 0.09), transparent 58%),
      var(--card);
    border-color: rgba(34, 211, 238, 0.22);
  }
  .stat:nth-child(6n + 2) .label {
    color: #0891b2;
  }
  .stat:nth-child(6n + 3) {
    background:
      linear-gradient(180deg, rgba(22, 163, 74, 0.07), transparent 58%),
      var(--card);
    border-color: rgba(22, 163, 74, 0.18);
  }
  .stat:nth-child(6n + 3) .label {
    color: #15803d;
  }
  .stat:nth-child(6n + 4) {
    background:
      linear-gradient(180deg, rgba(217, 119, 6, 0.08), transparent 58%),
      var(--card);
    border-color: rgba(217, 119, 6, 0.18);
  }
  .stat:nth-child(6n + 4) .label {
    color: #b45309;
  }
  .stat:nth-child(6n + 5) {
    background:
      linear-gradient(180deg, rgba(100, 116, 139, 0.06), transparent 58%),
      var(--card);
    border-color: rgba(100, 116, 139, 0.16);
  }
  .stat:nth-child(6n + 5) .label {
    color: #475569;
  }
  .stat:nth-child(6n + 6) {
    background:
      linear-gradient(180deg, rgba(220, 38, 38, 0.06), transparent 58%),
      var(--card);
    border-color: rgba(220, 38, 38, 0.14);
  }
  .stat:nth-child(6n + 6) .label {
    color: #dc2626;
  }
  .stat .value {
    color: var(--text);
  }
  .card {
    border-color: color-mix(in srgb, var(--border) 88%, transparent);
  }
  .card-head {
    border-bottom-color: color-mix(in srgb, var(--border) 92%, transparent);
  }
  .card-head h2 {
    position: relative;
    letter-spacing: -0.01em;
  }
  .filter-card {
    border: 1px solid var(--border);
    background: var(--card);
    border-radius: var(--radius);
  }
  .filter-card:focus-within {
    border-color: rgba(47, 111, 237, 0.22);
    box-shadow: 0 10px 28px rgba(47, 111, 237, 0.08);
  }
  .table-wrap thead th {
    color: #334155;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    background: linear-gradient(180deg, #f8fafc, transparent);
  }
  .badge {
    border: 1px solid transparent;
  }
  .badge.green {
    background: #dcfce7;
    color: #166534;
    border-color: #bbf7d0;
  }
  .badge.red {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fecaca;
  }
  .badge.amber {
    background: #fef3c7;
    color: #92400e;
    border-color: #fde68a;
  }
  .badge.blue {
    background: #dbeafe;
    color: #1e40af;
    border-color: #bfdbfe;
  }
  .level {
    border: 1px solid transparent;
  }
  .level.critical {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fecaca;
  }
  .level.high {
    background: #fef3c7;
    color: #92400e;
    border-color: #fde68a;
  }
  .level.normal {
    background: #dcfce7;
    color: #166534;
    border-color: #bbf7d0;
  }
  .login-hero-point:nth-child(1) .ico {
    background: rgba(47, 111, 237, 0.14);
    border-color: rgba(47, 111, 237, 0.22);
    color: #93c5fd;
  }
  .login-hero-point:nth-child(2) .ico {
    background: rgba(22, 163, 74, 0.12);
    border-color: rgba(22, 163, 74, 0.2);
    color: #86efac;
  }
  .login-hero-point:nth-child(3) .ico {
    background: rgba(124, 58, 237, 0.12);
    border-color: rgba(124, 58, 237, 0.18);
    color: #c4b5fd;
  }
  .login-card {
    border-color: #e5e9f0;
  }
  .login-card-head h1 {
    color: #0f172a;
  }
  body.dark .stat:nth-child(6n + 1) {
    background:
      linear-gradient(180deg, rgba(47, 111, 237, 0.12), transparent 60%),
      var(--card);
    border-color: rgba(47, 111, 237, 0.22);
  }
  body.dark .stat:nth-child(6n + 2) {
    background:
      linear-gradient(180deg, rgba(34, 211, 238, 0.11), transparent 60%),
      var(--card);
    border-color: rgba(34, 211, 238, 0.2);
  }
  body.dark .stat:nth-child(6n + 3) {
    background:
      linear-gradient(180deg, rgba(22, 163, 74, 0.1), transparent 60%),
      var(--card);
  }
  body.dark .stat:nth-child(6n + 4) {
    background:
      linear-gradient(180deg, rgba(217, 119, 6, 0.1), transparent 60%),
      var(--card);
  }
  body.dark .filter-card {
    background: var(--card);
    border-color: var(--border);
  }
  body.dark .filter-card:focus-within {
    border-color: rgba(34, 211, 238, 0.28);
    box-shadow: 0 10px 28px rgba(2, 6, 23, 0.35);
  }
  body.dark .card-head h2::before {
    opacity: 0.85;
  }
  body.dark .table-wrap thead th {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent);
    color: #cbd5e1;
  }
}

/* ============================================================
   LOGIN — redesign visual (referência: React Bits Pro Auth 2)
   Split 58/42 no desktop · somente escopo .login-* (não vaza).
   Sem OAuth · lógica/autenticação preservadas (só visual).
   Azul EdgeSecurity: #2f6fed (mesmo token da landing).
   ============================================================ */
.login-screen {
  grid-template-columns: minmax(0, 58%) minmax(0, 42%);
  min-height: 100dvh;
}
.login-hero {
  overflow: hidden;
  isolation: isolate;
}
.login-visual {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.login-visual img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.5;
  transform: scale(1.04);
}
.login-visual-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(10, 20, 48, 0.72) 0%, rgba(10, 20, 48, 0.55) 40%, rgba(10, 20, 48, 0.88) 100%),
    linear-gradient(115deg, rgba(47, 111, 237, 0.5) 0%, rgba(47, 111, 237, 0.12) 45%, transparent 70%);
}
.login-visual-grid {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 72px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 72px);
  mask-image: linear-gradient(180deg, #000 30%, transparent 95%);
}
.login-hero::after {
  content: "EDGE\A SECURITY";
  white-space: pre;
  position: absolute;
  right: 24px;
  bottom: 8px;
  z-index: 0;
  font-weight: 800;
  font-size: clamp(3.4rem, 7vw, 6.5rem);
  line-height: 0.9;
  letter-spacing: -0.05em;
  text-align: right;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.16);
  pointer-events: none;
}
.login-hero > div,
.login-hero-foot {
  position: relative;
  z-index: 1;
}
.login-hero-brand span {
  color: #8fb4ff;
}
.login-hero-copy h2 i {
  color: #8fb4ff;
}
.login-hero-point .ico {
  background: rgba(47, 111, 237, 0.16);
  border-color: rgba(143, 180, 255, 0.35);
  color: #bcd0ff;
}
.login-panel {
  padding: 56px clamp(24px, 4vw, 64px);
  gap: 18px;
}
.login-backrow {
  width: min(440px, 100%);
}
.login-back {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #2f6fed;
}
.login-back:hover {
  color: #1b3a8f;
}
.login-card {
  width: min(440px, 100%);
  border-radius: 24px;
  padding: 34px 30px 26px;
  gap: 22px;
  border: 1px solid #dfe5f0;
  box-shadow:
    0 24px 48px rgba(15, 35, 95, 0.12),
    0 2px 8px rgba(15, 23, 42, 0.05);
}
.login-card-head h1 {
  font-size: 1.65rem;
}
#auth-subtitle {
  color: #64748b;
  font-size: 0.9rem;
}
#login-form {
  gap: 16px;
}
.login-field {
  font-size: 0.82rem;
  font-weight: 700;
  gap: 8px;
}
.login-field input {
  min-height: 52px;
  padding: 14px 16px;
  font-size: 0.95rem;
  border-radius: 14px;
  border: 1px solid #d4dcea;
}
.login-field input:focus {
  border-color: #2f6fed;
  box-shadow: 0 0 0 4px rgba(47, 111, 237, 0.16);
}
.login-field input[aria-invalid="true"] {
  border-color: #dc2626;
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.1);
}
#login-error:not(:empty) {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 12px;
  padding: 10px 12px;
}
.login-card .check input {
  accent-color: #2f6fed;
}
.login-card .btn-primary {
  background: #2f6fed;
  min-height: 52px;
  border-radius: 14px;
  font-size: 0.95rem;
  font-weight: 700;
  box-shadow: 0 12px 24px rgba(47, 111, 237, 0.35);
}
.login-card .btn-primary:hover {
  background: #1b3a8f;
  box-shadow: 0 16px 32px rgba(27, 58, 143, 0.4);
}
.login-card .btn-primary:disabled {
  background: #93b4ff;
  box-shadow: none;
}
@media (max-width: 980px) {
  .login-hero {
    padding: 20px 18px 26px;
  }
  .login-visual img {
    opacity: 0.36;
  }
  .login-hero-copy {
    margin-top: 12px;
  }
  .login-hero-copy h2 {
    font-size: 1.5rem;
  }
  .login-hero-copy > p,
  .login-hero-points,
  .login-hero-foot {
    display: none;
  }
  .login-hero::after {
    font-size: 2.6rem;
    opacity: 0.7;
  }
  .login-panel {
    padding: 28px 18px 40px;
  }
  .login-card {
    padding: 26px 20px 22px;
  }
}
