/* ============================================================
   MI-CUENTA.CSS — Dashboard de usuario
   ============================================================ */

:root {
    --purple:       #6A4691;
    --purple-dark:  #5a3b7a;
    --purple-light: #f3eefb;
    --sidebar-w:    260px;
    --text:         #1a1a2e;
    --text-muted:   #7a7a9a;
    --border:       #ececf4;
    --bg:           #f5f5fb;
    --white:        #ffffff;
    --shadow:       0 2px 16px rgba(106,70,145,0.07);
    --radius:       14px;
}

html { overflow-y: scroll; }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: "Questrial", sans-serif;
    background: var(--bg);
    color: var(--text);
    display: flex;
    min-height: 100vh;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
    width: var(--sidebar-w);
    min-height: 100vh;
    background: var(--white);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 200;
    overflow-y: auto;
    transition: transform 0.28s cubic-bezier(.4,0,.2,1);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--purple);
    padding: 8px 14px;
    border-radius: 50px;
    text-decoration: none;
    margin-bottom: 24px;
    box-shadow: 0 4px 12px rgba(106,70,145,0.3);
    transition: background 0.2s;
    text-align: center;
}

/* Perfil mini en sidebar */
.sidebar-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--purple-light);
    border-radius: var(--radius);
    padding: 14px 12px;
    margin-bottom: 28px;
}

.sidebar-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--purple);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.sidebar-name {
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-email {
    font-size: 0.76rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Navegación */
.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-group-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    padding: 14px 10px 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border-radius: 10px;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.18s ease;
    text-align: left;
    width: 100%;
    position: relative;
}

.nav-item:hover {
    background: var(--purple-light);
    color: var(--purple);
}

.nav-item.active {
    background: var(--purple);
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(106,70,145,0.3);
}

.nav-icon {
    width: 22px;
    text-align: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.nav-label { flex: 1; }

/* Badge contador */
.nav-badge {
    background: rgba(106,70,145,0.15);
    color: var(--purple);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 50px;
    min-width: 20px;
    text-align: center;
}

.nav-item.active .nav-badge {
    background: rgba(255,255,255,0.25);
    color: white;
}

/* Badge punto rojo para mensajes no leídos */
.nav-badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e53935;
    padding: 0;
    min-width: 0;
}

/* Logout */
.sidebar-logout {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border-radius: 10px;
    border: 1.5px solid var(--border);
    background: transparent;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.18s;
    margin-top: 16px;
    width: 100%;
}

.sidebar-logout:hover {
    border-color: #e53935;
    color: #e53935;
    background: #fce4ec;
}

/* ============================================================
   CONTENIDO PRINCIPAL
   ============================================================ */
.dashboard-main {
    margin-left: var(--sidebar-w);
    flex: 1;
    padding: 40px 48px;
    min-height: 100vh;
}

/* Secciones — solo la activa se muestra */
.dash-section { display: none; }
.dash-section.active { display: block; }

/* Header de sección */
.section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.section-title {
    font-family: "Questrial", sans-serif;
    font-size: 2rem;
    font-weight: 400;
    color: var(--text);
    margin-bottom: 4px;
}

.section-sub {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.btn-explore {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--purple);
    color: white;
    padding: 12px 22px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(106,70,145,0.25);
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.btn-explore:hover {
    background: var(--purple-dark);
    transform: translateY(-1px);
}

/* ── STATS GRID ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    border-radius: var(--radius);
    padding: 22px 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border: 1px solid transparent;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.stat-purple { background: #f3eefb; border-color: #e0cef5; }
.stat-teal   { background: #e0f7f4; border-color: #b2dfdb; }
.stat-gold   { background: #fff8e1; border-color: #ffe082; }
.stat-rose   { background: #fce4ec; border-color: #f8bbd0; }

.stat-icon {
    font-size: 1.3rem;
    margin-bottom: 4px;
}

.stat-purple .stat-icon { color: #6A4691; }
.stat-teal   .stat-icon { color: #00796b; }
.stat-gold   .stat-icon { color: #f57f17; }
.stat-rose   .stat-icon { color: #c62828; }

.stat-value {
    font-family: "Questrial", sans-serif;
    font-size: 1.9rem;
    font-weight: 400;
    color: var(--text);
    line-height: 1;
}

.stat-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ── PRÓXIMA RESERVA ── */
.next-reservation {
    margin-bottom: 32px;
}

.next-card {
    background: linear-gradient(135deg, var(--purple) 0%, #9b6fc4 100%);
    border-radius: var(--radius);
    padding: 24px 28px;
    display: flex;
    align-items: center;
    gap: 20px;
    color: white;
    box-shadow: 0 8px 24px rgba(106,70,145,0.3);
}

.next-card-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    opacity: 0.75;
    margin-bottom: 6px;
}

.next-card-title {
    font-family: "Questrial", sans-serif;
    font-size: 1.4rem;
    margin-bottom: 8px;
}

.next-card-meta {
    display: flex;
    gap: 20px;
    font-size: 0.88rem;
    opacity: 0.85;
    flex-wrap: wrap;
}

.next-card-meta span { display: flex; align-items: center; gap: 6px; }

.next-card-img {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid rgba(255,255,255,0.3);
}

.next-card-img-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    background: rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    flex-shrink: 0;
}

.next-card-actions { margin-left: auto; display: flex; gap: 8px; flex-shrink: 0; }

.next-btn {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.35);
    color: white;
    padding: 9px 18px;
    border-radius: 50px;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s;
}

.next-btn:hover { background: rgba(255,255,255,0.3); }

/* ── ACCESOS RÁPIDOS ── */
.subsection-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 14px;
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.quick-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-family: inherit;
    text-decoration: none;
    color: var(--text);
    transition: all 0.2s;
    box-shadow: var(--shadow);
}

.quick-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(106,70,145,0.12);
    border-color: var(--purple);
}

.quick-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.quick-label {
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
}

/* ── FILTER PILLS ── */
.filter-pills {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.pill {
    padding: 7px 18px;
    border-radius: 50px;
    border: 1.5px solid var(--border);
    background: var(--white);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.18s;
}

.pill:hover { border-color: var(--purple); color: var(--purple); }

.pill.active {
    background: var(--purple);
    border-color: var(--purple);
    color: white;
}

/* ── CARDS DE RESERVA / ESPACIO ── */
.item-card {
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 14px;
    display: flex;
    height: 130px;
    transition: box-shadow 0.2s, transform 0.2s;
}

.item-card:hover {
    box-shadow: 0 6px 24px rgba(106,70,145,0.1);
    transform: translateY(-2px);
}

.item-thumb {
    width: 160px;
    height: 100%;
    object-fit: cover;
    flex-shrink: 0;
    display: block;
}

.item-thumb-placeholder {
    width: 160px;
    height: 100%;
    background: linear-gradient(135deg, #ede7f6, #d1c4e9);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    flex-shrink: 0;
    color: var(--purple);
}

.item-body {
    padding: 18px 22px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.item-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 3px;
}

.item-location {
    color: var(--text-muted);
    font-size: 0.84rem;
    margin-bottom: 8px;
}

.item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.item-meta span { display: flex; align-items: center; gap: 5px; }

.item-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.item-price {
    font-size: 1.05rem;
    font-weight: 700;
}

.item-status {
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.76rem;
    font-weight: 700;
}

.status-confirmed { background: #e8f5e9; color: #2e7d32; }
.status-pending   { background: #fff8e1; color: #e65100; }
.status-cancelled { background: #fce4ec; color: #b71c1c; }
.status-past      { background: #f3e5f5; color: #6A4691; }
.status-active    { background: #e8f5e9; color: #2e7d32; }

.item-actions { display: flex; gap: 8px; }

.btn-sm {
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.18s;
    border: 1.5px solid var(--border);
    background: white;
    color: var(--text);
}

.btn-sm:hover { border-color: var(--purple); color: var(--purple); }
.btn-sm.danger:hover { border-color: #e53935; color: #e53935; }
.btn-sm.primary {
    background: var(--purple);
    border-color: var(--purple);
    color: white;
}
.btn-sm.primary:hover { background: var(--purple-dark); }

/* ── MENSAJES ── */
.msg-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 22px;
    margin-bottom: 12px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    cursor: pointer;
    transition: all 0.18s;
    box-shadow: var(--shadow);
}

.msg-card:hover {
    border-color: var(--purple);
    box-shadow: 0 4px 16px rgba(106,70,145,0.1);
}

.msg-card.unread { border-left: 3px solid var(--purple); }

.msg-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--purple-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--purple);
}

.msg-body { flex: 1; }

.msg-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.msg-name {
    font-size: 0.95rem;
    font-weight: 700;
}

.msg-time {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.msg-subject {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.msg-preview {
    font-size: 0.84rem;
    color: #aaa;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 500px;
}

.msg-unread-dot {
    width: 10px;
    height: 10px;
    background: var(--purple);
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 6px;
}

/* ── PERFIL FORM ── */
.perfil-card {
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 36px;
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

.perfil-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.perfil-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--purple), #9b6fc4);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    font-weight: 700;
    font-family: "Questrial", sans-serif;
}

.perfil-avatar-edit {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--purple);
    color: white;
    border: 2px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    cursor: pointer;
    transition: background 0.2s;
}

.perfil-avatar-edit:hover { background: var(--purple-dark); }

.perfil-form { flex: 1; }

.pf-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.pf-group { display: flex; flex-direction: column; gap: 6px; }

.pf-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 0.3px;
}

.pf-input {
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 0.92rem;
    font-family: inherit;
    color: var(--text);
    outline: none;
    transition: border-color 0.2s;
    background: var(--bg);
}

.pf-input:focus { border-color: var(--purple); background: white; }
.pf-input[readonly] { opacity: 0.6; cursor: not-allowed; }

.btn-save {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--purple);
    color: white;
    border: none;
    padding: 13px 26px;
    border-radius: 50px;
    font-size: 0.92rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 14px rgba(106,70,145,0.25);
}

.btn-save:hover { background: var(--purple-dark); transform: translateY(-1px); }

/* ── PAGOS ── */
.pago-row {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 22px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow);
}

.pago-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: var(--purple-light);
    color: var(--purple);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.pago-info { flex: 1; }
.pago-title { font-size: 0.92rem; font-weight: 700; }
.pago-date  { font-size: 0.8rem; color: var(--text-muted); }

.pago-amount {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
}

.pago-amount.positive { color: #2e7d32; }

/* ── EMPTY STATE ── */
.empty-state {
    background: var(--white);
    border-radius: var(--radius);
    padding: 60px 40px;
    text-align: center;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.empty-icon { font-size: 3rem; margin-bottom: 14px; }
.empty-state h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: 8px; }
.empty-state p  { color: var(--text-muted); font-size: 0.92rem; margin-bottom: 22px; line-height: 1.6; }

.btn-empty {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--purple);
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s;
    box-shadow: 0 4px 14px rgba(106,70,145,0.25);
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.btn-empty:hover { background: var(--purple-dark); transform: translateY(-1px); }

/* ── TOPBAR MÓVIL ── */
.topbar {
    display: none;
    position: sticky;
    top: 0;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 14px 20px;
    align-items: center;
    justify-content: space-between;
    z-index: 100;
    margin: -40px -48px 32px;
}

.topbar-toggle {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text);
    padding: 6px;
}

.topbar-title { font-weight: 700; font-size: 1rem; }

.topbar-logo {
    background: var(--purple);
    padding: 6px 12px;
    border-radius: 50px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sidebar-logo .brand-logo-img {
    height: 44px;
    width: auto;
    object-fit: contain;
}

.topbar-logo .brand-logo-img {
    height: 34px;
    width: auto;
    object-fit: contain;
}

.review-modal {
    position: fixed;
    inset: 0;
    background: rgba(14, 12, 24, 0.55);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 400;
}

.review-modal.open {
    display: flex;
}

.review-modal-card {
    width: min(100%, 560px);
    background: var(--white);
    border-radius: 20px;
    padding: 28px;
    position: relative;
    box-shadow: 0 30px 80px rgba(19, 13, 33, 0.24);
}

.review-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    border: none;
    background: #f4f1fb;
    width: 38px;
    height: 38px;
    border-radius: 999px;
    cursor: pointer;
    color: var(--text);
}

.review-modal-eyebrow {
    color: var(--purple);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.review-modal-title {
    font-size: 1.45rem;
    margin-bottom: 18px;
}

.review-stars {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
}

.review-stars button {
    border: none;
    background: transparent;
    font-size: 2rem;
    color: #d2c8e5;
    cursor: pointer;
    transition: transform 0.16s ease, color 0.16s ease;
}

.review-stars button.active {
    color: #ffb938;
}

.review-stars button:hover {
    transform: translateY(-1px);
}

/* Overlay para cerrar sidebar en móvil */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 190;
}

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .quick-actions { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(calc(-1 * var(--sidebar-w)));
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0,0,0,0.15);
    }

    .sidebar-overlay.open { display: block; }

    .dashboard-main {
        margin-left: 0;
        padding: 40px 20px;
    }

    .topbar { display: flex; }

    .perfil-card { flex-direction: column; }
    .pf-row { grid-template-columns: 1fr; }

    .item-thumb, .item-thumb-placeholder { width: 100%; min-height: 160px; }
    .item-card { flex-direction: column; }

    .next-card { flex-direction: column; }
    .next-card-actions { margin-left: 0; }
}
