/* ========================================
   LIBRE SOY - ADMIN PANEL CSS
   ======================================== */

:root {
    --primary-purple: #7b2d8e;
    --primary-purple-light: #a855c7;
    --accent-gold: #d4af37;
    --accent-gold-light: #f0d77c;
    --accent-teal: #2dd4bf;
    --accent-rose: #e8567f;
    --bg-deep: #0a0812;
    --bg-dark: #110e1a;
    --bg-card: #1a1525;
    --bg-card-hover: #231e30;
    --text-white: #f5f0ff;
    --text-gray: #b8b0c8;
    --text-light: #8a80a0;
    --success-green: #25d366;
    --danger-red: #ef4444;
    --shadow-purple: rgba(123, 45, 142, 0.3);
    --gradient-main: linear-gradient(135deg, #7b2d8e 0%, #a855c7 50%, #7b2d8e 100%);
    --gradient-gold: linear-gradient(135deg, #d4af37 0%, #f0d77c 50%, #d4af37 100%);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Montserrat', sans-serif;
    background: var(--bg-deep);
    color: var(--text-white);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* Login */
.login-screen {
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse at 50% 50%, #1a0e2e 0%, #0a0812 70%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9000;
    transition: opacity 0.4s ease;
}

.login-container { text-align: center; padding: 40px 20px; max-width: 380px; width: 100%; }

.login-logo { margin-bottom: 35px; }
.login-symbol { font-size: 2.5rem; color: var(--accent-gold); margin-bottom: 12px; text-shadow: 0 0 30px rgba(212,175,55,0.5); }
.login-logo h1 { font-family: 'Cormorant Garamond', serif; font-size: 1.8rem; letter-spacing: 0.1em; }
.login-logo p { font-size: 0.8rem; color: var(--accent-gold); letter-spacing: 0.3em; }

.login-form { margin-bottom: 30px; }

.login-input-group { margin-bottom: 20px; text-align: left; }
.login-input-group label { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; color: var(--text-gray); margin-bottom: 8px; }
.login-input-group label i { color: var(--accent-gold); }

.login-input-group input {
    width: 100%;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(123,45,142,0.2);
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 1rem;
    color: var(--text-white);
    font-family: 'Montserrat', sans-serif;
    transition: all 0.3s ease;
}

.login-input-group input:focus { outline: none; border-color: var(--primary-purple); box-shadow: 0 0 20px var(--shadow-purple); }

.login-btn {
    width: 100%;
    background: var(--gradient-main);
    color: var(--text-white);
    border: none;
    padding: 16px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 5px 20px var(--shadow-purple);
    letter-spacing: 0.1em;
}

.login-btn:hover { transform: translateY(-2px); }

.login-error {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--danger-red);
    font-size: 0.85rem;
    margin-top: 15px;
    animation: shake 0.3s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.login-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.3s ease;
}

.login-back:hover { color: var(--accent-gold); }

/* Mobile Nav */
.mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(17, 14, 26, 0.98);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(123,45,142,0.2);
    z-index: 500;
    padding: 8px 0;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
}

.mobile-nav-items { display: flex; justify-content: space-around; }

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.65rem;
    padding: 6px 8px;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.mobile-nav-item i { font-size: 1.1rem; }
.mobile-nav-item.active { color: var(--accent-gold); }
.mobile-nav-item:hover { color: var(--text-white); }

/* Main Content */
.main-content {
    padding-bottom: 80px;
    max-width: 900px;
    margin: 0 auto;
}

/* Header */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 15px;
    background: rgba(10, 8, 18, 0.95);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(123,45,142,0.15);
}

.header-brand { display: flex; align-items: center; gap: 10px; }
.brand-symbol { font-size: 1.3rem; color: var(--accent-gold); }
.page-title { font-family: 'Cormorant Garamond', serif; font-size: 1.3rem; font-weight: 600; }
.brand-label { font-size: 0.65rem; color: var(--accent-gold); letter-spacing: 0.1em; }

.date-display { font-size: 0.75rem; color: var(--text-gray); display: flex; align-items: center; gap: 6px; }
.date-display i { color: var(--accent-gold); }

/* Content Sections */
.content-section { display: none; padding: 15px; }
.content-section.active { display: block; animation: fadeIn 0.3s ease; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Stats Grid */
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }

.stat-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 18px;
    border: 1px solid rgba(123,45,142,0.1);
    display: flex;
    align-items: center;
    gap: 12px;
}

.stat-icon {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.stat-icon.purple { background: rgba(123,45,142,0.2); color: var(--primary-purple-light); }
.stat-icon.gold { background: rgba(212,175,55,0.2); color: var(--accent-gold); }
.stat-icon.teal { background: rgba(45,212,191,0.2); color: var(--accent-teal); }
.stat-icon.rose { background: rgba(232,86,127,0.2); color: var(--accent-rose); }

.stat-info h3 { font-size: 1.3rem; font-weight: 700; }
.stat-info p { font-size: 0.7rem; color: var(--text-light); margin-top: 2px; }

/* Charts */
.charts-row { display: flex; flex-direction: column; gap: 15px; margin-bottom: 20px; }

.chart-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 18px;
    border: 1px solid rgba(123,45,142,0.1);
}

.chart-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.chart-header h3 { font-size: 0.9rem; display: flex; align-items: center; gap: 8px; }
.chart-header h3 i { color: var(--accent-gold); }

.chart-select {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(123,45,142,0.2);
    color: var(--text-white);
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-family: 'Montserrat', sans-serif;
}

.chart-select option { background: var(--bg-card); }

/* Recent Card */
.recent-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 18px;
    border: 1px solid rgba(123,45,142,0.1);
}

.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.card-header h3 { font-size: 0.95rem; display: flex; align-items: center; gap: 8px; }
.card-header h3 i { color: var(--accent-gold); }

.view-all {
    color: var(--primary-purple-light);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Appointments List */
.appointment-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(123,45,142,0.1);
    border-radius: 14px;
    padding: 15px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.appointment-card:hover { border-color: rgba(123,45,142,0.3); }

.appt-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.appt-number { font-size: 0.75rem; color: var(--primary-purple-light); font-weight: 600; }

.status-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-badge.pendiente { background: rgba(255,152,0,0.2); color: #ff9800; }
.status-badge.confirmada { background: rgba(45,212,191,0.2); color: var(--accent-teal); }
.status-badge.completada { background: rgba(37,211,102,0.2); color: var(--success-green); }
.status-badge.cancelada { background: rgba(239,68,68,0.2); color: var(--danger-red); }

.appt-client { font-weight: 600; font-size: 0.95rem; margin-bottom: 4px; }

.appt-details { display: flex; flex-wrap: wrap; gap: 10px; font-size: 0.8rem; color: var(--text-gray); }
.appt-details span { display: flex; align-items: center; gap: 5px; }
.appt-details i { color: var(--accent-gold); font-size: 0.7rem; }

.appt-price { color: var(--accent-gold); font-weight: 700; font-size: 1rem; }

.appt-actions { display: flex; gap: 8px; margin-top: 10px; }

.action-btn {
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.action-btn.view { background: rgba(123,45,142,0.2); color: var(--primary-purple-light); }
.action-btn.confirm { background: rgba(45,212,191,0.2); color: var(--accent-teal); }
.action-btn.complete { background: rgba(37,211,102,0.2); color: var(--success-green); }
.action-btn.cancel { background: rgba(239,68,68,0.2); color: var(--danger-red); }
.action-btn:hover { transform: translateY(-1px); }

/* Filters */
.section-header-bar { padding: 0 0 15px; }

.filters { display: flex; flex-wrap: wrap; gap: 10px; }

.filter-group { flex: 1; min-width: 120px; }

.filter-group input,
.filter-group select {
    width: 100%;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(123,45,142,0.2);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 0.85rem;
    color: var(--text-white);
    font-family: 'Montserrat', sans-serif;
    transition: all 0.3s ease;
}

.filter-group input:focus,
.filter-group select:focus { outline: none; border-color: var(--primary-purple); }
.filter-group select option { background: var(--bg-card); }

/* Reports */
.reports-grid { display: flex; flex-direction: column; gap: 15px; }

.report-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid rgba(123,45,142,0.1);
}

.report-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.report-header h3 { font-size: 0.95rem; display: flex; align-items: center; gap: 8px; }
.report-header h3 i { color: var(--accent-gold); }

.report-date {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(123,45,142,0.2);
    color: var(--text-white);
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-family: 'Montserrat', sans-serif;
}

.report-stat { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid rgba(123,45,142,0.1); }
.report-stat:last-child { border-bottom: none; }
.report-stat .label { color: var(--text-gray); font-size: 0.85rem; }
.report-stat .value { font-weight: 700; font-size: 0.95rem; color: var(--accent-gold); }

/* Settings */
.settings-grid { display: flex; flex-direction: column; gap: 15px; }

.settings-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid rgba(123,45,142,0.1);
}

.settings-card h3 { font-size: 0.95rem; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.settings-card h3 i { color: var(--accent-gold); }
.settings-card p { font-size: 0.8rem; color: var(--text-gray); margin-bottom: 15px; }

.settings-card.danger-zone { border-color: rgba(239,68,68,0.2); }
.settings-card.danger-zone h3 i { color: var(--danger-red); }

.settings-input-group { margin-bottom: 15px; }
.settings-input-group label { font-size: 0.8rem; color: var(--text-gray); display: block; margin-bottom: 6px; }

.settings-input-group input {
    width: 100%;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(123,45,142,0.2);
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 0.95rem;
    color: var(--text-white);
    font-family: 'Montserrat', sans-serif;
}

.settings-input-group input:focus { outline: none; border-color: var(--primary-purple); }

.settings-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.settings-btn {
    padding: 12px 20px;
    border-radius: 10px;
    border: none;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.settings-btn.primary { background: var(--gradient-main); color: var(--text-white); }
.settings-btn.danger { background: rgba(239,68,68,0.2); color: var(--danger-red); }
.settings-btn:hover { transform: translateY(-1px); }

.info-list { display: flex; flex-direction: column; gap: 10px; }
.info-item { display: flex; justify-content: space-between; font-size: 0.85rem; }
.info-item .label { color: var(--text-gray); }
.info-item .value { font-weight: 600; }

/* Empty State */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-light); }
.empty-state i { font-size: 3rem; margin-bottom: 15px; opacity: 0.4; }
.empty-state h3 { margin-bottom: 8px; }

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.9);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.active { opacity: 1; visibility: visible; }

.modal-content {
    background: var(--bg-card);
    width: 100%;
    max-width: 500px;
    max-height: 85vh;
    border-radius: 24px 24px 0 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(100%);
    transition: transform 0.4s ease;
}

.modal.active .modal-content { transform: translateY(0); }

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(123,45,142,0.15);
}

.modal-header h2 { font-size: 1.1rem; display: flex; align-items: center; gap: 8px; }
.modal-header h2 i { color: var(--accent-gold); }

.modal-close {
    width: 38px;
    height: 38px;
    border: none;
    background: rgba(255,255,255,0.1);
    color: var(--text-white);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover { background: var(--primary-purple); }

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

.detail-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid rgba(123,45,142,0.1); font-size: 0.9rem; }
.detail-row .label { color: var(--text-gray); }
.detail-row .value { font-weight: 500; text-align: right; max-width: 60%; }

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid rgba(123,45,142,0.15);
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Scrollbar */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: var(--primary-purple); border-radius: 3px; }

@media (min-width: 768px) {
    .stats-grid { grid-template-columns: repeat(4, 1fr); }
    .charts-row { flex-direction: row; }
    .chart-card { flex: 1; }
    .reports-grid { display: grid; grid-template-columns: repeat(3, 1fr); }
}
