.image-library-v4 {
    display: grid;
    gap: 18px;
}

.ilv4-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.ilv4-eyebrow {
    color: #2563eb;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1.2px;
}

.ilv4-head h1 {
    margin: 4px 0 6px;
    color: #07152e;
    font-size: 30px;
}

.ilv4-head p {
    margin: 0;
    color: #7c8ca3;
}

.ilv4-head-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.ilv4-watermark-wait {
    opacity: .62;
    cursor: not-allowed !important;
}

.ilv4-stats {
    display: grid;
    grid-template-columns:
        repeat(6, minmax(0, 1fr));
    gap: 12px;
}

.ilv4-stat,
.ilv4-panel,
.ilv4-bulkbar,
.ilv4-pagination,
.ilv4-empty {
    background: #fff;
    border: 1px solid #dbe3ef;
    border-radius: 14px;
}

.ilv4-stat {
    padding: 18px;
}

.ilv4-stat span {
    color: #56667c;
    font-size: 13px;
    font-weight: 700;
}

.ilv4-stat strong {
    display: block;
    margin: 8px 0 4px;
    color: #07152e;
    font-size: 28px;
    line-height: 1;
}

.ilv4-stat small {
    color: #91a0b4;
}

.ilv4-panel {
    padding: 18px;
}

.ilv4-panel-head {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 16px;
}

.ilv4-panel-head h2 {
    margin: 0 0 4px;
    font-size: 17px;
}

.ilv4-panel-head p {
    margin: 0;
    color: #8998ad;
    font-size: 13px;
}

.ilv4-result-count {
    align-self: flex-start;
    padding: 7px 11px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #46566d;
    font-size: 12px;
    font-weight: 700;
}

.ilv4-filter {
    display: grid;
    grid-template-columns:
        minmax(240px, 2fr)
        repeat(4, minmax(125px, 1fr))
        85px
        auto;
    gap: 10px;
    align-items: end;
}

.ilv4-filter label {
    display: grid;
    gap: 6px;
}

.ilv4-filter label > span {
    color: #526078;
    font-size: 12px;
    font-weight: 700;
}

.ilv4-filter input,
.ilv4-filter select,
.ilv4-bulk-actions select {
    width: 100%;
    min-height: 40px;
    padding: 0 11px;
    border: 1px solid #d4dfec;
    border-radius: 8px;
    background: #fff;
    color: #17233a;
}

.ilv4-filter-actions,
.ilv4-bulk-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ilv4-bulkbar {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    margin-bottom: 14px;
}

.ilv4-select-all {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

#imageSelectedCount {
    color: #2563eb;
    font-size: 13px;
}

.ilv4-bulk-actions {
    margin-left: auto;
}

.ilv4-bulk-actions select {
    min-width: 190px;
}

.ilv4-grid {
    display: grid;
    grid-template-columns:
        repeat(5, minmax(0, 1fr));
    gap: 16px;
}

.ilv4-card {
    position: relative;
    overflow: hidden;
    background: #fff;
    border: 1px solid #dbe3ef;
    border-radius: 14px;
    transition:
        transform .15s ease,
        box-shadow .15s ease;
}

.ilv4-card:hover {
    transform: translateY(-2px);
    box-shadow:
        0 12px 28px
        rgba(15, 23, 42, .08);
}

.ilv4-card.is-disabled {
    opacity: .72;
}

.ilv4-card-select {
    position: absolute;
    z-index: 5;
    top: 10px;
    left: 10px;
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border-radius: 8px;
    background: rgba(255,255,255,.94);
    box-shadow:
        0 2px 10px
        rgba(15,23,42,.12);
}

.ilv4-card-select input {
    width: 16px;
    height: 16px;
}

.ilv4-cover-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.ilv4-cover {
    position: relative;
    height: 250px;
    overflow: hidden;
    background: #eef2f7;
}

.ilv4-cover img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.ilv4-no-cover {
    height: 100%;
    display: grid;
    place-items: center;
    color: #8a99ad;
}

.ilv4-image-count {
    position: absolute;
    right: 10px;
    bottom: 10px;
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(15,23,42,.78);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}

.ilv4-disabled-mask {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 8px;
    border-radius: 999px;
    background: rgba(100,116,139,.9);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}

.ilv4-card-body {
    padding: 14px;
}

.ilv4-title {
    display: block;
    min-height: 42px;
    color: #15223a;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.5;
    text-decoration: none;
}

.ilv4-title:hover,
.ilv4-card-footer a:hover {
    color: #2563eb;
}

.ilv4-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.ilv4-tags span {
    padding: 4px 7px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
}

.ilv4-tags .category {
    background: #edf4ff;
    color: #2563eb;
}

.ilv4-tags .uncategorized {
    background: #fff7ed;
    color: #c2410c;
}

.ilv4-tags .source {
    background: #f3f5f8;
    color: #52637a;
}

.ilv4-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
    margin-top: 13px;
}

.ilv4-info div {
    min-width: 0;
}

.ilv4-info span {
    display: block;
    color: #93a1b5;
    font-size: 10px;
}

.ilv4-info strong {
    display: block;
    overflow: hidden;
    margin-top: 2px;
    color: #344158;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ilv4-info strong.bad {
    color: #dc2626;
}

.ilv4-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 14px;
    padding-top: 11px;
    border-top: 1px solid #edf1f6;
}

.ilv4-status {
    display: inline-flex;
    padding: 4px 7px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}

.ilv4-status.enabled {
    background: #eafaf0;
    color: #079447;
}

.ilv4-status.disabled {
    background: #f1f5f9;
    color: #64748b;
}

.ilv4-card-footer a {
    color: #2563eb;
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
}

.ilv4-pagination {
    margin-top: 16px;
    padding: 14px 16px;
}

.ilv4-empty {
    padding: 60px 20px;
    color: #8290a5;
    text-align: center;
}

.btn-danger {
    border-color: #dc2626 !important;
    background: #dc2626 !important;
    color: #fff !important;
}

@media (max-width: 1450px) {
    .ilv4-stats {
        grid-template-columns:
            repeat(3, 1fr);
    }

    .ilv4-grid {
        grid-template-columns:
            repeat(4, 1fr);
    }

    .ilv4-filter {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 1050px) {
    .ilv4-grid {
        grid-template-columns:
            repeat(3, 1fr);
    }

    .ilv4-head,
    .ilv4-bulkbar {
        align-items: stretch;
        flex-direction: column;
    }

    .ilv4-bulk-actions {
        margin-left: 0;
        flex-wrap: wrap;
    }
}

@media (max-width: 760px) {
    .ilv4-stats,
    .ilv4-filter {
        grid-template-columns:
            1fr 1fr;
    }

    .ilv4-grid {
        grid-template-columns:
            repeat(2, 1fr);
    }

    .ilv4-cover {
        height: 210px;
    }
}
