/* AMPA VEDRUNA — Panel de la junta: barra lateral + inicio con cuadros */

.adm-body { background: var(--bg-gray); }
.adm-gate { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.adm-gate .dash-container { max-width: 560px; }
.adm-shell:not(.hidden) + .adm-gate { display: none; }

.adm-shell { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 100vh; }

/* ── Barra lateral ── */
.adm-side { background: linear-gradient(180deg, var(--primary-dark) 0%, #26390a 100%); color: #fff; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 60; }
.adm-brand { display: flex; align-items: center; gap: 12px; padding: 22px 20px 18px; color: #fff; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,0.1); }
.adm-brand img { width: 42px; height: 42px; border-radius: 50%; background: #fff; padding: 3px; }
.adm-brand strong { display: block; font-family: var(--font-display); font-size: 1rem; line-height: 1.2; }
.adm-brand span { font-size: .75rem; color: rgba(255,255,255,0.65); }
#adm-nav { flex: 1; padding: 14px 12px; }
.adm-group { font-size: .68rem; text-transform: uppercase; letter-spacing: .09em; color: rgba(255,255,255,0.5); padding: 16px 10px 6px; }
.adm-link { display: flex; align-items: center; gap: 12px; width: 100%; background: none; border: none; color: rgba(255,255,255,0.85); font: 500 .92rem var(--font-body, inherit); padding: 10px 12px; border-radius: 10px; cursor: pointer; text-align: left; text-decoration: none; transition: background .15s, color .15s; }
.adm-link i { width: 20px; text-align: center; font-size: 1rem; color: var(--accent); }
.adm-link:hover { background: rgba(255,255,255,0.09); color: #fff; }
.adm-link.active { background: var(--accent); color: var(--primary-dark); font-weight: 700; }
.adm-link.active i { color: var(--primary-dark); }
.adm-link .adm-badge { margin-left: auto; background: #e08a00; color: #fff; font-size: .68rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.adm-side-foot { padding: 12px; border-top: 1px solid rgba(255,255,255,0.1); }
.adm-side-foot .adm-link { font-size: .85rem; }

/* ── Zona principal ── */
.adm-main { padding: 0 32px 60px; min-width: 0; }
.adm-top { display: flex; align-items: center; gap: 14px; padding: 22px 0 18px; }
.adm-top h1 { font-family: var(--font-display); font-size: 1.5rem; color: var(--primary-dark); margin: 0; }
.adm-user { margin-left: auto; font-size: .82rem; color: var(--text-muted); text-align: right; }
#adm-burger { display: none; background: #fff; border: 1px solid var(--border); border-radius: 10px; width: 42px; height: 42px; font-size: 1.1rem; color: var(--primary); cursor: pointer; }
.adm-backdrop { display: none; }
.admin-view { max-width: 1080px; }
.admin-view > .dash-card { margin-bottom: 24px; }

/* ── Inicio ── */
.adm-hello { background: linear-gradient(135deg, var(--primary-dark), var(--primary) 70%, var(--primary-light)); color: #fff; border-radius: var(--radius); padding: 26px 30px; margin-bottom: 24px; }
.adm-hello h2 { font-family: var(--font-display); font-size: 1.4rem; margin: 0 0 4px; color: #fff; }
.adm-hello p { margin: 0; color: rgba(255,255,255,0.85); font-size: .95rem; }
.adm-section-title { font-family: var(--font-display); font-size: 1.05rem; color: var(--primary-dark); margin: 28px 0 12px; }
.adm-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.adm-kpi { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; display: flex; gap: 14px; align-items: center; text-decoration: none; color: inherit; border: 1px solid transparent; transition: transform .15s, border-color .15s; cursor: pointer; }
.adm-kpi:hover { transform: translateY(-2px); border-color: var(--accent); }
.adm-kpi-ic { width: 46px; height: 46px; border-radius: 14px; background: rgba(165,202,47,0.22); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0; }
.adm-kpi-num { font-family: var(--font-display); font-size: 1.55rem; font-weight: 800; color: var(--primary-dark); line-height: 1.1; }
.adm-kpi-label { font-size: .82rem; color: var(--text); font-weight: 600; }
.adm-kpi-sub { font-size: .74rem; color: var(--text-muted); }
.adm-alerts { display: flex; flex-direction: column; gap: 10px; }
.adm-alert { display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 12px; padding: 12px 16px; border-left: 4px solid var(--accent); box-shadow: var(--shadow); font-size: .92rem; text-decoration: none; color: var(--text); }
.adm-alert.warn { border-left-color: #e08a00; }
.adm-alert.ok { border-left-color: #2e7d32; }
.adm-alert i { color: var(--primary); }
.adm-alert.warn i { color: #e08a00; }
.adm-alert .adm-go { margin-left: auto; color: var(--primary); font-weight: 600; font-size: .82rem; white-space: nowrap; }
.adm-modules { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.adm-mod { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; text-decoration: none; color: inherit; border: 1px solid transparent; transition: transform .15s, border-color .15s; display: flex; flex-direction: column; gap: 8px; cursor: pointer; text-align: left; font: inherit; }
button.adm-mod { border: 1px solid transparent; }
.adm-mod:hover { transform: translateY(-3px); border-color: var(--primary); }
.adm-mod-ic { width: 48px; height: 48px; border-radius: 14px; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; }
.adm-mod h3 { font-family: var(--font-display); font-size: 1rem; color: var(--primary-dark); margin: 4px 0 0; }
.adm-mod p { font-size: .82rem; color: var(--text-muted); margin: 0; line-height: 1.45; }
.adm-mod.soon { opacity: .6; cursor: default; box-shadow: none; background: transparent; border: 2px dashed var(--border); }
.adm-mod.soon:hover { transform: none; border-color: var(--border); }
.adm-mod.soon .adm-mod-ic { background: var(--border); color: var(--text-muted); }
.adm-soon-tag { align-self: flex-start; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; background: rgba(0,0,0,0.06); color: var(--text-muted); padding: 2px 8px; border-radius: 999px; }

/* ── Herramientas de la tabla de familias ── */
.adm-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 16px; }
.adm-tools input { flex: 1; min-width: 200px; border: 1.5px solid var(--border); border-radius: 999px; padding: 9px 16px; font-size: .9rem; }
.adm-tools input:focus { outline: none; border-color: var(--primary); }
.adm-tools .adm-count { font-size: .82rem; color: var(--text-muted); }

/* ── Móvil ── */
@media (max-width: 1100px) { .adm-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .adm-shell { grid-template-columns: minmax(0, 1fr); }
  .adm-side { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; transform: translateX(-100%); transition: transform .25s; box-shadow: 6px 0 30px rgba(0,0,0,0.3); }
  .adm-shell.adm-open .adm-side { transform: translateX(0); }
  .adm-shell.adm-open .adm-backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 55; }
  #adm-burger { display: block; }
  .adm-main { padding: 0 16px 50px; }
  .adm-user { display: none; }
  .adm-top h1 { font-size: 1.25rem; }
  .adm-kpis { grid-template-columns: minmax(0, 1fr); }
  .admin-view .dash-card { padding: 20px; overflow-x: auto; }
}

/* ── Tesorería: formulario adaptativo ── */
.tes-step { margin-bottom: 20px; }
.tes-step-label { display: block; font-weight: 700; color: var(--primary-dark); font-size: .92rem; margin-bottom: 10px; }
.tes-type-toggle { display: flex; gap: 10px; }
.tes-type-btn { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 14px; border-radius: 12px; border: 2px solid var(--border); background: #fff; font: 700 .95rem inherit; color: var(--text-muted); cursor: pointer; transition: border-color .15s, background .15s, color .15s; }
.tes-type-btn:hover { border-color: var(--primary); }
.tes-type-btn.active { border-color: var(--primary); background: var(--primary); color: #fff; }
.tes-cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.tes-cat-card { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 8px; border-radius: 12px; border: 2px solid var(--border); background: #fff; cursor: pointer; text-align: center; font: 600 .8rem inherit; color: var(--text); transition: border-color .15s, background .15s, transform .15s; }
.tes-cat-card i { font-size: 1.2rem; color: var(--primary); }
.tes-cat-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.tes-cat-card.active { border-color: var(--primary); background: rgba(165,202,47,0.15); }
.tes-fields { border-top: 1px solid var(--border); padding-top: 18px; animation: tesReveal .2s ease; }
@keyframes tesReveal { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
.tes-hint { display: flex; align-items: flex-start; gap: 8px; background: var(--bg-gray); border-left: 3px solid var(--accent); border-radius: 8px; padding: 10px 12px; font-size: .82rem; color: #4a4a3e; margin-bottom: 14px; }
.tes-hint[hidden] { display: none; }
.tes-hint.warn { background: #fff4e5; border-left-color: #e08a00; color: #7a5200; font-weight: 600; }
.tes-hint i { margin-top: 2px; }
.tes-hint-text { font-size: .78rem; color: var(--text-muted); margin: 6px 0 0; }

/* ── Móvil: ajustes tras probar en el teléfono (29-oct-2026) ── */
@media (max-width: 900px) {
  /* La sombra del menú lateral solo cuando está abierto (cerrado dejaba una franja gris a la izquierda) */
  .adm-side { box-shadow: none; }
  .adm-shell.adm-open .adm-side { box-shadow: 6px 0 30px rgba(0,0,0,0.3); }

  /* Cifras de Inicio: dos por fila, compactas */
  .adm-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .adm-kpi { flex-direction: column; align-items: flex-start; gap: 8px; padding: 14px; }
  .adm-kpi-ic { width: 38px; height: 38px; font-size: 1rem; }
  .adm-kpi-num { font-size: 1.4rem; }

  /* Resumen de Tesorería: 2x2 en vez de una columna irregular */
  #tes-kpis { display: grid !important; grid-template-columns: 1fr 1fr; gap: 10px !important; }
  #tes-kpis > div { min-width: 0 !important; }

  /* Formulario de excursiones convocadas: campos a todo el ancho */
  #excConvForm > div, #excConvForm > button { flex: 1 1 100% !important; min-width: 0 !important; }
  #excConvForm input[type="date"] { width: 100%; min-height: 46px; font-size: 16px; background: #fff; }
  #excConvForm input[type="text"] { font-size: 16px; }

  /* Tablas como tarjetas: cada fila se apila con su etiqueta (las pone admin.js con data-label) */
  .admin-view .dash-card { overflow-x: visible; }
  table.admin-table, table.admin-table tbody { display: block; width: 100%; }
  table.admin-table thead { display: none; }
  table.admin-table tr { display: block; background: var(--bg-gray); border-radius: 12px; padding: 8px 12px; margin-bottom: 10px; }
  table.admin-table td { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; text-align: right; border-bottom: 1px dashed var(--border); padding: 8px 0; word-break: break-word; }
  table.admin-table td:last-child { border-bottom: none; }
  table.admin-table td[data-label]::before { content: attr(data-label); flex: 0 0 38%; text-align: left; color: var(--primary); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
  table.admin-table td[colspan] { display: block; text-align: left; }
}
