:root[data-theme="dark"] {
  --bg: #0e0e0e;
  --fg: #f0f0f0;
  --border: #2a2a2a;
  --header-bg: #1b1b1b;

  --hover-bg: #2f2f2f;
  
  --danger-bg: #3a0d0d;   /* rojo oscuro */
  --danger-fg: #ffdede;

  --warn-bg: #3a320d;     /* ámbar oscuro */
  --warn-fg: #fff2b0;

  --accent-color: #64b5f6;
}

:root[data-theme="light"] {
  --bg: #ffffff;
  --fg: #111111;
  --border: #d0d0d0;
  --header-bg: #fafafa;
  --header-border: #bcbcbc;
  --header-shadow: rgba(0,0,0,0.08);
  
  --hover-bg: #e2e2e2;

  --danger-bg: #ffe5e5;   /* rosa claro */
  --danger-fg: #7a0000;

  --warn-bg: #fff4cc;     /* amarillo claro */
  --warn-fg: #5a4a00;
  
  --table-head-bg: #f2f2f2;
  --table-head-border: #b0b0b0;

  --accent-color: #1976d2;
}


/*
:root {
  --bg: #111;
  --fg: #eee;
  --border: #333;
  --header-bg: #1a1a1a;
}
*/
/*
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, sans-serif;
}
*/

html, body {
  height: 100%;
  margin: 0;
}
/*
body {
  display: flex;
  flex-direction: column;
  height: 100vh;*/         /* IMPORTANTE *//*
  overflow: hidden;     */ /* EL BODY NO SCROLLEA *//*
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, sans-serif;
}
*/

body {
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, sans-serif;
}

/* El contenedor principal */
#app {
  height: 100vh;
  display: flex;
  flex-direction: column;
}
/*
header {
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 1rem;
  background: var(--header-bg);
  border-bottom: 2px solid var(--header-border);
  box-shadow: 0 2px 4px var(--header-shadow);
  z-index: 10;
}
*/

/* Header fijo arriba */
header {
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 1rem;
  background: var(--header-bg);
  border-bottom: 2px solid var(--header-border);
  box-shadow: 0 2px 4px var(--header-shadow);
  z-index: 10;
}

nav a {
  margin-right: 1rem;
  color: var(--fg);
  text-decoration: none;
}

/* Botón volver / anterior */
.cc-nav-back {
  color: var(--accent-color);
  font-weight: 600;
  opacity: 0.9;
}

.cc-nav-back:hover {
  opacity: 1;
  text-decoration: underline;
}
/*
.cc-nav-back::before {
  content: "← ";
}
*/
/*
main {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 1rem;
}
*/


/* Contenido central con scroll */
main {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 1rem;
  min-height: 0; /* MUY IMPORTANTE */
}


/* Footer fijo abajo */
footer {
  flex: 0 0 auto;
  border-top: 1px solid var(--border);
  padding: 0.6rem;
  text-align: center;
  font-size: 0.8rem;
  opacity: 0.7;
  background: var(--header-bg);
}

h2, h3 {
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

/*
h3 {
  margin-top: 2rem;
  margin-bottom: 0.8rem;
}
*/

/* estilos user y dibujo de silueta */
#user-indicator {
  width: 28px;
  height: 28px;
  position: relative;
  cursor: default;
}

/* cabeza */
#user-indicator::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 50%;
  width: 10px;
  height: 10px;
  background: var(--fg);
  border-radius: 50%;
  transform: translateX(-50%);
}

/* cuerpo */
#user-indicator::after {
  content: '';
  position: absolute;
  bottom: 1px;
  left: 50%;
  width: 18px;
  height: 10px;
  background: var(--fg);
  border-radius: 50% 50% 40% 40%;
  /* transform: translateX(-50%) rotate(-8deg); */
  transform: translateX(-50%) rotate(-6deg) scaleX(1.1);
}
/* Home y Community — botones */
.cc-btn-list {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
}

.cc-btn {
  padding: 0.8rem 1.4rem;
  font-size: 1rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--header-bg);
  color: var(--fg);
  cursor: pointer;
}

.cc-btn:hover {
  background: var(--hover-bg);
  border-color: #666;
}

/* GroupActivity y GroupStats — tablas en columnas limpias */
.cc-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.cc-table th,
.cc-table td {
  padding: 0.6rem 0.8rem;
  text-align: center;
}

.cc-table thead {
  background: var(--header-bg);
}

.cc-table thead th {
  background: var(--table-head-bg);
  border-bottom: 2px solid var(--table-head-border);
  font-weight: 600;
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
}

.cc-table tbody tr:nth-child(odd) {
  background: color-mix(in srgb, var(--bg) 90%, #000);
}

.cc-table tbody tr:nth-child(even) {
  background: color-mix(in srgb, var(--bg) 80%, #000);
}

.cc-table tbody tr:hover {
  background: var(--hover-bg);
}

/* Expulsión recomendada */
.cc-table tr.expulsion {
  background: var(--danger-bg);
  color: var(--danger-fg);
}

/* VIP */
.cc-table tr.vip {
  background: var(--warn-bg);
  color: var(--warn-fg);
}

.cc-table tr.expulsion td:first-child::before {
  content: "❌ ";
}

.cc-table tr.vip td:first-child::before {
  content: "⚠️ ";
}

/* Mejora para dispositivo - contenido tabla  */
@media (max-width: 600px) {

  .cc-table thead {
    display: none;
  }

  .cc-table tr {
    display: block;
    border: 1px solid var(--border);
    margin-bottom: 0.8rem;
    padding: 0.6rem;
    border-radius: 6px;
    background: var(--header-bg);
  }

  .cc-table td {
    display: flex;
    justify-content: space-between;
    padding: 0.3rem 0;
  }

  .cc-table td::before {
    content: attr(data-label);
    font-weight: bold;
    opacity: 0.7;
  }
  .cc-table {
    border: none;
  }

  .cc-table tbody tr {
    margin-bottom: 1rem;
  }
}

/* Mejorar home intro */
.home-intro {
  max-width: 600px;
  line-height: 1.5;
  opacity: 0.85;
}
/* Mostrar última actualización */
.cc-subtitle {
  font-size: 1.05rem;
  font-weight: 500;
}

.ultima-actualizacion {
  font-size: 0.8rem;
  opacity: 0.6;
}
/*
.ultima-actualizacion {
  font-size: 0.9rem;
  opacity: 0.7;
  margin-bottom: 1rem;
}
*/
/* Identity menu */
.identity-menu {
  position: relative;
}

.identity-button {
  background: none;
  border: none;
  color: var(--fg);
  cursor: pointer;
  font-size: 0.9rem;
}

.identity-dropdown {
  position: absolute;
  right: 0;
  top: 110%;
  background: var(--header-bg);
  border: 1px solid var(--border);
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  min-width: 150px;
}

.identity-dropdown button {
  background: none;
  border: none;
  padding: 0.4rem;
  text-align: left;
  cursor: pointer;
  color: var(--fg);
}

.identity-dropdown button:hover {
  background: var(--hover-bg);
}

.hidden {
  display: none;
}
/* Estilo de la tarjeta personal */
.identity-card {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--header-bg);
  max-width: 400px;
}

.identity-actions {
  margin-top: 1.5rem;
}
/* Invitado más tenue que miembro */
.identity-button.invited {
  opacity: 0.7;
}
/* decorar contenedor vista navegable */
.cc-page-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}

.cc-page-nav button {
  min-width: 56px;
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--border);
  background: var(--header-bg);
  color: var(--fg);
  border-radius: 4px;
  cursor: pointer;
}

.cc-page-nav button:hover {
  background: var(--hover-bg);
}

.cc-page-nav button.active-page {
  background: var(--accent-color);
  color: #fff;
  border-color: var(--accent-color);
  font-weight: 600;
}

/* Juntar en un línea a continuación ultima actualización */
.cc-header-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 0.8rem;
}

.ultima-actualizacion {
  font-size: 0.85rem;
  opacity: 0.7;
}

/* contenedor de los gráficos */
.cc-chart-container {
  position: relative;
  height: 420px;
  margin-top: 1rem;
}
/* UX para el móvil */
@media (max-width: 600px) {
  .cc-chart-container {
    height: 600px; /* más alto para que entren nombres */
  }
}

/* Selector de vista Tabla / Gráfico */

.cc-view-selector {
  display: flex;
  gap: 0.6rem;
  margin: 0.6rem 0 1rem 0;
  justify-content: flex-end;
}

.cc-view-btn {
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--border);
  background: var(--header-bg);
  color: var(--fg);
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
}

.cc-view-btn:hover {
  background: var(--hover-bg);
}

.cc-view-btn.active {
  background: var(--accent-color);
  color: #fff;
  border-color: var(--accent-color);
  font-weight: 600;
}
