/* ========================================
   ADMIN PANEL - DOLL'S AESTHETICS LAB
   ======================================== */

/* ===== ADMIN LOGIN ===== */
.admin-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-cream);
    padding: 2rem;
}

.admin-login-container {
    width: 100%;
    max-width: 440px;
}

.admin-login-box {
    background: var(--white);
    padding: 3rem 2.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-hover);
    text-align: center;
}

.admin-login-logo .logo-img {
    height: 60px;
    margin: 0 auto 1rem;
}

.admin-login-logo h1 {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.admin-login-logo p {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 2rem;
}

.admin-login-form .form-group {
    text-align: left;
}

.admin-login-form .form-group label {
    font-weight: 500;
    display: block;
    margin-bottom: 0.3rem;
}

.login-error {
    color: #e74c3c;
    font-size: 0.9rem;
    padding: 0.5rem;
    background: #fde8e8;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.admin-login-footer {
    margin-top: 1.5rem;
    font-size: 0.9rem;
}

.admin-login-footer a {
    color: var(--primary);
    text-decoration: underline;
}

.admin-login-footer a:hover {
    color: var(--primary-dark);
}

/* ========================================
   ADMIN HEADER - LOGO + LOGOUT
   ======================================== */

.admin-header {
    background: var(--white);
    padding: 12px 24px;
    border-bottom: 1px solid #eee;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.admin-header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.admin-logo .logo-img {
    height: 35px;
    width: auto;
}

.admin-logo .admin-badge {
    font-weight: 600;
    color: var(--primary);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 2px 10px;
    border: 1px solid var(--primary-light);
    border-radius: 50px;
    background: rgba(201, 168, 140, 0.08);
}

.admin-header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.admin-user {
    font-weight: 500;
    color: var(--text);
    font-size: 0.9rem;
}

/* ========================================
   PESTAÑAS (TABS) - LAYOUT CORREGIDO
   ======================================== */

.admin-tabs-nav {
    background: var(--white);
    border-bottom: 2px solid #eee;
    padding: 0 24px;
    position: sticky;
    top: 60px;
    z-index: 99;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.admin-tabs-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem 0 0;
    flex-wrap: nowrap;
    overflow-x: auto;
}

.admin-tab {
    padding: 12px 24px;
    border: none;
    background: none;
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-light);
    transition: var(--transition);
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    flex-shrink: 0;
}

.admin-tab:hover {
    color: var(--text);
    background: var(--bg-light);
}

.admin-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

/* ========================================
   ADMIN DASHBOARD
   ======================================== */

.admin-dashboard {
    padding: 2rem 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.admin-container {
    display: block;
}

.admin-tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.admin-tab-content.active {
    display: block;
}

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

/* ========================================
   ADMIN CARDS
   ======================================== */

.admin-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem;
    margin-bottom: 2rem;
}

.admin-card-header {
    margin-bottom: 1.5rem;
}

.admin-card-header h2 {
    font-size: 1.5rem;
    margin-bottom: 0.3rem;
}

.admin-card-header p {
    color: var(--text-light);
    font-size: 0.95rem;
}

.admin-card-actions {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.save-status {
    font-size: 0.9rem;
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    background: var(--bg-light);
}

/* ========================================
   AVAILABILITY - NUEVA INTERFAZ
   ======================================== */

.availability-grid-new {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.availability-dates-list {
    background: var(--bg-light);
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid #eee;
    max-height: 500px;
    overflow-y: auto;
}

.availability-dates-list h3,
.availability-time-editor h3 {
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

/* ===== AGREGAR FECHA ===== */
.add-date-container {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.add-date-container .date-input {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-family: var(--font-sans);
    font-size: 0.9rem;
}

.add-date-container .date-input:focus {
    outline: none;
    border-color: var(--primary);
}

/* ===== LISTA DE FECHAS ===== */
#datesList {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.date-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--white);
    border-radius: 8px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.date-item:hover {
    border-color: var(--primary-light);
    transform: translateX(4px);
}

.date-item.active {
    border-color: var(--primary);
    background: var(--primary-light);
}

.date-item .date-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.date-item .date-info .date-text {
    font-weight: 600;
    font-size: 0.95rem;
}

.date-item .date-info .date-hours {
    font-size: 0.8rem;
    color: var(--text-light);
}

.date-item .date-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.date-item .date-actions .btn-remove-date {
    background: none;
    border: none;
    color: #ff6b6b;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 4px 8px;
    border-radius: 6px;
    transition: var(--transition);
}

.date-item .date-actions .btn-remove-date:hover {
    background: #ff6b6b;
    color: var(--white);
}

.empty-message {
    color: var(--text-light);
    text-align: center;
    padding: 1rem 0;
    font-size: 0.95rem;
}

/* ===== EDITOR DE HORAS ===== */
.availability-time-editor {
    background: var(--bg-light);
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid #eee;
}

.time-slots-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.time-slot {
    padding: 8px 4px;
    text-align: center;
    border: 2px solid #eee;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition);
    font-family: var(--font-sans);
    background: var(--white);
}

.time-slot:hover {
    border-color: var(--primary-light);
    background: var(--bg-light);
}

.time-slot.active {
    border-color: var(--primary);
    background: var(--primary-light);
    font-weight: 500;
}

.time-slot.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.time-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.time-presets .btn {
    font-size: 0.75rem;
    padding: 6px 14px;
}

#timeSlotsStatus {
    font-size: 0.85rem;
    color: var(--text-light);
    text-align: center;
    margin-top: 0.5rem;
}

/* ========================================
   CONTACT INFO FORM
   ======================================== */

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group small {
    display: block;
    color: var(--text-light);
    font-size: 0.8rem;
    margin-top: 0.2rem;
}

.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-family: var(--font-sans);
    font-size: 1rem;
    background: var(--white);
    transition: var(--transition);
}

.form-group select:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-family: var(--font-sans);
    font-size: 1rem;
    transition: var(--transition);
}

.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

/* ========================================
   BOOKINGS TABLE
   ======================================== */

.bookings-table-container {
    overflow-x: auto;
}

.bookings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.bookings-table th {
    text-align: left;
    padding: 10px 12px;
    background: var(--bg-light);
    font-weight: 600;
    color: var(--text);
    border-bottom: 2px solid #eee;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bookings-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.bookings-table tr:hover td {
    background: var(--bg-light);
}

.status-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-confirmed {
    background: #d4edda;
    color: #155724;
}

.bookings-table .btn {
    font-size: 0.7rem;
    padding: 3px 10px;
    margin: 0 2px;
}

.bookings-table .btn-secondary {
    padding: 3px 10px;
}

/* ========================================
   MODALES
   ======================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.modal-container.modal-admin {
    max-width: 500px;
    width: 100%;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-hover);
    animation: modalSlideUp 0.3s ease;
}

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

.modal-container.modal-cancel {
    max-width: 440px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #eee;
}

.modal-header h2 {
    font-size: 1.3rem;
    font-family: var(--font-serif);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
    transition: var(--transition);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: var(--bg-light);
    color: var(--text);
}

.modal-body {
    padding: 2rem;
}

.modal-body .booking-info {
    background: var(--bg-light);
    border-radius: var(--radius);
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
}

.modal-body .booking-info .info-row {
    display: flex;
    justify-content: space-between;
    padding: 0.3rem 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.modal-body .booking-info .info-row:last-child {
    border-bottom: none;
}

.modal-body .booking-info .info-label {
    color: var(--text-light);
    font-size: 0.9rem;
}

.modal-body .booking-info .info-value {
    font-weight: 600;
}

.modal-body .warning-text {
    color: var(--text-light);
    text-align: center;
    font-size: 0.95rem;
    padding: 0.5rem 0;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem 2rem;
    border-top: 1px solid #eee;
    background: var(--bg-light);
    border-radius: 0 0 var(--radius) var(--radius);
}

.modal-footer .btn {
    min-width: 120px;
}

.btn-danger {
    background: #dc3545;
    color: var(--white);
    border: none;
}

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 992px) {
    .availability-grid-new {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .admin-header {
        padding: 8px 12px;
    }
    
    .admin-header-content {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .admin-logo .logo-img {
        height: 28px;
    }
    
    .admin-tabs-nav {
        top: 55px;
        padding: 0 12px;
    }
    
    .admin-tab {
        font-size: 0.8rem;
        padding: 10px 16px;
    }
    
    .admin-login-box {
        padding: 2rem 1.5rem;
    }

    .admin-card {
        padding: 1.2rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .time-slots-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .add-date-container {
        flex-direction: column;
    }
    
    .add-date-container .date-input {
        width: 100%;
    }

    .bookings-table {
        font-size: 0.8rem;
    }

    .bookings-table th,
    .bookings-table td {
        padding: 6px 8px;
    }
    
    .modal-container.modal-admin {
        margin: 1rem;
        max-height: 95vh;
    }
    
    .modal-header {
        padding: 1rem 1.5rem;
    }
    
    .modal-header h2 {
        font-size: 1.1rem;
    }
    
    .modal-body {
        padding: 1.5rem;
    }
    
    .modal-footer {
        flex-direction: column;
        padding: 1rem 1.5rem;
    }
    
    .modal-footer .btn {
        width: 100%;
        min-width: unset;
    }
    
    .modal-body .booking-info .info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.2rem;
    }
}

@media (max-width: 480px) {
    .admin-header {
        padding: 6px 10px;
    }
    
    .admin-logo .logo-img {
        height: 22px;
    }
    
    .admin-tabs-nav {
        top: 48px;
    }
    
    .admin-tab {
        font-size: 0.7rem;
        padding: 8px 12px;
    }
    
    .admin-user {
        font-size: 0.75rem;
    }
    
    .time-slots-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .admin-card-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .admin-dashboard {
        padding: 1rem 12px;
    }

    .bookings-table th,
    .bookings-table td {
        padding: 4px 6px;
        font-size: 0.7rem;
    }

    .bookings-table .btn {
        font-size: 0.6rem;
        padding: 2px 6px;
    }
    
    .date-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .date-item .date-actions {
        width: 100%;
        justify-content: flex-end;
    }
}