:root {
    --primary-color: #1e3a8a;       /* Azul corporativo oscuro */
    --accent-color: #2563eb;        /* Azul vibrante acciones */
    --range-habil: #bbdefb;         /* Azul medio para rango de días hábiles */
    --range-inabil: #e0e0e0;        /* Gris para rango de fines de semana */
    --color-festivo-bg: #f0d6da;   /* Rojo suave para festivos */
    --color-festivo-text: #c62828;  /* Texto rojo festivo */
    --bg-main: #f1f5f9;
    --text-main: #1e293b;
}

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

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    padding-bottom: 40px;
}

/* ==========================================
   ENCABEZADO SOBRIO Y LIMPIO
   ========================================== */
.main-header {
    background: linear-gradient(135deg, #0b1329 0%, #1e3a8a 50%, #172554 100%);
    color: #ffffff;
    padding: 1.15rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.header-container {
    max-width: 96%;
    width: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

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

.header-flag-box {
    width: 48px;
    height: 34px;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.header-flag-svg {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.header-top-badge {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem !important;
    font-weight: 700 !important;
    color: rgba(255, 255, 255, 0.75) !important;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 0.15rem !important;
    line-height: 1;
}

.header-titles h1 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 !important;
    line-height: 1.15;
    letter-spacing: -0.3px;
}

.header-subtext {
    font-size: 0.82rem;
    color: #cbd5e1;
    margin-top: 0.2rem !important;
    margin-bottom: 0 !important;
    line-height: 1.2;
    font-weight: 400;
}

.header-trust-tag {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 0.5rem 0.85rem;
    border-radius: 8px;
    font-size: 0.78rem;
    color: #e2e8f0;
    font-weight: 500;
    white-space: nowrap;
}

.trust-icon {
    width: 18px;
    height: 18px;
    fill: #38bdf8;
    flex-shrink: 0;
}

/* BARRA FIJA DE HERRAMIENTAS Y CONTADOR */
.sticky-toolbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    padding: 0.65rem 1rem;
    margin-bottom: 1.25rem;
}

.toolbar-container {
    max-width: 96%;
    width: 100%;
    margin: 0 auto;
    padding: 0 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    align-items: center;
    justify-content: space-between;
}

.status-box {
    display: flex;
    flex-direction: column;
}

.contador-label {
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 600;
    margin-bottom: 2px;
}

.contador-valor {
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--accent-color);
    line-height: 1.1;
}

.tools-box {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.input-card {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    background: #ffffff;
    padding: 0.35rem 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-card:focus-within {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.input-card label {
    font-size: 0.68rem;
    font-weight: 700;
    color: #64748b;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

.input-with-icon {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.field-icon {
    width: 18px;
    height: 18px;
    fill: #94a3b8;
    flex-shrink: 0;
}

.custom-input {
    border: none;
    outline: none;
    background: transparent;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    color: #334155 !important;
    padding: 2px 0;
}

.number-input {
    width: 65px;
    color: #334155 !important;
}

.actions-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    align-self: flex-end;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.55rem 1.1rem;
    border: none;
    border-radius: 9999px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, box-shadow 0.2s ease;
    user-select: none;
}

.btn-icon {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.btn-primary {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}

.btn-secondary {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
}

.btn-secondary:hover {
    background: #e2e8f0;
    color: #0f172a;
}

/* ==========================================
   GRILLA Y CELDAS DEL CALENDARIO
   ========================================== */
.main-container {
    max-width: 96%;
    width: 100%;
    margin: 0 auto;
    padding: 0 0.5rem;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
}

.month-card {
    background: white;
    border-radius: 12px;
    padding: 1.1rem 0.75rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    border: 1px solid #e2e8f0;
    width: 100%;
    scroll-margin-top: 20px;
}

.month-name {
    text-align: center;
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 0.75rem;
    color: var(--primary-color);
}

.days-header, .week-row {
    display: grid;
    grid-template-columns: 2.2rem repeat(7, 1fr);
    text-align: center;
    align-items: center;
    width: 100%;
}

.days-header {
    font-weight: 700;
    font-size: 0.75rem;
    color: #64748b;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 0.4rem;
    margin-bottom: 0.35rem;
}

.week-row {
    margin-bottom: 3px;
    gap: 2px;
}

.week-num {
    font-size: 0.7rem;
    color: #94a3b8;
    font-weight: 600;
}

/* CASILLAS INDIVIDUALES (ESTABILIDAD ABSOLUTA) */
.day {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    user-select: none;
    margin: 0 auto;
    box-sizing: border-border-box;
    transition: background-color 0.15s ease, color 0.15s ease; /* Transición suave de color únicamente */
}

/* Hover limpio: Solo cambia color de fondo, NO tamaño ni margen */
.day:hover {
    background-color: #2563eb !important;
    color: #ffffff !important;
}

/* Sábados */
.day.weekend {
    background-color: #f1f5f9;
    color: #94a3b8;
}

/* Domingos */
.day.weekend.sunday {
    background-color: #cbd5e1 !important;
    color: #334155 !important;
    font-weight: 600;
}

/* Festivos fuera de rango */
.day.festivo {
    background-color: var(--color-festivo-bg) !important;
    color: var(--color-festivo-text) !important;
    font-weight: bold;
    border-radius: 50% !important;
}

/* Días hábiles dentro de rango */
.day.in-range {
    background-color: var(--range-habil) !important;
    color: #0f172a !important;
    border-radius: 4px !important;
}

/* Días no hábiles (Sá-Do) dentro de rango */
.day.in-range.weekend {
    background-color: var(--range-inabil) !important;
    color: #64748b !important;
}

/* Festivos dentro de rango */
.day.in-range.festivo {
    background-color: var(--color-festivo-bg) !important;
    color: var(--color-festivo-text) !important;
    border-radius: 50% !important;
    font-weight: bold;
}

/* Puntos de Inicio y Fin */
.day.selected-start, 
.day.selected-end,
.day.selected-click-origin {
    background-color: var(--accent-color) !important;
    color: #ffffff !important;
    font-weight: bold;
    border-radius: 50% !important;
}

/* DÍA ACTUAL (HOY) */
.day.today {
    background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    border-radius: 6px !important;
}

/* ==========================================
   SECCIÓN SEO Y TABLA DE FESTIVOS
   ========================================== */
.seo-festivos-section {
    max-width: 96%;
    width: 100%;
    margin: 3rem auto 2rem auto;
    padding: 0 0.5rem;
}

.seo-card-container {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.seo-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #41517b;
    margin-bottom: 0.75rem;
}

.seo-text {
    font-size: 0.88rem;
    color: #475569;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.festivos-header-box {
    border-top: 1px solid #e2e8f0;
    padding-top: 1.5rem;
    margin-bottom: 1.25rem;
}

.festivos-subtitle {
    font-size: 1.05rem;
    font-weight: 700;
    color: #41517b;
    letter-spacing: -0.2px;
}

.festivos-table-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(7, auto);
    grid-auto-flow: column;
    gap: 0.75rem 1.25rem;
}

.festivo-row {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    border-radius: 8px;
    font-size: 0.82rem;
}

.festivo-date {
    font-weight: 700;
    color: #496e98;
    background: #eff6ff;
    padding: 3px 8px;
    border-radius: 5px;
    font-size: 0.75rem;
    min-width: 95px;
    text-align: center;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.festivo-name {
    color: #475569;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==========================================
   FOOTER
   ========================================== */
.site-footer {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
    color: #f1f5f9;
    padding: 2.5rem 1rem 1.5rem 1rem;
    margin-top: 3rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-container {
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-col {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.footer-col h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.5rem;
}

.footer-col p {
    font-size: 0.88rem;
    color: #94a3b8;
    line-height: 1.5;
    margin-bottom: 1rem;
    max-width: 480px;
}

.footer-mail {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: #38bdf8;
    font-weight: 600;
    font-size: 0.92rem;
    text-decoration: none;
}

.footer-mail:hover {
    color: #7dd3fc;
    text-decoration: underline;
}

.footer-mail svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.footer-bottom {
    max-width: 600px;
    margin: 1.25rem auto 0 auto;
    text-align: center;
    font-size: 0.78rem;
    color: #64748b;
}

/* ==========================================
   REGLAS RESPONSIVAS (TABLETS Y SMARTPHONES)
   ========================================== */
@media (max-width: 1200px) {
    .calendar-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (max-width: 1024px) {
    .festivos-table-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(10, auto);
    }
}

@media (max-width: 900px) {
    .header-trust-tag {
        display: none;
    }
    .calendar-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem;
    }
}

@media (max-width: 640px) {
    body {
        padding-bottom: 220px !important;
    }

    .main-header {
        padding: 0.75rem 0.5rem;
    }

    .header-brand {
        gap: 0.65rem;
    }

    .header-flag-box {
        width: 36px;
        height: 26px;
        border-radius: 3px;
    }

    .header-subtext {
        display: none !important;
    }

    .header-top-badge {
        font-size: 0.75rem !important;
        margin-bottom: 0.1rem;
    }

    .header-titles h1 {
        font-size: 1rem;
        line-height: 1.2;
    }

    .sticky-toolbar {
        position: fixed !important;
        top: auto !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        padding: 0.6rem 0.75rem !important;
        margin-bottom: 0 !important;
        box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.12) !important;
        border-top: 1px solid #e2e8f0;
        background: #ffffff !important;
        z-index: 2000 !important;
    }

    .toolbar-container { 
        flex-direction: column; 
        align-items: stretch; 
        gap: 0.4rem;
    }

    .status-box {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .tools-box { 
        flex-direction: column; 
        align-items: stretch; 
        gap: 0.35rem;
    }

    .input-card {
        width: 100%;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 0.35rem 0.65rem;
    }

    .actions-group { 
        width: 100%; 
        margin-top: 0.15rem; 
        gap: 0.4rem;
        display: flex;
        flex-direction: row-reverse !important;
    }

    .btn { 
        flex: 1; 
        padding: 0.5rem;
        font-size: 0.85rem;
    }

    .calendar-grid { 
        grid-template-columns: 1fr !important; 
    }

    .month-card { 
        padding: 0.75rem 0.5rem; 
    }

    .seo-card-container {
        padding: 1.25rem 1rem;
    }

    .festivos-table-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        grid-auto-flow: row;
        gap: 0.5rem;
    }

    .site-footer {
        padding-bottom: 6.5rem;
    }
}


/* Mantiene la lectura estructurada para Google sin mostrar el menú en pantalla */
.main-nav {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}




/* Estilo general de las celdas del calendario */
.day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s, color 0.2s;
    user-select: none;
}

/* Fines de semana (Sábados y Domingos) */
.day.weekend {
    background-color: #f8f9fa;
    color: #6c757d;
}

/* Días Festivos oficiales */
.day.festivo {
    background-color: #ffe3e3; /* Rojo suave */
    color: #c92a2a;
    font-weight: bold;
}

/* Semana Santa (Días inhábiles judiciales Lu, Ma, Mi) */
.day.semana-santa {
    background-color: #fff3bf; /* Amarillo suave */
    color: #f08c00;
    font-weight: bold;
}






