/* ═══════════════════════════════════════════
   CRITERIA MODAL
   ═══════════════════════════════════════════ */

.criteria-modal-card {
    max-width: 520px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ── Barra de peso ── */
.criteria-weight-bar-wrap {
    padding: 0 1.5rem 1rem;
    border-bottom: 1px solid rgba(169, 204, 187, 0.1);
}

.criteria-weight-meta {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #7fb89a;
    margin-bottom: 7px;
}

.criteria-weight-track {
    height: 7px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 5px;
}

.criteria-weight-fill {
    height: 100%;
    width: 0%;
    border-radius: 999px;
    background: linear-gradient(90deg, #3ddc97, #78b095);
    transition: width 300ms cubic-bezier(.4,0,.2,1), background 300ms ease;
}

.criteria-weight-remaining {
    font-size: 11px;
    color: rgba(169, 204, 187, 0.5);
    font-weight: 500;
}

/* ── Lista de criterios ── */
.criteria-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 8px;
    scrollbar-width: thin;
    scrollbar-color: rgba(169, 204, 187, 0.15) transparent;
    min-height: 60px;
    max-height: 240px;
}

.criteria-list:empty::after {
    content: 'Aún no hay criterios. Agrega uno abajo.';
    display: block;
    text-align: center;
    font-size: 12.5px;
    color: rgba(169, 204, 187, 0.35);
    padding: 1rem 0;
    font-style: italic;
}

.criteria-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(169, 204, 187, 0.1);
    transition: background 150ms ease;
}

.criteria-item:hover { background: rgba(255, 255, 255, 0.07); }

.criteria-item-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.criteria-type-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: rgba(61, 220, 151, 0.1);
    border: 1px solid rgba(61, 220, 151, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #3ddc97;
    font-size: 12px;
    flex-shrink: 0;
}

.criteria-item-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.criteria-item-name {
    font-size: 13px;
    font-weight: 600;
    color: #e8efe9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.criteria-item-weight {
    font-size: 11px;
    color: #7fb89a;
    font-weight: 500;
}

.criteria-item-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.criteria-score-input {
    width: 68px;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid rgba(169, 204, 187, 0.18);
    background: rgba(255, 255, 255, 0.06);
    color: #e8efe9;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    outline: none;
    transition: border-color 150ms ease;
}

.criteria-score-input:focus {
    border-color: rgba(61, 220, 151, 0.45);
}

/* Ocultar flechas number input */
.criteria-score-input::-webkit-inner-spin-button,
.criteria-score-input::-webkit-outer-spin-button { -webkit-appearance: none; }
.criteria-score-input { -moz-appearance: textfield; }

.criteria-folder-hint {
    font-size: 11.5px;
    color: rgba(169, 204, 187, 0.5);
    display: flex;
    align-items: center;
    gap: 5px;
}

.criteria-delete-btn {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    border: 1px solid rgba(255, 80, 80, 0.2);
    background: rgba(255, 80, 80, 0.08);
    color: #ff9090;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    transition: background 150ms ease, transform 120ms ease;
}

.criteria-delete-btn:hover {
    background: rgba(255, 80, 80, 0.2);
    transform: scale(1.08);
}

/* ── Formulario agregar criterio ── */
.criteria-add-form {
    padding: 0.75rem 1.5rem 0;
    border-top: 1px solid rgba(169, 204, 187, 0.1);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.criteria-form-row {
    display: flex;
    gap: 10px;
}

/* Reutiliza .field-group del subjects.css */

/* Ocultar flechas en input peso */
.criteria-add-form input[type="number"]::-webkit-inner-spin-button,
.criteria-add-form input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; }
.criteria-add-form input[type="number"] { -moz-appearance: textfield; }

/* ── Toggle tipo ── */
.type-toggle-row {
    display: flex;
    gap: 8px;
}

.type-toggle-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 12px;
    border-radius: 10px;
    border: 1px solid rgba(169, 204, 187, 0.18);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(232, 239, 233, 0.5);
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}

.type-toggle-btn i { font-size: 13px; }

.type-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #e8efe9;
}

.type-toggle-btn.active {
    background: rgba(61, 220, 151, 0.12);
    border-color: rgba(61, 220, 151, 0.4);
    color: #3ddc97;
}

/* Error */
.criteria-form-error {
    font-size: 12px;
    color: #ff9090;
    background: rgba(255, 80, 80, 0.08);
    border: 1px solid rgba(255, 80, 80, 0.18);
    border-radius: 8px;
    padding: 7px 12px;
}

.criteria-form-error.hidden { display: none; }

/* Submit dentro del form */
.criteria-submit-btn {
    width: 100%;
    margin-bottom: 0.25rem;
}

/* Footer del modal de criterios */
.criteria-modal-footer {
    border-top: 1px solid rgba(169, 204, 187, 0.1);
}

/* ═══════════════════════════════════════════
   CATEGORY CARDS (vista de detalle)
   ═══════════════════════════════════════════ */

.category-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(169, 204, 187, 0.12);
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 10px;
    transition: border-color 180ms ease;
}

.category-card:hover {
    border-color: rgba(169, 204, 187, 0.25);
}

.category-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.category-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    flex-shrink: 0;
}

.category-type-badge.single {
    background: rgba(61, 220, 151, 0.1);
    color: #3ddc97;
    border: 1px solid rgba(61, 220, 151, 0.2);
}

.category-type-badge.folder {
    background: rgba(61, 160, 220, 0.1);
    color: #7cc8ff;
    border: 1px solid rgba(61, 160, 220, 0.2);
}

.category-header h3 {
    font-size: 14px;
    font-weight: 700;
    color: #e8efe9;
}

.category-header h3 small {
    font-size: 11px;
    font-weight: 500;
    color: #7fb89a;
    margin-left: 4px;
}

.category-score-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.category-score-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: rgba(232, 239, 233, 0.25);
    letter-spacing: -0.02em;
    line-height: 1;
    transition: color 200ms ease;
}

.category-score-value.has-score {
    color: #3ddc97;
}

.btn-icon-action {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid rgba(169, 204, 187, 0.18);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(169, 204, 187, 0.6);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: background 150ms ease, color 150ms ease, transform 120ms ease;
}

.btn-icon-action:hover {
    background: rgba(61, 220, 151, 0.1);
    color: #3ddc97;
    border-color: rgba(61, 220, 151, 0.3);
    transform: scale(1.08);
}

.grades-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px solid rgba(169, 204, 187, 0.08);
}

.grade-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    transition: background 150ms ease;
}

.grade-row:hover { background: rgba(255, 255, 255, 0.06); }

.grade-title {
    flex: 1;
    font-size: 13px;
    color: rgba(232, 239, 233, 0.75);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.grade-score {
    font-size: 13px;
    font-weight: 700;
    color: #7affc5;
    min-width: 28px;
    text-align: right;
}

/* ── Mobile ── */
@media (max-width: 800px) {
    .criteria-modal-card { max-height: 92vh; }
    .type-toggle-btn { font-size: 11.5px; padding: 8px 8px; }
    .criteria-list { max-height: 180px; }
}