/* ========================================================================
 * Baza klientów – styl 1:1 do makiety (tylko w obrębie .profilio-clients-wrap)
 * ===================================================================== */

.profilio-clients-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px 56px;
    background: transparent;
    color: #0f172a;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
        "Segoe UI", sans-serif;
    box-sizing: border-box;
}

/* reset w obrębie wrappera, żeby nie gryzł się z motywem */
.profilio-clients-wrap * {
    box-sizing: border-box;
}

/* ========================================================================
 * HEADER
 * ===================================================================== */

.pc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

.pc-header__title {
    margin: 0 0 6px;
    font-size: 40px;
    line-height: 1.1;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.pc-header__subtitle {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: #6b7280;
}

.pc-header__right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ========================================================================
 * BUTTONY
 * ===================================================================== */

.pc-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 999px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 18px;
    cursor: pointer;
    transition: background-color 0.15s ease, box-shadow 0.15s ease,
        transform 0.05s ease, color 0.15s ease;
    outline: none;
    text-decoration: none;
    white-space: nowrap;
}

.pc-btn__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    line-height: 1;
}

/* główny ciemny przycisk (+ Dodaj, „Dodaj klienta”, „Instrukcja wysyłki”) */
.pc-btn--primary,
.pc-btn--dark {
    background: #111827;
    color: #ffffff;
    box-shadow: 0 10px 15px rgba(15, 23, 42, 0.15);
}

.pc-btn--primary:hover,
.pc-btn--dark:hover {
    background: #020617;
    box-shadow: 0 12px 20px rgba(15, 23, 42, 0.2);
}

.pc-btn--secondary {
    background: #ffffff;
    color: #111827;
    border: 1px solid #d1d5db;
}

.pc-btn--secondary:hover {
    background: #f9fafb;
}

.pc-btn--ghost {
    background: #ffffff;
    color: #111827;
    border-radius: 999px;
    padding-inline: 12px;
    border: 1px solid #e5e7eb;
}

.pc-btn--ghost:hover {
    background: #f3f4f6;
}

.pc-btn[disabled],
.pc-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
}

/* przycisk w headerze: jasne tło, ciemny tekst */
.pc-header__right .pc-btn--primary {
    background: #0f172a;
    color: #fff;
    padding-inline: 20px;
}

/* ========================================================================
 * CHIPY / PILL
 * ===================================================================== */

.pc-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
}

.pc-chip--soft-success {
    background: #e9f9ee;
    color: #16a34a;
}

.pc-chip--soft-neutral {
    background: #eef2ff;
    color: #6366f1;
}

.pc-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}

.pc-pill--level {
    background: #e5f0ff;
    color: #1d4ed8;
}

/* ========================================================================
 * KARTY ZADAŃ
 * ===================================================================== */

.pc-tasks {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 18px;
    margin-bottom: 24px;
}

@media (max-width: 900px) {
    .pc-tasks {
        grid-template-columns: minmax(0, 1fr);
    }
}

.pc-task-card {
    background: #ffffff;
    border-radius: 18px;
    padding: 18px 20px 18px;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.06);
    border: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pc-task-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 4px;
}

.pc-task-card__labels {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pc-task-card__body {
    margin-bottom: 4px;
}

.pc-task-card__title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}

.pc-task-card__desc {
    margin: 0;
    font-size: 13px;
    color: #6b7280;
    line-height: 1.5;
}

.pc-task-card__note {
    margin: 8px 0 0;
    font-size: 12px;
    color: #9ca3af;
}

.pc-task-card__progress {
    margin-top: 8px;
}

.pc-task-card__progress-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: #4b5563;
    margin-bottom: 6px;
}

.pc-task-card__progress-count {
    font-weight: 600;
}

.pc-progress-bar {
    position: relative;
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: #e5e7eb;
    overflow: hidden;
}

.pc-progress-bar__inner {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    border-radius: inherit;
    background: #020617;
    transition: width 0.25s ease;
}

.pc-task-card__actions {
    margin-top: 10px;
}

/* ========================================================================
 * FILTRY / SZUKAJ
 * ===================================================================== */

.pc-filters {
    margin: 24px 0 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.pc-filter {
    min-width: 260px;
    max-width: 420px;
    flex: 1 1 260px;
}

.pc-filter__label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
    color: #4b5563;
}

.pc-filter__input {
    width: 100%;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    padding: 9px 14px;
    font-size: 14px;
    outline: none;
    background: #ffffff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.pc-filter__input::placeholder {
    color: #9ca3af;
}

.pc-filter__input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.35);
    background: #ffffff;
}

/* ========================================================================
 * TABELA
 * ===================================================================== */

.pc-table-wrap {
    background: #ffffff;
    border-radius: 18px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
    overflow: hidden;
}

.pc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.pc-table__head {
    background: #f3f4f6;
}

.pc-table__th {
    padding: 12px 20px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
    border-bottom: 1px solid #e5e7eb;
}

.pc-table__th--actions {
    text-align: right;
    width: 150px;
}

.pc-table__body .pc-table__row:nth-child(even) {
    background: #fbfbfd;
}

.pc-table__row {
    border-bottom: 1px solid #e5e7eb;
    transition: background-color 0.1s ease;
}

.pc-table__row:hover {
    background: #f9fafb;
}

.pc-table__row--empty td {
    text-align: center;
}

.pc-table__td {
    padding: 14px 20px;
    vertical-align: top;
}

.pc-table__td--client {
    width: 30%;
}

.pc-table__td--actions {
    text-align: right;
}

/* komórka „Brak klientów” */
.pc-table__empty {
    display: inline-block;
    padding: 18px 0;
    color: #9ca3af;
    font-size: 14px;
}

/* ========================================================================
 * AVATARY / KOMÓRKA KLIENT
 * ===================================================================== */

.pc-client-cell {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.pc-avatar {
    flex-shrink: 0;
    border-radius: 50%;
    border: 2px solid #e5f0ff;
    background: linear-gradient(135deg, #22a6f2, #06b6d4, #34d399);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 700;
    overflow: hidden;
}

.pc-avatar--small {
    width: 32px;
    height: 32px;
    font-size: 13px;
}

.pc-avatar--large {
    width: 80px;
    height: 80px;
    border-radius: 28px;
}

.pc-avatar__img {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
}

.pc-avatar__placeholder {
    font-size: 14px;
}

.pc-client-cell__meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pc-client-name {
    border: none;
    background: none;
    padding: 0;
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    cursor: pointer;
    text-align: left;
}

.pc-client-name:hover {
    text-decoration: underline;
}

.pc-client-cell__sub {
    font-size: 12px;
    color: #6b7280;
}

/* ========================================================================
 * KONTAKT / STATUS / ETAP
 * ===================================================================== */

.pc-contact__line {
    font-size: 13px;
    line-height: 1.4;
}

.pc-contact__line--muted {
    color: #6b7280;
    margin-top: 2px;
}

.pc-contact__empty {
    color: #d1d5db;
}

.pc-stage {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 12px;
}

.pc-stage__badge {
    padding-inline: 10px;
}

.pc-stage__date {
    color: #9ca3af;
}

/* tagi statusu: wizytówka / oferta */
.pc-status-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.pc-status-tag {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 500;
}

.pc-status-tag--card {
    background: #eef2ff;
    color: #4f46e5;
}

.pc-status-tag--offer {
    background: #ecfdf5;
    color: #059669;
}

/* ========================================================================
 * AKCJE – MAŁE PRZYCISKI IKONOWE
 * ===================================================================== */

.pc-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.pc-btn-icon {
    position: relative;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: none;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: #e5e7eb;
    transition: transform 0.05s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.pc-btn-icon:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.18);
}

.pc-btn-icon--mail {
    background: #e0edff;
    color: #2563eb;
}

.pc-btn-icon--offer {
    background: #dcfce7;
    color: #059669;
}

.pc-btn-icon--danger {
    background: #fee2e2;
    color: #b91c1c;
}

.pc-btn-icon__svg {
    width: 16px;
    height: 16px;
}

/* Ikony mail / plik / kosz – proste SVG w data-uri */
.pc-btn-icon__svg--mail::before,
.pc-btn-icon__svg--file::before,
.pc-btn-icon__svg--trash::before {
    content: "";
    display: block;
    width: 16px;
    height: 16px;
    background-size: contain;
    background-repeat: no-repeat;
}

/* koperta */
.pc-btn-icon__svg--mail::before {
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 5.5C4 4.948 4.448 4.5 5 4.5h14c.552 0 1 .448 1 1v13c0 .552-.448 1-1 1H5a1 1 0 0 1-1-1v-13Z' stroke='%232563eb' stroke-width='1.8'/%3E%3Cpath d='M5 6l7 5 7-5' stroke='%232563eb' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
}

/* kartka / plik */
.pc-btn-icon__svg--file::before {
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M14 3H7a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1V8l-4-5Z' stroke='%23059669' stroke-width='1.8'/%3E%3Cpath d='M14 3v5h5' stroke='%23059669' stroke-width='1.8'/%3E%3C/svg%3E");
}

/* kosz */
.pc-btn-icon__svg--trash::before {
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M9 4h6l1 2h4v1.5H4V6l4-2Z' stroke='%23b91c1c' stroke-width='1.8'/%3E%3Cpath d='M8.5 10v7.5M12 10v7.5M15.5 10v7.5' stroke='%23b91c1c' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
}

/* ========================================================================
 * LINKI
 * ===================================================================== */

.pc-link {
    color: #1d4ed8;
    text-decoration: none;
    cursor: pointer;
}

.pc-link:hover {
    text-decoration: underline;
}

/* ========================================================================
 * MODALE – wspólne
 * ===================================================================== */

.pc-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.pc-modal[aria-hidden="false"],
.pc-modal.pc-modal--open {
    display: flex;
}

.pc-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
}

.pc-modal__dialog {
    position: relative;
    max-height: 90vh;
    overflow: hidden;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.5);
    width: 100%;
    display: flex;
    flex-direction: column;
}

.pc-modal__dialog--sm {
    max-width: 480px;
}

.pc-modal__dialog--md {
    max-width: 640px;
}

.pc-modal__dialog--lg {
    max-width: 840px;
}

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

.pc-modal__title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.pc-modal__close {
    border: none;
    padding: 2px 8px;
    background: transparent;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: #6b7280;
}

.pc-modal__close:hover {
    color: #111827;
}

.pc-modal__body {
    padding: 18px 24px 20px;
    overflow: auto;
}

.pc-modal__footer {
    padding: 14px 24px 16px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ========================================================================
 * MODAL – MATERIAL INSTRUKTAŻOWY
 * ===================================================================== */

.pc-help-placeholder {
    border-radius: 16px;
    background: #f3f4f6;
    padding: 40px 24px;
    text-align: center;
}

.pc-help-placeholder__icon {
    width: 46px;
    height: 46px;
    border-radius: 999px;
    border: 2px solid #d1d5db;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 20px;
    color: #9ca3af;
}

.pc-help-placeholder__text {
    font-size: 14px;
    color: #6b7280;
}

/* ========================================================================
 * MODAL – FORMULARZ KLIENTA
 * ===================================================================== */

.pc-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 18px;
}

@media (max-width: 900px) {
    .pc-form-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

.pc-form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pc-form-group--full {
    grid-column: 1 / -1;
}

.pc-form-label {
    font-size: 13px;
    font-weight: 500;
    color: #4b5563;
}

.pc-form-control {
    border-radius: 12px;
    border: 1px solid #d1d5db;
    padding: 8px 11px;
    font-size: 14px;
    outline: none;
    background: #ffffff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.pc-form-control--textarea {
    min-height: 90px;
    resize: vertical;
}

.pc-form-control:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.35);
    background: #ffffff;
}

.pc-form-error {
    font-size: 12px;
    color: #b91c1c;
}

.pc-form-group--checkbox {
    align-items: flex-start;
}

.pc-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    color: #4b5563;
}

.pc-checkbox input[type="checkbox"] {
    margin-top: 3px;
}

/* Image picker */
.pc-form-group--image {
    margin-top: 4px;
}

.pc-image-picker {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.pc-image-picker__preview {
    width: 84px;
    height: 84px;
    border-radius: 999px;
    border: 2px solid #e5f0ff;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.pc-image-picker__img {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
}

.pc-image-picker__controls {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pc-image-picker__url .pc-form-control {
    width: 100%;
}

/* ========================================================================
 * MODAL – KARTA KLIENTA
 * ===================================================================== */

.pc-client-card {
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

.pc-client-card__hero {
    position: relative;
    height: 120px;
    overflow: visible;
}

.pc-client-card__hero-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #1ea7e6 0%, #19b9c8 40%, #33c58f 70%, #8fd15a 100%);
}

.pc-client-card__hero-inner {
    position: absolute;
    bottom: -34px;
    left: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.pc-client-card__body {
    padding: 56px 24px 20px;
    background: #ffffff;
}

.pc-client-card__name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 2px;
}

.pc-client-card__meta {
    font-size: 13px;
    color: #f9fafb;
}

.pc-client-card__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 18px;
    margin-bottom: 16px;
}

@media (max-width: 720px) {
    .pc-client-card__grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

.pc-client-card__field--full {
    grid-column: 1 / -1;
}

.pc-client-card__label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #9ca3af;
    margin-bottom: 2px;
}

.pc-client-card__value {
    font-size: 14px;
    color: #111827;
    word-break: break-word;
}

.pc-client-card__note {
    margin-top: 6px;
}

.pc-client-card__textarea {
    margin-top: 4px;
}

.pc-client-card__note-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 8px;
}

.pc-client-card__note-status {
    font-size: 12px;
    color: #16a34a;
}

/* ========================================================================
 * MODAL – WYSYŁKA WIZYTÓWKI / OFERTY
 * ===================================================================== */

.pc-send-card__to {
    font-size: 14px;
    margin: 0 0 12px;
}

.pc-send-card__preview {
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    padding: 12px 14px;
    font-size: 14px;
    line-height: 1.6;
    background: #f9fafb;
}

.pc-offer .pc-send-card__preview {
    margin-top: 10px;
}

/* ========================================================================
 * INFO BANNERY (np. brak uprawnień)
 * ===================================================================== */

.pc-info {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    margin: 0 0 14px;
}

.pc-info--warning {
    background: #fff7ed;
    color: #c05621;
}

.pc-info--error {
    background: #fef2f2;
    color: #b91c1c;
}
/* lekki lifting modala formularza – bardziej jak makieta */

#pc-modal-form .pc-modal__dialog--lg {
    border-radius: 24px;
}

#pc-modal-form .pc-modal__header {
    padding-top: 18px;
    padding-bottom: 14px;
}

#pc-modal-form .pc-modal__body {
    padding-top: 18px;
}

#pc-modal-form .pc-modal__footer {
    padding-top: 12px;
    padding-bottom: 18px;
}
