/* AmaFitness Full Dashboard - style-dashboard.css */

html.af-full-no-scroll,
body.af-full-no-scroll {
  height: 100%;
  overflow: hidden;
}

/* ---------- Layout base ---------- */
.afd-app {
  height: 100vh;
  width: 100%;
  display: grid;
  grid-template-rows: auto 1fr;
  background: radial-gradient(1200px 800px at 20% 0%, rgba(243,210,0,.18), rgba(255,255,255,0) 60%),
              radial-gradient(1200px 800px at 90% 20%, rgba(59,130,246,.12), rgba(255,255,255,0) 55%),
              #ffffff;
}

.afd-topbar {
  padding: .85rem 1rem;
  border-bottom: 1px solid rgba(0,0,0,.06);
  background: rgba(255,255,255,.8);
  backdrop-filter: blur(8px);
}

.afd-brand { display:flex; align-items:baseline; gap:.5rem; }
.afd-brand-badge {
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: .2px;
  padding: .25rem .6rem;
  border-radius: 999px;
  background: #f3d200;
  color: #111827;
}
.afd-brand-sub { font-weight: 700; color: #374151; }

.afd-main {
  display: grid;
  grid-template-rows: 58% 42%;
  gap: 1rem;
  padding: 1rem;
  min-height: 0; /* crucial for internal scroll */
}

/* Responsive: stack sections */
@media (max-width: 992px) {
  .afd-main { grid-template-rows: auto auto; }
}

/* ---------- TOP: 2 columnas ---------- */
.afd-top {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 1rem;
  min-height: 0;
}
@media (max-width: 992px) {
  .afd-top { grid-template-columns: 1fr; }
}

/* ---------- Cards ---------- */
.afd-card {
  border: 1px solid rgba(0,0,0,.06);
  border-radius: 18px;
  background: rgba(255,255,255,.9);
  box-shadow: 0 10px 26px rgba(17,24,39,.06);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.afd-card-header {
  padding: .9rem 1rem .75rem 1rem;
  border-bottom: 1px solid rgba(0,0,0,.06);
  display:flex;
  align-items:flex-start;
  justify-content: space-between;
  gap: .75rem;
}

.afd-card-title { font-weight: 800; color: #111827; line-height: 1.15; }
.afd-card-sub { font-size: .86rem; color: #6b7280; }

.afd-card-body {
  padding: .9rem 1rem 1rem 1rem;
  min-height: 0;
}

.afd-scroll {
  overflow: auto;
  min-height: 0;
}

/* ---------- Checklist ---------- */
.afd-filter { min-width: 190px; }
@media (max-width: 420px) { .afd-filter { min-width: 140px; } }

#afd-task-list { display: flex; flex-direction: column; gap: .6rem; }

.afd-task {
  display:flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .65rem .75rem;
  border: 1px solid rgba(0,0,0,.06);
  border-radius: 14px;
  background: #ffffff;
}

.afd-task-inner { display:flex; align-items:center; gap:.6rem; margin:0; cursor:pointer; }
.afd-task-title { font-weight: 650; color:#111827; }
.afd-task-title.is-done { text-decoration: line-through; color:#6b7280; }

.afd-task-badge {
  display:inline-flex; align-items:center; gap:.45rem;
  font-size: .78rem;
  font-weight: 700;
  padding: .25rem .55rem;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.06);
  color: #374151;
  background: rgba(0,0,0,.02);
}
.afd-task-badge .afd-dot {
  width:10px; height:10px; border-radius:999px;
  background: var(--afd-cat, #9ca3af);
}

/* ---------- Calendar ---------- */
.afd-cal-header { align-items: center; }
.afd-cal-selected {
  font-size: .95rem;
  font-weight: 800;
  color: #374151;
  margin-top: .1rem;
}
.afd-cal-nav { display:flex; gap:.5rem; align-items:center; }

#afd-calendar .fc {
  --fc-border-color: rgba(0,0,0,.06);
  --fc-today-bg-color: rgba(243,210,0,.16);
  font-size: .88rem;
}
#afd-calendar .fc .fc-daygrid-day-number { padding: .2rem .35rem; }

#afd-calendar td.afd-selected-day {
  outline: 3px solid rgba(59,130,246,.35);
  outline-offset: -3px;
  border-radius: 10px;
}

/* ---------- Bottom tabs ---------- */
.afd-bottom { min-height: 0; }
.afd-tabs-header {
  padding: .85rem 1rem .25rem 1rem;
  border-bottom: 1px solid rgba(0,0,0,.06);
}

.afd-nav .nav-link {
  border-radius: 999px !important;
  font-weight: 750;
  padding: .45rem .8rem;
}
.afd-nav .nav-link.active {
  background: #111827 !important;
}

.afd-tabs-content {
  padding: .75rem 1rem 1rem 1rem;
  min-height: 0;
}

.afd-pane-inner { padding-right: .25rem; }
.afd-pane-title { font-weight: 800; margin-bottom: .65rem; }

.afd-table thead th { font-size: .85rem; color: #6b7280; font-weight: 800; }


/* ---------- Layout override: 70/30 (Tabs izquierda, Calendario+Pendientes derecha) ---------- */
.afd-main{
  display: block; /* override old grid */
  padding: 1rem;
  min-height: 0;
  height: 100%;
}

/*.afd-layout{*/
/*  height: 100%;*/
/*  min-height: 0;*/
/*  display: grid;*/
/*grid-template-columns: 1.7fr 1fr; */
/*  gap: 1rem;*/
/*}*/

/* --- Nuevo Layout de 3 Columnas --- */

.afd-layout {
  height: 100%;
  display: grid;
  /* Col 1: Tabs (flexible), Col 2: Pendientes (flexible), Col 3: Calendario (fijo) */
  grid-template-columns: 1.4fr .7fr 280px; 
  gap: 1rem;
  align-items: start;
}

.afd-left{
  min-height: 0;
  display: flex;
}
.afd-left .afd-bottom{
  flex: 1 1 auto;
  min-height: 0;
}

.afd-right{
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 1rem;
}

/* Ajuste para que las columnas ocupen todo el alto disponible */
.afd-col-tabs,
.afd-col-tasks,
.afd-col-access {
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* Forzamos que el calendario no se estire */
.afd-card.afd-calendar {
  width: 280px;
  flex: 0 0 auto;
}

/* Responsive: Pasamos a una sola columna en tablets/m¨®viles */
@media (max-width: 1100px) {
  .afd-layout {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }
  .afd-card.afd-calendar {
    width: 100%;
    max-width: none;
  }
}

.afd-right-top,
.afd-right-bottom{
  min-height: 0;
}

/* On smaller screens: stack */
@media (max-width: 992px){
  .afd-layout{
    grid-template-columns: 1fr;
  }
  .afd-right{
    grid-template-rows: auto auto;
  }
}

.afd-btn-cal {
  padding: 2px 6px;
  font-size: 0.7rem;
  font-weight: 700;
  border: 1px solid rgba(0,0,0,0.1);
  background: #fff;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.afd-btn-cal:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}

/* ---------- Mini Calendar (Custom) ---------- */
#afd-calendar{
  height: 100%;
  width: 100%;
  max-height: 400px;   /* ðŸ‘ˆ CLAVE */
  aspect-ratio: 1 / 1.2; /* mantiene proporciÃ³n visual */
}

@media (max-width: 768px){
  #afd-calendar{
    max-height: none;
    aspect-ratio: auto;
  }
}

/* root uses density classes */
.afd-mini-cal{
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.afd-mini-month{
  text-align: center;
  font-weight: 600;
  font-size: 1.05rem;
  line-height: 1.1;
}

.afd-mini-weekdays{
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  font-size: .8rem;
  opacity: .75;
  text-align: center;
}

.afd-mini-grid{
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-template-rows: repeat(6, 1fr);
  gap: 8px;
}

.afd-mini-day{
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 12px;
  background: rgba(255,255,255,.75);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 8px 6px;
  cursor: pointer;
}

.afd-mini-day.is-out{ opacity: .35; }
.afd-mini-day.is-today{ outline: 2px solid rgba(59,130,246,.35); }
.afd-mini-day.is-selected{
  outline: 2px solid rgba(234,179,8,.7);
  box-shadow: 0 0 0 3px rgba(234,179,8,.15);
}

.afd-mini-day-num{
  font-size: .95rem;
  font-weight: 700;
}

.afd-mini-dots{
  display:flex;
  gap: 5px;
  height: 12px;
  align-items:center;
}

.afd-mini-dot{
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display:inline-block;
}

.afd-mini-day.has-program {
  background-color: #d4f5dd; /* verde claro */
  border-radius: 6px;
}

.afd-mini-day.has-program.selected {
  outline: 2px solid #4caf50;
}

.afd-date-edit {
  border: none;
  background: transparent;
  padding: 2px 4px;
  font-size: 0.85rem;
  width: auto;
}

.afd-date-edit:focus {
  background: #fff;
  box-shadow: 0 0 0 2px rgba(243, 210, 0, 0.5);
}


/* Density compression */
.afd-mini-cal.density-2{ gap: 8px; }
.afd-mini-cal.density-2 .afd-mini-month{ font-size: 1.0rem; }
.afd-mini-cal.density-2 .afd-mini-weekdays{ font-size: .75rem; gap: 6px; }
.afd-mini-cal.density-2 .afd-mini-grid{ gap: 6px; }
.afd-mini-cal.density-2 .afd-mini-day{ padding: 6px 4px; border-radius: 10px; }
.afd-mini-cal.density-2 .afd-mini-day-num{ font-size: .88rem; }
.afd-mini-cal.density-2 .afd-mini-dot{ width: 7px; height: 7px; }

.afd-mini-cal.density-3{ gap: 6px; }
.afd-mini-cal.density-3 .afd-mini-month{ font-size: .92rem; }
.afd-mini-cal.density-3 .afd-mini-weekdays{ font-size: .68rem; gap: 4px; }
.afd-mini-cal.density-3 .afd-mini-grid{ gap: 4px; }
.afd-mini-cal.density-3 .afd-mini-day{ padding: 4px 3px; border-radius: 9px; }
.afd-mini-cal.density-3 .afd-mini-day-num{ font-size: .8rem; }
.afd-mini-cal.density-3 .afd-mini-dot{ width: 6px; height: 6px; }

.afd-mini-cal.density-4{ gap: 4px; }
.afd-mini-cal.density-4 .afd-mini-month{ font-size: .85rem; }
.afd-mini-cal.density-4 .afd-mini-weekdays{ font-size: .6rem; gap: 3px; }
.afd-mini-cal.density-4 .afd-mini-grid{ gap: 3px; }
.afd-mini-cal.density-4 .afd-mini-day{ padding: 3px 2px; border-radius: 8px; }
.afd-mini-cal.density-4 .afd-mini-day-num{ font-size: .72rem; }
.afd-mini-cal.density-4 .afd-mini-dot{ width: 5px; height: 5px; }
