@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 100 1000;
  font-display: swap;
  src: url('../fonts/dm-sans-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 100 1000;
  font-display: swap;
  src: url('../fonts/dm-sans-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/jetbrains-mono-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/jetbrains-mono-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ==========================================================================
   SISTEMA DE DISEÑO · ASISTE
   Estilo editorial moderno, cálido, táctil y de alta fidelidad con animaciones
   ========================================================================== */

:root {
  /* Paleta cromática cálida y orgánica */
  --bg: #ece2da;
  --bg-gradient: linear-gradient(135deg, #f0e7df 0%, #ece2da 50%, #e6dad0 100%);
  --card: #f8f3ee;
  --card-hover: #ffffff;
  --card-border: rgba(195, 178, 164, 0.35);
  --card-inner: #f2e9e2;
  --surface: #ffffff;
  --black: #0c0d10;
  --sidebar-bg: #090a0d;
  --sidebar-border: rgba(255, 255, 255, 0.08);
  --orange: #f15d2a;
  --orange-hover: #e04a16;
  --orange-light: #fef0eb;
  --orange-glow: rgba(241, 93, 42, 0.28);
  --text-main: #181716;
  --text-muted: #645b54;
  --muted: #7d736a;
  --line: #ded3c7;
  --line-light: rgba(222, 211, 199, 0.6);
  --green: #1d8841;
  --green-bg: #e3f5e9;
  --green-border: #b8e6c4;
  --yellow: #b48218;
  --yellow-bg: #fdf3d7;
  --yellow-border: #f7e099;
  --red: #d13d32;
  --red-bg: #fde8e5;
  --red-border: #f8beba;

  /* Tipografías */
  --font-main: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Sombras dinámicas y elevaciones */
  --shadow-xs: 0 1px 2px rgba(40, 25, 15, 0.04);
  --shadow-sm: 0 2px 6px rgba(40, 25, 15, 0.06), 0 1px 2px rgba(40, 25, 15, 0.03);
  --shadow-md: 0 8px 24px -4px rgba(40, 25, 15, 0.08), 0 2px 6px -1px rgba(40, 25, 15, 0.04);
  --shadow-lg: 0 18px 40px -8px rgba(40, 25, 15, 0.14), 0 4px 12px rgba(40, 25, 15, 0.06);
  --shadow-glow: 0 0 25px rgba(241, 93, 42, 0.25);
  --shadow-glow-green: 0 0 20px rgba(29, 136, 65, 0.25);

  /* Curvas de aceleración y física */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-bounce: cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-standard: cubic-bezier(0.2, 0, 0, 1);

  /* Radios */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;
}

/* ==========================================================================
   RESET & FUNDAMENTALES
   ========================================================================== */

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

::selection {
  background: rgba(241, 93, 42, 0.28);
  color: inherit;
}

body {
  margin: 0;
  background: var(--bg);
  background-image: var(--bg-gradient);
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  overflow-x: hidden;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: 0;
  background: transparent;
  touch-action: manipulation;
  user-select: none;
}

a {
  color: inherit;
  text-decoration: none;
}

:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 3px;
}

/* Scrollbars estilizados */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(180, 160, 145, 0.45);
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(180, 160, 145, 0.75);
}

.skip-link {
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 100;
  padding: 12px 20px;
  background: #ffffff;
  color: var(--orange);
  font-weight: 600;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  transform: translateY(-180%);
  transition: transform 0.25s var(--ease-spring);
}
.skip-link:focus {
  transform: translateY(0);
}

/* ==========================================================================
   ESTRUCTURA PRINCIPAL (LAYOUT)
   ========================================================================== */

.app {
  display: flex;
  min-height: 100vh;
  max-width: 1720px;
  margin: 0 auto;
  background: transparent;
  position: relative;
  align-items: stretch;
}

/* ==========================================================================
   SIDEBAR (BARRA LATERAL)
   ========================================================================== */

#sidebar {
  width: 250px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  color: #ffffff;
  padding: 30px 20px 24px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-right: 1px solid var(--sidebar-border);
  scrollbar-width: thin;
  scrollbar-color: #27282d transparent;
  z-index: 20;
  box-shadow: 4px 0 30px rgba(0, 0, 0, 0.15);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.8px;
  color: #ffffff;
  position: relative;
  padding-bottom: 2px;
  transition: opacity 0.2s ease;
}
.brand:hover {
  opacity: 0.92;
}

.brand-mark {
  color: var(--orange);
  font-size: 32px;
  line-height: 1;
  display: inline-block;
  transform-origin: center;
  transition: transform 0.6s var(--ease-spring);
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .brand:hover .brand-mark {
    transform: rotate(90deg) scale(1.1);
  }
}

.brand-dot {
  color: var(--orange);
  margin-left: 1px;
}

.brand-sub {
  font-size: 9.5px;
  letter-spacing: 1.8px;
  font-weight: 600;
  color: #8c8f99;
  margin: 6px 0 28px;
  text-transform: uppercase;
}

/* Botón Nueva Sesión con gradiente interactivo */
.new-session {
  background: linear-gradient(135deg, #f15d2a 0%, #db4614 100%);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 18px 6px 7px;
  color: #ffffff;
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 26px;
  box-shadow: 0 4px 18px rgba(241, 93, 42, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition-property: transform, opacity, color, background-color, border-color, box-shadow, filter;
  transition-duration: 0.22s;
  transition-timing-function: var(--ease-spring);
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 46px;
  min-height: 46px;
  flex-shrink: 0;
  box-sizing: border-box;
  text-align: left;
}
.new-session::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  transform: translateX(-100%);
  transition: transform 0.6s ease;
  pointer-events: none;
}
.new-session:hover {

  box-shadow: 0 8px 26px rgba(241, 93, 42, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .new-session:hover {
    transform: translateY(-2px) scale(1.02);
  }
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .new-session:hover::after {
    transform: translateX(100%);
  }
}
.new-session:active {
  transform: scale(0.97);
}

.new-session-icon,
.new-session > span:first-child {
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
  border-radius: 50%;
  font-size: 19px;
  font-weight: 600;
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition-property: transform, opacity, color, background-color, border-color, box-shadow, filter;
  transition-duration: 0.3s;
  transition-timing-function: var(--ease-spring);
  line-height: 1;
}

.new-session-text,
.new-session > span:last-child:not(:first-child) {
  background: transparent;
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: -0.2px;
  box-shadow: none;
  border-radius: 0;
  width: auto;
  height: auto;
  display: inline;
}

.new-session:hover .new-session-icon,
.new-session:hover > span:first-child {

  background: #ffffff;
  color: var(--orange);
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .new-session:hover .new-session-icon,
  .new-session:hover > span:first-child {
    transform: rotate(90deg) scale(1.08);
  }
}

/* Navegación lateral */
nav {
  display: grid;
  gap: 4px;
}

.nav-group {
  font-size: 10px;
  font-weight: 700;
  color: #636775;
  letter-spacing: 1.6px;
  margin: 22px 12px 6px;
  text-transform: uppercase;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: #a4a8b5;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  position: relative;
  transition-property: transform, opacity, color, background-color, border-color, box-shadow, filter;
  transition-duration: 0.2s;
  transition-timing-function: var(--ease-out);
}
.nav-item svg {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
  stroke-width: 1.7;
  transition: transform 0.25s var(--ease-spring), stroke 0.2s ease;
}
.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;

}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .nav-item:hover {
    transform: translateX(3px);
  }
}
.nav-item:hover svg {

  stroke: #ffffff;
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .nav-item:hover svg {
    transform: scale(1.1);
  }
}

.nav-item.active {
  background: rgba(241, 93, 42, 0.16);
  color: #ffffff;
  font-weight: 600;
  border-color: rgba(241, 93, 42, 0.35);
  box-shadow: inset 0 0 16px rgba(241, 93, 42, 0.12), 0 2px 8px rgba(0, 0, 0, 0.2);
}
.nav-item.active svg {
  stroke: var(--orange);
  transform: scale(1.08);
  filter: drop-shadow(0 0 5px rgba(241, 93, 42, 0.45));
}
.nav-item.active:hover {
  background: rgba(241, 93, 42, 0.22);
  color: #ffffff;
  transform: none;
}

/* Sección inferior del sidebar con telemetría */
.sidebar-bottom {
  margin-top: auto;
  padding-top: 24px;
  border-top: 1px solid var(--sidebar-border);
  font-size: 11px;
}

.hardware-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 12px;
  transition-property: transform, opacity, color, background-color, border-color, box-shadow, filter;
  transition-duration: 0.2s;
  transition-timing-function: ease;
}
.hardware-card:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.14);
}

.hardware-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  font-weight: 600;
  color: #ffffff;
}

.led-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: #38ef7d;
  font-family: var(--font-mono);
}

.demo-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: #2cd65a;
  border-radius: 50%;
  box-shadow: 0 0 10px #2cd65a;
  animation: pulseLive 2s infinite ease-in-out;
}

.hardware-specs {
  font-size: 10px;
  color: #8c8f99;
  line-height: 1.5;
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
}

.help {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: #9295a0;
  font-size: 11.5px;
  transition-property: transform, opacity, color, background-color, border-color, box-shadow, filter;
  transition-duration: 0.2s;
  transition-timing-function: ease;
}
.help:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}
.help-icon {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  font-weight: 700;
  font-size: 11px;
}

/* ==========================================================================
   WORKSPACE & HEADER
   ========================================================================== */

.workspace {
  flex: 1;
  width: calc(100% - 250px);
  min-width: 0;
  display: flex;
  flex-direction: column;
}

header {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 86px;
  padding: 0 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: #ece2da;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 4px 20px rgba(40, 25, 15, 0.03);
  will-change: auto;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

#menu-toggle {
  display: none;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  width: 42px;
  height: 42px;
  place-items: center;
  font-size: 18px;
  color: var(--text-main);
  box-shadow: var(--shadow-xs);
  transition-property: transform, opacity, color, background-color, border-color, box-shadow, filter;
  transition-duration: 0.2s;
  transition-timing-function: var(--ease-spring);
}
#menu-toggle:hover {
  background: #faf6f2;

}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  #menu-toggle:hover {
    transform: scale(1.05);
  }
}

h1 {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.9px;
  margin: 0;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-right {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-shrink: 0;
}

/* Simulador de tiempo interactivo en el header */
.time-pill-widget {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  padding: 5px 6px 5px 12px;
  border-radius: var(--radius-full);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  transition-property: transform, opacity, color, background-color, border-color, box-shadow, filter;
  transition-duration: 0.2s;
  transition-timing-function: ease;
}
.time-pill-widget:hover {
  border-color: #cdbfb2;
  box-shadow: var(--shadow-sm);
}

.live-time-dot {
  width: 8px;
  height: 8px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(29, 136, 65, 0.6);
  animation: pulseLive 2s infinite ease-in-out;
}

#header-time-val {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: -0.2px;
}

.time-advance-btn {
  background: var(--orange-light);
  color: var(--orange);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  transition-property: transform, opacity, color, background-color, border-color, box-shadow, filter;
  transition-duration: 0.18s;
  transition-timing-function: var(--ease-spring);
}
.time-advance-btn:hover {
  background: var(--orange);
  color: #ffffff;

}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .time-advance-btn:hover {
    transform: scale(1.06);
  }
}
.time-advance-btn:active {
  transform: scale(0.95);
}

/* Barra de búsqueda interactiva */
.search {
  display: flex;
  align-items: center;
  gap: 9px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  padding: 8px 16px;
  box-shadow: var(--shadow-xs);
  transition-property: transform, opacity, color, background-color, border-color, box-shadow, filter;
  transition-duration: 0.22s;
  transition-timing-function: var(--ease-spring);
  position: relative;
  cursor: text;
}
.search:focus-within {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px var(--orange-glow), var(--shadow-sm);
  transform: translateY(-1px);
}
.search svg {
  width: 17px;
  height: 17px;
  stroke: var(--muted);
  flex-shrink: 0;
  transition: stroke 0.2s ease;
}
.search:focus-within svg {
  stroke: var(--orange);
}
.search input {
  border: 0;
  width: 180px;
  font-size: 12.5px;
  background: transparent;
  outline: none;
  color: var(--text-main);
}
.search input::placeholder {
  color: #9c958f;
}

.search-kbd {
  background: #f1eae2;
  color: #7d736a;
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 10px;
  font-family: var(--font-mono);
  font-weight: 600;
  border: 1px solid #dfd4c9;
  user-select: none;
}

/* Botón de sonido */
.sound-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
  display: grid;
  place-items: center;
  color: var(--text-secondary);
  transition-property: transform, opacity, color, background-color, border-color, box-shadow, filter;
  transition-duration: 0.2s;
  transition-timing-function: var(--ease-spring);
}
.sound-btn:hover {
  color: var(--orange);
  border-color: #cebeaf;

}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .sound-btn:hover {
    transform: scale(1.06);
  }
}
.sound-btn:active {
  transform: scale(0.95);
}
.sound-btn svg {
  width: 18px;
  height: 18px;
}
.sound-btn.muted svg {
  opacity: 0.45;
}

/* Botón de notificaciones con insignia animada */
.notification {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
  display: grid;
  place-items: center;
  position: relative;
  color: var(--text-secondary);
  transition-property: transform, opacity, color, background-color, border-color, box-shadow, filter;
  transition-duration: 0.2s;
  transition-timing-function: var(--ease-spring);
}
.notification:hover {
  color: var(--orange);
  border-color: #cebeaf;

}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .notification:hover {
    transform: scale(1.06);
  }
}
.notification:active {
  transform: scale(0.95);
}
.notification svg {
  width: 18px;
  height: 18px;
}
.notification i, .notif-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  min-width: 9px;
  height: 9px;
  background: var(--orange);
  border: 2px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 6px var(--orange-glow);
  animation: badgeBounce 2.5s infinite;
}

/* Botón de perfil con micro-avatar */
.profile {
  display: flex;
  gap: 10px;
  align-items: center;
  border-radius: var(--radius-full);
  background: #ffffff;
  border: 1px solid var(--line);
  padding: 5px 14px 5px 5px;
  text-align: left;
  font-size: 12px;
  box-shadow: var(--shadow-xs);
  transition-property: transform, opacity, color, background-color, border-color, box-shadow, filter;
  transition-duration: 0.2s;
  transition-timing-function: var(--ease-spring);
}
.profile:hover {
  box-shadow: var(--shadow-sm);
  border-color: #cdbfb2;

}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .profile:hover {
    transform: translateY(-1px);
  }
}
.profile:active {
  transform: scale(0.98);
}

.avatar {
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #e3ebe4 0%, #c9d7cb 100%);
  color: #294631;
  width: 32px;
  height: 32px;
  font-weight: 700;
  font-size: 11.5px;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.8);
}
.profile-info {
  display: flex;
  flex-direction: column;
}
.profile-name {
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.2;
}
.profile small {
  color: #7b726b;
  font-size: 10px;
}
.profile-arrow {
  color: #a39990;
  font-size: 12px;
  margin-left: 2px;
  transition: transform 0.2s ease;
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .profile:hover .profile-arrow {
    transform: translateY(1px);
  }
}

/* ==========================================================================
   ÁREA DE CONTENIDO (MAIN)
   ========================================================================== */

main {
  padding: 32px 36px 40px;
  max-width: 1560px;
  width: 100%;
  margin: 0 auto;
  min-height: calc(100vh - 150px);
}

/* Encabezados de sección */
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
}
.section-heading h2 {
  font-size: 24px;
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.7px;
  color: var(--text-main);
}
.section-heading p {
  color: var(--text-muted);
  font-size: 13px;
  margin: 6px 0 0;
  line-height: 1.5;
}

/* Botones & Pills interactivos */
.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.pill, .btn {
  border-radius: var(--radius-full);
  background: #ffffff;
  border: 1px solid var(--line);
  padding: 8px 18px;
  font-size: 12.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: var(--shadow-xs);
  transition-property: transform, opacity, color, background-color, border-color, box-shadow, filter;
  transition-duration: 0.2s;
  transition-timing-function: var(--ease-spring);
  color: var(--text-main);
  white-space: nowrap;
}
.pill:hover, .btn:hover {
  box-shadow: var(--shadow-sm);
  border-color: #cdbfb2;

}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .pill:hover, .btn:hover {
    transform: translateY(-1.5px);
  }
}
.pill:active, .btn:active {
  transform: scale(0.97);
}

.btn.primary {
  background: var(--orange);
  background-image: linear-gradient(180deg, #f56734 0%, #ea521e 100%);
  color: #ffffff;
  border-color: #d84513;
  box-shadow: 0 3px 12px var(--orange-glow), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.btn.primary:hover {
  background: var(--orange-hover);
  box-shadow: 0 6px 18px rgba(241, 93, 42, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);

}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .btn.primary:hover {
    transform: translateY(-2px);
  }
}

.btn.dark {
  background: #15161b;
  color: #ffffff;
  border-color: #0c0d10;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.btn.dark:hover {
  background: #23252c;
}

.btn.danger {
  background: var(--red-bg);
  color: var(--red);
  border-color: var(--red-border);
}
.btn.danger:hover {
  background: #fadcd8;
  border-color: #f5a8a1;
  color: #ba281e;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.link-btn {
  background: none;
  border: 0;
  padding: 4px 6px;
  color: var(--orange);
  font-weight: 600;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: var(--radius-sm);
  transition-property: transform, opacity, color, background-color, border-color, box-shadow, filter;
  transition-duration: 0.18s;
  transition-timing-function: ease;
}
.link-btn:hover {
  background: rgba(241, 93, 42, 0.08);
  text-decoration: underline;
  text-underline-offset: 3px;

}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .link-btn:hover {
    transform: translateX(2px);
  }
}

/* ==========================================================================
   ESTADÍSTICAS & TARJETAS (STAT CARDS)
   ========================================================================== */

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 26px;
}

.stat, .card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  position: relative;
  overflow: hidden;
}

.stat {
  transition: transform 0.22s var(--ease-spring), box-shadow 0.22s ease, border-color 0.22s ease;
  cursor: default;
}
.stat:hover {
  background: var(--card-hover);
  border-color: rgba(241, 93, 42, 0.28);
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.9);

}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .stat:hover {
    transform: translateY(-2.5px);
  }
}

.interactive-card {
  transition: transform 0.22s var(--ease-spring), box-shadow 0.22s ease, border-color 0.22s ease;
}
.interactive-card:hover {
  border-color: rgba(241, 93, 42, 0.35);
  box-shadow: var(--shadow-md);

}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .interactive-card:hover {
    transform: translateY(-2px);
  }
}

.stat-icon {
  display: grid;
  place-items: center;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #d8a7ec 0%, #b87de0 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(184, 125, 224, 0.35);
  transition: transform 0.3s var(--ease-spring);
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .stat:hover .stat-icon {
    transform: scale(1.1) rotate(5deg);
  }
}

.stat:nth-child(2) .stat-icon {
  background: linear-gradient(135deg, #f5a07c 0%, #f16f39 100%);
  box-shadow: 0 4px 12px rgba(241, 111, 57, 0.35);
}
.stat:nth-child(3) .stat-icon {
  background: linear-gradient(135deg, #8cb5f5 0%, #528ce9 100%);
  box-shadow: 0 4px 12px rgba(82, 140, 233, 0.35);
}
.stat:nth-child(4) .stat-icon {
  background: linear-gradient(135deg, #f7d188 0%, #e8aa3a 100%);
  box-shadow: 0 4px 12px rgba(232, 170, 58, 0.35);
}

.stat-icon svg {
  width: 21px;
  height: 21px;
  stroke-width: 1.8;
}

.stat label {
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 500;
  display: block;
}

.stat strong {
  display: block;
  font-size: 34px;
  letter-spacing: -1.2px;
  font-weight: 600;
  margin: 6px 0;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

.stat strong small {
  font-size: 14px;
  letter-spacing: 0;
  font-weight: 500;
  color: var(--muted);
  margin-left: 3px;
}

.stat p {
  margin: 6px 0 0;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.4;
}

.positive {
  color: var(--green) !important;
}

/* ==========================================================================
   DASHBOARD GRID & SECCIONES
   ========================================================================== */

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr);
  align-items: start;
  gap: 22px;
}

.dashboard-column {
  display: grid;
  align-content: start;
  gap: 22px;
  min-width: 0;
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.card h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.4px;
  color: var(--text-main);
}

.card-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin: 4px 0 16px;
  line-height: 1.5;
}

/* ==========================================================================
   TABLAS MODERNAS
   ========================================================================== */

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-md);
  scrollbar-width: thin;
  scrollbar-color: rgba(180, 160, 145, 0.45) transparent;
}

table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  text-align: left;
  white-space: nowrap;
  font-size: 12.5px;
}

th {
  font-weight: 600;
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: 0.3px;
  text-transform: uppercase;
  padding: 10px 14px 14px;
  border-bottom: 1px solid var(--line);
}

td {
  padding: 14px;
  border-bottom: 1px solid rgba(222, 211, 199, 0.5);
  transition: background-color 0.15s ease;
  vertical-align: middle;
}

tr:last-child td {
  border-bottom: 0;
}

tbody tr {
  transition: background-color 0.18s ease, transform 0.18s ease;
}
tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.65);
}

/* Insignias (Badges) */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: var(--radius-full);
  padding: 4px 11px;
  font-size: 11px;
  font-weight: 600;
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid var(--green-border);
  white-space: nowrap;
}
.badge::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.badge.orange {
  background: var(--orange-light);
  color: var(--orange);
  border-color: #f8cfc0;
}

.badge.yellow {
  background: var(--yellow-bg);
  color: #9c6c06;
  border-color: var(--yellow-border);
}

.badge.red {
  background: var(--red-bg);
  color: var(--red);
  border-color: var(--red-border);
}

.badge.gray {
  background: #ebe4dc;
  color: #696058;
  border-color: #dcd3ca;
}

/* Barras de progreso */
.progress {
  height: 7px;
  background: #e3d9cf;
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: 10px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.08);
}

.progress span {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #f56734 0%, #ea4a13 100%);
  border-radius: var(--radius-full);
  transform-origin: left center;
  transition: transform 0.8s var(--ease-spring);
  box-shadow: 0 0 8px var(--orange-glow);
}

/* ==========================================================================
   LISTAS Y TARJETAS DE CLASES
   ========================================================================== */

.class-list {
  display: grid;
  gap: 16px;
}

.class-item {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  transition: transform 0.2s ease;
}
.class-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .class-item:hover {
    transform: translateX(4px);
  }
}

.class-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.class-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
  margin: 6px 0 2px;
}

.class-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin: 6px 0;
  line-height: 1.5;
}

.class-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  font-size: 12px;
}

.class-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.class-grid .card {
  padding: 24px;
}

/* ==========================================================================
   GRÁFICO MEDIDOR (GAUGE)
   ========================================================================== */

.gauge {
  position: relative;
  text-align: center;
  margin: 16px auto 4px;
  max-width: 310px;
}

.gauge svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

.gauge path {
  transition: stroke-dasharray 0.32s var(--ease-out);
}

.gauge-center {
  position: absolute;
  bottom: 26px;
  left: 0;
  right: 0;
}

.gauge-center strong {
  font-size: 38px;
  font-weight: 600;
  letter-spacing: -1.2px;
  color: var(--text-main);
  display: block;
  line-height: 1;
}

.gauge-center span {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 5px;
}

.gauge-values {
  display: flex;
  justify-content: space-around;
  margin: 16px 0 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line-light);
}

.gauge-values strong {
  display: block;
  font-size: 22px;
  font-weight: 600;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
}

.gauge-values span {
  font-size: 11.5px;
  color: var(--muted);
}

/* ==========================================================================
   EVENTOS, RECIENTES & CHECKLIST
   ========================================================================== */

.event-list {
  display: grid;
  gap: 14px;
}

.event {
  display: flex;
  gap: 13px;
  align-items: center;
  font-size: 13px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  transition: background 0.18s ease;
}
.event:hover {
  background: rgba(255, 255, 255, 0.6);
}
.event .avatar {
  width: 32px;
  height: 32px;
  font-size: 11px;
  flex-shrink: 0;
}
.event-main {
  flex: 1;
  min-width: 0;
  font-weight: 500;
}
.event-main small {
  display: block;
  color: var(--text-muted);
  font-size: 11px;
  margin-top: 2px;
}

.tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  margin: 0 0 18px;
  padding-bottom: 2px;
  overflow-x: auto;
}

.tab {
  background: none;
  border: 0;
  padding: 8px 16px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  border-radius: var(--radius-full);
  transition-property: transform, opacity, color, background-color, border-color, box-shadow, filter;
  transition-duration: 0.2s;
  transition-timing-function: var(--ease-spring);
  white-space: nowrap;
}
.tab:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.5);
}
.tab.active {
  background: #ffffff;
  color: var(--orange);
  font-weight: 600;
  box-shadow: var(--shadow-xs);
}

.checklist {
  display: grid;
  gap: 13px;
}

.check-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  font-size: 12.5px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  transition: background 0.18s ease;
}
.check-item:hover {
  background: rgba(255, 255, 255, 0.5);
}

.check-item > span:first-child {
  display: flex;
  align-items: center;
  gap: 10px;
}

.check-dot {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: var(--green);
  color: #ffffff;
  font-size: 11px;
  font-style: normal;
  box-shadow: 0 2px 6px rgba(29, 136, 65, 0.3);
}

/* Avisos informativos */
.notice {
  background: #fdf5ec;
  border: 1px solid #ebd4bf;
  border-left: 4px solid var(--orange);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  font-size: 12.5px;
  line-height: 1.6;
  margin-bottom: 22px;
  color: #4a3f36;
}
.notice strong {
  display: block;
  font-size: 13px;
  color: #27211c;
  margin-bottom: 3px;
}

/* ==========================================================================
   FORMULARIOS, INPUTS Y TOOLBAR
   ========================================================================== */

.toolbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 22px;
}

.toolbar input, .toolbar select,
.field input, .field select, .field textarea {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 11px 15px;
  font-size: 13px;
  box-shadow: var(--shadow-xs);
  transition-property: transform, opacity, color, background-color, border-color, box-shadow, filter;
  transition-duration: 0.2s;
  transition-timing-function: var(--ease-spring);
  color: var(--text-main);
  outline: none;
}

.toolbar input:focus, .toolbar select:focus,
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px var(--orange-glow), var(--shadow-sm);
}

.toolbar input {
  flex: 1;
  min-width: 220px;
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 18px;
}
.field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}
.field textarea {
  min-height: 90px;
  resize: vertical;
}

.two-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

.step {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0;
  font-size: 13px;
  color: var(--text-main);
}
.step-number {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--orange-light);
  border: 1px solid #f8cdbf;
  display: grid;
  place-items: center;
  color: var(--orange);
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
}

/* ==========================================================================
   BIOMETRÍA Y HUD DE ESCANEO FUTURISTA
   ========================================================================== */

.capture-placeholder {
  min-height: 190px;
  border: 2px dashed #cebeb1;
  background: rgba(255, 255, 255, 0.35);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #7a6e63;
  gap: 10px;
  margin: 16px 0;
  position: relative;
  overflow: hidden;
  transition-property: transform, opacity, color, background-color, border-color, box-shadow, filter;
  transition-duration: 0.3s;
  transition-timing-function: ease;
}
.capture-placeholder:hover {
  border-color: var(--orange);
  background: rgba(255, 255, 255, 0.6);
}

.capture-placeholder svg {
  width: 44px;
  height: 44px;
  stroke: var(--orange);
  stroke-width: 1.5;
  transition: transform 0.3s var(--ease-spring);
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .capture-placeholder:hover svg {
    transform: scale(1.12);
  }
}

/* Línea láser de escaneo animada */
.scanner-active-box {
  position: relative;
  background: #11141a !important;
  color: #e0e6ed !important;
  border: 2px solid #28303f !important;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35), 0 0 20px rgba(241, 93, 42, 0.2);
}
.scanner-laser {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 100%;
  animation: laserScan 1.6s infinite ease-in-out;
  pointer-events: none;
  z-index: 5;
}
.scanner-laser::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, transparent, #f15d2a, #ff956e, #f15d2a, transparent);
  box-shadow: 0 0 14px #f15d2a, 0 0 25px #f15d2a;
}

/* Cuadrícula facial CSI */
.camera-hud {
  position: relative;
  width: 100%;
  height: 180px;
  display: grid;
  place-items: center;
}
.camera-reticle {
  position: absolute;
  width: 110px;
  height: 110px;
  border: 2px dashed rgba(241, 93, 42, 0.7);
  border-radius: 12px;
  box-shadow: 0 0 15px rgba(241, 93, 42, 0.3);
  animation: pulseLive 2s infinite ease-in-out;
}
.camera-reticle::before, .camera-reticle::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  border-color: #f15d2a;
  border-style: solid;
}
.camera-reticle::before {
  top: -2px; left: -2px;
  border-width: 3px 0 0 3px;
}
.camera-reticle::after {
  bottom: -2px; right: -2px;
  border-width: 0 3px 3px 0;
}

/* ==========================================================================
   TERMINAL OLED 0.96″ REALISTA
   ========================================================================== */

.oled-screen {
  background: #060e14;
  color: #00f0ff;
  font-family: var(--font-mono);
  padding: 24px;
  border-radius: var(--radius-md);
  margin: 18px 0;
  line-height: 1.7;
  font-size: 13px;
  border: 4px solid #1c2a36;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.9), 0 8px 24px rgba(0, 0, 0, 0.35);
  position: relative;
  overflow: hidden;
  text-shadow: 0 0 5px rgba(0, 240, 255, 0.65);
}
.oled-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.22) 0px,
    rgba(0, 0, 0, 0.22) 1px,
    transparent 1px,
    transparent 2px
  );
  pointer-events: none;
  opacity: 0.75;
}
.oled-cursor {
  display: inline-block;
  width: 8px;
  height: 14px;
  background: #00f0ff;
  vertical-align: middle;
  margin-left: 4px;
  animation: pulseLive 1s infinite steps(2, start);
}

.device-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.device-grid .card > svg {
  width: 32px;
  height: 32px;
  color: var(--orange);
  stroke-width: 1.6;
  margin-bottom: 16px;
  transition: transform 0.3s var(--ease-spring);
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .device-grid .card:hover > svg {
    transform: scale(1.15) rotate(5deg);
  }
}
.device-grid h3 {
  font-size: 18px;
  margin: 0 0 6px;
}
.device-grid p {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-muted);
}

/* Gráfico de barras interactivo */
.bars {
  display: flex;
  gap: 24px;
  align-items: flex-end;
  height: 190px;
  padding: 24px 10px 10px;
}
.bar-col {
  flex: 1;
  text-align: center;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
  transition: transform 0.2s var(--ease-spring);
}
.bar-col:hover {

  color: var(--orange);
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .bar-col:hover {
    transform: translateY(-4px);
  }
}
.bar {
  width: 44px;
  max-width: 100%;
  background: linear-gradient(180deg, #f56c3a 0%, #e8521d 100%);
  border-radius: 8px 8px 0 0;
  margin: 0 auto;
  box-shadow: 0 4px 12px var(--orange-glow);
  transform-origin: bottom;
  transition: filter 0.2s ease;
}
.fade-in-stagger.page-enter .bar {
  animation: barEntrance 0.32s var(--ease-out) backwards;
}
@keyframes barEntrance {
  from { transform: scaleY(0.03); }
  to { transform: none; }
}
.bar-col:hover .bar {
  filter: brightness(1.15);
  box-shadow: 0 6px 20px rgba(241, 93, 42, 0.45);
}

/* ==========================================================================
   CONFIGURACIÓN & FILAS
   ========================================================================== */

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 20px 0;
  gap: 24px;
}
.setting-row:last-child {
  border-bottom: 0;
}
.setting-row strong {
  font-size: 14px;
  color: var(--text-main);
}
.setting-row p {
  font-size: 12px;
  color: var(--text-muted);
  margin: 4px 0 0;
  line-height: 1.5;
}
.setting-row select, .setting-row input {
  min-height: 42px;
  padding: 8px 14px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  font: inherit;
  box-shadow: var(--shadow-xs);
  outline: none;
}
.setting-row select:focus, .setting-row input:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px var(--orange-glow);
}

.login-preview {
  max-width: 460px;
  margin: 30px auto;
  padding: 32px !important;
}
.login-preview h3 {
  font-size: 22px;
}
.wide {
  width: 100%;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

footer {
  padding: 16px 36px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 11.5px;
  border-top: 1px solid var(--line-light);
  gap: 20px;
}

/* ==========================================================================
   MODALES (DIALOG) & TOASTS
   ========================================================================== */

dialog {
  border: 0;
  border-radius: var(--radius-lg);
  width: 500px;
  max-width: calc(100% - 32px);
  padding: 30px;
  background: #faf5ee;
  box-shadow: 0 25px 80px rgba(20, 15, 10, 0.25), 0 4px 20px rgba(0, 0, 0, 0.1);
  transform-origin: center;
  opacity: 0;
  transform: scale(0.95) translateY(10px);
  transition: opacity 0.22s var(--ease-out), transform 0.22s var(--ease-spring), display 0.22s allow-discrete, overlay 0.22s allow-discrete;
}
dialog[open] {
  opacity: 1;
  transform: scale(1) translateY(0);
}
dialog::backdrop {
  background: rgba(15, 12, 10, 0.5);
  opacity: 0;
  transition: opacity 0.22s var(--ease-out), display 0.22s allow-discrete, overlay 0.22s allow-discrete;
}
dialog[open]::backdrop {
  opacity: 1;
}

@starting-style {
  dialog[open] {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
  dialog[open]::backdrop {
    opacity: 0;
  }
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.modal-head h2 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.6px;
  margin: 0;
}
.modal-head button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #ece3d8;
  display: grid;
  place-items: center;
  font-size: 22px;
  color: #645b53;
  line-height: 1;
  transition-property: transform, opacity, color, background-color, border-color, box-shadow, filter;
  transition-duration: 0.2s;
  transition-timing-function: var(--ease-spring);
}
.modal-head button:hover {
  background: #dfd4c8;
  color: var(--text-main);

}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .modal-head button:hover {
    transform: scale(1.1);
  }
}

#modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 26px;
}

/* Toast flotante con microanimación */
#toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translate(-50%, 25px) scale(0.95);
  background: #121317;
  color: #ffffff;
  padding: 14px 24px;
  border-radius: var(--radius-full);
  opacity: 0;
  pointer-events: none;
  transition-property: transform, opacity, color, background-color, border-color, box-shadow, filter;
  transition-duration: 0.28s;
  transition-timing-function: var(--ease-spring);
  z-index: 1000;
  font-size: 13px;
  font-weight: 500;
  max-width: 90%;
  text-align: center;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: 10px;
}
#toast.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0) scale(1);
}

/* Backdrop para mobile drawer */
#menu-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 12, 10, 0.6);
  z-index: 18;
  opacity: 0;
  transition: opacity 0.25s var(--ease-out), display 0.25s allow-discrete;
}
#menu-backdrop:not([hidden]) {
  opacity: 1;
}
@starting-style {
  #menu-backdrop:not([hidden]) {
    opacity: 0;
  }
}

/* ==========================================================================
   COMMAND PALETTE (CTRL + K)
   ========================================================================== */

#command-dialog {
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg);
  width: 620px;
  max-width: calc(100% - 32px);
  background: #faf6f0;
  box-shadow: 0 25px 90px rgba(10, 8, 5, 0.35);
  overflow: hidden;
  /* Frequent keyboard action: both the panel and backdrop appear immediately. */
  transform: none;
  transition: none;
}
#command-dialog::backdrop {
  transition: none;
}
@starting-style {
  #command-dialog[open],
  #command-dialog[open]::backdrop {
    opacity: 1;
    transform: none;
  }
}
.command-header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}
.command-header svg {
  width: 20px;
  height: 20px;
  stroke: var(--orange);
  flex-shrink: 0;
}
.command-header input {
  flex: 1;
  border: 0;
  font-size: 15px;
  background: transparent;
  outline: none;
  color: var(--text-main);
  padding: 4px 0;
}
.command-list {
  max-height: 380px;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.command-group-title {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 1.2px;
  padding: 8px 12px 4px;
  text-transform: uppercase;
}
.command-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--text-main);
  cursor: pointer;
  transition-property: transform, opacity, color, background-color, border-color, box-shadow, filter;
  transition-duration: 0.15s;
  transition-timing-function: ease;
  user-select: none;
}
.command-item:hover, .command-item.selected {
  background: var(--orange-light);
  color: var(--orange);
  font-weight: 600;
}
.command-item span:first-child {
  display: flex;
  align-items: center;
  gap: 12px;
}
.command-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* ==========================================================================
   MODAL DE ESCÁNER BIOMÉTRICO (DARK THEME HUD)
   ========================================================================== */

#scanner-modal {
  width: 520px;
  max-width: calc(100% - 32px);
  padding: 26px;
  border: 0;
  border-radius: var(--radius-lg);
  background: #12141a;
  color: #ffffff;
  box-shadow: 0 25px 90px rgba(0, 0, 0, 0.6), 0 0 35px rgba(241, 93, 42, 0.25);
}
#scanner-modal .modal-head h2 {
  color: #ffffff;
  font-size: 20px;
}
#scanner-modal .modal-head button {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}
#scanner-modal .modal-head button:hover {
  background: rgba(255, 255, 255, 0.25);
  color: var(--orange);
}
#scanner-modal .btn {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.15);
}
#scanner-modal .btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   ANIMACIONES DE ENTRADA Y FLUIDEZ (HARDWARE ACCELERATED)
   ========================================================================== */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translate3d(0, 10px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes pageEntrance {
  from {
    opacity: 0.85;
    transform: translate3d(0, 6px, 0);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes pulseLive {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.15);
    opacity: 0.75;
  }
}

@keyframes laserScan {
  0% {
    transform: translateY(5%);
    opacity: 0.8;
  }
  50% {
    transform: translateY(92%);
    opacity: 1;
  }
  100% {
    transform: translateY(5%);
    opacity: 0.8;
  }
}

/* Preserve decorative motion while avoiding work in a background tab. */
.motion-paused *,
.motion-paused *::before,
.motion-paused *::after {
  animation-play-state: paused !important;
}

@keyframes badgeBounce {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.25);
  }
}

/* One entrance per section; release compositor layers when it finishes. */
.fade-in-stagger.page-enter > * {
  animation: pageEntrance 0.18s var(--ease-out) backwards;
}
.fade-in-stagger.page-enter > *:nth-child(2) { animation-delay: 0.02s; }
.fade-in-stagger.page-enter > *:nth-child(3) { animation-delay: 0.04s; }
.fade-in-stagger.page-enter > *:nth-child(n+4) { animation-delay: 0.06s; }

/* ==========================================================================
   CÁMARA EN VIVO · MONITOREO Y DETECCIÓN FACIAL (LIVE CAMERA)
   ========================================================================== */

.camera-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(320px, 1fr);
  gap: 22px;
}

.camera-main-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.camera-feed-card {
  background: #0d0f15;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(195, 178, 164, 0.25);
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  overflow: hidden;
  position: relative;
}

.camera-monitor {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  min-height: 410px;
  background: radial-gradient(circle at center, #171b26 0%, #090a0f 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: filter 0.3s ease, box-shadow 0.3s ease;
}

.camera-monitor.flash-active {
  filter: brightness(1.35) contrast(1.1);
  box-shadow: inset 0 0 100px rgba(255, 240, 200, 0.25);
}

.camera-monitor::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  background: #fff;
  opacity: 0;
  transition: opacity 200ms var(--ease-out);
}
.camera-monitor.shutter-effect::after {
  opacity: 0.28;
  transition-duration: 0s;
}

.camera-stream-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
  z-index: 2;
  transform: scaleX(-1);
}

/* Interfaz HUD superpuesta */
.camera-hud-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hud-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: auto;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(220, 38, 38, 0.9);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  box-shadow: 0 0 14px rgba(220, 38, 38, 0.6);
}

.live-badge .live-dot {
  width: 6px;
  height: 6px;
  background: #ffffff;
  border-radius: 50%;
  animation: pulseLive 1.4s infinite ease-in-out;
}

.hud-actions {
  display: flex;
  gap: 8px;
}

.hud-btn {
  background: rgba(40, 42, 48, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 14px;
  transition-property: transform, opacity, color, background-color, border-color, box-shadow, filter;
  transition-duration: 0.2s;
  transition-timing-function: var(--ease-spring);
  cursor: pointer;
}
.hud-btn:hover {
  background: var(--orange);
  border-color: var(--orange);

}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .hud-btn:hover {
    transform: scale(1.08);
  }
}
.hud-btn:active {
  transform: scale(0.95);
}

/* Marco de esquinas telescópicas */
.hud-corner-brackets {
  position: absolute;
  inset: 16px;
  pointer-events: none;
}
.hud-corner-brackets::before,
.hud-corner-brackets::after {
  content: '';
  position: absolute;
  width: 26px;
  height: 26px;
  border-color: rgba(255, 255, 255, 0.45);
  border-style: solid;
}
.hud-corner-brackets::before {
  top: 0; left: 0;
  border-width: 3px 0 0 3px;
}
.hud-corner-brackets::after {
  top: 0; right: 0;
  border-width: 3px 3px 0 0;
}
.hud-corners-bottom::before,
.hud-corners-bottom::after {
  content: '';
  position: absolute;
  width: 26px;
  height: 26px;
  border-color: rgba(255, 255, 255, 0.45);
  border-style: solid;
}
.hud-corners-bottom::before {
  bottom: 16px; left: 16px;
  border-width: 0 0 3px 3px;
}
.hud-corners-bottom::after {
  bottom: 16px; right: 16px;
  border-width: 0 3px 3px 0;
}

/* Recuadro de seguimiento facial IA animado */
.face-target-position {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 6;
  /* Percentages use the monitor's size, preserving responsive placement. */
  transform: translate(38%, 28%);
  transition: transform 0.5s var(--ease-spring);
}
.face-target-box {
  position: absolute;
  top: 0;
  left: 0;
  width: 150px;
  height: 185px;
  border: 2px dashed #f15d2a;
  border-radius: 14px;
  box-shadow: 0 0 25px rgba(241, 93, 42, 0.5), inset 0 0 15px rgba(241, 93, 42, 0.2);
  z-index: 6;
  pointer-events: none;
  transition-property: opacity, border-color, box-shadow;
  transition-duration: 0.5s;
  transition-timing-function: var(--ease-spring);
  animation: faceTrackFloat 3.5s infinite ease-in-out;
}

@keyframes faceTrackFloat {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-8px, 10px); }
}

.face-target-tag {
  position: absolute;
  bottom: -30px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--orange);
  color: #ffffff;
  padding: 4px 11px;
  border-radius: var(--radius-sm);
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: 0.3px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
}

.hud-telemetry {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: rgba(255, 255, 255, 0.75);
  background: rgba(0, 0, 0, 0.72);
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  pointer-events: auto;
}

/* Barra de controles inferior de la cámara (colores del dashboard) */
.camera-controls-bar {
  background: var(--card);
  padding: 20px 24px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.ip-input-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 270px;
}
.ip-input-group label {
  font-weight: 600;
  font-size: 12.5px;
  color: var(--text-main);
  white-space: nowrap;
}
.ip-input-group input {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 9px 14px;
  font-family: var(--font-mono);
  font-size: 13px;
  flex: 1;
  color: var(--text-main);
  outline: none;
  transition-property: transform, opacity, color, background-color, border-color, box-shadow, filter;
  transition-duration: 0.2s;
  transition-timing-function: var(--ease-spring);
}
.ip-input-group input:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px var(--orange-glow);
}

/* Interruptor Toggle moderno estilo iOS */
.switch-control {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-main);
}
.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  background: #ded3c7;
  border-radius: 9999px;
  transition: background-color 0.25s var(--ease-spring);
}
.toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.25s var(--ease-spring);
}
.switch-control.active .toggle-switch {
  background: var(--orange);
}
.switch-control.active .toggle-switch::after {
  transform: translateX(20px);
}

/* Control deslizante de Calidad JPEG */
.slider-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 220px;
}
.slider-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}
.slider-group input[type="range"] {
  flex: 1;
  accent-color: var(--orange);
  cursor: pointer;
}
.slider-val-badge {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 12px;
  color: var(--orange);
  min-width: 28px;
}

/* Panel lateral de Últimas Detecciones */
.detections-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.detections-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 520px;
  overflow-y: auto;
  padding-right: 4px;
}
.detection-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 13px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-xs);
  transition-property: transform, opacity, color, background-color, border-color, box-shadow, filter;
  transition-duration: 0.22s;
  transition-timing-function: var(--ease-spring);
  animation: fadeInUp 0.35s var(--ease-spring) both;
}
.detection-card:hover {
  border-color: rgba(241, 93, 42, 0.4);
  box-shadow: var(--shadow-sm);

}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .detection-card:hover {
    transform: translateX(3px);
  }
}
.detection-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fce8df 0%, #fbd5c6 100%);
  color: var(--orange);
  font-weight: 700;
  font-size: 12px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border: 1px solid #f8cdbf;
}
.detection-info {
  flex: 1;
  min-width: 0;
}
.detection-info strong {
  display: block;
  font-size: 13px;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.detection-info small {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}
.detection-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

@keyframes newDetectionGlow {
  0% {
    background: #fff4ed;
    border-color: var(--orange);
    box-shadow: 0 0 18px rgba(241, 93, 42, 0.4);
    transform: scale(1.02);
  }
  100% {
    background: #ffffff;
    border-color: var(--line);
    box-shadow: var(--shadow-xs);
    transform: scale(1);
  }
}
.detection-card.just-added {
  animation: newDetectionGlow 2.2s ease-out;
}

/* Transición suave para las pestañas de asistencia */
.table-tab-fade {
  animation: fadeInUp 0.28s var(--ease-spring);
}

/* ==========================================================================
   RESPONSIVIDAD Y CONSULTAS DE MEDIOS
   ========================================================================== */

@media (max-width: 1250px) {
  .camera-layout { grid-template-columns: minmax(0, 1fr); }
  .search input { width: 140px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: minmax(0, 1fr); }
  .two-cols { grid-template-columns: minmax(0, 1fr); }
  .device-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 960px) {
  #sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 260px;
    height: 100dvh;
    z-index: 40;
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform 0.28s var(--ease-drawer), visibility 0.28s;
  }
  #sidebar.open {
    transform: translateX(0);
    visibility: visible;
  }
  .workspace {
    width: 100%;
  }
  #menu-toggle {
    display: grid;
  }
  header {
    padding: 0 24px;
    height: 76px;
  }
  main {
    padding: 26px 24px;
  }
  .search {
    display: none;
  }
}

@media (max-width: 640px) {
  header {
    padding: 0 16px;
    height: 70px;
  }
  h1 {
    font-size: 20px;
  }
  .profile-name, .profile small, .profile-arrow {
    display: none;
  }
  .profile {
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
  }
  main {
    padding: 20px 16px;
  }
  .section-heading {
    flex-direction: column;
    align-items: flex-start;
  }
  .stats {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .class-grid, .two-cols, .device-grid {
    grid-template-columns: 1fr;
  }
  .time-pill-widget {
    padding: 4px 8px;
    font-size: 11px;
  }
}

/* Modo accesibilidad para movimiento reducido */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition-property: opacity, color, background-color, border-color !important;
    transition-duration: 120ms !important;
    transition-delay: 0ms !important;
  }
  .new-session:active,
  .time-advance-btn:active,
  .sound-btn:active,
  .notification:active,
  .profile:active,
  .pill:active, .btn:active,
  .hud-btn:active {
    transform: none;
  }
  /* Preserve functional transforms: drawer, toggle, video mirror and progress. */
  dialog, dialog[open] { transform: none; }
  @starting-style {
    dialog[open] { transform: none; }
  }
  #toast, #toast.visible { transform: translateX(-50%); }
  #command-dialog, #command-dialog::backdrop,
  .face-target-position {
    transition: none !important;
  }
}

/* Identidad y bienvenida del acceso de demostración. */
.login-brand{display:flex;align-items:center;justify-content:center;gap:12px;font-size:32px;font-weight:700;letter-spacing:-1.2px;margin:4px 0 28px;color:var(--text)}
.login-logo{display:inline-block;color:var(--orange);font-size:54px;line-height:1;flex-shrink:0}
.login-welcome{text-align:center;padding:30px 8px;min-height:280px;display:flex;flex-direction:column;align-items:center;justify-content:center}
.login-welcome .login-brand{margin-bottom:24px}
.login-welcome p{color:var(--text-muted);margin:12px 0 20px}
.login-preview{width:100%;box-sizing:border-box}
@media(max-width:640px){.login-brand{font-size:29px}.login-logo{font-size:48px}.login-preview{padding:22px}.login-welcome{min-height:240px}}

/* Camera panels must not inherit the navigation sidebar geometry. */
.camera-main-panel,.detections-panel,.detections-panel>.card{min-width:0}
.detections-panel{width:100%;align-self:start}
.detections-panel>.card{height:auto!important}
.detections-list{overflow-x:hidden;scrollbar-width:thin;max-height:560px}
.detection-card{display:grid;grid-template-columns:36px minmax(0,1fr);gap:8px 12px;min-width:0;animation:none;transition:border-color 160ms,box-shadow 160ms}
.detection-card:hover{transform:none}
.detection-card.detection-enter {
  transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out), border-color 160ms ease, box-shadow 160ms ease;
}
@starting-style {
  .detection-card.detection-enter {
    opacity: 0;
    transform: translateY(8px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .camera-monitor::after { display: none; }
  .detection-card.detection-enter { transform: none; }
  @starting-style {
    .detection-card.detection-enter { transform: none; }
  }
}
.detection-avatar{grid-row:1/3}
.detection-info strong{white-space:normal;overflow:visible;overflow-wrap:anywhere;line-height:1.4}
.detection-info small{overflow-wrap:anywhere;line-height:1.5}
.detection-meta{grid-column:2;flex-direction:row;align-items:center;justify-content:flex-start;flex-wrap:wrap;gap:6px 10px;min-width:0}
.detections-panel .card-head{flex-wrap:wrap;gap:10px}
.detections-panel .card-head h3{line-height:1.4}
.detections-panel .card-sub{margin-top:0!important}
.detections-panel .card>div:last-child>div{flex-wrap:wrap;gap:8px;line-height:1.6}
.hud-telemetry{flex-wrap:wrap;gap:8px 16px}
#camera-sim-feed{padding:24px;text-align:center;max-width:100%;box-sizing:border-box}
#camera-sim-feed svg{width:24px;height:24px}
.ip-input-group{flex-wrap:wrap;min-width:0}
.ip-input-group input{min-width:0;width:150px}
.camera-controls-bar select{max-width:100%;min-height:38px;border:1px solid var(--line);background:white;border-radius:8px;padding:6px;font:inherit}
.slider-group{min-width:0;flex-basis:240px}.slider-group input{min-width:0}
@media(max-width:640px){
 .camera-layout{gap:18px}.camera-monitor{min-height:340px;aspect-ratio:auto}
 .camera-hud-overlay{padding:14px}.hud-telemetry{font-size:10px;display:grid;grid-template-columns:1fr 1fr;padding:8px;gap:8px}
 .hud-telemetry span{min-width:0;overflow-wrap:anywhere}
 .camera-controls-bar{padding:18px}.controls-row{gap:14px}
 .ip-input-group{flex-basis:100%}.ip-input-group label{width:100%}
 .ip-input-group input{font-size:16px}.switch-control{flex-wrap:wrap}
 .face-target-position{transform:translate(calc(50% - 65px),22%)}
 .face-target-box{width:130px;height:150px}
 .face-target-tag{font-size:10px;max-width:220px}
}

.ip-input-group{flex:1 1 100%}.ip-input-group input{flex:1 1 180px;width:auto}.ip-input-group .btn{flex-shrink:0}
@media(max-width:640px){.face-target-position{transform:translate(calc(50% - 65px),16%)}.ip-input-group input{flex-basis:150px}}

/* Class selection and scoped student directory. */
.student-class-card{display:block;text-decoration:none;color:var(--text-main);border:1px solid var(--line)}
.student-class-card h3{font-size:21px;margin:18px 0 8px;line-height:1.4}
.student-class-card .btn{margin-top:22px}
.student-class-summary{display:flex;justify-content:space-between;flex-wrap:wrap;gap:10px;color:var(--text-muted);font-size:13px;margin-top:20px}
.student-breadcrumb{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px;margin-bottom:20px;color:var(--text-muted);font-size:12px}
.student-class-select{display:flex;align-items:center;gap:12px;color:var(--text-muted);font-size:13px;flex-wrap:wrap}
.student-class-select select{min-width:200px;max-width:100%}
.student-class-toolbar{align-items:center}
@media(hover:hover) and (pointer:fine){.student-class-card:hover{border-color:var(--orange);box-shadow:var(--shadow-sm)}}
@media(max-width:640px){.student-class-select{width:100%;gap:8px}.student-class-select select{width:100%;min-width:0}.student-class-summary{flex-direction:column}}

/* Match the camera and detection panel edges on desktop. */
@media(min-width:1251px){
 .camera-layout{align-items:stretch}
 .detections-panel{position:relative;align-self:stretch;min-height:0}
 .detections-panel>.card{position:absolute;inset:0;overflow:hidden;margin:0}
 .detections-panel .card-head,.detections-panel .card-sub,.detections-panel .card>div:last-child{flex-shrink:0}
 .detections-list{flex:1;min-height:0;max-height:none;overflow-y:auto;padding-bottom:12px}
 .detection-card{flex-shrink:0}
}

/* University timetable. */
.class-view-tabs{display:flex;flex-wrap:wrap;gap:10px;margin-bottom:26px}
.class-view-tabs .selected{background:#151515;color:white}
.academic-scroll{overflow:auto;max-width:100%;scrollbar-width:thin}
.academic-timetable{min-width:1000px;table-layout:fixed;border-collapse:separate;border-spacing:0;font-size:12px}
.academic-timetable th,.academic-timetable td{padding:5px!important;border-bottom:1px solid var(--line);border-right:1px solid var(--line);height:46px;box-sizing:border-box;vertical-align:middle}
.academic-timetable thead th{text-align:center;background:#e8ddd3;height:42px}
.academic-timetable th:first-child{width:155px;position:sticky;left:0;background:#faf5ef;z-index:1;font-size:11px;white-space:nowrap;font-weight:500;text-align:center}
.academic-timetable thead th:first-child{background:#e8ddd3;z-index:2}
.academic-block{display:flex;flex-direction:column;align-items:center;justify-content:center;width:100%;min-height:40px;gap:2px;background:#f9dccd;color:#8c3414;border-radius:7px;padding:5px;line-height:1.3}
.academic-block b{font-size:11px;white-space:nowrap}.academic-block small{font-size:9px}
.subject-4010{background:#dfe9f5;color:#365c85}.subject-4012{background:#e5def0;color:#685184}.subject-4013{background:#e1eddf;color:#396c38}.subject-4014{background:#f4e7ca;color:#7b5e20}
.academic-catalogue{margin-top:24px}.academic-catalogue .link-btn{text-align:left;white-space:normal;max-width:310px}
.academic-details{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin:0 0 24px}.academic-details dt{color:var(--text-muted);font-size:12px}.academic-details dd{margin:4px 0 0;font-weight:600}
.academic-form-fields{display:grid;grid-template-columns:1fr 1fr;gap:0 14px}.academic-form-fields input{min-width:0;width:100%;box-sizing:border-box}
.academic-class-codes{font-size:11px;color:var(--text-muted);line-height:1.6}
@media(max-width:640px){.academic-schedule-card{padding:14px}.academic-details{grid-template-columns:1fr}.academic-form-fields{grid-template-columns:1fr}.academic-timetable{min-width:970px}}

.enrollment-fields{border:1px solid var(--line);border-radius:12px;padding:16px;margin:6px 0 22px;min-width:0}
.enrollment-fields legend{font-size:13px;font-weight:600;padding:0 5px}
.enrollment-fields p{font-size:12px;color:var(--text-muted);margin:0 0 12px}
.enrollment-fields label{display:flex;align-items:center;gap:10px;padding:8px 0;font-size:13px;line-height:1.5;cursor:pointer}
.enrollment-fields input{width:18px;height:18px;flex-shrink:0;accent-color:var(--orange)}
.enrollment-summary{display:block;max-width:260px;white-space:normal;font-size:12px;line-height:1.6;color:var(--text-muted)}

.subject-labels{display:flex;flex-wrap:wrap;gap:6px;min-width:140px;max-width:300px}.subject-labels .badge{white-space:normal;line-height:1.5}

#nav .nav-section{display:grid;gap:4px}
#nav .nav-group{letter-spacing:1px;line-height:1.5;margin:20px 12px 7px;color:#8c909b}
#nav .nav-section:first-child .nav-group{margin-top:4px}

.academic-class-assignment { display:flex; flex-wrap:wrap; gap:6px; margin:12px 0; }
.academic-class-assignment span { border:1px solid #e4d7cb; background:#f7f0e9; padding:4px 8px; border-radius:6px; font-size:11px; color:#66584c; }
.class-academic-dates { display:flex; flex-wrap:wrap; gap:20px; font-size:12px; margin:12px 0; }
.class-academic-dates div { display:grid; gap:4px; }.class-academic-dates dt { color:#887669; }.class-academic-dates dd { margin:0; }

.meeting-row{border:1px solid #e3d7cc;border-radius:14px;padding:18px;margin:18px 0;background:#fff;min-width:0}.meeting-row legend{font-size:13px;font-weight:700;padding:0 8px;color:#a14321}.meeting-grid{display:grid;grid-template-columns:1fr 1fr;gap:4px 16px}.meeting-grid .field{min-width:0;margin-bottom:14px}.meeting-grid label{display:grid;gap:8px}.meeting-grid input,.meeting-grid select{width:100%;min-width:0;box-sizing:border-box}.meeting-valid-from{margin-top:22px}.course-meeting-list{display:grid;gap:10px;margin:16px 0}.course-meeting-list>div{display:grid;grid-template-columns:95px 1fr;gap:6px 12px;padding:12px;border-radius:10px;background:#f8f3ee;font-size:12px}.course-meeting-list small{color:#76665b}.week-session-kind{font-size:10px;color:#876346;font-weight:600}.registration-notice{border-color:#b6d8c4;background:#edf8f1;color:#20553a}
@media(max-width:600px){.meeting-grid{grid-template-columns:1fr}.meeting-row{padding:14px}.meeting-grid input,.meeting-grid select{font-size:16px;min-height:48px}.meeting-remove{width:100%}.course-meeting-list>div{grid-template-columns:1fr 1fr}}
