.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    padding: 2rem;
    background-color: #f4f5f7;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* --- Karta logowania --- */
.login-card {
    width: 100%;
    max-width: 450px;
    background: #ffffff;
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.1);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}
.login-title {
    font-weight: 700;
    font-size: 1.75rem;
    color: #1a233b;
}
.login-subtitle {
    font-size: 1rem;
    color: #6c757d;
}

/* --- Style formularza --- */
.form-group label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #495057;
}
.form-control {
    padding: 0.85rem 1rem;
    font-size: 1rem;
    border: 2px solid #dde2e7;
    border-radius: 8px;
    transition: all 0.2s ease-in-out;
}
.form-control:focus {
    border-color: #252A3B;
    box-shadow: 0 0 0 4px rgba(37, 42, 59, 0.1);
}
.form-control.is-invalid {
    border-color: #dc3545;
}
.form-error-message {
    color: #dc3545;
    font-size: 0.85rem;
    font-weight: 500;
    margin-top: 5px;
    display: none; /* Domyślnie ukryty */
}

/* Przyciski */
.btn-primary.btn-block {
    width: 100%;
    padding: 0.8rem;
    font-weight: 600;
    font-size: 1rem;
    border-radius: 8px;
    background-color: #252A3B;
    border-color: #252A3B;
    transition: all 0.2s ease;
}
.btn-primary.btn-block:hover {
    background-color: #1a1e2a;
    border-color: #1a1e2a;
    transform: translateY(-2px);
}
.btn-primary.btn-block:disabled {
    background-color: #6c757d;
    border-color: #6c757d;
}


.ref-panel-wrapper {
    font-family: 'Inter', sans-serif;
    background-color: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
    overflow: hidden; /* Ważne dla zaokrąglonych rogów */
}

/* NAWIGACJA ZAKŁADEK */
.ref-panel-nav {
    display: flex;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}
.ref-nav-tab {
    background: none; border: none; padding: 1rem 1.5rem;
    font-weight: 600; font-size: 1rem; color: #6c757d;
    cursor: pointer; border-bottom: 3px solid transparent;
    transition: color 0.3s ease, border-color 0.3s ease;
}
.ref-nav-tab:hover { color: #252A3B; }
.ref-nav-tab.active { color: #252A3B; border-bottom-color: #252A3B; }

/* TREŚĆ ZAKŁADEK */
.ref-tab-content { padding: 2rem; }
.ref-tab-pane { display: none; }
.ref-tab-pane.active { display: block; animation: ref-fade-in 0.5s ease; }
@keyframes ref-fade-in { from { opacity: 0; } to { opacity: 1; } }

/* TABELA */
.ref-table { width: 100%; border-collapse: collapse; }
.ref-table th {
    padding: 1rem; text-align: left; font-weight: 600;
    color: #6c757d; text-transform: uppercase; font-size: 0.75rem;
    border-bottom: 2px solid #dee2e6;
}
.ref-table td { padding: 1rem; vertical-align: middle; border-bottom: 1px solid #f0f0f0; }
.ref-table tbody tr:last-child td { border-bottom: none; }
.product-title { font-weight: 600; color: #212529; }

/* PRZYCISK KOPIOWANIA */
.btn-copy-link {
    background-color: #252A3B; color: #fff; border: 1px solid #252A3B;
    padding: 0.6rem 1.2rem; border-radius: 8px; font-weight: 600;
    cursor: pointer; display: flex; align-items: center; gap: 0.5rem;
    transition: all 0.2s ease;
}
.btn-copy-link:hover {
    background-color: #1a1e2a; transform: scale(1.05);
}
.btn-copy-link.copied {
    background-color: #198754; border-color: #198754;
}

/* PAGINACJA */
.ref-pagination-container { display: flex; justify-content: center; margin-top: 1.5rem; }
.pagination { list-style: none; display: flex; gap: 5px; padding: 0; }
.pagination .page-item a {
    display: block; padding: 0.5rem 1rem; color: #252A3B;
    background-color: #fff; border: 1px solid #dee2e6; border-radius: 6px;
    font-weight: 600; text-decoration: none; transition: all 0.2s ease;
}
.pagination .page-item a:hover { background-color: #f8f9fa; }
.pagination .page-item.active a { color: #fff; background-color: #252A3B; border-color: #252A3B; }
.is-layout-constrained > :where(:not(.alignleft):not(.alignright):not(.alignfull))
{
    max-width: 100% !important;
}

.ref-welcome-panel {
    background: linear-gradient(135deg, #f7f9fc, #ffffff);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* Zawijanie na mniejszych ekranach */
    gap: 1rem;
}

.ref-welcome-panel .welcome-text h4 {
    font-weight: 700;
    font-size: 1.25rem;
    color: #252A3B;
    margin: 0;
}

.ref-welcome-panel .welcome-text p {
    margin: 0.25rem 0 0 0;
    color: #64748b;
}

.ref-welcome-panel .welcome-action {
    flex-shrink: 0; /* Zapobiega kurczeniu się formularza */
}

.ref-welcome-panel .welcome-form {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.ref-welcome-panel .form-control {
    width: 100%;
    min-width: 250px; /* Minimalna szerokość pola */
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    transition: all 0.2s ease-in-out;
}
.ref-welcome-panel .form-control:focus {
    outline: none;
    border-color: #252A3B;
    box-shadow: 0 0 0 3px rgba(37, 42, 59, 0.1);
}

.ref-welcome-panel .btn-primary {
    background-color: #252A3B;
    border-color: #252A3B;
    color: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.2s ease;
}
.ref-welcome-panel .btn-primary:hover {
    background-color: #1a1e2a;
    transform: scale(1.05);
}

/* Responsywność dla mniejszych ekranów */
@media (max-width: 576px) {
    .ref-welcome-panel .welcome-form {
        flex-direction: column;
        align-items: stretch;
    }
}

#toast-notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    width: auto;
    max-width: 380px;
}

/* Pojedynczy komunikat (toast) */
.toast-notification {
    position: relative;
    padding: 16px 24px 16px 55px; /* Miejsce na ikonę */
    margin-bottom: 15px;
    color: #fff;
    background-color: #323232;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateX(110%);
    animation: slideInToast 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    font-size: 1rem;
    font-weight: 500;
}

/* Ikona wewnątrz toasta */
.toast-notification::before {
    font-family: "Font Awesome 5 Free"; /* Wymaga Font Awesome */
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
    font-size: 1.3rem;
}

/* Wariant "sukces" (zielony) */
.toast-notification.success {
    background: linear-gradient(135deg, #28a745, #218838);
}
.toast-notification.success::before {
    content: '\f058'; /* Ikona "check-circle" */
}

/* Wariant "błąd" (czerwony) */
.toast-notification.error {
    background: linear-gradient(135deg, #dc3545, #c82333);
}
.toast-notification.error::before {
    content: '\f071'; /* Ikona "exclamation-triangle" */
}

/* Animacja wsuwania się */
@keyframes slideInToast {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.psm-status-badge.status-pending { background-color: rgba(249, 115, 22, 0.1); color: #d97706; } /* Oczekujące na płatność */
.psm-status-badge.status-processing { background-color: rgba(59, 130, 246, 0.1); color: #2563eb; } /* W trakcie realizacji */
.psm-status-badge.status-on-hold { background-color: rgba(245, 158, 11, 0.1); color: #c2880a; } /* Wstrzymane */
.psm-status-badge.status-completed { background-color: rgba(22, 163, 74, 0.1); color: #15803d; } /* Zrealizowane */
.psm-status-badge.status-cancelled { background-color: rgba(107, 114, 128, 0.1); color: #475569; } /* Anulowane */
.psm-status-badge.status-refunded { background-color: rgba(107, 114, 128, 0.1); color: #475569; } /* Zwrócone */
.psm-status-badge.status-failed { background-color: rgba(239, 68, 68, 0.1); color: #be123c; } /* Nieudane */

.ref-tab-pane .psm-filters-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}
.ref-tab-pane .filter-group {
    flex: 1 1 200px; /* Elastyczność i minimalna szerokość */
}
.ref-tab-pane .filter-group.search {
    flex-basis: 250px;
}
.ref-tab-pane .filter-group label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 8px;
    color: #475569;
}
.ref-tab-pane .date-range {
    display: flex;
    gap: 15px;
}
.ref-tab-pane .date-range .date-input {
    flex: 1;
}

/* --- Tabela --- */
.ref-tab-pane .psm-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
}
.ref-tab-pane .psm-table thead {
    color: #64748b;
}
.ref-tab-pane .psm-table th {
    padding: 1rem 1.5rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.ref-tab-pane .psm-table tbody tr {
    background-color: #ffffff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02), 0 1px 2px rgba(0,0,0,0.04);
    border-radius: 8px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.ref-tab-pane .psm-table tbody tr:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px -5px rgba(37, 42, 59, 0.1);
}
.ref-tab-pane .psm-table td {
    padding: 1rem 1.5rem;
    vertical-align: middle;
}
.ref-tab-pane .psm-table td:first-child { border-top-left-radius: 8px; border-bottom-left-radius: 8px; }
.ref-tab-pane .psm-table td:last-child { border-top-right-radius: 8px; border-bottom-right-radius: 8px; }

/* --- Paginacja --- */
.ref-tab-pane .psm-pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1.5rem;
    margin-top: 1rem;
    border-top: 1px solid #f0f0f0;
}
.ref-tab-pane .pagination-info {
    color: #6c757d;
    font-size: 0.9rem;
}
.ref-tab-pane .pagination {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    gap: 5px;
}

button.ref-nav-tab:hover, button.ref-nav-tab:active, button.ref-nav-tab:focus
{
    background-color: transparent !important;
}

.assignment-actions {
    display: flex;
    gap: 1rem;
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #e9ecef;
}
.assignment-actions .btn {
    font-weight: 600;
}

.database-list {
    display: grid;
    gap: 1rem;
}

.database-item {
    display: flex;
    align-items: center;
    background-color: #ffffff;
    padding: 1rem 1.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    transition: all 0.2s ease;
}
.database-item:hover {
    border-color: #252A3B;
    box-shadow: 0 4px 15px -5px rgba(37, 42, 59, 0.1);
    transform: translateY(-2px);
}

.db-icon {
    font-size: 1.5rem;
    color: #252A3B;
    margin-right: 1.5rem;
}

.db-details {
    flex-grow: 1;
}
.db-name {
    display: block;
    font-weight: 600;
    color: #212529;
}
.db-meta {
    font-size: 0.9rem;
    color: #6c757d;
}

.db-actions {
    flex-shrink: 0;
}

#add-database-modal-overlay .psm-modal-content {
    max-width: 700px;
}

/* Styl dla strefy upuszczania pliku */
.file-drop-zone {
    position: relative;
    padding: 3rem;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    background-color: #f8f9fa;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}
.file-drop-zone:hover, .file-drop-zone.is-dragover {
    border-color: #252A3B;
    background-color: #f1f3f5;
}
.file-drop-zone-text {
    color: #64748b;
    font-weight: 500;
}
.file-drop-zone-text i {
    display: block;
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #94a3b8;
}
.file-drop-zone input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* Styl dla tabeli mapowania */
.mapping-table {
    display: grid;
    gap: 1rem;
}
.mapping-row {
    display: grid;
    grid-template-columns: 1fr 2fr;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    border-radius: 8px;
}
.mapping-row:nth-child(even) {
    background-color: #f8f9fa;
}
.mapping-label {
    font-weight: 600;
    color: #334155;
}

.psm-modal-overlay {
    position: fixed; /* Pozycjonowanie względem okna przeglądarki */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(20, 31, 51, 0.7); /* Ciemne tło z przezroczystością */
    z-index: 1050; /* Wysoki z-index, aby być nad wszystkim */

    /* Centrowanie zawartości (okna modala) w pionie i poziomie */
    display: flex;
    align-items: center;
    justify-content: center;

    /* Logika ukrywania/pokazywania */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(5px);
}

/* Stan widoczny, dodawany przez JavaScript */
.psm-modal-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

/* --- Animacja pojawiania się okna --- */
@keyframes psm-modal-fade-in {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* --- Właściwe okno modala --- */
/* =================================================================
   NOWY DESIGN MODALA DODAWANIA BAZY
   ================================================================= */

#add-database-modal-overlay .psm-modal-content {
    max-width: 700px;
}

/* --- KROK 1: STREFA UPLOADU --- */
.file-drop-zone {
    position: relative;
    padding: 2.5rem;
    border: 2px dashed #dde2e7;
    border-radius: 12px;
    background-color: #f7f9fc;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}
.file-drop-zone:hover, .file-drop-zone.is-dragover {
    border-color: #252A3B;
    background-color: #fff;
    transform: scale(1.02);
}
.file-drop-zone-icon i {
    font-size: 3rem;
    color: #252A3B;
    opacity: 0.8;
}
.file-drop-zone-title {
    font-weight: 700;
    font-size: 1.2rem;
    color: #334155;
    margin: 1rem 0 0.25rem 0;
}
.file-drop-zone-text {
    color: #64748b;
    font-weight: 500;
}
.file-drop-zone input[type="file"] {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* --- KROK 2: MAPOWANIE PÓL --- */
.file-summary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background-color: #eef2f7;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 1rem;
}
.file-summary i { color: #64748b; }

.mapping-table {
    display: grid;
    gap: 1rem;
}
.mapping-row {
    display: grid;
    grid-template-columns: 1fr 2fr;
    align-items: center;
    gap: 1.5rem;
    padding: 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}
.mapping-label {
    font-weight: 600;
    color: #1e293b;
    font-size: 1rem;
}
.mapping-row .form-select {
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    font-weight: 500;
}
.mapping-row .form-select:focus {
    border-color: #252A3B;
    box-shadow: 0 0 0 3px rgba(37, 42, 59, 0.1);
}

/* Przycisk importu */
#import-db-btn:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

.psm-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(20, 31, 51, 0.7); /* Twój ciemnoniebieski z przezroczystością */
    z-index: 1050;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(5px);
}
.psm-modal-overlay.is-visible {
    display: flex;
    opacity: 1;
}

/* --- Animacja pojawiania się --- */
@keyframes psm-modal-fade-in {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Główny kontener modala --- */
.psm-modal-content {
    position: relative;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    width: 90%;
    max-width: 440px; /* Idealny rozmiar dla komunikatu */
    padding: 2.5rem 2rem;
    animation: psm-modal-fade-in 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    text-align: center;
}

/* Przycisk zamykania 'x' */
.psm-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #e9ecef;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 1.2rem;
    color: #6c757d;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}
.psm-modal-close:hover {
    background-color: #dee2e6;
    transform: rotate(90deg);
}

/* Ikona sukcesu */
.modal-icon-wrapper {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.5rem auto;
    border-radius: 50%;
    background-color: rgba(25, 135, 84, 0.1); /* Jasnozielone tło */
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-icon-wrapper i {
    font-size: 2rem;
    color: #198754; /* Ciemnozielona ikona */
}

/* Teksty w modalu */
.modal-main-title {
    font-family: 'Barlow', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: #141f33; /* Twój ciemnoniebieski kolor */
    margin-bottom: 0.5rem;
}
.modal-description {
    color: #6c757d;
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
}

/* Przyciski akcji */
.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.btn-modal {
    padding: 0.8rem;
    font-weight: 600;
    font-size: 1rem;
    border-radius: 8px;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

/* Przycisk główny (pomarańczowy) */
.btn-primary-custom {
    background-color: #ed4f00;
    border: 1px solid #ed4f00;
    color: #ffffff;
}
.btn-primary-custom:hover {
    background-color: #d14600;
    border-color: #d14600;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(237, 79, 0, 0.2);
}

/* Przycisk drugorzędny (tekstowy) */
.btn-secondary-custom {
    background: none;
    border: none;
    color: #6c757d;
}
.btn-secondary-custom:hover {
    color: #141f33;
    background-color: #f0f0f0;
}

.psm-modal-content.large {
    max-width: 900px;
}
/* Poprawki dla tabeli wewnątrz modala */
.psm-modal-body .table-responsive {
    max-height: 60vh; /* Ograniczenie wysokości i dodanie scrolla */
}
.psm-modal-body .psm-table th {
    background-color: #f8f9fa; /* Jaśniejszy nagłówek w modalu */
    color: #495057;
}

#contacts-list-modal-overlay .psm-modal-body {
    padding: 1rem 0.5rem 2rem 0.5rem; /* Zmniejszamy padding, bo tabela ma własne marginesy */
    background-color: #f8f9fa; /* Lekko szare tło dla lepszego kontrastu z wierszami */
}

#contacts-list-modal-overlay .table-responsive {
    max-height: 65vh; /* Ustawienie maksymalnej wysokości i scrolla */
    border: none;
    padding: 0 1.5rem; /* Dodajemy padding po bokach */
}

/* Nowy styl tabeli */
#contacts-list-modal-overlay .psm-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px; /* Odstęp między wierszami */
}

/* Nagłówek tabeli - minimalistyczny i czytelny */
#contacts-list-modal-overlay .psm-table thead {
    color: #64748b;
}
#contacts-list-modal-overlay .psm-table th {
    padding: 1rem 1.5rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background-color: #f8f9fa; /* Tło nagłówka takie samo jak tło body */
    border-bottom: 2px solid #e2e8f0;
}

/* Wiersze tabeli - teraz wyglądają jak "karty" */
#contacts-list-modal-overlay .psm-table tbody tr {
    background-color: #ffffff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03), 0 1px 2px rgba(0,0,0,0.05);
    border-radius: 8px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-left-color 0.2s ease;
    border-left: 4px solid transparent;
}
#contacts-list-modal-overlay .psm-table tbody tr:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px -5px rgba(37, 42, 59, 0.1);
    border-left-color: #ed4f00; /* Pomarańczowy akcent po najechaniu */
}

/* Komórki tabeli */
#contacts-list-modal-overlay .psm-table td {
    padding: 1rem 1.5rem;
    vertical-align: middle;
    color: #334155;
    font-weight: 500;
    border-top: none;
    border-bottom: none;
}
#contacts-list-modal-overlay .psm-table td:first-child {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}
#contacts-list-modal-overlay .psm-table td:last-child {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

/* Linki w tabeli */
#contacts-list-modal-overlay .psm-table a {
    color: #252A3B;
    text-decoration: none;
    font-weight: 600;
}
#contacts-list-modal-overlay .psm-table a:hover {
    color: #ed4f00;
    text-decoration: underline;
}

.assignment-grid {
    display: grid;
    grid-template-columns: 250px 1fr; /* Kolumna na handlowców i kolumna na kontakty */
    gap: 1.5rem;
    min-height: 50vh;
}
.assignment-employees-list, .assignment-contacts-list {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background-color: #f8f9fa;
    padding: 1rem;
    max-height: 500px;
    overflow-y: auto;
}
.employee-item {
    padding: 0.75rem 1rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    margin-bottom: 5px;
    transition: all 0.2s ease;
}
.employee-item:hover { background-color: #e2e8f0; }
.employee-item.active { background-color: #252A3B; color: #fff; }
.employee-item .badge { margin-left: auto; }

.contact-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    margin-bottom: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.contact-item:hover { background-color: #eef2f7; }
.contact-item.assigned {
    cursor: not-allowed;
    background-color: #f1f5f9;
    color: #94a3b8;
    text-decoration: line-through;
}
.contact-item.assigned-to-current {
    background-color: #dbeafe;
    border: 1px solid #93c5fd;
}
.contact-item .assigned-badge {
    margin-left: auto;
    font-size: 0.7rem;
    background-color: #64748b;
    color: #fff;
}

.assignment-board {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    width: 100%;
    margin-top: 1.5rem;
}

.assignment-column, .worker-column {
    background-color: #f0f2f5;
    border-radius: 8px;
    padding: 1rem;
    flex-shrink: 0;
}

.assignment-column { /* Kolumna "Nierozdzielone" */
    width: 25%;
}

.worker-columns-container {
    display: flex;
    gap: 1.5rem;
    flex-grow: 1;
    overflow-x: auto; /* Pozwala przewijać handlowców w poziomie */
}
.worker-column { /* Kolumna pojedynczego handlowca */
    width: 300px;
    border-top: 4px solid #6c757d; /* Domyślny kolor */
}
.column-header {
    font-weight: 600;
    color: #495057;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #dee2e6;
}

.contact-list {
    min-height: 300px; /* Minimalna wysokość strefy upuszczania */
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

/* Styl dla przeciąganego elementu */
.contact-item {
    background-color: #ffffff;
    padding: 10px 15px;
    border-radius: 6px;
    margin-bottom: 8px;
    cursor: grab;
    border: 1px solid #dee2e6;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    font-weight: 500;
}

/* Styl, gdy element jest przeciągany nad strefą upuszczania */
.contact-list.drop-hover {
    background-color: #dde2e7;
}
.btn-action-icon {
    background: transparent;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 5px;
    margin-left: 5px;
    opacity: 0.7;
    transition: all 0.2s ease;
}
.btn-action-icon:hover {
    opacity: 1;
    color: #252A3B;
}
.btn-action-icon.delete-assignment:hover {
    color: #dc3545; /* Czerwony dla usuwania */
}

.status-label {
    padding: 0.3em 0.7em;
    border-radius: 50rem;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
}
.status-label.status-nowy {
    background-color: rgba(59, 130, 246, 0.1);
    color: #2563eb;
}
.status-label.status-skontaktowano-się {
    background-color: rgba(249, 115, 22, 0.1);
    color: #d97706;
}
.status-label.status-zainteresowany {
    background-color: rgba(22, 163, 74, 0.1);
    color: #15803d;
}
.status-label.status-brak-zainteresowania {
    background-color: rgba(107, 114, 128, 0.1);
    color: #475569;
}
.status-label.status-do-ponowienia {
    background-color: rgba(139, 92, 246, 0.1);
    color: #7c3aed;
}

/* --- Skracanie zbyt długich notatek --- */
.note-preview {
    display: block; /* Ważne dla poprawnego działania */
    white-space: nowrap; /* Zapobiega łamaniu linii */
    overflow: hidden; /* Ukrywa tekst, który się nie mieści */
    text-overflow: ellipsis; /* Dodaje trzy kropki "..." */
    max-width: 250px; /* Maksymalna szerokość notatki w tabeli */

    /* Dodajemy title, aby pokazać całą treść w dymku po najechaniu */
    cursor: help;
}