﻿:root {
    --cal-primary: #004aad;
    --cal-secondary: #0099cc;
    --cal-bg: #f8f9fa;
    --cal-border: #e2e8f0;
    --cal-text: #2d3748;
    --status-open: #48bb78;
    --status-warning: #ecc94b;
    --status-urgent: #f56565;
    --status-soldout: #a0aec0;
}

/* 1. HERO */
.calendario-hero {
    position: relative;
    height: 340px;
    display: flex;
    align-items: center;
    overflow: hidden;
    background-color: #eee;
}

.hero-bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

    .hero-bg-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        opacity: 0.95;
    }

.hero-container {
    position: relative;
    z-index: 2;
    width: 100%;
}

.hero-content-box {
    background-color: #ffffff;
    padding: 2.5rem 3rem;
    max-width: 600px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
    border-left: 6px solid var(--cal-primary);
    border-radius: 0 4px 4px 0;
}

    .hero-content-box h1 {
        color: var(--cal-primary);
        font-size: 2.2rem;
        font-weight: 800;
        margin-bottom: 0.5rem;
        line-height: 1.1;
    }

    .hero-content-box p {
        color: #4a5568;
        margin-bottom: 0;
        font-size: 1.1rem;
    }

/* 2. TOOLBAR ALIGNMENT FIX */
.control-deck {
    background: white;
    padding: 1rem 0;
    border-bottom: 1px solid var(--cal-border);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
    z-index: 100;
}

/* FIX: Cálculo exacto de altura Bootstrap SM */
.search-wrapper {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
    /* ESTA LÍNEA ES LA CLAVE DE LA ALINEACIÓN */
    height: calc(1.5em + 0.5rem + 2px);
    width: 100%;
    transition: all 0.2s;
}

    .search-wrapper:focus-within {
        border-color: #86b7fe;
        box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
    }

    .search-wrapper i {
        color: #6c757d;
        font-size: 0.875rem;
        margin-right: 0.5rem;
    }

.search-input {
    border: none;
    outline: none;
    width: 100%;
    background: transparent;
    color: var(--cal-text);
    padding: 0;
    margin: 0;
}

/* Asegurar que los selects no cambien */
.control-deck .form-select-sm {
    height: calc(1.5em + 0.5rem + 2px);
}

/* Switcher */
.view-switcher {
    background: #edf2f7;
    display: inline-flex;
    padding: 2px;
    border-radius: 4px;
    vertical-align: middle;
    height: calc(1.5em + 0.5rem + 2px); /* Misma altura */
    align-items: center;
}

.btn-icon {
    border: none;
    background: transparent;
    padding: 0 10px;
    height: 100%;
    display: flex;
    align-items: center;
    border-radius: 3px;
    color: #718096;
    transition: all 0.2s;
    cursor: pointer;
    font-size: 1rem;
}

    .btn-icon:hover {
        color: var(--cal-primary);
    }

    .btn-icon.active {
        background: white;
        color: var(--cal-primary);
        box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    }

/* 3. MODAL BUTTONS (Upskilling Blue) */
.btn-submit-modal {
    background-color: var(--cal-primary) !important;
    border-color: var(--cal-primary) !important;
    color: #ffffff !important;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 74, 173, 0.2);
}

    .btn-submit-modal:hover:not(:disabled) {
        background-color: #003380 !important;
        border-color: #003380 !important;
        transform: translateY(-1px);
        box-shadow: 0 6px 12px rgba(0, 74, 173, 0.3);
    }

    .btn-submit-modal:disabled {
        background-color: #a0aec0 !important;
        border-color: #a0aec0 !important;
        opacity: 0.7;
        cursor: not-allowed;
    }

.modal-header-custom {
    border-bottom: 1px solid #f0f0f0;
    background-color: #fff;
}

/* 4. TICKETS */
.month-separator {
    color: var(--cal-primary);
    font-size: 1.2rem;
    font-weight: 700;
    text-transform: uppercase;
    margin: 2.5rem 0 1rem;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0.5rem;
    letter-spacing: 1px;
}

.agenda-ticket {
    display: grid;
    grid-template-columns: 110px 1fr 220px;
    background: white;
    border: 1px solid var(--cal-border);
    border-radius: 8px;
    margin-bottom: 1rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

    .agenda-ticket:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 20px -5px rgba(0,0,0,0.08);
        border-color: #bee3f8;
    }

.status-open {
    border-left: 5px solid var(--status-open);
}

.status-lowstock {
    border-left: 5px solid var(--status-warning);
}

.status-urgent {
    border-left: 5px solid var(--status-urgent);
}

.status-soldout {
    border-left: 5px solid var(--status-soldout);
    background-color: #fafafa;
    opacity: 0.85;
}

.ticket-date {
    background: #f7fafc;
    display: flex;
    justify-content: center;
    align-items: center;
    border-right: 1px solid var(--cal-border);
    padding: 1rem;
}

.date-graphic {
    text-align: center;
    line-height: 1;
    color: var(--cal-primary);
}

    .date-graphic .day {
        font-size: 1.8rem;
        font-weight: 800;
        display: block;
    }

    .date-graphic .divider {
        font-size: 0.9rem;
        color: #cbd5e0;
        display: block;
        margin: -2px 0;
    }

    .date-graphic .month {
        font-size: 0.75rem;
        font-weight: 700;
        text-transform: uppercase;
        margin-top: 5px;
        display: block;
        color: #718096;
    }

.ticket-info {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.badge-cat {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #718096;
    letter-spacing: 0.5px;
}

.ticket-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0.25rem 0 0.5rem;
    line-height: 1.3;
}

    .ticket-title a {
        color: var(--cal-text);
        text-decoration: none;
    }

        .ticket-title a:hover {
            color: var(--cal-primary);
            text-decoration: underline;
        }

.ticket-details {
    font-size: 0.9rem;
    color: #4a5568;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

    .ticket-details i {
        color: var(--cal-secondary);
        margin-right: 4px;
    }

.ticket-action {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
    background: #fff;
    border-left: 1px solid var(--cal-border);
}

.price-display {
    text-align: right;
    margin-bottom: 0.75rem;
}

    .price-display .currency {
        font-size: 0.75rem;
        color: #718096;
        vertical-align: top;
    }

    .price-display .amount {
        font-size: 1.3rem;
        font-weight: 700;
        color: #2d3748;
    }

    .price-display .tax {
        font-size: 0.7rem;
        color: #a0aec0;
        display: block;
    }

.link-detail {
    font-size: 0.8rem;
    color: #718096;
    text-decoration: underline;
    margin-top: 0.5rem;
}

/* 5. CALENDAR GRID */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
    margin-top: 1rem;
}

.cal-header-cell {
    text-align: center;
    font-weight: 600;
    font-size: 0.85rem;
    color: #718096;
    padding: 0.5rem;
    background: #edf2f7;
    border-radius: 4px;
}

.cal-day-cell {
    border: 1px solid var(--cal-border);
    background: white;
    min-height: 110px;
    padding: 6px;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
}

.cal-day-number {
    font-size: 0.85rem;
    font-weight: 700;
    color: #cbd5e0;
    margin-bottom: 6px;
    align-self: flex-end;
}

.cal-event-pill {
    display: block;
    font-size: 0.7rem;
    padding: 3px 6px;
    margin-bottom: 4px;
    border-radius: 3px;
    background: var(--cal-primary);
    color: white;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

    .cal-event-pill:hover {
        background: var(--cal-secondary);
        color: white;
    }

    .cal-event-pill.pill-soldout {
        background: #edf2f7;
        color: #a0aec0;
        text-decoration: line-through;
        border: 1px solid #e2e8f0;
    }

/* RESPONSIVE */
@media (max-width: 991px) {
    .agenda-ticket {
        grid-template-columns: 90px 1fr;
    }

    .ticket-action {
        grid-column: 1 / -1;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        border-left: none;
        border-top: 1px solid var(--cal-border);
        padding: 1rem;
        background: #fafafa;
    }

    .price-display {
        text-align: left;
        margin-bottom: 0;
    }
}

@media (max-width: 576px) {
    .calendario-hero {
        height: auto;
        display: block;
    }

    .hero-content-box {
        margin: 2rem 1rem;
        padding: 1.5rem;
        border-left-width: 4px;
    }

    .agenda-ticket {
        display: block;
    }

    .ticket-date {
        border-right: none;
        border-bottom: 1px solid var(--cal-border);
        flex-direction: row;
        gap: 10px;
        padding: 0.5rem;
    }

    .calendar-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}
