/* tripower.css — estilos principales */
:root {
  --tp-verde: #00e5a0;
  --tp-negro: #0a0a0a;
  --tp-gris-oscuro: #141414;
  --tp-gris-medio: #1e1e1e;
  --tp-gris: #2a2a2a;
  --tp-borde: rgba(255,255,255,0.08);
  --tp-texto: #f0f0f0;
  --tp-texto-muted: #888;
  --tp-naranja: #ff6b35;
  --tp-radius: 12px;
  --tp-radius-sm: 8px;
  --tp-sombra: 0 2px 16px rgba(0,0,0,0.4);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--tp-negro);
  color: var(--tp-texto);
  min-height: 100vh;
  line-height: 1.6;
}

a { color: var(--tp-verde); text-decoration: none; }
a:hover { opacity: 0.85; }

/* ── Navbar ──────────────────────────────────────────── */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10,10,10,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--tp-borde);
  display: flex; align-items: center; gap: 1.5rem;
  padding: 0.75rem 1.5rem;
}
.navbar-brand {
  display: flex; align-items: center; gap: 10px;
  font-size: 18px; font-weight: 600; color: #fff;
}
.navbar-logo { height: 36px; width: 36px; object-fit: contain; border-radius: 50%; }
.navbar-links {
  display: flex; gap: 4px; flex: 1;
}
.navbar-links a {
  color: var(--tp-texto-muted); padding: 6px 14px; border-radius: 999px;
  font-size: 14px; transition: all 0.15s;
}
.navbar-links a:hover, .navbar-links a.active {
  color: #fff; background: var(--tp-gris);
}
.navbar-links a.active { color: var(--tp-verde); }

/* User menu */
.user-menu { position: relative; cursor: pointer; display: flex; align-items: center; gap: 8px; }
.user-avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; border: 2px solid var(--tp-verde); }
.user-name { font-size: 14px; color: var(--tp-texto); }
.user-dropdown {
  display: none; position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--tp-gris-medio); border: 1px solid var(--tp-borde);
  border-radius: var(--tp-radius-sm); min-width: 200px;
  padding: 6px 0; box-shadow: var(--tp-sombra);
}
.user-menu.open .user-dropdown { display: block; }
.user-dropdown a, .user-dropdown hr {
  display: block; padding: 9px 16px; font-size: 14px;
  color: var(--tp-texto); transition: background 0.1s;
}
.user-dropdown a:hover { background: var(--tp-gris); }
.user-dropdown hr { border: none; border-top: 1px solid var(--tp-borde); padding: 0; margin: 4px 0; }
.btn-login {
  background: var(--tp-verde); color: #000 !important; font-weight: 600;
  padding: 7px 18px; border-radius: 999px; font-size: 14px;
}

/* ── Layout ──────────────────────────────────────────── */
.main-content { padding: 1.5rem; max-width: 1100px; margin: 0 auto; }
.container { max-width: 800px; margin: 0 auto; }

.page-header { margin-bottom: 1.5rem; }
.page-header h1 { font-size: 24px; font-weight: 600; }
.page-header p { color: var(--tp-texto-muted); margin-top: 4px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 1rem; }
.sidebar-layout { display: grid; grid-template-columns: 1fr 320px; gap: 1.5rem; }

/* ── Cards ───────────────────────────────────────────── */
.card {
  background: var(--tp-gris-medio);
  border: 1px solid var(--tp-borde);
  border-radius: var(--tp-radius);
  padding: 1.25rem;
}
.card-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1rem;
}
.card-title { font-size: 15px; font-weight: 600; }

/* ── Stat cards ──────────────────────────────────────── */
.stat-card {
  background: var(--tp-gris);
  border-radius: var(--tp-radius-sm);
  padding: 1rem;
  text-align: center;
}
.stat-value { font-size: 26px; font-weight: 700; color: var(--tp-verde); }
.stat-label { font-size: 12px; color: var(--tp-texto-muted); margin-top: 2px; }

/* ── Feed / Actividades ──────────────────────────────── */
.feed-item {
  background: var(--tp-gris-medio);
  border: 1px solid var(--tp-borde);
  border-radius: var(--tp-radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.feed-user {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
}
.feed-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.feed-user-info .nombre { font-weight: 600; font-size: 15px; }
.feed-user-info .fecha { font-size: 12px; color: var(--tp-texto-muted); }

.feed-titulo { font-size: 17px; font-weight: 600; margin-bottom: 8px; }
.feed-tipo-badge {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 600; margin-bottom: 10px;
  background: rgba(0,229,160,0.15); color: var(--tp-verde);
}

.feed-metricas {
  display: flex; gap: 1.5rem; flex-wrap: wrap;
  padding: 10px 0; border-top: 1px solid var(--tp-borde); border-bottom: 1px solid var(--tp-borde);
  margin: 10px 0;
}
.metrica { text-align: center; }
.metrica .val { font-size: 18px; font-weight: 700; }
.metrica .lbl { font-size: 11px; color: var(--tp-texto-muted); }

.feed-acciones { display: flex; gap: 8px; }
.btn-reaccion {
  background: none; border: 1px solid var(--tp-borde); color: var(--tp-texto-muted);
  border-radius: 999px; padding: 5px 12px; font-size: 13px; cursor: pointer;
  transition: all 0.15s; display: flex; align-items: center; gap: 4px;
}
.btn-reaccion:hover, .btn-reaccion.activo {
  background: rgba(0,229,160,0.1); border-color: var(--tp-verde); color: var(--tp-verde);
}

/* ── Sesión del día ──────────────────────────────────── */
.sesion-hoy {
  background: linear-gradient(135deg, rgba(0,229,160,0.1), rgba(0,229,160,0.03));
  border: 1px solid rgba(0,229,160,0.3);
  border-radius: var(--tp-radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.sesion-hoy .badge-hoy {
  font-size: 11px; font-weight: 700; color: var(--tp-verde);
  text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px;
}
.sesion-hoy h3 { font-size: 17px; margin-bottom: 6px; }
.sesion-hoy p { font-size: 13px; color: var(--tp-texto-muted); }

/* ── Formularios ─────────────────────────────────────── */
.form-group { margin-bottom: 1.1rem; }
.form-label { display: block; font-size: 13px; color: var(--tp-texto-muted); margin-bottom: 5px; }
.form-control {
  width: 100%; background: var(--tp-gris); border: 1px solid var(--tp-borde);
  border-radius: var(--tp-radius-sm); padding: 10px 14px;
  color: var(--tp-texto); font-size: 14px; outline: none;
  transition: border-color 0.15s;
}
.form-control:focus { border-color: var(--tp-verde); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* ── Botones ─────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 20px; border-radius: 999px; font-size: 14px;
  font-weight: 600; cursor: pointer; border: none; transition: all 0.15s;
}
.btn-primary { background: var(--tp-verde); color: #000; }
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-secondary { background: var(--tp-gris); color: var(--tp-texto); border: 1px solid var(--tp-borde); }
.btn-secondary:hover { border-color: var(--tp-verde); }
.btn-danger { background: #c0392b; color: #fff; }
.btn-sm { padding: 5px 14px; font-size: 12px; }

/* ── Alertas ─────────────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: var(--tp-radius-sm); margin-bottom: 1rem; font-size: 14px; }
.alert-success { background: rgba(0,229,160,0.1); border: 1px solid rgba(0,229,160,0.3); color: var(--tp-verde); }
.alert-error { background: rgba(192,57,43,0.1); border: 1px solid rgba(192,57,43,0.3); color: #e74c3c; }
.alert-info { background: rgba(52,152,219,0.1); border: 1px solid rgba(52,152,219,0.3); color: #3498db; }

/* ── Tabla ───────────────────────────────────────────── */
.tabla { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabla th {
  text-align: left; padding: 10px 14px;
  border-bottom: 1px solid var(--tp-borde);
  color: var(--tp-texto-muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
}
.tabla td { padding: 12px 14px; border-bottom: 1px solid var(--tp-borde); }
.tabla tr:last-child td { border-bottom: none; }
.tabla tr:hover td { background: rgba(255,255,255,0.02); }

/* ── Footer ──────────────────────────────────────────── */
.footer {
  margin-top: 4rem; border-top: 1px solid var(--tp-borde);
  padding: 1.5rem;
}
.footer-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; gap: 1rem;
  font-size: 13px; color: var(--tp-texto-muted);
}

/* ── Login page ──────────────────────────────────────── */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--tp-negro);
}
.login-card {
  background: var(--tp-gris-medio); border: 1px solid var(--tp-borde);
  border-radius: var(--tp-radius); padding: 2.5rem; width: 100%; max-width: 420px;
}
.login-logo { text-align: center; margin-bottom: 2rem; }
.login-logo img { height: 80px; }
.login-logo h1 { font-size: 22px; margin-top: 10px; }
.login-logo p { color: var(--tp-texto-muted); font-size: 13px; }

/* ── Bottom nav mobile ───────────────────────────────── */
.bottom-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 200;
  background: rgba(10,10,10,0.97);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--tp-borde);
  padding: 6px 0 env(safe-area-inset-bottom, 6px);
}
.bottom-nav-inner {
  display: flex; justify-content: space-around; align-items: center;
}
.bottom-nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 12px; border-radius: 10px;
  color: var(--tp-texto-muted); font-size: 10px;
  text-decoration: none; transition: color 0.15s;
  min-width: 52px;
}
.bottom-nav-item svg { width: 22px; height: 22px; }
.bottom-nav-item.active { color: var(--tp-verde); }
.bottom-nav-item:hover { color: var(--tp-texto); }

.fab {
  position: fixed; bottom: 80px; right: 16px; z-index: 199;
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--tp-verde); color: #000;
  display: none; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 300; box-shadow: 0 4px 16px rgba(0,229,160,0.4);
  text-decoration: none; line-height: 1;
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 768px) {
  .navbar { padding: 0.6rem 1rem; }
  .navbar-links { display: none; }
  .navbar-user .user-name { display: none; }
  .bottom-nav { display: block !important; }
  .fab { display: flex !important; }
  .main-content {
    padding: 0.75rem 0.75rem;
    padding-bottom: 80px;
  }
  .sidebar-layout { grid-template-columns: 1fr; }
  .grid-2, .grid-3, .form-row { grid-template-columns: 1fr; }
  .feed-metricas { gap: 0.75rem; }
  .feed-metricas .metrica .val { font-size: 15px; }
  .feed-item { padding: 1rem; border-radius: 10px; }
  .page-header h1 { font-size: 20px; }
  .page-header { margin-bottom: 1rem; }
  .stat-card .stat-value { font-size: 22px; }
  .card { padding: 1rem; }
  .btn { padding: 9px 16px; font-size: 13px; }
  .tabla th, .tabla td { padding: 8px 10px; font-size: 12px; }
  .tabla { font-size: 12px; }
  .login-card { padding: 1.75rem 1.25rem; margin: 1rem; }
  .footer { display: none; }
  .user-dropdown { right: 0; min-width: 180px; }
}

@media (max-width: 400px) {
  .feed-metricas { gap: 0.5rem; }
  .bottom-nav-item { min-width: 44px; padding: 6px 8px; }
}
