.task-library-page { background: radial-gradient(circle at 8% 8%, #fff0f3 0, transparent 32%), radial-gradient(circle at 94% 25%, #fff7df 0, transparent 28%), #f7f8fc; }
.task-library-main { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 36px 0 120px; }
.task-hero { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 24px; min-height: 250px; overflow: hidden; padding: 38px clamp(24px, 5vw, 58px); border-radius: 30px; color: #fff; background: linear-gradient(120deg, #9f1737 0%, #d33050 48%, #f06b4c 100%); box-shadow: 0 23px 55px #b7213d3d; }
.task-hero::before, .task-hero::after { content: ""; position: absolute; border-radius: 50%; background: #fff; opacity: .1; pointer-events: none; }
.task-hero::before { width: 280px; height: 280px; right: 13%; top: -190px; }
.task-hero::after { width: 150px; height: 150px; right: -30px; bottom: -90px; }
.task-hero-content, .task-hero-icon { position: relative; z-index: 1; }
.task-kicker { display: inline-flex; align-items: center; gap: 7px; color: #ffe0e6; font-size: .76rem; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
.task-hero h1 { margin: 14px 0 9px; color: #fff; font: 800 clamp(2rem, 5vw, 4rem)/1 'Manrope', sans-serif; letter-spacing: -.055em; }
.task-hero p { max-width: 610px; margin: 0; color: #fff3f5; font-size: 1.04rem; line-height: 1.65; }
.task-welcome { display: inline-flex; align-items: center; gap: 7px; margin-top: 19px; padding: 8px 12px; border: 1px solid #ffffff40; border-radius: 99px; background: #ffffff1f; font-size: .78rem; font-weight: 700; }
.task-hero-icon { display: grid; place-items: center; width: 142px; height: 142px; flex: 0 0 auto; border: 1px solid #ffffff42; border-radius: 38px; background: #ffffff1a; box-shadow: inset 0 0 35px #ffffff12; transform: rotate(5deg); }
.task-hero-icon i { font-size: 4.1rem; }
.task-hero-icon span { margin-top: -20px; font: 800 .9rem 'Manrope', sans-serif; }
.task-controls { display: grid; gap: 13px; margin: 22px 0 34px; padding: 18px; border: 1px solid #eadfe3; border-radius: 20px; background: #fff; box-shadow: 0 12px 30px #3b26310e; }
.task-search label { display: flex; align-items: center; gap: 10px; max-width: 700px; margin: 0; padding: 0 12px; border: 1px solid #dfe4ec; border-radius: 13px; color: #8b96a8; }
.task-search label:focus-within { border-color: #d33050; box-shadow: 0 0 0 4px #d3305014; }
.task-search input { width: 100%; border: 0; outline: 0; padding: 12px 0; color: #182338; font: inherit; }
.task-search button { border: 0; border-radius: 9px; padding: 8px 12px; color: #fff; background: #c51f3e; font-weight: 800; cursor: pointer; }
.task-filter-group, .task-category-group { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.task-filter, .task-category { border: 1px solid #e1e6ee; border-radius: 99px; padding: 8px 13px; color: #65738a; background: #fbfcfe; font-size: .78rem; font-weight: 800; text-decoration: none; }
.task-filter:hover, .task-category:hover, .task-filter.active, .task-category.active { border-color: #d33050; color: #b3122d; background: #fff0f3; text-decoration: none; }
.task-category i { margin-right: 4px; }
.task-results-head { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.task-results-head .task-kicker { color: #c51f3e; }
.task-results-head h2 { margin: 8px 0 0; color: #182338; font: 800 1.45rem 'Manrope', sans-serif; }
.task-results-head > strong { color: #8c6070; font-size: .82rem; }
.task-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 17px; }
.task-card { display: flex; flex-direction: column; min-width: 0; overflow: hidden; border: 1px solid #eadfe3; border-radius: 20px; background: #fff; box-shadow: 0 12px 30px #3b26310c; transition: transform .22s ease, box-shadow .22s ease; }
.task-card:hover { transform: translateY(-5px); box-shadow: 0 20px 38px #3b26311b; }
.task-card-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 14px 15px 0; }
.task-type { display: inline-flex; border-radius: 99px; padding: 6px 9px; font-size: .68rem; font-weight: 900; }
.task-type-tarea { color: #9b3d00; background: #fff1d5; }
.task-type-comunicado { color: #ad173a; background: #ffe7ec; }
.task-type-material { color: #126c58; background: #e2f7ef; }
.task-type-otro { color: #5b43a2; background: #eee9ff; }
.task-card-top time { color: #9aa4b3; font-size: .7rem; }
.task-library-page .fas, .task-library-page .far, .task-library-page .fab { display: inline-block; width: 1em; min-width: 1em; line-height: 1; text-align: center; }
.task-file-preview, .task-image-preview { height: 235px; margin: 14px 15px 0; overflow: hidden; border-radius: 15px; }
.task-file-preview { display: grid; place-items: center; align-content: center; gap: 7px; color: #fff; background: linear-gradient(135deg, #c51f3e, #ef6c50); }
.task-file-preview i { font-size: 3.2rem; }
.task-file-preview span { font-size: .74rem; font-weight: 800; }
.task-pdf-preview { position: relative; display: flex; align-items: center; justify-content: center; height: 290px; padding: 30px 14px 12px; color: #fff; background: linear-gradient(135deg, #b31338, #f06a50); }
.task-pdf-preview canvas { display: none; width: auto; height: auto; max-width: 100%; max-height: 100%; box-sizing: border-box; object-fit: contain; background: #fff; box-shadow: 0 8px 18px #24324a2b; }
.task-pdf-preview.is-ready { background: #e9edf4; }
.task-pdf-preview.is-ready canvas { display: block; }
.task-pdf-fallback { display: grid; place-items: center; align-content: center; gap: 7px; }
.task-pdf-fallback i { font-size: 3.2rem; }
.task-pdf-preview.is-ready .task-pdf-fallback { display: none; }
.task-pdf-loading { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); padding: 5px 8px; border-radius: 99px; color: #fff; background: #111827b8; font-size: .66rem; font-weight: 800; white-space: nowrap; }
.task-pdf-loading i { margin-right: 4px; font-size: .68rem; }
.task-pdf-preview.is-ready .task-pdf-loading { display: none; }
.task-pdf-preview.is-fallback .task-pdf-loading { background: #7d1532; }
.task-pdf-badge { position: absolute; top: 9px; left: 9px; padding: 5px 8px; border-radius: 99px; color: #8d1735; background: #fff; box-shadow: 0 4px 10px #36101d25; font-size: .63rem !important; font-weight: 900 !important; }
.task-pdf-badge i { margin-right: 3px; color: #c51f3e; font-size: .64rem; }
.task-pdf-preview.is-ready .task-pdf-badge { color: #6334c5; }
.task-pdf-preview.is-ready .task-pdf-badge i { color: #7c3aed; }
.task-image-preview { background: #f4f5f8; }
.task-image-preview img { width: 100%; height: 100%; object-fit: cover; }
.task-card-body { flex: 1; padding: 16px 15px 12px; }
.task-card-body h3 { margin: 0 0 7px; color: #182338; font: 800 1.03rem/1.25 'Manrope', sans-serif; }
.task-card-body p { min-height: 42px; margin: 0 0 11px; color: #68758a; font-size: .81rem; line-height: 1.5; }
.task-card-body small { display: block; overflow: hidden; color: #9a6876; font-size: .7rem; text-overflow: ellipsis; white-space: nowrap; }
.task-card-body small i { margin-right: 4px; }
.task-open { display: flex; align-items: center; justify-content: center; gap: 7px; margin: 0 15px 15px; border-radius: 11px; padding: 11px; color: #fff; background: linear-gradient(135deg, #c51f3e, #d93455); font-size: .8rem; font-weight: 900; text-decoration: none; }
.task-open:hover { color: #fff; background: #a91635; text-decoration: none; }
.task-empty { display: grid; place-items: center; gap: 8px; min-height: 260px; padding: 30px; border: 1px dashed #e6bfc8; border-radius: 24px; background: #fff; color: #7e899a; text-align: center; }
.task-empty i { color: #d33050; font-size: 2.6rem; }
.task-empty h2 { margin: 8px 0 0; color: #29364d; font: 800 1.3rem 'Manrope', sans-serif; }
.task-empty p { margin: 0; }
.task-setup { border-style: solid; }
.task-completion { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin: 0 15px 15px; padding-top: 12px; border-top: 1px solid #f0e3e6; }
.task-completion button { display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 10px; padding: 9px 11px; color: #fff; background: linear-gradient(135deg, #c51f3e, #d93455); font-size: .73rem; font-weight: 900; cursor: pointer; }
.task-completion button:hover { background: #a91635; }
.task-completion button:disabled { cursor: default; opacity: .9; }
.task-completion button.is-done, .task-completion.is-complete button { color: #126c58; background: #e2f7ef; }
.task-completion small { color: #8c6070; font-size: .68rem; }
.task-submission { margin: 0 15px 15px; padding: 12px; border-top: 1px solid #f0e3e6; border-radius: 13px; background: #fff8f9; }
.task-submission-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 9px; color: #9f1737; font-size: .78rem; }
.task-submission-head strong i { margin-right: 4px; }
.task-score { display: inline-flex; align-items: center; gap: 4px; padding: 5px 8px; border-radius: 99px; color: #8a5600; background: #fff0c9; font-weight: 900; }
.task-score i { color: #f59e0b; }
.task-submission-status { color: #8c6070; font-size: .68rem; font-weight: 700; }
.task-submission-photo { position: relative; display: block; height: 130px; overflow: hidden; margin-bottom: 9px; border-radius: 11px; background: #f0e7ea; }
.task-submission-photo img { width: 100%; height: 100%; object-fit: cover; }
.task-submission-photo span { position: absolute; right: 7px; bottom: 7px; padding: 5px 7px; border-radius: 8px; color: #fff; background: #9f1737d9; font-size: .68rem; font-weight: 800; }
.task-feedback { margin: 0 0 9px; padding: 8px 9px; border-radius: 9px; color: #5b4360; background: #f4efff; font-size: .72rem; line-height: 1.4; }
.task-feedback i { margin-right: 4px; color: #7c3aed; }
.task-submission-form { display: grid; gap: 7px; }
.task-submission-form label { display: grid; gap: 5px; margin: 0; color: #8c6070; font-size: .71rem; font-weight: 800; }
.task-submission-form input[type="file"], .task-submission-form input[type="text"] { width: 100%; min-width: 0; border: 1px solid #e5cbd2; border-radius: 9px; padding: 8px; color: #6d4050; background: #fff; font: inherit; font-size: .72rem; }
.task-submission-form input[type="file"] { padding: 6px; }
.task-submission-form button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 9px; padding: 9px 10px; color: #fff; background: linear-gradient(135deg, #c51f3e, #d93455); font-size: .74rem; font-weight: 900; cursor: pointer; }
.task-submission-form button:disabled { cursor: wait; opacity: .65; }
.task-photo-tools, .task-submission-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.task-camera-button, .task-file-picker, .task-delete-submission, .task-note-form button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid #e5cbd2; border-radius: 9px; padding: 8px 10px; color: #9f1737; background: #fff; font: inherit; font-size: .72rem; font-weight: 900; cursor: pointer; }
.task-camera-button { color: #fff; border-color: #c51f3e; background: linear-gradient(135deg, #c51f3e, #d93455); }
.task-file-picker { flex: 1 1 150px; min-width: 0; }
.task-file-picker input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.task-photo-preview { display: flex; align-items: center; gap: 8px; padding: 6px; border: 1px solid #f0d8df; border-radius: 9px; background: #fff; color: #8c6070; font-size: .68rem; overflow: hidden; }
.task-photo-preview img { width: 44px; height: 44px; flex: 0 0 auto; object-fit: cover; border-radius: 7px; }
.task-photo-preview span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-note-form { display: grid; gap: 7px; margin: 0 0 9px; padding: 8px; border-radius: 9px; background: #f9f5ff; }
.task-note-form label { display: grid; gap: 5px; color: #6e5575; font-size: .69rem; font-weight: 800; }
.task-note-form input { width: 100%; border: 1px solid #e0d5ee; border-radius: 8px; padding: 8px; color: #4e3f5e; background: #fff; font: inherit; font-size: .72rem; }
.task-note-form button { justify-self: start; color: #5f3ec4; border-color: #ded5ff; background: #f5f0ff; }
.task-note-form small { color: #5f3ec4; font-size: .66rem; }
.task-delete-submission { color: #b3122d; border-color: #f0c4cd; background: #fff0f3; }
.task-camera-modal { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 14px; background: #161323cc; }
.task-camera-modal[hidden] { display: none; }
.task-camera-dialog { width: min(520px, 100%); max-height: calc(100vh - 28px); overflow: auto; padding: 16px; border-radius: 20px; background: #fff; box-shadow: 0 24px 70px #0006; }
.task-camera-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.task-camera-head h2 { margin: 5px 0 0; color: #182338; font: 800 1.25rem 'Manrope', sans-serif; }
.task-camera-close { width: 36px; height: 36px; border: 0; border-radius: 10px; color: #65738a; background: #f0f2f6; cursor: pointer; }
.task-camera-viewport { position: relative; display: grid; min-height: 300px; overflow: hidden; border-radius: 15px; background: #101522; }
.task-camera-viewport video { width: 100%; height: min(62vh, 480px); object-fit: cover; }
.task-page-guide { position: absolute; inset: 11% 13%; display: grid; place-items: end center; border: 2px solid #ffffffb8; border-radius: 12px; box-shadow: 0 0 0 999px #0003; pointer-events: none; }
.task-page-guide span { margin-bottom: 10px; padding: 5px 8px; border-radius: 99px; color: #fff; background: #111827aa; font-size: .68rem; font-weight: 800; }
.task-camera-detection { position: absolute; top: 10px; left: 10px; padding: 6px 9px; border-radius: 99px; color: #fff; background: #111827c7; font-size: .68rem; font-weight: 900; }
.task-camera-detection.is-ready { color: #063b2a; background: #a7f3d0; }
.task-camera-status { margin: 10px 0; color: #65738a; font-size: .76rem; line-height: 1.45; }
.task-camera-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.task-camera-capture, .task-camera-secondary { flex: 1 1 150px; border: 0; border-radius: 10px; padding: 11px; font: inherit; font-size: .78rem; font-weight: 900; cursor: pointer; }
.task-camera-capture { color: #fff; background: linear-gradient(135deg, #c51f3e, #d93455); }
.task-camera-secondary { color: #526079; background: #eef1f6; }
body.task-camera-open { overflow: hidden; }
@media (max-width: 991.98px) { .task-grid { grid-template-columns: minmax(0, 1fr); } }
@media (min-width: 992px) and (max-width: 1100px) { .task-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) {
    .task-library-page .task-library-main { width: 100%; max-width: none; padding: 20px 12px 120px; }
    .task-hero { min-height: 0; padding: 27px 22px; border-radius: 23px; }
    .task-hero-icon { display: none; }
    .task-hero h1 { font-size: 2.25rem; }
    .task-hero p { font-size: .92rem; }
    .task-file-preview, .task-image-preview { height: 245px; }
    .task-pdf-preview { height: 300px; }
    .task-controls { padding: 13px; }
    .task-search button { padding: 8px 9px; }
    .task-grid, .task-card { width: 100%; min-width: 0; }
    .task-grid { grid-template-columns: minmax(0, 1fr); }
    .task-results-head { align-items: start; flex-direction: column; }
}

/* Fecha de publicación visible en cada tarjeta. */
.task-card-top time.task-publish-date {
    display: grid;
    justify-items: end;
    gap: 2px;
    min-width: 96px;
    padding: 7px 9px;
    border: 1px solid #f2d7df;
    border-radius: 12px;
    color: #9f1737;
    background: #fff7f9;
}

.task-publish-date small {
    color: #b46b7a;
    font-size: .58rem;
    font-weight: 900;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.task-publish-date strong {
    color: #9f1737;
    font-size: .84rem;
    line-height: 1.05;
}

.task-publish-date em {
    color: #b46b7a;
    font-size: .63rem;
    font-style: normal;
}

@media (max-width: 420px) {
    .task-card-top {
        align-items: flex-start;
    }

    .task-card-top time.task-publish-date {
        min-width: 88px;
        padding-inline: 7px;
    }

    .task-publish-date strong {
        font-size: .78rem;
    }
}
