html.el-resource-page .fi-page {
    color: #173246;
}

html.el-resource-page .fi-header-heading {
    color: #173246;
    font-weight: 850;
    letter-spacing: -.02em;
}

html.el-resource-page .fi-header-subheading {
    color: #748894;
}

html.el-resource-page .fi-section,
html.el-resource-page .fi-ta-ctn {
    overflow: hidden;
    border: 1px solid #dfe8ed;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 5px 20px rgba(15, 34, 51, .045);
}

html.el-resource-page .fi-section-header {
    padding: 16px 18px;
    border-bottom: 1px solid #edf2f4;
}

html.el-resource-page .fi-section-header-heading {
    color: #173246;
    font-weight: 850;
}

html.el-resource-page .fi-section-header-description {
    color: #7a8d98;
}

html.el-resource-page .fi-section-content {
    padding: 18px;
}

html.el-resource-page .fi-ta-header {
    border-bottom-color: #edf2f4;
}

html.el-resource-page .fi-btn-color-primary {
    background: #00aeb5;
}

html.el-resource-page .fi-tabs {
    padding: 5px;
    border: 1px solid #dfe8ed;
    border-radius: 14px;
    background: #fff;
}

html.el-resource-page .fi-tabs-item-active {
    color: #007f86;
    background: #e8f8f8;
}

/* Modale zasobów: jedna szerokość, pełny formularz, bez zagnieżdżonej karty. */
.el-resource-modal {
    width: min(680px, calc(100vw - 32px)) !important;
    max-width: min(680px, calc(100vw - 32px)) !important;
    max-height: calc(100dvh - 32px) !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    border-radius: 18px !important;
}

.el-resource-modal--availability {
    width: min(620px, calc(100vw - 32px)) !important;
    max-width: min(620px, calc(100vw - 32px)) !important;
}

.el-resource-modal .fi-modal-header {
    padding: 18px 20px 15px;
    border-bottom: 1px solid #e8eff2;
    background: #fff;
}

.el-resource-modal .fi-modal-heading {
    color: #173246;
    font-size: 18px;
    font-weight: 850;
    letter-spacing: -.015em;
}

.el-resource-modal .fi-modal-description {
    max-width: 560px;
    margin-top: 3px;
    color: #748894;
    font-size: 12px;
    line-height: 1.45;
}

.el-resource-modal .fi-modal-content {
    width: 100% !important;
    padding: 18px 20px 22px !important;
}

.el-resource-modal .fi-modal-content > *,
.el-resource-modal .fi-sc,
.el-resource-modal .fi-sc-component,
.el-resource-modal .fi-fo-component-ctn,
.el-resource-modal .fi-grid {
    width: 100% !important;
    max-width: none !important;
}

.el-resource-modal .fi-sc-component,
.el-resource-modal .fi-fo-field-wrp {
    min-width: 0;
}

.el-resource-modal .fi-input-wrp,
.el-resource-modal .fi-select-input,
.el-resource-modal textarea {
    border-radius: 10px;
}

.el-resource-modal .fi-modal-footer {
    padding: 13px 20px;
    border-top: 1px solid #e8eff2;
    background: rgba(255, 255, 255, .98);
}

.el-resource-modal .fi-modal-footer-actions {
    width: 100%;
    justify-content: flex-end;
    gap: 8px;
}

.el-resource-modal .fi-btn-color-primary {
    background: #00aeb5;
}

.el-resource-modal .fi-modal-close-btn {
    color: #718692;
}

@media (max-width: 640px) {
    html.el-resource-page .fi-section-content {
        padding: 14px;
    }

    .el-resource-modal,
    .el-resource-modal--availability {
        width: calc(100vw - 16px) !important;
        max-width: calc(100vw - 16px) !important;
        max-height: calc(100dvh - 16px) !important;
        border-radius: 15px !important;
    }

    .el-resource-modal .fi-modal-header {
        padding: 15px 16px 12px;
    }

    .el-resource-modal .fi-modal-content {
        padding: 14px 16px 18px !important;
    }

    .el-resource-modal .fi-modal-footer {
        padding: 12px 16px;
    }

    .el-resource-modal .fi-modal-footer-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .el-resource-modal .fi-modal-footer-actions > * {
        width: 100%;
        justify-content: center;
    }
}

@media (prefers-color-scheme: dark) {
    html.dark .el-resource-modal .fi-modal-header,
    html.dark .el-resource-modal .fi-modal-footer {
        background: #111827;
        border-color: rgba(255, 255, 255, .08);
    }

    html.dark .el-resource-modal .fi-modal-heading {
        color: #f8fafc;
    }
}

/* Szybkie zarządzanie dostępnością i dokumentami bez opuszczania listy. */
.el-resource-modal--quick {
    width: min(780px, calc(100vw - 32px)) !important;
    max-width: min(780px, calc(100vw - 32px)) !important;
}

.el-resource-modal--quick .fi-section.fi-section-not-contained {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
}

.el-resource-modal--quick .fi-section.fi-section-not-contained + .fi-section.fi-section-not-contained {
    margin-top: 8px;
    padding-top: 18px;
    border-top: 1px solid #e8eff2;
}

.el-quick-summary {
    display: grid;
    gap: 8px;
    width: 100%;
}

.el-quick-summary__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-width: 0;
    padding: 11px 12px;
    border: 1px solid #e3ebef;
    border-radius: 12px;
    background: #f9fbfc;
}

.el-quick-summary__main {
    min-width: 0;
}

.el-quick-summary__title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    color: #173246;
    font-size: 13px;
    font-weight: 800;
}

.el-quick-summary__meta,
.el-quick-summary__description,
.el-quick-summary__more {
    margin-top: 3px;
    color: #748894;
    font-size: 12px;
    line-height: 1.4;
}

.el-quick-summary__description {
    color: #516b79;
}

.el-quick-summary__badge {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 2px 7px;
    border-radius: 999px;
    background: #e7f8ee;
    color: #16784a;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
}

.el-quick-summary__badge.is-warning {
    background: #fff5d9;
    color: #98670d;
}

.el-quick-summary__badge.is-danger {
    background: #fee9e9;
    color: #b42318;
}

.el-quick-summary__link {
    flex: 0 0 auto;
    padding: 7px 10px;
    border: 1px solid #b9e4e6;
    border-radius: 9px;
    color: #007f86;
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
}

.el-quick-summary__link:hover {
    border-color: #00aeb5;
    background: #e9f9f9;
}

.el-quick-summary__empty {
    padding: 14px;
    border: 1px dashed #cfdde3;
    border-radius: 12px;
    color: #748894;
    background: #fbfcfd;
    font-size: 12px;
    line-height: 1.5;
}

.el-quick-summary__more {
    padding: 2px 4px 0;
}

@media (max-width: 640px) {
    .el-resource-modal--quick {
        width: calc(100vw - 16px) !important;
        max-width: calc(100vw - 16px) !important;
    }

    .el-quick-summary__item {
        align-items: flex-start;
        flex-direction: column;
    }

    .el-quick-summary__link {
        width: 100%;
        text-align: center;
    }
}

@media (prefers-color-scheme: dark) {
    html.dark .el-resource-modal--quick .fi-section.fi-section-not-contained + .fi-section.fi-section-not-contained {
        border-color: rgba(255, 255, 255, .08);
    }

    html.dark .el-quick-summary__item,
    html.dark .el-quick-summary__empty {
        border-color: rgba(255, 255, 255, .1);
        background: rgba(255, 255, 255, .035);
    }

    html.dark .el-quick-summary__title {
        color: #f8fafc;
    }

    html.dark .el-quick-summary__meta,
    html.dark .el-quick-summary__description,
    html.dark .el-quick-summary__more,
    html.dark .el-quick-summary__empty {
        color: #9fb0ba;
    }
}

/* v5: dostępność zasobów w planowaniu kursów */
.erp-grid-5 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.el-resource-availability-note {
    margin: -0.2rem 1rem 1rem;
    color: #6b7d91;
    font-size: 0.68rem;
    line-height: 1.45;
}

@media (max-width: 1500px) {
    .erp-grid-5 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 1100px) {
    .erp-grid-5 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .erp-grid-5 {
        grid-template-columns: 1fr;
    }

    .el-resource-availability-note {
        margin-inline: .75rem;
    }
}

/* v6: statusy terminów dokumentów */
.el-document-summary-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 2px;
}

.el-document-summary-strip > span {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 5px;
    padding: 9px 10px;
    border: 1px solid #dce7eb;
    border-radius: 10px;
    background: #f8fafb;
    color: #647986;
    font-size: 11px;
    font-weight: 700;
}

.el-document-summary-strip > span b {
    color: #29485a;
    font-size: 15px;
}

.el-document-summary-strip > span.is-danger {
    border-color: #f5c7c7;
    background: #fff1f1;
    color: #a8322b;
}

.el-document-summary-strip > span.is-danger b {
    color: #b42318;
}

.el-document-summary-strip > span.is-warning {
    border-color: #f0dba4;
    background: #fff8e5;
    color: #8a6517;
}

.el-document-summary-strip > span.is-warning b {
    color: #98670d;
}

.el-document-summary-strip > span.is-success {
    border-color: #bae4cf;
    background: #effaf4;
    color: #24714d;
}

.el-document-summary-strip > span.is-success b {
    color: #16784a;
}

.el-quick-summary__badge.is-neutral {
    background: #edf2f5;
    color: #607582;
}

.el-document-course-note {
    margin-top: 6px;
    color: #8a6517;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.4;
}

@media (max-width: 640px) {
    .el-document-summary-strip {
        grid-template-columns: 1fr;
    }
}

@media (prefers-color-scheme: dark) {
    html.dark .el-document-summary-strip > span {
        border-color: rgba(255, 255, 255, .1);
        background: rgba(255, 255, 255, .035);
        color: #9fb0ba;
    }

    html.dark .el-document-summary-strip > span b {
        color: #f8fafc;
    }
}

/* v7: centrum alertów zasobów na pulpicie */
.el-resource-alert-center {
    margin: 18px 0 22px;
}

.el-resource-alert-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 14px;
}

.el-resource-alert-eyebrow {
    display: block;
    margin-bottom: 4px;
    color: #00aeb5;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.el-resource-alert-heading h2 {
    margin: 0;
    color: #17384a;
    font-size: 21px;
    font-weight: 800;
    letter-spacing: -.02em;
}

.el-resource-alert-heading p {
    margin: 4px 0 0;
    color: #718391;
    font-size: 12px;
}

.el-resource-alert-total {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-width: 58px;
    height: 36px;
    padding: 0 12px;
    border: 1px solid #d9e4e9;
    border-radius: 11px;
    background: #fff;
    color: #6d8190;
    font-size: 13px;
    font-weight: 800;
    box-shadow: 0 5px 16px rgba(31, 58, 76, .05);
}

.el-resource-alert-total svg {
    width: 18px;
    height: 18px;
}

.el-resource-alert-total.has-alerts {
    border-color: #f4c1c1;
    background: #fff4f4;
    color: #b42318;
}

.el-resource-alert-cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.el-resource-alert-card {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 14px 15px;
    border: 1px solid #dde7eb;
    border-radius: 14px;
    background: #fff;
    text-align: left;
    box-shadow: 0 6px 20px rgba(29, 55, 72, .045);
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.el-resource-alert-card:hover,
.el-resource-alert-card.is-active {
    border-color: #91dce0;
    box-shadow: 0 9px 24px rgba(29, 55, 72, .09);
    transform: translateY(-1px);
}

.el-resource-alert-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: #eef7f8;
    color: #14858b;
}

.el-resource-alert-card__icon svg {
    width: 21px;
    height: 21px;
}

.el-resource-alert-card.is-danger .el-resource-alert-card__icon {
    background: #fff0f0;
    color: #c3322b;
}

.el-resource-alert-card.is-warning .el-resource-alert-card__icon {
    background: #fff7df;
    color: #a36b0a;
}

.el-resource-alert-card.is-info .el-resource-alert-card__icon {
    background: #edf7fd;
    color: #237ba7;
}

.el-resource-alert-card__content {
    display: grid;
    min-width: 0;
}

.el-resource-alert-card__content > strong {
    color: #17384a;
    font-size: 22px;
    line-height: 1;
}

.el-resource-alert-card__content > span {
    margin-top: 4px;
    color: #395666;
    font-size: 12px;
    font-weight: 750;
}

.el-resource-alert-card__content small {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 7px;
    margin-top: 6px;
    color: #82929d;
    font-size: 9px;
    font-style: normal;
}

.el-resource-alert-card__content small em {
    font-style: normal;
}

.el-resource-alert-panel {
    overflow: hidden;
    border: 1px solid #dce7eb;
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 7px 24px rgba(29, 55, 72, .05);
}

.el-resource-alert-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 11px 13px;
    border-bottom: 1px solid #e8eef1;
    background: #fbfcfd;
}

.el-resource-alert-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.el-resource-alert-filters button,
.el-resource-alert-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 29px;
    padding: 5px 9px;
    border: 1px solid transparent;
    border-radius: 9px;
    color: #607785;
    font-size: 10px;
    font-weight: 750;
}

.el-resource-alert-filters button span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    border-radius: 999px;
    background: #edf2f4;
    color: #617784;
    font-size: 9px;
}

.el-resource-alert-filters button:hover,
.el-resource-alert-filters button.is-active {
    border-color: #b9e4e6;
    background: #ecf9f9;
    color: #087c82;
}

.el-resource-alert-filters button.is-active span {
    background: #cceff0;
    color: #066a70;
}

.el-resource-alert-toggle {
    flex: 0 0 auto;
    color: #087c82;
}

.el-resource-alert-toggle svg {
    width: 15px;
    height: 15px;
}

.el-resource-alert-row {
    display: grid;
    grid-template-columns: 38px minmax(240px, 1.45fr) minmax(180px, .8fr) 18px;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid #edf1f3;
    color: inherit;
    text-decoration: none;
    transition: background .15s ease;
}

.el-resource-alert-row:last-child {
    border-bottom: 0;
}

.el-resource-alert-row:hover {
    background: #f8fbfc;
}

.el-resource-alert-row__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: #edf7fd;
    color: #237ba7;
}

.el-resource-alert-row__icon svg {
    width: 18px;
    height: 18px;
}

.el-resource-alert-row.is-danger .el-resource-alert-row__icon {
    background: #fff0f0;
    color: #c3322b;
}

.el-resource-alert-row.is-warning .el-resource-alert-row__icon {
    background: #fff7df;
    color: #a36b0a;
}

.el-resource-alert-row__main,
.el-resource-alert-row__resource {
    display: grid;
    min-width: 0;
}

.el-resource-alert-row__main strong,
.el-resource-alert-row__resource strong {
    overflow: hidden;
    color: #263f4e;
    font-size: 11px;
    font-weight: 750;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.el-resource-alert-row__main small {
    margin-top: 3px;
    color: #788a95;
    font-size: 10px;
}

.el-resource-alert-row__resource em {
    margin-bottom: 3px;
    color: #8b9ba4;
    font-size: 9px;
    font-style: normal;
    font-weight: 750;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.el-resource-alert-row__arrow {
    width: 17px;
    height: 17px;
    color: #9aabb4;
}

.el-resource-alert-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 126px;
    padding: 20px;
    text-align: left;
}

.el-resource-alert-empty > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 13px;
    background: #eaf8f1;
    color: #168557;
}

.el-resource-alert-empty svg {
    width: 23px;
    height: 23px;
}

.el-resource-alert-empty strong {
    color: #29485a;
    font-size: 12px;
}

.el-resource-alert-empty p {
    margin: 3px 0 0;
    color: #7b8d98;
    font-size: 10px;
}

.el-resource-alert-footer {
    padding: 8px 14px;
    border-top: 1px solid #edf1f3;
    background: #fbfcfd;
    color: #83939d;
    font-size: 9px;
    text-align: right;
}

.el-topbar-resource-alerts.has-alerts {
    border-color: #f2bbbb !important;
    background: #fff2f2 !important;
    color: #b42318 !important;
}

@media (max-width: 1280px) {
    .el-resource-alert-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .el-resource-alert-heading {
        align-items: flex-start;
    }

    .el-resource-alert-cards {
        grid-template-columns: 1fr;
    }

    .el-resource-alert-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .el-resource-alert-toggle {
        align-self: flex-start;
    }

    .el-resource-alert-row {
        grid-template-columns: 36px minmax(0, 1fr) 17px;
        gap: 9px;
    }

    .el-resource-alert-row__resource {
        grid-column: 2 / 3;
    }

    .el-resource-alert-row__arrow {
        grid-column: 3;
        grid-row: 1 / span 2;
    }
}
