/* =============================================================
   KMultimedios VIP PWA – Estilos principales
   Paleta: Rojo KM #e63946 · Oscuro #0a0a0a · Gris #1a1a2e · Blanco #f8f9fa
   ============================================================= */

/* ── Fuentes ─────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ── Reset & base ────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

:root {
  --km-red:       #e63946;
  --km-red-dark:  #c1121f;
  --km-dark:      #0a0a0a;
  --km-dark2:     #141414;
  --km-dark3:     #1e1e1e;
  --km-gray:      #2a2a2a;
  --km-gray2:     #3d3d3d;
  --km-text:      #f1f1f1;
  --km-text-muted:#999;
  --km-accent:    #ffd60a;
  --km-success:   #2dc653;
  --km-warning:   #f4a261;
  --km-error:     #e63946;

  --radius-sm:  6px;
  --radius:     12px;
  --radius-lg:  20px;
  --shadow:     0 4px 24px rgba(0,0,0,0.4);
  --shadow-card:0 2px 12px rgba(0,0,0,0.3);

  --header-h:   64px;
  --nav-h:      52px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

html, body {
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--km-dark);
  color: var(--km-text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--km-red); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

/* ── Pantallas ───────────────────────────────────────────────── */
#app { position: relative; height: 100dvh; overflow: hidden; }

.screen {
  display: none;
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  overflow: hidden;
  animation: fadeIn .25s ease;
}
.screen.active { display: flex; flex-direction: column; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ── Splash / Loading ────────────────────────────────────────── */
.splash {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  background: var(--km-dark);
}

.splash__logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.splash__img {
  width: 88px;
  height: 88px;
  border-radius: var(--radius-lg);
  box-shadow: 0 0 0 3px var(--km-red), var(--shadow);
}

.splash__k {
  font-size: 2.8rem;
  font-weight: 800;
  color: var(--km-red);
  line-height: 1;
}

.splash__brand {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: .2em;
  color: var(--km-text);
}

.splash__vip {
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .3em;
  color: var(--km-accent);
  background: rgba(255,214,10,.12);
  padding: 2px 10px;
  border-radius: 999px;
}

.splash__text {
  color: var(--km-text-muted);
  font-size: .9rem;
}

/* ── Spinner ─────────────────────────────────────────────────── */
.loading-spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--km-gray);
  border-top-color: var(--km-red);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Mensaje global ──────────────────────────────────────────── */
.message {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  padding: 12px 20px;
  font-size: .88rem;
  font-weight: 500;
  text-align: center;
  border-bottom: 2px solid transparent;
}
.message--info    { background: rgba(255,214,10,.15); border-color: var(--km-accent); color: var(--km-accent); }
.message--success { background: rgba(45,198,83,.15);  border-color: var(--km-success); color: var(--km-success); }
.message--warning { background: rgba(244,162,97,.15); border-color: var(--km-warning); color: var(--km-warning); }
.message--error   { background: rgba(230,57,70,.15);  border-color: var(--km-red);     color: var(--km-red); }

/* ── Toast ───────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--km-dark3);
  color: var(--km-text);
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: .88rem;
  box-shadow: var(--shadow);
  opacity: 0;
  transition: all .3s ease;
  z-index: 2000;
  max-width: 90vw;
  text-align: center;
  border-left: 3px solid var(--km-gray2);
}
.toast--success { border-color: var(--km-success); }
.toast--error   { border-color: var(--km-red); }
.toast--info    { border-color: var(--km-accent); }
.toast--visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Banner de instalación ───────────────────────────────────── */
.install-banner {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--km-dark3);
  border-bottom: 1px solid var(--km-gray);
  font-size: .85rem;
  color: var(--km-text-muted);
}

/* ── iOS Install Banner ──────────────────────────────────────── */
.ios-install-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 1000;
  background: #1c1c1e;
  border-top: 1px solid rgba(255,255,255,.15);
  border-radius: 16px 16px 0 0;
  padding: 16px 16px 28px;
  box-shadow: 0 -4px 24px rgba(0,0,0,.5);
  animation: slideUp .35s ease;
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
.ios-install-close {
  position: absolute;
  top: 10px; right: 12px;
  background: rgba(255,255,255,.12);
  border: none;
  color: #fff;
  border-radius: 50%;
  width: 26px; height: 26px;
  font-size: .8rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.ios-install-content {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-right: 30px;
}
.ios-install-icon {
  width: 52px; height: 52px;
  border-radius: 12px;
  flex-shrink: 0;
}
.ios-install-title {
  font-weight: 700;
  font-size: .95rem;
  color: #fff;
  margin: 0 0 4px;
}
.ios-install-desc {
  font-size: .82rem;
  color: rgba(255,255,255,.7);
  margin: 0;
  line-height: 1.5;
}
.ios-install-arrow {
  text-align: center;
  font-size: 1.4rem;
  color: var(--km-accent);
  margin-top: 10px;
  animation: bounce .8s ease infinite alternate;
}
@keyframes bounce {
  from { transform: translateY(0); }
  to   { transform: translateY(6px); }
}

/* ── Screen centradas (login, error, etc.) ───────────────────── */
.screen-inner {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 20px;
}
.screen-inner--centered {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 16px;
}

.icon-circle {
  width: 80px; height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  background: var(--km-dark3);
}
.icon-circle--warning { background: rgba(244,162,97,.15); }
.icon-circle--error   { background: rgba(230,57,70,.15); }

/* ── Botones ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: var(--radius);
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all .2s ease;
  text-decoration: none;
  line-height: 1;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn--full { width: 100%; }
.btn--sm   { padding: 8px 14px; font-size: .8rem; }

.btn--primary {
  background: var(--km-red);
  color: #fff;
  box-shadow: 0 4px 16px rgba(230,57,70,.35);
}
.btn--primary:hover:not(:disabled) {
  background: var(--km-red-dark);
  box-shadow: 0 6px 20px rgba(230,57,70,.5);
  transform: translateY(-1px);
}

.btn--ghost {
  background: transparent;
  color: var(--km-text-muted);
  border: 1px solid var(--km-gray2);
}
.btn--ghost:hover { background: var(--km-dark3); color: var(--km-text); }

.btn--accent {
  background: var(--km-accent);
  color: var(--km-dark);
}

.btn--biometric { font-size: 1rem; padding: 16px; }
.btn-icon       { font-size: 1.1rem; }

.btn--back {
  margin: 16px;
  padding: 10px 16px;
  font-size: .9rem;
}

/* ── Screen de Registro ──────────────────────────────────────── */
.screen-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 24px 0 16px;
  border-bottom: 1px solid var(--km-gray);
  margin-bottom: 24px;
}

.header-logo { width: 48px; height: 48px; border-radius: var(--radius-sm); }

.header-title {
  font-size: 1.2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-user { font-size: .85rem; color: var(--km-text-muted); margin-top: 2px; }

.badge-vip {
  display: inline-block;
  background: linear-gradient(135deg, var(--km-accent), #f4a261);
  color: var(--km-dark);
  font-size: .6rem;
  font-weight: 800;
  letter-spacing: .1em;
  padding: 2px 7px;
  border-radius: 999px;
  vertical-align: middle;
}

.register-card {
  background: var(--km-dark3);
  border: 1px solid var(--km-gray);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  text-align: center;
}

.register-card__icon { font-size: 3rem; margin-bottom: 8px; }
.register-card__title { font-size: 1.3rem; font-weight: 700; margin-bottom: 12px; }
.register-card__desc  { color: var(--km-text-muted); font-size: .9rem; line-height: 1.6; margin-bottom: 20px; }
.register-card__footer { font-size: .78rem; color: var(--km-text-muted); margin-top: 16px; }

.form-group  { text-align: left; margin-bottom: 16px; }
.form-label  { display: block; font-size: .82rem; color: var(--km-text-muted); margin-bottom: 6px; }
.form-input  {
  width: 100%; padding: 12px 14px;
  background: var(--km-dark2); border: 1px solid var(--km-gray2);
  border-radius: var(--radius-sm); color: var(--km-text);
  font-size: .9rem; outline: none; transition: border-color .2s;
}
.form-input:focus { border-color: var(--km-red); }

.biometric-methods {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.biometric-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: .78rem;
  color: var(--km-text-muted);
  background: var(--km-gray);
  padding: 5px 10px;
  border-radius: 999px;
}

.support-list {
  list-style: none;
  text-align: left;
  font-size: .88rem;
  color: var(--km-text-muted);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.error-list {
  list-style: none;
  text-align: left;
  font-size: .88rem;
  color: var(--km-text-muted);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.error-list li::before { content: '• '; color: var(--km-red); }

/* ── App Header ──────────────────────────────────────────────── */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--km-dark2);
  border-bottom: 1px solid var(--km-gray);
  padding-bottom: 0;
}

.app-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  height: var(--header-h);
}

.app-header__brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.app-header__logo { width: 36px; height: 36px; border-radius: 8px; }

.app-header__name {
  font-size: 1rem;
  font-weight: 700;
  margin-right: 6px;
}

.app-header__user {
  display: flex;
  align-items: center;
}

.user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--km-red);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  font-weight: 700;
  color: #fff;
}

.welcome-bar {
  padding: 8px 16px 10px;
  font-size: .85rem;
  color: var(--km-text-muted);
  border-top: 1px solid var(--km-gray);
}
.welcome-bar strong { color: var(--km-text); }
.welcome-bar em     { color: var(--km-accent); font-style: normal; font-size: .8rem; }

/* ── App Main ────────────────────────────────────────────────── */
.app-main {
  flex: 1;
  padding: 16px;
  padding-bottom: 16px;
  overflow-y: auto;
}

.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--km-gray);
}

/* ── Content Grid ────────────────────────────────────────────── */
.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.content-card {
  background: var(--km-dark3);
  border: 1px solid var(--km-gray);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: all .2s ease;
  box-shadow: var(--shadow-card);
}
.content-card:hover {
  transform: translateY(-3px);
  border-color: var(--km-red);
  box-shadow: 0 8px 24px rgba(230,57,70,.2);
}

.content-card__img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
}
.content-card__img--placeholder {
  background: linear-gradient(135deg, var(--km-dark3), var(--km-gray));
}

.content-card__body { padding: 14px; }

.content-card__type {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--km-red);
}

.content-card__title {
  font-size: .95rem;
  font-weight: 600;
  margin: 6px 0;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.content-card__excerpt {
  font-size: .8rem;
  color: var(--km-text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 8px;
}

.content-card__date {
  font-size: .75rem;
  color: var(--km-text-muted);
}

/* Skeleton loader */
.content-skeleton {
  background: var(--km-dark3);
  border-radius: var(--radius);
  height: 240px;
  animation: shimmer 1.4s ease infinite;
}
@keyframes shimmer {
  0%, 100% { opacity: .6; }
  50%       { opacity: 1; }
}

.content-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--km-text-muted);
  padding: 40px 0;
}
.content-empty--error { color: var(--km-red); }

/* ── Detalle de contenido ────────────────────────────────────── */
.detail-view {
  flex: 1;
  overflow-y: auto;
  padding-bottom: calc(var(--nav-h) + var(--safe-bottom));
}

.detail__hero {
  width: 100%;
  max-height: 300px;
  object-fit: cover;
}

.detail__content {
  padding: 20px 16px;
  max-width: 800px;
  margin: 0 auto;
}

.detail__title {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 10px;
}

.detail__meta {
  display: flex;
  gap: 16px;
  font-size: .8rem;
  color: var(--km-text-muted);
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--km-gray);
}

.detail__body {
  font-size: .95rem;
  line-height: 1.8;
  color: var(--km-text);
}
.detail__body h2, .detail__body h3 { margin: 1.5em 0 .5em; color: var(--km-text); }
.detail__body p  { margin-bottom: 1em; }
.detail__body img { border-radius: var(--radius-sm); margin: 1em 0; }
.detail__body a  { color: var(--km-red); }
.detail__body ul, .detail__body ol { padding-left: 1.5em; margin-bottom: 1em; }
.detail__body blockquote {
  border-left: 3px solid var(--km-red);
  padding-left: 16px;
  color: var(--km-text-muted);
  margin: 1em 0;
}

/* ── Top navigation ──────────────────────────────────────────── */
.top-nav {
  display: flex;
  background: rgba(0,0,0,0.55);
  border-bottom: 1px solid rgba(0,255,65,0.12);
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
  z-index: 200;
}
.top-nav::-webkit-scrollbar { display: none; }

.top-nav__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 4px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  cursor: pointer;
  color: var(--km-text-muted);
  text-decoration: none;
  transition: color .15s, border-color .15s;
  font-size: inherit;
  min-width: 56px;
  -webkit-appearance: none;
  appearance: none;
  font-family: inherit;
}
.top-nav__item:hover,
.top-nav__item--active { color: var(--km-red); border-bottom-color: var(--km-red); }

.top-nav__icon  { font-size: 1rem; line-height: 1; }
.top-nav__label { font-size: .58rem; font-weight: 600; letter-spacing: .02em; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (min-width: 600px) {
  .screen-inner { padding: 40px 32px; }
  .app-main { padding: 24px; }
  .content-grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
}

@media (prefers-color-scheme: light) {
  /* Mantener dark mode ya que es una app de multimedia premium */
}

/* ── Utilidades ──────────────────────────────────────────────── */
.error-msg { color: var(--km-red); padding: 20px; text-align: center; }

/* ── Pantalla de cámaras ─────────────────────────────────────── */
.screen--cameras {
  background: #000;
}

/* Header compacto para cámaras */
.cam-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  height: 50px;
  background: var(--km-dark2);
  border-bottom: 1px solid var(--km-gray);
  flex-shrink: 0;
  z-index: 10;
}

.cam-header__left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cam-header__logo {
  width: 28px;
  height: 28px;
  border-radius: 6px;
}

.cam-header__name {
  display: block;
  font-size: .82rem;
  font-weight: 700;
  line-height: 1.2;
}

.cam-header__user {
  display: block;
  font-size: .68rem;
  color: var(--km-text-muted);
}

.cam-header__right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.live-indicator {
  font-size: .62rem;
  font-weight: 800;
  color: #fff;
  background: var(--km-red);
  padding: 2px 8px;
  border-radius: 3px;
  letter-spacing: .04em;
  animation: live-pulse 2s ease infinite;
}

@keyframes live-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .7; }
}

/* Wrapper del iframe */
.cameras-wrap {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #000;
  /* Espacio para el bottom-nav */
  margin-bottom: calc(var(--nav-h) + var(--safe-bottom));
}

.cameras-frame {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  background: #000;
}

/* Overlay de carga */
.cam-loading-overlay {
  position: absolute;
  inset: 0;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 5;
  transition: opacity .3s ease;
}

.cam-loading-overlay p {
  font-size: .85rem;
  color: var(--km-text-muted);
}

.cam-loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

/* =============================================================
   PANEL DE DISPOSITIVOS v2.0
   ============================================================= */

.panel-title { font-size:1rem; font-weight:700; flex:1; text-align:center; }

.devices-panel { display:flex; flex-direction:column; gap:16px; }

.devices-intro {
  font-size:.88rem; color:var(--km-text-muted); line-height:1.6;
  text-align:center; padding:0 4px;
}

/* ── Tarjeta de ranura ───────────────────────────────────────── */
.device-slot-card {
  background:var(--km-dark3); border-radius:var(--radius-lg);
  padding:20px; display:flex; flex-direction:column; gap:14px; transition:border-color .2s;
}
.device-slot-card--active  { border:1px solid var(--km-success); box-shadow:0 0 0 1px rgba(45,198,83,.15); }
.device-slot-card--empty   { border:1.5px dashed var(--km-gray2); opacity:.85; }

.device-slot-card__header  { display:flex; align-items:center; gap:12px; }
.slot-type-icon            { font-size:1.8rem; line-height:1; }
.slot-type-info            { display:flex; flex-direction:column; gap:4px; }
.slot-type-label           { font-size:.9rem; font-weight:700; color:var(--km-text); }
.device-slot-card__info    { display:flex; flex-direction:column; gap:3px; }
.device-name               { font-size:.92rem; font-weight:600; color:var(--km-text); }
.device-meta               { font-size:.78rem; color:var(--km-text-muted); }
.slot-empty-hint           { font-size:.82rem; color:var(--km-text-muted); font-style:italic; text-align:center; }

/* ── Badges ──────────────────────────────────────────────────── */
.slot-badge {
  display:inline-block; padding:2px 8px; border-radius:999px;
  font-size:.68rem; font-weight:700; letter-spacing:.04em; text-transform:uppercase;
}
.slot-badge--active  { background:rgba(45,198,83,.2);  color:var(--km-success); }
.slot-badge--empty   { background:var(--km-gray);       color:var(--km-text-muted); }
.slot-badge--current { background:rgba(255,214,10,.2);  color:var(--km-accent); }

/* ── Barra de cuota anual ────────────────────────────────────── */
.quota-section { display:flex; align-items:center; gap:8px; }
.quota-label   { font-size:.75rem; color:var(--km-text-muted); white-space:nowrap; flex-shrink:0; }
.quota-bar     { flex:1; height:6px; background:var(--km-gray); border-radius:999px; overflow:hidden; }
.quota-bar__fill { height:100%; border-radius:999px; transition:width .4s ease; }
.quota-bar.quota--empty   .quota-bar__fill { background:var(--km-success); }
.quota-bar.quota--partial .quota-bar__fill { background:var(--km-warning); }
.quota-bar.quota--full    .quota-bar__fill { background:var(--km-red); }
.quota-count { font-size:.75rem; font-weight:700; color:var(--km-text-muted); min-width:24px; text-align:right; }

/* ── Indicador ranura (pantalla registro) ────────────────────── */
.slot-indicator {
  display:inline-flex; align-items:center; gap:6px;
  background:rgba(255,214,10,.12); border:1px solid rgba(255,214,10,.3);
  color:var(--km-accent); padding:5px 14px; border-radius:999px;
  font-size:.82rem; font-weight:600; margin-bottom:12px;
}

/* ── Bloqueo anual ───────────────────────────────────────────── */
.blocked-notice {
  display:flex; align-items:flex-start; gap:10px;
  background:rgba(230,57,70,.1); border:1px solid rgba(230,57,70,.3);
  border-radius:var(--radius); padding:16px;
  font-size:.88rem; line-height:1.6; color:var(--km-text);
}
.blocked-notice--sm    { padding:10px 14px; font-size:.8rem; border-radius:var(--radius-sm); }
.blocked-notice__icon  { font-size:1.5rem; flex-shrink:0; }

/* ── Botón eliminar ──────────────────────────────────────────── */
.btn--danger {
  background:rgba(230,57,70,.15); color:var(--km-red);
  border:1px solid rgba(230,57,70,.4);
}
.btn--danger:hover:not(:disabled) { background:var(--km-red); color:#fff; }

/* ── Info box ────────────────────────────────────────────────── */
.devices-info-box {
  background:var(--km-dark3); border:1px solid var(--km-gray);
  border-radius:var(--radius); padding:14px 16px;
  font-size:.82rem; color:var(--km-text-muted); line-height:1.6;
}

/* ── Modal ───────────────────────────────────────────────────── */
.modal-overlay {
  position:fixed; inset:0; z-index:3000;
  background:rgba(0,0,0,.75);
  display:none; align-items:center; justify-content:center;
  padding:20px;
}
.modal-overlay.modal--open {
  display:flex; animation:fadeIn .2s ease;
}
.modal-box {
  background:var(--km-dark3); border:1px solid var(--km-gray2);
  border-radius:var(--radius-lg); padding:28px 24px;
  width:100%; max-width:380px; text-align:center;
  box-shadow:0 20px 60px rgba(0,0,0,.6);
}
.modal-icon  { font-size:2.5rem; margin-bottom:8px; }
.modal-title { font-size:1.2rem; font-weight:700; margin-bottom:12px; }
.modal-desc  { font-size:.87rem; color:var(--km-text-muted); line-height:1.6; margin-bottom:24px; }
.modal-actions { display:flex; gap:10px; }
.modal-actions .btn { flex:1; }

/* ══════════════════════════════════════════════════════════════
   COMMAND CENTER – Variables & Animaciones
   ══════════════════════════════════════════════════════════════ */
:root {
  --cc-green:      #00ff41;
  --cc-cyan:       #00f0ff;
  --cc-amber:      #ffb700;
  --cc-red:        #ff2d2d;
  --cc-bg:         #040d08;
  --cc-bg2:        #071210;
  --cc-panel:      rgba(0,255,65,.04);
  --cc-border:     rgba(0,255,65,.18);
  --cc-border2:    rgba(0,240,255,.15);
}

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Share+Tech+Mono&display=swap');

@keyframes cc-scanline {
  0%   { transform: translateY(-100%); }
  100% { transform: translateY(100vh); }
}
@keyframes cc-grid-pulse {
  0%,100% { opacity:.15; }
  50%      { opacity:.28; }
}
@keyframes cc-radar-sweep {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@keyframes cc-pulse-dot {
  0%,100% { opacity:1; transform: scale(1); }
  50%      { opacity:.4; transform: scale(1.5); }
}
@keyframes radio-bar {
  0%,100% { height:4px; }
  50%      { height:20px; }
}
@keyframes radio-pulse-ring {
  0%   { transform: scale(1);   opacity:1; }
  100% { transform: scale(2.5); opacity:0; }
}

/* ── Screen CC ───────────────────────────────────────────────── */
.screen--cc {
  flex-direction: column;
  background: var(--cc-bg);
  color: var(--cc-green);
  font-family: 'Share Tech Mono', monospace;
  overflow: hidden;
  position: relative;
}

/* Grid background */
.cc-grid-layer {
  position: absolute; inset: 0; z-index: 0;
  background-image:
    linear-gradient(rgba(0,255,65,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,255,65,.06) 1px, transparent 1px);
  background-size: 40px 40px;
  animation: cc-grid-pulse 4s ease-in-out infinite;
  pointer-events: none;
}

/* Scanline */
.cc-scanline {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(transparent 50%, rgba(0,0,0,.03) 50%);
  background-size: 100% 4px;
  animation: cc-scanline 12s linear infinite;
  pointer-events: none; opacity:.4;
}

/* ── CC Header ───────────────────────────────────────────────── */
.cc-header {
  position: relative; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 14px 6px;
  padding-top: calc(8px + env(safe-area-inset-top, 0px));
  background: rgba(0,0,0,.7);
  border-bottom: 1px solid var(--cc-border);
  flex-shrink: 0;
}
.cc-header__logo {
  width: 30px; height: 30px; border-radius: 6px;
  margin-right: 8px; border: 1px solid var(--cc-border);
}
.cc-header__left { display:flex; align-items:center; }
.cc-header__titles { display:flex; flex-direction:column; }
.cc-header__name {
  font-family:'Orbitron',sans-serif; font-size:.8rem; font-weight:700;
  color: var(--cc-cyan); letter-spacing:.05em;
}
.cc-header__sub { font-size:.65rem; color: var(--cc-green); opacity:.8; }

.cc-header__right { display:flex; align-items:center; gap:10px; }
.cc-live-dot {
  font-family:'Orbitron',sans-serif; font-size:.65rem; font-weight:700;
  color: var(--cc-green); animation: cc-pulse-dot 1.2s ease-in-out infinite;
  white-space: nowrap;
}

/* ── Tabs ────────────────────────────────────────────────────── */
.cc-tabs {
  display: flex; position: relative; z-index: 10;
  background: rgba(0,0,0,.6);
  border-bottom: 1px solid var(--cc-border);
  flex-shrink: 0;
}
.cc-tab {
  flex: 1; padding: 8px 4px; font-size: .75rem;
  font-family: 'Orbitron', sans-serif; font-weight: 700;
  background: transparent; border: none; color: rgba(0,255,65,.5);
  cursor: pointer; letter-spacing: .04em; transition: color .2s, border-color .2s;
  border-bottom: 2px solid transparent;
  display: flex; align-items: center; justify-content: center; gap: 5px;
}
.cc-tab--active {
  color: var(--cc-green); border-bottom-color: var(--cc-green);
}

/* ── CC Main scrollable area ─────────────────────────────────── */
.cc-main {
  flex: 1; overflow-y: auto; position: relative; z-index: 5;
  -webkit-overflow-scrolling: touch;
}
.cc-main--hidden { display: none !important; }

/* ── Session Banner ──────────────────────────────────────────── */
.cc-session-banner {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 14px;
  background: rgba(0,240,255,.06);
  border-bottom: 1px solid var(--cc-border2);
  font-size: .65rem; color: var(--cc-cyan); position: relative; overflow: hidden;
}
.cc-session-banner__icon { font-size: .9rem; }
.cc-session-banner__text { flex: 1; line-height: 1.4; }

/* Radar mini */
.cc-radar {
  width: 36px; height: 36px; position: relative; flex-shrink: 0;
}
.cc-radar__sweep {
  position: absolute; inset: 0;
  background: conic-gradient(from 0deg, transparent 70%, rgba(0,255,65,.6) 100%);
  border-radius: 50%;
  animation: cc-radar-sweep 3s linear infinite;
}
.cc-radar__ring {
  position: absolute; border: 1px solid rgba(0,255,65,.3); border-radius: 50%;
}
.cc-radar__ring--1 { inset: 20%; }
.cc-radar__ring--2 { inset: 0; }

/* ── Loading state ───────────────────────────────────────────── */
.cc-loading-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; padding: 60px 20px; color: var(--cc-green); opacity: .7;
  font-size: .85rem;
}
.cc-loading-state--error { color: var(--cc-red); }

/* ── Zone ────────────────────────────────────────────────────── */
.cc-zone {
  border: 1px solid var(--cc-border);
  margin: 10px; border-radius: 6px;
  background: var(--cc-panel);
  overflow: hidden;
}
.cc-zone__header {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  padding: 8px 12px;
  background: rgba(0,255,65,.07);
  border-bottom: 1px solid var(--cc-border);
}
.cc-zone__code {
  font-family: 'Orbitron',sans-serif; font-size: .65rem; font-weight: 900;
  color: var(--cc-cyan); letter-spacing: .1em;
}
.cc-zone__name {
  font-family: 'Orbitron',sans-serif; font-size: .75rem; font-weight: 700;
  color: var(--cc-green); flex: 1; min-width: 120px;
}
.cc-zone__status {
  font-size: .6rem; padding: 2px 7px; border-radius: 3px; font-weight: 700;
  letter-spacing: .06em;
}
.cc-zone__status--online {
  background: rgba(0,255,65,.15); color: var(--cc-green);
  border: 1px solid var(--cc-green);
}
.cc-zone__traffic {
  font-size: .6rem; color: var(--cc-amber); letter-spacing: .06em;
}

/* ── Section ─────────────────────────────────────────────────── */
.cc-section { padding: 8px 10px; }
.cc-section__header {
  display: flex; align-items: center; gap: 6px;
  font-size: .65rem; color: var(--cc-cyan); margin-bottom: 8px;
  letter-spacing: .06em; text-transform: uppercase;
}
.cc-section__dir {
  margin-left: auto; font-size: .6rem; color: rgba(0,240,255,.6);
}

/* ── Camera Grid ─────────────────────────────────────────────── */
.cc-cams-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 10px;
  padding: 4px 0;
}
.cc-zone__meta { display: flex; align-items: center; gap: 6px; margin-left: auto; }

/* ── Camera Card ─────────────────────────────────────────────── */
.cam-card {
  border: 1px solid var(--cc-green);
  background: var(--cc-panel);
  overflow: hidden;
  box-shadow: 0 0 12px rgba(0,255,65,.15);
  transition: box-shadow .2s;
}
.cam-card:hover { box-shadow: 0 0 24px rgba(0,255,65,.3); }

/* Header */
.cam-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 6px 10px;
  background: linear-gradient(135deg, rgba(0,255,65,.08), rgba(0,240,255,.05));
  border-bottom: 1px solid var(--cc-border);
  gap: 8px;
}
.cam-header__info { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.cam-id       { font-family: 'Share Tech Mono',monospace; font-size: .58rem; color: var(--cc-cyan); letter-spacing: .12em; text-transform: uppercase; }
.cam-name     { font-size: .75rem; font-weight: 700; color: var(--cc-text); text-transform: uppercase; letter-spacing: .03em; }
.cam-location { font-size: .6rem; color: var(--cc-text-dim); }
.cam-type-badge {
  flex-shrink: 0; padding: 2px 7px;
  background: var(--cc-cyan); color: #000;
  font-family: 'Share Tech Mono',monospace; font-size: .55rem;
  font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  white-space: nowrap; align-self: flex-start;
}

/* Video */
.cam-video-wrap {
  position: relative; background: #000;
  aspect-ratio: 16/9; overflow: hidden;
}
.cam-video { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }
.cam-loading {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px;
  background: linear-gradient(135deg, #020d05, #040d08);
}
.cam-spinner {
  width: 36px; height: 36px;
  border: 2px solid rgba(0,255,65,.2);
  border-top-color: var(--cc-green);
  border-radius: 50%;
  animation: camSpin 1s linear infinite;
}
@keyframes camSpin { to { transform: rotate(360deg); } }
.cam-loading__text {
  font-family: 'Share Tech Mono',monospace;
  font-size: .6rem; color: rgba(0,255,65,.5);
  letter-spacing: .1em; text-transform: uppercase;
}
.cam-placeholder {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(135deg, #020d05, #040d08);
}
.cam-placeholder__name { font-size: .65rem; color: rgba(0,255,65,.5); letter-spacing: .05em; }
.cam-placeholder__err  { font-size: .65rem; color: var(--cc-red); margin-bottom: 4px; }

.cc-play-btn {
  background: rgba(0,255,65,.12); border: 1px solid var(--cc-green);
  color: var(--cc-green); font-family: 'Share Tech Mono', monospace;
  font-size: .7rem; padding: 6px 16px; cursor: pointer; transition: background .2s;
}
.cc-play-btn:hover { background: rgba(0,255,65,.25); }

/* Session banner (watermark) */
.cam-session-banner {
  display: flex; align-items: stretch;
  background: linear-gradient(90deg, #0a0e00, #0d1200, #0a0e00);
  border-top: 1px solid rgba(0,255,65,.25);
  border-bottom: 1px solid rgba(0,255,65,.12);
  overflow: hidden; user-select: none;
}
.csb-indicator {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px;
  padding: 4px 8px;
  background: rgba(0,255,65,.06);
  border-right: 1px solid rgba(0,255,65,.2);
  flex-shrink: 0;
}
.csb-rec-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #ff0033; box-shadow: 0 0 5px rgba(255,0,51,.5);
  animation: recBlink 1.4s ease-in-out infinite;
}
@keyframes recBlink { 0%,100%{opacity:1} 50%{opacity:.2} }
.csb-rec-label { font-family: 'Share Tech Mono',monospace; font-size: 7px; color: #ff0033; letter-spacing: .08em; }
.csb-body { flex: 1; min-width: 0; padding: 4px 8px; display: flex; align-items: center; }
.csb-data-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0 10px; }
.csb-field { display: flex; align-items: center; }
.csb-field-value { font-family: 'Share Tech Mono',monospace; font-size: 8.5px; color: var(--cc-green); font-weight: 700; }
.csb-email { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.csb-ip    { color: var(--cc-cyan); font-size: 9px; }

/* Footer */
.cam-footer { padding: 5px 8px; background: rgba(0,0,0,.4); border-top: 1px solid var(--cc-border); }
.cam-status-bar { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.cam-status {
  font-family: 'Share Tech Mono',monospace;
  font-size: .6rem; letter-spacing: .06em; text-transform: uppercase;
}
.cam-status.online     { color: var(--cc-green); }
.cam-status.connecting { color: var(--cc-amber); }
.cam-status.offline    { color: var(--cc-red);   }
.cam-controls { display: flex; gap: 4px; }

.cc-ctrl-btn {
  width: 26px; height: 26px; cursor: pointer;
  background: rgba(0,255,65,.08); border: 1px solid var(--cc-border);
  color: var(--cc-green); font-size: .75rem;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.cc-ctrl-btn:hover { background: rgba(0,255,65,.2); }
.cc-ctrl-btn--audio { color: var(--cc-cyan); }

/* ══════════════════════════════════════════════════════════════
   RADIO PLAYER
   ══════════════════════════════════════════════════════════════ */
.radio-panel {
  padding: 20px 16px;
  display: flex; flex-direction: column; gap: 20px;
  max-width: 480px; margin: 0 auto;
}

.radio-header {
  display: flex; align-items: center; gap: 14px;
}
.radio-pulse {
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(0,255,65,.15); border: 2px solid var(--cc-green);
  position: relative; flex-shrink: 0;
}
.radio-pulse::after {
  content: ''; position: absolute; inset: -6px;
  border: 2px solid rgba(0,255,65,.4); border-radius: 50%;
  animation: radio-pulse-ring 2s ease-out infinite;
}
.radio-title {
  font-family: 'Orbitron', sans-serif; font-size: 1.1rem;
  color: var(--cc-green); font-weight: 700;
}
.radio-subtitle { font-size: .7rem; color: rgba(0,255,65,.6); margin-top: 2px; }

.radio-player-wrap {
  background: rgba(0,0,0,.5);
  border: 1px solid var(--cc-border);
  border-radius: 8px; padding: 20px;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
}

/* Visualizer */
.radio-visualizer {
  display: flex; align-items: flex-end; gap: 3px; height: 24px;
}
.radio-visualizer span {
  display: inline-block; width: 4px; background: var(--cc-border);
  border-radius: 2px; height: 4px;
}
.radio-visualizer--active span {
  background: var(--cc-green);
  animation: radio-bar .8s ease-in-out infinite;
}
.radio-visualizer--active span:nth-child(1)  { animation-delay: 0s; }
.radio-visualizer--active span:nth-child(2)  { animation-delay: .1s; }
.radio-visualizer--active span:nth-child(3)  { animation-delay: .2s; }
.radio-visualizer--active span:nth-child(4)  { animation-delay: .05s; }
.radio-visualizer--active span:nth-child(5)  { animation-delay: .15s; }
.radio-visualizer--active span:nth-child(6)  { animation-delay: .25s; }
.radio-visualizer--active span:nth-child(7)  { animation-delay: .08s; }
.radio-visualizer--active span:nth-child(8)  { animation-delay: .18s; }
.radio-visualizer--active span:nth-child(9)  { animation-delay: .12s; }
.radio-visualizer--active span:nth-child(10) { animation-delay: .22s; }

.radio-player-top { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.radio-station-logo { width: 56px; height: 56px; border-radius: 8px; object-fit: contain; background: #fff; padding: 4px; flex-shrink: 0; }
.radio-info { text-align: left; flex: 1; }
.radio-info__station { font-family:'Orbitron',sans-serif; font-size:.9rem; color:var(--cc-cyan); }
.radio-info__nowplaying { font-size:.7rem; color:rgba(0,255,65,.8); margin-top:2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
.radio-info__status  { font-size:.65rem; color:rgba(0,255,65,.5); margin-top:2px; }

.radio-play-btn {
  width: 64px; height: 64px; border-radius: 50%;
  background: rgba(0,255,65,.12); border: 2px solid var(--cc-green);
  color: var(--cc-green); font-size: 1.6rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s, transform .1s;
}
.radio-play-btn:active { transform: scale(.94); }
.radio-play-btn:hover  { background: rgba(0,255,65,.25); }

.radio-volume-wrap {
  display: flex; align-items: center; gap: 8px; width: 100%;
}
.radio-vol-icon { font-size: .9rem; }
.radio-volume {
  flex: 1; accent-color: var(--cc-green);
  height: 4px; cursor: pointer;
}

.radio-stations { display: flex; flex-direction: column; gap: 6px; }
.radio-stations__label {
  font-size: .6rem; color: rgba(0,255,65,.5);
  letter-spacing: .1em; text-transform: uppercase; margin-bottom: 4px;
}
.radio-station {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px; cursor: pointer;
  background: rgba(0,0,0,.4); border: 1px solid var(--cc-border);
  color: rgba(0,255,65,.7); font-size: .8rem;
  font-family: 'Share Tech Mono', monospace;
  transition: background .15s, border-color .15s;
  width: 100%; text-align: left;
}
.radio-station:hover { background: rgba(0,255,65,.06); border-color: rgba(0,255,65,.4); }
.radio-station--active {
  border-color: var(--cc-green); color: var(--cc-green);
  background: rgba(0,255,65,.08);
}
.radio-station__logo { width: 42px; height: 42px; border-radius: 6px; object-fit: contain; background: #fff; padding: 3px; flex-shrink: 0; }
.radio-station__info { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.radio-station__name { font-size: .78rem; font-weight: 600; }
.radio-station__freq { font-size: .62rem; color: var(--cc-cyan); }
.radio-station__dot { color: var(--cc-green); animation: cc-pulse-dot 1.2s ease-in-out infinite; flex-shrink: 0; }

.radio-legal {
  font-size: .6rem; color: rgba(0,255,65,.35);
  text-align: center; line-height: 1.5;
}

/* ── Toasts container ────────────────────────────────────────── */
#toasts {
  position:fixed;
  bottom:calc(var(--nav-h) + 16px + var(--safe-bottom));
  left:50%; transform:translateX(-50%);
  z-index:2000;
  display:flex; flex-direction:column; align-items:center; gap:8px;
  pointer-events:none; width:90vw;
}
.toast { pointer-events:auto; }


/* ── Camera Watermark Overlay ────────────────────────────────── */
.cam-wm-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 6px 8px;
  font-family: 'Share Tech Mono', 'Courier New', monospace;
  font-size: 0.6rem;
  color: #00ff41;
  letter-spacing: 0.04em;
  user-select: none;
  -webkit-user-select: none;
  opacity: 0.5;
}
.cam-wm-top,
.cam-wm-mid,
.cam-wm-bot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  width: 100%;
  background: rgba(0,0,0,0.28);
  border-radius: 2px;
  padding: 2px 4px;
}
.cam-wm-enc  { font-size: 0.55rem; color: #00ccff; }
.cam-wm-deg  { font-size: 0.55rem; }
.cam-wm-email,
.cam-wm-ip   { font-size: 0.58rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cam-wm-sep  { opacity: 0.4; }
.cam-wm-frame { font-size: 0.55rem; color: #ffdd00; }
.cam-wm-ts   { font-size: 0.55rem; }
.cam-wm-id   { font-size: 0.55rem; color: #00ccff; }

/* ── Home Tiles ──────────────────────────────────────────────────────────── */
.home-main {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 16px;
  gap: 0;
}
.home-tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}
.home-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 20px 16px;
  border-radius: 12px;
  border: 1px solid var(--cc-border);
  background: rgba(0,0,0,0.5);
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .1s;
  text-align: left;
  position: relative;
  overflow: hidden;
  min-height: 130px;
  -webkit-appearance: none;
  appearance: none;
  font-family: inherit;
  color: inherit;
}
.home-tile:active { transform: scale(.97); }
.home-tile__icon  { font-size: 2rem; line-height: 1; }
.home-tile__info  { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.home-tile__title { font-size: .8rem; font-weight: 700; color: #e0ffe8; letter-spacing: .02em; }
.home-tile__sub   { font-size: .65rem; color: rgba(0,255,65,.5); }
.home-tile__arrow { position: absolute; bottom: 10px; right: 14px; font-size: 1.4rem; color: rgba(0,255,65,.3); }

.home-tile--cameras { border-color: rgba(0,255,65,.3); }
.home-tile--cameras:hover { background: rgba(0,255,65,.07); border-color: var(--cc-green); }

.home-tile--video   { border-color: rgba(0,204,255,.3); }
.home-tile--video:hover { background: rgba(0,204,255,.07); border-color: var(--cc-cyan); }
.home-tile--video .home-tile__sub { color: rgba(0,204,255,.6); }

.home-tile--radio   { border-color: rgba(255,180,0,.25); }
.home-tile--radio:hover { background: rgba(255,180,0,.06); border-color: rgba(255,180,0,.7); }
.home-tile--radio .home-tile__sub { color: rgba(255,180,0,.6); }

.home-tile--settings { border-color: rgba(180,180,180,.2); }
.home-tile--settings:hover { background: rgba(255,255,255,.05); border-color: rgba(180,180,180,.5); }
.home-tile--settings .home-tile__sub { color: rgba(255,255,255,.4); }

/* ── Back button ─────────────────────────────────────────────────────────── */
.cc-back-btn {
  background: none; border: none; cursor: pointer;
  color: var(--cc-green); font-size: 1.6rem; line-height: 1;
  padding: 0 8px 0 0; margin-right: 4px;
  display: flex; align-items: center;
}
.cc-back-btn:hover { color: #fff; }

/* ── Video Screen ────────────────────────────────────────────────────────── */
.video-main { padding: 12px; }
.video-channels { display: flex; flex-direction: column; gap: 12px; }
.video-channel-card {
  border-radius: 10px; border: 1px solid var(--cc-border);
  background: rgba(0,0,0,.5); overflow: hidden;
}
.video-channel__header {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--cc-border);
  font-family: 'Share Tech Mono', monospace; font-size: .8rem;
}
.video-channel__dot   { color: var(--cc-green); animation: cc-pulse-dot 1.2s ease-in-out infinite; }
.video-channel__name  { flex: 1; color: var(--cc-green); font-weight: 700; }
.video-channel__badge {
  font-size: .6rem; padding: 2px 6px; border-radius: 3px;
  background: rgba(0,255,65,.15); color: var(--cc-green);
  border: 1px solid rgba(0,255,65,.3);
}
.video-channel__player {
  width: 100%; aspect-ratio: 16/9; background: #000;
}

/* ── Settings Screen ─────────────────────────────────────────────────────── */
.settings-main { padding: 16px; display: flex; flex-direction: column; gap: 16px; }

.settings-user-card {
  display: flex; align-items: center; gap: 14px;
  padding: 16px; border-radius: 12px;
  background: rgba(0,255,65,.06); border: 1px solid rgba(0,255,65,.2);
}
.settings-avatar {
  width: 52px; height: 52px; border-radius: 50%;
  background: rgba(0,255,65,.15); border: 2px solid rgba(0,255,65,.4);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; font-weight: 700; color: var(--cc-green);
  flex-shrink: 0;
}
.settings-user-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.settings-user-name  { font-size: .95rem; font-weight: 700; color: #e0ffe8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.settings-user-email { font-size: .7rem; color: rgba(0,255,65,.5); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.settings-user-level { font-size: .65rem; color: var(--cc-cyan); letter-spacing: .05em; text-transform: uppercase; }

.settings-section { display: flex; flex-direction: column; gap: 2px; }
.settings-section__label {
  font-size: .6rem; color: rgba(0,255,65,.4);
  letter-spacing: .1em; padding: 0 4px; margin-bottom: 4px;
}
.settings-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 12px; border-radius: 8px; cursor: pointer;
  background: rgba(0,0,0,.4); border: 1px solid var(--cc-border);
  color: rgba(0,255,65,.8); text-decoration: none;
  transition: background .15s, border-color .15s;
  width: 100%; text-align: left;
}
.settings-item:hover   { background: rgba(0,255,65,.06); border-color: rgba(0,255,65,.4); }
.settings-item:active  { transform: scale(.99); }
.settings-item__icon   { font-size: 1.2rem; width: 28px; text-align: center; flex-shrink: 0; }
.settings-item__info   { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.settings-item__title  { font-size: .85rem; font-weight: 600; color: #e0ffe8; }
.settings-item__sub    { font-size: .65rem; color: rgba(0,255,65,.45); }
.settings-item__arrow  { font-size: 1.2rem; color: rgba(0,255,65,.3); flex-shrink: 0; }
.settings-item--danger { color: rgba(255,80,80,.8); border-color: rgba(255,80,80,.2); }
.settings-item--danger .settings-item__title { color: #ffaaaa; }
.settings-item--danger:hover { background: rgba(255,80,80,.06); border-color: rgba(255,80,80,.4); }

.settings-version {
  font-size: .6rem; color: rgba(0,255,65,.25);
  text-align: center; letter-spacing: .05em; padding-bottom: 8px;
}
