/* CONTENEDOR PRINCIPAL */
#cs-dashboard {
    max-width: 1200px;
    margin: 30px auto;
    padding: 10px 20px 40px;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Inter", sans-serif;
    color: #111827;
}

/* CABECERA SEMANA */
.cs-week-header {
    margin-bottom: 20px;
}

.cs-week-title {
    margin: 0 0 6px;
    font-size: 26px;
    font-weight: 700;
    color: #0f172a;
}

.cs-week-progress {
    max-width: 420px;
}

.cs-progress-bar {
    width: 100%;
    height: 14px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
}

.cs-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #22c55e, #16a34a);
    width: 0%;
    transition: width .35s ease;
}

.cs-progress-label {
    margin-top: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
}

/* GRID DE DÍAS */
.cs-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 18px;
}

/* TARJETA DÍA */
.cs-day-card {
    background: #f9fafb;
    border-radius: 18px;
    box-shadow: 0 4px 10px rgba(15,23,42,0.06);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 230px;
}

.cs-day-card:hover {
    box-shadow: 0 7px 18px rgba(15,23,42,0.12);
    transform: translateY(-2px);
    transition: all .15s ease-out;
}

/* CABECERA AZUL DÍA */
.cs-day-headerbar {
    background: #2563eb;
    color: #f9fafb;
    padding: 10px 14px;
    font-weight: 700;
    font-size: 17px;
}

/* INTERIOR TARJETA */
.cs-day-inner {
    padding: 10px 12px 6px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cs-day-footer {
    padding: 8px 14px 12px;
    font-size: 13px;
    font-weight: 500;
    color: #0f766e;
}

/* CAJAS GENERALES */
.cs-box {
    border-radius: 12px;
    padding: 8px 10px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    font-size: 13px;
}

.cs-box-title {
    font-weight: 600;
    margin-bottom: 4px;
}

/* TIPOS DE CAJA */
.cs-box-assign {
    background: #ffffff;
}

.cs-box-study {
    background: #dcfce7;
    border-color: #bbf7d0;
}

.cs-box-screen {
    background: #fee2e2;
    border-color: #fecaca;
}

.cs-box-morning {
    background: #fef9c3;
    border-color: #fef08a;
}

.cs-box-afternoon {
    background: #f5f3ff;
    border-color: #ddd6fe;
}

/* LÍNEAS DE TAREA */
.cs-task-row {
    display: flex;
    align-items: center;
    margin-top: 3px;
    font-size: 13px;
}

.cs-task-row--festive {
    padding-left: 2px;
}

.cs-task-check {
    margin-right: 6px;
}

.cs-task-label {
    flex: 1;
}

.cs-task-empty {
    font-style: italic;
    font-size: 12px;
    color: #6b7280;
}

.cs-box-text {
    font-size: 13px;
}

/* TARJETAS FESTIVOS (ligero matiz de color) */
.cs-day-card--festivo .cs-day-headerbar {
    background: #eab308;
}

/* BLOQUE FIN DE SEMANA */
.cs-weekend-box {
    margin-top: 26px;
    display: flex;
    justify-content: center;
}

.cs-weekend-inner {
    max-width: 500px;
    width: 100%;
    padding: 16px 18px 12px;
    border-radius: 16px;
    background: #f9fafb;
    box-shadow: 0 4px 12px rgba(15,23,42,0.10);
    text-align: left;
    font-size: 14px;
}

.cs-weekend-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    color: #166534;
    margin-bottom: 10px;
}

.cs-weekend-icon {
    font-size: 18px;
}

.cs-weekend-line {
    margin: 2px 0;
}

.cs-weekend-footer {
    margin-top: 10px;
    font-size: 13px;
    font-weight: 500;
    color: #0f172a;
}

/* UTILIDADES */
.hidden {
    display: none !important;
}

.cs-day-actions {
    margin-top:8px;
}
.cs-copy-day {
    background:#21759b;
    color:white;
}
.cs-card {
    background: #fff;
    border: 1px solid #ccd0d4;
    padding: 15px;
    margin-bottom: 20px;
}

.cs-card h3 {
    margin-top: 0;
}


#cs-week-day-editor.cs-loading {
    opacity: .6;
    pointer-events: none;
}
.cs-festive-field input[type="number"],
.cs-festive-field input[type="text"] {
    max-width: 120px !important;
}

/* ===========================
   CHECKBOXES EN MODO LECTURA
   =========================== */

.cs-task-check:disabled {
    opacity: 1;                 /* evita que se vea “apagado” */
    cursor: default;
}

/* Checkbox desmarcado en lectura */
.cs-task-check:disabled:not(:checked) {
    accent-color: #9ca3af;      /* gris visible */
}

/* Checkbox marcado en lectura */
.cs-task-check:disabled:checked {
    accent-color: #16a34a;      /* verde consistente con el dashboard */
}

/* ===========================
   MOBILE HEADER FIX (iPhone)
   =========================== */
@media (max-width: 480px) {

    /* Contenedor navegación semana */
    .cs-week-nav {
        gap: 10px;
    }

    /* Fila de botones + título */
    .cs-week-nav > div {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }

    /* Título semana: UNA sola línea clara */
    .cs-week-title {
        font-size: 22px;
        line-height: 1.2;
        text-align: center;
        white-space: normal;
    }

    /* Forzar formato fecha compacto */
    .cs-week-title br {
        display: none;
    }

    /* Botones semana */
    #cs-week-prev,
    #cs-week-next {
        width: 100%;
        max-width: 260px;
        font-size: 14px;
        padding: 8px 12px;
    }

    /* Controles edición */
    #cs-edit-controls {
        margin-top: 6px;
    }

    #cs-edit-controls button {
        width: 100%;
        max-width: 260px;
        font-size: 14px;
    }

    /* Barra progreso */
    .cs-week-progress {
        margin-top: 10px;
    }
}
/* ===========================
   FIX OVERFLOW HORIZONTAL MOBILE
   =========================== */
@media (max-width: 480px) {

    /* Nunca permitir scroll horizontal */
    html, body {
        overflow-x: hidden;
    }

    /* El grid no puede desbordar */
    .cs-overview {
        width: 100%;
        max-width: 100%;
    }

    /* Tarjetas de día */
    .cs-day-card {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Contenido interno */
    .cs-day-inner,
    .cs-day-footer {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Cajas internas */
    .cs-box {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Textos largos no rompen layout */
    .cs-task-label,
    .cs-box-text {
        word-break: break-word;
        overflow-wrap: break-word;
    }
}
/* ===========================
   MOBILE GRID FIX (CRÍTICO)
   =========================== */
@media (max-width: 480px) {

    /* Forzar 1 columna sin mínimos peligrosos */
    .cs-overview {
        grid-template-columns: 1fr !important;
    }
}
@media (max-width: 480px) {

    /* Reducir padding lateral del dashboard */
    #cs-dashboard {
        padding-left: 10px;
        padding-right: 10px;
    }
}
@media (max-width: 480px) {

    .cs-day-card,
    .cs-box,
    .cs-day-inner {
        max-width: 100%;
        box-sizing: border-box;
    }
}
@media (max-width: 480px) {

    /* Compactar cabecera */
    .cs-week-header {
        margin-bottom: 12px;
    }

    .cs-week-title {
        font-size: 20px;
        margin-bottom: 4px;
    }

    #cs-edit-controls button,
    #cs-week-prev,
    #cs-week-next {
        padding: 6px 10px;
        font-size: 13px;
    }

    .cs-week-progress {
        margin-top: 6px;
    }
}
/* ===========================
   SEMANA ACTIVA - DESTACAR EN MÓVIL
   =========================== */
@media (max-width: 480px) {

    #cs-week-active-label {
        font-size: 16px;          /* antes ~13px */
        padding: 6px 16px;        /* más “badge” */
        border-radius: 999px;     /* píldora */
        font-weight: 700;
        letter-spacing: 0.2px;
        margin-bottom: 4px;
    }
}
/* ===========================
   BOTON GUARDAR PARA MENU PENALIZACIONES
   =========================== */
#cs-pen-list tr.updated {
    background-color: #ecfdf5;
}

.cs-box-penalties {
    background: #fff7ed;
    border-color: #fed7aa;
}

.cs-pen-row {
    font-size: 13px;
    margin-top: 4px;
    color: #7c2d12;
}

