/**
 * Estilos Dojo Pro - Gestión de Clases de Kárate
 * Interfaz gráfica moderna, intuitiva, táctil y optimizada para velocidad de creación
 */

:root {
    --bg-main: #070a12;
    --bg-surface: #101625;
    --bg-surface-elevated: #161f33;
    --bg-card: #1a243b;
    --bg-card-hover: #222f4c;
    --bg-input: #0d1322;
    
    --border-color: rgba(255, 255, 255, 0.12);
    --border-subtle: rgba(255, 255, 255, 0.07);
    --border-focus: #e11d48;
    
    --text-main: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    
    --primary: #e11d48;
    --primary-hover: #f43f5e;
    --primary-glow: rgba(225, 29, 72, 0.35);
    --primary-light: rgba(225, 29, 72, 0.14);
    
    --accent-gold: #f59e0b;
    --accent-green: #10b981;
    --accent-blue: #38bdf8;
    
    /* Colores de cinturón para las 7 partes */
    --belt-calentamiento: #eab308;
    --belt-kihon: #f97316;
    --belt-kata: #22c55e;
    --belt-kumite: #ef4444;
    --belt-fisico: #3b82f6;
    --belt-juegos: #a855f7;
    --belt-vuelta-calma: #78716c;
    
    --radius-xs: 6px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 22px;
    --radius-full: 9999px;
    
    --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.28);
    --shadow-md: 0 8px 20px -4px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 18px 36px -6px rgba(0, 0, 0, 0.65);
    
    --header-height: 62px;
    --nav-bottom-height: 66px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-main);
    background-image: 
        radial-gradient(circle at 15% 5%, rgba(225, 29, 72, 0.08), transparent 35%),
        radial-gradient(circle at 85% 15%, rgba(56, 189, 248, 0.06), transparent 35%);
    background-attachment: fixed;
    color: var(--text-main);
    line-height: 1.5;
    padding-top: var(--header-height);
    padding-bottom: calc(var(--nav-bottom-height) + 28px);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
    background: #2d3b55;
    border-radius: 4px;
}

/* ==========================================================================
   CABECERA PRINCIPAL (NAVBAR SUPERIOR)
   ========================================================================== */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background-color: rgba(10, 15, 28, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border-subtle);
    z-index: 60;
}

.header-inner {
    max-width: 1040px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    color: var(--text-main);
    text-decoration: none;
}

.brand-icon-box {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(225, 29, 72, 0.25), rgba(225, 29, 72, 0.08));
    border: 1px solid rgba(225, 29, 72, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 2px 10px rgba(225, 29, 72, 0.2);
}

.brand-title {
    display: flex;
    flex-direction: column;
}

.brand-main {
    font-family: 'Outfit', sans-serif;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.2px;
    line-height: 1.15;
}

.brand-sub {
    font-size: 10.5px;
    font-weight: 600;
    color: var(--primary-hover);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ==========================================================================
   NAVEGACIÓN INFERIOR PARA MÓVIL
   ========================================================================== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--nav-bottom-height);
    background-color: rgba(12, 18, 32, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 60;
    padding: 0 6px;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 10.5px;
    font-weight: 600;
    padding: 6px 8px;
    border-radius: var(--radius-md);
    transition: all 0.18s ease;
    border: none;
    background: transparent;
    cursor: pointer;
    flex: 1;
}

.nav-item .nav-icon {
    font-size: 19px;
    margin-bottom: 2px;
    transition: transform 0.18s ease;
}

.nav-item:hover {
    color: var(--text-main);
}

.nav-item.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

.nav-item.active .nav-icon {
    transform: translateY(-1px) scale(1.08);
}

.nav-item.nav-btn-highlight {
    color: #ffffff;
    background: linear-gradient(135deg, #e11d48, #be123c);
    border-radius: var(--radius-md);
    margin: 0 4px;
    padding: 7px 12px;
    box-shadow: 0 4px 14px var(--primary-glow);
    font-weight: 700;
}

.nav-item.nav-btn-highlight:hover {
    background: linear-gradient(135deg, #f43f5e, #e11d48);
}

/* ==========================================================================
   CONTENEDOR PRINCIPAL Y ANIMACIÓN DE VISTAS
   ========================================================================== */
.app-container {
    max-width: 980px;
    margin: 0 auto;
    padding: 18px 14px;
}

.view-section {
    display: none;
}

.view-section.active {
    display: block;
    animation: fadeSlideUp 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   HERO STATS BAR (VISTA DE CLASES)
   ========================================================================== */
.hero-stats-bar {
    background: linear-gradient(135deg, rgba(26, 36, 59, 0.9), rgba(16, 22, 37, 0.95));
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 14px 18px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    box-shadow: var(--shadow-sm);
}

.hero-stats-items {
    display: flex;
    align-items: center;
    gap: 18px;
}

.stat-pill {
    display: flex;
    flex-direction: column;
}

.stat-num {
    font-family: 'Outfit', sans-serif;
    font-size: 22px;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.1;
}

.stat-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.stat-divider {
    width: 1px;
    height: 28px;
    background: var(--border-color);
}

/* ==========================================================================
   TARJETAS Y PANELES
   ========================================================================== */
.card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 18px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-subtle);
    flex-wrap: wrap;
    gap: 10px;
}

.card-title {
    font-family: 'Outfit', sans-serif;
    font-size: 16.5px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-main);
}

/* ==========================================================================
   BOTONES Y CONTROLES TÁCTILES
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 16px;
    font-size: 13.5px;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
    min-height: 40px;
    user-select: none;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: linear-gradient(135deg, #e11d48, #be123c);
    color: #ffffff;
    box-shadow: 0 3px 12px rgba(225, 29, 72, 0.3);
}
.btn-primary:hover {
    background: linear-gradient(135deg, #f43f5e, #e11d48);
    box-shadow: 0 4px 16px rgba(225, 29, 72, 0.45);
}

.btn-secondary {
    background-color: var(--bg-card);
    color: var(--text-main);
    border-color: var(--border-color);
}
.btn-secondary:hover {
    background-color: var(--bg-card-hover);
    border-color: rgba(255, 255, 255, 0.22);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
}
.btn-ghost:hover {
    color: var(--text-main);
    background: var(--bg-card);
}

.btn-danger {
    background-color: rgba(239, 68, 68, 0.14);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.3);
}
.btn-danger:hover {
    background-color: #ef4444;
    color: #ffffff;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12.5px;
    min-height: 34px;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 700;
    min-height: 48px;
}

.btn-block {
    width: 100%;
}

.icon-btn {
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.14s ease;
}
.icon-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-main);
    border-color: var(--border-color);
}

/* ==========================================================================
   FILTROS SEGMENTADOS Y PÍLDORAS DE GRUPO
   ========================================================================== */
.filter-toolbar-card {
    padding: 12px 14px;
    margin-bottom: 14px;
}

.filter-toolbar-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.segmented-control {
    display: inline-flex;
    background: var(--bg-input);
    padding: 3px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

.seg-btn {
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 12.5px;
    font-weight: 700;
    padding: 6px 13px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
}

.seg-btn:hover {
    color: var(--text-main);
}

.seg-btn.active {
    background: var(--bg-card);
    color: #ffffff;
    box-shadow: var(--shadow-sm);
}

.group-filter-pills {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.group-pill {
    border: 1px solid var(--border-subtle);
    background: var(--bg-surface-elevated);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    padding: 5px 11px;
    border-radius: var(--radius-full);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.14s ease;
}

.group-pill:hover {
    border-color: var(--border-color);
    color: var(--text-main);
}

.group-pill.active {
    background: var(--primary-light);
    border-color: var(--primary);
    color: #fda4af;
    font-weight: 700;
}

/* ==========================================================================
   FORMULARIOS Y ATAJOS RÁPIDOS (1-CLICK CHIPS)
   ========================================================================== */
.form-group {
    margin-bottom: 14px;
}

.form-label {
    display: block;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 13px;
    font-size: 14px;
    color: var(--text-main);
    outline: none;
    transition: all 0.15s ease;
    font-family: inherit;
}

.form-control:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.18);
}

.form-control-lg {
    padding: 12px 16px;
    font-size: 16px;
}

.planner-meta-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.quick-mini-btns {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.mini-chip {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-xs);
    cursor: pointer;
    transition: all 0.12s ease;
}

.mini-chip:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-blue);
    color: #fff;
}

/* Selector rápido de grupos en el planificador */
.group-quick-selector {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.group-pills-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.group-select-pill {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 7px 13px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.14s ease;
}

.group-select-pill:hover {
    background: var(--bg-card-hover);
    color: #fff;
}

.group-select-pill.active {
    background: linear-gradient(135deg, rgba(225, 29, 72, 0.25), rgba(225, 29, 72, 0.12));
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 0 0 1px var(--primary);
}

.badge-editing {
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.4);
    color: #7dd3fc;
    font-size: 11.5px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: var(--radius-full);
}

/* ==========================================================================
   BARRA STICKY DE TIEMPO Y GUARDADO (PLANIFICADOR)
   ========================================================================== */
.planner-sticky-bar {
    position: sticky;
    top: calc(var(--header-height) + 6px);
    z-index: 45;
    margin-bottom: 14px;
}

.minute-counter-bar {
    background: rgba(16, 22, 37, 0.94);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: var(--radius-lg);
    padding: 12px 16px;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.minute-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.minute-total-wrap {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.minute-badge-label {
    font-size: 11px;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 0.6px;
}

.minute-total {
    font-family: 'Outfit', sans-serif;
    font-size: 26px;
    font-weight: 800;
    color: #ffffff;
    line-height: 1;
}

.planner-top-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.minute-progress {
    height: 9px;
    background-color: var(--bg-input);
    border-radius: var(--radius-full);
    display: flex;
    overflow: hidden;
    border: 1px solid var(--border-subtle);
}

.minute-progress-segment {
    height: 100%;
    transition: width 0.25s ease;
}

.minute-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 11.5px;
    color: var(--text-secondary);
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
}

/* ==========================================================================
   BARRA DE PRESETS / CARGA RÁPIDA EN 1 CLIC
   ========================================================================== */
.quick-presets-bar {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.quick-presets-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    white-space: nowrap;
}

.quick-presets-scroll {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    flex: 1;
    padding-bottom: 2px;
}

.preset-chip {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.14s ease;
}

.preset-chip:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-gold);
    transform: translateY(-1px);
}

.preset-chip-clear {
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.08);
}

/* ==========================================================================
   NIVEL 1: SELECTOR DE PARTES (CINTURONES)
   ========================================================================== */
.parts-quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(125px, 1fr));
    gap: 8px;
}

.part-toggle-btn {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 10px;
    background-color: var(--bg-surface-elevated);
    border: 2px solid var(--border-subtle);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.16s ease;
    text-align: center;
    user-select: none;
}

.part-toggle-btn:hover {
    background-color: var(--bg-card);
    transform: translateY(-1px);
}

.part-toggle-btn .part-icon {
    font-size: 20px;
    margin-bottom: 4px;
}

.part-toggle-btn .part-name {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text-muted);
}

.part-toggle-btn .part-min-pill {
    margin-top: 4px;
    font-size: 10.5px;
    font-weight: 800;
    padding: 1px 7px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-dim);
}

.part-toggle-btn.active {
    background-color: rgba(255, 255, 255, 0.06);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.part-toggle-btn.active .part-name {
    color: #ffffff;
}

.part-toggle-btn.active .part-min-pill {
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
}

.part-check-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

/* ==========================================================================
   NIVEL 2 Y 3: BLOQUES DE PARTES, SUBGRUPOS Y EJERCICIOS
   ========================================================================== */
.class-part-block {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-left-width: 6px;
    border-radius: var(--radius-lg);
    margin-bottom: 18px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.class-part-header {
    padding: 12px 16px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.04), transparent);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-subtle);
    flex-wrap: wrap;
    gap: 8px;
}

.class-part-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Outfit', sans-serif;
    font-size: 16px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.class-part-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.class-part-items {
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Barra rápida inline para añadir Subgrupos sin abrir modal */
.inline-subgroup-creator {
    background: rgba(13, 19, 34, 0.65);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.inline-sg-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.sg-quick-chip {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.14s ease;
}

.sg-quick-chip:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: #fff;
}

.inline-input-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.inline-fast-input {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 7px 11px;
    font-size: 13px;
    color: var(--text-main);
    outline: none;
}

.inline-fast-input:focus {
    border-color: var(--accent-blue);
}

/* Tarjeta de Subgrupo dentro de una Parte */
.class-subgroup-block {
    background-color: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px;
    transition: all 0.15s ease;
}

.subgroup-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.subgroup-controls-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-subtle);
}

/* Tarjeta de Ejercicio dentro de un Subgrupo */
.class-exercise-item {
    background-color: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 11px 13px;
    margin-bottom: 8px;
    transition: all 0.15s ease;
}

.class-exercise-item:hover {
    border-color: rgba(255, 255, 255, 0.18);
}

.ex-num-badge {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 5px;
    margin-right: 4px;
}

/* Controles táctiles de minutos (-5 [ 10 ] +5) */
.minute-stepper {
    display: inline-flex;
    align-items: center;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.stepper-btn {
    border: none;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 800;
    padding: 5px 9px;
    cursor: pointer;
    transition: background 0.12s ease;
    user-select: none;
}

.stepper-btn:hover {
    background: var(--bg-card-hover);
    color: #fff;
}

.stepper-btn:active {
    background: var(--primary);
}

.minute-input {
    width: 46px;
    padding: 4px 2px;
    text-align: center;
    font-size: 13.5px;
    font-weight: 800;
    background: transparent;
    border: none;
    color: #ffffff;
    outline: none;
    -moz-appearance: textfield;
}
.minute-input::-webkit-outer-spin-button,
.minute-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.note-input {
    flex: 1;
    min-width: 160px;
    font-size: 12.5px;
    padding: 6px 10px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: #fef08a;
    outline: none;
}

.note-input:focus {
    border-color: var(--accent-gold);
}

.note-input::placeholder {
    color: var(--text-dim);
}

/* Barra rápida para añadir ejercicios dentro de un subgrupo */
.subgroup-add-exercise-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--border-subtle);
}

/* Botonera final del planificador */
.planner-bottom-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
    margin-bottom: 34px;
}

/* ==========================================================================
   DRAG & DROP Y BOTONES DE REORDENACIÓN
   ========================================================================== */
.drag-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    font-size: 16px;
    line-height: 1;
    cursor: grab;
    user-select: none;
    padding: 4px 6px;
    border-radius: var(--radius-xs);
    transition: all 0.15s ease;
    touch-action: none;
}

.drag-handle:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.08);
}

.move-arrow-btn {
    width: 26px;
    height: 26px;
    border-radius: 5px;
    border: 1px solid var(--border-subtle);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    font-size: 11px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.move-arrow-btn:hover {
    background: var(--bg-card-hover);
    color: #fff;
    border-color: var(--border-color);
}

.is-dragging {
    opacity: 0.45 !important;
    transform: scale(0.98);
    border: 2px dashed var(--primary) !important;
    box-shadow: var(--shadow-lg);
}

.drag-over {
    border-color: var(--accent-blue) !important;
    background: rgba(56, 189, 248, 0.08) !important;
    outline: 2px dashed var(--accent-blue);
    outline-offset: 2px;
}

/* ==========================================================================
   SISTEMA DE ETIQUETAS (TAGS)
   ========================================================================== */
.tags-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 6px 0;
}

.tag-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 11.5px;
    font-weight: 600;
    user-select: none;
    cursor: pointer;
    transition: all 0.14s ease;
}

.tag-badge.active {
    background-color: var(--primary-light);
    border-color: var(--primary);
    color: #fda4af;
    font-weight: 700;
}

.tag-badge.selectable:hover {
    border-color: var(--text-muted);
    color: #ffffff;
    transform: translateY(-1px);
}

/* ==========================================================================
   TARJETAS DE CLASE (VISTA MIS CLASES)
   ========================================================================== */
.class-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 16px 18px;
    margin-bottom: 12px;
    transition: all 0.16s ease;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: var(--shadow-sm);
}

.class-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background-color: var(--bg-surface-elevated);
}

.class-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    cursor: pointer;
}

.class-date-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    min-width: 60px;
    padding: 6px 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.class-date-dayname {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--primary-hover);
    letter-spacing: 0.6px;
}

.class-date-num {
    font-family: 'Outfit', sans-serif;
    font-size: 20px;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.1;
}

.class-date-month {
    font-size: 10.5px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
}

.class-card-info {
    flex: 1;
}

.class-card-meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.class-card-group {
    background: rgba(225, 29, 72, 0.15);
    border: 1px solid rgba(225, 29, 72, 0.35);
    color: #fda4af;
    padding: 2px 9px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.class-card-time {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-secondary);
}

.class-card-duration {
    margin-left: auto;
    font-family: 'Outfit', sans-serif;
    font-size: 16px;
    font-weight: 800;
    color: #fff;
    background: var(--bg-card);
    padding: 3px 10px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
}

.class-card-title {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 3px;
}

.class-card-objective {
    font-size: 12.5px;
    color: var(--text-muted);
}

.class-card-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-subtle);
}

.class-parts-pills {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.part-mini-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
}

.class-direct-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ==========================================================================
   CALENDARIO MENSUAL
   ========================================================================== */
.calendar-wrap {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 20px;
}

.calendar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.calendar-month-title {
    font-family: 'Outfit', sans-serif;
    font-size: 17px;
    font-weight: 800;
    text-transform: capitalize;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    text-align: center;
}

.calendar-day-head {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-dim);
    padding: 4px 0;
    text-transform: uppercase;
}

.calendar-cell {
    min-height: 54px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    cursor: pointer;
    transition: all 0.14s ease;
}

.calendar-cell:hover {
    border-color: var(--primary);
    background-color: var(--bg-card-hover);
}

.calendar-cell.other-month {
    opacity: 0.22;
    cursor: default;
}

.calendar-cell.today {
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 1px var(--accent-gold);
    font-weight: 800;
}

.calendar-cell-num {
    font-size: 12.5px;
    font-weight: 700;
}

.calendar-events-dots {
    display: flex;
    gap: 3px;
    margin-top: 5px;
    flex-wrap: wrap;
    justify-content: center;
}

.event-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
}

.dot-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.belt-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

/* ==========================================================================
   MODALES Y SELECTOR MULTI-EJERCICIO
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(4, 7, 14, 0.8);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 14px;
}

.modal-overlay.active {
    display: flex;
    animation: fadeSlideUp 0.16s ease-out;
}

.modal-sheet {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 620px;
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-family: 'Outfit', sans-serif;
    font-size: 17px;
    font-weight: 800;
}

.modal-body {
    padding: 18px;
    flex: 1;
    overflow-y: auto;
}

.modal-footer {
    padding: 12px 18px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.toggle-pill-group {
    display: inline-flex;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    padding: 2px;
}

.toggle-pill {
    padding: 3px 10px;
    border-radius: var(--radius-full);
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

.toggle-pill.active {
    background: var(--primary);
    color: white;
}

.exercise-pick-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 340px;
    overflow-y: auto;
    padding-right: 4px;
}

.exercise-pick-item {
    background-color: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 11px 14px;
    cursor: pointer;
    transition: all 0.14s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.exercise-pick-item:hover {
    border-color: var(--border-focus);
    background-color: var(--bg-card-hover);
}

.exercise-pick-item.already-added {
    border-color: var(--accent-green);
    background-color: rgba(16, 185, 129, 0.08);
}

.exercise-pick-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
}

.last-used-badge {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-dim);
    background: var(--bg-input);
    padding: 2px 7px;
    border-radius: var(--radius-full);
}

.last-used-badge.recent {
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.12);
}

/* ==========================================================================
   PANTALLA DE ACCESO / LOGIN
   ========================================================================== */
.login-screen {
    min-height: calc(100vh - 100px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.login-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 34px 28px;
    width: 100%;
    max-width: 400px;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.login-logo-ring {
    width: 72px;
    height: 72px;
    margin: 0 auto 16px;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(225, 29, 72, 0.25), rgba(225, 29, 72, 0.05));
    border: 1px solid rgba(225, 29, 72, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(225, 29, 72, 0.25);
}

.login-logo {
    font-size: 38px;
}

.login-title {
    font-family: 'Outfit', sans-serif;
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 6px;
}

.login-desc {
    font-size: 13.5px;
    color: var(--text-muted);
    margin-bottom: 22px;
}

.login-alert {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid #ef4444;
    color: #fca5a5;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* ==========================================================================
   NOTIFICACIONES TOAST
   ========================================================================== */
.toast-container {
    position: fixed;
    top: 72px;
    right: 16px;
    z-index: 250;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    background-color: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 11px 16px;
    border-radius: var(--radius-md);
    font-size: 13.5px;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideInRight 0.2s ease-out;
    pointer-events: auto;
}

.toast.success { border-left: 4px solid var(--accent-green); }
.toast.error { border-left: 4px solid var(--primary); }
.toast.info { border-left: 4px solid var(--accent-blue); }

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ==========================================================================
   RESPONSIVIDAD Y ESCRITORIO
   ========================================================================== */
@media (min-width: 768px) {
    body {
        padding-bottom: 40px;
    }

    .bottom-nav {
        display: none;
    }

    .header-desktop-nav {
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .header-desktop-nav .nav-item {
        flex-direction: row;
        gap: 7px;
        font-size: 13px;
        padding: 7px 13px;
        flex: initial;
    }

    .header-desktop-nav .nav-item .nav-icon {
        font-size: 16px;
        margin-bottom: 0;
    }

    .header-quick-new {
        display: none;
    }

    .planner-meta-grid {
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }

    .settings-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 18px;
    }
}

@media (max-width: 767px) {
    .header-desktop-nav {
        display: none;
    }
    .hide-xs {
        display: none;
    }
}
