.absence-page {
    background: transparent;
    box-shadow: none;
    padding: 0;
}

.absence-card {
    max-width: 1600px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 1.5rem;
}

/* ---- Header ---- */

.absence-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 0.75rem;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.absence-heading {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.absence-icon {
    width: 44px;
    height: 44px;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-light));
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.absence-title {
    color: var(--primary);
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
}

.absence-subtitle,
.section-text {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ---- Sections ---- */

.form-section {
    background: #f8fbff;
    border: 1px solid #dbeafe;
    border-radius: var(--radius-lg);
    padding: 0.75rem;
}

.section-heading {
    margin-bottom: 0.5rem;
}

.section-title {
    color: var(--primary);
    font-size: 0.88rem;
    font-weight: 700;
    margin: 0 0 0.15rem;
}

/* ---- Fields ---- */

.form-label {
    color: var(--text-main);
    font-weight: 600;
    margin-bottom: 0.45rem;
    font-size: 0.88rem;
}

.form-custom {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.7rem 0.9rem;
    font-size: 0.9rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-custom:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 0.2rem rgba(15, 76, 129, 0.12);
    outline: none;
}

select.form-custom {
    padding-right: 2.5rem;
}

/* ---- Period rows ---- */

.periods-list {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.period-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.3rem 0.6rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.period-row.is-selected {
    border-color: var(--primary-light);
    background: var(--bg-blue);
    box-shadow: 0 0 0 3px rgba(15, 76, 129, 0.06);
}

.period-row-check {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    cursor: pointer;
    flex-shrink: 0;
    margin: 0;
}

.period-row-check .form-check-input {
    float: none;
    flex-shrink: 0;
    margin: 0;
    cursor: pointer;
    accent-color: var(--primary);
}

.period-badge {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
    padding: 0.18rem 0.55rem;
    white-space: nowrap;
}

.period-time {
    color: var(--primary-dark);
    font-size: 0.88rem;
    font-weight: 600;
    white-space: nowrap;
}

.period-row-upload {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
    flex: 1;
    justify-content: flex-end;
    min-width: 0;
}

.period-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.65rem;
    border: 1px solid var(--primary-light);
    border-radius: 999px;
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    background: #fff;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    white-space: nowrap;
    margin-bottom: 0;
    user-select: none;
}

.period-upload-btn:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.period-row .uploaded-files {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    align-items: center;
}

.file-badge {
    background: var(--bg-blue);
    color: var(--primary-dark);
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    padding: 0.18rem 0.55rem;
    font-size: 0.75rem;
    font-weight: 700;
}

/* ---- Side blocks (col 3) ---- */

.side-block {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 0.75rem;
}

/* ---- Justificante compact ---- */

.justificante-field {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.8rem;
    border: 1.5px dashed #cbd5e1;
    border-radius: var(--radius-md);
    background: #f8fafc;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    width: 100%;
    margin-bottom: 0;
}

.justificante-field:hover {
    border-color: var(--primary-light);
    background: #eff6ff;
}

.justificante-field i {
    color: var(--primary);
    font-size: 1.15rem;
    flex-shrink: 0;
}

.justificante-field span {
    flex: 1;
    font-size: 0.83rem;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.justificante-field small {
    color: var(--text-muted);
    font-size: 0.75rem;
    flex-shrink: 0;
    white-space: nowrap;
}

/* ---- Summary ---- */

.summary-list {
    display: grid;
    gap: 0.3rem;
}

.summary-list div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.3rem 0.6rem;
    border-radius: var(--radius-md);
    background: #f8fbff;
    border: 1px solid #dbeafe;
}

.summary-list span {
    color: var(--text-muted);
    font-size: 0.82rem;
}

.summary-list strong {
    color: var(--primary-dark);
    font-size: 0.9rem;
}

/* ---- Empty state ---- */

.empty-periods {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #fff;
    border: 1px dashed #cbd5e1;
    border-radius: var(--radius-md);
    padding: 1rem;
    color: var(--text-muted);
}

.empty-periods i {
    color: var(--primary);
    font-size: 1.3rem;
}

/* ---- Form footer ---- */

.absence-form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

/* ---- Button ---- */

.btn-custom {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #fff !important;
    font-weight: 700;
}

.btn-custom:hover {
    background: var(--primary-dark) !important;
    border-color: var(--primary-dark) !important;
    color: #fff !important;
}

/* ---- Compact form rows ---- */

#absence-form .row.g-3 {
    --bs-gutter-y: 0.5rem;
}

/* ---- Responsive ---- */

@media (max-width: 768px) {
    .absence-card {
        padding: 1.75rem;
    }

    .absence-title {
        font-size: 1.3rem;
    }

    .absence-icon {
        width: 48px;
        height: 48px;
        font-size: 1.3rem;
    }
}
