/* ============================================================
   Atelier Clases — Frontend CSS
   ============================================================ */
:root {
    --at-primary:     #1a1a1a;
    --at-accent:      #c8a96e;
    --at-accent-dark: #a8894e;
    --at-bg:          #f6f5f3;
    --at-surface:     #ffffff;
    --at-border:      #e2e0dc;
    --at-text:        #2c2c2c;
    --at-muted:       #888580;
    --at-radius:      10px;
    --at-shadow:      0 2px 12px rgba(0,0,0,.08);
    --at-success:     #4caf7d;
    --at-danger:      #e05555;
}

/* ── Base ── */
.atelier-panel { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; color: var(--at-text); }
.atp-step-hidden { display: none !important; }

/* ── Botones ── */
.atelier-btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 11px 22px; background: var(--at-accent); color: #fff;
    border-radius: 8px; border: none; cursor: pointer;
    font-size: 14px; font-weight: 600; text-decoration: none;
    transition: background .15s; line-height: 1;
}
.atelier-btn:hover { background: var(--at-accent-dark); color: #fff; }
.atelier-btn-sm   { padding: 7px 14px; font-size: 12.5px; }

/* ── Notices ── */
.atelier-notice { padding: 13px 16px; border-radius: 8px; margin: 12px 0; font-size: 14px; line-height: 1.5; }
.atelier-notice a { color: inherit; font-weight: 600; }
.atelier-notice-warning { background: #fef6e7; border: 1px solid #f5d98a; color: #a0700a; }
.atelier-notice-error   { background: #fdeaea; border: 1px solid #f5b8b8; color: #b03030; }
.atelier-notice-success { background: #eaf7f1; border: 1px solid #b5e1ca; color: #2e7d57; }
.atelier-notice-info    { background: #e8f1fb; border: 1px solid #adc8ef; color: #2a5fa0; }

/* ── Header del panel ── */
.atp-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.atp-header-info { display: flex; align-items: center; gap: 14px; }
.atp-avatar {
    width: 52px; height: 52px; border-radius: 50%;
    background: var(--at-accent); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; font-weight: 700; flex-shrink: 0;
}
.atp-greeting { font-size: 20px; font-weight: 700; margin: 0; color: var(--at-primary); }
.atp-subtitle { font-size: 13px; color: var(--at-muted); margin: 2px 0 0; }
.atp-link-account { font-size: 13px; color: var(--at-accent); font-weight: 600; text-decoration: none; }

/* ── Status cards ── */
.atp-status-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-bottom: 28px; }
.atp-status-card {
    background: var(--at-surface); border: 1.5px solid var(--at-border);
    border-radius: var(--at-radius); padding: 18px;
    display: flex; gap: 14px; align-items: flex-start;
    transition: border-color .2s;
}
.atp-status-card.active  { border-color: var(--at-accent); }
.atp-status-card.inactive { opacity: .7; }
.atp-sc-icon  { font-size: 26px; flex-shrink: 0; margin-top: 2px; }
.atp-sc-body  { display: flex; flex-direction: column; gap: 2px; }
.atp-sc-label { font-size: 11px; text-transform: uppercase; font-weight: 700; color: var(--at-muted); letter-spacing: .05em; }
.atp-sc-value { font-size: 16px; font-weight: 700; color: var(--at-primary); }
.atp-sc-sub   { font-size: 12px; color: var(--at-muted); }
.atp-muted    { color: var(--at-muted) !important; font-weight: 400 !important; }

/* ── Barra de progreso ── */
.atp-progress-bar { height: 6px; background: var(--at-bg); border-radius: 3px; margin: 6px 0; width: 140px; overflow: hidden; }
.atp-progress-fill { height: 100%; background: var(--at-accent); border-radius: 3px; transition: width .4s; }

/* ── Tabs del panel ── */
.atp-tabs-nav { display: flex; border-bottom: 2px solid var(--at-border); margin-bottom: 24px; overflow-x: auto; }
.atp-tab-btn {
    padding: 10px 20px; background: none; border: none;
    border-bottom: 3px solid transparent; margin-bottom: -2px;
    font-size: 14px; font-weight: 500; color: var(--at-muted);
    cursor: pointer; white-space: nowrap; transition: color .15s, border-color .15s;
}
.atp-tab-btn.active, .atp-tab-btn:hover { color: var(--at-accent); border-bottom-color: var(--at-accent); }
.atp-tab-panel { display: none; }
.atp-tab-panel.active { display: block; }

/* ── Steps ── */
.atp-step-title {
    font-size: 16px; font-weight: 700; margin: 0 0 18px;
    display: flex; align-items: center; gap: 10px;
}
.atp-step-num {
    width: 28px; height: 28px; background: var(--at-accent); color: #fff;
    border-radius: 50%; display: inline-flex; align-items: center;
    justify-content: center; font-size: 13px; font-weight: 700; flex-shrink: 0;
}
.atp-back-btn {
    background: none; border: none; color: var(--at-accent);
    font-size: 13px; font-weight: 600; cursor: pointer; padding: 0; margin-bottom: 14px;
    display: inline-flex; align-items: center; gap: 4px;
}
.atp-selected-clase { font-size: 13.5px; color: var(--at-muted); margin-bottom: 16px; }

/* ── Grid de clases ── */
.atp-clases-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.atp-clase-card {
    background: var(--at-surface); border: 1.5px solid var(--at-border);
    border-radius: var(--at-radius); overflow: hidden;
    transition: border-color .2s, box-shadow .2s; cursor: pointer;
}
.atp-clase-card:hover { border-color: var(--at-accent); box-shadow: var(--at-shadow); }
.atp-clase-img {
    height: 130px; background-size: cover; background-position: center;
    background-color: var(--at-bg); position: relative;
}
.atp-clase-cat {
    position: absolute; top: 8px; left: 8px;
    background: rgba(0,0,0,.6); color: #fff;
    font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 20px;
}
.atp-clase-body { padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.atp-clase-body h4 { margin: 0; font-size: 14px; font-weight: 700; color: var(--at-primary); }
.atp-clase-meta { font-size: 12px; color: var(--at-muted); }

/* ── Campos de formulario ── */
.atp-field { margin-bottom: 16px; }
.atp-field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; color: var(--at-primary); }
.atp-input {
    width: 100%; max-width: 260px; padding: 9px 12px;
    border: 1.5px solid var(--at-border); border-radius: 7px;
    font-size: 14px; background: var(--at-surface); color: var(--at-text);
    box-sizing: border-box; transition: border-color .15s;
}
.atp-input:focus { border-color: var(--at-accent); outline: none; box-shadow: 0 0 0 3px rgba(200,169,110,.15); }
.atp-field-hint { font-size: 12px; color: var(--at-muted); display: block; margin-top: 4px; }

/* ── Horarios disponibles ── */
.atp-horarios-grid { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.atp-horario-btn {
    background: var(--at-surface); border: 1.5px solid var(--at-border);
    border-radius: 8px; padding: 12px 16px; cursor: pointer;
    display: flex; align-items: center; gap: 16px;
    text-align: left; transition: border-color .15s, background .15s;
}
.atp-horario-btn:hover:not([disabled]) { border-color: var(--at-accent); background: #faf8f4; }
.atp-horario-btn.selected { border-color: var(--at-accent); background: #fdf8ef; }
.atp-horario-btn[disabled] { opacity: .45; cursor: not-allowed; }
.atp-h-hora    { font-size: 15px; font-weight: 700; color: var(--at-primary); }
.atp-h-maestro { font-size: 13px; color: var(--at-muted); }
.atp-h-cupo    { font-size: 12px; color: var(--at-accent); font-weight: 600; margin-left: auto; }

/* ── Resumen de reserva ── */
.atp-resumen-card {
    background: var(--at-bg); border: 1.5px solid var(--at-border);
    border-radius: var(--at-radius); padding: 18px;
    display: flex; flex-direction: column; gap: 10px;
}
.atp-resumen-row { display: flex; justify-content: space-between; align-items: center; font-size: 14px; }
.atp-resumen-row span { color: var(--at-muted); }
.atp-resumen-row strong { color: var(--at-primary); text-align: right; }

/* ── Éxito ── */
.atp-success-wrap { text-align: center; padding: 32px 0; }
.atp-success-icon { font-size: 52px; margin-bottom: 12px; }
.atp-success-wrap h3 { font-size: 22px; color: var(--at-primary); margin: 0 0 8px; }

/* ── Mis reservas ── */
.atp-section-title { font-size: 15px; font-weight: 700; color: var(--at-primary); margin: 0 0 14px; }
.atp-reservas-list { display: flex; flex-direction: column; gap: 10px; }
.atp-reserva-item {
    display: flex; align-items: center; gap: 16px;
    background: var(--at-surface); border: 1.5px solid var(--at-border);
    border-radius: var(--at-radius); padding: 14px 16px;
    transition: border-color .15s;
}
.atp-reserva-item.pronto   { border-color: var(--at-accent); }
.atp-reserva-item.pasada   { opacity: .65; }
.atp-ri-fecha  { display: flex; flex-direction: column; align-items: center; min-width: 38px; }
.atp-ri-dia    { font-size: 20px; font-weight: 800; color: var(--at-primary); line-height: 1; }
.atp-ri-mes    { font-size: 11px; text-transform: uppercase; color: var(--at-muted); font-weight: 600; }
.atp-ri-info   { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.atp-ri-info strong { font-size: 14px; color: var(--at-primary); }
.atp-ri-detalle{ font-size: 12.5px; color: var(--at-muted); }
.atp-badge-pronto   { font-size: 11px; font-weight: 700; color: var(--at-accent); }
.atp-badge-os       { font-size: 11px; background: #fef6e7; color: #a0700a; border-radius: 20px; padding: 2px 8px; font-weight: 600; }
.atp-badge-cancelada{ font-size: 12px; background: #fdeaea; color: #b03030; border-radius: 20px; padding: 3px 10px; font-weight: 600; white-space: nowrap; }
.atp-badge-completada{font-size: 12px; background: #eaf7f1; color: #2e7d57; border-radius: 20px; padding: 3px 10px; font-weight: 600; white-space: nowrap; }
.atp-btn-cancelar-outline {
    background: transparent; border: 1.5px solid #e05555; color: #e05555;
    padding: 6px 12px; border-radius: 6px; font-size: 12px; font-weight: 600;
    cursor: pointer; white-space: nowrap; transition: background .15s, color .15s;
}
.atp-btn-cancelar-outline:hover { background: #e05555; color: #fff; }
.atp-cancel-locked { font-size: 16px; cursor: help; }

/* ── Modal ── */
.atp-modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 99999;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity .2s;
}
.atp-modal-overlay.open { opacity: 1; pointer-events: all; }
.atp-modal-box {
    background: var(--at-surface); border-radius: 14px;
    padding: 28px; max-width: 420px; width: 94vw;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
    transform: translateY(20px); transition: transform .2s;
}
.atp-modal-overlay.open .atp-modal-box { transform: translateY(0); }
.atp-modal-box h3  { margin: 0 0 12px; font-size: 18px; }
.atp-modal-box p   { font-size: 14px; color: var(--at-muted); margin: 0 0 8px; }
.atp-cancel-hint   { font-size: 12px; color: var(--at-accent) !important; }
.atp-modal-actions { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.atp-modal-actions .atelier-btn { flex: 1; }

/* ── Open Studio ── */
.atp-os-header { text-align: center; margin-bottom: 24px; }
.atp-os-badge  { display: inline-block; background: var(--at-accent); color: #fff; padding: 4px 14px; border-radius: 20px; font-size: 12px; font-weight: 700; margin-bottom: 10px; }
.atp-os-header h3 { margin: 0 0 6px; font-size: 19px; }
.atp-os-header p  { font-size: 13.5px; color: var(--at-muted); margin: 0; }
.atp-os-clases { display: flex; flex-wrap: wrap; gap: 8px; }
.atp-os-clase-opt { display: flex; align-items: center; gap: 6px; padding: 8px 14px; border: 1.5px solid var(--at-border); border-radius: 7px; cursor: pointer; font-size: 13.5px; transition: border-color .15s; }
.atp-os-clase-opt:has(input:checked) { border-color: var(--at-accent); background: #fdf8ef; }
.atp-os-fechas { display: flex; flex-direction: column; gap: 10px; }
.atp-os-fecha-card {
    display: flex; align-items: center; gap: 16px;
    background: var(--at-surface); border: 1.5px solid var(--at-border);
    border-radius: var(--at-radius); padding: 14px 18px;
}
.atp-os-fecha-card.sin-cupo  { opacity: .55; }
.atp-os-fecha-card.ya-reservado { border-color: var(--at-accent); }
.atp-os-fecha-info { display: flex; flex-direction: column; align-items: center; min-width: 40px; }
.atp-os-fecha-dia  { font-size: 22px; font-weight: 800; color: var(--at-primary); line-height: 1; }
.atp-os-fecha-mes  { font-size: 11px; text-transform: uppercase; color: var(--at-muted); font-weight: 600; }
.atp-os-cupo       { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.atp-os-cupo span  { font-size: 12.5px; color: var(--at-muted); }
.atp-badge-os-ok   { font-size: 13px; color: #2e7d57; font-weight: 600; }
.atp-badge-lleno   { font-size: 13px; color: #888; font-weight: 600; margin-left: auto; }

/* ── Estado widget (sidebar) ── */
.atelier-estado-widget { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; }
.at-badge-memb, .at-badge-paquete {
    background: var(--at-bg); border: 1.5px solid var(--at-border);
    border-radius: 20px; padding: 5px 12px; font-weight: 600;
}
.at-badge-memb    { color: var(--at-accent); }
.at-badge-paquete { color: var(--at-primary); }

/* ── Responsive ── */
@media (max-width: 600px) {
    .atp-status-grid { grid-template-columns: 1fr; }
    .atp-clases-grid { grid-template-columns: 1fr 1fr; }
    .atp-header { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 380px) {
    .atp-clases-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   CALENDARIO DE RESERVAS (estilo Fitco)
   ============================================================ */
.atc-wrap { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }

.atc-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; flex-wrap: wrap; gap: 10px; }
.atc-paquete-pill { display: flex; align-items: center; gap: 10px; background: #fdf8ef; border: 1px solid #e8d9b8; border-radius: 10px; padding: 9px 14px; }
.atc-paquete-pill i { font-size: 18px; color: #c8a96e; }
.atc-paquete-pill span { font-size: 13px; color: #7a5c2a; }
.atc-paquete-pill strong { font-size: 15px; color: #4a3410; font-weight: 600; }
.atc-paquete-vence { font-size: 11px; color: #a07840; margin-top: 1px; }
.atc-pill-inactive { background: var(--at-bg); border-color: var(--at-border); }
.atc-pill-inactive i { color: var(--at-text-muted); }
.atc-pill-inactive span { color: var(--at-text-muted); font-size: 13px; }

.atc-week-nav { display: flex; align-items: center; gap: 8px; }
.atc-week-nav button { background: none; border: 1px solid var(--at-border); border-radius: 7px; padding: 6px 10px; cursor: pointer; color: var(--at-text-muted); font-size: 14px; transition: background .12s; }
.atc-week-nav button:hover { background: var(--at-bg); }
.atc-week-label { font-size: 13.5px; font-weight: 600; color: var(--at-primary); min-width: 155px; text-align: center; }

/* Tira de días */
.atc-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 1.25rem; }
.atc-day-btn { background: none; border: 1px solid var(--at-border); border-radius: 8px; padding: 8px 4px; cursor: pointer; text-align: center; transition: border-color .12s, background .12s; }
.atc-day-btn:hover:not([disabled]) { background: var(--at-bg); border-color: #c8a96e; }
.atc-day-btn.active { background: #fdf8ef; border-color: #c8a96e; }
.atc-day-btn.expired { opacity: .35; cursor: not-allowed; }
.atc-day-btn.today .atc-day-num { color: #c8a96e; font-weight: 700; }
.atc-day-name { font-size: 10px; color: var(--at-text-muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 2px; }
.atc-day-num { font-size: 17px; font-weight: 600; color: var(--at-primary); line-height: 1; }
.atc-day-btn.active .atc-day-num { color: #7a5c2a; }
.atc-day-dot { width: 5px; height: 5px; border-radius: 50%; background: #c8a96e; margin: 4px auto 0; opacity: 0; }
.atc-day-btn.has-clase .atc-day-dot { opacity: 1; }

.atc-clases-label { font-size: 12px; font-weight: 700; color: var(--at-text-muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 10px; }

/* Tarjetas de clase */
.atc-clases-list { display: flex; flex-direction: column; gap: 8px; }
.atc-clase-card { background: #fff; border: 1px solid var(--at-border); border-radius: 10px; padding: 13px 15px; display: grid; grid-template-columns: 5px 1fr auto; gap: 0 14px; align-items: center; }
.atc-clase-card.disponible { transition: border-color .12s; }
.atc-clase-card.disponible:hover { border-color: #c8a96e; }
.atc-clase-stripe { width: 5px; border-radius: 3px; background: #c8a96e; align-self: stretch; min-height: 44px; }
.atc-clase-stripe.os { opacity: .45; }
.atc-clase-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.atc-clase-nombre { font-size: 14px; font-weight: 600; color: var(--at-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.atc-clase-meta { font-size: 12px; color: var(--at-text-muted); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.atc-clase-meta i { font-size: 12px; vertical-align: -1px; margin-right: 2px; }
.atc-clase-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 7px; flex-shrink: 0; }
.atc-cupo-bar-wrap { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.atc-cupo-text { font-size: 11px; color: var(--at-text-muted); }
.atc-cupo-bar { width: 68px; height: 4px; background: var(--at-border); border-radius: 2px; overflow: hidden; }
.atc-cupo-fill { height: 100%; border-radius: 2px; background: #c8a96e; transition: width .3s; }
.atc-cupo-fill.alto { background: #d07070; }

/* Botón reservar */
.atc-btn-reservar { border: none; border-radius: 7px; padding: 7px 14px; font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .12s; }
.atc-btn-reservar.disponible { background: #c8a96e; color: #fff; }
.atc-btn-reservar.disponible:hover { background: #a8894e; }
.atc-btn-reservar.lleno, .atc-btn-reservar.sin-paquete { background: var(--at-bg); color: var(--at-text-muted); cursor: not-allowed; border: 1px solid var(--at-border); }
.atc-btn-reservar.reservado { background: #eaf7f1; color: #2e7d57; cursor: default; border: 1px solid #b5e1ca; }
.atc-btn-reservar.reservado i { font-size: 12px; vertical-align: -1px; margin-right: 3px; }

/* Badges */
.atc-badge-os { font-size: 11px; background: #fdf8ef; color: #7a5c2a; border-radius: 20px; padding: 2px 8px; border: 1px solid #e8d9b8; }
.atc-badge-tag { font-size: 11px; background: var(--at-bg); color: var(--at-text-muted); border-radius: 20px; padding: 2px 8px; }

/* Estado vacío y loading */
.atc-empty { text-align: center; padding: 2rem 0; color: var(--at-text-muted); font-size: 14px; }
.atc-empty i { font-size: 30px; display: block; margin-bottom: 8px; color: var(--at-border); }
.atc-loading { text-align: center; padding: 1.5rem 0; color: var(--at-text-muted); font-size: 13px; }
.atc-spin { display: inline-block; animation: atcSpin .8s linear infinite; }
@keyframes atcSpin { to { transform: rotate(360deg); } }

/* Modal (inline faux overlay) */
.atc-modal-bg { margin-top: 1rem; background: rgba(0,0,0,.45); border-radius: 12px; display: none; align-items: center; justify-content: center; min-height: 280px; padding: 20px; }
.atc-modal-bg.show { display: flex; }
.atc-modal-box { background: #fff; border-radius: 12px; border: 1px solid var(--at-border); padding: 20px 22px; width: 100%; max-width: 380px; }
.atc-modal-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
.atc-modal-title { font-size: 15px; font-weight: 700; color: var(--at-primary); margin: 0; }
.atc-modal-sub { font-size: 12px; color: var(--at-text-muted); margin: 3px 0 0; }
.atc-modal-close { background: none; border: none; cursor: pointer; color: var(--at-text-muted); font-size: 17px; padding: 0; line-height: 1; }
.atc-modal-row { display: flex; justify-content: space-between; align-items: center; font-size: 13px; padding: 8px 0; border-bottom: 1px solid var(--at-border); }
.atc-modal-row:last-of-type { border-bottom: none; }
.atc-modal-row span { color: var(--at-text-muted); }
.atc-modal-row strong { color: var(--at-primary); }
.atc-modal-footer { margin-top: 14px; display: flex; gap: 8px; }
.atc-modal-footer button { flex: 1; padding: 10px; border-radius: 7px; font-size: 13px; font-weight: 600; cursor: pointer; }
.atc-btn-cancel-modal { background: none; border: 1px solid var(--at-border); color: var(--at-text-muted); }
.atc-btn-confirm { background: #c8a96e; color: #fff; border: none; }
.atc-btn-confirm:hover { background: #a8894e; }
.atc-btn-confirm:disabled { opacity: .6; cursor: wait; }
.atc-success { text-align: center; padding: 1.5rem 1rem; }
.atc-success i { font-size: 40px; color: #4a9e6a; display: block; margin-bottom: 10px; }
.atc-success strong { font-size: 17px; font-weight: 700; color: var(--at-primary); display: block; }
.atc-success p { font-size: 13px; color: var(--at-text-muted); margin: 6px 0 0; }
.atc-success button { margin-top: 14px; background: #c8a96e; color: #fff; border: none; border-radius: 7px; padding: 9px 22px; font-size: 13px; font-weight: 600; cursor: pointer; }

@media (max-width: 500px) {
    .atc-days { gap: 4px; }
    .atc-day-num { font-size: 15px; }
    .atc-clase-card { grid-template-columns: 4px 1fr; gap: 0 10px; }
    .atc-clase-actions { grid-column: 2; margin-top: 8px; flex-direction: row; align-items: center; }
    .atc-week-label { min-width: 120px; font-size: 12px; }
}
