.dostawy-filters {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
    box-sizing: border-box;
}

.dostawy-filters__layout {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    min-width: 0;
}

.dostawy-filters__supplier {
    width: 100%;
    min-width: 0;
    margin-bottom: 0;
}

.dostawy-filters__label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.dostawy-select {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    height: 42px;
    padding: 0 12px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    background: #fff;
    font-size: 14px;
    box-sizing: border-box;
}

.dostawy-filters__checks {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    min-width: 0;
}

.dostawy-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    min-width: 0;
    max-width: none;
    height: 64px;
    padding: 4px;
    border-radius: 14px;
    border: 1px solid #d1d5db;
    background: #fff;
    cursor: pointer;
    transition: 0.15s ease;
    box-sizing: border-box;
    overflow: hidden;
}

.dostawy-chip__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dostawy-chip__label {
    font-size: 11px;
    font-weight: 400;
    color: #6b7280;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.dostawy-chip.is-neutral {
    background: #fff;
    border-color: #d1d5db;
}

.dostawy-chip.is-yes {
    background: #ecfdf5;
    border-color: #a7f3d0;
}

.dostawy-chip.is-no {
    background: #fee2e2;
    border-color: #fca5a5;
}

.dostawy-chip.is-yes .dostawy-chip__label {
    color: #065f46;
}

.dostawy-chip.is-no .dostawy-chip__label {
    color: #991b1b;
}

.dostawy-chip.is-neutral:hover {
    background: #f9fafb;
}

.dostawy-chip:active {
    transform: translateY(1px);
}

.dostawy-groups {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.dostawy-group {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 18px;
}

.dostawy-group__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
}

.dostawy-group__header h2 {
    margin: 0;
    font-size: 22px;
    line-height: 1.2;
    color: #111827;
}

.dostawy-group__header span {
    font-size: 14px;
    color: #6b7280;
}

.dostawy-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.dostawy-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.dostawy-card__top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 14px;
}

.dostawy-card__title {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 4px;
}

.dostawy-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.dostawy-card__supplier {
    font-size: 14px;
    color: #4b5563;
}

.dostawy-card__date {
    display: flex;
    align-items: center;
    gap: 6px;
}

.dostawy-card__meta {
    display: grid;
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.dostawy-card__label {
    display: block;
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 4px;
}

.dostawy-card__statuses {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid transparent;
}

.status-pill.is-yes {
    background: #ecfdf5;
    color: #065f46;
    border-color: #a7f3d0;
}

.status-pill.is-no {
    background: #f9fafb;
    color: #6b7280;
    border-color: #e5e7eb;
}

.status-pill.is-ok {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #bfdbfe;
}

.status-pill.is-warn {
    background: #fff7ed;
    color: #c2410c;
    border-color: #fed7aa;
}

.dostawy-card__notes {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px;
    margin: 8px 0;
}

.dostawy-card__notes p {
    margin: 4px;
    color: #374151;
}

.dostawy-card__notes p:last-child {
    margin-bottom: 0;
}

.dostawy-loading {
    margin-top: 16px;
    color: #6b7280;
}

.status-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 1px solid transparent;
    transition: 0.15s ease;
}

.status-icon.is-yes {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #059669;
}

.status-icon.is-no {
    background: #f9fafb;
    border-color: #e5e7eb;
    color: #9ca3af;
}

.status-icon.is-warn {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #ea580c;
}

.status-icon-btn {
    border: 0;
    background: transparent;
    padding: 0.35rem;
    margin: 0;
    border-radius: 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease, opacity 0.15s ease, background-color 0.15s ease;
}

.status-icon-btn:hover {
    transform: scale(1.05);
    background-color: rgba(0, 0, 0, 0.04);
}

.status-icon-btn svg {
    width: 25px;
    height: 25px;
}

.status-icon-btn.is-yes {
    color: #198754;
}

.status-icon-btn.is-no {
    color: #aaaaaa;
}

.status-icon-btn.is-warn {
    color: #f0ad4e;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.modal {
    width: min(520px, calc(100vw - 32px));
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.modal__body {
    padding: 20px;
}

.modal__close {
    border: 0;
    background: transparent;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.form-error {
    color: #b42318;
    font-size: 14px;
}

.dostawy-pagination {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.dostawy-pagination__range {
    font-size: 14px;
    color: #666;
}

.dostawy-pagination__actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

@media (max-width: 1024px) {
    .dostawy-card__meta {
        grid-template-columns: repeat(2, minmax(140px, 1fr));
    }
}

@media (max-width: 640px) {
    .dostawy-filters {
        padding: 12px;
    }

    .dostawy-filters__layout {
        gap: 12px;
    }

    .dostawy-filters__checks {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 6px;
    }

    .dostawy-chip {
        height: 60px;
        padding: 4px 2px;
        border-radius: 12px;
    }

    .dostawy-chip__label {
        font-size: 10px;
    }

    .dostawy-chip__icon svg {
        width: 18px;
        height: 18px;
    }

    .dostawy-group__header {
        flex-direction: column;
        align-items: flex-start;
    }

    .dostawy-card__top {
        flex-direction: column;
    }

    .dostawy-card__date {
        white-space: normal;
    }

    .dostawy-card__meta {
        grid-template-columns: 1fr;
    }
}

.checkbox-small {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    opacity: 0.3;
    cursor: pointer;
}

.checkbox-small input[type="checkbox"] {
    transform: scale(0.8);
    width: auto;
    margin: 0;
    flex: 0 0 auto;
}

.checkbox-small:hover {
    opacity: 1;
}