.sales-avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
}

/* Hardware details rows */
.hw-detail-row td {
    background: rgba(15, 23, 42, .9);
    border-top: 1px dashed rgba(148, 163, 184, .45);
}

/* Lista szczegółów pozycji hardware – szary tekst jak deliverables w WBS */
.hw-detail-list {
    margin: 0;
    padding-left: 1.25rem;
    font-size: .75rem;
    color: var(--muted);
}

.hw-detail-list li {
    margin-bottom: 2px;
    color: inherit;
}

.hw-detail-row input[data-f="detail_desc"] {
    background: rgba(15, 23, 42, .95);
    border-color: #25345e;
}

/* WBS deliverables rows in public view (similar to hardware details) */
.details-row td {
    background: rgba(15, 23, 42, .9);
    border-top: 1px dashed rgba(148, 163, 184, .45);
}

/* Lista opisów zadań WBS – szary tekst jak w hardware */
.details-list {
    margin: 0;
    padding-left: 1.25rem;
    font-size: .75rem;
    color: var(--muted);
}

/* Gantt: ogranicz długość etykiet po lewej stronie */
.g-label,
.g-left-task {
    max-width: 210px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.details-list li {
    margin-bottom: 2px;
    color: inherit;
    text-transform: uppercase;
}

:root {
    --bg: #0b1220;
    --panel: #0b1224;
    --panel-2: #0d1530;
    --card: rgba(13, 22, 44, .7);
    --muted: #94a3b8;
    --text: #e5e7eb;
    --brand: #7aa2ff;
    --accent: #22c55e;
    --danger: #ef4444;
    --border: #1f2a44;
    --shadow: 0 10px 40px rgba(0, 0, 0, .45);
    --radius: 14px;
}

* {
    box-sizing: border-box
}

html,
body {
    height: 100%
}

body {
    margin: 0;
    background: radial-gradient(1200px 600px at 10% -10%, #142042 0, transparent 60%), linear-gradient(180deg, #0a1022 0%, #0b1220 100%);
    color: var(--text);
    font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

/* === Global read-only state dla zamkniętych ofert === */
body.offer-readonly .form-control,
body.offer-readonly .form-select,
body.offer-readonly textarea {
    background-color: #020617;
    opacity: .8;
    cursor: default;
}

/* Read-only: przełączniki/checkboxy (w tym Moduły w ofercie) */
body.offer-readonly .form-check,
body.offer-readonly .form-switch,
body.offer-readonly .form-check-label,
body.offer-readonly #modulesGrid *,
body.offer-readonly input[type="checkbox"] {
    pointer-events: none !important;
}

body.offer-readonly input,
body.offer-readonly textarea,
body.offer-readonly select,
body.offer-readonly button.btn,
body.offer-readonly button.btn-primary,
body.offer-readonly button.btn-ghost,
body.offer-readonly button.btn-danger,
body.offer-readonly button.btn-outline-danger {
    pointer-events: none !important;
}

/* W trybie projektu odblokuj pola (z wyjątkiem Tytułu, Statusu i Daty oferty) */
body.project-mode.offer-readonly input:not(#fldTitle):not(#fldStatus):not(#fldProjectDate),
body.project-mode.offer-readonly select:not(#fldStatus),
body.project-mode.offer-readonly textarea {
    pointer-events: auto !important;
    opacity: 1 !important;
    cursor: text !important;
    background-color: var(--surface, #0d1626) !important;
}

body.project-mode.offer-readonly #fldTitle,
body.project-mode.offer-readonly #fldStatus,
body.project-mode.offer-readonly #fldProjectDate {
    pointer-events: none !important;
    opacity: .8 !important;
    cursor: default !important;
}

/* Read-only: nawigacja w headerze (język, Oferty, Firma, profil) ma zawsze działać */
body.offer-readonly .app-header,
body.offer-readonly .app-header * {
    pointer-events: auto !important;
}

body.offer-readonly .app-header .btn,
body.offer-readonly .app-header .user-chip {
    opacity: 1 !important;
    cursor: pointer !important;
}

/* Wyjątek: select statusu może pozostać aktywny przy wybranych statusach (np. Gotowe do wysłania) */
body.offer-readonly select.keep-enabled {
    pointer-events: auto !important;
    opacity: 1 !important;
}

/* Sidebar (katalogi & oferty) zawsze aktywna – nawet w trybie read-only ofert */
body.offer-readonly .sidebar,
body.offer-readonly .sidebar * {
    pointer-events: auto !important;
}

/* Ale same przyciski w sidebarze nie powinny być przygaszone */

body.offer-readonly .sidebar .btn {
    opacity: 1 !important;
}

/* W trybie read-only wyszukiwarka w sidebarze ma pozostać w pełni aktywna */
body.offer-readonly .sidebar input,
body.offer-readonly .sidebar textarea,
body.offer-readonly .sidebar select {
    pointer-events: auto !important;
    opacity: 1 !important;
    cursor: text !important;
}

body.offer-readonly .btn,
body.offer-readonly .btn-primary,
body.offer-readonly .btn-ghost,
body.offer-readonly .btn-danger,
body.offer-readonly .btn-outline-danger {
    opacity: .65;
}

/* Wyjątki: te przyciski są zawsze aktywne nawet w trybie read-only */
body.offer-readonly #btnMakeTemplate,
body.offer-readonly #btnReopenOffer {
    pointer-events: auto !important;
    opacity: 1 !important;
}

/* Wyjątki: przyciski w zakładce Udostępnianie powinny działać nawet w trybie read-only */
body.offer-readonly #btnShareCreate,
body.offer-readonly #btnShareDisable,
body.offer-readonly #btnShareCopy,
body.offer-readonly #btnShareReload,
body.offer-readonly #btnShareDecisionCopy,
body.offer-readonly #btnShareDecisionReset,
body.offer-readonly #btnSendOffer {
    pointer-events: auto !important;
    opacity: 1 !important;
}


/* Umożliw zawsze kliknięcie przycisków w modalach (np. potwierdzenie, usuwanie) */
body.offer-readonly .modal button,
body.offer-readonly .modal .btn {
    pointer-events: auto !important;
    opacity: 1 !important;
}

/* Read-only: wszystkie pola w modalach (np. Dodaj katalog / ofertę) pozostają aktywne */
body.offer-readonly .modal input,
body.offer-readonly .modal textarea,
body.offer-readonly .modal select {
    pointer-events: auto !important;
    opacity: 1 !important;
    cursor: auto !important;
}

/* Read-only: pozwól przełączać moduł Finanse w konfiguracji projektu */
body.offer-readonly #modulesGrid [data-mod-key="finance"],
body.offer-readonly #modulesGrid [data-mod-key="finance"] *,
body.offer-readonly #modulesGrid .mod-finance,
body.offer-readonly #modulesGrid .mod-finance * {
    pointer-events: auto !important;
    opacity: 1 !important;
}

/* Read-only: selektory wariantów w zakładce Finanse pozostają aktywne */
body.offer-readonly #finVariantFilters select,
body.offer-readonly #finVariantFilters .form-select {
    pointer-events: auto !important;
    opacity: 1 !important;
    cursor: pointer !important;
}

/* Read-only: moduł "Post-project raport" pozostaje edytowalny */
body.offer-readonly #tab-post input,
body.offer-readonly #tab-post textarea,
body.offer-readonly #tab-post select,
body.offer-readonly #tab-post button,
body.offer-readonly #tab-post .btn {
    pointer-events: auto !important;
    opacity: 1 !important;
    cursor: auto !important;
}

a {
    color: inherit;
    text-decoration: none
}

.app-shell {
    min-height: calc(100vh - 64px)
}

/* Top header */
.app-header {
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: saturate(130%) blur(8px);
    background: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, 0));
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.user-chip {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .35rem .6rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(255, 255, 255, .03)
}

.user-chip.muted {
    opacity: .6
}

/* clickable login chip */
.user-chip[role=button] {
    cursor: pointer
}

.user-chip[role=button]:hover {
    border-color: #335493;
    background: rgba(255, 255, 255, .06)
}

/* decorative background */
.bg-decor:before,
.bg-decor:after {
    content: "";
    position: fixed;
    filter: blur(60px);
    opacity: .22;
    z-index: -1;
}

/* Sidebar */
.sidebar {
    width: 420px !important;
    min-width: 420px !important;
    max-width: 420px !important;
    flex: 0 0 320px !important;
    background: linear-gradient(180deg, var(--panel), var(--panel-2));
    box-shadow: var(--shadow);
    border-right: 1px solid var(--border);
    position: sticky;
    top: 64px;
    /* header height */
    height: calc(100vh - 64px);
    display: flex;
    flex-direction: column;
}

.sidebar-scroll {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(122, 162, 255, .3) transparent;
}

.sidebar-scroll::-webkit-scrollbar {
    width: 6px;
}

.sidebar-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-scroll::-webkit-scrollbar-thumb {
    background: rgba(122, 162, 255, .3);
    border-radius: 3px;
}

.sidebar-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(122, 162, 255, .5);
}

.list-group-flush .list-group-item {
    background: transparent;
    border: 0;
    border-bottom: 1px solid rgba(255, 255, 255, .05)
}

.dir-row:hover {
    background: rgba(255, 255, 255, .08);
    transform: translateX(2px);
}

.dir-row {
    position: relative;
    height: 100%;
    cursor: pointer;
    margin-bottom: 2px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .5rem;
    padding: .75rem .5rem;
    border-radius: 12px;
    transition: all .2s ease;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, .02);
}

/* Force white title/icon for directories */
.dir-row .title span {
    color: #fff;
    font-weight: 500;
    transition: color .15s;
}

.dir-row .title i {
    color: #7aa2ff;
    font-size: 1.1rem;
    transition: color .15s, transform .15s;
}

.dir-row:hover .title i {
    color: #9ec5fe;
    transform: scale(1.1);
}

.dir-row.active .title i {
    color: #7aa2ff;
}

.actions {
    opacity: 0;
    transition: opacity .15s;
}

.dir-row:hover .actions {
    opacity: 1 !important;
}

/* Better button styling in actions */
.dir-row .actions .btn {
    padding: .3rem .5rem;
    font-size: .8rem;
    border-radius: 8px;
    transition: all .15s;
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .1);
    color: rgba(255, 255, 255, .8);
}

.dir-row .actions .btn:hover {
    background: rgba(255, 255, 255, .1);
    border-color: rgba(255, 255, 255, .2);
    color: #fff;
    transform: translateY(-1px);
}

.dir-row .actions .btn.text-danger:hover {
    background: rgba(239, 68, 68, .2);
    border-color: rgba(239, 68, 68, .4);
    color: #fca5a5;
}

/* Akcje (3 kropki) w pakietach wariantów – zachowanie jak w listach ofert */
.share-pkg-row .actions {
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s;
}

.share-pkg-row:hover .actions {
    opacity: 1;
    pointer-events: auto;
}

/* Produkty: akcje (3 kropki) w tabeli katalogu */
#prodBody .actions {
    opacity: 1;
    pointer-events: none;
    transition: opacity .15s;
}

#prodBody tr:hover .actions {
    opacity: 1;
    pointer-events: auto;
}

/* Admin katalog: akcje (3 kropki) w tabelach słowników */
#statusBody .actions,
#manuBody .actions,
#suppBody .actions,
#catBody .actions {
    opacity: 1;
    pointer-events: none;
    transition: opacity .15s;
}

#statusBody tr:hover .actions,
#manuBody tr:hover .actions,
#suppBody tr:hover .actions,
#catBody tr:hover .actions {
    opacity: 1;
    pointer-events: auto;
}

.actions.has-toggle .action-list {
    position: absolute;
    right: 0;
    top: 100%;
    bottom: auto;
    margin-top: .4rem;
    background: rgba(255, 255, 255, .95);
    color: #000;
    border: 1px solid rgba(0, 0, 0, .1);
    border-radius: 10px;
    box-shadow: 0 6px 26px rgba(0, 0, 0, .25);
    padding: .35rem 0;
    z-index: 2000;
    min-width: 180px;
    display: none !important;
}

.actions.has-toggle.show-actions .action-list {
    display: none !important;
}

.actions.has-toggle .action-list button {
    width: 100%;
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: .5rem .9rem;
    text-align: left;
    font-size: .85rem;
    color: #000;
}

.actions.has-toggle .action-list button:hover {
    background: rgba(0, 0, 0, .06);
}

.card-list .list-group-item {
    background: rgba(255, 255, 255, .05);
    border: 1px solid var(--border);
    margin-bottom: .6rem;
    border-radius: 12px;
    transition: all .2s ease;
    padding: .75rem 1rem;
    align-items: flex-start;
}

/* Licencje: warianty – karty układają się w kilka rzędów zamiast poziomego scrolla */
#srvVariantsList,
#hwVariantsList,
#variantsList,
.wbs-variants-list {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    padding-bottom: .25rem;
    flex-direction: row;
    align-items: stretch;
    justify-content: flex-start;
}

#variantsList .list-group-item {
    margin-bottom: 0;
}


.card-list .list-group-item:hover,
.wbs-variants-list .list-group-item:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, .08);
    border-color: rgba(122, 162, 255, .3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
}

/* WBS Variants - Modern styling */
.wbs-variants-list .list-group-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1.5px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.wbs-variants-list .list-group-item.active {
    background: rgba(122, 162, 255, 0.12);
    border-color: rgba(122, 162, 255, 0.4);
    box-shadow: 0 2px 8px rgba(122, 162, 255, 0.2);
}

/* Offers list – richer visual row */
/* Offers rows: show actions on hover (parity with .dir-row) */
.card-list .list-group-item .actions,
.wbs-variants-list .list-group-item .actions {
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s;
    position: relative;
    z-index: 2;
}

.card-list .list-group-item:hover .actions,
.wbs-variants-list .list-group-item:hover .actions {
    opacity: 1;
    pointer-events: auto;
}

/* ensure actions are clickable on hover (safety override) */
#dirList .list-group-item:hover .actions {
    pointer-events: auto;
}

/* spacing: first offer separated from folder above */
.collapse .list-group-item:first-child {
    margin-top: 0.5rem;
}

/* Collapse groups for offers - better visual separation */
#dirList .collapse {
    margin-left: 0;
    margin-bottom: .5rem;
    border-left: 2px solid rgba(122, 162, 255, .15);
    padding-left: 1rem;
    transition: all .2s ease;
}

#dirList .collapse.show {
    border-left-color: rgba(122, 162, 255, .3);
}

/* Different folder icon colors for different levels */
.dir-row[data-level="0"] .title i {
    color: #7aa2ff;
}

.dir-row[data-level="1"] .title i {
    color: #8b9aff;
}

.dir-row[data-level="2"] .title i {
    color: #9ca5ff;
}

.dir-row[data-level="3"] .title i {
    color: #adb0ff;
}

.dir-row[data-level="4"] .title i {
    color: #beb5ff;
}

.dir-row[data-level="5"] .title i {
    color: #cfbaff;
}

/* Hierarchical folder structure styles */
.dir-content-group {
    transition: all 0.2s ease;
    overflow: hidden;
}

.dir-content-group.collapse:not(.show) {
    display: none;
}

.dir-content-group.show {
    display: block;
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dir-folder-wrapper {
    width: 100%;
}

.dir-children-container {
    margin-top: 2px;
    display: block;
    width: 100%;
}

.dir-content-group.show .dir-children-container {
    display: block !important;
    visibility: visible;
}

.dir-content-group:not(.show) .dir-children-container {
    display: none;
}

/* Upewnij się, że podfoldery są widoczne gdy parent jest rozwinięty */
.dir-content-group.show .dir-children-container .dir-folder-wrapper {
    display: block;
    width: 100%;
}

.dir-offers-container {
    margin-bottom: 4px;
}

.dir-connector-line {
    pointer-events: none;
    opacity: 0.08;
    transition: opacity 0.2s ease;
}

.dir-row:hover .dir-connector-line {
    opacity: 0.15;
}

/* Kompaktowy styl dla głębokich poziomów */
.dir-folder-wrapper[data-deep="1"] .dir-row {
    min-height: 32px;
}

.dir-folder-wrapper[data-deep="1"] .title {
    font-size: 0.9rem;
    line-height: 1.3;
}

.dir-folder-wrapper[data-deep="1"] .meta {
    opacity: 0.7;
}

.dir-folder-wrapper[data-deep="1"]:hover .meta {
    opacity: 1;
}

.dir-chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease, color 0.2s ease;
}

.dir-chevron:hover {
    color: var(--brand) !important;
    transform: scale(1.1);
}

.dir-chevron.bi-chevron-down {
    transform: rotate(0deg);
}

.dir-row[data-has-children="1"] .title {
    font-weight: 500;
}

.dir-row[data-has-children="0"] .title {
    opacity: 0.9;
}

.offer-title {
    font-weight: 600;
    color: #fff;
    /* pozwól tytułowi zajmować pełną szerokość i zawijać się */
    display: block;
    width: 100%;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    word-break: break-word;
    line-height: 1.4;
    margin-bottom: .2rem;
}

.offer-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1 1 auto;
}

.offer-sub {
    font-size: .8rem;
    color: rgba(255, 255, 255, .65);
    display: flex;
    align-items: center;
    gap: .4rem;
}

/* Empty state */
.empty-state {
    padding: 36px;
    text-align: center;
    color: var(--muted)
}

.empty-state i {
    font-size: 32px;
    opacity: .55
}

.empty-state h6 {
    margin: .6rem 0 .25rem 0;
    color: #dbeafe
}

/* Slide + fade dla ofert */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.fade-in-up {
    animation: slideInUp .18s ease-out both;
}

/* Podczas otwierania collapse — ukryj overflow */
.dir-offers.collapsing {
    overflow: hidden;
}


/* --- Notifications / Toasts --- */
.toast-container {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    z-index: 1080;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
    /* nie blokuj kliknięć w tło */
}

.toast-item {
    min-width: 260px;
    max-width: 360px;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.96);
    /* ciemny, lekko przezroczysty panel */
    color: #e5e7eb;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.45);
    font-size: 0.875rem;
    line-height: 1.4;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.2s ease-out, transform 0.2s ease-out;
    pointer-events: auto;
    /* pozwól kliknąć toast jeśli kiedyś dodamy przycisk */
}

.toast-item.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-item .toast-body {
    flex: 1;
    margin: 0;
    padding: 0;
}

/* warianty kolorystyczne (pasek po lewej) */
.toast-success {
    border-left: 3px solid #22c55e;
}

.toast-error {
    border-left: 3px solid #ef4444;
}

.toast-warning {
    border-left: 3px solid #f59e0b;
}

.toast-info {
    border-left: 3px solid #3b82f6;
}

/* Admin Panel Styling */

/* === Global modal styling (matching Licencje modals) === */
.modal-content {
    background: var(--panel-2);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
}

.modal-header,
.modal-footer {
    background: rgba(255, 255, 255, .05);
    border-color: rgba(255, 255, 255, .08);
}

.modal-body input,
.modal-body textarea {
    background: rgba(12, 19, 40, .85);
    border: 1px solid #25345e;
    color: var(--text);
}

.modal-body input::placeholder,
.modal-body textarea::placeholder {
    color: var(--muted);
}

.btn-close {
    filter: invert(1) grayscale(100%) brightness(150%);
}


/* === GANTT: viewport & bottom scrollbar (scroll only the timeline) === */
.gantt-surface {
    position: relative;
    height: 420px;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior: contain;
}

/* Bright scrollbar for main Gantt viewport */
#gantt.gantt-surface::-webkit-scrollbar {
    height: 12px;
}

#gantt.gantt-surface::-webkit-scrollbar-thumb {
    background: #5a78c9;
    border-radius: 8px;
}

#gantt.gantt-surface::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, .08);
}

/* Firefox */
#gantt.gantt-surface {
    scrollbar-width: thin;
    scrollbar-color: #5a78c9 rgba(255, 255, 255, .08);
}

/* Cienki, zawsze widoczny pasek przewijania pod wykresem */
.gantt-x-scroll {
    height: 14px;
    margin-top: 6px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(255, 255, 255, .03);
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior: contain;
}

.gantt-x-scroll::-webkit-scrollbar {
    height: 12px;
}

.gantt-x-scroll::-webkit-scrollbar-thumb {
    background: #243357;
    border-radius: 8px;
}

.gantt-x-scroll::-webkit-scrollbar-track {
    background: transparent;
}

/* wewnętrzny element ma szerokość równą szerokości SVG */
.gantt-x-inner {
    height: 1px;
}

.gantt-grid {
    grid-column: 1/-1;
    grid-row: 1;
    display: grid;
    height: 2px;
    background: transparent;
}

.gantt-bar {
    height: 18px;
    border-radius: 6px;
    background: rgba(122, 162, 255, .6);
    border: 1px solid rgba(122, 162, 255, .85);
}

/* ===================== WBS & Harmonogram – UI polish ===================== */
/* Project Summary - above sticky header */
#projectSummary {
    position: relative;
    z-index: 1;
}

/* Sticky WBS header (toolbar with "Dodaj fazę") */
.wbs-sticky {
    position: sticky;
    top: 78px;
    /* below main header + tabs; adjust if needed */
    z-index: 15;
    background: rgba(13, 22, 44, 0.95);
    border-radius: var(--radius);
    padding: .75rem 1rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(8px) saturate(120%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    margin-top: 0;
}

.wbs-sticky h6 {
    color: var(--text);
    font-weight: 600;
    letter-spacing: -0.01em;
}

.wbs-sticky h6 i {
    color: var(--brand);
}

/* Grid baseline */
.wbs-grid {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.wbs-grid thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: rgba(13, 22, 44, 0.95);
    backdrop-filter: blur(8px) saturate(120%);
    padding: .75rem 1rem;
    font-weight: 600;
    color: var(--text);
    border-bottom: 1.5px solid var(--border);
    font-size: 0.9rem;
    letter-spacing: -0.01em;
}

.wbs-grid tbody tr+tr td {
    border-top: 1px solid rgba(255, 255, 255, .05);
}

.wbs-grid td {
    padding: .65rem .75rem;
    vertical-align: middle;
    transition: background 0.2s ease;
}

/* Phase vs Task rows - Modern styling */
.wbs-row.phase {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.wbs-row.phase td {
    background: rgba(122, 162, 255, 0.12);
    border-top: 1.5px solid rgba(122, 162, 255, 0.2);
}

.wbs-row.phase td:first-child {
    border-left: 4px solid var(--brand);
    border-top-left-radius: 12px;
    padding-left: 1rem;
}

.wbs-row.phase td:last-child {
    border-top-right-radius: 12px;
}

.wbs-row.task {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.wbs-row.task td {
    background: rgba(255, 255, 255, .02);
    transition: background 0.2s ease;
}

.wbs-row.task:hover td {
    background: rgba(255, 255, 255, .06);
}

/* Ensure drag & drop works */
.wbs-row.phase[draggable="true"],
.wbs-row.task[draggable="true"] {
    pointer-events: auto !important;
    cursor: move !important;
}

.wbs-row.phase[draggable="true"]:hover,
.wbs-row.task[draggable="true"]:hover {
    opacity: 0.95;
}

/* WBS: deliverables / sub-tasks rows (editor view) */
.wbs-row.deliv td {
    padding: .4rem .75rem;
    background: rgba(12, 19, 40, 0.85);
    border-top: 1px dashed rgba(255, 255, 255, 0.08);
}

.wbs-row.deliv i.bi-arrow-return-right {
    font-size: .9rem;
    color: var(--muted);
}

.wbs-row.deliv .deliv-label {
    font-size: .65rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted);
    white-space: nowrap;
}

.wbs-row.deliv textarea[data-f="detail_desc"] {
    background: rgba(12, 19, 40, 0.9);
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text);
    resize: vertical;
    padding: 0.4rem 0.6rem;
    transition: all 0.2s ease;
}

.wbs-row.deliv textarea[data-f="detail_desc"]:focus {
    border-color: var(--brand);
    background: rgba(12, 19, 40, 0.95);
    box-shadow: 0 0 0 4px rgba(122, 162, 255, 0.15);
    outline: none;
}

/* Drag handle */
.wbs-row .handle {
    opacity: .45;
    cursor: grab !important;
    pointer-events: auto !important;
    user-select: none;
    -webkit-user-select: none;
}

.wbs-row .handle:hover {
    opacity: .7;
    cursor: grab !important;
}

.wbs-row .handle:active {
    cursor: grabbing !important;
}

/* Inline controls - Modern styling */
.wbs-grid .form-control,
.wbs-grid .form-select {
    height: 36px;
    padding: .4rem .65rem;
    border-radius: 10px;
    background: rgba(12, 19, 40, 0.8);
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    color: var(--text);
    font-size: 0.9rem;
    transition: all 0.2s ease;
    pointer-events: auto;
}

.wbs-grid .form-control:hover,
.wbs-grid .form-select:hover {
    border-color: rgba(122, 162, 255, 0.3);
    background: rgba(12, 19, 40, 0.9);
}

.wbs-grid .form-control:focus,
.wbs-grid .form-select:focus {
    border-color: var(--brand);
    background: rgba(12, 19, 40, 0.95);
    box-shadow: 0 0 0 4px rgba(122, 162, 255, 0.15);
    outline: none;
}

/* Ensure drag & drop works - input fields should not block dragging */
.wbs-row.phase,
.wbs-row.task {
    position: relative;
}

.wbs-row.phase[draggable="true"],
.wbs-row.task[draggable="true"] {
    cursor: move !important;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.wbs-row.phase[draggable="true"]:hover,
.wbs-row.task[draggable="true"]:hover {
    opacity: 0.95;
}

.wbs-row.phase[draggable="true"] .handle,
.wbs-row.task[draggable="true"] .handle {
    pointer-events: auto;
    cursor: grab !important;
}

.wbs-row.phase[draggable="true"] .handle:active,
.wbs-row.task[draggable="true"] .handle:active {
    cursor: grabbing !important;
}

/* Input fields should allow interaction but not block row dragging */
.wbs-row.phase .form-control,
.wbs-row.phase .form-select,
.wbs-row.task .form-control,
.wbs-row.task .form-select {
    pointer-events: auto;
}

/* Allow dragging from empty space in row, but allow clicks on inputs */
.wbs-row.phase[draggable="true"] td,
.wbs-row.task[draggable="true"] td {
    cursor: move;
    position: relative;
}

.wbs-row.phase[draggable="true"] td .form-control,
.wbs-row.phase[draggable="true"] td .form-select,
.wbs-row.task[draggable="true"] td .form-control,
.wbs-row.task[draggable="true"] td .form-select,
.wbs-row.phase[draggable="true"] td input,
.wbs-row.phase[draggable="true"] td select,
.wbs-row.task[draggable="true"] td input,
.wbs-row.task[draggable="true"] td select {
    cursor: text !important;
    pointer-events: auto !important;
}

/* Buttons and actions should be clickable */
.wbs-row.phase[draggable="true"] td .btn,
.wbs-row.task[draggable="true"] td .btn,
.wbs-row.phase[draggable="true"] td [data-act],
.wbs-row.task[draggable="true"] td [data-act] {
    cursor: pointer !important;
    pointer-events: auto !important;
}

.wbs-grid .form-control.text-end {
    text-align: right;
}

.wbs-grid input[type="date"] {
    min-width: 135px;
}


.wbs-grid .btn-ghost i {
    font-size: 1rem;
}

/* Summary table under WBS - Modern styling */
.wbs-summary {
    border-radius: 12px;
    overflow: hidden;
}

.wbs-summary thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: rgba(13, 22, 44, 0.95);
    backdrop-filter: blur(8px) saturate(120%);
    padding: .75rem 1rem;
    font-weight: 600;
    color: var(--text);
    border-bottom: 1.5px solid var(--border);
    font-size: 0.9rem;
}

.wbs-summary tbody td {
    padding: .65rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.wbs-summary tbody tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}

.wbs-summary tfoot td {
    padding: .75rem 1rem;
    background: rgba(13, 22, 44, 0.5);
    border-top: 1.5px solid var(--border);
    font-weight: 600;
}

/* Gantt - Modern styling */
.gantt-surface {
    position: relative;
    display: grid;
    gap: .4rem;
    padding: 1rem;
    min-height: 180px;
    width: 100%;
    max-width: 100%;
    border: 1.5px solid var(--border);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.02);
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.gantt-surface:hover {
    border-color: rgba(122, 162, 255, 0.2);
    background: rgba(255, 255, 255, 0.03);
}

.gantt-bar {
    height: 18px;
    border-radius: 8px;
    background: rgba(122, 162, 255, .7);
    border: 1px solid rgba(122, 162, 255, .9);
}

.gantt-bar:hover {
    filter: brightness(1.05);
}

/* ===================== WBS – layout & contrast tweaks ===================== */
.wbs-grid .row-title {
    display: grid;
    align-items: center;
    gap: .4rem;
}

/* Faza: toggle + handle + numeracja + tytuł */
.wbs-row.phase .row-title {
    grid-template-columns: 18px 16px auto 1fr;
}

/* Zadanie: tylko handle + numeracja + tytuł (pełna szerokość) */
.wbs-row.task .row-title {
    grid-template-columns: 16px auto 1fr;
}

.wbs-grid .row-title .phase-number,
.wbs-grid .row-title .task-number {
    font-weight: 600;
    color: var(--text-muted, #6c757d);
    user-select: none;
    flex-shrink: 0;
    padding-right: 4px;
    white-space: nowrap;
}

.wbs-grid .row-title .collapse-toggle {
    border: 0;
    background: transparent;
    padding: 0;
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: .7;
}

.wbs-grid .row-title .collapse-toggle:hover {
    opacity: 1;
}

.wbs-grid .row-title .collapse-toggle i {
    font-size: 0.8rem;
    color: #ffffff;
    line-height: 1;
}

.wbs-grid .row-title .handle {
    opacity: .55;
    cursor: grab !important;
    pointer-events: auto !important;
    user-select: none;
    -webkit-user-select: none;
}

.wbs-grid .row-title .handle:hover {
    opacity: .85;
    cursor: grab !important;
}

.wbs-grid .row-title .handle:active {
    cursor: grabbing !important;
}

/* Czytelne pola na ciemnym tle */
.wbs-grid .form-control,
.wbs-grid .form-select,
.wbs-summary .form-control,
.wbs-summary .form-select {
    color: #fff;
    background: rgba(12, 19, 40, .85);
    border-color: #25345e;
}

.wbs-grid input[type="date"] {
    color: #fff;
}

.wbs-grid thead th {
    color: #f8fafc;
}

/* WBS: right-aligned actions in the same row */
.wbs-grid .row-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: .35rem;
}

.wbs-grid .row-actions .btn {
    line-height: 1;
}

/* WBS: calculated read-only numbers (strong contrast) */
.wbs-grid [data-f="sum_estimate"],
.wbs-grid [data-f="sum_buffered"],
.wbs-grid [data-f="est_buf"] {
    color: #fff;
    font-weight: 600;
}

/* Normalize icon button size in WBS header */
.wbs-grid .btn.btn-sm i {
    font-size: 0.85rem;
}

#btnAddPhase i,
#btnReloadWbs i {
    font-size: 0.85rem;
}

/* Unify icon size in secondary tabs (WBS + Harmonogram / Podsumowanie) */
.sub-pills .nav-link i {
    font-size: 0.95rem;
    /* match config tabs */
    line-height: 1;
}

/* Fix: unify icon size in WBS/Harmonogram and Podsumowanie tabs */
.nav.nav-pills.sub-pills .nav-link i {
    font-size: 0.9rem !important;
    width: 1.1rem;
    min-width: 1.1rem;
}

/* WBS: wymuś biały tekst w kolumnie Daty */
.wbs-grid td[data-f="phase_dates"] {
    color: var(--text) !important;
}

/* ========== WBS Summary – polish & phase total ========== */
.wbs-summary thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .03));
    color: #dbeafe;
    border-bottom: 1px solid var(--border);
}

.wbs-summary tbody tr td {
    background: rgba(255, 255, 255, .02);
}

.wbs-summary tbody tr+tr td {
    border-top: 1px solid rgba(255, 255, 255, .06);
}

.wbs-summary tbody tr:hover td {
    background: rgba(255, 255, 255, .04);
}

/* separator fazy + suma kwoty w ostatniej kolumnie */
.wbs-summary .phase-sep td {
    background: rgba(122, 162, 255, .10);
    color: #e5edff;
    border-top: 1px solid rgba(122, 162, 255, .25);
}

.wbs-summary tfoot td {
    background: rgba(255, 255, 255, .06);
}

/* WBS Summary: ensure white text for dark theme */
.wbs-summary thead th,
.wbs-summary tbody td,
.wbs-summary tfoot td {
    color: var(--text) !important;
}

/* ========== WBS Summary - Modern Professional Design ========== */
.wbs-summary-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding: 0;
}

/* Summary Section Card */
.wbs-summary-section {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.75rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.wbs-summary-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--brand), rgba(122, 162, 255, 0.3));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.wbs-summary-section:hover {
    box-shadow: 0 6px 28px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(122, 162, 255, 0.15);
    transform: translateY(-2px);
    border-color: rgba(122, 162, 255, 0.2);
}

.wbs-summary-section:hover::before {
    opacity: 1;
}

/* Header with icon and content */
.wbs-summary-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.wbs-summary-header-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(122, 162, 255, 0.15), rgba(122, 162, 255, 0.05));
    border: 1px solid rgba(122, 162, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.wbs-summary-section:hover .wbs-summary-header-icon {
    background: linear-gradient(135deg, rgba(122, 162, 255, 0.25), rgba(122, 162, 255, 0.1));
    border-color: rgba(122, 162, 255, 0.35);
    transform: scale(1.05);
}

.wbs-summary-header-icon i {
    font-size: 1.25rem;
    color: var(--brand);
}

.wbs-summary-header-content {
    flex: 1;
    min-width: 0;
}

.wbs-summary-title {
    color: var(--text);
    font-weight: 600;
    font-size: 1.125rem;
    letter-spacing: -0.02em;
    margin: 0 0 0.25rem 0;
    line-height: 1.4;
}

.wbs-summary-subtitle {
    color: var(--muted);
    font-size: 0.875rem;
    margin: 0;
    line-height: 1.5;
    font-weight: 400;
}

/* Table Wrapper */
.wbs-summary-table-wrapper {
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    overflow-x: auto;
}

.wbs-summary-table-wrapper::-webkit-scrollbar {
    height: 8px;
}

.wbs-summary-table-wrapper::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 4px;
}

.wbs-summary-table-wrapper::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

.wbs-summary-table-wrapper::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Modern Table Styling */
.wbs-summary-table {
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
}

.wbs-summary-table thead {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
}

.wbs-summary-table thead th {
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: none;
    letter-spacing: 0.01em;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.95) !important;
    position: relative;
}

.wbs-summary-table thead th:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 25%;
    bottom: 25%;
    width: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.wbs-summary-table tbody td {
    padding: 1rem 1.25rem;
    vertical-align: middle;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--text) !important;
    transition: background-color 0.2s ease;
}

.wbs-summary-table tbody tr:hover td {
    background: rgba(255, 255, 255, 0.05);
}

.wbs-summary-table tbody tr:first-child td {
    border-top: none;
}

/* Empty state styling */
.wbs-summary-table tbody tr td.text-muted.text-center {
    padding: 3rem 1.25rem !important;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.35) !important;
    font-style: italic;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

/* Footer styling */
.wbs-summary-table tfoot {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03));
    border-top: 2px solid rgba(255, 255, 255, 0.1);
}

.wbs-summary-table tfoot td {
    padding: 1.25rem 1.25rem;
    font-size: 0.95rem;
    color: var(--text) !important;
    font-weight: 600;
}

.wbs-summary-table tfoot td.fw-bold {
    font-size: 1rem;
    color: var(--brand) !important;
}

/* Phase separator enhancement */
.wbs-summary-table .phase-sep td {
    padding: 1rem 1.25rem;
    font-size: 0.9rem;
    background: rgba(122, 162, 255, 0.08);
    color: rgba(229, 237, 255, 0.95) !important;
    border-top: 1px solid rgba(122, 162, 255, 0.2);
    font-weight: 600;
}

.wbs-summary-table .phase-sep:first-child td {
    border-top: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .wbs-summary-section {
        padding: 1.25rem;
    }
    
    .wbs-summary-header {
        gap: 0.75rem;
        margin-bottom: 1.25rem;
        padding-bottom: 1rem;
    }
    
    .wbs-summary-header-icon {
        width: 40px;
        height: 40px;
    }
    
    .wbs-summary-header-icon i {
        font-size: 1.1rem;
    }
    
    .wbs-summary-title {
        font-size: 1rem;
    }
    
    .wbs-summary-subtitle {
        font-size: 0.8rem;
    }
    
    .wbs-summary-table thead th,
    .wbs-summary-table tbody td,
    .wbs-summary-table tfoot td {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
}

/* Legacy compatibility - keep old class names working */
.wbs-summary {
    border-radius: 12px;
    overflow: hidden;
}

.wbs-summary thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .03));
    color: #dbeafe;
    border-bottom: 1px solid var(--border);
}

.wbs-summary tbody tr td {
    background: rgba(255, 255, 255, .02);
}

.wbs-summary tbody tr+tr td {
    border-top: 1px solid rgba(255, 255, 255, .06);
}

.wbs-summary tbody tr:hover td {
    background: rgba(255, 255, 255, .04);
}

.wbs-summary .phase-sep td {
    background: rgba(122, 162, 255, .10);
    color: #e5edff;
    border-top: 1px solid rgba(122, 162, 255, .25);
}

.wbs-summary tfoot td {
    background: rgba(255, 255, 255, .06);
}

/* WBS: drag & drop hints */
/* Drag & Drop states */
.wbs-grid tr.dragging {
    opacity: 0.6;
    pointer-events: none;
}

.wbs-grid tr.dragging td {
    opacity: .6;
}

.wbs-grid tr.dragging * {
    pointer-events: none !important;
}

.wbs-grid tr.drag-over {
    position: relative;
}

.wbs-grid tr.drag-over td {
    outline: 2px dashed rgba(122, 162, 255, .6);
    outline-offset: -4px;
    background: rgba(122, 162, 255, 0.15) !important;
}

/* WBS: podpowiedź, że przenosi się cały blok fazy */
.wbs-grid tr.phase.dragging td {
    box-shadow: inset 0 0 0 2px rgba(122, 162, 255, .5);
}

/* Ensure rows are draggable */
.wbs-grid tr.phase,
.wbs-grid tr.task {
    -webkit-user-drag: element;
    -khtml-user-drag: element;
    -moz-user-drag: element;
    -o-user-drag: element;
    user-drag: element;
}

/* Gantt: never shrink SVG inside the viewport; always use its intrinsic width */
.gantt-surface .gantt-svg {
    width: auto !important;
    height: auto !important;
    max-width: none !important;
    display: block;
}

/* Day cells with small gutters so days don't visually merge */
.g-day-cell {
    fill: rgba(255, 255, 255, .02);
    /* subtle fill */
    stroke: rgba(255, 255, 255, .06);
    /* thin border to outline each day */
    stroke-width: 0.5;
    rx: 2;
    ry: 2;
    transition: fill 0.2s ease;
}

.g-day-cell:hover {
    fill: rgba(255, 255, 255, .04);
}

/* Slightly dim grid so cell borders are dominant */
.g-grid {
    stroke: rgba(255, 255, 255, .08);
}

.g-task {
    fill: url(#taskGradient);
    opacity: 1;
    stroke: rgba(105, 208, 132, 0.6);
    stroke-width: 1;
    filter: drop-shadow(0 2px 4px rgba(105, 208, 132, 0.3));
    transition: all 0.2s ease;
    cursor: pointer;
}

.g-task:hover {
    fill: url(#taskGradientHover);
    stroke: rgba(105, 208, 132, 0.9);
    filter: drop-shadow(0 4px 8px rgba(105, 208, 132, 0.5));
}

/* --- Gantt refinements: table-like look & labels --- */
.gantt-surface {
    background: rgba(255, 255, 255, .02);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow-x: auto;
    overflow-y: hidden;
}

.gantt-svg {
    font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Arial;
}

.g-bg {
    fill: rgba(255, 255, 255, .02);
    rx: 0;
    ry: 0;
}

.g-grid {
    stroke: rgba(255, 255, 255, .10);
    stroke-width: 1;
}

.g-weekend {
    fill: rgba(255, 255, 255, .08);
    opacity: 0.5;
}

.g-day {
    fill: var(--text);
    font-size: 12px;
    opacity: .9;
}

.g-day-minor {
    fill: rgba(229, 231, 235, .7);
    font-size: 11px;
}

.g-day-major {
    font-weight: 700;
}

.g-label {
    fill: var(--text);
    font-weight: 600;
    font-size: 13px;
}

.g-bar {
    shape-rendering: geometricPrecision;
}

.g-phase {
    fill: url(#phaseGradient);
    opacity: 0.7;
    pointer-events: none;
    /* faza nigdy nie blokuje interakcji */
    stroke: rgba(122, 162, 255, 0.6);
    /* miękki obrys dla czytelnej krawędzi */
    stroke-width: 1.5;
    filter: drop-shadow(0 2px 4px rgba(122, 162, 255, 0.25));
}


.g-task-text {
    fill: #ffffff;
    font-weight: 600;
    font-size: 12px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    pointer-events: none;
}

.g-left-task {
    fill: var(--text);
    font-size: 12px;
    opacity: 0.9;
    font-weight: 500;
}

.g-row {
    stroke: rgba(255, 255, 255, .06);
    stroke-width: 0.5;
}

/* Wyróżnienie dzisiejszej daty */
.g-today {
    stroke: rgba(122, 162, 255, 0.6);
    stroke-width: 2;
    stroke-dasharray: 4, 4;
}

/* Lepsze style dla nagłówka harmonogramu */
.g-label {
    fill: var(--text);
    font-weight: 600;
    font-size: 13px;
    letter-spacing: -0.01em;
}

.g-left-task {
    fill: var(--text);
    font-size: 12px;
    opacity: 0.9;
    font-weight: 500;
}

/* Lepsze style dla harmonogramu - ogólne ulepszenia */
.gantt-svg {
    font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Arial;
}

.g-layer-tasks {
    pointer-events: all;
}

.g-layer-phases {
    pointer-events: none;
}

/* Lepsze style dla siatki */
.g-grid {
    stroke: rgba(255, 255, 255, .08);
    stroke-width: 0.5;
}

/* Lepsze style dla dat */
.g-day {
    fill: var(--text);
    font-size: 12px;
    opacity: 0.85;
    font-weight: 500;
}

.g-day-major {
    font-weight: 700;
    opacity: 1;
    fill: var(--brand);
}

.g-day-minor {
    fill: rgba(229, 231, 235, .7);
    font-size: 11px;
    opacity: 0.75;
}

/* Lepsze style dla tła harmonogramu */
.gantt-surface {
    background: rgba(13, 22, 44, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

/* --- GANTT: shell + toolbar + viewport --- */
.gantt-surface {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .02);
    padding: 0;
    overflow: hidden;
}

/* pasek nad wykresem (z suwakiem zoom) */
.gantt-toolbar {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .5rem .75rem;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, .03);
    position: sticky;
    top: 0;
    z-index: 2;
}

.gantt-toolbar .zoom-wrap {
    display: flex;
    align-items: center;
    gap: .4rem;
    margin-left: auto;
}

.gantt-toolbar input[type="range"] {
    width: 220px;
}

/* tylko wykres przewijamy poziomo */
.gantt-viewport {
    position: relative;
    height: 420px;
    overflow-x: auto;
    overflow-y: hidden;
}

.gantt-viewport:hover {
    overscroll-behavior: contain;
}

/* wheel nie przewija całej strony */

.gantt-canvas {
    position: relative;
    min-width: 1200px;
    height: 100%;
}

/* sticky nagłówek z datami */
.gantt-header {
    position: sticky;
    top: 0;
    z-index: 1;
    background: rgba(13, 22, 44, .92);
    backdrop-filter: blur(4px) saturate(120%);
    border-bottom: 1px solid var(--border);
    padding: 6px 10px;
    color: var(--text);
    font-weight: 600;
    letter-spacing: .02em;
}

.gantt-header .tick {
    display: inline-block;
    opacity: .9;
    padding: 0 12px;
    white-space: nowrap;
}

/* lewa kolumna z nazwami */
.gantt-row-labels {
    position: absolute;
    left: 0;
    top: 36px;
    bottom: 0;
    width: 220px;
    border-right: 1px solid var(--border);
    padding: 12px 10px;
}

.gantt-row-label {
    color: var(--text);
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

/* siatka + bary */
.gantt-grid {
    position: absolute;
    left: 220px;
    right: 0;
    top: 36px;
    bottom: 0;
}

.gantt-gridlines .v {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: rgba(255, 255, 255, .06);
}

.gantt-gridlines .v.major {
    background: rgba(255, 255, 255, .12);
}

.gantt-row {
    position: relative;
    height: 32px;
    display: flex;
    align-items: center;
}

.gantt-bar.phase {
    height: 10px;
    border-radius: 8px;
    background: #7aa2ff;
    opacity: .9;
}

.gantt-bar.task {
    height: 18px;
    border-radius: 6px;
    background: #45b36b;
}

.gantt-sticky-shadow {
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, .06);
}

/* Gantt: tylko timeline się przewija i zostaje w boxie */
#gantt.gantt-surface {
    overflow-x: auto;
    overflow-y: hidden;
    max-width: 100%;
    padding: 8px 0;
}

#gantt.gantt-surface svg {
    display: block;
}

/* Siatka/etykiety */
.gantt-grid text {
    font-size: 11px;
    fill: #cbd5e1;
    opacity: .9;
}

.gantt-grid .tick {
    stroke: rgba(255, 255, 255, .08);
}

.gantt-grid .tick-strong {
    stroke: rgba(255, 255, 255, .14);
}

/* Paski zadań (brak pasków faz) */
.gantt-bar {
    rx: 6px;
    ry: 6px;
}

/* === FIX: prevent page expansion on Gantt zoom; keep scroll only inside the chart === */
main.flex-grow-1,
.tab-content,
.tab-pane,
.card-surface {
    min-width: 0;
    /* allow flex children to shrink, avoid layout overflow */
}

/* Gantt viewport hard guarantees */
.gantt-surface {
    width: 100%;
    max-width: 100%;
    overflow-x: auto !important;
    overflow-y: hidden !important;
}

/* Make SVG not affect outer layout while still expanding internal scroll area */
.gantt-surface svg.gantt-svg {
    display: block;
}

/* Bottom scrollbar spans the card width but never expands the page */
.gantt-x-scroll {
    width: 100%;
    max-width: 100%;
}

/* Project Summary container */
#projectSummary {
    position: relative;
    z-index: 1;
    margin-bottom: 1rem;
}

#projectSummary .card-surface {
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1.5px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    transition: all 0.2s ease;
}

#projectSummary .card-surface:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(122, 162, 255, 0.2);
}

.text-muted {
    color: #4a7bb7 !important;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    opacity: .75;
}

#projectSummary strong {
    font-size: 1.05rem;
    color: var(--text);
    font-weight: 600;
}

.app-header .brand {
    display: flex;
    align-items: center;
    gap: .6rem;
    font-weight: 600;
    letter-spacing: .2px
}

.app-header .brand i {
    font-size: 1.1rem;
    color: var(--brand)
}

.app-header .brand .brand-logo {
    height: 1.65rem;
    width: auto;
    display: inline-block;
    vertical-align: middle;
}

.app-header .hdr-right {
    display: flex;
    align-items: center;
    gap: .5rem
}

/* View toggle switch (Oferty/Projekty) */
.view-toggle-wrapper {
    display: flex;
    align-items: center;
    margin-left: 1.5rem;
}

.view-toggle {
    display: flex;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 4px;
    gap: 4px;
    position: relative;
}

.view-toggle-btn {
    background: transparent;
    border: none;
    color: var(--muted);
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    z-index: 1;
    white-space: nowrap;
}

.view-toggle-btn:hover {
    color: var(--text);
}

.view-toggle-btn.active {
    color: var(--text);
    background: rgba(122, 162, 255, 0.2);
    border-color: rgba(122, 162, 255, 0.3);
    box-shadow: 0 0 0 1px rgba(122, 162, 255, 0.2);
}

.view-toggle-btn span {
    position: relative;
    z-index: 1;
}

.bg-decor:before {
    width: 420px;
    height: 420px;
    left: -120px;
    top: -80px;
    background: radial-gradient(circle at 30% 30%, #7aa2ff 0, transparent 60%)
}

.bg-decor:after {
    width: 520px;
    height: 520px;
    right: -160px;
    bottom: -140px;
    background: radial-gradient(circle at 70% 70%, #22c55e 0, transparent 60%)
}

.sidebar .hdr h2 {
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: .02em;
    text-transform: none;
    color: #fff;
    margin: 0;
    line-height: 1.3;
}

.sidebar .hdr .small {
    font-size: .8rem;
    color: rgba(255, 255, 255, .6);
    margin-top: .2rem;
}

.toolbar {
    gap: .5rem;
}

.sidebar .toolbar .btn {
    transition: all .15s;
}

.sidebar .toolbar .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(122, 162, 255, .2);
}

.input-with-icon {
    position: relative;
}

.input-with-icon i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    opacity: .7;
    color: rgba(122, 162, 255, .8);
    z-index: 1;
    transition: opacity .15s;
}

.input-with-icon .form-control:focus ~ i {
    opacity: 1;
    color: #7aa2ff;
}

.input-with-icon .form-control {
    padding-left: 38px;
    transition: all .15s;
}

.input-with-icon .form-control:focus {
    border-color: rgba(122, 162, 255, .4);
    box-shadow: 0 0 0 3px rgba(122, 162, 255, .1);
}

.dir-row .title {
    display: flex;
    align-items: center;
    gap: .75rem;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    flex: 1 1 auto;
    min-width: 0;
    line-height: 1.4;
}

.dir-row .meta {
    display: flex;
    align-items: center;
    gap: .4rem;
    flex: 0 0 auto;
}

.badge-soft {
    background: rgba(110, 168, 254, .18);
    color: #b7d0ff;
    border: 1px solid rgba(110, 168, 254, .35);
    border-radius: 999px;
    padding: .2rem .6rem;
    font-weight: 600;
    font-size: .8rem;
    min-width: 24px;
    text-align: center;
    transition: all .15s;
    box-shadow: 0 1px 3px rgba(110, 168, 254, .1);
}

.dir-row:hover .badge-soft {
    background: rgba(110, 168, 254, .25);
    border-color: rgba(110, 168, 254, .45);
    transform: scale(1.05);
}

/* === Admin stats (Statystyki) === */
.stats-kpi-label {
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted);
    margin-bottom: .15rem;
}

.stats-kpi-value {
    font-size: 1.6rem;
    font-weight: 600;
    color: #e5edff;
}

.stats-kpi-sub {
    font-size: .8rem;
    color: var(--muted);
}

.stats-progress {
    height: 10px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(15, 23, 42, .9);
    border: 1px solid rgba(148, 163, 184, .45);
}

.stats-progress .progress-bar {
    background: linear-gradient(90deg, #4f46e5, #22c55e);
}

/* Main */
.main-top {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .02))
}

.autosave-hint {
    opacity: .75;
    font-size: .9rem
}

.card-surface {
    background: var(--card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    border-radius: var(--radius)
}

/* Dashboard styling */
.dashboard-view {
    color: var(--text);
}

.dashboard-view .card-title,
.dashboard-view .h3,
.dashboard-view .h4,
.dashboard-view .h5,
.dashboard-view .h6 {
    color: #ffffff;
}

.dashboard-view .text-white {
    color: #ffffff !important;
}

.dashboard-view .text-white-50 {
    color: rgba(255, 255, 255, 0.5) !important;
}

.dashboard-view .list-group-item {
    background-color: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text);
}

.dashboard-view .list-group-item:hover {
    background-color: rgba(255, 255, 255, 0.06);
    border-color: rgba(122, 162, 255, 0.3);
}

.dashboard-view .form-label {
    color: rgba(255, 255, 255, 0.8);
}


.dashboard-view .pagination .page-link {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
}

.dashboard-view .pagination .page-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(122, 162, 255, 0.3);
    color: #ffffff;
}

.dashboard-view .pagination .page-item.active .page-link {
    background-color: var(--brand);
    border-color: var(--brand);
    color: #ffffff;
}

.dashboard-view .pagination .page-item.disabled .page-link {
    background-color: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.3);
}

/* Dashboard offer cards - professional styling */
.dashboard-offer-card {
    display: block;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 14px;
    padding: 1.25rem 1.5rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.dashboard-offer-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--brand) 0%, rgba(122, 162, 255, 0.5) 100%);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.dashboard-offer-card:hover {
    background: rgba(15, 23, 42, 1);
    border-color: rgba(122, 162, 255, 0.35);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(122, 162, 255, 0.1);
    text-decoration: none;
    color: inherit;
}

.dashboard-offer-card:hover::before {
    opacity: 1;
}

.dashboard-offer-card:active {
    transform: translateY(-1px);
}

.dashboard-offer-card .bi {
    transition: transform 0.2s ease;
}

.dashboard-offer-card:hover .bi-chevron-right {
    transform: translateX(4px);
}

.glass {
    backdrop-filter: blur(4px) saturate(120%);
    border-radius: var(--radius)
}

/* Tabs */
.pretty-tabs .nav-link {
    display: flex;
    align-items: center;
    gap: .5rem;
    position: relative;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    min-width: auto;
}

.pretty-tabs .nav-link .tab-label {
    white-space: nowrap;
    transition: all 0.3s ease;
    overflow: hidden;
}

/* Nieaktywne zakładki - tylko ikona */
.pretty-tabs .nav-link:not(.active) .tab-label {
    width: 0;
    opacity: 0;
    margin: 0;
    padding: 0;
}

.pretty-tabs .nav-link:not(.active) {
    padding: 0.5rem;
    min-width: 44px;
    justify-content: center;
    gap: 0.25rem;
}

/* Aktywna zakładka - ikona + tekst */
.pretty-tabs .nav-link.active .tab-label {
    width: auto;
    opacity: 1;
    margin: 0;
    padding: 0;
}

.pretty-tabs .nav-link.active {
    padding: 0.5rem 1rem;
    min-width: auto;
}

/* Badge w tabach statusów - zawsze widoczny */
.pretty-tabs .nav-link .badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
    vertical-align: middle;
    flex-shrink: 0;
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* W nieaktywnych tabach badge jest widoczny obok ikony */
.pretty-tabs .nav-link:not(.active) .badge {
    margin-left: 0.25rem;
}

.nav-tabs {
    border-bottom: 1px solid var(--border)
}

.nav-tabs .nav-link {
    background: rgba(255, 255, 255, .03);
    color: var(--muted);
    border: 1px solid var(--border);
    border-bottom-color: transparent;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

.nav-tabs .nav-link:hover {
    color: #dbeafe;
    background: rgba(255, 255, 255, .05);
}

.nav-tabs .nav-link.active {
    background: rgba(255, 255, 255, .08);
    color: var(--text);
    border-color: rgba(255, 255, 255, .15);
}

.sub-pills .nav-link {
    border-radius: 999px
}

/* Forms */
.form-control,
.form-select {
    background: rgba(12, 19, 40, .75);
    border: 1px solid #1f2a44;
    color: var(--text);
    border-radius: 10px
}

.form-control:disabled,
.form-control[readonly] {
    background: rgba(12, 19, 40, .85);
    border-color: #1f2a44;
    color: var(--text);
    opacity: 1;
}

.form-control:focus,
.form-select:focus {
    border-color: #335493;
    box-shadow: 0 0 0 .25rem rgba(110, 168, 254, .14)
}

/* Select z hierarchią katalogów w modalu przenoszenia */
#modalFolderParent.form-select {
    font-family: 'Monaco', 'Menlo', 'Consolas', 'Courier New', monospace;
    font-size: .9rem;
    line-height: 1.6;
    padding: .5rem .75rem;
    max-height: 300px;
}

#modalFolderParent.form-select option {
    padding: .4rem .5rem;
    white-space: pre;
    font-family: 'Monaco', 'Menlo', 'Consolas', 'Courier New', monospace;
}

/* .card-list .list-group-item:hover - zdefiniowane wcześniej (linia 521) */

.offer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: .75rem;
}

.offer-cell {
    display: flex;
    align-items: center;
    gap: .75rem;
    min-width: 0;
}

.offer-icon {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(122, 162, 255, .15);
    border: 1px solid rgba(122, 162, 255, .3);
    transition: all .15s;
}

.card-list .list-group-item:hover .offer-icon {
    background: rgba(122, 162, 255, .22);
    border-color: rgba(122, 162, 255, .4);
    transform: scale(1.05);
}

/* .offer-meta - zdefiniowane wcześniej (linia 608) */

.card-list .list-group-item:hover .chevron {
    transform: translateX(3px);
    opacity: .85;
}

/* Status pills */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .15rem .55rem;
    border-radius: 999px;
    font-size: .75rem;
    border: 1px solid var(--border);
}

.status-pill.st-draft {
    background: rgba(148, 163, 184, .12);
    color: #cbd5e1;
}

.status-pill.st-preparing {
    background: rgba(251, 191, 36, .14);
    color: #fde047;
    border-color: rgba(251, 191, 36, .35);
}

.status-pill.st-verification {
    background: rgba(59, 130, 246, .14);
    color: #93c5fd;
    border-color: rgba(59, 130, 246, .35);
}

.status-pill.st-ready-to-send {
    background: rgba(34, 197, 94, .14);
    color: #86efac;
    border-color: rgba(34, 197, 94, .35);
}

.status-pill.st-in_review {
    background: rgba(245, 158, 11, .14);
    color: #fcd34d;
    border-color: rgba(245, 158, 11, .35);
}

.status-pill.st-sent {
    background: rgba(59, 130, 246, .14);
    color: #93c5fd;
    border-color: rgba(59, 130, 246, .35);
}

.status-pill.st-accepted {
    background: rgba(34, 197, 94, .14);
    color: #86efac;
    border-color: rgba(34, 197, 94, .35);
}

.status-pill.st-rejected {
    background: rgba(239, 68, 68, .14);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, .35);
}

.status-pill.st-archived {
    background: rgba(100, 116, 139, .12);
    color: #cbd5e1;
}

/* Statusy projektu */
.status-pill.st-waiting {
    background: rgba(251, 191, 36, .14);
    color: #fde047;
    border-color: rgba(251, 191, 36, .35);
}

.status-pill.st-in-progress {
    background: rgba(59, 130, 246, .14);
    color: #93c5fd;
    border-color: rgba(59, 130, 246, .35);
}

.status-pill.st-completed {
    background: rgba(34, 197, 94, .14);
    color: #86efac;
    border-color: rgba(34, 197, 94, .35);
}

.status-pill.st-cancelled {
    background: rgba(239, 68, 68, .14);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, .35);
}

.status-pill.st-no-status {
    background: rgba(148, 163, 184, .12);
    color: #cbd5e1;
}

/* Active highlight for selected offer & directory */
.card-list .list-group-item.active,
.dir-row.active {
    background: rgba(122, 162, 255, .18);
    border-color: rgba(122, 162, 255, .45);
    box-shadow: 0 0 0 2px rgba(122, 162, 255, .15), inset 0 1px 2px rgba(122, 162, 255, .1);
}

.dir-row.active:hover {
    background: rgba(122, 162, 255, .22);
    border-color: rgba(122, 162, 255, .5);
}

.dir-row.active .title span {
    color: #e0edff;
    font-weight: 600;
}

/* Skeleton */
.skeleton {
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, .06);
    border-radius: 10px
}

.skeleton::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .08), transparent);
    animation: shimmer 1.1s infinite
}

@keyframes shimmer {
    100% {
        transform: translateX(100%)
    }
}

/* Save indicator */
.save-indicator {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    font-size: .9rem
}

.save-indicator .dot {
    width: .6rem;
    height: .6rem;
    border-radius: 50%;
    background: #64748b;
    box-shadow: 0 0 0 0 rgba(100, 116, 139, .4);
    animation: pulseOff 2s infinite
}

.save-indicator.saving .dot {
    background: #f59e0b;
    animation: pulse 1.2s infinite
}

.save-indicator.saved .dot {
    background: #22c55e
}

.save-indicator.error .dot {
    background: #ef4444
}

.save-indicator.warning .dot {
    background: #f59e0b
}

/* System powiadomień - taby na środku */
.notifications-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    justify-content: center;
    max-height: 3.5rem;
    overflow: visible;
}

.notification-tab {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.4rem 1.5rem;
    border-radius: 6px;
    font-size: 0.875rem;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s ease;
    position: relative;
    cursor: default;
    min-width: 500px;
    max-width: 750px;
    border: 1px solid;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    z-index: 2147483646;
}

.notification-tab.show {
    opacity: 1;
    transform: scale(1);
}

.notification-tab-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    position: relative;
}

.notification-tab i {
    font-size: 1rem;
    flex-shrink: 0;
}

.notification-count {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 0.1rem 0.4rem;
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 1.2rem;
    text-align: center;
    line-height: 1.2;
    position: absolute;
    top: -0.4rem;
    right: -0.4rem;
}

.notification-tab-message {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Rozwijana lista powiadomień */
.notification-dropdown {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 0.5rem;
    background: rgba(13, 22, 44, 0.95);
    border: 1px solid rgba(122, 162, 255, 0.3);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    min-width: 280px;
    max-width: 400px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 2147483647;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(-10px);
    transition: all 0.3s ease;
    padding: 0.5rem;
}

.notification-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.notification-dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 6px;
    margin-bottom: 0.25rem;
    background: rgba(255, 255, 255, 0.05);
    transition: background 0.2s ease;
}

.notification-dropdown-item:last-child {
    margin-bottom: 0;
}

.notification-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.notification-dropdown-message {
    flex: 1;
    color: #fff;
    font-size: 0.875rem;
    line-height: 1.4;
    word-wrap: break-word;
}

.notification-dropdown-close {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
    flex-shrink: 0;
    width: 1.5rem;
    height: 1.5rem;
}

.notification-dropdown-close:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.notification-dropdown-close i {
    font-size: 0.875rem;
}

/* Scrollbar dla dropdown */
.notification-dropdown::-webkit-scrollbar {
    width: 6px;
}

.notification-dropdown::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.notification-dropdown::-webkit-scrollbar-thumb {
    background: rgba(122, 162, 255, 0.3);
    border-radius: 3px;
}

.notification-dropdown::-webkit-scrollbar-thumb:hover {
    background: rgba(122, 162, 255, 0.5);
}

.notification-tab-close {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    padding: 0.15rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    transition: all 0.2s ease;
    flex-shrink: 0;
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    width: 1.2rem;
    height: 1.2rem;
}

.notification-tab-close:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.notification-tab-close i {
    font-size: 0.75rem;
}

/* Success */
.notification-tab-success {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(34, 197, 94, 0.1));
    border-color: rgba(34, 197, 94, 0.5);
    color: #fff;
}

.notification-tab-success i {
    color: #22c55e;
}

.notification-tab-success:hover {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.3), rgba(34, 197, 94, 0.15));
    border-color: rgba(34, 197, 94, 0.7);
}

/* Warning */
.notification-tab-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(245, 158, 11, 0.1));
    border-color: rgba(245, 158, 11, 0.5);
    color: #fff;
}

.notification-tab-warning i {
    color: #f59e0b;
}

.notification-tab-warning:hover {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.3), rgba(245, 158, 11, 0.15));
    border-color: rgba(245, 158, 11, 0.7);
}

/* Error */
.notification-tab-error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(239, 68, 68, 0.1));
    border-color: rgba(239, 68, 68, 0.5);
    color: #fff;
}

.notification-tab-error i {
    color: #ef4444;
}

.notification-tab-error:hover {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.3), rgba(239, 68, 68, 0.15));
    border-color: rgba(239, 68, 68, 0.7);
}

/* Saving */
.notification-tab-saving {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(245, 158, 11, 0.1));
    border-color: rgba(245, 158, 11, 0.5);
    color: #fff;
}

.notification-tab-saving i {
    color: #f59e0b;
    animation: spin 1s linear infinite;
}

.notification-tab-saving:hover {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.3), rgba(245, 158, 11, 0.15));
    border-color: rgba(245, 158, 11, 0.7);
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, .6)
    }

    70% {
        box-shadow: 0 0 0 8px rgba(245, 158, 11, 0)
    }

    100% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0)
    }
}

@keyframes pulseOff {
    0% {
        box-shadow: 0 0 0 0 rgba(100, 116, 139, .3)
    }

    70% {
        box-shadow: 0 0 0 6px rgba(100, 116, 139, 0)
    }

    100% {
        box-shadow: 0 0 0 0 rgba(100, 116, 139, 0)
    }
}

/* Animations */
.fade-in {
    animation: fadeIn .22s ease-out both
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(6px)
    }

    to {
        opacity: 1;
        transform: none
    }
}

/* Scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: #2c3a60 transparent
}

::-webkit-scrollbar {
    height: 8px;
    width: 8px
}

::-webkit-scrollbar-thumb {
    background: #243357;
    border-radius: 8px
}

::-webkit-scrollbar-track {
    background: transparent
}

/* Admin Panel Styling */
#modalAdminUsers .modal-content {
    background: var(--panel-2);
    backdrop-filter: blur(12px);
}

#adminUsersList .list-group-item {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: .35rem;
    color: var(--text);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .6rem .9rem;
}

#adminUsersList .list-group-item:hover {
    background: rgba(255, 255, 255, .05);
    transform: translateY(-1px);
}

#adminUsersList .role-badge {
    background: rgba(255, 255, 255, .05);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: .15rem .6rem;
    font-size: .75rem;
    opacity: .85;
}

#modalAdminUsers .card {
    background: var(--card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    border-radius: var(--radius);
}


#adminUsersList .btn.btn-sm.btn-ghost.text-danger i {
    color: var(--danger);
}

/* Ensure confirm modal always appears on top */
#modalConfirm {
    z-index: 99999 !important;
}

#modalConfirm .modal-dialog {
    z-index: 99999 !important;
}

/* Roles & Rates table */
.roles-grid {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 .5rem;
    border-radius: 12px;
    overflow: hidden;
}

.roles-grid thead th {
    font-weight: 600;
    color: var(--text);
    font-size: 0.9rem;
    padding: 0.75rem 1rem;
    background: rgba(13, 22, 44, 0.95);
    backdrop-filter: blur(8px) saturate(120%);
    border-bottom: 1.5px solid var(--border);
    letter-spacing: -0.01em;
}

/* Roles & Rates table totals row */
.roles-grid tfoot td {
    padding: .75rem 1rem;
    background: rgba(13, 22, 44, 0.5);
    border-top: 1.5px solid var(--border);
    font-weight: 600;
}

.roles-grid tfoot td:first-child {
    color: var(--text);
}

.roles-row {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    transition: all 0.2s ease;
}

.roles-row:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(122, 162, 255, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.roles-row td {
    padding: .6rem .75rem;
    vertical-align: middle;
}

.roles-row input {
    text-align: right;
    background: rgba(12, 19, 40, 0.8);
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 0.4rem 0.65rem;
    color: var(--text);
    transition: all 0.2s ease;
}

.roles-row input:hover {
    border-color: rgba(122, 162, 255, 0.3);
    background: rgba(12, 19, 40, 0.9);
}

.roles-row input:focus {
    border-color: var(--brand);
    background: rgba(12, 19, 40, 0.95);
    box-shadow: 0 0 0 4px rgba(122, 162, 255, 0.15);
    outline: none;
}

.roles-row input[data-f="role_name"] {
    text-align: left;
}

.roles-actions {
    display: flex;
    gap: .5rem;
    justify-content: flex-end;
    align-items: center;
}

.roles-actions .btn {
    border-radius: 8px;
    padding: 0.35rem 0.65rem;
    transition: all 0.2s ease;
}

.roles-actions .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Profit pill visibility */
.profit-pill {
    display: inline-block;
    min-width: 88px;
    text-align: right;
    padding: .35rem .5rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, .05);
    font-weight: 600;
}

.profit-pos {
    color: #86efac;
    border-color: rgba(34, 197, 94, .35);
    background: rgba(34, 197, 94, .12);
}

.profit-neg {
    color: #fca5a5;
    border-color: rgba(239, 68, 68, .35);
    background: rgba(239, 68, 68, .12);
}

.profit-zero {
    color: #cbd5e1;
    background: rgba(148, 163, 184, .1);
}

/* WBS grid */
.wbs-grid input,
.wbs-grid select {
    min-width: 0;
}

.wbs-sticky {
    position: sticky;
    top: 70px;
    /* dopasuj do wysokości navbara */
    z-index: 50;
    border-radius: 0.75rem;
    border-color: #ffffff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
    padding: 0.5rem 1rem;
    backdrop-filter: blur(6px);
}

.wbs-row.phase {
    background: rgba(122, 162, 255, .08);
}

.wbs-row.task {
    background: rgba(255, 255, 255, .04);
}

.wbs-row .handle {
    cursor: grab;
    opacity: .6;
}

/* === GANTT: viewport & bottom scrollbar (scroll only the timeline) === */
.gantt-surface {
    position: relative;
    height: 420px;
    /* stała wysokość: przewija się tylko wykres */
    max-width: 100%;
    overflow-x: auto;
}


/* --- Clauses: dark table/look --- */
.clauses-grid {
    background: transparent;
    border-color: var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.clauses-grid thead th {
    background: rgba(13, 22, 44, 0.95);
    backdrop-filter: blur(8px) saturate(120%);
    color: var(--text);
    border-color: var(--border) !important;
    padding: 0.75rem 1rem;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: -0.01em;
}

.clauses-grid td,
.clauses-grid th {
    border-color: var(--border) !important;
}

.clauses-grid tbody tr td {
    background: rgba(255, 255, 255, 0.02);
    padding: 0.65rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.2s ease;
}

.clauses-grid tbody tr:hover td {
    background: rgba(255, 255, 255, 0.05);
}

.clauses-grid .new-row td {
    background: rgba(255, 255, 255, 0.05);
    border-top: 1.5px dashed rgba(122, 162, 255, 0.3);
}

.clauses-grid .form-control,
.clauses-grid .form-select,
.clauses-grid textarea {
    background: rgba(12, 19, 40, 0.8) !important;
    border: 1.5px solid rgba(255, 255, 255, 0.1) !important;
    color: var(--text) !important;
    border-radius: 10px !important;
    padding: 0.5rem 0.75rem !important;
    transition: all 0.2s ease !important;
}

.clauses-grid .form-control:hover,
.clauses-grid .form-select:hover,
.clauses-grid textarea:hover {
    border-color: rgba(122, 162, 255, 0.3) !important;
    background: rgba(12, 19, 40, 0.9) !important;
}

.clauses-grid .form-control:focus,
.clauses-grid .form-select:focus,
.clauses-grid textarea:focus {
    border-color: var(--brand) !important;
    background: rgba(12, 19, 40, 0.95) !important;
    box-shadow: 0 0 0 4px rgba(122, 162, 255, 0.15) !important;
    outline: none !important;
}

/* Read-only clause bubble */
.clauses-grid .clause-text {
    display: block;
    padding: .55rem .75rem;
    color: var(--text);
    white-space: pre-wrap;
    font-size: .92rem;
    font-weight: 500;
    background: transparent !important;
    border: none !important;
}

/* Nowe założenie/wykluczenie – większe pole, rośnie z tekstem */
.clauses-grid textarea.clause-input {
    min-height: 60px;
    resize: none;
    overflow: hidden;
    border-radius: 10px;
    font-size: 0.9rem;
}

/* suggestions dropdown already defined; ensure sits above cards below */
.clauses-wrap {
    position: relative;
    z-index: 1;
}

/* === Clauses: suggestions dropdown === */
.clauses-suggest {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    margin-top: 4px;
    background: rgba(13, 22, 44, .98);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow);
    max-height: 220px;
    overflow: auto;
    z-index: 9999;
    /* <- mocny stacking */
    pointer-events: auto;
    color: #fff;
    /* pewny kolor */
}

.clauses-suggest .item {
    padding: .45rem .6rem;
    font-size: .92rem;
    line-height: 1.25rem;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, .04);
    color: #fff;
}

.clauses-suggest .item:last-child {
    border-bottom: 0;
}

/* === Icons: normalize size, color and alignment (dark mode friendly) === */
.bi {
    vertical-align: -0.125em;
    /* lepsze wyrównanie z tekstem */
}

/* ikony w przyciskach dziedziczą kolor tekstu (primary/ghost/danger itd.) */
.btn i,
.row-actions .btn i {
    color: currentColor;
    opacity: .9;
    transition: opacity .15s;
    line-height: 1;
    pointer-events: none;
    /* nie łap klików wyłącznie na <i> */
}

/* hover/focus — pełna widoczność */
.btn:hover i,
.btn:focus i,
.row-actions .btn:hover i,
.row-actions .btn:focus i {
    opacity: 1;
}

/* mniejsze ikonki w .btn-sm, żeby były idealnie na środku */
.btn-sm i {
    font-size: .95rem;
}

/* kosz w ghost + text-danger zachowuje kontrast */
.btn-ghost.text-danger,
.btn-ghost .text-danger {
    color: var(--danger) !important;
}

.clauses-suggest .item:hover {
    background: rgba(122, 162, 255, .14);
}

/* żeby dropdown nie był obcinany przez wrapper tabeli */
.clauses-wrap .table-responsive {
    overflow: visible !important;
}


/* === Clauses: kompaktowe ikonki === */
.clauses-grid .row-actions .btn.btn-sm {
    padding: .35rem .65rem !important;
    border-radius: 8px !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
}

.clauses-grid .row-actions .btn.btn-sm:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.clauses-grid .row-actions .btn i {
    font-size: .9rem !important;
}

.clauses-grid .row-actions .btn-primary {
    background: var(--brand) !important;
    border-color: var(--brand) !important;
}

.clauses-grid .row-actions .btn-primary:hover {
    background: #8bb0ff !important;
    border-color: #8bb0ff !important;
}

.clauses-grid .handle {
    font-size: 1rem;
    opacity: .85;
}

.clauses-grid .handle:hover {
    opacity: 1;
}

.clauses-grid .bi-plus-lg {
    font-size: .9rem !important;
}

/* Ensure inputs inside clauses use white placeholders for consistency */
#assumNewText::placeholder,
#exclNewText::placeholder {
    color: rgba(255, 255, 255, .75) !important;
}

/* --- Clauses: drag & drop + visuals --- */
.clauses-grid .handle {
    color: #fff !important;
    cursor: grab;
    opacity: .9;
}

.clauses-grid tr.dragging {
    opacity: .6;
}

.clauses-grid tr.clause-row {
    user-select: none;
}

/* Suggestions hover highlight (ensure visible on dark) */
.clauses-suggest .item {
    color: #fff !important;
}

.clauses-suggest .item:hover {
    background: rgba(255, 255, 255, .10) !important;
}


/* --- Directory tree with collapsible offers --- */
.dir-tree .dir-item {
    padding: .4rem .5rem;
    border-bottom: 1px solid rgba(255, 255, 255, .05);
}

.dir-tree .dir-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    cursor: pointer;
    border-radius: 10px;
    padding: .45rem .55rem;
}

.dir-tree .dir-head:hover {
    background: rgba(255, 255, 255, .05);
}

.dir-tree .dir-title {
    display: flex;
    align-items: center;
    gap: .5rem;
    min-width: 0;
}

.dir-tree .dir-title .name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dir-tree .chev {
    transition: transform .18s ease;
    opacity: .65;
}

.dir-tree .dir-item.open .chev {
    transform: rotate(90deg);
    opacity: .9;
}

.dir-tree .offers {
    margin: .25rem 0 .4rem 1.4rem;
    border-left: 1px dashed rgba(255, 255, 255, .12);
    padding-left: .7rem;
}

.dir-tree .offer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .35rem .45rem;
    border-radius: 8px;
    cursor: pointer;
}

.dir-tree .offer-row:hover {
    background: rgba(255, 255, 255, .06);
}

.dir-tree .offer-row.active {
    background: rgba(122, 162, 255, .14);
    border: 1px solid rgba(122, 162, 255, .35);
}

.dir-tree .offer-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- Themed modal (global confirm) --- */
.modal .modal-content.card-surface {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    color: var(--text);
}

.modal .modal-header,
.modal .modal-footer {
    border-color: var(--border);
}

.modal .modal-title {
    color: var(--text);
}

.modal .modal-title .bi {
    color: var(--danger);
}

/* Spójne przyciski */
.btn-danger {
    background: var(--danger);
    border-color: var(--danger);
}

.btn-danger:hover {
    filter: brightness(1.05);
}

/* === Licencje (warianty + pozycje) === */
.lic-table .table {
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
}

.lic-table .table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: linear-gradient(180deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .03));
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    white-space: nowrap;
}

.lic-table .table thead th:first-child {
    border-top-left-radius: 10px;
}

.lic-table .table thead th:last-child {
    border-top-right-radius: 10px;
}

.lic-table .table tbody td,
.lic-table .table thead th,
.lic-table .table tfoot td {
    border-color: rgba(255, 255, 255, .06);
}

.lic-table .table tbody tr:hover {
    background: rgba(255, 255, 255, .05);
}

.lic-table .table tfoot td {
    background: rgba(255, 255, 255, .04);
    border-top: 1px solid var(--border);
}

.lic-table .table tfoot td.fw-bold {
    color: var(--accent);
}

.lic-table input.form-control-sm {
    height: 30px;
    padding: .25rem .5rem;
}

.lic-table .row-actions .btn {
    padding: .25rem .45rem;
    border-radius: 8px;
}

.lic-table .row-actions .btn:hover {
    transform: translateY(-1px);
}

.lic-table .new-row td {
    background: rgba(255, 255, 255, .02);
}

.lic-table .new-row .btn-primary {
    white-space: nowrap;
}

/* === Licencje === */
.lic-table .nav-pills .nav-link {
    padding: .25rem .6rem;
    font-weight: 600;
    color: #cbd5e1;
    background: rgba(255, 255, 255, .04);
    border: 1px solid var(--border);
}

.lic-table .nav-pills .nav-link.active {
    color: #e5e7eb;
    background: rgba(255, 255, 255, .08);
}

.lic-table .table thead th,
.lic-table .table tfoot td {
    font-size: .88rem;
}

.lic-table .btn.btn-sm,
.lic-table .row-actions .btn {
    padding: .2rem .4rem;
    line-height: 1.05;
    border-radius: 8px;
}

.lic-table input.form-control-sm {
    height: 28px;
    padding: .2rem .45rem;
    font-size: .9rem;
}

.lic-table .table tbody tr:hover {
    background: rgba(255, 255, 255, .04);
}

.lic-table .gain {
    color: #86efac;
    font-weight: 700;
}

.lic-table .loss {
    color: #fca5a5;
    font-weight: 700;
}

.lic-summary-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.lic-summary-table th,
.lic-summary-table td {
    padding: .5rem .6rem;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.lic-summary-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: linear-gradient(180deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .03));
}

/* === Licencje: ciemny styl tabeli i lepsze puste stany === */
.lic-grid-wrap {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255, 255, 255, .03);
    overflow: hidden;
}

.lic-table .table {
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
}

.lic-table .table thead th {
    color: #cbd5e1;
    background: linear-gradient(180deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .04));
    border-bottom: 1px solid var(--border);
    padding: .5rem .6rem;
    white-space: nowrap;
}

.lic-table .table thead th:first-child {
    border-top-left-radius: 10px;
}

.lic-table .table thead th:last-child {
    border-top-right-radius: 10px;
}

.lic-table .table tbody td {
    background: rgba(255, 255, 255, .02);
    border-top: 1px solid rgba(255, 255, 255, .05);
    padding: .5rem .6rem;
}

.lic-table .table tbody tr:hover td {
    background: rgba(255, 255, 255, .04);
}

.lic-table .table tfoot td {
    background: rgba(255, 255, 255, .04);
    border-top: 1px solid var(--border);
    padding: .6rem .6rem;
}

/* Komórka pustego stanu – bez białej belki */
.lic-table .table tbody tr.empty-row td {
    background: transparent;
    border-top: 0;
    color: var(--muted);
    font-size: 1.05rem;
}


/* === Licencje: VARIANTY — czysty układ i spójne style === */

/* 1) Ikonki w nagłówku sekcji */
#btnAddVariant i,
#btnReloadLic i {
    font-size: 0.9rem;
    line-height: 1;
}

/* 6) Tabela licencji — jasny tekst i placeholdery na ciemnym tle */
.lic-table .form-control {
    color: #ffffff !important;
}

.lic-table .form-control::placeholder {
    color: #c7d2fe;
    opacity: .85;
}

.lic-table .btn.btn-sm i {
    font-size: 1.1rem;
    line-height: 1;
}

/* === Licencje: pełny wiersz "Dodaj pozycję" === */
.lic-table .new-row td {
    background: rgba(255, 255, 255, .03);
    border-top: 1px solid var(--border);
    padding: 0.75rem !important;
}

.lic-table .new-row .btn.w-100 {
    border-radius: 8px;
    font-size: 0.95rem;
    background: rgba(110, 168, 254, .15);
    border: 1px solid rgba(110, 168, 254, .35);
    color: #dbeafe;
    transition: all 0.15s ease;
}

.lic-table .new-row .btn.w-100:hover {
    background: rgba(122, 162, 255, .25);
    transform: translateY(-1px);
    color: #fff;
}

/* === Licencje: wymuś biały tekst w tabeli === */
.lic-table td,
.lic-table th {
    color: var(--text) !important;
}

.lic-table input.form-control,
.lic-table select.form-select {
    color: var(--text) !important;
    background: rgba(12, 19, 40, 0.85);
    border-color: #25345e;
}

/* Licencje – statystyki wariantu */
.lic-variant-stats .stat-chip {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    padding: .4rem .6rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(255, 255, 255, .04);
    min-width: 160px;
}

.lic-variant-stats .stat-chip .label {
    font-size: .75rem;
    color: #9fb2d1;
}

.lic-variant-stats .stat-chip .val {
    font-weight: 700;
    color: #e5efff;
}

/* === Poprawa kontrastu w statystykach wariantu (Licencje) === */
.lic-variant-stats {
    color: var(--text);
}

.lic-variant-stats .small,
.lic-variant-stats label {
    color: #e2e8f0 !important;
    /* lepsza widoczność dla opisów */
}

.lic-variant-stats #statPerCurrency {
    color: #dbeafe !important;
    /* wyróżnij listę walut */
}

.lic-variant-stats #ratesInfo {
    color: #a5b4fc !important;
    /* informacja o dacie NBP – lekko niebieskawa */
}

/* === Logowanie – jasne inputy i tekst === */
#loginForm input.form-control {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text) !important;
}

#loginForm input.form-control::placeholder {
    color: #b0b8c5;
}

#loginForm label.form-label {
    color: #cbd5e1 !important;
}

#loginForm .btn-primary {
    background-color: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

/* === Login panel polish === */
.login-card .form-label {
    color: #e2e8f0 !important;
}

.login-card input.form-control {
    background: rgba(255, 255, 255, .08);
    border-color: rgba(255, 255, 255, .25);
    color: #f8fafc !important;
}

.login-card input.form-control::placeholder {
    color: #b6c2d1;
}

.login-card .btn-primary {
    background-color: var(--brand);
    border-color: var(--brand);
}

.login-card .alert {
    background: rgba(239, 68, 68, .12);
    color: #fecaca;
    border-color: rgba(239, 68, 68, .35);
}

/* Modules grid readability + switches */
#modulesGrid:not(#tab-config #modulesGrid) .form-check-label strong {
    color: var(--text);
}

#modulesGrid:not(#tab-config #modulesGrid) .form-check-input {
    border-color: rgba(255, 255, 255, .5);
}

#modulesGrid:not(#tab-config #modulesGrid) .form-check-input:checked {
    background-color: var(--brand);
    border-color: var(--brand);
}

/* === Moduły w ofercie – czytelność etykiet i opisów w dark mode === */
#modulesGrid:not(#tab-config #modulesGrid) .form-check-label .text-muted,
#modulesGrid:not(#tab-config #modulesGrid) .form-check-label .small {
    color: var(--text) !important;
    opacity: 0.9;
}

#modulesGrid:not(#tab-config #modulesGrid) .form-check:hover .form-check-label .small {
    opacity: 1;
}

/* ==== Sidebar DnD indicators for directories ==== */
.dir-row[draggable="true"] {
    cursor: grab;
}

.dir-row.dragging {
    opacity: .4;
    cursor: grabbing;
    transform: scale(0.98);
}

.dir-row.drop-forbidden {
    outline: 2px dashed rgba(239, 68, 68, .6);
    outline-offset: 2px;
    background: rgba(239, 68, 68, .08) !important;
}

/* Drop indicators */
.dir-drop-indicator {
    height: 0;
    margin: 4px 0;
    position: relative;
    pointer-events: none;
    z-index: 10;
}

.dir-drop-line {
    height: 2px;
    background: linear-gradient(90deg, transparent, #7aa2ff, transparent);
    border-radius: 2px;
    box-shadow: 0 0 8px rgba(122, 162, 255, .6);
    animation: dropPulse 1.5s ease-in-out infinite;
}

@keyframes dropPulse {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 8px rgba(122, 162, 255, .6);
    }
    50% {
        opacity: .7;
        box-shadow: 0 0 12px rgba(122, 162, 255, .8);
    }
}

/* Drop target states */
.dir-row.drop-target-before {
    border-top: 2px solid rgba(122, 162, 255, .5);
    padding-top: calc(.75rem - 2px);
}

.dir-row.drop-target-after {
    border-bottom: 2px solid rgba(122, 162, 255, .5);
    padding-bottom: calc(.75rem - 2px);
}

.dir-row.drop-target-inside {
    background: rgba(122, 162, 255, .15) !important;
    border: 2px solid rgba(122, 162, 255, .4) !important;
    box-shadow: 0 0 0 2px rgba(122, 162, 255, .2), inset 0 0 20px rgba(122, 162, 255, .1);
}

.dir-row.drop-target-inside .title i,
.dir-row.drop-target-inside .title span {
    color: #b8d4ff !important;
}

/* Root drop zone */
.dir-root-drop-zone {
    margin: .5rem 0;
    padding: 1rem;
    border: 2px dashed rgba(122, 162, 255, .3);
    border-radius: 12px;
    background: rgba(122, 162, 255, .05);
    transition: all .2s ease;
    text-align: center;
}

.dir-root-drop-zone.drop-active {
    border-color: rgba(122, 162, 255, .6);
    background: rgba(122, 162, 255, .12);
    box-shadow: 0 0 0 3px rgba(122, 162, 255, .15);
}

.dir-root-drop-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    color: rgba(255, 255, 255, .7);
    font-size: .85rem;
}

.dir-root-drop-zone.drop-active .dir-root-drop-hint {
    color: #b8d4ff;
}

.dir-root-drop-hint i {
    font-size: 1.2rem;
    color: #7aa2ff;
}

.dir-root-drop-zone.drop-active .dir-root-drop-hint i {
    color: #9ec5fe;
    animation: dropPulse 1.5s ease-in-out infinite;
}

/* === Services variants look = Licenses variants === */
#srvVariantsList .list-group-item {
    background: rgba(255, 255, 255, .03);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: .6rem .75rem;
    transition: all .15s ease;
    position: relative;
}

#srvVariantsList .list-group-item:hover {
    background: rgba(122, 162, 255, .08);
    border-color: rgba(122, 162, 255, .3);
}

#srvVariantsList .list-group-item.active {
    background: rgba(122, 162, 255, .15);
    border-color: rgba(122, 162, 255, .35);
    box-shadow: 0 0 0 1px rgba(122, 162, 255, .3) inset;
}

#srvVariantsList .offer-icon {
    margin-left: 6px;
}

#srvVariantsList .offer-meta {
    flex: 1 1 auto;
    min-width: 0;
}

#srvVariantsList .offer-title {
    display: block;
    width: 100%;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#srvVariantsList .offer-sub {
    display: block;
    font-size: .8rem;
    color: #9fb2d1;
}

#srvVariantsList .actions {
    position: absolute;
    top: 8px;
    right: 8px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s ease;
}

#srvVariantsList .list-group-item:hover .actions {
    opacity: 1;
    pointer-events: auto;
}

#srvVariantsList .actions .btn i {
    font-size: .9rem;
    line-height: 1;
}

/* === Services toolbar buttons smaller === */
#btnSrvAddVariant,
#btnSrvReload {
    font-size: 0.85rem !important;
    padding: 0.25rem 0.5rem !important;
    line-height: 1 !important;
    height: auto !important;
}

#btnSrvAddVariant i,
#btnSrvReload i {
    font-size: 0.95rem !important;
}

/* === Dark tables (force) === */
.table-darkish,
.table-darkish thead,
.table-darkish tbody,
.table-darkish tr,
.table-darkish td,
.table-darkish th {
    background-color: var(--panel-2) !important;
    color: var(--text) !important;
    border-color: rgba(255, 255, 255, .08) !important;
}

.table-darkish thead th {
    background: var(--panel) !important;
    font-weight: 600;
}

.table-darkish tbody tr:hover {
    background-color: rgba(255, 255, 255, .04) !important;
}

.table-darkish a {
    color: var(--text);
}

/* Inputs/selecty wewnątrz ciemnych tabelek */
.table-darkish .form-control,
.table-darkish .form-select {
    background: rgba(255, 255, 255, .08) !important;
    border: 1px solid rgba(255, 255, 255, .18) !important;
    color: var(--text) !important;
}

.table-darkish .form-control:focus,
.table-darkish .form-select:focus {
    background: rgba(255, 255, 255, .10) !important;
    border-color: var(--brand) !important;
    box-shadow: 0 0 0 .15rem rgba(122, 162, 255, .25) !important;
    color: var(--text) !important;
}


/* === Clients table row selection === */
.table-darkish tbody tr {
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.table-darkish tbody tr:hover {
    background: rgba(255, 255, 255, .05);
}

.table-darkish tbody tr.selected {
    background: rgba(122, 162, 255, .25);
    border-left: 3px solid var(--brand);
}

.table-darkish th {
    padding: .6rem .75rem;
    font-weight: 600;
    border-bottom: 1px solid var(--border);
}

.table-darkish td {
    padding: .5rem .75rem;
    border-bottom: 1px solid rgba(255, 255, 255, .05);
    vertical-align: middle;
}

.table-darkish tbody tr:hover {
    background: rgba(255, 255, 255, .03);
}

.table-darkish tbody tr:last-child td {
    border-bottom: none;
}

/* Styl inputów w tabelkach (kontakty) */
.table-darkish input.form-control-sm {
    background: rgba(255, 255, 255, .07);
    border: 1px solid rgba(255, 255, 255, .15);
    color: var(--text);
    font-size: .85rem;
    padding: .25rem .4rem;
}

.table-darkish input.form-control-sm:focus {
    background: rgba(255, 255, 255, .1);
    border-color: var(--brand);
    box-shadow: 0 0 0 .1rem rgba(122, 162, 255, .25);
}

.table-darkish input.form-control-sm::placeholder {
    color: var(--muted);
}

/* Guzik dodaj kontakt */
.btn-add-contact {
    background: var(--brand);
    color: #fff;
    font-weight: 500;
    padding: .35rem .75rem;
    border: none;
    border-radius: 4px;
    transition: background .15s;
}

.btn-add-contact:hover {
    background: #89b1ff;
    color: #fff;
}

/* Guzik kosza */
.btn-ghost.text-danger {
    background: rgba(255, 0, 0, .05);
    border-radius: 4px;
}

.btn-ghost.text-danger:hover {
    background: rgba(255, 0, 0, .15);
}

/* === Clients modal (dark tidy form) === */
#modalClient .modal-content.card-surface {
    background: var(--panel-2);
    color: var(--text);
    border: 1px solid var(--border);
    box-shadow: 0 10px 40px rgba(0, 0, 0, .6);
}

#modalClient .modal-header,
#modalClient .modal-footer {
    border-color: var(--border);
}

#modalClient .form-label {
    color: #e8eeff;
    opacity: .9;
    font-weight: 500;
}

#modalClient .form-control {
    background: rgba(255, 255, 255, .07);
    border: 1px solid rgba(255, 255, 255, .15);
    color: var(--text);
}

#modalClient .form-control:focus {
    background: rgba(255, 255, 255, .10);
    border-color: var(--brand);
    box-shadow: 0 0 0 .15rem rgba(122, 162, 255, .25);
    color: var(--text);
}

#modalClient .form-control::placeholder {
    color: var(--muted);
}

/* Grid dla pól w modalu */
#modalClient .modal-body .grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: .75rem .75rem;
}

/* WBS Summary: zysk na zielono / czerwono */
.wbs-profit {
    font-weight: 600;
    color: #86efac;
    /* zielony jak w profit-pill */
}

.wbs-profit.neg {
    color: #fca5a5;
    /* czerwony jak w profit-neg */
}

.decision-banner {
    border-radius: 0.5rem;
    padding: 1rem 1.25rem;
    border: 1px solid transparent;
    margin-top: 0.5rem;
    transition: all 0.3s ease;
}

.decision-banner.accepted {
    background-color: rgba(0, 255, 100, 0.08);
    border-color: rgba(0, 255, 100, 0.3);
    color: #bdf7cf;
}

.decision-banner {
    border-radius: var(--radius);
}

.decision-banner-accepted {
    background: rgba(34, 197, 94, .12);
    border: 1px solid rgba(34, 197, 94, .45);
    color: #bbf7d0;
}

.decision-banner-rejected {
    background: rgba(239, 68, 68, .12);
    border: 1px solid rgba(239, 68, 68, .45);
    color: #fecaca;
}


/* Global placeholder color for all inputs and textareas (force override) */
input::placeholder,
textarea::placeholder,
.form-control::placeholder {
    color: rgba(229, 231, 235, 0.65) !important;
    opacity: 1 !important;
}

/* For WebKit browsers */
input::-webkit-input-placeholder,
textarea::-webkit-input-placeholder {
    color: rgba(229, 231, 235, 0.65) !important;
    opacity: 1 !important;
}

/* For Firefox */
input::-moz-placeholder,
textarea::-moz-placeholder {
    color: rgba(229, 231, 235, 0.65) !important;
    opacity: 1 !important;
}

/* For Edge/IE */
input:-ms-input-placeholder,
textarea:-ms-input-placeholder {
    color: rgba(229, 231, 235, 0.65) !important;
}

input::-ms-input-placeholder,
textarea::-ms-input-placeholder {
    color: rgba(229, 231, 235, 0.65) !important;
}

/* Założenia & Wykluczenia – hierarchia pod-punktów */
.clauses-grid .clause-col {
    padding-top: .35rem;
    padding-bottom: .35rem;
}

.clauses-grid .clause-col.clause-lvl-1 {
    padding-left: 1.5rem;
}

.clauses-grid .clause-col.clause-lvl-2 {
    padding-left: 3rem;
}

.clauses-grid .clause-prefix i {
    color: var(--muted);
    font-size: .85rem;
    margin-top: .15rem;
}

/* WBS variants list – wygląd jak warianty Licencji */
.wbs-variants-list {
    display: flex;
    flex-direction: column;
    gap: .35rem;
}

.wbs-variant-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .45rem .7rem;
    border-radius: 10px;
    background: rgba(15, 23, 42, .95);
    border: 1px solid rgba(148, 163, 184, .35);
    transition: background .15s ease, border-color .15s ease, transform .12s ease;
}

.wbs-variant-card.active {
    background: rgba(37, 99, 235, .35);
    border-color: rgba(129, 140, 248, .9);
    box-shadow: 0 0 0 1px rgba(129, 140, 248, .35);
}

.wbs-variant-main {
    display: flex;
    align-items: center;
    gap: .6rem;
    min-width: 0;
}

.wbs-variant-icon {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, .9);
    border: 1px solid rgba(148, 163, 184, .45);
    flex: 0 0 26px;
}

.wbs-variant-icon i {
    font-size: .95rem;
    color: #e5e7eb;
}

.wbs-variant-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.wbs-variant-title {
    font-size: .9rem;
    font-weight: 600;
    color: #e5e7eb;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wbs-variant-sub {
    font-size: .75rem;
    color: var(--muted);
}

.wbs-variant-actions {
    display: flex;
    align-items: center;
    gap: .25rem;
    flex: 0 0 auto;
}

/* --- Wspólne pigułki wariantów (Usługi, Licencje, Sprzęt, WBS) --- */
.btn-ghost {
    border: 1px solid rgba(148, 163, 184, 0.45);
    border-radius: 12px;
    background-color: rgba(30, 41, 59, 0.6);
    color: #e2e8f0;
    padding: 6px 14px;
    transition:
        background-color 0.18s ease,
        color 0.18s ease,
        border-color 0.18s ease,
        transform 0.12s ease;
}

.btn-ghost:hover {
    background-color: rgba(122, 162, 255, 0.15);
    color: #f8fafc;
    border-color: rgba(148, 163, 184, 0.7);
    transform: translateY(-1px);
}

.btn-ghost.active {
    background: rgba(122, 162, 255, 0.25);
    color: #fff;
    border-color: rgba(122, 162, 255, 0.8);
    box-shadow: inset 0 0 0 1px rgba(122, 162, 255, 0.35);
}

/* Dla wewnętrznego układu pigułki */
.btn-ghost .d-flex.flex-column.text-start span:first-child {
    font-weight: 500;
}

.btn-ghost .small.muted {
    font-size: 0.8rem;
    color: #a3b2d3;
}

/* Klient vs Firma w widoku publicznym */
.client-company-card {
    position: relative;
    overflow: hidden;
}

.client-company-card .section-header .section-title {
    font-size: .7rem;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--muted);
}

.client-company-card .tiny-label {
    font-size: .7rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: rgba(148, 163, 184, .9);
}

.section-pill {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    font-size: .95rem;
    background: rgba(15, 23, 42, .9);
    border: 1px solid var(--border);
}

.section-pill-client {
    background: rgba(59, 130, 246, .18);
    border-color: rgba(59, 130, 246, .55);
    color: #bfdbfe;
}

.section-pill-company {
    background: rgba(34, 197, 94, .16);
    border-color: rgba(34, 197, 94, .5);
    color: #bbf7d0;
}

.client-company-separator {
    border-color: rgba(148, 163, 184, .25);
    opacity: .8;
}

/* Delikatne tło pod danymi firmy – żeby się odcinała od klienta */
.client-company-card .company-block {
    border-radius: 12px;
    padding: 12px 14px 10px;
    background: linear-gradient(90deg, rgba(15, 23, 42, .7), rgba(15, 23, 42, .3));
}

/* Avatar użytkownika (nagłówek / profil) */
.user-avatar-sm {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    object-fit: cover;
    margin-right: .35rem;
    flex-shrink: 0;
}

.profile-avatar-preview {
    width: 120px;
    height: 120px;
    border-radius: 999px;
    object-fit: cover;
    border: 1px solid var(--border);
}

.client-company-logo,
.logo-placeholder {
    width: 150px;
    height: 150px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    object-fit: contain;
}

.logo-placeholder i {
    font-size: 48px;
    color: rgba(255, 255, 255, 0.3);
}

.logo-box {
    width: 150px;
    height: 150px;
    flex-shrink: 0;
}

.wbs-diagram-host {
    min-height: 720px;
    border-radius: var(--radius);
    overflow: hidden;
}

.wbs-diagram-frame {
    width: 100%;
    min-height: 720px;
    border: 0;
    display: block;
}

/* -------------------------------------------------
   Dokumentacja & Notatki – nagłówki i typ-pillki
   ------------------------------------------------- */
.docs-section-heading {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.1rem;
}

/* Ramka typu (LINK / NOTATKA / PLIK) po lewej */
.docs-type-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.9rem;
    border-radius: 999px;
    border: 1px solid var(--border-subtle-color, rgba(255, 255, 255, 0.25));
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
}

.docs-type-label {
    font-weight: 500;
}

/* Dokumentacja & Notatki – wyraźniejsze tytuły sekcji */
.docs-section-heading {
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #e5edff;
    margin-bottom: 0.15rem;
}

.docs-section-heading i {
    color: var(--brand);
    font-size: 1rem;
}

/* Nowoczesny wygląd sekcji dokumentacji */
.docs-section-modern {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 16px;
    transition: all 0.2s ease;
}

.docs-section-modern:hover {
    border-color: rgba(122, 162, 255, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.docs-list-modern {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.docs-item-modern {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 12px;
    padding: 1rem;
    transition: all 0.2s ease;
    position: relative;
}

.docs-item-modern:hover {
    background: rgba(15, 23, 42, 0.85);
    border-color: rgba(122, 162, 255, 0.4);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.docs-item-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.docs-item-title {
    font-size: 1rem;
    font-weight: 600;
    color: #e5e7eb;
    margin: 0;
    flex: 1;
    min-width: 0;
}

.docs-item-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.docs-item-content {
    color: var(--muted);
    font-size: 0.875rem;
    line-height: 1.5;
    word-wrap: break-word;
}

.docs-item-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(148, 163, 184, 0.15);
    font-size: 0.75rem;
    color: var(--muted);
}

.docs-type-pill-modern {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    background: rgba(122, 162, 255, 0.15);
    border: 1px solid rgba(122, 162, 255, 0.3);
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #bfdbfe;
}

.docs-type-pill-modern i {
    font-size: 0.875rem;
}

/* Meeting Notes specific styles */
.meeting-participants-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.6rem;
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 6px;
    font-size: 0.75rem;
    color: #86efac;
}

.meeting-link-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.6rem;
    background: rgba(147, 51, 234, 0.15);
    border: 1px solid rgba(147, 51, 234, 0.3);
    border-radius: 6px;
    font-size: 0.75rem;
    color: #c4b5fd;
}

.participant-row {
    transition: all 0.2s ease;
}

.participant-row:hover {
    background: rgba(15, 23, 42, 0.6) !important;
    border-color: rgba(148, 163, 184, 0.15) !important;
}

/* Subtelne ramki dla listy uczestników */
#meetingParticipantsList {
    border: 1px solid rgba(148, 163, 184, 0.1) !important;
    background: rgba(15, 23, 42, 0.3) !important;
}

.fin-card {
    background: rgba(15, 23, 42, .85);
    border-radius: var(--radius);
    padding: .75rem .9rem;
    border: 1px solid rgba(148, 163, 184, .35);
}

.fin-card .fin-label {
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted);
    margin-bottom: .35rem;
}

.fin-card .fin-value {
    font-size: 1.1rem;
    font-weight: 600;
}

/* .badge-soft - zdefiniowane wcześniej dla folderów (linia 1612) */

/* Teleportowany dropdown sidebar — jak w profilu */
.sidebar-dropdown {
    position: fixed;
    background: rgba(255, 255, 255, .98);
    color: #000;
    border: 1px solid rgba(0, 0, 0, .12);
    border-radius: 12px;
    box-shadow: 0 8px 26px rgba(0, 0, 0, .35);
    padding: .35rem 0;
    z-index: 99999;
    min-width: 120px;
}

.sidebar-dropdown .dropdown-btn {
    width: 100%;
    background: transparent;
    border: 0;
    padding: .55rem .9rem;
    text-align: left;
    font-size: .9rem;
}

.sidebar-dropdown .dropdown-btn:hover {
    background: rgba(0, 0, 0, .06);
}

/* ===================== Unified variants pattern ===================== */
/* Kontenery list wariantów we wszystkich modułach */
#srvVariantsList,
#hwVariantsList,
#variantsList,
.wbs-variants-list {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    padding-bottom: .25rem;
    flex-direction: row;
    align-items: stretch;
}

/* Wspólny układ: 3 kafelki w rzędzie na desktopie, 2 na tablet, 1 na mobile */
#srvVariantsList .list-group-item,
#hwVariantsList .list-group-item,
#variantsList .list-group-item,
.wbs-variants-list .list-group-item {
    flex: 0 0 calc(33.333% - .5rem);
    /* 3 w rzędzie */
    max-width: calc(33.333% - .5rem);
}

/* Tablet: 2 w rzędzie */
@media (max-width: 992px) {

    #srvVariantsList .list-group-item,
    #hwVariantsList .list-group-item,
    #variantsList .list-group-item,
    .wbs-variants-list .list-group-item {
        flex: 0 0 calc(50% - .5rem);
        max-width: calc(50% - .5rem);
    }
}

/* Mobile: 1 w rzędzie */
@media (max-width: 576px) {

    #srvVariantsList .list-group-item,
    #hwVariantsList .list-group-item,
    #variantsList .list-group-item,
    .wbs-variants-list .list-group-item {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* Pojedyncza karta wariantu */
#srvVariantsList .list-group-item,
#hwVariantsList .list-group-item,
#variantsList .list-group-item,
.wbs-variants-list .list-group-item {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin: 0;
    padding: 0.5rem 0.75rem;
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 0.5rem;
    transition: transform 0.12s ease, background 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
    flex: 1 1 240px;
    /* wąskie na małych ekranach, szerzej na większych */
}

/* Hover na karcie wariantu */
#srvVariantsList .list-group-item:hover,
#hwVariantsList .list-group-item:hover,
#variantsList .list-group-item:hover,
.wbs-variants-list .list-group-item:hover {
    transform: translateY(-1px);
    background: rgba(15, 23, 42, 1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

/* Aktywny wariant */
#srvVariantsList .list-group-item.active,
#hwVariantsList .list-group-item.active,
#variantsList .list-group-item.active,
.wbs-variants-list .list-group-item.active {
    border-color: var(--brand);
    box-shadow: 0 0 0 1px rgba(122, 162, 255, 0.6), 0 16px 40px rgba(15, 23, 42, 0.9);
    background: radial-gradient(circle at 0 0, rgba(122, 162, 255, 0.28), rgba(15, 23, 42, 0.98));
}

/* Kolorowa listwa po lewej stronie aktywnego wariantu */
#srvVariantsList .list-group-item.active::before,
#hwVariantsList .list-group-item.active::before,
#variantsList .list-group-item.active::before,
.wbs-variants-list .list-group-item.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 3px;
    border-radius: 999px;
}

/* Wspólne wnętrze karty – korzysta z istniejących klas offer-row / offer-meta */
#srvVariantsList .offer-row,
#hwVariantsList .offer-row,
#variantsList .offer-row,
.wbs-variants-list .offer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
}

#srvVariantsList .offer-cell,
#hwVariantsList .offer-cell,
#variantsList .offer-cell,
.wbs-variants-list .offer-cell {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    flex: 1 1 auto;
    min-width: 0;
}

#srvVariantsList .offer-icon,
#hwVariantsList .offer-icon,
#variantsList .offer-icon,
.wbs-variants-list .offer-icon {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.4);
    flex-shrink: 0;
}

#srvVariantsList .offer-icon i,
#hwVariantsList .offer-icon i,
#variantsList .offer-icon i,
.wbs-variants-list .offer-icon i {
    font-size: 1rem;
    color: #c7d2fe;
}

/* Tytuł i opis wariantu */
#srvVariantsList .offer-title,
#hwVariantsList .offer-title,
#variantsList .offer-title,
.wbs-variants-list .offer-title {
    font-weight: 600;
    color: var(--text);
    font-size: 0.9rem;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

#srvVariantsList .offer-sub,
#hwVariantsList .offer-sub,
#variantsList .offer-sub,
.wbs-variants-list .offer-sub {
    font-size: 0.78rem;
    color: var(--muted);
}

/* Prawa strona – akcje (3 kropki, opcjonalna strzałka) */
#srvVariantsList .actions,
#hwVariantsList .actions,
#variantsList .actions,
.wbs-variants-list .actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s;
}

#srvVariantsList .list-group-item:hover .actions,
#hwVariantsList .list-group-item:hover .actions,
#variantsList .list-group-item:hover .actions,
.wbs-variants-list .list-group-item:hover .actions {
    opacity: 1;
    pointer-events: auto;
}

#srvVariantsList .actions .btn,
#hwVariantsList .actions .btn,
#variantsList .actions .btn,
.wbs-variants-list .actions .btn {
    padding-inline: 0.25rem;
}

#srvVariantsList .chevron,
#hwVariantsList .chevron,
#variantsList .chevron,
.wbs-variants-list .chevron {
    font-size: 0.9rem;
    color: rgba(148, 163, 184, 0.8);
}

.share-packages-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: stretch;
}

/* pakiet = taka sama pastylka jak wariant usług,
   ale z ograniczoną szerokością i ustaloną wysokością */
.share-package-pill {
    border-color: rgba(148, 163, 184, .45);
    background: transparent;
    padding: 0.35rem 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    min-width: 180px;
    max-width: 260px;
    min-height: 68px;
    flex: 0 0 auto;
    text-align: left;
}

.share-package-pill .share-package-pill-title {
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 0.05rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.share-package-pill .share-package-pill-desc {
    font-size: 0.78rem;
    color: var(--muted);
    margin-bottom: 0.1rem;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    /* max 2 linie opisu */
}

.share-package-pill .share-package-pill-badge {
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    white-space: nowrap;
}

.share-package-pill.active {
    border-color: var(--brand);
    background: rgba(37, 99, 235, .22);
    box-shadow: 0 10px 30px rgba(15, 23, 42, .65);
}

.share-package-desc-full {
    max-width: 520px;
    white-space: pre-wrap;
    /* zachowuje entery */
}

.share-package-desc-full:empty {
    display: none;
    /* box znika, gdy nie ma opisu */
}

/* Pakiety wariantów – lista w zakładce Udostępnianie */
.share-pkg-row {
    background: rgba(15, 23, 42, .96);
    border-radius: 14px;
    border: 1px solid var(--border);
    margin-bottom: .5rem;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .45);
}

.share-pkg-title {
    font-weight: 600;
    color: #e5e7eb;
}

.share-pkg-badge {
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--muted);
}

.share-pkg-desc {
    font-size: .8rem;
    color: var(--muted);
}

.share-pkg-variants {
    font-size: .75rem;
}

.share-pkg-pill {
    border-radius: 999px;
    padding: .15rem .6rem;
    background: rgba(15, 23, 42, .9);
    border: 1px solid rgba(148, 163, 184, .45);
}

/* Upewnij się, że przycisk z trzema kropkami wygląda jak w innych miejscach */
.share-pkg-row .btn-icon-circle {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Akcje (3 kropki) w wierszach pakietów – pokaż na hover, jak w innych listach */
.share-pkg-row .actions {
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s;
}

.share-pkg-row:hover .actions {
    opacity: 1;
    pointer-events: auto;
}

.prod-image-preview {
    width: 120px;
    height: 120px;
    border-radius: 16px;
    background: rgba(15, 23, 42, .9);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-size: .75rem;
    color: var(--muted);
}

.prod-image-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    display: block;
}

/* Lightbox dla zdjęć produktów */
.image-lightbox-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .92);
    z-index: 1300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.image-lightbox-inner {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-lightbox-inner img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 18px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(148, 163, 184, .5);
}

.image-lightbox-close {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, .7);
    background: rgba(15, 23, 42, .95);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.image-lightbox-close i {
    font-size: 1rem;
}

/* === FIX: bootstrap modal pod backdrop/overlay (z-index stacking) === */
.modal {
    z-index: 3100 !important;
}

.modal-backdrop {
    z-index: 3090 !important;
}

.modal-dialog,
.modal-content {
    pointer-events: auto;
}

/* Tasks table - phases have different background color (purple/violet theme) */
.table-darkish tbody tr.phase-row,
.table-darkish tbody tr[data-is-phase="1"] {
    background-color: rgba(168, 85, 247, 0.18) !important;
    border-left: 4px solid rgba(168, 85, 247, 0.7) !important;
    border-top: 2px solid rgba(168, 85, 247, 0.3) !important;
}

.table-darkish tbody tr.phase-row:hover,
.table-darkish tbody tr[data-is-phase="1"]:hover {
    background-color: rgba(168, 85, 247, 0.25) !important;
}

/* Tasks table - child tasks under phase - professional hierarchy visualization */
/* Zadania bezpośrednio po fazie */
.table-darkish tbody tr.phase-row + tr.task-row,
.table-darkish tbody tr[data-is-phase="1"] + tr.task-row,
.table-darkish tbody tr[data-is-phase="1"] + tr:not([data-is-phase="1"]) {
    background-color: rgba(255, 255, 255, 0.02) !important;
}

/* Wszystkie zadania po fazie (aż do następnej fazy) - używamy JavaScript do dodania klasy */
.table-darkish tbody tr.task-row.is-child {
    background-color: rgba(255, 255, 255, 0.02) !important;
}

.table-darkish tbody tr.task-row.is-child:hover {
    background-color: rgba(255, 255, 255, 0.05) !important;
}

/* Visual connector lines removed - no borders or lines for tasks under phase */

/* Worklogs styling */
.worklog-item {
    transition: all 0.2s ease;
}

.worklog-item:hover {
    background: rgba(255,255,255,0.05) !important;
    border-color: rgba(255,255,255,0.2) !important;
}

.worklog-item .badge {
    font-weight: 500;
    letter-spacing: 0.5px;
}

.worklog-content {
    line-height: 1.6;
}

/* Comments styling */
.comment-item {
    transition: all 0.2s ease;
}

.comment-item:hover {
    background: rgba(255,255,255,0.05) !important;
    border-color: rgba(255,255,255,0.2) !important;
}

.comment-content {
    line-height: 1.6;
}

/* Attachments styling */
.attachment-item {
    transition: all 0.2s ease;
}

.attachment-item:hover {
    background: rgba(255,255,255,0.05) !important;
    border-color: rgba(255,255,255,0.2) !important;
}

/* Admin Users styling */
.user-item {
    transition: all 0.2s ease;
    border: 1px solid rgba(255,255,255,0.1) !important;
    margin-bottom: 0.5rem;
    border-radius: 0.375rem;
}

.user-item:hover {
    background: rgba(255,255,255,0.03) !important;
    border-color: rgba(255,255,255,0.15) !important;
    transform: translateX(2px);
}

.user-item .badge {
    font-size: 0.75rem;
    padding: 0.25em 0.5em;
    font-weight: 500;
}

/* Modal Edit User - szerokość i layout */
#modalEditUser .modal-dialog.modal-xl {
    max-width: 95vw;
    width: 95vw;
    height: auto;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

#modalEditUser .modal-content {
    min-height: 60vh;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#modalEditUser .modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1 1 auto;
}

#modalEditUser .modal-footer {
    flex-shrink: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem 1.5rem;
    margin-top: 0;
}

#modalEditUser {
    z-index: 100000 !important;
}

#modalEditUser .modal-dialog {
    z-index: 100001 !important;
}

#modalEditUser .modal-backdrop {
    z-index: 99990 !important;
}

/* Lepsze wykorzystanie przestrzeni w modalu użytkownika */
#modalEditUser .form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: rgba(255, 255, 255, 0.9);
}

#modalEditUser .col-lg-5 {
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    padding-right: 2rem;
}

#modalEditUser .col-lg-7 {
    padding-left: 2rem;
}

#modalEditUser h6.text-muted {
    color: rgba(255, 255, 255, 0.7) !important;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
}

#editUserModules {
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.2) transparent;
}

#editUserModules::-webkit-scrollbar {
    width: 6px;
}

#editUserModules::-webkit-scrollbar-track {
    background: transparent;
}

#editUserModules::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
}

#editUserModules::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.3);
}

#editUserModules .form-check {
    padding: 0.5rem;
    border-radius: 0.25rem;
    transition: background 0.2s ease;
    margin-bottom: 0.5rem;
}

#editUserModules .form-check:hover {
    background: rgba(255,255,255,0.05);
}

#editUserModules .form-check-label {
    cursor: pointer;
    user-select: none;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.85);
}

#editUserModules .form-check-input {
    cursor: pointer;
    margin-top: 0.25rem;
}


/* Lepsze wykorzystanie przestrzeni w modalu użytkownika */
#modalEditUser .form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: rgba(255, 255, 255, 0.9);
}

#modalEditUser .col-lg-5 {
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    padding-right: 2rem;
}

#modalEditUser .col-lg-7 {
    padding-left: 2rem;
}

#modalEditUser h6.text-muted {
    color: rgba(255, 255, 255, 0.7) !important;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
}

#editUserModules {
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.2) transparent;
}

#editUserModules::-webkit-scrollbar {
    width: 6px;
}

#editUserModules::-webkit-scrollbar-track {
    background: transparent;
}

#editUserModules::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
}

#editUserModules::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.3);
}

/* Tasks table wrapper - bez poziomego scrolla, wpasowana w sekcję */
.tasks-table-wrapper {
    width: 100%;
    overflow-x: hidden;
    overflow-y: visible;
    max-width: 100%;
}

.tasks-table-wrapper table {
    width: 100%;
    table-layout: fixed;
    word-wrap: break-word;
}

.tasks-table-wrapper table td,
.tasks-table-wrapper table th {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tasks-table-wrapper table td:nth-child(2) {
    white-space: normal;
    word-break: break-word;
}

/* Tasks table - inline select styling (usunięte, bo nie używamy już selecta) */

.table-darkish .task-add-time-btn {
    flex-shrink: 0;
    padding: 0.25rem 0.5rem;
    line-height: 1;
}

/* Tasks modals - ensure they're always on top (highest priority, above everything else) */
#modalTask,
#modalSelectWbsVariant,
#modalSyncWbs,
#modalAddTime {
    z-index: 100000 !important;
    position: fixed !important;
}

/* Modal backdrop for tasks modals - MUST be LOWER than modal z-index */
body:has(#modalTask.show) .modal-backdrop,
body:has(#modalSelectWbsVariant.show) .modal-backdrop,
body:has(#modalSyncWbs.show) .modal-backdrop,
body:has(#modalAddTime.show) .modal-backdrop {
    z-index: 99990 !important;
}

/* Ensure backdrop z-index is lower - override any inline styles */
.modal-backdrop.fade.show {
    z-index: 99990 !important;
}

/* Tasks modals backdrop - specifically lower */
body:has(#modalTask.show) .modal-backdrop.fade.show,
body:has(#modalSelectWbsVariant.show) .modal-backdrop.fade.show,
body:has(#modalSyncWbs.show) .modal-backdrop.fade.show,
body:has(#modalAddTime.show) .modal-backdrop.fade.show {
    z-index: 99990 !important;
}

#modalTask .modal-dialog,
#modalSelectWbsVariant .modal-dialog,
#modalSyncWbs .modal-dialog,
#modalAddTime .modal-dialog {
    z-index: 100001 !important;
    position: relative !important;
}

#modalTask .modal-content,
#modalSelectWbsVariant .modal-content,
#modalSyncWbs .modal-content,
#modalAddTime .modal-content {
    z-index: 100002 !important;
    pointer-events: auto !important;
    position: relative !important;
}

/* Q&A Modal - ensure it's always on top */
#qaQuestionModal {
    z-index: 3100 !important;
}

#qaQuestionModal .modal-dialog {
    z-index: 3101 !important;
}

#qaQuestionModal .modal-content {
    z-index: 3102 !important;
    pointer-events: auto !important;
}

/* Share modals - ensure they're always on top */
#sendOfferResultModal,
#sharePkgModal,
#shareReminderModal {
    z-index: 3100 !important;
}

#sendOfferResultModal .modal-dialog,
#sharePkgModal .modal-dialog,
#shareReminderModal .modal-dialog {
    z-index: 3101 !important;
}

#sendOfferResultModal .modal-content,
#sharePkgModal .modal-content,
#shareReminderModal .modal-content {
    z-index: 3102 !important;
    pointer-events: auto !important;
}

/* Q&A Answer Content Styling */
.qa-answer-content {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.qa-answer-content p {
    margin-bottom: 0.75rem;
    color: var(--text-main);
}

.qa-answer-content p:last-child {
    margin-bottom: 0;
}

.qa-answer-content ul,
.qa-answer-content ol {
    margin-bottom: 0.75rem;
    padding-left: 1.5rem;
    color: var(--text-main);
}

.qa-answer-content li {
    margin-bottom: 0.25rem;
}

.qa-answer-content strong,
.qa-answer-content b {
    font-weight: 600;
    color: var(--text-main);
}

.qa-answer-content em,
.qa-answer-content i {
    font-style: italic;
}

.qa-answer-content a {
    color: var(--brand);
    text-decoration: underline;
}

.qa-answer-content a:hover {
    color: #9bb5ff;
}

.qa-answer-content h1,
.qa-answer-content h2,
.qa-answer-content h3 {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-main);
}

.qa-answer-content h1:first-child,
.qa-answer-content h2:first-child,
.qa-answer-content h3:first-child {
    margin-top: 0;
}

/* Galeria (jak w share_view) – globalnie: jedno główne + pasek miniaturek */
.cm-gallery {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cm-gallery-main {
    width: 100%;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.cm-gallery-main img {
    width: 100%;
    height: 320px;
    max-height: 420px;
    object-fit: cover;
    display: block;
}

.cm-gallery-strip {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
}

.cm-gallery-thumb {
    position: relative;
    flex: 0 0 auto;
    width: 160px;
    height: 96px;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.45);
    background: rgba(15, 23, 42, 0.9);
    padding: 0;
}

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

.cm-gallery-thumb.active {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.65);
}

@media (max-width: 767.98px) {
    .cm-gallery-main img {
        height: 220px;
    }
}

/* ============================================
   PROJECT CONFIG - MODERN STYLING
   ============================================ */

/* Enhanced card-surface for project config */
#tab-config .card-surface {
    background: var(--card);
    border: 1px solid var(--border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

#tab-config .card-surface::before {
    display: none !important;
}

#tab-config .card-surface:hover {
    box-shadow: 0 6px 28px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(122, 162, 255, 0.15);
    transform: translateY(-1px);
}

/* Section headers with icons */
#tab-config .card-surface h5,
#tab-config .card-surface h6 {
    color: var(--text);
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#tab-config .card-surface h5::before,
#tab-config .card-surface h6::before {
    display: none !important;
}

#tab-config .card-surface small.text-muted {
    color: var(--muted);
    font-size: 0.85rem;
    line-height: 1.5;
    display: block;
    margin-top: 0.25rem;
}

/* Enhanced form labels */
#tab-config .form-label {
    font-weight: 500;
    color: var(--text);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#tab-config .form-label i {
    color: var(--brand);
    font-size: 0.95rem;
    opacity: 0.8;
}

/* Modern form controls */
#tab-config .form-control,
#tab-config .form-select {
    background: rgba(12, 19, 40, 0.8);
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    color: var(--text);
    border-radius: 12px;
    padding: 0.65rem 1rem;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    backdrop-filter: blur(8px);
}

#tab-config .form-control:hover,
#tab-config .form-select:hover {
    border-color: rgba(122, 162, 255, 0.3);
    background: rgba(12, 19, 40, 0.9);
}

#tab-config .form-control:focus,
#tab-config .form-select:focus {
    border-color: var(--brand);
    background: rgba(12, 19, 40, 0.95);
    box-shadow: 0 0 0 4px rgba(122, 162, 255, 0.15), 0 4px 12px rgba(0, 0, 0, 0.2);
    outline: none;
}

/* Enhanced section cards */
#tab-config #projectClientSection,
#tab-config #projectPeopleSection,
#tab-config #projectClientSection:hover,
#tab-config #projectPeopleSection:hover {
    border-color: rgba(122, 162, 255, 0.25);
    background: rgba(13, 22, 44, 0.6);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

#tab-references #offerRefsSection {
    background: rgba(13, 22, 44, 0.5);
    border: 1px solid rgba(122, 162, 255, 0.15);
    border-radius: 14px;
    transition: all 0.3s ease;
}

#tab-references #offerRefsSection:hover {
    border-color: rgba(122, 162, 255, 0.25);
    background: rgba(13, 22, 44, 0.6);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

/* Lista referencji w ofercie */
.references-list {
    min-height: 200px;
}

.reference-item {
    background: rgba(13, 22, 44, 0.3);
    border: 1px solid rgba(122, 162, 255, 0.1);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.reference-item:hover {
    border-color: rgba(122, 162, 255, 0.3);
    background: rgba(13, 22, 44, 0.4);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Modal wyboru referencji */
#modalSelectReference .table-darkish {
    background: transparent;
}

#modalSelectReference .table-darkish thead {
    background: rgba(13, 22, 44, 0.8);
}

#modalSelectReference .table-darkish tbody tr {
    cursor: pointer;
    transition: background 0.2s ease;
}

#modalSelectReference .table-darkish tbody tr:hover {
    background: rgba(122, 162, 255, 0.1);
}

#modalSelectReference .table-darkish tbody tr.table-active {
    background: rgba(122, 162, 255, 0.15);
}

/* Modal podglądu PDF */
#modalPdfPreview .modal-dialog {
    max-width: 95vw;
    height: 95vh;
}

#modalPdfPreview .modal-content {
    height: 100%;
    display: flex;
    flex-direction: column;
}

#modalPdfPreview .modal-body {
    flex: 1;
    overflow: hidden;
    padding: 0;
}

#pdfPreviewFrame {
    width: 100%;
    height: 100%;
    min-height: 500px;
}

/* Modern module switches - FIXED */
#tab-config #modulesGrid {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 1.25rem !important;
    width: 100% !important;
    margin: 0 !important;
}

#tab-config #modulesGrid > .col-md-4 {
    padding: 0 !important;
    width: calc(33.333% - 0.83rem) !important;
    min-width: 280px !important;
    max-width: 100% !important;
    margin: 0 !important;
    float: none !important;
    display: block !important;
    flex: 1 1 280px !important;
}

#tab-config #modulesGrid .form-check {
    background: rgba(255, 255, 255, 0.03);
    border: 1.5px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    min-height: 140px;
    display: block !important;
    width: 100% !important;
    box-sizing: border-box;
    height: 100%;
    cursor: pointer;
}

#tab-config #modulesGrid .form-check:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(122, 162, 255, 0.3);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(122, 162, 255, 0.15);
}

#tab-config #modulesGrid .form-check-input:checked ~ .form-check {
    background: rgba(122, 162, 255, 0.08);
    border-color: rgba(122, 162, 255, 0.4);
}

#tab-config #modulesGrid .form-check::before {
    display: none !important;
}

#tab-config #modulesGrid .form-check::after {
    display: none !important;
}

#tab-config #modulesGrid .form-check:hover::before {
    opacity: 0.8;
}

#tab-config #modulesGrid .form-check-input:checked ~ .form-check:hover::before {
    display: none !important;
}

#tab-config #modulesGrid .form-check:hover::after {
    display: none !important;
}

#tab-config #modulesGrid .form-check-input:checked ~ .form-check-label {
    color: var(--text);
}

#tab-config #modulesGrid .form-check-input:checked ~ .form-check-label strong {
    color: var(--text);
}

#tab-config #modulesGrid .form-check-input:checked ~ .form-check {
    background: rgba(122, 162, 255, 0.08);
    border-color: rgba(122, 162, 255, 0.4);
}

#tab-config #modulesGrid .form-check-input:checked ~ .form-check-label::after {
    display: none !important;
}

#tab-config #modulesGrid .form-check-input:checked ~ .form-check-label strong {
    color: var(--text);
    position: relative;
}

#tab-config #modulesGrid .form-check-input:checked ~ .form-check-label strong::after {
    content: '✓';
    position: absolute;
    right: 0;
    top: 0;
    color: var(--accent);
    font-size: 1rem;
    opacity: 0.9;
    font-weight: bold;
    line-height: 1.4;
    animation: checkmarkAppear 0.3s ease;
}

@keyframes checkmarkAppear {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 0.9;
        transform: scale(1);
    }
}

#tab-config #modulesGrid .form-check-label {
    display: block !important;
    cursor: pointer !important;
    position: relative;
    padding-left: 3.5rem;
    width: 100% !important;
    writing-mode: horizontal-tb !important;
    text-orientation: mixed !important;
    direction: ltr !important;
    unicode-bidi: normal !important;
    pointer-events: auto !important;
    user-select: none;
}

/* Make entire card clickable but don't block checkbox */
#tab-config #modulesGrid .form-check {
    position: relative;
}

#tab-config #modulesGrid .form-check-label {
    position: relative;
    z-index: 1;
}

/* Ensure checkbox is always on top and clickable */
#tab-config #modulesGrid .form-check.form-switch .form-check-input {
    z-index: 20 !important;
    pointer-events: auto !important;
}

#tab-config #modulesGrid .form-check-label strong {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.4;
    letter-spacing: -0.01em;
    margin-bottom: 0.5rem;
    display: block !important;
    width: 100% !important;
    writing-mode: horizontal-tb !important;
    text-orientation: mixed !important;
    white-space: normal !important;
    word-break: normal !important;
    transition: color 0.3s ease;
    position: relative;
    padding-right: 1.5rem;
}

#tab-config #modulesGrid .form-check-label .small {
    font-size: 0.875rem;
    color: var(--muted);
    line-height: 1.6;
    display: block !important;
    width: 100% !important;
    word-wrap: break-word;
    overflow-wrap: break-word;
    writing-mode: horizontal-tb !important;
    text-orientation: mixed !important;
    white-space: normal !important;
    word-break: normal !important;
}

#tab-config #modulesGrid .form-check.form-switch .form-check-input {
    width: 2.75rem !important;
    height: 1.5rem !important;
    margin-top: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    cursor: pointer !important;
    border: 2px solid rgba(255, 255, 255, 0.25) !important;
    background-color: rgba(12, 19, 40, 0.9) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: absolute !important;
    left: 1.5rem !important;
    top: 1.5rem !important;
    flex-shrink: 0;
    z-index: 20 !important;
    pointer-events: auto !important;
    opacity: 1 !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    background-image: none !important;
    float: none !important;
}

#tab-config #modulesGrid .form-check.form-switch .form-check-input::before {
    content: '';
    position: absolute;
    left: 2px;
    top: 2px;
    width: 1.1rem;
    height: 1.1rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 1;
}

#tab-config #modulesGrid .form-check.form-switch .form-check-input:checked::before {
    transform: translateX(1.25rem);
    background: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

#tab-config #modulesGrid .form-check.form-switch .form-check-input:hover {
    border-color: rgba(122, 162, 255, 0.5) !important;
    background-color: rgba(12, 19, 40, 1) !important;
}

#tab-config #modulesGrid .form-check.form-switch .form-check-input:checked {
    background-color: var(--brand) !important;
    border-color: var(--brand) !important;
    box-shadow: 0 0 0 4px rgba(122, 162, 255, 0.25), 0 2px 8px rgba(122, 162, 255, 0.3) !important;
}

#tab-config #modulesGrid .form-check.form-switch .form-check-input:checked:hover {
    background-color: #8bb0ff !important;
    box-shadow: 0 0 0 4px rgba(122, 162, 255, 0.3), 0 4px 12px rgba(122, 162, 255, 0.4) !important;
}

#tab-config #modulesGrid .form-check.form-switch .form-check-input:focus {
    box-shadow: 0 0 0 4px rgba(122, 162, 255, 0.25) !important;
    outline: none !important;
}

#tab-config #modulesGrid .form-check.form-switch .form-check-input:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

#tab-config #modulesGrid .form-check.opacity-50 {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.05);
    opacity: 0.7;
}

#tab-config #modulesGrid .form-check.opacity-50:hover {
    opacity: 0.85;
}

/* Disabled module info styling */
#tab-config #modulesGrid .module-disabled-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: rgba(148, 163, 184, 0.1);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 10px;
    color: var(--muted);
    font-size: 0.875rem;
    font-weight: 500;
}

#tab-config #modulesGrid .module-disabled-info i {
    color: var(--muted);
    font-size: 1rem;
    opacity: 0.8;
}

#tab-config #modulesGrid .module-disabled-info span {
    color: var(--muted);
}

/* Active state glow effect */
#tab-config #modulesGrid .form-check-input:checked ~ .form-check::before {
    display: none !important;
}

#tab-config #modulesGrid .form-check-input:checked ~ .form-check {
    box-shadow: 0 0 20px rgba(122, 162, 255, 0.2), 0 8px 24px rgba(0, 0, 0, 0.3);
    background: rgba(122, 162, 255, 0.08);
    border-color: rgba(122, 162, 255, 0.4);
}

/* Pulse animation for active modules */
#tab-config #modulesGrid .form-check-input:checked ~ .form-check::after {
    display: none !important;
}

@keyframes pulseGlow {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}

/* Badge styling improvements */
#tab-config #modulesGrid .badge {
    font-size: 0.7rem;
    padding: 0.3rem 0.7rem;
    border-radius: 8px;
    font-weight: 500;
    margin-left: 0.5rem;
    background: rgba(122, 162, 255, 0.2);
    border: 1px solid rgba(122, 162, 255, 0.3);
    color: #9ec5fe;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}


/* Enhanced buttons */
#tab-config .btn-ghost {
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    border-radius: 10px;
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
    font-weight: 500;
}

#tab-config .btn-ghost:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(122, 162, 255, 0.4);
    color: var(--text);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

#tab-config .btn-outline-danger {
    border: 1.5px solid rgba(239, 68, 68, 0.4);
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
    border-radius: 10px;
    transition: all 0.2s ease;
}

#tab-config .btn-outline-danger:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.6);
    transform: translateY(-1px);
}

/* Sub-pills navigation */
#tab-config .sub-pills {
    margin-bottom: 1.5rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    display: inline-flex;
    gap: 0.5rem;
}

#tab-config .sub-pills .nav-link {
    padding: 0.6rem 1.25rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--muted);
    transition: all 0.2s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#tab-config .sub-pills .nav-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    border-color: rgba(122, 162, 255, 0.3);
}

#tab-config .sub-pills .nav-link.active {
    background: rgba(122, 162, 255, 0.15);
    border-color: var(--brand);
    color: var(--text);
    box-shadow: 0 2px 8px rgba(122, 162, 255, 0.2);
}

/* Extra recipients chips */
#tab-config #extraRecipientsChips {
    min-height: 2rem;
}

#tab-config .badge-soft {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    background: rgba(122, 162, 255, 0.15);
    border: 1px solid rgba(122, 162, 255, 0.3);
    color: #9ec5fe;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    margin: 0.25rem;
}

/* Status select styling */
#tab-config #fldStatus {
    font-weight: 500;
}

#tab-config #fldStatus option {
    padding: 0.5rem;
}

/* Approval comment section */
#tab-config #approvalCommentRow {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

#tab-config #fldApprovalComment {
    background: rgba(12, 19, 40, 0.6);
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    resize: vertical;
    min-height: 80px;
}

/* Module icons in labels */
#tab-config #modulesGrid .form-check-label strong::before {
    content: '';
    display: inline-block;
    width: 24px;
    height: 24px;
    margin-right: 0.5rem;
    vertical-align: middle;
    opacity: 0.7;
}

/* Specific module icons */
#tab-config #modulesGrid [data-mod="summary"] ~ .form-check-label strong::before {
    content: '📋';
    font-size: 1.1rem;
}

#tab-config #modulesGrid [data-mod="services"] ~ .form-check-label strong::before {
    content: '💼';
    font-size: 1.1rem;
}

#tab-config #modulesGrid [data-mod="wbs"] ~ .form-check-label strong::before {
    content: '📊';
    font-size: 1.1rem;
}

#tab-config #modulesGrid [data-mod="lic"] ~ .form-check-label strong::before {
    content: '🔑';
    font-size: 1.1rem;
}

#tab-config #modulesGrid [data-mod="hw"] ~ .form-check-label strong::before {
    content: '💻';
    font-size: 1.1rem;
}

#tab-config #modulesGrid [data-mod="docs"] ~ .form-check-label strong::before {
    content: '📄';
    font-size: 1.1rem;
}

#tab-config #modulesGrid [data-mod="locals"] ~ .form-check-label strong::before {
    content: '🏢';
    font-size: 1.1rem;
}

#tab-config #modulesGrid [data-mod="ref"] ~ .form-check-label strong::before {
    content: '⭐';
    font-size: 1.1rem;
}

#tab-config #modulesGrid [data-mod="post"] ~ .form-check-label strong::before {
    content: '💰';
    font-size: 1.1rem;
}

#tab-config #modulesGrid [data-mod="finance"] ~ .form-check-label strong::before {
    content: '💵';
    font-size: 1.1rem;
}

#tab-config #modulesGrid [data-mod="share"] ~ .form-check-label strong::before {
    content: '🔗';
    font-size: 1.1rem;
}

/* Remove emoji icons, use Bootstrap icons instead - already using icons in HTML */
#tab-config #modulesGrid .form-check-label strong::before {
    display: none;
}

/* Responsive improvements */
@media (max-width: 768px) {
    #tab-config #modulesGrid > .col-md-4 {
        width: 100% !important;
        flex: 1 1 100% !important;
    }
    
    #tab-config .card-surface {
        padding: 1rem !important;
    }
    
    #tab-config .row.g-3 {
        --bs-gutter-y: 1rem;
    }
}

/* ============================================
   WBS MODULE - MODERN STYLING (consistent with project_config)
   ============================================ */

/* WBS Tab Content - Enhanced card styling */
#tab-wbs .card-surface {
    background: var(--card);
    border: 1px solid var(--border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    padding: 1.5rem;
}

#tab-wbs .card-surface:hover {
    box-shadow: 0 6px 28px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(122, 162, 255, 0.15);
    transform: translateY(-1px);
}

/* WBS Section headers with icons */
#tab-wbs h6 {
    color: var(--text);
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#tab-wbs h6 i {
    color: var(--brand);
    font-size: 1.1rem;
}

/* WBS Sub-pills navigation */
#tab-wbs .sub-pills {
    margin-bottom: 1.5rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    display: inline-flex;
    gap: 0.5rem;
}

#tab-wbs .sub-pills .nav-link {
    padding: 0.6rem 1.25rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--muted);
    transition: all 0.2s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#tab-wbs .sub-pills .nav-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    border-color: rgba(122, 162, 255, 0.3);
}

#tab-wbs .sub-pills .nav-link.active {
    background: rgba(122, 162, 255, 0.15);
    border-color: var(--brand);
    color: var(--text);
    box-shadow: 0 2px 8px rgba(122, 162, 255, 0.2);
}

/* Services tabs - same styling as WBS sub-pills */
#tab-services .sub-pills {
    margin-bottom: 1.5rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    display: inline-flex;
    gap: 0.5rem;
}

#tab-services .sub-pills .nav-link {
    padding: 0.6rem 1.25rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--muted);
    transition: all 0.2s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#tab-services .sub-pills .nav-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    border-color: rgba(122, 162, 255, 0.3);
}

#tab-services .sub-pills .nav-link.active {
    background: rgba(122, 162, 255, 0.15);
    border-color: var(--brand);
    color: var(--text);
    box-shadow: 0 2px 8px rgba(122, 162, 255, 0.2);
}

/* Dashboard status tabs - same styling as WBS sub-pills */
#dashboardView .sub-pills {
    margin-bottom: 1.5rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

#dashboardView .sub-pills .nav-item {
    flex: 1 1 auto;
    min-width: 0;
}

#dashboardView .sub-pills .nav-link {
    padding: 0.6rem 1rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--muted);
    transition: all 0.2s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    width: 100%;
    text-align: center;
}

#dashboardView .sub-pills .nav-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    border-color: rgba(122, 162, 255, 0.3);
}

#dashboardView .sub-pills .nav-link.active {
    background: rgba(122, 162, 255, 0.15);
    border-color: var(--brand);
    color: var(--text);
    box-shadow: 0 2px 8px rgba(122, 162, 255, 0.2);
}

/* WBS Buttons */
#tab-wbs .btn-primary {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
    border-radius: 10px;
    padding: 0.5rem 1rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

#tab-wbs .btn-primary:hover {
    background: #8bb0ff;
    border-color: #8bb0ff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(122, 162, 255, 0.3);
}

#tab-wbs .btn-ghost {
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    border-radius: 10px;
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
    font-weight: 500;
}

#tab-wbs .btn-ghost:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(122, 162, 255, 0.4);
    color: var(--text);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* WBS Diagram host */
.wbs-diagram-host {
    min-height: 400px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1.5px solid var(--border);
    padding: 1rem;
}

/* WBS Variants list improvements */
#wbsVariantsList .list-group-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1.5px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
    margin-bottom: 0.5rem;
}

#wbsVariantsList .list-group-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(122, 162, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

#wbsVariantsList .list-group-item.active {
    background: rgba(122, 162, 255, 0.12);
    border-color: rgba(122, 162, 255, 0.4);
    box-shadow: 0 2px 8px rgba(122, 162, 255, 0.2);
}

/* === Custom Tooltips === */
.custom-tooltip {
    position: absolute;
    z-index: 10000;
    padding: 8px 12px;
    background: rgba(15, 23, 42, 0.98);
    color: #e5e7eb;
    border: 1px solid rgba(122, 162, 255, 0.3);
    border-radius: 8px;
    font-size: 0.875rem;
    line-height: 1.4;
    white-space: pre-line;
    max-width: 300px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(122, 162, 255, 0.1);
    backdrop-filter: blur(12px);
    pointer-events: none;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.2s ease-out, transform 0.2s ease-out;
}

.custom-tooltip.show {
    opacity: 1;
    transform: translateY(0);
}

.custom-tooltip::before {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border: 6px solid transparent;
}

/* Tooltip arrow - top */
.custom-tooltip.placement-top::before {
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    border-top-color: rgba(122, 162, 255, 0.3);
}

.custom-tooltip.placement-top::after {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border: 5px solid transparent;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-top-color: rgba(15, 23, 42, 0.98);
}

/* Tooltip arrow - bottom */
.custom-tooltip.placement-bottom::before {
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    border-bottom-color: rgba(122, 162, 255, 0.3);
}

.custom-tooltip.placement-bottom::after {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border: 5px solid transparent;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-bottom-color: rgba(15, 23, 42, 0.98);
}

/* Tooltip arrow - left */
.custom-tooltip.placement-left::before {
    right: -12px;
    top: 50%;
    transform: translateY(-50%);
    border-left-color: rgba(122, 162, 255, 0.3);
}

.custom-tooltip.placement-left::after {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border: 5px solid transparent;
    right: -10px;
    top: 50%;
    transform: translateY(-50%);
    border-left-color: rgba(15, 23, 42, 0.98);
}

/* Tooltip arrow - right */
.custom-tooltip.placement-right::before {
    left: -12px;
    top: 50%;
    transform: translateY(-50%);
    border-right-color: rgba(122, 162, 255, 0.3);
}

.custom-tooltip.placement-right::after {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border: 5px solid transparent;
    left: -10px;
    top: 50%;
    transform: translateY(-50%);
    border-right-color: rgba(15, 23, 42, 0.98);
}

/* ===================== Teams & Roles Module Styles ===================== */

/* Department Card */
.teams-dept-card {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.teams-dept-card:hover {
    border-color: rgba(148, 163, 184, 0.35);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.teams-dept-header {
    background: rgba(30, 41, 59, 0.6);
    border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

.teams-dept-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(59, 130, 246, 0.15);
    border-radius: 10px;
    color: #60a5fa;
    font-size: 1.2rem;
}

/* Teams List */
.teams-teams-list {
    background: rgba(15, 23, 42, 0.5);
}

.teams-team-card {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 10px;
    transition: all 0.2s ease;
}

.teams-team-card:hover {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(148, 163, 184, 0.25);
}

.teams-team-header {
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.teams-team-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(34, 197, 94, 0.15);
    border-radius: 8px;
    color: #86efac;
    font-size: 1.1rem;
}

/* Members List */
.teams-members-list {
    background: rgba(15, 23, 42, 0.3);
    border-radius: 8px;
    margin-top: 0.5rem;
}

.teams-member-item {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(148, 163, 184, 0.1);
    border-radius: 8px;
    transition: all 0.15s ease;
}

.teams-member-item:hover {
    background: rgba(15, 23, 42, 0.6);
    border-color: rgba(148, 163, 184, 0.2);
}

.teams-member-avatar {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 1.5rem;
}

.teams-member-empty {
    padding: 1rem;
    text-align: center;
    opacity: 0.6;
}

.teams-empty-state {
    padding: 2rem;
    text-align: center;
    opacity: 0.5;
}

.teams-empty-state i {
    display: block;
    margin-bottom: 0.5rem;
}

/* ===== TASKS KANBAN VIEW ===== */
.kanban-board {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding: 1rem 0;
    min-height: 500px;
}

.kanban-column {
    flex: 1;
    min-width: 280px;
    background: rgba(15, 23, 42, 0.6);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 300px);
}

.kanban-column-header {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px 8px 0 0;
}

.kanban-column-header h6 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.kanban-column-body {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.kanban-card {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 0.75rem;
    cursor: grab;
    transition: all 0.2s ease;
    position: relative;
}

.kanban-card:hover {
    background: rgba(30, 41, 59, 0.95);
    border-color: rgba(99, 102, 241, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.kanban-card.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.kanban-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.kanban-card-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.95);
    margin: 0;
    flex: 1;
    line-height: 1.4;
}

.kanban-card-priority {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-left: 0.5rem;
}

.kanban-card-priority.priority-low { background: #10b981; }
.kanban-card-priority.priority-medium { background: #3b82f6; }
.kanban-card-priority.priority-high { background: #f59e0b; }
.kanban-card-priority.priority-critical { background: #ef4444; }

.kanban-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.kanban-card-tag {
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-weight: 500;
}

.kanban-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 0.5rem;
}

.kanban-card-assignee {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.kanban-card-time {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.kanban-card-subtasks {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 0.25rem;
}

/* Task priority badges */
.task-priority-badge {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.5rem;
}

.task-priority-badge.priority-low { background: #10b981; }
.task-priority-badge.priority-medium { background: #3b82f6; }
.task-priority-badge.priority-high { background: #f59e0b; }
.task-priority-badge.priority-critical { background: #ef4444; }

/* Task tags */
.task-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.25rem;
}

.task-tag {
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

/* View switcher - nowy styl zgodny z screenshotem */
.view-switcher-container {
    display: inline-flex;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 4px;
    gap: 0;
    position: relative;
}

.view-switcher-radio {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.view-switcher-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
    white-space: nowrap;
    border: 1px solid transparent;
    background: transparent;
}

.view-switcher-tab i {
    font-size: 1rem;
    opacity: 0.8;
}

.view-switcher-tab:hover {
    background: rgba(255, 255, 255, 0.05);
}

.view-switcher-radio:checked + .view-switcher-tab {
    background: rgba(122, 162, 255, 0.15);
    border-color: rgba(122, 162, 255, 0.3);
    color: var(--text);
    box-shadow: 0 0 0 1px rgba(122, 162, 255, 0.2);
}

.view-switcher-radio:checked + .view-switcher-tab i {
    opacity: 1;
}

.view-switcher-tab:not(:first-child) {
    margin-left: 2px;
}

.view-switcher-tab:not(:last-child)::after {
    content: '';
    position: absolute;
    right: -1px;
    top: 25%;
    bottom: 25%;
    width: 1px;
    background: rgba(255, 255, 255, 0.08);
}

/* Filter and search */
#taskSearch, #taskFilterStatus, #taskFilterPriority, #taskFilterAssignee, #taskSortBy {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
    color: var(--text);
}

#taskSearch:focus, #taskFilterStatus:focus, #taskFilterPriority:focus, 
#taskFilterAssignee:focus, #taskSortBy:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--brand);
    color: var(--text);
}