:root{
  --bg: #ffffff;
  --fg: #1f2937;
  --muted: #6b7280;
  --primary: #0ea5e9;
  --accent: #10b981;
  --border: #e5e7eb;
  --shadow: 0 8px 30px rgba(0,0,0,.08);
}

html[data-theme="dark"]{
  --bg: #0b0f14;
  --fg: #e5e7eb;
  --muted: #9ca3af;
  --primary: #38bdf8;
  --accent: #34d399;
  --border: #1f2937;
}

*{box-sizing:border-box}
body{
  margin:0; padding:0;
  background:var(--bg);
  color:var(--fg);
  font: 16px/1.4 system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Arial, sans-serif;
}

/* Layout */
.app-header{
  position:fixed; top:0; left:0; right:0;
  height:56px; display:flex; align-items:center; gap:12px;
  padding:0 12px; background:var(--bg); border-bottom:1px solid var(--border);
  z-index:1000;
}
.icon-btn{
  display:inline-flex; align-items:center; justify-content:center;
  width:38px; height:38px; border:1px solid var(--border); background:transparent;
  border-radius:12px; cursor:pointer; color:var(--fg);
}
.icon-btn:hover{ background:rgba(0,0,0,.04) }
html[data-theme="dark"] .icon-btn:hover{ background:rgba(255,255,255,.06) }

.app-title{ flex:1; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis }
.app-actions{ display:flex; gap:8px; align-items:center }

/* Ticker */
.alert-ticker{
  position:fixed; top:56px; left:0; right:0; height:32px;
  display:flex; align-items:center; background:var(--primary); color:#fff; overflow:hidden; z-index:999;
}
.ticker-track{ display:flex; gap:32px; white-space:nowrap; animation: ticker 20s linear infinite }
.ticker-item{ padding-left:16px; opacity:.95 }
.ticker-item.warn{ background:rgba(0,0,0,.08) }
@keyframes ticker{ 0%{transform:translateX(0)} 100%{transform:translateX(-50%)} }

/* Sidebar */
.sidebar{
  position:fixed; top:0; bottom:0; left:0; width:300px; background:var(--bg);
  border-right:1px solid var(--border);
  transform: translateX(-100%); transition: transform .2s ease;
  z-index:1100; display:flex; flex-direction:column;
}
.sidebar.show{ transform: translateX(0) }
.sidebar-backdrop{
  position:fixed; inset:0; background:rgba(0,0,0,.35); z-index:1090; display:none;
}
.sidebar-backdrop.show{ display:block }

.sidebar-header{ padding:16px; border-bottom:1px solid var(--border) }
/*.drawer{ display:flex; gap:12px; align-items:center }*/
.drawer {
  display: flex;
  flex-direction: column; /* 🔑 en columna, no fila */
  align-items: stretch;   /* el banner ocupa ancho completo */
  width: 100%;
  padding: 0;             /* que no meta relleno adicional */
}

.avatar{ width:56px; height:56px; border-radius:14px; object-fit:cover; box-shadow: var(--shadow) }
.drawer-info small{ color:var(--muted) }



/* DRAWER NUVO */
/* === Banner superior === */
.drawer-banner {
  /*background: var(--primary); /* color de fondo detrás del splash */

  background: var(--drawer-bg);
  width: 100%;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.25);
}
.drawer-banner-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* === Avatar + texto en columna === */
.drawer-user {
  display: flex;
  flex-direction: column;   /* columna en lugar de fila */
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  text-align: center;
}
.avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: var(--shadow);
}

.avatar-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  margin-bottom: 6px;
}
.avatar-icon svg {
  width: 60%;
  height: 60%;
  color: var(--fg);
}



.drawer-info strong {
  display: block;
  font-size: 1rem;
}
.drawer-info small {
  color: var(--muted);
  font-size: 0.85rem;
}

/* Sponsors grid */
.sponsor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.sponsor-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  background: var(--bg);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.sponsor-logo {
  width: 100px;
  height: 100px;
  border-radius: 12px;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  overflow: hidden;
}
.sponsor-logo img, .sponsor-logo svg {
  width: 80%;
  height: auto;
  object-fit: contain;
  color: var(--fg); /* para el fallback svg */
}

.sponsor-info h3 {
  margin: 0;
  font-size: 1.1rem;
}
.sponsor-info p {
  margin: 4px 0;
  font-size: 0.9rem;
}





.sidebar-nav{ padding:8px 0; flex:1; overflow:auto }
.sidebar-nav ul{ list-style:none; margin:0; padding:0 }
.menu-link{
  display:flex; gap:12px; align-items:center; padding:10px 16px; color:var(--fg);
  text-decoration:none; border-left:3px solid transparent;
}
.menu-link:hover{ background:rgba(0,0,0,.04) }
html[data-theme="dark"] .menu-link:hover{ background:rgba(255,255,255,.06) }
.menu-icon{ width:22px; display:inline-flex; justify-content:center }
.sidebar-footer{
  padding:12px 16px; border-top:1px solid var(--border);
}
.sidebar-footer a{ color:var(--primary); text-decoration:none }
.sidebar-footer a:hover{ text-decoration:underline }

/* Main & Footer */
.app-main{
  padding: calc(56px + 16px) 16px 80px; /* top: header + espacio; bottom: espacio para footer */
  max-width: 1024px; margin: 0 auto;
}
.app-footer{
  position:fixed; left:0; right:0; bottom:0; height:56px;
  display:flex; align-items:center; justify-content:space-between;
  padding: 0 16px; background:var(--bg); border-top:1px solid var(--border); z-index:980;
}
.footer-left{ font-weight:500 }
.footer-right{ color:var(--muted); font-size:14px }

/* Cards / utilitarios */
.card{
  border:1px solid var(--border); border-radius:14px; padding:16px; box-shadow: var(--shadow);
  background: var(--bg);
}

/* Responsive: si querés sidebar desde la derecha en mobile, cambia left -> right y ajustes en JS */
@media (min-width: 1024px){
  /* Podrías anclar el sidebar visible en desktop si preferís */
}


/* SPLASH NUEVO */
.splash-screen {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.splash-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.splash-box {
  text-align: center;
}

.splash-logo {
  max-width: 180px;
  margin-bottom: 1rem;
}

.splash-title {
  font-size: 1.4rem;
  margin-bottom: 1rem;
}

.splash-msg {
  margin-top: 1rem;
  font-size: 1rem;
  color: #444;
}

.splash-btn {
  margin-top: 1rem;
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 6px;
  background: var(--primary, #ff8948);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
}

/* Spinner centrado */
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #ccc;
  border-top: 4px solid var(--primary, #ff8948);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 1rem auto 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.splash-loader.hidden,
.splash-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.splash-loader,
.splash-screen {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--bg);
  z-index: 9999;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.splash-loader.hidden,
.splash-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.splash-box {
  text-align: center;
}


/*Splash Welcome */
.splash-welcome {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--bg);
  z-index: 10000; /* encima del loader */
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.splash-welcome.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}


/* Estado activo del menú */
.menu-link.active {
  background: rgba(0,0,0,.08);
  border-left: 3px solid var(--primary);
  font-weight: 600;
  color: var(--primary);
}

html[data-theme="dark"] .menu-link.active {
  background: rgba(255,255,255,.08);
  border-left: 3px solid var(--primary);
  color: var(--primary);
}

/* En pantallas pequeñas (mobile), resaltar más fuerte */
@media (max-width: 768px) {
  .menu-link.active {
    background: var(--primary);
    color: #fff;
    border-left: none; /* quito la barra lateral porque no se ve */
  }

  html[data-theme="dark"] .menu-link.active {
    background: var(--primary);
    color: #fff;
  }
}


/* Sidebar */
.sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: 300px;
  background: var(--bg);
  border-right: 1px solid var(--border);
  transform: translateX(-100%);
  transition: transform 0.25s ease; /* un poco más suave */
  z-index: 1100;
  display: flex;
  flex-direction: column;
}
.sidebar.show {
  transform: translateX(0);
}
.sidebar[aria-hidden="true"] {
  visibility: hidden; /* sincronizado con JS */
}
.sidebar[aria-hidden="false"] {
  visibility: visible;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  z-index: 1090;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.sidebar-backdrop.show {
  opacity: 1;
  visibility: visible;
}

.sidebar-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

/* === FORMS & GRID para páginas como recovery.php === */

/* Grid simple */
.row {
  display: flex;
  flex-wrap: wrap;
  margin-left: -8px;
  margin-right: -8px;
}
.col {
  flex: 1 0 0%;
  padding-left: 8px;
  padding-right: 8px;
}
.col-12 { flex: 0 0 100%; max-width: 100%; }
.col-md-3 { flex: 0 0 25%; max-width: 25%; }
.col-md-6 { flex: 0 0 50%; max-width: 50%; }
.col-md-7 { flex: 0 0 58.3333%; max-width: 58.3333%; }
.col-md-12 { flex: 0 0 100%; max-width: 100%; }

/* Form labels */
.form-label {
  display: block;
  margin-bottom: 4px;
  font-weight: 500;
  color: var(--fg);
}

/* Inputs */
.form-control,
.form-select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--fg);
  font-size: 15px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-control:focus,
.form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(14,165,233,.2);
}

/* Botones */
.btn {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  text-align: center;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
  border: none;
}
.btn-primary:hover { background: #0284c7; }

.btn-success {
  background: var(--accent);
  color: #fff;
  border: none;
}
.btn-success:hover { background: #059669; }

.btn-outline-secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--fg);
}
.btn-outline-secondary:hover {
  background: rgba(0,0,0,.04);
}
html[data-theme="dark"] .btn-outline-secondary:hover {
  background: rgba(255,255,255,.06);
}

/* Cards */
.card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  background: var(--bg);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.card-title {
  font-size: 1.1rem;
  margin-bottom: 12px;
  font-weight: 600;
}

/* Alerts */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
}
.alert-danger {
  background: #fee2e2;
  color: #991b1b;
}
.alert-success {
  background: #dcfce7;
  color: #166534;
}
.alert-warning {
  background: #fef9c3;
  color: #854d0e;
}