html, body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #1e293b;
    background: #f5f7fb;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a, .btn-link {
    color: #2563eb;
}

a:hover {
    color: #1d4ed8;
}

.btn-primary {
    color: #fff;
    background-color: #2563eb;
    border-color: #2563eb;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: #1d4ed8;
    border-color: #1d4ed8;
}

.btn-primary:active {
    background-color: #1e40af;
    border-color: #1e40af;
}

.btn-outline-primary {
    color: #2563eb;
    border-color: #2563eb;
}

.btn-outline-primary:hover {
    background-color: #2563eb;
    border-color: #2563eb;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem #ffffff, 0 0 0 0.25rem rgba(37, 99, 235, 0.45);
    border-color: #2563eb;
}

.form-control, .form-select {
    border-color: #d8dee8;
}

.form-control:focus, .form-select:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.15);
}

.content {
    padding-top: 1.4rem;
    padding-bottom: 2rem;
}

h1, h2, h3 {
    color: #0f172a;
    letter-spacing: -0.01em;
}

h1 {
    font-size: 1.65rem;
    font-weight: 700;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

.page-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e9f0;
}

.page-header p {
    max-width: 720px;
    margin-bottom: 0;
    color: #5b6472;
}

.toolbar {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(140px, 220px) minmax(140px, 180px) auto;
    gap: .75rem;
    align-items: end;
    margin-bottom: 1rem;
    padding: 1rem;
    background: #ffffff;
    border: 1px solid #e5e9f0;
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.toolbar-wide {
    grid-template-columns: repeat(4, minmax(150px, 1fr)) auto;
}

.toolbar label {
    display: grid;
    gap: .25rem;
    font-weight: 600;
    color: #2f3742;
    font-size: 0.85rem;
}

.summary-line {
    display: flex;
    gap: 1rem;
    color: #5b6472;
    margin-bottom: .5rem;
    font-size: 0.88rem;
}

.pager {
    display: flex;
    justify-content: flex-end;
    gap: .5rem;
}

.customer-tabs {
    margin-bottom: 1rem;
}

.customer-tab-content {
    display: grid;
    gap: 1rem;
}

.detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
    gap: 1rem;
    align-items: start;
}

.detail-grid .full-span-panel {
    grid-column: 1 / -1;
}

.panel {
    border: 1px solid #e5e9f0;
    border-radius: 10px;
    padding: 1.1rem 1.15rem;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.panel h2 {
    font-size: 1.05rem;
    font-weight: 650;
    margin-bottom: .85rem;
    color: #0f172a;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: .85rem;
}

.section-header h2 {
    margin-bottom: 0;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(180px, 1fr));
    gap: .85rem;
    margin-bottom: 1rem;
}

.form-grid label {
    display: grid;
    gap: .25rem;
    font-weight: 600;
    color: #2f3742;
    font-size: 0.85rem;
}

.form-grid .form-check {
    display: flex;
    gap: .5rem;
    align-items: center;
    min-height: 2.4rem;
}

.form-grid .full-span {
    grid-column: 1 / -1;
}

.form-section-title {
    font-size: 0.95rem;
    margin: 0;
    color: #2f3742;
    font-weight: 650;
}

.fees-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(180px, 1fr));
    gap: .85rem;
    margin-bottom: 1rem;
}

.fee-panel {
    display: grid;
    align-content: start;
    gap: .75rem;
}

.fee-panel h3 {
    font-size: 0.95rem;
    margin: 0;
    color: #2f3742;
    font-weight: 650;
}

.fee-panel label {
    display: grid;
    gap: .25rem;
    font-weight: 600;
    color: #2f3742;
    font-size: 0.85rem;
}

.details-list {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: .35rem .9rem;
}

.details-list dt {
    color: #64748b;
    font-weight: 500;
    font-size: 0.88rem;
}

.details-list dd {
    margin-bottom: 0;
    min-width: 0;
    overflow-wrap: anywhere;
    color: #0f172a;
    font-weight: 500;
}

.compact-filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(150px, 1fr));
    gap: .75rem;
    align-items: end;
    margin-bottom: 1rem;
}

.compact-filters label {
    display: grid;
    gap: .25rem;
    font-weight: 600;
    color: #2f3742;
    font-size: 0.85rem;
}

.margin-editor {
    display: grid;
    grid-template-columns: minmax(80px, 110px) auto auto;
    gap: .4rem;
    align-items: center;
}

.margin-editor small {
    grid-column: 1 / -1;
    color: #5b6472;
}

.action-row {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    align-items: center;
}

.dialog-actions {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
    margin-top: 1rem;
}

.consents-form {
    display: grid;
    gap: .85rem;
    margin-bottom: 1rem;
}

.consents-form .form-check {
    display: flex;
    align-items: center;
    gap: .65rem;
}

.parcels-toolbar {
    grid-template-columns: repeat(4, minmax(150px, 1fr)) auto;
}

/* Tables — softer, modern look */
.table {
    background: #ffffff;
    border-radius: 10px;
    overflow: hidden;
}

.table > :not(caption) > * > * {
    padding: 0.7rem 0.85rem;
    border-bottom-color: #eef1f6;
}

.table thead th {
    background: #f8fafc;
    color: #475569;
    font-weight: 600;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 1px solid #e5e9f0;
}

.table tbody tr:hover {
    background-color: #f8fafc;
}

/* Status badges */
.status-badge {
    display: inline-block;
    padding: .22rem .55rem;
    border-radius: 999px;
    background: #eef2f7;
    color: #243447;
    font-weight: 600;
    font-size: .78rem;
    letter-spacing: 0.02em;
    white-space: nowrap;
    line-height: 1.3;
}

.status-badge-success {
    background: #dcfce7;
    color: #166534;
}

.status-badge-info {
    background: #dbeafe;
    color: #1e40af;
}

.status-badge-muted {
    background: #f1f5f9;
    color: #475569;
}

.status-badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.nested-table {
    margin: .35rem 0;
    padding: .4rem;
    border: 1px solid #e5e9f0;
    border-radius: 6px;
    background: #f8fafc;
}

.sub-nav {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem;
    margin-bottom: 1.1rem;
    border-bottom: 2px solid #e5e9f0;
}

.sub-nav-link {
    display: inline-flex;
    align-items: center;
    min-height: 2.4rem;
    padding: .4rem 1.05rem;
    color: #475569;
    text-decoration: none;
    background: transparent;
    font-weight: 600;
    font-size: 0.9rem;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    border-radius: 6px 6px 0 0;
    cursor: pointer;
    transition: color 0.12s ease, background-color 0.12s ease, border-color 0.12s ease;
}

.sub-nav-link:hover {
    color: #1e293b;
    background: #f1f5f9;
    border-bottom-color: #cbd5e1;
}

.sub-nav-link.active {
    color: #2563eb;
    background: transparent;
    border-bottom-color: #2563eb;
    font-weight: 700;
}

.sub-nav-link.active:hover {
    background: #eff6ff;
}

/* Disabled sub-nav links — explicit TBD placeholders only */
.sub-nav-link[disabled],
.sub-nav-link.disabled {
    color: #cbd5e1;
    cursor: not-allowed;
    pointer-events: none;
    font-weight: 500;
}

.nav-subgroup {
    margin-top: -.35rem;
    margin-bottom: .35rem;
}

.nav-sub-link {
    padding-left: 2.25rem;
    font-size: .92rem;
}

.parcels-bulk-actions {
    margin-bottom: .75rem;
}

.selection-column {
    width: 2.5rem;
    text-align: center;
}

.selected-row > td {
    background: #eff6ff;
}

.info-banner {
    border: 1px solid #bfdbfe;
    border-left: 4px solid #3b82f6;
    border-radius: 6px;
    padding: .65rem .85rem;
    margin-bottom: .9rem;
    background: #eff6ff;
    color: #1e40af;
    font-size: 0.88rem;
}

.section-heading-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.section-heading-row h2,
.side-panel h3 {
    margin-bottom: .25rem;
}

.section-heading-row p,
.side-panel-header p {
    margin-bottom: 0;
    color: #64748b;
}

.details-cell {
    max-width: 28rem;
    overflow-wrap: anywhere;
}

.side-panel {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 1040;
    width: min(520px, 100vw);
    height: 100vh;
    overflow-y: auto;
    padding: 1rem;
    border-left: 1px solid #e5e9f0;
    background: #fff;
    box-shadow: -18px 0 48px rgba(15, 23, 42, .16);
}

.side-panel-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.history-list {
    display: grid;
    gap: .75rem;
}

.history-item {
    display: grid;
    gap: .45rem;
    padding: .75rem;
    border: 1px solid #e5e9f0;
    border-radius: 8px;
    background: #f8fafc;
}

.history-item > div {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    align-items: center;
}

.history-item p {
    margin-bottom: 0;
    overflow-wrap: anywhere;
}

.raw-response-panel {
    width: min(880px, 100%);
}

.raw-response {
    max-height: min(68vh, 680px);
    overflow: auto;
    padding: .75rem;
    border: 1px solid #e5e9f0;
    border-radius: 6px;
    background: #0f172a;
    color: #e2e8f0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.modal-backdrop-custom {
    position: fixed;
    inset: 0;
    z-index: 1050;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgba(15, 23, 42, .42);
}

.modal-panel {
    width: min(440px, 100%);
    border-radius: 10px;
    border: 1px solid #e5e9f0;
    background: #fff;
    padding: 1.1rem;
    box-shadow: 0 18px 48px rgba(15, 23, 42, .22);
}

.modal-panel-wide {
    width: min(980px, 100%);
    max-height: min(92vh, 860px);
    overflow: auto;
}

.modal-panel h2 {
    font-size: 1.15rem;
    font-weight: 650;
    margin-bottom: .65rem;
    color: #0f172a;
}

.cod-picker-panel {
    width: min(980px, 100%);
    max-height: min(92vh, 860px);
    overflow: auto;
}

.cod-picker-table {
    max-height: min(38vh, 420px);
    overflow: auto;
}

.compact-list {
    margin-bottom: 0;
    padding-left: 1.25rem;
}

.details-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: .75rem;
    margin-bottom: 1rem;
}

.details-list div {
    display: grid;
    gap: .2rem;
}

.details-list dt {
    font-size: .78rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
}

.details-list dd {
    margin-bottom: 0;
    overflow-wrap: anywhere;
}

.message-content {
    max-height: min(46vh, 520px);
    overflow: auto;
    padding: 1rem;
    border: 1px solid #e5e9f0;
    border-radius: 6px;
    background: #ffffff;
    overflow-wrap: anywhere;
}

@media (max-width: 900px) {
    .toolbar {
        grid-template-columns: 1fr;
    }

    .detail-grid,
    .form-grid,
    .fees-grid,
    .compact-filters {
        grid-template-columns: 1fr;
    }
}

/* Login screen */
.login-shell {
    min-height: calc(100vh - 5rem);
    display: grid;
    place-items: center;
}

.login-panel {
    width: min(420px, 100%);
    display: grid;
    gap: 1rem;
    padding: 1.5rem;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e5e9f0;
    box-shadow: 0 8px 32px rgba(15, 23, 42, 0.06);
}

.login-panel form {
    display: grid;
    gap: .85rem;
}

.login-panel label {
    display: grid;
    gap: .25rem;
    font-weight: 600;
    font-size: 0.85rem;
}

.auth-link {
    justify-self: start;
    color: #2563eb;
    font-weight: 600;
    text-decoration: none;
}

.auth-link:hover,
.auth-link:focus {
    color: #1d4ed8;
    text-decoration: underline;
}

/* Zwarta tabela przesyłek (klient 28.08.2026: „ma się mieścić na ekranie"). */
.parcels-table {
    font-size: 0.8rem;
    table-layout: auto;
}

.parcels-table th {
    white-space: nowrap;
    font-size: 0.75rem;
    padding: 0.3rem 0.3rem;
}

.parcels-table td {
    padding: 0.28rem 0.3rem;
    vertical-align: top;
}

.parcels-table .cell-sub {
    font-size: 0.74rem;
    color: #6b7280;
    line-height: 1.25;
    max-width: 8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.parcels-table .cell-main {
    line-height: 1.3;
    white-space: nowrap;
    max-width: 10rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.parcels-table .status-badge {
    font-size: 0.72rem;
    padding: 0.1rem 0.45rem;
}

.parcels-table .btn-sm {
    font-size: 0.72rem;
    padding: 0.15rem 0.45rem;
}

.parcels-table .parcel-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem;
    max-width: 9rem;
}

/* ── Redesign 29.08.2026: karty KPI, znaczki przewoźników, pigułki, kebab ── */

.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    gap: 0.9rem;
    margin-bottom: 1.1rem;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background: #ffffff;
    border: 1px solid #e5e9f0;
    border-radius: 12px;
    padding: 0.9rem 1rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
    min-width: 0;
}

.stat-ico {
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-body {
    min-width: 0;
    flex: 1;
}

.stat-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #64748b;
}

.stat-value {
    font-size: 1.45rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.15;
}

.stat-delta {
    font-size: 0.74rem;
    font-weight: 600;
    white-space: nowrap;
}

.stat-delta span {
    color: #94a3b8;
    font-weight: 500;
}

.stat-delta-good { color: #16a34a; }
.stat-delta-bad { color: #dc2626; }
.stat-delta-flat { color: #94a3b8; }

.stat-spark {
    flex-shrink: 0;
    opacity: 0.85;
}

@media (max-width: 1500px) {
    .stat-spark { display: none; }
}

/* Znaczek przewoźnika w tabeli */
.carrier-cell {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.carrier-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.7rem;
    height: 1.7rem;
    border-radius: 6px;
    font-size: 0.52rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    flex-shrink: 0;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}

/* Kolorowe pigułki statusów (kropka + pastelowe tło) */
.status-badge.pill-blue { background: #e0ecff; color: #1d4ed8; }
.status-badge.pill-amber { background: #fef3c7; color: #b45309; }
.status-badge.pill-green { background: #dcfce7; color: #15803d; }
.status-badge.pill-gray { background: #f1f5f9; color: #64748b; }
.status-badge.pill-violet { background: #ede9fe; color: #6d28d9; }
.status-badge.pill-blue::before,
.status-badge.pill-amber::before,
.status-badge.pill-green::before,
.status-badge.pill-gray::before,
.status-badge.pill-violet::before {
    content: "";
    display: inline-block;
    width: 0.42rem;
    height: 0.42rem;
    border-radius: 50%;
    margin-right: 0.32rem;
    background: currentColor;
}

/* Kebab akcji w wierszu tabeli */
.kebab {
    position: relative;
    display: inline-block;
}

.kebab summary {
    list-style: none;
    cursor: pointer;
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #475569;
    font-size: 1rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.kebab summary::-webkit-details-marker { display: none; }

.kebab summary:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.kebab[open] summary {
    background: #e0ecff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

.kebab-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 0.25rem);
    z-index: 30;
    min-width: 13rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14);
    padding: 0.3rem;
    display: flex;
    flex-direction: column;
    text-align: left;
}

.kebab-menu a,
.kebab-menu button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.45rem 0.7rem;
    border: none;
    background: none;
    border-radius: 7px;
    font-size: 0.82rem;
    font-weight: 500;
    color: #1e293b;
    text-decoration: none;
    cursor: pointer;
}

.kebab-menu a:hover,
.kebab-menu button:hover {
    background: #f1f5f9;
}

.kebab-menu .kebab-danger {
    color: #dc2626;
}

.kebab-menu .kebab-danger:hover {
    background: #fee2e2;
}

/* Wynik zbiorczego anulowania — jedna linia na przesyłkę */
.alert.pre-line {
    white-space: pre-line;
}


/* Panel edycji osadzony nad tabelą (ubezpieczenia itp.) — wyraźnie oddzielony od listy */
.inline-edit-panel {
    border: 2px solid #2563eb;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.12);
    margin-bottom: 1rem;
}


/* Mini-excel stawek kraju (taryfy międzynarodowe): sticky nagłówki + zwarta siatka */
.rates-grid-wrap {
    overflow: auto;
    max-height: 72vh;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.rates-grid {
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.78rem;
    margin: 0;
    width: max-content;
    min-width: 100%;
}

.rates-grid th,
.rates-grid td {
    padding: 0.25rem 0.5rem;
    border-bottom: 1px solid #eef2f7;
    border-right: 1px solid #f3f6fa;
    text-align: right;
    white-space: nowrap;
}

.rates-grid thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f1f5f9;
    font-weight: 700;
    color: #334155;
}

.rates-grid th:first-child,
.rates-grid td:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    background: #f8fafc;
    font-weight: 600;
    text-align: left;
    border-right: 2px solid #e2e8f0;
}

.rates-grid thead th:first-child {
    z-index: 3;
    background: #f1f5f9;
}

.rates-grid td.rate-empty {
    color: #cbd5e1;
    text-align: center;
}

.rates-grid tbody tr:hover td {
    background: #eff6ff;
}

.rates-grid tbody tr:hover td:first-child {
    background: #dbeafe;
}

/* Logo na stronie logowania (Łukasz 04.09.2026) */
.login-logo {
    display: block;
    height: 2.6rem;
    width: auto;
    margin: 0 0 1rem;
}

/* Dzwonek powiadomień w górnym pasku (Łukasz 04.09.2026) */
.notif { position: relative; display: inline-block; }
.notif-btn {
    width: 2.2rem; height: 2.2rem; border-radius: 50%; position: relative; cursor: pointer; padding: 0;
    border: 1px solid #e2e8f0;
    background: #f1f5f9 no-repeat center/1.05rem url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%2394a3b8'%3E%3Cpath d='M8 16a2 2 0 0 0 2-2H6a2 2 0 0 0 2 2zm.995-14.901a1 1 0 1 0-1.99 0A5.002 5.002 0 0 0 3 6c0 1.098-.5 6-2 7h14c-1.5-1-2-5.902-2-7 0-2.42-1.72-4.44-4.005-4.901z'/%3E%3C/svg%3E");
    transition: background-color .15s, border-color .15s;
}
.notif-btn:hover { background-color: #e2e8f0; }
.notif-btn:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }
.notif-btn.has-items {
    background-color: #e0ecff; border-color: #bfdbfe;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%232563eb'%3E%3Cpath d='M8 16a2 2 0 0 0 2-2H6a2 2 0 0 0 2 2zm.995-14.901a1 1 0 1 0-1.99 0A5.002 5.002 0 0 0 3 6c0 1.098-.5 6-2 7h14c-1.5-1-2-5.902-2-7 0-2.42-1.72-4.44-4.005-4.901z'/%3E%3C/svg%3E");
}
.notif-btn.pulse { animation: notif-ring .9s ease; }
@keyframes notif-ring {
    0% { transform: rotate(0); } 20% { transform: rotate(-14deg); } 40% { transform: rotate(12deg); }
    60% { transform: rotate(-8deg); } 80% { transform: rotate(6deg); } 100% { transform: rotate(0); }
}
@media (prefers-reduced-motion: reduce) { .notif-btn.pulse { animation: none; } }
.notif-badge {
    position: absolute; top: -0.35rem; right: -0.35rem; min-width: 1.2rem; height: 1.2rem; padding: 0 .3rem;
    border-radius: 999px; background: #dc2626; color: #fff; font-size: .68rem; font-weight: 700; line-height: 1;
    display: inline-flex; align-items: center; justify-content: center; border: 2px solid #fff;
}
.notif-backdrop { position: fixed; inset: 0; z-index: 1040; }
.notif-panel {
    position: absolute; right: 0; top: calc(100% + .55rem); width: 25rem; max-width: calc(100vw - 2rem);
    background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; box-shadow: 0 14px 34px rgba(15, 23, 42, .16);
    z-index: 1050; overflow: hidden; text-align: left;
}
.notif-head {
    display: flex; justify-content: space-between; align-items: center; gap: .75rem;
    padding: .7rem .95rem; border-bottom: 1px solid #eef2f7; font-weight: 600; font-size: .9rem; color: #0f172a;
}
.notif-head-meta { font-weight: 500; font-size: .78rem; color: #64748b; }
.notif-list { list-style: none; margin: 0; padding: 0; max-height: 24rem; overflow-y: auto; }
.notif-item a { display: block; padding: .6rem .95rem; border-bottom: 1px solid #f1f5f9; text-decoration: none; color: inherit; }
.notif-item:last-child a { border-bottom: 0; }
.notif-item a:hover, .notif-item a:focus-visible { background: #f8fafc; outline: none; }
.notif-title { font-size: .86rem; font-weight: 600; color: #0f172a; display: flex; gap: .5rem; align-items: center; }
.notif-kind { width: .55rem; height: .55rem; border-radius: 50%; flex-shrink: 0; background: #2563eb; }
.notif-kind.MESSAGE { background: #0ea5e9; }
.notif-kind.CANCELLATION { background: #f59e0b; }
.notif-kind.SERVICE { background: #8b5cf6; }
.notif-kind.DISPATCH { background: #dc2626; }
.notif-detail { display: block; font-size: .8rem; color: #475569; margin-top: .15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-time { display: block; font-size: .72rem; color: #94a3b8; margin-top: .1rem; }
.notif-empty { padding: 1.3rem .95rem; font-size: .86rem; color: #64748b; text-align: center; }
.notif-more { padding: .55rem .95rem; font-size: .76rem; color: #64748b; background: #f8fafc; border-top: 1px solid #eef2f7; }

/* Dokumenty przesyłki: aktualne vs archiwalne (04.09.2026) */
.doc-group-title { font-size: 1rem; font-weight: 600; margin: 0.25rem 0 0.6rem; display: flex; align-items: center; gap: 0.6rem; }
.doc-group-ref { font-weight: 500; font-size: 0.85rem; color: #475569; background: #f1f5f9; border-radius: 999px; padding: 0.15rem 0.6rem; }
.doc-archive { margin-top: 1rem; }
.doc-archive > summary { cursor: pointer; font-size: 0.9rem; color: #475569; }
.doc-archive-table { margin-top: 0.6rem; opacity: 0.85; }

/* Szablony e-mail (04.09.2026) */
.tpl-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.tpl-list { max-height: 78vh; overflow: auto; }
.tpl-editor h2 { font-size: 1rem; font-weight: 650; margin-bottom: 0.25rem; }
.tpl-content { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.8rem; }
.tpl-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; align-items: center; margin-top: 0.4rem; }
.tpl-tag { font-size: 0.72rem; background: #f1f5f9; color: #64748b; padding: 0.1rem 0.4rem; border-radius: 4px; }
.tpl-tag.used { background: #dcfce7; color: #166534; }
.tpl-preview-frame { width: 100%; height: 26rem; border: 1px solid #e5e9f0; border-radius: 8px; background: #fff; }
@media (max-width: 1100px) { .tpl-layout { grid-template-columns: 1fr; } }
/* Anulowania: dwie zakładki (prośby klientów / anulowane przesyłki) */
.cancel-tabs { display: flex; gap: 0.4rem; margin: -0.25rem 0 1rem; }
.cancel-tabs a { padding: 0.35rem 0.85rem; border-radius: 999px; border: 1px solid #e2e8f0; background: #fff; color: #334155; text-decoration: none; font-size: 0.85rem; }
.cancel-tabs a.active { background: #0f172a; color: #fff; border-color: #0f172a; }

/* Karta klienta (05.09.2026) */
.customer-hero { display: flex; justify-content: space-between; gap: 1.25rem; align-items: flex-start; margin-bottom: 1.1rem; padding: 1.1rem 1.25rem; background: #fff; border: 1px solid #e5e9f0; border-radius: 12px; box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03); }
.customer-hero-title { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.customer-hero-title h1 { margin: 0; font-size: 1.45rem; }
.customer-hero-id { color: #94a3b8; font-size: 0.85rem; }
.customer-hero-sub { margin: 0.35rem 0 0; color: #5b6472; }
.customer-facts { display: flex; flex-wrap: wrap; gap: 0.4rem 1.6rem; margin: 0.75rem 0 0; }
.customer-facts div { display: grid; gap: 0.1rem; }
.customer-facts dt { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: #94a3b8; }
.customer-facts dd { margin: 0; font-size: 0.92rem; color: #0f172a; }
.customer-hero-actions { display: flex; gap: 0.5rem; flex-shrink: 0; }
.customer-tabs { gap: 0.3rem; border-bottom: 0 !important; margin-bottom: 1rem; }
.customer-tabs .nav-link { border: 1px solid #e2e8f0 !important; border-radius: 999px !important; padding: 0.35rem 0.9rem; color: #334155; font-size: 0.88rem; background: #fff; }
.customer-tabs .nav-link.active { background: #0f172a; color: #fff; border-color: #0f172a !important; }
.customer-tabs .nav-link.disabled { opacity: 0.5; }
.panel-subhead { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: #94a3b8; margin: 0.9rem 0 0.5rem; }
.panel-subhead:first-of-type { margin-top: 0.25rem; }
.form-grid-3 { grid-template-columns: repeat(3, minmax(160px, 1fr)); }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-3 { grid-column: 1 / -1; }
.consent-list { list-style: none; margin: 0 0 0.6rem; padding: 0; display: grid; gap: 0.35rem; }
.consent-list li { display: flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; }
.consent-list li::before { content: ""; width: 0.6rem; height: 0.6rem; border-radius: 50%; background: #cbd5e1; flex-shrink: 0; }
.consent-list li.on::before { background: #22c55e; }
.consent-list li.off { color: #94a3b8; }
@media (max-width: 900px) { .customer-hero { flex-direction: column; } .form-grid-3 { grid-template-columns: 1fr; } .form-grid .span-2 { grid-column: auto; } }

/* Listy: spokojniejsze tabele, zachęcające przyciski akcji (Łukasz 05.09.2026) */
.table-responsive { background: #fff; border: 1px solid #e5e9f0; border-radius: 12px; box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03); }
.table-responsive > .table { margin-bottom: 0; border-radius: 0; }
.table-striped { --bs-table-striped-bg: #fbfcfe; }
.table > :not(caption) > * > * { padding: 0.65rem 0.9rem; }
.table tbody tr.row-link:hover { background-color: #f1f5f9; }
.cell-link { color: #0f172a; font-weight: 600; text-decoration: none; }
.cell-link:hover { color: #1d4ed8; text-decoration: underline; }
.tabular { font-variant-numeric: tabular-nums; }
.btn-row { --bs-btn-color: #1d4ed8; --bs-btn-bg: #eff6ff; --bs-btn-border-color: #bfdbfe; --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #2563eb; --bs-btn-hover-border-color: #2563eb; --bs-btn-active-bg: #1d4ed8; --bs-btn-active-color: #fff; --bs-btn-active-border-color: #1d4ed8; border-radius: 999px; padding-inline: 0.85rem; font-weight: 600; white-space: nowrap; }
.btn-row::after { content: "›"; margin-left: 0.35rem; font-weight: 700; }
.pill { display: inline-block; padding: 0.15rem 0.6rem; border-radius: 999px; font-size: 0.78rem; font-weight: 600; line-height: 1.4; }
.pill-ok { background: #dcfce7; color: #166534; }
.pill-bad { background: #fee2e2; color: #991b1b; }
.pill-muted { background: #f1f5f9; color: #475569; }
.toolbar-customers { grid-template-columns: minmax(240px, 2fr) minmax(160px, 1fr) minmax(160px, 1fr) auto; }

/* Role i uprawnienia (05.09.2026) */
.role-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 0.85rem 1rem; margin-top: 0.75rem; }
.role-group { border: 1px solid #e6ebf2; border-radius: 12px; padding: 0.7rem 0.85rem 0.5rem; background: #fff; }
.role-group-head { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 0.82rem; letter-spacing: 0.02em; text-transform: uppercase; color: #334155; margin-bottom: 0.4rem; padding-bottom: 0.4rem; border-bottom: 1px solid #f1f5f9; }
.role-group-head .btn-link { font-size: 0.78rem; text-transform: none; letter-spacing: 0; font-weight: 500; }
.perm-options { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.15rem; }
.perm-option { display: flex; align-items: flex-start; gap: 0.75rem; padding: 0.4rem 0.5rem; border-radius: 8px; cursor: pointer; transition: background 0.12s; }
.perm-option:hover { background: #f8fafc; }
.perm-option.is-on { background: #f0f6ff; }
.perm-option .form-switch { padding-left: 2.6em; min-height: 0; flex: none; margin-top: 0.15rem; }
.perm-option .form-check-input { cursor: pointer; width: 2.2em; height: 1.2em; margin-top: 0; }
.perm-text { display: grid; gap: 0.05rem; min-width: 0; }
.perm-name { font-weight: 600; font-size: 0.9rem; color: #0f172a; line-height: 1.3; }
.perm-desc { font-size: 0.78rem; color: #64748b; line-height: 1.35; }
.tpl-editor .form-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 1100px) { .role-groups { grid-template-columns: 1fr; } }

/* Opiekunowie klienta (etap 2 ról, 05.09.2026) */
.caretaker-list { list-style: none; margin: 0 0 0.5rem; padding: 0; display: grid; gap: 0.35rem; }
.caretaker-list li { display: flex; align-items: center; gap: 0.7rem; padding: 0.4rem 0.5rem; border: 1px solid #eef2f7; border-radius: 10px; background: #fff; }
.caretaker-avatar { width: 2rem; height: 2rem; border-radius: 50%; background: #e8f0fe; color: #1d4ed8; font-weight: 700; font-size: 0.8rem; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.caretaker-text { display: grid; gap: 0.05rem; min-width: 0; flex: 1; }
.caretaker-name { font-weight: 600; font-size: 0.9rem; color: #0f172a; }
.caretaker-meta { font-size: 0.78rem; color: #64748b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Tylko podgląd (brak uprawnienia do edycji, 05.09.2026): formularze i przyciski akcji nieaktywne, nawigacja działa */
.readonly-scope button:not(.ro-allow), .readonly-scope input, .readonly-scope select, .readonly-scope textarea, .readonly-scope .form-check-input { pointer-events: none; opacity: 0.55; }
.readonly-scope .nav-tabs a, .readonly-scope a.btn { pointer-events: auto; opacity: 1; }
.readonly-banner { margin-bottom: 1rem; }
