/*
 * Portal klienta eSolumus – wygląd.
 * Wszystkie reguły są pod klasą .cp na <body> (panel administracyjny ładuje ten plik, ale jej nie ma).
 * theme.css dostarcza tylko siatkę i narzędzia Bootstrapa 4; to, co z niego zostaje widoczne
 * (typografia, pola, tabele, przyciski), jest tu nadpisane.
 * Motyw: jasny domyślnie, ciemny z ciasteczka "dark-mode" (html[data-theme]) albo z ustawień systemu.
 */

/* ---------------------------------------------------------------- tokeny */

.cp {
    --cp-bg: #f3f5f9;
    --cp-surface: #ffffff;
    --cp-surface-2: #f7f9fc;
    --cp-surface-hover: #eef3f9;
    --cp-border: #e2e7ef;
    --cp-border-strong: #cfd7e3;
    --cp-text: #0f1b2d;
    --cp-text-2: #334155;
    --cp-muted: #64748b;
    --cp-primary: #0a6fc9;
    --cp-primary-hover: #085ca8;
    --cp-primary-soft: #e6f1fb;
    --cp-primary-contrast: #ffffff;
    --cp-success: #0f8f6c;
    --cp-success-soft: #e3f6ef;
    --cp-danger: #d42424;
    --cp-danger-soft: #fdecec;
    --cp-warning: #b45309;
    --cp-warning-soft: #fdf3e2;
    --cp-ring-track: #e8edf4;
    --cp-focus: 0 0 0 3px rgba(10, 111, 201, .28);
    --cp-shadow-sm: 0 1px 2px rgba(15, 27, 45, .06);
    --cp-shadow: 0 1px 3px rgba(15, 27, 45, .06), 0 6px 20px -8px rgba(15, 27, 45, .12);
    --cp-shadow-lg: 0 20px 50px -12px rgba(15, 27, 45, .35);
    --cp-radius: 14px;
    --cp-radius-sm: 10px;
    --cp-sidebar-w: 260px;
    --cp-topbar-h: 64px;
    --cp-nav-bg: linear-gradient(180deg, #072849 0%, #0b3561 100%);
    --cp-brand-gradient: linear-gradient(90deg, #00aeef 0%, #8dc63f 50%, #fdb813 100%);
    --cp-font: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color-scheme: light;
}

html[data-theme="dark"] .cp {
    --cp-bg: #0b111b;
    --cp-surface: #131c2a;
    --cp-surface-2: #182233;
    --cp-surface-hover: #1d293c;
    --cp-border: #243147;
    --cp-border-strong: #31415b;
    --cp-text: #e7edf5;
    --cp-text-2: #c4cfdd;
    --cp-muted: #8d9bb0;
    --cp-primary: #3ea3f2;
    --cp-primary-hover: #66b6f5;
    --cp-primary-soft: rgba(62, 163, 242, .14);
    --cp-primary-contrast: #06121f;
    --cp-success: #34c79a;
    --cp-success-soft: rgba(52, 199, 154, .13);
    --cp-danger: #f26b6b;
    --cp-danger-soft: rgba(242, 107, 107, .13);
    --cp-warning: #f0a54a;
    --cp-warning-soft: rgba(240, 165, 74, .13);
    --cp-ring-track: #243147;
    --cp-focus: 0 0 0 3px rgba(62, 163, 242, .35);
    --cp-shadow-sm: none;
    --cp-shadow: 0 1px 2px rgba(0, 0, 0, .3);
    --cp-shadow-lg: 0 24px 60px -12px rgba(0, 0, 0, .7);
    --cp-nav-bg: linear-gradient(180deg, #08182c 0%, #0b1d33 100%);
    color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
    html:not([data-theme]) .cp {
        --cp-bg: #0b111b;
        --cp-surface: #131c2a;
        --cp-surface-2: #182233;
        --cp-surface-hover: #1d293c;
        --cp-border: #243147;
        --cp-border-strong: #31415b;
        --cp-text: #e7edf5;
        --cp-text-2: #c4cfdd;
        --cp-muted: #8d9bb0;
        --cp-primary: #3ea3f2;
        --cp-primary-hover: #66b6f5;
        --cp-primary-soft: rgba(62, 163, 242, .14);
        --cp-primary-contrast: #06121f;
        --cp-success: #34c79a;
        --cp-success-soft: rgba(52, 199, 154, .13);
        --cp-danger: #f26b6b;
        --cp-danger-soft: rgba(242, 107, 107, .13);
        --cp-warning: #f0a54a;
        --cp-warning-soft: rgba(240, 165, 74, .13);
        --cp-ring-track: #243147;
        --cp-focus: 0 0 0 3px rgba(62, 163, 242, .35);
        --cp-shadow-sm: none;
        --cp-shadow: 0 1px 2px rgba(0, 0, 0, .3);
        --cp-shadow-lg: 0 24px 60px -12px rgba(0, 0, 0, .7);
        --cp-nav-bg: linear-gradient(180deg, #08182c 0%, #0b1d33 100%);
        color-scheme: dark;
    }
}

/* ---------------------------------------------------------------- podstawy */

body.cp {
    min-width: 0 !important;
    margin: 0;
    background: var(--cp-bg);
    background-image: none;
    color: var(--cp-text);
    font-family: var(--cp-font);
    font-size: 15px;
    line-height: 1.55;
    letter-spacing: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.cp h1, .cp h2, .cp h3, .cp h4, .cp h5, .cp h6 { font-family: var(--cp-font); color: var(--cp-text); font-weight: 650; line-height: 1.3; letter-spacing: -.01em; }
.cp h1 { font-size: 1.75rem; margin: 0 0 .25rem; }
.cp h2 { font-size: 1.125rem; }
.cp h5 { font-size: 1rem; font-weight: 600; }
.cp a { color: var(--cp-primary); }
.cp a:hover { color: var(--cp-primary-hover); }
.cp :focus-visible { outline: none; box-shadow: var(--cp-focus); border-radius: 6px; }
.cp hr { border-color: var(--cp-border); }
.cp code { color: var(--cp-danger); }
.cp .text-muted, .cp .cp-muted { color: var(--cp-muted) !important; }
.cp .small, .cp small { font-size: .82rem; }
.cp .text-danger { color: var(--cp-danger) !important; }
.cp ::selection { background: rgba(0, 174, 239, .25); }

.cp-skip { position: absolute; left: -9999px; top: 8px; z-index: 2000; padding: 8px 14px; border-radius: 8px; background: var(--cp-surface); color: var(--cp-text); box-shadow: var(--cp-shadow); }
.cp-skip:focus { left: 8px; }

/* ---------------------------------------------------------------- układ */

.cp-shell { display: flex; min-height: 100vh; min-height: 100dvh; }
.cp-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cp-content { flex: 1; width: 100%; max-width: 1480px; margin: 0 auto; padding: 28px 32px 40px; }

/* menu boczne */
.cp-sidebar {
    position: sticky; top: 0; z-index: 1040;
    display: flex; flex-direction: column;
    width: var(--cp-sidebar-w); height: 100vh; height: 100dvh; flex-shrink: 0;
    background: var(--cp-nav-bg); color: #c7d5e8;
    overflow-y: auto;
}
.cp-sidebar::before { content: ""; display: block; height: 3px; background: var(--cp-brand-gradient); flex-shrink: 0; }
.cp-sidebar__head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 14px; }
.cp-icon-btn.cp-sidebar__close { display: none; color: #fff; }

.cp-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none !important; color: #fff !important; }
.cp-brand img { display: block; width: 34px; height: auto; }
.cp-brand span { font-family: Exo, var(--cp-font); font-weight: 700; font-size: 1.6rem; letter-spacing: -.01em; line-height: 1; }
.cp-brand--compact { display: none; color: var(--cp-text) !important; }
.cp-brand--compact img { width: 28px; }
.cp-brand--compact span { font-size: 1.35rem; }

.cp-nav { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; }
.cp-nav__link {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 14px; border-radius: 10px;
    color: #c7d5e8 !important; font-weight: 500; text-decoration: none !important;
    transition: background-color .15s, color .15s;
}
.cp-nav__link i { width: 20px; font-size: 1rem; color: #7f9dbf; transition: color .15s; }
.cp-nav__link:hover { background: rgba(255, 255, 255, .07); color: #fff !important; }
.cp-nav__link:hover i { color: #fff; }
.cp-nav__link.is-active { background: rgba(0, 174, 239, .16); color: #fff !important; box-shadow: inset 3px 0 0 #00aeef; }
.cp-nav__link.is-active i { color: #00aeef; }

.cp-sidebar__foot { margin-top: auto; padding: 18px 20px 22px; border-top: 1px solid rgba(255, 255, 255, .08); }
.cp-sidebar__label { margin: 0 0 8px; font-size: .72rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #6f8db0; }
.cp-contact { display: flex; align-items: center; gap: 10px; padding: 6px 0; color: #c7d5e8 !important; font-size: .88rem; text-decoration: none !important; }
.cp-contact i { color: #7f9dbf; }
.cp-contact:hover { color: #fff !important; }
.cp-contact__ext { margin-left: auto; font-size: .7rem; }

.cp-backdrop { display: none; }

/* górny pasek */
.cp-topbar {
    position: sticky; top: 0; z-index: 1030;
    display: flex; align-items: center; gap: 12px;
    height: var(--cp-topbar-h); padding: 0 32px;
    background: color-mix(in srgb, var(--cp-surface) 86%, transparent);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--cp-border);
}
.cp-topbar__spacer { flex: 1; }
.cp-icon-btn.cp-burger { display: none; }

.cp-icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; flex-shrink: 0;
    border: 0; border-radius: 10px; background: transparent;
    color: var(--cp-text-2); font-size: 1.05rem; cursor: pointer;
    transition: background-color .15s;
}
.cp-icon-btn:hover { background: var(--cp-surface-hover); }

/* przełącznik motywu: pokazujemy ikonę trybu, na który się przełączy */
.cp .cp-when-dark { display: none; }
html[data-theme="dark"] .cp .cp-when-dark { display: inline-block; }
html[data-theme="dark"] .cp .cp-when-light { display: none; }
@media (prefers-color-scheme: dark) {
    html:not([data-theme]) .cp .cp-when-dark { display: inline-block; }
    html:not([data-theme]) .cp .cp-when-light { display: none; }
}

/* limit w pasku */
.cp-limit-chip {
    display: flex; align-items: center; gap: 14px;
    padding: 5px 14px 5px 6px; border: 1px solid var(--cp-border); border-radius: 999px;
    background: var(--cp-surface); color: var(--cp-text) !important; text-decoration: none !important;
    transition: border-color .15s, box-shadow .15s;
}
.cp-limit-chip:hover { border-color: var(--cp-border-strong); box-shadow: var(--cp-shadow-sm); }
.cp-limit-chip__text { display: flex; flex-direction: column; line-height: 1.15; }
.cp-limit-chip__value { font-weight: 650; font-size: .9rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cp-limit-chip__label { font-size: .7rem; color: var(--cp-muted); white-space: nowrap; }

/* licznik sesji */
.cp-session {
    display: inline-flex; align-items: center; gap: 7px;
    height: 34px; padding: 0 12px; border-radius: 999px;
    background: var(--cp-surface-2); border: 1px solid var(--cp-border);
    color: var(--cp-muted); font-size: .85rem; font-weight: 600; font-variant-numeric: tabular-nums;
}
.cp-session.is-ending { color: var(--cp-danger); border-color: var(--cp-danger); background: var(--cp-danger-soft); }

/* menu użytkownika */
.cp-user { position: relative; }
.cp-user__btn {
    display: flex; align-items: center; gap: 10px;
    padding: 4px 10px 4px 4px; border: 0; border-radius: 999px;
    background: transparent; color: var(--cp-text); font-weight: 600; font-size: .9rem; cursor: pointer;
}
.cp-user__btn:hover { background: var(--cp-surface-hover); }
.cp-user__name { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-user__caret { font-size: .7rem; color: var(--cp-muted); }
.cp-avatar {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 50%;
    background: linear-gradient(135deg, #00aeef, #0a6fc9); color: #fff;
    font-size: .78rem; font-weight: 700; letter-spacing: .02em;
}
.cp-user__menu {
    position: absolute; right: 0; top: calc(100% + 8px); z-index: 1050;
    width: 270px; padding: 6px;
    background: var(--cp-surface); border: 1px solid var(--cp-border); border-radius: 12px;
    box-shadow: var(--cp-shadow-lg);
    animation: cp-pop .14s ease-out;
}
.cp-user__menu[hidden] { display: none; }
.cp-user__info { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px 12px; margin-bottom: 4px; border-bottom: 1px solid var(--cp-border); }
.cp-user__info span { color: var(--cp-text-2); font-size: .85rem; overflow-wrap: anywhere; }
.cp-user__info small { color: var(--cp-muted); }
.cp-user__item {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 9px 12px; border: 0; border-radius: 8px; background: transparent;
    color: var(--cp-text) !important; font-size: .9rem; text-align: left; text-decoration: none !important; cursor: pointer;
}
.cp-user__item i { color: var(--cp-muted); }
.cp-user__item:hover { background: var(--cp-surface-hover); }
.cp-user__item--danger, .cp-user__item--danger i { color: var(--cp-danger) !important; }
/* Stary motyw (theme.css) pozycjonuje #logout-button absolutnie w rogu jako ikonę 32×34 px – w menu ma być zwykłą pozycją. */
.cp-user__menu #logout-button,
.dark .cp-user__menu #logout-button {
    position: static; width: 100%; height: auto; background-image: none;
}

/* powiadomienia: dzwonek w pasku, lista, ustawienia */
.cp-bell { position: relative; }
.cp-bell__btn { position: relative; }
.cp-bell__count {
    position: absolute; top: 3px; right: 1px; min-width: 18px; height: 18px; padding: 0 5px;
    border-radius: 99px; background: var(--cp-danger); color: #fff;
    font-size: .68rem; font-weight: 700; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums;
}
.cp-bell__menu {
    position: absolute; right: 0; top: calc(100% + 8px); z-index: 1050;
    width: 360px; max-width: calc(100vw - 24px); padding: 6px;
    background: var(--cp-surface); border: 1px solid var(--cp-border); border-radius: 12px;
    box-shadow: var(--cp-shadow-lg);
    animation: cp-pop .14s ease-out;
}
.cp-bell__menu[hidden] { display: none; }
.cp-bell__head, .cp-bell__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; }
.cp-bell__head { border-bottom: 1px solid var(--cp-border); margin-bottom: 4px; }
.cp-bell__head form { margin: 0; }
.cp-bell__foot { border-top: 1px solid var(--cp-border); margin-top: 4px; }
.cp-bell__link { padding: 0; border: 0; background: none; color: var(--cp-primary) !important; font-size: .85rem; font-weight: 600; cursor: pointer; text-decoration: none !important; }
.cp-bell__link:hover { text-decoration: underline !important; }
.cp-bell__empty { margin: 0; padding: 22px 12px; text-align: center; color: var(--cp-muted); font-size: .9rem; }
.cp-bell__list, .cp-notice-list { list-style: none; margin: 0; padding: 0; }
.cp-bell__list { max-height: min(420px, 60vh); overflow-y: auto; }
.cp-notice {
    position: relative; display: flex; gap: 12px; padding: 10px 12px; border-radius: 8px;
    color: var(--cp-text) !important; text-decoration: none !important;
}
.cp-notice:hover { background: var(--cp-surface-hover); }
.cp-notice__icon { margin-top: 3px; color: var(--cp-muted); }
.cp-notice.is-unread .cp-notice__icon { color: var(--cp-primary); }
.cp-notice.is-unread .cp-notice__title { font-weight: 700; }
.cp-notice__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.cp-notice__title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 600; font-size: .9rem; }
.cp-notice__body { color: var(--cp-text-2); font-size: .85rem; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cp-notice__body--full { display: block; white-space: pre-line; -webkit-line-clamp: unset; }
.cp-notice__time { color: var(--cp-muted); font-size: .75rem; }
.cp-notice-list li + li { border-top: 1px solid var(--cp-border); }
.cp-notice--wide { padding: 16px 20px; border-radius: 0; }
.cp-pager { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 14px; border-top: 1px solid var(--cp-border); color: var(--cp-muted); font-size: .85rem; }
.cp-notify-table td, .cp-notify-table th { vertical-align: middle; }
@media (max-width: 575.98px) {
    /* górny pasek ma backdrop-filter, więc „fixed” liczy się względem paska – menu na całą jego szerokość */
    .cp-bell__menu { position: fixed; left: 12px; right: 12px; top: calc(100% + 6px); width: auto; max-width: none; }
}

@keyframes cp-pop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* stopka */
.cp-footer { display: flex; flex-wrap: wrap; gap: 6px 20px; padding: 18px 32px 26px; color: var(--cp-muted); font-size: .82rem; border-top: 1px solid var(--cp-border); }
.cp-footer a { color: var(--cp-muted) !important; }
.cp-footer a:hover { color: var(--cp-text) !important; }

.cp-to-top {
    position: fixed; right: 20px; bottom: 20px; z-index: 1020;
    display: flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; border: 0; border-radius: 50%;
    background: var(--cp-surface); color: var(--cp-text); box-shadow: var(--cp-shadow-lg);
    opacity: 0; visibility: hidden; transform: translateY(8px);
    transition: opacity .2s, transform .2s, visibility .2s; cursor: pointer;
}
.cp-to-top.is-visible { opacity: 1; visibility: visible; transform: none; }

/* ---------------------------------------------------------------- nagłówek strony */

.cp-page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.cp-page-head h1 { margin: 0; }
.cp-page-sub { margin: 4px 0 0; color: var(--cp-muted); }
.cp-eyebrow { display: block; margin-bottom: 4px; color: var(--cp-muted); font-size: .8rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.cp-back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 10px; color: var(--cp-muted) !important; font-size: .88rem; font-weight: 500; text-decoration: none !important; }
.cp-back:hover { color: var(--cp-text) !important; }
.cp-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* zakładki */
.cp-tabs { display: flex; gap: 4px; margin: 0 0 24px; padding: 4px; overflow-x: auto; scrollbar-width: none; background: var(--cp-surface); border: 1px solid var(--cp-border); border-radius: 12px; width: max-content; max-width: 100%; }
.cp-tabs::-webkit-scrollbar { display: none; }
.cp-tabs__link { flex-shrink: 0; padding: 8px 16px; border-radius: 8px; color: var(--cp-muted) !important; font-weight: 600; font-size: .9rem; text-decoration: none !important; white-space: nowrap; transition: background-color .15s, color .15s; }
.cp-tabs__link:hover { color: var(--cp-text) !important; background: var(--cp-surface-hover); }
.cp-tabs__link.is-active { background: var(--cp-primary-soft); color: var(--cp-primary) !important; }

/* ---------------------------------------------------------------- karty */

.cp-card { background: var(--cp-surface); border: 1px solid var(--cp-border); border-radius: var(--cp-radius); box-shadow: var(--cp-shadow); margin-bottom: 24px; min-width: 0; }
.cp-card__head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--cp-border); }
.cp-card__title { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 1rem; font-weight: 650; }
.cp-card__title i { color: var(--cp-primary); font-size: .95rem; }
.cp-card__sub { color: var(--cp-muted); font-size: .85rem; }
.cp-card__body { padding: 20px; }
.cp-card__body--flush { padding: 0; }
.cp-card__foot { padding: 14px 20px; border-top: 1px solid var(--cp-border); }
.cp-link { font-weight: 600; font-size: .88rem; text-decoration: none !important; }
.cp-link::after { content: " →"; }

.cp-grid { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); }
.cp-grid > .cp-card { margin-bottom: 0; }
@media (min-width: 1100px) {
    .cp-grid--main-aside { grid-template-columns: minmax(0, 1fr) 380px; align-items: start; }
    .cp-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}
.cp-stack { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.cp-stack > .cp-card { margin-bottom: 0; }

/* szybkie akcje na stronie głównej */
.cp-quick { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin-bottom: 24px; }
.cp-quick__item {
    display: flex; align-items: center; gap: 14px; padding: 16px 18px;
    background: var(--cp-surface); border: 1px solid var(--cp-border); border-radius: var(--cp-radius);
    color: var(--cp-text) !important; text-decoration: none !important; box-shadow: var(--cp-shadow);
    transition: transform .15s, border-color .15s, box-shadow .15s;
}
.cp-quick__item:hover { transform: translateY(-2px); border-color: var(--cp-border-strong); box-shadow: var(--cp-shadow-lg); }
.cp-quick__icon { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex-shrink: 0; border-radius: 12px; background: var(--cp-primary-soft); color: var(--cp-primary); font-size: 1.1rem; }
.cp-quick__item--primary { background: linear-gradient(135deg, #0a6fc9 0%, #072849 100%); border-color: transparent; color: #fff !important; }
.cp-quick__item--primary .cp-quick__icon { background: rgba(255, 255, 255, .16); color: #fff; }
.cp-quick__item--primary small { color: rgba(255, 255, 255, .75) !important; }
.cp-quick__item strong { display: block; font-weight: 650; }
.cp-quick__item small { display: block; color: var(--cp-muted); font-size: .8rem; }

/* ---------------------------------------------------------------- limit */

.cp-ring {
    --p: 0;
    --size: 132px;
    --thick: 14px;
    position: relative; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
    width: var(--size); height: var(--size); border-radius: 50%;
    background:
        radial-gradient(closest-side, var(--cp-surface) calc(100% - var(--thick)), transparent calc(100% - var(--thick) + 1px)),
        conic-gradient(from 0deg, #00aeef, #8dc63f calc(var(--p) * .5%), #fdb813 calc(var(--p) * 1%), var(--cp-ring-track) 0);
}
.cp-ring > span { display: flex; flex-direction: column; align-items: center; line-height: 1.1; font-variant-numeric: tabular-nums; }
.cp-ring strong { font-size: 1.6rem; font-weight: 700; }
.cp-ring small { color: var(--cp-muted); font-size: .72rem; }
.cp-ring--sm { --size: 40px; --thick: 5px; font-size: .66rem; font-weight: 700; }
.cp-ring--lg { --size: 136px; }

.cp-limit__top { display: flex; align-items: center; gap: 24px; }
.cp-stats { display: grid; gap: 12px; margin: 0; flex: 1; min-width: 0; }
.cp-stats > div { min-width: 0; }
.cp-stats dt { margin: 0; color: var(--cp-muted); font-size: .8rem; font-weight: 500; }
.cp-stats dd { margin: 0; font-size: 1.05rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.cp-stats--row { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--cp-border); }
.cp-stats--big dd { font-size: 1.4rem; }
.cp .is-positive { color: var(--cp-success) !important; }
.cp .is-negative { color: var(--cp-danger) !important; }

.cp-limit__validity { margin-top: 20px; }
.cp-limit__validity-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 8px; font-size: .85rem; color: var(--cp-muted); }
.cp-limit__validity-head strong { color: var(--cp-text); }
.cp-progress { height: 8px; border-radius: 99px; background: var(--cp-ring-track); overflow: hidden; }
.cp-progress__bar { height: 100%; border-radius: 99px; background: linear-gradient(90deg, #00aeef 0%, #8dc63f 35%, #fdb813 70%, #f42829 100%); background-size: 100vw 100%; }

.cp-kpis { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-bottom: 24px; }
.cp-kpi { padding: 16px 18px; background: var(--cp-surface); border: 1px solid var(--cp-border); border-radius: var(--cp-radius); box-shadow: var(--cp-shadow); }
.cp-kpi__label { display: block; color: var(--cp-muted); font-size: .8rem; font-weight: 500; }
.cp-kpi__value { display: block; margin-top: 4px; font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- listy opisowe */

.cp-dl { display: grid; grid-template-columns: minmax(140px, 220px) minmax(0, 1fr); margin: 0; }
.cp-dl dt, .cp-dl dd { margin: 0; padding: 11px 0; border-bottom: 1px solid var(--cp-border); }
.cp-dl dt { color: var(--cp-muted); font-weight: 500; font-size: .88rem; padding-right: 16px; }
.cp-dl dd { overflow-wrap: anywhere; }
.cp-dl dt:last-of-type, .cp-dl dd:last-of-type { border-bottom: 0; }
.cp-dl dd:empty::before { content: "—"; color: var(--cp-muted); }

/* ---------------------------------------------------------------- przyciski */

.cp-btn, .cp .btn-primary-dark-w {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 42px; padding: 9px 18px;
    border: 1px solid transparent; border-radius: 10px;
    font-family: var(--cp-font); font-size: .92rem; font-weight: 600; line-height: 1.2;
    text-decoration: none !important; white-space: nowrap; cursor: pointer;
    transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s, transform .05s;
}
.cp-btn:active { transform: translateY(1px); }
.cp-btn:disabled, .cp-btn.is-disabled { opacity: .5; cursor: not-allowed; transform: none; }
.cp-btn--primary, .cp .btn-primary-dark-w { background: var(--cp-primary); color: var(--cp-primary-contrast) !important; }
.cp-btn--primary:hover:not(:disabled), .cp .btn-primary-dark-w:hover { background: var(--cp-primary-hover); }
.cp-btn--secondary { background: var(--cp-surface); border-color: var(--cp-border-strong); color: var(--cp-text) !important; }
.cp-btn--secondary:hover:not(:disabled):not(.is-disabled) { background: var(--cp-surface-hover); }
.cp-btn--ghost { background: transparent; color: var(--cp-text-2) !important; }
.cp-btn--ghost:hover { background: var(--cp-surface-hover); }
.cp-btn--danger { background: var(--cp-surface); border-color: var(--cp-border-strong); color: var(--cp-danger) !important; }
.cp-btn--danger:hover:not(:disabled):not(.is-disabled) { background: var(--cp-danger-soft); border-color: var(--cp-danger); }
.cp-btn--success { background: var(--cp-surface); border-color: var(--cp-border-strong); color: var(--cp-success) !important; }
.cp-btn--success:hover { background: var(--cp-success-soft); border-color: var(--cp-success); }
.cp-btn--sm { min-height: 34px; padding: 6px 12px; font-size: .84rem; border-radius: 8px; }
.cp-btn--block { display: flex; width: 100%; }
.cp-btn--icon { width: 40px; min-height: 40px; padding: 0; }
.cp-btn--add { border-style: dashed; }

/* ---------------------------------------------------------------- formularze */

.cp label, .cp .cp-label, .cp .solumus-form-label, .cp .solumus-filter-label { display: block; margin-bottom: 6px; color: var(--cp-text-2); font-size: .85rem; font-weight: 600; }
.cp .form-group { margin-bottom: 18px; }
.cp .form-control, .cp .custom-select {
    height: 44px; padding: 10px 14px;
    background-color: var(--cp-surface); color: var(--cp-text);
    border: 1px solid var(--cp-border-strong); border-radius: 10px;
    font-family: var(--cp-font); font-size: .95rem;
    transition: border-color .15s, box-shadow .15s;
}
.cp textarea.form-control { height: auto; min-height: 96px; resize: vertical; }
.cp select.form-control {
    -webkit-appearance: none; -moz-appearance: none; appearance: none; padding-right: 38px;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat; background-position: right 14px center; background-size: 12px;
}
.cp .form-control::placeholder { color: var(--cp-muted); opacity: .8; }
.cp .form-control:focus { border-color: var(--cp-primary); box-shadow: var(--cp-focus); color: var(--cp-text); background-color: var(--cp-surface); }
.cp .form-control:disabled, .cp .form-control[readonly] { background-color: var(--cp-surface-2); }
.cp .form-control-sm { height: 36px; padding: 6px 10px; font-size: .88rem; }
.cp .form-row { margin-left: -8px; margin-right: -8px; }
.cp .form-row > [class*="col"] { padding-left: 8px; padding-right: 8px; }
.cp .flatpickr-input[readonly] { background-color: var(--cp-surface); cursor: pointer; }
.cp-hint { margin: -10px 0 18px; color: var(--cp-muted); font-size: .82rem; }
.cp-price-indicative { color: var(--cp-muted); }
.cp-order-summary .cp-stats--row { margin-top: 0; }
.cp-order-summary .cp-hint { margin-top: 10px; }
.cp-rows-table .js-product-select { min-width: 110px; }
.cp-position-price { white-space: nowrap; vertical-align: middle !important; font-weight: 600; }
.cp-position-price__value { color: var(--cp-muted); font-size: .82rem; font-weight: 500; }
.cp-form-section { margin: 0 0 14px; font-size: .78rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--cp-muted); }
.cp-form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 8px; }

/* hasło z przyciskiem podglądu */
.cp-password { position: relative; }
.cp-password .form-control { padding-right: 46px; }
.cp-password .toggle-password {
    position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
    display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px;
    border-radius: 8px; color: var(--cp-muted); cursor: pointer;
}
.cp-password .toggle-password:hover { background: var(--cp-surface-hover); color: var(--cp-text); }

/* przełącznik i pola wyboru */
.cp-switch {
    -webkit-appearance: none; appearance: none; position: relative; flex-shrink: 0;
    width: 42px; height: 24px; margin: 0; border-radius: 99px;
    background: var(--cp-border-strong); cursor: pointer; transition: background-color .15s;
}
.cp-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .15s; }
.cp-switch:checked { background: var(--cp-primary); }
.cp-switch:checked::after { transform: translateX(18px); }
.cp input[type="checkbox"]:not(.cp-switch):not(.custom-control-input),
.cp input[type="radio"] { width: 18px; height: 18px; accent-color: var(--cp-primary); vertical-align: middle; cursor: pointer; }
.cp .custom-control-label { font-weight: 500; color: var(--cp-text); }
.cp .custom-control-label::before { background-color: var(--cp-surface); border-color: var(--cp-border-strong); }
.cp .custom-control-input:checked ~ .custom-control-label::before { background-color: var(--cp-primary); border-color: var(--cp-primary); }
.cp .custom-control-input:focus ~ .custom-control-label::before { box-shadow: var(--cp-focus); }
.cp-check-list { display: grid; gap: 4px; margin: 0 0 8px; }
.cp-check { display: flex; align-items: center; gap: 12px; margin: 0; padding: 10px 12px; border: 1px solid var(--cp-border); border-radius: 10px; font-weight: 500 !important; color: var(--cp-text) !important; cursor: pointer; }
.cp-check:hover { background: var(--cp-surface-2); }
.cp-check span { flex: 1; }

/* filtry nad tabelą */
.cp-filters { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); align-items: end; padding: 16px 20px; border-bottom: 1px solid var(--cp-border); background: var(--cp-surface-2); border-radius: var(--cp-radius) var(--cp-radius) 0 0; }
.cp-filters .form-group { margin: 0; }
.cp-filters .cp-btn { width: 100%; }

/* ---------------------------------------------------------------- komunikaty */

.cp-alert { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 20px; padding: 14px 16px; border-radius: 12px; border: 1px solid transparent; font-size: .92rem; }
.cp-alert > i { margin-top: 3px; }
.cp-alert ul { margin: 0; padding-left: 18px; }
.cp-alert--success { background: var(--cp-success-soft); border-color: color-mix(in srgb, var(--cp-success) 30%, transparent); color: var(--cp-success); }
.cp-alert--danger { background: var(--cp-danger-soft); border-color: color-mix(in srgb, var(--cp-danger) 30%, transparent); color: var(--cp-danger); }
.cp-alert--warning { background: var(--cp-warning-soft); border-color: color-mix(in srgb, var(--cp-warning) 30%, transparent); color: var(--cp-warning); }
.cp-alert--info { background: var(--cp-primary-soft); border-color: color-mix(in srgb, var(--cp-primary) 25%, transparent); color: var(--cp-text-2); }
.cp-alert--info > i { color: var(--cp-primary); }
.cp-alert > div { color: inherit; }
.cp .validation-summary-valid { display: none; }

.cp-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: .78rem; font-weight: 600; line-height: 1.5; white-space: nowrap; }
.cp-badge--neutral { background: var(--cp-surface-2); color: var(--cp-text-2); border: 1px solid var(--cp-border); }
.cp-badge--success { background: var(--cp-success-soft); color: var(--cp-success); }
.cp-badge--danger { background: var(--cp-danger-soft); color: var(--cp-danger); }
.cp-badge--dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* statusy zamówień (account/order_row.php) */
.cp .order-status { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.cp .order-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.cp .order-status.status-green { background: var(--cp-success-soft); color: var(--cp-success); }
.cp .order-status.status-red { background: var(--cp-danger-soft); color: var(--cp-danger); }
.cp .order-status.status-black { background: var(--cp-text); color: var(--cp-surface); }
.cp .order-status.status-default { background: var(--cp-surface-2); color: var(--cp-text-2); border: 1px solid var(--cp-border); }

.cp-status-page { max-width: 520px; margin: 6vh auto; padding: 40px 28px; text-align: center; }
.cp-status-page p { margin: 8px 0 24px; }
.cp-status-page__icon { display: inline-flex; align-items: center; justify-content: center; width: 64px; height: 64px; margin-bottom: 16px; border-radius: 50%; background: var(--cp-primary-soft); color: var(--cp-primary); font-size: 1.5rem; }
.cp-status-page__icon.is-negative { background: var(--cp-danger-soft); }
.cp-guest-main > .cp-status-page { margin: 0 16px; position: relative; top: 12vh; }
@media (min-width: 560px) { .cp-guest-main > .cp-status-page { margin: 0 auto; } }

/* rozwijany formularz w wierszu tabeli (zmiana hasła subkonta) */
.cp-details { position: relative; }
.cp-details > summary { list-style: none; }
.cp-details > summary::-webkit-details-marker { display: none; }
.cp-details__panel { position: absolute; right: 0; top: calc(100% + 6px); z-index: 10; width: 240px; padding: 12px; background: var(--cp-surface); border: 1px solid var(--cp-border); border-radius: 12px; box-shadow: var(--cp-shadow-lg); }

.cp-empty { padding: 40px 20px; text-align: center; color: var(--cp-muted); }
.cp-empty i { display: block; margin-bottom: 10px; font-size: 1.8rem; opacity: .5; }

/* ---------------------------------------------------------------- tabele */

.cp-table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.cp .table { margin: 0; color: var(--cp-text); font-size: .9rem; border-collapse: separate; border-spacing: 0; }
.cp .table th, .cp .table td { padding: 12px 16px; border-top: 0; border-bottom: 1px solid var(--cp-border); vertical-align: middle; text-align: left; }
.cp .table thead th {
    position: relative; border-bottom: 1px solid var(--cp-border);
    background: var(--cp-surface-2); color: var(--cp-muted);
    font-size: .75rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap;
}
.cp .table tbody tr:last-child td, .cp .table tbody tr:last-child th { border-bottom: 0; }
.cp .table tbody tr { transition: background-color .1s; }
.cp .table.hover tbody tr:hover, .cp .table.js-datatable tbody tr:hover { background: var(--cp-surface-hover); }
.cp .table tbody th { color: var(--cp-muted); font-weight: 500; }
.cp .table .num, .cp .table .text-right { text-align: right !important; font-variant-numeric: tabular-nums; }
.cp .table .text-center { text-align: center !important; }
.cp .table td.is-strong { font-weight: 650; }
.cp-card .table thead th:first-child { border-top-left-radius: 0; }
#orders_table td { white-space: nowrap; }

/* cennik bazy × produkty – układ jak tabela rabatów w FuelPricingHub, kolory portalu (granat menu, błękit marki) */
.cp { --cp-grid-head-bg: #0b3561; --cp-grid-head-text: #7fd3f7; --cp-grid-head-muted: rgba(255, 255, 255, .62); }
.cp-pricegrid__meta {
    display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px;
    padding: 10px 16px; color: var(--cp-muted); font-size: .8rem;
}
.cp .table.cp-pricegrid thead th {
    background: var(--cp-grid-head-bg); color: var(--cp-grid-head-text); border-bottom: 0;
    padding-top: 13px; padding-bottom: 13px; font-weight: 650; letter-spacing: .06em;
}
.cp .table.cp-pricegrid thead th:first-child { color: var(--cp-grid-head-muted); }
.cp .table.cp-pricegrid tbody tr:nth-child(even) { background: var(--cp-surface-2); }
.cp .table.cp-pricegrid tbody tr:hover { background: var(--cp-primary-soft); }
.cp .table.cp-pricegrid tbody th { color: var(--cp-text); font-weight: 500; white-space: nowrap; }
.cp .table.cp-pricegrid tbody th small { display: block; color: var(--cp-muted); font-size: .75rem; font-weight: 400; }
.cp .table.cp-pricegrid td { white-space: nowrap; font-variant-numeric: tabular-nums; }
.cp .table.cp-pricegrid .cp-pricegrid__value { font-weight: 650; color: var(--cp-text); font-size: .95rem; }
.cp .table.cp-pricegrid .cp-pricegrid__none { color: var(--cp-border-strong); }
html[data-theme="dark"] .cp { --cp-grid-head-bg: #0b1d33; --cp-grid-head-text: #66b6f5; }
@media (prefers-color-scheme: dark) {
    html:not([data-theme]) .cp { --cp-grid-head-bg: #0b1d33; --cp-grid-head-text: #66b6f5; }
}
#orders_table tbody tr.is-selected { background: var(--cp-primary-soft); }

/* tabele edytowalne (pozycje, transport): na telefonie wiersz zamienia się w kartę z etykietami */
.cp-rows-table td { padding: 8px 6px !important; border-bottom: 0 !important; }
.cp-rows-table thead th { padding: 8px 6px !important; background: transparent !important; border-bottom: 0 !important; }
.cp-rows-table td:first-child, .cp-rows-table th:first-child { padding-left: 0 !important; }
.cp-rows-table td:last-child, .cp-rows-table th:last-child { padding-right: 0 !important; width: 48px; }

/* DataTables */
.cp .dataTables_wrapper { padding: 0; }
.cp .dataTables_wrapper .cp-dt-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; }
.cp .dataTables_wrapper .cp-dt-bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--cp-border); }
.cp .dataTables_wrapper .dataTables_filter { margin: 0; flex: 1; display: flex; justify-content: flex-end; }
.cp .dataTables_wrapper .dataTables_filter label { position: relative; display: flex; align-items: center; margin: 0; width: 100%; max-width: 320px; font-size: 0; }
.cp .dataTables_wrapper .dataTables_filter label::before { content: "\f002"; position: absolute; left: 13px; font: 900 .8rem "Font Awesome 5 Free"; color: var(--cp-muted); }
.cp .dataTables_wrapper .dataTables_filter input { width: 100%; height: 40px; margin: 0 !important; padding-left: 36px; font-size: .9rem; }
.cp .dataTables_wrapper .dataTables_info { padding: 0 !important; color: var(--cp-muted); font-size: .85rem; }
.cp .dataTables_wrapper .dataTables_paginate { margin: 0; }
.cp .dataTables_wrapper .pagination { margin: 0 !important; gap: 4px; }
.cp .page-link { min-width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; padding: 0 10px; border: 1px solid var(--cp-border) !important; border-radius: 8px !important; background: var(--cp-surface); color: var(--cp-text-2); font-weight: 600; font-size: .85rem; }
.cp .page-link:hover { background: var(--cp-surface-hover); color: var(--cp-text); }
.cp .page-item.active .page-link { background: var(--cp-primary); border-color: var(--cp-primary) !important; color: var(--cp-primary-contrast); }
.cp .page-item.disabled .page-link { background: var(--cp-surface); color: var(--cp-muted); opacity: .5; }
.cp .dt-buttons { display: flex; flex: 0 0 auto; width: auto; gap: 8px; }
.cp .dataTables_wrapper .cp-dt-top .dataTables_filter { flex: 1 1 180px; }
.cp .dt-buttons .btn {
    display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 14px; margin: 0 !important;
    border: 1px solid var(--cp-border-strong) !important; border-radius: 10px !important; background: var(--cp-surface) !important;
    color: var(--cp-text-2) !important; font-size: .85rem; font-weight: 600;
}
.cp .dt-buttons .btn:hover { background: var(--cp-surface-hover) !important; }
.cp .dt-buttons .btn .fa-file-excel { color: #1d7a45; }
.cp .dt-buttons .btn .fa-file-pdf { color: #c62828; }
.cp table.dataTable { margin: 0 !important; }
.cp table.dataTable td { white-space: nowrap; }
.cp table.dataTable thead .sorting::before, .cp table.dataTable thead .sorting::after,
.cp table.dataTable thead .sorting_asc::before, .cp table.dataTable thead .sorting_asc::after,
.cp table.dataTable thead .sorting_desc::before, .cp table.dataTable thead .sorting_desc::after { bottom: .9em; }
.cp table.dataTable td.dataTables_empty { padding: 32px; color: var(--cp-muted); text-align: center; }

/* ---------------------------------------------------------------- okna dialogowe */

.cp-modal { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(6, 14, 26, .55); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.cp-modal[hidden] { display: none; }
.cp-modal__dialog { width: 100%; max-width: 420px; padding: 24px; background: var(--cp-surface); border-radius: 16px; box-shadow: var(--cp-shadow-lg); animation: cp-pop .16s ease-out; }
.cp-modal__title { margin: 0 0 8px; font-size: 1.15rem; }
.cp-modal__body { margin: 0 0 22px; color: var(--cp-text-2); }
.cp-modal__actions { display: flex; justify-content: flex-end; gap: 10px; }

.cp-cookies { position: fixed; inset: 0; z-index: 1990; align-items: flex-end; justify-content: center; padding: 16px; background: rgba(6, 14, 26, .45); }
.cp-cookies__panel { width: 100%; max-width: 520px; padding: 24px; background: var(--cp-surface); color: var(--cp-text); border-radius: 16px; box-shadow: var(--cp-shadow-lg); animation: cp-pop .2s ease-out; }
.cp-cookies__title { display: flex; align-items: center; gap: 10px; margin: 0 0 6px; font-size: 1.15rem; }
.cp-cookies__title i { color: #c58a32; }
.cp-cookies__list { margin: 16px 0 20px; padding: 0; list-style: none; border: 1px solid var(--cp-border); border-radius: 12px; }
.cp-cookies__list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--cp-border); }
.cp-cookies__list li:last-child { border-bottom: 0; }
.cp-cookies__list label { margin: 0; color: var(--cp-text); font-size: .92rem; font-weight: 500; flex: 1; cursor: pointer; }
@media (min-width: 640px) { .cp-cookies { align-items: center; } }

/* ---------------------------------------------------------------- logowanie */

.cp-guest-main { min-height: 100vh; min-height: 100dvh; }
.cp-auth { display: grid; min-height: 100vh; min-height: 100dvh; grid-template-columns: minmax(0, 1fr); }
.cp-auth__aside { display: none; }
.cp-auth__main { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 20px; }
.cp-auth__card { width: 100%; max-width: 420px; }
.cp-auth__logo { display: block; width: 190px; height: auto; margin: 0 auto 28px; }
.cp-auth__logo--dark { display: none; }
html[data-theme="dark"] .cp .cp-auth__logo--light { display: none; }
html[data-theme="dark"] .cp .cp-auth__logo--dark { display: block; }
@media (prefers-color-scheme: dark) {
    html:not([data-theme]) .cp .cp-auth__logo--light { display: none; }
    html:not([data-theme]) .cp .cp-auth__logo--dark { display: block; }
}
.cp-auth h1 { font-size: 1.6rem; margin-bottom: 6px; }
.cp-auth__lead { margin: 0 0 26px; color: var(--cp-muted); }
.cp-auth__row { display: flex; justify-content: space-between; align-items: center; margin: -6px 0 20px; }
.cp-text-btn { padding: 0; border: 0; background: none; color: var(--cp-primary); font-weight: 600; font-size: .88rem; cursor: pointer; }
.cp-text-btn:hover { color: var(--cp-primary-hover); text-decoration: underline; }
.cp-auth__divider { display: flex; align-items: center; gap: 12px; margin: 24px 0; color: var(--cp-muted); font-size: .82rem; }
.cp-auth__divider::before, .cp-auth__divider::after { content: ""; flex: 1; height: 1px; background: var(--cp-border); }
.cp-auth__terms { margin: 22px 0 0; color: var(--cp-muted); font-size: .8rem; text-align: center; }
.cp-auth__contact { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 18px; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--cp-border); font-size: .88rem; }
.cp-auth__contact a { display: inline-flex; align-items: center; gap: 8px; color: var(--cp-text-2) !important; text-decoration: none !important; }
.cp-auth__contact a:hover { color: var(--cp-primary) !important; }
.cp .loginpage-step:not(.login-step) { display: none; }
.cp .account-request-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

@media (min-width: 992px) {
    .cp-auth { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
    .cp-auth__aside {
        position: relative; display: flex; flex-direction: column; justify-content: space-between;
        padding: 48px 56px; overflow: hidden;
        background: radial-gradient(1200px 600px at -10% 110%, rgba(0, 174, 239, .35), transparent 60%),
                    radial-gradient(800px 500px at 110% -10%, rgba(141, 198, 63, .22), transparent 60%),
                    linear-gradient(160deg, #072849 0%, #0b3561 100%);
        color: #d7e3f2;
    }
    .cp-auth__aside::after {
        content: ""; position: absolute; right: -140px; bottom: -140px; width: 460px; height: 460px; border-radius: 50%;
        border: 60px solid rgba(255, 255, 255, .04);
    }
    .cp-auth__aside .cp-brand span { font-size: 2rem; }
    .cp-auth__aside .cp-brand img { width: 42px; }
    .cp-auth__pitch { position: relative; z-index: 1; max-width: 460px; }
    .cp-auth__pitch h2 { margin: 0 0 14px; color: #fff; font-size: 2.1rem; font-weight: 700; line-height: 1.2; }
    .cp-auth__pitch p { margin: 0 0 26px; color: #b6c8de; font-size: 1.02rem; }
    .cp-auth__features { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
    .cp-auth__features li { display: flex; align-items: center; gap: 12px; color: #e5edf7; }
    .cp-auth__features i { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 10px; background: rgba(255, 255, 255, .08); color: #00aeef; }
    .cp-auth__aside-foot { position: relative; z-index: 1; color: #8ea7c4; font-size: .85rem; }
    .cp-auth__aside-foot a { color: #fff !important; }
    .cp-auth__main { padding: 48px; background: var(--cp-surface); }
    .cp-auth__logo { display: none !important; }
}

/* ---------------------------------------------------------------- flatpickr / select2 w ciemnym motywie */

.cp .flatpickr-calendar { border-radius: 12px; box-shadow: var(--cp-shadow-lg); }
html[data-theme="dark"] .flatpickr-calendar { background: #182233; box-shadow: 0 20px 50px rgba(0, 0, 0, .6); }
html[data-theme="dark"] .flatpickr-calendar .flatpickr-day,
html[data-theme="dark"] .flatpickr-calendar .flatpickr-weekday,
html[data-theme="dark"] .flatpickr-calendar .flatpickr-month,
html[data-theme="dark"] .flatpickr-calendar .flatpickr-current-month input.cur-year,
html[data-theme="dark"] .flatpickr-calendar .flatpickr-monthDropdown-months { color: #e7edf5; fill: #e7edf5; background: transparent; }
html[data-theme="dark"] .flatpickr-calendar .flatpickr-day.flatpickr-disabled { color: #4d5b72; }
html[data-theme="dark"] .flatpickr-calendar .flatpickr-day:hover { background: #243147; border-color: #243147; }
html[data-theme="dark"] .flatpickr-calendar .flatpickr-months .flatpickr-prev-month svg,
html[data-theme="dark"] .flatpickr-calendar .flatpickr-months .flatpickr-next-month svg { fill: #e7edf5; }
.cp .flatpickr-day.selected, .cp .flatpickr-day.selected:hover { background: #0a6fc9; border-color: #0a6fc9; }

/* ---------------------------------------------------------------- responsywność */

@media (max-width: 1279.98px) {
    .cp-limit-chip__text--overdue { display: none; }
}

@media (max-width: 991.98px) {
    .cp-sidebar {
        position: fixed; left: 0; top: 0; bottom: 0;
        transform: translateX(-100%); transition: transform .25s ease;
        box-shadow: none; width: min(300px, 86vw);
    }
    .cp-nav-open .cp-sidebar { transform: none; box-shadow: var(--cp-shadow-lg); }
    .cp-icon-btn.cp-sidebar__close { display: inline-flex; }
    .cp-sidebar__close:hover { background: rgba(255, 255, 255, .08); }
    .cp-backdrop { display: block; position: fixed; inset: 0; z-index: 1035; background: rgba(6, 14, 26, .5); opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s; }
    .cp-nav-open .cp-backdrop { opacity: 1; visibility: visible; }
    .cp-nav-open { overflow: hidden; }
    .cp-icon-btn.cp-burger { display: inline-flex; margin-left: -8px; }
    .cp-brand--compact { display: inline-flex; }
    .cp-topbar { padding: 0 16px; gap: 6px; height: 58px; }
    .cp-content { padding: 20px 16px 32px; }
    .cp-footer { padding: 16px; }
    .cp-user__name, .cp-user__caret { display: none; }
    .cp-user__btn { padding: 3px; }
}

@media (max-width: 767.98px) {
    .cp h1 { font-size: 1.4rem; }
    .cp-limit-chip { padding: 3px; border: 0; background: transparent; }
    .cp-limit-chip__text { display: none; }
    .cp-session { padding: 0 9px; }
    .cp-session i { display: none; }
    .cp-card__head, .cp-card__body { padding-left: 16px; padding-right: 16px; }
    .cp .dataTables_wrapper .cp-dt-top, .cp .dataTables_wrapper .cp-dt-bottom, .cp-filters { padding-left: 16px; padding-right: 16px; }
    .cp .dataTables_wrapper .dataTables_filter label { max-width: none; }
    .cp .dataTables_wrapper .cp-dt-bottom { justify-content: center; }
    .cp .table th, .cp .table td { padding: 10px 12px; }
    .cp-page-head { align-items: stretch; }
    .cp-page-head .cp-actions, .cp-page-head .cp-actions .cp-btn { width: 100%; }
    .cp-limit__top { flex-direction: column; align-items: stretch; }
    .cp-limit__top .cp-ring { align-self: center; }
    .cp-dl { grid-template-columns: minmax(0, 1fr); }
    .cp-dl dt { padding-bottom: 0; border-bottom: 0; font-size: .8rem; }
    .cp-dl dd { padding-top: 2px; }
    .cp-form-actions .cp-btn { flex: 1; }
    .cp-modal__actions .cp-btn { flex: 1; }
    .cp-to-top { right: 14px; bottom: 14px; }

    /* szybkie akcje: dwie kolumny, ikona nad tekstem */
    .cp-quick { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .cp-quick__item { flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; }
    .cp-quick__icon { width: 38px; height: 38px; font-size: 1rem; }
    .cp-quick__item small { display: none; }

    /* edytowalne tabele w formie kart */
    .cp-rows-table thead { display: none; }
    .cp-rows-table, .cp-rows-table tbody { display: block; }
    .cp-rows-table tr {
        display: grid; grid-template-columns: minmax(0, 1fr) 40px; gap: 8px 10px;
        margin-bottom: 12px; padding: 12px; border: 1px solid var(--cp-border); border-radius: 12px; background: var(--cp-surface-2);
    }
    .cp-rows-table td { display: block; padding: 0 !important; width: auto !important; }
    .cp-rows-table td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 4px; color: var(--cp-muted); font-size: .76rem; font-weight: 600; }
    .cp-rows-table td:not(:last-child) { grid-column: 1; }
    .cp-rows-table td:last-child { grid-column: 2; grid-row: 1; align-self: start; }
}

@media (max-width: 420px) {
    .cp-session { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .cp *, .cp *::before, .cp *::after { animation: none !important; transition: none !important; }
}

/* ---------------------------------------------------------------- panel admina */

.api-error-text { max-width: 520px; white-space: pre-wrap; word-break: break-word; font-family: monospace; font-size: 11px; }

/* ---------------------------------------------------------------- wydruk */

@media print {
    body.cp { background: #fff; color: #000; }
    .cp-sidebar, .cp-topbar, .cp-footer, .cp-to-top, .cp-backdrop, .cp-actions, .cp-back, .cp-tabs, .dt-buttons, .dataTables_filter, .dataTables_paginate { display: none !important; }
    .cp-content { padding: 0; max-width: none; }
    .cp-card { box-shadow: none; break-inside: avoid; }
}

/* ---------- przełącznik języka (PL / EN / UA) ---------- */
.cp-lang { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: 10px; background: var(--cp-surface-hover); flex-shrink: 0; }
.cp-lang__item {
    display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 28px; padding: 0 6px;
    border-radius: 7px; font-size: .75rem; font-weight: 600; letter-spacing: .02em; color: var(--cp-text-2); text-decoration: none;
}
.cp-lang__item:hover { color: var(--cp-text); text-decoration: none; }
.cp-lang__item.is-active { background: var(--cp-surface); color: var(--cp-primary); box-shadow: var(--cp-shadow-sm); }
.cp-lang__item:focus-visible { outline: none; box-shadow: var(--cp-focus); }
.cp-guest-lang { position: absolute; top: 16px; right: 16px; z-index: 5; }
.cp-guest-main { position: relative; }
@media (max-width: 420px) { .cp-topbar .cp-lang__item { min-width: 26px; padding: 0 4px; } }

/* ---------------------------------------------------------------- ankiety (/surveys, okno zaproszenia) */
/* Te same style w przeglądarce i w aplikacji mobilnej (WebView): duże pola dotyku, okno jako arkusz od dołu na telefonie. */

.cp-badge--primary { background: var(--cp-primary-soft); color: var(--cp-primary); }
.cp-nav__badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; margin-left: auto; padding: 0 6px; border-radius: 99px; background: #fdb813; color: #072849; font-size: .72rem; font-weight: 700; line-height: 1; }
.cp-user__item .cp-nav__badge { margin-left: 8px; }

.cp-survey-list { display: grid; gap: 16px; }
.cp-survey-item { display: flex; align-items: center; gap: 20px; margin: 0; padding: 20px 24px; }
.cp-survey-item.is-done { opacity: .8; }
.cp-survey-item__body { flex: 1; min-width: 0; }
.cp-survey-item__meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.cp-survey-item__title { margin: 0 0 4px; font-size: 1.1rem; }
.cp-survey-item__desc { margin: 0 0 8px; color: var(--cp-text-2); white-space: pre-line; }
.cp-survey-item__facts, .cp-survey-prompt__facts { display: flex; flex-wrap: wrap; gap: 16px; margin: 0; color: var(--cp-muted); font-size: .85rem; }
.cp-survey-item__facts i, .cp-survey-prompt__facts i { margin-right: 6px; }

.cp-survey { max-width: 760px; margin: 0 auto; }
.cp-survey__head { padding: 24px; }
.cp-survey__head h1 { margin: 0 0 8px; }
.cp-survey__desc { margin: 0; color: var(--cp-text-2); white-space: pre-line; }
.cp-survey__notes { display: grid; gap: 6px; margin: 14px 0 0; padding: 0; list-style: none; color: var(--cp-muted); font-size: .85rem; }
.cp-survey__notes:empty { display: none; }
.cp-survey__notes i { margin-right: 6px; }
.cp-survey__form { display: grid; gap: 16px; margin-top: 16px; }
.cp-survey-q { min-width: 0; margin: 0; padding: 20px 24px; border: 1px solid var(--cp-border); }
.cp-survey-q.is-invalid { border-color: var(--cp-danger); box-shadow: 0 0 0 3px var(--cp-danger-soft); }
.cp-survey-q__title { display: flex; gap: 12px; width: 100%; margin: 0 0 12px; font-size: 1rem; font-weight: 600; color: var(--cp-text); }
.cp-survey-q__num { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--cp-primary-soft); color: var(--cp-primary); font-size: .85rem; }
.cp-survey-q__text { padding-top: 3px; white-space: pre-line; }
.cp-survey-q__req { color: var(--cp-danger); }
.cp-survey-q__help { margin: -4px 0 12px 40px; color: var(--cp-muted); font-size: .85rem; white-space: pre-line; }
.cp-survey-q__error { display: flex; gap: 8px; align-items: center; margin: 10px 0 0; color: var(--cp-danger); font-size: .88rem; font-weight: 500; }
.cp-survey-q .cp-check { min-height: 48px; }
.cp-survey-q .cp-check input { width: 18px; height: 18px; flex: none; accent-color: var(--cp-primary); }
.cp-survey-q .cp-check:has(input:checked) { border-color: var(--cp-primary); background: var(--cp-primary-soft); }
.cp-survey-q .form-control { min-height: 46px; }

.cp-rating { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.cp-rating__item { position: relative; margin: 0; }
.cp-rating__item input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.cp-rating__item span { display: flex; align-items: center; justify-content: center; height: 52px; border: 1px solid var(--cp-border-strong); border-radius: 12px; background: var(--cp-surface); font-size: 1.1rem; font-weight: 700; color: var(--cp-text); cursor: pointer; transition: background-color .12s, border-color .12s; }
.cp-rating__item:hover span { background: var(--cp-surface-hover); }
.cp-rating__item input:checked + span { border-color: var(--cp-primary); background: var(--cp-primary); color: var(--cp-primary-contrast); }
.cp-rating__item input:focus-visible + span { box-shadow: var(--cp-focus); }
.cp-rating__legend { display: flex; justify-content: space-between; gap: 12px; margin-top: 6px; color: var(--cp-muted); font-size: .8rem; }

.cp-survey__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 4px 0 24px; }
.cp-survey__actions .cp-btn--primary { margin-right: auto; }

.cp-status-page__icon.is-positive { background: var(--cp-success-soft); color: var(--cp-success); }
.cp-survey-thanks__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 24px; }

.cp-survey-prompt__dialog { position: relative; max-width: 460px; padding: 28px 24px 22px; }
.cp-survey-prompt__close-form { position: absolute; top: 10px; right: 10px; margin: 0; }
.cp-survey-prompt__icon { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; margin-bottom: 14px; border-radius: 14px; background: var(--cp-primary-soft); color: var(--cp-primary); font-size: 1.3rem; }
.cp-survey-prompt .cp-modal__title { padding-right: 32px; }
.cp-survey-prompt__body { margin-bottom: 12px; white-space: pre-line; max-height: 30vh; overflow-y: auto; }
.cp-survey-prompt__actions { display: grid; gap: 10px; margin-top: 20px; }
.cp-survey-prompt__actions form { margin: 0; }
.cp-survey-prompt__secondary { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 10px; }
.cp-survey-prompt__hint { margin: 2px 0 0; color: var(--cp-muted); font-size: .78rem; text-align: center; }
.cp-survey-prompt .cp-btn { min-height: 46px; justify-content: center; }

@media (max-width: 767.98px) {
    .cp-survey-item { flex-direction: column; align-items: stretch; gap: 14px; padding: 16px; }
    .cp-survey-item__actions .cp-btn { width: 100%; justify-content: center; }
    .cp-survey__head, .cp-survey-q { padding: 16px; }
    .cp-survey-q__help { margin-left: 0; }
    .cp-rating { gap: 6px; }
    .cp-survey__actions { flex-direction: column; align-items: stretch; }
    .cp-survey__actions .cp-btn { justify-content: center; min-height: 48px; margin-right: 0; }

    /* okno zaproszenia jako arkusz od dołu ekranu – wygodne kciukiem, z miejscem na pasek systemowy */
    .cp-survey-prompt { align-items: flex-end; padding: 0; }
    .cp-survey-prompt__dialog { max-width: none; border-radius: 20px 20px 0 0; padding-bottom: calc(22px + env(safe-area-inset-bottom)); animation: cp-sheet .22s ease-out; }
}

@keyframes cp-sheet { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }

/* Weryfikacja dwuetapowa (Views/Account/Mfa.cshtml, Security.cshtml) */
[data-mfa] [hidden] { display: none !important; }
.cp-mfa h1 { display: flex; align-items: center; gap: 10px; }
.cp-mfa__code { font-size: 1.4rem; letter-spacing: .4em; text-align: center; font-variant-numeric: tabular-nums; }
.cp-mfa-list { list-style: none; margin: 0 0 18px; padding: 0; }
.cp-mfa-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--cp-border); }
.cp-mfa-list li > div { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.cp-mfa-list form { margin: 0; }
.cp-subtitle { font-size: 1rem; font-weight: 600; margin: 22px 0 8px; }
.cp-inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.cp-inline-form .form-control { flex: 1 1 200px; max-width: 320px; }
