/**
 * QR System – Design System
 * Styl: czarno-biały, ostre narożniki, mobile-first (inspiracja: InPost app)
 */

/* =========================================================
   Zmienne & reset
   ========================================================= */
:root {
    --c-black:   #0a0a0a;
    --c-white:   #ffffff;
    --c-gray-50: #fafafa;
    --c-gray-100:#f4f4f4;
    --c-gray-200:#e8e8e8;
    --c-gray-400:#b0b0b0;
    --c-gray-600:#6b6b6b;
    --c-gray-800:#2e2e2e;
    --c-danger:  #c0392b;
    --c-warning: #d68910;
    --c-success: #1a7a3e;

    --radius: 0;
    --border: 1.5px solid var(--c-gray-200);
    --border-dark: 1.5px solid var(--c-black);
    --shadow: none;
    --font: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: "SF Mono", "Fira Code", Consolas, monospace;
}

*,
*::before,
*::after {
    border-radius: 0 !important;
}

body {
    font-family: var(--font);
    background: var(--c-white);
    color: var(--c-black);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* =========================================================
   Typografia
   ========================================================= */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.text-muted,
.text-secondary { color: var(--c-gray-600) !important; }

/* =========================================================
   Nawigacja
   ========================================================= */
header {
    border-bottom: var(--border) !important;
    background: var(--c-white) !important;
    position: sticky;
    top: 0;
    z-index: 1000;
    --app-header-height: 56px;
}

.navbar {
    padding-top: 0.875rem;
    padding-bottom: 0.875rem;
}

.navbar-brand {
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: -0.03em;
    color: var(--c-black) !important;
    text-decoration: none !important;
}

.navbar-toggler {
    border: var(--border-dark) !important;
    padding: 6px 10px;
}

.navbar-toggler:focus { box-shadow: none !important; }

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(10,10,10,1)' stroke-linecap='square' stroke-width='2.5' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.nav-link {
    font-weight: 500;
    font-size: 0.9rem;
    letter-spacing: 0.01em;
    color: var(--c-black) !important;
    padding: 6px 0 !important;
    transition: opacity 0.15s;
}

.nav-link:hover { opacity: 0.55; }

/* Menu mobilne: bez poziomego przewijania całej strony przez długie etykiety */
@media (max-width: 991.98px) {
    .navbar-collapse {
        max-width: 100%;
        overflow-x: hidden;
    }
    .navbar-nav .nav-link {
        max-width: 100%;
        box-sizing: border-box;
    }
}

@media (min-width: 992px) {
    .navbar-nav .nav-item {
        padding-right: 20px;
    }
    .navbar-nav .nav-item:last-child {
        padding-right: 0;
    }
}

/* Nav CTA buttons */
.nav-btn {
    display: inline-block;
    padding: 7px 18px;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    letter-spacing: 0.01em;
    transition: background 0.15s, color 0.15s;
    text-align: center;
    text-transform: uppercase;
}

.nav-btn-outline {
    border: var(--border-dark);
    color: var(--c-black);
    background: transparent;
}

.nav-btn-outline:hover {
    background: var(--c-black);
    color: var(--c-white);
}

.nav-btn-fill {
    border: var(--border-dark);
    background: var(--c-black);
    color: var(--c-white);
}

.nav-btn-fill:hover {
    background: var(--c-gray-800);
    color: var(--c-white);
}

/* Aktywna pozycja menu */
.nav-link.active {
    font-weight: 700;
    border-bottom: 2px solid var(--c-black);
    padding-bottom: 4px !important;
}

/* =========================================================
   Przyciski
   ========================================================= */
.btn {
    font-weight: 600;
    font-size: 0.875rem;
    letter-spacing: 0.02em;
    padding: 10px 20px;
    border-width: 1.5px;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    text-align: center;
    text-transform: uppercase;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
}

.btn-dark {
    background: var(--c-black);
    border-color: var(--c-black);
    color: var(--c-white);
}

.btn-dark:hover,
.btn-dark:focus {
    background: var(--c-gray-800);
    border-color: var(--c-gray-800);
    color: var(--c-white);
}

.btn-outline-dark {
    border-color: var(--c-black);
    color: var(--c-black);
    background: transparent;
}

.btn-outline-dark:hover,
.btn-outline-dark:focus {
    background: var(--c-black);
    color: var(--c-white);
}

.btn-outline-secondary {
    border-color: var(--c-gray-400);
    color: var(--c-gray-800);
    background: transparent;
}

.btn-outline-secondary:hover {
    background: var(--c-gray-100);
    color: var(--c-black);
    border-color: var(--c-gray-800);
}

.btn-outline-danger {
    border-color: var(--c-danger);
    color: var(--c-danger);
    background: transparent;
}

.btn-outline-danger:hover {
    background: var(--c-danger);
    color: var(--c-white);
}

.btn-outline-primary {
    border-color: var(--c-black);
    color: var(--c-black);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--c-black);
    color: var(--c-white);
    border-color: var(--c-black);
}

.btn:focus { box-shadow: 0 0 0 3px rgba(10,10,10,0.15) !important; }

/* Pełna szerokość na mobile */
@media (max-width: 575px) {
    .btn-mobile-full { width: 100%; justify-content: center; }
}

/* =========================================================
   Karty
   ========================================================= */
.card {
    border: var(--border) !important;
    box-shadow: none !important;
    background: var(--c-white);
}

.card-header {
    background: var(--c-gray-50) !important;
    border-bottom: var(--border) !important;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 12px 20px;
    color: var(--c-black);
}

.card-body { padding: 20px; }

/* Karty klikalne */
a.card,
.card-link {
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s;
}

a.card:hover,
.card-link:hover { border-color: var(--c-black) !important; }

/* =========================================================
   Formularze
   ========================================================= */
.form-control,
.form-select {
    border: var(--border) !important;
    border-color: var(--c-gray-400) !important;
    font-size: 0.925rem;
    padding: 10px 14px;
    background-color: var(--c-white);
    color: var(--c-black);
    transition: border-color 0.15s;
}

/* Przywróć prawy padding dla strzałki selecta (Bootstrap używa background-image jako chevron) */
.form-select {
    padding-right: 2.5rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--c-black) !important;
    box-shadow: 0 0 0 3px rgba(10,10,10,0.1) !important;
    outline: none;
}

.form-control.bg-light {
    background: var(--c-gray-100) !important;
    border-color: var(--c-gray-200) !important;
    color: var(--c-gray-600) !important;
}

.form-label {
    font-weight: 600;
    font-size: 0.825rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--c-gray-600);
    margin-bottom: 6px;
}

.form-text {
    font-size: 0.8rem;
    color: var(--c-gray-600);
    margin-top: 4px;
}

.form-check-input {
    border: 1.5px solid var(--c-gray-400) !important;
}

.form-check-input:checked {
    background-color: var(--c-black) !important;
    border-color: var(--c-black) !important;
}

.form-check-input:focus { box-shadow: 0 0 0 3px rgba(10,10,10,0.1) !important; }

/* Textarea */
textarea.form-control { min-height: 90px; resize: vertical; }

/* Input groups */
.input-group .btn { border-left: none; }
.input-group .form-control { flex: 1; }

/* =========================================================
   Alerty
   ========================================================= */
.alert {
    border-width: 0 0 0 3px;
    border-style: solid;
    background: var(--c-gray-50);
    color: var(--c-black);
    font-size: 0.9rem;
    padding: 14px 18px;
}

.alert-success {
    border-color: var(--c-success);
    background: #f0f9f4;
    color: var(--c-success);
}

.alert-danger {
    border-color: var(--c-danger);
    background: #fdf3f2;
    color: var(--c-danger);
}

.alert-warning {
    border-color: var(--c-warning);
    background: #fdf8f0;
    color: var(--c-warning);
}

.alert-info,
.alert-secondary {
    border-color: var(--c-gray-400);
    background: var(--c-gray-50);
    color: var(--c-gray-800);
}

.alert-dismissible .btn-close { padding: 16px 18px; }

/* =========================================================
   Odznaki (badges)
   ========================================================= */
.badge {
    font-weight: 600;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    padding: 4px 8px;
    border: 1px solid transparent;
}

.badge.bg-dark        { background: var(--c-black) !important; color: var(--c-white) !important; }
.badge.bg-secondary,
.badge.bg-secondary-subtle  { background: var(--c-gray-100) !important; color: var(--c-gray-800) !important; border-color: var(--c-gray-300, var(--c-gray-200)) !important; }
.badge.bg-success,
.badge.bg-success-subtle    { background: #f0f9f4 !important; color: var(--c-success) !important; border-color: #c3e6d0 !important; }
.badge.bg-danger,
.badge.bg-danger-subtle     { background: #fdf3f2 !important; color: var(--c-danger) !important; border-color: #f5c6c2 !important; }
.badge.bg-warning,
.badge.bg-warning-subtle    { background: #fdf8f0 !important; color: var(--c-warning) !important; border-color: #f0d5a0 !important; }
.badge.bg-info-subtle       { background: var(--c-gray-100) !important; color: var(--c-gray-800) !important; border-color: var(--c-gray-200) !important; }

/* =========================================================
   Lista grup
   ========================================================= */
.list-group-item {
    border-color: var(--c-gray-200) !important;
    padding: 14px 20px;
    font-size: 0.9rem;
}

.list-group-item:first-child { border-top: none !important; }

.list-group-item-action:hover {
    background: var(--c-gray-50);
    color: var(--c-black);
}

.list-group-item-action:active {
    background: var(--c-gray-100);
    color: var(--c-black);
}

/* =========================================================
   Tabele
   ========================================================= */
.table {
    font-size: 0.9rem;
    margin-bottom: 0;
}

.table th {
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--c-gray-600);
    border-bottom: 2px solid var(--c-black) !important;
    padding: 10px 12px;
}

.table.table-dark th,
.table.table-dark td,
thead.table-dark th {
    color: #fff !important;
    border-bottom-color: rgba(255,255,255,.2) !important;
}

.table td {
    padding: 12px 12px;
    border-color: var(--c-gray-200) !important;
    vertical-align: middle;
}

.table-hover tbody tr:hover { background: var(--c-gray-50); }

.table-responsive {
    min-height: 360px;
}

/* =========================================================
   Wiersz elementu listy (device/location row)
   ========================================================= */
.qr-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    border-bottom: var(--border);
    text-decoration: none;
    color: var(--c-black);
    transition: background 0.12s;
}

.qr-row:last-child { border-bottom: none; }
.qr-row:hover { background: var(--c-gray-50); }

.qr-row-icon {
    width: 44px;
    height: 44px;
    background: var(--c-gray-100);
    border: var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.875rem;
    color: var(--c-gray-600);
}

.qr-row-icon svg { width: 20px; height: 20px; }

.qr-row-body { flex: 1; min-width: 0; }

.qr-row-title {
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--c-black);
    margin-bottom: 2px;
}

.qr-row-sub {
    font-size: 0.8rem;
    color: var(--c-gray-600);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.qr-row-chevron {
    color: var(--c-gray-400);
    flex-shrink: 0;
}

/* Moje urządzenia / Moi klienci / Moi serwisanci / Moje serwisy – mobile: wiersz karty + akcje pod treścią */
#dlMobile .dl-row,
#mcMobile .dl-row,
#mtMobile .dl-row,
#plMobile .pl-row,
#mdMobile .qr-row {
    flex-wrap: wrap;
}
#dlMobile .dl-row .dl-mobile-actions,
#mcMobile .dl-row .dl-mobile-actions,
#mtMobile .dl-row .dl-mobile-actions,
#plMobile .pl-row .pl-mobile-actions,
#mdMobile .qr-row .md-mobile-actions {
    flex-basis: 100%;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 0.35rem;
}
#dlMobile .dl-row .dl-mobile-actions .btn,
#dlMobile .dl-row .dl-mobile-actions .dropdown,
#mcMobile .dl-row .dl-mobile-actions .btn,
#mcMobile .dl-row .dl-mobile-actions .dropdown,
#mtMobile .dl-row .dl-mobile-actions .btn,
#mtMobile .dl-row .dl-mobile-actions .dropdown,
#plMobile .pl-row .pl-mobile-actions .btn,
#plMobile .pl-row .pl-mobile-actions .dropdown,
#mdMobile .qr-row .md-mobile-actions .btn,
#mdMobile .qr-row .md-mobile-actions .dropdown {
    flex-shrink: 0;
}

/* =========================================================
   List tables with row context menu (⋮) – jak Moje serwisy
   ========================================================= */
.list-table-page-col { min-width: 0; }

.list-table-wrap {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.list-table {
    table-layout: fixed;
    width: 100%;
}

.list-table th,
.list-table td {
    vertical-align: middle;
}

.list-table td.list-cell-truncate {
    overflow: hidden;
    max-width: 0;
}

.list-table th.list-col-actions,
.list-table td.list-col-actions-cell {
    overflow: visible;
    width: 52px;
    padding-right: 14px;
}

.list-table th.list-col-actions-wide,
.list-table td.list-col-actions-wide {
    overflow: visible;
    width: 220px;
}

.list-table .dropdown-menu {
    z-index: 1080;
}

.list-context-menu.dropdown {
    position: static;
    display: inline-block;
}

/* Ikony w tabelach list – jednakowy kwadrat (serwis +, menu ⋮, itd.) */
.btn-list-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.9375rem;
    height: 1.9375rem;
    padding: 0 !important;
    line-height: 1;
    flex-shrink: 0;
}
.btn-list-icon > .bi {
    font-size: 1rem;
    line-height: 1;
}

/* Moje serwisy – szerokości kolumn */
.list-table.md-devices-cols .md-col-device { width: 24%; }
.list-table.md-devices-cols .md-col-location { width: 18%; }
.list-table.md-devices-cols .md-col-owner { width: 16%; }
.list-table.md-devices-cols .md-col-service { width: 12%; }
.list-table.md-devices-cols .md-col-active { width: 8%; }
.list-table.md-devices-cols .md-col-lastorder { width: 10%; }
.list-table.md-devices-cols .md-col-dstatus { width: 10%; }

/* Moje urządzenia (właściciel) */
.list-table.dl-devices-cols .dl-col-media { width: 10%; }
.list-table.dl-devices-cols .dl-col-device { width: 38%; }
.list-table.dl-devices-cols .dl-col-status { width: 8%; }
.list-table.dl-devices-cols .dl-col-nsd {
    width: 15%;
    min-width: 7.75rem;
    white-space: nowrap;
}
.list-table.dl-devices-cols .dl-col-service {
    width: 118px;
    min-width: 118px;
    max-width: 118px;
    padding-left: 4px;
    padding-right: 4px;
}
.list-table.dl-devices-cols .dl-col-service .dl-service-cell {
    max-width: 110px;
    margin-left: auto;
    margin-right: auto;
}
.list-table.dl-devices-cols .dl-col-service .dl-service-label {
    display: block;
    max-width: 110px;
    font-size: .65rem;
    line-height: 1.15;
    word-break: break-word;
    overflow-wrap: anywhere;
}

/* Obiekty – mobile: przyciski Dodaj, Edytuj, Usuń pod przyciskiem Urządzenia */
@media (max-width: 767.98px) {
    .loc-card-actions {
        /*flex-direction: column;
        align-items: stretch;*/
    }
    .loc-card-actions .loc-card-actions-buttons {
        justify-content: flex-start;
    }
}

/* Lista urządzeń (mobile): zdjęcie nad kodem QR */
.device-list-media {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

/* Listy: na desktop paginacja (wierszy) wyrównana do prawej */
@media (min-width: 768px) {
    .list-toolbar .list-toolbar-actions {
        flex-grow: 1;
    }
}

/* Listy: na mobile szukaj na górze; filtry + paginacja mogą się zawinąć (bez poziomego scrollu strony) */
@media (max-width: 767.98px) {
    .list-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        min-width: 0;
    }
    .list-toolbar .list-toolbar-search {
        max-width: none !important;
        min-width: 0 !important;
        flex: 0 0 auto;
        width: 100%;
    }
    .list-toolbar .list-toolbar-search .input-group {
        width: 100%;
        min-width: 0;
    }
    .list-toolbar .list-toolbar-actions {
        width: 100%;
        min-width: 0;
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 0.5rem;
        margin-left: 0;
        align-items: center;
    }
    .list-toolbar .list-toolbar-actions .list-toolbar-pagination {
        margin-left: 0;
        flex: 1 1 auto;
        min-width: 0;
        justify-content: flex-end;
    }
    .list-toolbar .list-toolbar-actions .list-filters-wrap {
        flex-shrink: 0;
    }
    .list-toolbar .list-toolbar-pagination .text-muted.small {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    /* Filtry tylko szerokość przycisku (wyrównane do lewej) */
    .list-toolbar .list-filters-wrap {
        width: auto;
        flex-shrink: 0;
    }
    /* Panel filtrów: stała górna szerokość – bez calc(100vw), które potrafi rozszerzyć stronę */
    .list-toolbar .list-filters-panel.dropdown-menu {
        max-width: 20rem;
        max-height: min(75vh, 420px);
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }
}

/* Nagłówek strony z długim opisem – nie rozpycha flexa poza viewport */
.page-header.d-flex > div:first-child {
    min-width: 0;
}
.page-header.d-flex > div:first-child .text-muted {
    overflow-wrap: anywhere;
    word-break: break-word;
}
@media (min-width: 768px) {
    .table-clients-tech .mc-th-actions,
    .table-clients-tech .mt-th-actions {
        width: 220px;
    }
    .table-clients-tech .mc-th-actions.list-col-actions-wide,
    .table-clients-tech .mt-th-actions.list-col-actions-wide {
        overflow: visible;
    }
}

.table-clients-tech .mt-col-categories {
    width: 240px;
    min-width: 240px;
    max-width: 280px;
}

.table-clients-tech .mt-col-google {
    width: 120px;
    min-width: 110px;
    white-space: nowrap;
}

.mt-google-rating {
    display: inline-flex;
    align-items: center;
    font-size: 0.875rem;
    white-space: nowrap;
}

.mt-google-rating--sm {
    font-size: 0.75rem;
}

.mt-google-rating-link {
    display: inline-flex;
    align-items: center;
    border-radius: 0.25rem;
    transition: opacity 0.15s ease;
}

.mt-google-rating-link:hover {
    opacity: 0.85;
}

.mt-cat-badge {
    font-weight: 500;
    font-size: 0.72rem;
    line-height: 1.25;
    white-space: normal;
    text-align: left;
}

.mt-cat-dropdown-btn {
    font-size: 0.75rem;
    padding: 0.25rem 0.55rem;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 600;
}

.mt-cat-dropdown-menu {
    max-width: min(320px, 90vw);
    z-index: 1080;
}

.mt-cat-inline .mt-cat-dropdown-btn {
    font-size: 0.7rem;
}

/* Tabele Moi klienci / Moi serwisanci: łamanie długich e-maili w komórce */
.table-clients-tech.table > :not(caption) > * > th,
.table-clients-tech.table > :not(caption) > * > td {
    vertical-align: middle;
}

/* Grupy przycisków akcji (Zapisz / Wróć / Anuluj) – jednakowa szerokość na mobile */
.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}
.action-buttons > .btn,
.action-buttons > a.btn {
    flex: 1 1 0;
    min-width: 12rem;
    text-align: center;
}
.action-buttons > .btn .bi,
.action-buttons > a.btn .bi {
    flex-shrink: 0;
}

@media (max-width: 575.98px) {
    .action-buttons.flex-column {
        align-items: stretch;
        width: 100%;
    }
    .action-buttons.flex-column > .btn,
    .action-buttons.flex-column > a.btn {
        width: 100%;
        flex: 0 0 auto;
        min-width: 0;
        justify-content: center;
        display: inline-flex;
        align-items: center;
    }
}

/* =========================================================
   Statystyki (dashboard kafelki)
   ========================================================= */
.stat-card {
    border: var(--border);
    padding: 24px 20px;
    text-align: center;
    text-decoration: none;
    color: var(--c-black);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.15s, background 0.15s;
    background: var(--c-white);
}

.stat-card--active {
    border-color: var(--c-black);
    background: var(--c-gray-50);
}

.stat-card:hover {
    border-color: var(--c-black);
    background: var(--c-gray-50);
    color: var(--c-black);
}

.stat-card-icon {
    width: 48px;
    height: 48px;
    background: var(--c-gray-100);
    border: var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
}

.stat-card-icon svg { width: 22px; height: 22px; }

.stat-card-icon .bi {
    font-size: 1.4rem;
    line-height: 1;
}

.stat-card-value {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1;
    margin-bottom: 4px;
    text-align: center;
    width: 100%;
    max-width: 100%;
}

.stat-card-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--c-gray-600);
    text-align: center;
    width: 100%;
    max-width: 100%;
    line-height: 1.25;
    overflow-wrap: break-word;
    hyphens: none;
}

/* =========================================================
   Sekcja page header
   ========================================================= */
.page-header {
    border-bottom: var(--border);
    padding: 28px 0 20px;
    margin-bottom: 28px;
}

.page-header h1 {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 2px;
}

/* =========================================================
   Sekcja pustej listy
   ========================================================= */
.empty-state {
    border: var(--border);
    padding: 60px 24px;
    text-align: center;
    background: var(--c-gray-50);
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    border: 2px solid var(--c-black);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.empty-state-icon svg { width: 28px; height: 28px; }

.empty-state p { color: var(--c-gray-600); font-size: 0.95rem; margin-bottom: 20px; }

/* =========================================================
   Pasek kroków (stepper)
   ========================================================= */
.step-bar {
    display: flex;
    border: var(--border);
    overflow: hidden;
    margin-bottom: 28px;
}

.step-item {
    flex: 1;
    padding: 10px 8px;
    text-align: center;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    border-right: var(--border);
    background: var(--c-white);
    color: var(--c-gray-400);
}

.step-item:last-child { border-right: none; }

.step-item.active {
    background: var(--c-black);
    color: var(--c-white);
}

.step-item.done {
    background: var(--c-gray-100);
    color: var(--c-gray-600);
}

/* =========================================================
   Avatar kołowy
   ========================================================= */
.avatar {
    width: 52px;
    height: 52px;
    background: var(--c-black);
    color: var(--c-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.3rem;
    flex-shrink: 0;
    /* bez border-radius – kwadrat */
}

/* =========================================================
   Separator sekcji
   ========================================================= */
.section-sep {
    border: none;
    border-top: var(--border);
    margin: 28px 0;
}

/* =========================================================
   Stopka
   ========================================================= */
footer {
    border-top: 2px solid var(--c-black);
    background: var(--c-black) !important;
    color: var(--c-white);
}

footer a:hover { opacity: 0.7; }

/* =========================================================
   Responsywność – mobile first
   ========================================================= */
@media (max-width: 767px) {
    .page-header h1 { font-size: 1.3rem; }

    /* Dwa przyciski w nagłówku strony – obok siebie, równej szerokości */
    .page-header-actions:has(> :nth-child(2):last-child),
    .dashboard-header-actions:has(> :nth-child(2):last-child) {
        flex: 1 1 100%;
        width: 100%;
        flex-wrap: nowrap;
    }
    .page-header-actions:has(> :nth-child(2):last-child) > .btn,
    .page-header-actions:has(> :nth-child(2):last-child) > a.btn,
    .page-header-actions:has(> :nth-child(2):last-child) > button.btn,
    .dashboard-header-actions:has(> :nth-child(2):last-child) > .btn,
    .dashboard-header-actions:has(> :nth-child(2):last-child) > a.btn,
    .dashboard-header-actions:has(> :nth-child(2):last-child) > button.btn {
        flex: 1 1 0;
        min-width: 0;
        justify-content: center;
        display: inline-flex;
        align-items: center;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
        text-align: center;
        white-space: normal;
        font-size: 0.8125rem;
    }

    .dl-header-btn-long {
        font-size: 0.8125rem;
        line-height: 1.2;
    }
    .dl-header-btn-short {
        display: none;
        font-size: 0.8125rem;
        line-height: 1.2;
    }
    @media (max-width: 399px) {
        .dl-header-btn-long { display: none; }
        .dl-header-btn-short { display: inline; }
    }

    .list-toolbar-pagination--compact .dl-page-size-label {
        font-size: 0.7rem;
    }
    .list-toolbar-pagination--compact .dl-page-size-select {
        width: 3.25rem !important;
        padding-left: 0.35rem;
        padding-right: 1.35rem;
        font-size: 0.75rem;
    }
    .list-toolbar-pagination--compact #dlCount {
        font-size: 0.65rem;
        max-width: 4.5rem;
        line-height: 1.2;
    }

    .stat-card {
        padding: 14px 8px;
    }
    .stat-card-icon {
        width: 44px;
        height: 44px;
        margin-bottom: 10px;
    }
    .stat-card-icon .bi {
        font-size: 1.25rem;
    }
    .stat-card-value { font-size: 1.6rem; }
    .stat-card-label {
        font-size: 0.68rem;
        letter-spacing: 0.04em;
    }
    .card-body { padding: 16px; }
    .qr-row { padding: 14px 16px; }
    .container { padding-left: 16px; padding-right: 16px; }
    .btn { padding: 11px 18px; }
}

/* =========================================================
   Mapa (Google Maps)
   ========================================================= */
#map { border: var(--border); }

/* =========================================================
   Mono / kod
   ========================================================= */
.font-monospace,
code { font-family: var(--font-mono); font-size: 0.85em; }

/* =========================================================
   Druk
   ========================================================= */
@media print {
    .no-print,
    header, footer,
    .navbar { display: none !important; }
    .print-only { display: block !important; }
    body { background: #fff; font-size: 12pt; }
}

/* =========================================================
   Bootstrap overrides – zaokrąglenia globalne
   ========================================================= */
.rounded, .rounded-circle, .rounded-pill,
.rounded-sm, .rounded-md, .rounded-lg,
.rounded-top, .rounded-bottom,
.rounded-start, .rounded-end { border-radius: 0 !important; }

img.rounded, img.rounded-circle { border-radius: 0 !important; }

.dropdown-menu { border-radius: 0 !important; border: var(--border) !important; }

.modal-content { border-radius: 0 !important; border: var(--border-dark) !important; }

/* Progres bar */
.progress { border-radius: 0 !important; background: var(--c-gray-100); }
.progress-bar { background: var(--c-black) !important; }

/* Tooltip */
.tooltip-inner { border-radius: 0 !important; background: var(--c-black); }

/* Pagination */
.page-link { border-radius: 0 !important; border-color: var(--c-gray-200) !important; color: var(--c-black) !important; }
.page-item.active .page-link { background: var(--c-black) !important; border-color: var(--c-black) !important; color: var(--c-white) !important; }

/* =========================================================
   Statusy zleceń serwisowych
   ========================================================= */
.so-badge-unsent     { background-color: #fff3cd !important; color: #664d03 !important; border: 1px solid #ffc107 !important; font-weight: 600; }
.badge-so-new        { background: #f0f0f0; color: #333;    border: 1px solid #ccc; }
.badge-so-accepted   { background: #e8f5e9; color: #1b5e20; border: 1px solid #81c784; }
.badge-so-progress   { background: #fff3cd; color: #856404; border: 1px solid #ffc107; }
.badge-so-approval   { background: #e3f2fd; color: #0d47a1; border: 1px solid #90caf9; }
.badge-so-done       { background: #000;    color: #fff; }
.badge-so-closed     { background: #e8f5e9; color: #1b5e20; border: 1px solid #a5d6a7; }
.badge-so-cancelled  { background: #f8f8f8; color: #999;    border: 1px solid #ddd; text-decoration: line-through; }

/* =========================================================
   Oś czasu urządzenia (device_history)
   ========================================================= */
.device-timeline {
    padding: 0;
}

.timeline-day-sep {
    padding: 8px 20px;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--c-gray-500);
    background: var(--c-gray-100);
    border-bottom: 1px solid var(--c-gray-200);
    border-top: 1px solid var(--c-gray-200);
}

.timeline-item {
    display: flex;
    gap: 14px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--c-gray-200);
    transition: background .15s;
}
.timeline-item:last-child { border-bottom: none; }
.timeline-item:hover { background: var(--c-gray-50); }

.timeline-dot {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--c-gray-200);
    background: var(--c-white);
}

.timeline-body {
    flex: 1;
    min-width: 0;
}

.timeline-title {
    font-size: .9rem;
    line-height: 1.3;
}

.timeline-time {
    font-size: .75rem;
    flex-shrink: 0;
}

.timeline-text {
    font-size: .875rem;
    color: var(--c-gray-700);
    margin-top: 2px;
}

.timeline-meta, .timeline-author {
    font-size: .75rem;
    margin-top: 4px;
}

/* Preloader na przyciskach (ZASADY_PROJEKTU §9 – jak w profilu) */
@keyframes app1-btn-spin {
    to { transform: rotate(360deg); }
}
.bi.spin {
    display: inline-block;
    animation: app1-btn-spin 0.8s linear infinite;
}

/* =========================================================
   Edytor sekcji paszportu (DPP)
   ========================================================= */
.pse-wrap > .card-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: var(--c-black) !important;
    color: var(--c-white) !important;
    border-bottom-color: var(--c-black) !important;
}

.pse-wrap > .card-header small {
    font-size: 0.75rem;
    letter-spacing: 0;
    text-transform: none;
    font-weight: 500;
    color: var(--c-gray-400);
}

.pse-intro {
    padding: 14px 20px;
    border-bottom: var(--border);
    font-size: 0.875rem;
    color: var(--c-gray-600);
    margin: 0;
}

.pse-add-field {
    padding: 12px 20px 16px;
    border-top: 1px solid var(--c-gray-200);
    background: var(--c-gray-50);
}

.pse-row-save {
    display: flex;
    justify-content: flex-end;
    padding: 10px 12px 12px;
    border-top: 1px dashed var(--c-gray-200);
    background: var(--c-white);
}

.pse-field .pse-row-save {
    margin: 0 -1px -1px;
    border-radius: 0 0 8px 8px;
}

.pse-identification-fields .pse-row-save {
    justify-content: flex-start;
    padding: 10px 0 4px;
    border-top: none;
    background: transparent;
}

.pse-section {
    border-bottom: var(--border);
}

.pse-section:last-child {
    border-bottom: none;
}

.pse-section-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: var(--c-black);
    color: var(--c-white);
    border-bottom: var(--border-dark);
}

.pse-section-index {
    flex-shrink: 0;
    min-width: 2rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--c-gray-400);
    text-align: center;
}

.pse-section-move-group {
    flex-shrink: 0;
}

.pse-section-move-group .btn {
    padding: 0 7px;
    line-height: 1.25;
    border-color: rgba(255, 255, 255, 0.35);
    color: var(--c-white);
}

.pse-section-move-group .btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.55);
    color: var(--c-white);
}

.pse-section-move-group .btn:disabled {
    opacity: 0.35;
}

.pse-section-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.pse-section-name-display {
    flex: 1;
    min-width: 0;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--c-white);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pse-section-edit {
    flex-shrink: 0;
    padding: 4px 10px !important;
    line-height: 1;
    border-color: var(--c-gray-600) !important;
    color: var(--c-white) !important;
    background: transparent !important;
}

.pse-section-edit:hover {
    background: var(--c-white) !important;
    border-color: var(--c-white) !important;
    color: var(--c-black) !important;
}

.pse-section-del {
    flex-shrink: 0;
    opacity: 0.65;
    color: var(--c-gray-400) !important;
    transition: opacity 0.15s, color 0.15s;
}

.pse-section-del:hover {
    opacity: 1;
    color: #e8a0a0 !important;
}

.pse-fields {
    padding: 16px 20px 8px;
}

.pse-field {
    padding: 0;
    margin-bottom: 10px;
    background: var(--c-white);
    border: var(--border);
    transition: border-color 0.15s, box-shadow 0.15s;
    overflow: hidden;
}

.pse-field:hover {
    border-color: var(--c-gray-400);
}

.pse-field:focus-within {
    border-color: var(--c-black);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}

.pse-field:last-child {
    margin-bottom: 0;
}

.pse-field-top {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 8px 10px;
    background: var(--c-gray-50);
    color: var(--c-black);
    border-bottom: var(--border);
}

.pse-field[data-collapsed="1"] .pse-field-top {
    border-bottom: none;
}

.pse-field-toggle {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: var(--c-gray-600);
    transition: background 0.15s, color 0.15s, transform 0.2s;
}

.pse-field-toggle:hover {
    background: var(--c-white);
    border-color: var(--c-gray-300);
    color: var(--c-black);
}

.pse-field-toggle-icon {
    font-size: 0.95rem;
    line-height: 1;
}

.pse-field-move-group {
    flex-shrink: 0;
}

.pse-field-move-group .btn {
    padding: 0 7px;
    line-height: 1.25;
}

.pse-field-move-group .btn:disabled {
    opacity: 0.35;
}

.pse-field[data-collapsed="0"] .pse-field-toggle {
    background: var(--c-white);
    border-color: var(--c-gray-300);
    color: var(--c-black);
}

.pse-field-top-summary {
    display: none;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1;
}

.pse-field[data-collapsed="1"] .pse-field-top-summary {
    display: flex;
}

.pse-field-top-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.pse-field[data-collapsed="1"] .pse-field-top-controls,
.pse-field[data-collapsed="1"] .pse-field-del {
    display: none;
}

.pse-field-summary-meta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.pse-summary-chip {
    display: inline-block;
    padding: 2px 8px;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    border-radius: 999px;
    border: 1px solid var(--c-gray-300);
    background: var(--c-white);
    color: var(--c-gray-700);
    white-space: nowrap;
}

.pse-summary-chip-access {
    color: var(--c-gray-800);
}

.pse-control-group {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.pse-control-label {
    flex-shrink: 0;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--c-gray-500);
}

.pse-field-top-label {
    display: none;
}

.pse-type-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex: 1 1 auto;
}

.pse-access-wrap-inline {
    flex: 1 1 220px;
    min-width: 200px;
    max-width: 280px;
}

.pse-summary-icon {
    width: 28px;
    height: 28px;
    border-width: 1px;
}

.pse-type-icon-wrap {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: var(--c-white);
    color: var(--c-black);
    border: 1px solid var(--c-gray-300);
    border-radius: 6px;
}

.pse-type-icon {
    flex-shrink: 0;
    font-size: 0.95rem;
    line-height: 1;
}

.pse-type-select,
.pse-access-select {
    flex: 1;
    min-width: 0;
    font-size: 0.8125rem !important;
    font-weight: 500 !important;
    padding: 6px 1.75rem 6px 10px !important;
    background-color: var(--c-white) !important;
    border: 1px solid var(--c-gray-300) !important;
    border-radius: 6px !important;
    color: var(--c-black) !important;
}

.pse-type-select {
    max-width: 168px;
}

.pse-access-select {
    min-width: 200px;
}

.pse-type-select:focus,
.pse-access-select:focus {
    border-color: var(--c-black) !important;
    box-shadow: none !important;
}

.pse-field-grid {
    display: grid;
    grid-template-columns: minmax(120px, 32%) 1fr;
    gap: 12px;
    align-items: start;
    padding: 12px 14px;
}

.pse-field-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 0;
    padding: 0 14px 14px;
    border-top: none;
}

.pse-field-meta:not(.d-none) {
    margin-top: 0;
    padding-top: 12px;
    border-top: 1px dashed var(--c-gray-200);
}

.pse-field.pse-field-has-error {
    border-color: var(--c-danger) !important;
    box-shadow: 0 0 0 1px rgba(220, 53, 69, 0.35);
}

.pse-field .field-value.is-invalid,
.pse-field .field-label.is-invalid {
    border-color: var(--c-danger) !important;
    background-color: #fff5f5;
}

.pse-field-server-error {
    font-size: 0.8rem;
    color: var(--c-danger);
}

#passport-form .form-control.is-invalid,
#passport-form .form-select.is-invalid {
    border-color: var(--c-danger) !important;
    background-color: #fff5f5;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.12);
}

#passport-form .invalid-feedback {
    color: var(--c-danger);
}

#passport-manufacturer-card.passport-section-error {
    border: 1px solid var(--c-danger) !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.12);
}

.passport-readonly-field-error {
    color: var(--c-danger) !important;
    font-weight: 600;
}

.pse-field-required-lock,
.pse-section-required-lock {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    font-size: 0.95rem;
    opacity: 0.65;
}

#passport-manufacturer-profile-link.text-danger {
    text-decoration: underline !important;
}

#passport-form .form-label.dpp-missing-required,
#passport-form .card-header.text-danger {
    color: var(--c-danger) !important;
}

#passport-form .form-control.dpp-missing-required,
#passport-form .form-select.dpp-missing-required,
#passport-form textarea.dpp-missing-required {
    border-color: var(--c-danger);
    box-shadow: 0 0 0 0.15rem rgba(220, 53, 69, 0.1);
}

#passport-form .pse-field.dpp-missing-required {
    border-color: rgba(220, 53, 69, 0.45);
    box-shadow: 0 0 0 1px rgba(220, 53, 69, 0.12);
}

#passport-form .pse-field-grid.dpp-missing-required {
    background-color: #fff5f5;
    border-radius: 0 0 6px 6px;
}

#passport-form .card.border-dpp-missing {
    border: 1px solid var(--c-danger) !important;
    box-shadow: 0 0 0 0.15rem rgba(220, 53, 69, 0.08);
}

.passport-error-highlight-wrap {
    animation: passport-error-pulse 0.75s ease-in-out 2;
    outline: 2px solid rgba(220, 53, 69, 0.55);
    outline-offset: 3px;
    border-radius: 8px;
}

@keyframes passport-error-pulse {
    0%, 100% {
        outline-color: rgba(220, 53, 69, 0.55);
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.2);
    }
    50% {
        outline-color: rgba(220, 53, 69, 0.95);
        box-shadow: 0 0 0 6px rgba(220, 53, 69, 0.12);
    }
}

.pse-field-del {
    flex-shrink: 0;
    opacity: 1;
    border-color: var(--c-gray-300) !important;
    color: var(--c-gray-700) !important;
    background: transparent !important;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    padding: 5px 8px !important;
    border-radius: 6px !important;
    line-height: 1;
}

.pse-field-del:hover,
.pse-field-del:focus {
    background: var(--c-danger) !important;
    border-color: var(--c-danger) !important;
    color: var(--c-white) !important;
}

.pse-field-del-label {
    margin-left: 4px;
}

/* Etykiety pól w edytorze DPP — stonowane względem globalnego .form-label */
.pse-field .form-label,
.pse-field-meta .form-label {
    font-weight: 500;
    font-size: 0.8rem;
    letter-spacing: 0;
    text-transform: none;
    color: var(--c-gray-600);
    margin-bottom: 5px;
}

.pse-add-field {
    padding: 4px 20px 16px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.pse-add-field .btn {
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-weight: 600;
}

.pse-add-field .btn-passport-save {
    text-transform: none;
    letter-spacing: normal;
    font-weight: 600;
}

.pse-add-section {
    padding: 20px;
    background: var(--c-gray-50);
    border-top: var(--border);
}

.pse-add-section-toggle {
    width: 100%;
    border-style: dashed !important;
    border-color: var(--c-gray-400) !important;
    color: var(--c-gray-800) !important;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 0.8rem;
    padding: 14px !important;
}

.pse-add-section-toggle:hover {
    border-color: var(--c-black) !important;
    background: var(--c-white) !important;
}

.pse-add-section-form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: stretch;
}

.pse-add-section-form .form-control {
    flex: 1;
    min-width: 180px;
}

.pse-empty {
    padding: 48px 24px;
    text-align: center;
    color: var(--c-gray-600);
}

.pse-empty i {
    font-size: 2rem;
    display: block;
    margin-bottom: 12px;
    opacity: 0.35;
}

@media (max-width: 767.98px) {
    .pse-field-grid,
    .pse-field-meta {
        grid-template-columns: 1fr;
    }

    .pse-field-top-controls {
        flex-wrap: wrap;
    }

    .pse-type-wrap,
    .pse-access-wrap-inline {
        flex: 1 1 100%;
        max-width: none;
        min-width: 0;
    }

    .pse-access-select {
        min-width: 0;
    }

    .pse-type-select {
        max-width: none;
    }

    .pse-field-del-label {
        display: none;
    }

    .passport-form-actions {
        flex-wrap: nowrap;
    }

    .passport-form-actions .btn {
        flex: 1 1 0;
        min-width: 0;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
}

/* ── Publiczny widok paszportu (jak qrsystem.pl/app/qr) ───────────────── */
.card-passport {
    margin: 0 auto 2rem;
    background: #fff;
    border: 2px solid #000;
    border-radius: 16px;
    padding: 20px;
    max-width: 750px;
}

.card-passport-title {
    font-weight: 700;
    font-size: 1.125rem;
    letter-spacing: 0.02em;
}

.card-passport-hero {
    text-align: left;
    padding: 0 5px 0 0;
}

.card-passport-hero-name {
    font-size: 1rem;
    font-weight: 700;
    padding-bottom: 0.35rem;
}

.card-passport-hero-media {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
}

.card-passport-hero img.product-photo,
.card-passport-hero-media img.product-photo {
    height: 100px;
    width: auto;
    max-width: 120px;
    object-fit: cover;
    border-radius: 4px;
}

.card-passport-hero img.qr-thumb,
.card-passport-hero-media img.qr-thumb {
    width: 100px;
    height: 100px;
    object-fit: contain;
    flex-shrink: 0;
}

.pvp-lightbox-trigger {
    display: inline-block;
    line-height: 0;
    cursor: zoom-in;
    text-decoration: none;
}

.pvp-lightbox-trigger:hover img {
    opacity: 0.9;
}

.pvp-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1080;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.88);
    box-sizing: border-box;
}

.pvp-lightbox.is-open {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    justify-content: stretch;
    align-items: stretch;
    padding: 0;
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
}

.pvp-lightbox-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-height: 0;
    width: 100%;
    max-width: min(95vw, 920px);
    margin: 0 auto;
    padding:
        calc(2.75rem + env(safe-area-inset-top, 0px))
        calc(0.75rem + env(safe-area-inset-right, 0px))
        calc(0.75rem + env(safe-area-inset-bottom, 0px))
        calc(0.75rem + env(safe-area-inset-left, 0px));
    box-sizing: border-box;
}

.pvp-lightbox.is-open > .pvp-lightbox-inner {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: min(95vw, 920px);
    margin: 0 auto;
    padding:
        calc(2.75rem + env(safe-area-inset-top, 0px))
        calc(0.75rem + env(safe-area-inset-right, 0px))
        calc(0.75rem + env(safe-area-inset-bottom, 0px))
        calc(0.75rem + env(safe-area-inset-left, 0px));
    box-sizing: border-box;
}

.pvp-lightbox-inner {
    margin: 0;
    max-width: 100%;
    width: 100%;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    text-align: center;
}

.pvp-lightbox-inner img {
    display: block;
    flex: 1 1 auto;
    min-height: 0;
    width: auto;
    max-width: 100%;
    max-height: 100%;
    margin: 0 auto;
    object-fit: contain;
    background: #fff;
    border-radius: 8px;
}

.pvp-lightbox-caption {
    flex-shrink: 0;
    margin-top: 0.5rem;
    color: #fff;
    font-size: 0.9rem;
    line-height: 1.35;
}

.pvp-lightbox-close {
    position: absolute;
    top: calc(0.35rem + env(safe-area-inset-top, 0px));
    right: calc(0.5rem + env(safe-area-inset-right, 0px));
    z-index: 2;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 2.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
}

.pvp-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    border: 0;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
}

.pvp-lightbox-nav:hover,
.pvp-lightbox-nav:focus {
    background: rgba(255, 255, 255, 0.22);
    outline: none;
}

.pvp-lightbox-prev {
    left: calc(0.75rem + env(safe-area-inset-left, 0px));
}

.pvp-lightbox-next {
    right: calc(0.75rem + env(safe-area-inset-right, 0px));
}

.pvp-lightbox-counter {
    flex-shrink: 0;
    margin-top: 0.35rem;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.85rem;
}

.pvp-lightbox-thumbs {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: nowrap;
    flex-shrink: 0;
    width: 100%;
    max-width: 100%;
    margin-top: 0.5rem;
    padding: 0.25rem 0 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.pvp-lightbox-thumbs.d-none {
    display: none !important;
}

.pvp-lightbox-thumb {
    flex: 0 0 auto;
    border: 2px solid transparent;
    border-radius: 4px;
    padding: 0;
    background: transparent;
    cursor: pointer;
    opacity: 0.6;
    line-height: 0;
}

.pvp-lightbox-thumb.is-active {
    border-color: #fff;
    opacity: 1;
}

.pvp-lightbox-thumb img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 2px;
    display: block;
}

@media (max-width: 767.98px) {
    .pvp-lightbox-content,
    .pvp-lightbox.is-open > .pvp-lightbox-inner {
        max-width: 100%;
        padding-top: calc(2.25rem + env(safe-area-inset-top, 0px));
        padding-right: calc(0.35rem + env(safe-area-inset-right, 0px));
        padding-bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px));
        padding-left: calc(0.35rem + env(safe-area-inset-left, 0px));
    }

    .pvp-lightbox-close {
        font-size: 2rem;
    }

    .pvp-lightbox-nav {
        font-size: 1.35rem;
        padding: 0.35rem 0.5rem;
    }

    .pvp-lightbox-prev {
        left: calc(0.15rem + env(safe-area-inset-left, 0px));
    }

    .pvp-lightbox-next {
        right: calc(0.15rem + env(safe-area-inset-right, 0px));
    }

    .pvp-lightbox-caption {
        font-size: 0.8rem;
        margin-top: 0.35rem;
    }

    .pvp-lightbox-thumbs {
        margin-top: 0.35rem;
    }

    .pvp-lightbox-thumb img {
        width: 48px;
        height: 48px;
    }
}

.card-passport-section {
    border-bottom: 1px solid #000;
    padding: 1rem 0;
}

.card-passport-section-title {
    font-weight: 700;
    text-align: left;
    margin-bottom: 0.65rem;
}

.card-passport-option {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    text-align: left;
    padding: 0.65rem 0 0.65rem 5px;
    border-bottom: 1px solid #eee;
}

.card-passport-option:last-child {
    border-bottom: none;
}

.card-passport-option > i.bi {
    font-size: 1.25rem;
    line-height: 1.2;
    flex-shrink: 0;
    width: 1.5rem;
    text-align: center;
    margin-top: 0.1rem;
}

.card-passport-option-body {
    flex: 1;
    min-width: 0;
    font-size: 0.95rem;
}

.card-passport-link-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.65rem;
}

.card-passport-link {
    overflow-wrap: anywhere;
    word-break: break-word;
    color: inherit;
}

.card-passport-copy {
    border: 0;
    background: transparent;
    padding: 0;
    color: inherit;
    line-height: 1;
    cursor: pointer;
}

.card-passport-copy i {
    font-size: 1.15rem;
}

.card-passport-copy-msg {
    display: none;
    font-size: 0.75rem;
    color: #155724;
}

.card-passport-copy.is-copied .card-passport-copy-msg {
    display: inline;
}

.card-passport-actions .card-passport-option {
    cursor: pointer;
}

.card-passport-actions a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.card-passport-meta {
    display: block;
    padding-top: 0.75rem;
    font-size: 0.75rem;
    color: #666;
}

@media print {
    .card-passport-actions,
    .card-passport-edit-fab {
        display: none !important;
    }
}

/* =========================================================
   Landing (strona główna)
   ========================================================= */
.landing-hero {
    background: var(--c-white);
}

.py-lg-6 {
    padding-top: 4rem !important;
    padding-bottom: 4rem !important;
}

@media (min-width: 992px) {
    .py-lg-6 {
        padding-top: 5.5rem !important;
        padding-bottom: 5.5rem !important;
    }
}

.landing-eyebrow {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--c-gray-600);
}

.landing-hero-panel {
    background: var(--c-gray-50);
    border-color: var(--c-gray-200) !important;
}

.landing-hero-btns {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
    width: 100%;
    max-width: 33rem;
    margin-inline: auto;
}

.landing-hero-btns .btn {
    width: 100%;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

@media (min-width: 992px) {
    .landing-hero-btns {
        grid-template-columns: repeat(3, minmax(12.5rem, 1fr));
        width: max-content;
        max-width: 100%;
        margin-inline: 0;
    }

    .landing-hero-btns .btn {
        white-space: nowrap;
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }
}

@media (max-width: 575.98px) {
    .landing-hero-btns {
        grid-template-columns: 1fr;
        max-width: 14rem;
    }
}

.landing-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    flex-shrink: 0;
    border: var(--border-dark);
    background: var(--c-white);
    font-size: 1.15rem;
}

.landing-icon-sm {
    width: 2.25rem;
    height: 2.25rem;
    font-size: 1rem;
}

.landing-section {
    scroll-margin-top: 5.5rem;
}

.landing-card {
    border: var(--border);
    padding: 1.5rem;
    background: var(--c-white);
    display: flex;
    flex-direction: column;
}

.landing-card .btn {
    margin-top: auto;
    align-self: flex-start;
}

#dla-kogo .landing-card .landing-icon {
    align-self: center;
}

#dla-kogo .landing-card h3 {
    text-align: center;
}

#dla-kogo .landing-card .btn {
    align-self: center;
}

.landing-card-accent {
    border-color: var(--c-black);
    box-shadow: 4px 4px 0 var(--c-black);
}

.landing-list {
    list-style: none;
    padding-left: 0;
    margin-bottom: 0;
}

.landing-list li {
    position: relative;
    padding-left: 1.25rem;
    margin-bottom: 0.45rem;
}

.landing-list li::before {
    content: "—";
    position: absolute;
    left: 0;
    color: var(--c-gray-600);
}

.landing-feature {
    border-color: var(--c-gray-200) !important;
}

.landing-illustration {
    background: var(--c-gray-50);
    border-color: var(--c-gray-200) !important;
}

.landing-illustration-icon {
    font-size: 3.5rem;
    line-height: 1;
    color: var(--c-black);
}

.landing-step {
    border: var(--border);
    padding: 1.25rem;
    background: var(--c-white);
}

.landing-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: var(--border-dark);
    font-weight: 800;
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

.landing-cta {
    background: var(--c-gray-50);
}

.landing-cta .btn-lg {
    min-width: 9rem;
}

/* =========================================================
   Cennik / pricing
   ========================================================= */
.pricing-page .page-header h1 {
    font-size: clamp(1.5rem, 4vw, 2rem);
}

.pricing-mobile {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.pricing-card {
    position: relative;
    border: var(--border-dark);
    background: var(--c-white);
    overflow: hidden;
}

.pricing-card--featured {
    border-width: 2px;
    box-shadow: 4px 4px 0 var(--c-black);
}

.pricing-card__ribbon {
    background: var(--c-black);
    color: var(--c-white);
    text-align: center;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 0.35rem 0.5rem;
}

.pricing-card__head {
    padding: 1.25rem 1.25rem 1rem;
    border-bottom: var(--border);
    text-align: center;
}

.pricing-card__title {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--c-gray-600);
    margin: 0 0 0.5rem;
}

.pricing-card__devices-num {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.03em;
}

.pricing-card__devices-label {
    font-size: 0.8rem;
    color: var(--c-gray-600);
}

.pricing-card__price {
    margin: 0.75rem 0 1rem;
}

.pricing-card__price-value {
    font-size: 1.25rem;
    font-weight: 700;
}

.pricing-card__price-period {
    font-size: 0.8rem;
    color: var(--c-gray-600);
}

.pricing-card__features {
    padding: 0.5rem 0;
}

.pricing-card__feature {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 1.25rem;
    border-bottom: 1px solid var(--c-gray-200);
    font-size: 0.875rem;
    line-height: 1.35;
}

.pricing-card__feature:last-child {
    border-bottom: none;
}

.pricing-card__feature-label {
    flex: 1;
    color: var(--c-gray-800);
}

.pricing-card__feature-value {
    flex-shrink: 0;
    font-weight: 600;
    min-width: 2rem;
    text-align: right;
}

.pricing-card__feature-value .bi-check-lg {
    color: var(--c-success);
    font-size: 1.1rem;
}

.pricing-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.35rem 0.75rem;
    border: var(--border-dark);
}

.pricing-badge--own {
    background: var(--c-gray-100);
    color: var(--c-gray-600);
}

.pricing-table-shell {
    border: var(--border-dark);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.pricing-table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
    margin: 0;
    font-size: 0.875rem;
}

.pricing-table thead th {
    vertical-align: top;
    background: var(--c-gray-50);
    border-bottom: var(--border-dark);
    padding: 0;
}

.pricing-table__corner {
    width: 220px;
    min-width: 200px;
    padding: 1rem 1.25rem !important;
    text-align: left;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    position: sticky;
    left: 0;
    z-index: 2;
    background: var(--c-gray-50);
    border-right: var(--border);
    vertical-align: bottom;
}

.pricing-table__plan {
    width: 18%;
    min-width: 148px;
    padding: 0 !important;
    text-align: center;
    border-left: 1px solid var(--c-gray-200);
    position: relative;
    vertical-align: bottom;
}

.pricing-table__plan-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 0;
    padding: 1.15rem 0.65rem 1rem;
    min-height: 168px;
}

.pricing-table__plan--featured {
    background: var(--c-white);
    box-shadow: inset 0 2px 0 var(--c-black);
}

.pricing-table__badge {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 1;
    background: var(--c-black);
    color: var(--c-white);
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.2rem 0.4rem;
    line-height: 1;
    margin: 0;
}

.pricing-table__plan-name {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--c-gray-600);
    margin: 0 0 0.5rem;
    line-height: 1.2;
}

.pricing-table__plan-devices {
    line-height: 1.15;
    margin-bottom: 0.5rem;
}

.pricing-table__plan-devices strong {
    display: block;
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--c-black);
}

.pricing-table__plan-devices span {
    display: block;
    font-size: 0.75rem;
    color: var(--c-gray-600);
    margin-top: 0.1rem;
}

.pricing-table__plan-price {
    margin: 0 0 0.75rem;
    line-height: 1.3;
}

.pricing-table__plan-price strong {
    font-size: 1rem;
    font-weight: 700;
    color: var(--c-black);
}

.pricing-table__plan-price span {
    font-size: 0.75rem;
    color: var(--c-gray-600);
}

.pricing-table__plan-cta {
    min-height: 1.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pricing-table__dash {
    color: var(--c-gray-400);
}

.pricing-table tbody th {
    font-weight: 500;
    text-align: left;
    padding: 0.7rem 1.25rem;
    border-bottom: 1px solid var(--c-gray-200);
    background: var(--c-white);
    position: sticky;
    left: 0;
    z-index: 1;
    border-right: var(--border);
}

.pricing-table tbody tr:nth-child(even) th,
.pricing-table tbody tr:nth-child(even) td {
    background: var(--c-gray-50);
}

.pricing-table__cell {
    text-align: center;
    padding: 0.7rem 0.5rem;
    border-bottom: 1px solid var(--c-gray-200);
    border-left: 1px solid var(--c-gray-200);
    vertical-align: middle;
}

.pricing-table__cell--featured {
    background: rgba(10, 10, 10, 0.03);
}

.pricing-table tbody tr:nth-child(even) .pricing-table__cell--featured {
    background: rgba(10, 10, 10, 0.05);
}

.pricing-table__check {
    color: var(--c-success);
    font-size: 1.15rem;
}

.pricing-table__no {
    color: var(--c-gray-400);
}

.pricing-table__history {
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.pricing-table__feature-name {
    font-size: 0.85rem;
    color: var(--c-gray-800);
}

@media (max-width: 991.98px) {
    .pricing-card__cta .btn {
        padding-top: 0.65rem;
        padding-bottom: 0.65rem;
        font-weight: 600;
    }
}

@media (min-width: 992px) and (max-width: 1199.98px) {
    .pricing-table__corner {
        width: 180px;
        min-width: 160px;
        font-size: 0.75rem;
    }
    .pricing-table__plan-devices strong {
        font-size: 1.4rem;
    }
}

/* Profil – sekcja abonamentu */
.profile-page-header {
    gap: 1rem;
}

.profile-subscription {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border: var(--border-dark);
    background: var(--c-gray-50);
    width: 100%;
    max-width: 22rem;
}

.profile-subscription--aside {
    flex-shrink: 0;
}

.profile-subscription__usage {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    font-size: 0.85rem;
    line-height: 1.35;
}

.profile-subscription__usage-count {
    font-weight: 600;
    color: var(--c-gray-900);
}

.profile-subscription__usage-limit,
.profile-subscription__usage-extra {
    font-size: 0.8rem;
}

.profile-subscription__head {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.profile-subscription__plan-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.65rem;
}

.profile-subscription__label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--c-gray-600);
}

.profile-subscription__expires {
    font-size: 0.8rem;
    color: var(--c-gray-600);
}

.profile-subscription__actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    padding-top: 0.15rem;
    width: 100%;
}

.profile-subscription__actions .profile-subscription__btn {
    width: 100%;
    min-width: 0;
    margin: 0;
}

.profile-subscription__actions .profile-subscription__btn .bi {
    flex-shrink: 0;
}

@media (max-width: 575.98px) {
    .profile-subscription {
        max-width: none;
    }
}

/* Plan free — wygaszone urządzenia ponad limit */
.dl-row--plan-limited {
    opacity: 0.5;
}

.dl-row--plan-limited td,
.dl-row--plan-limited .qr-row-body {
    color: var(--c-gray-600);
}

.device-form__limited-fieldset {
    border: 0;
    padding: 0;
    margin: 0;
    min-width: 0;
}

/* ── Zgłoś uwagi (uchwyt na krawędzi + panel) ───────────────────────── */
.feedback-edge-tab {
    position: fixed;
    right: 0;
    top: calc(var(--app-header-height, 56px) + 40px);
    z-index: 1040;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    border-radius: 10px 0 0 10px;
    background: #fff;
    color: #111;
    box-shadow: -2px 0 12px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.06);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.feedback-edge-tab:hover,
.feedback-edge-tab:focus {
    background: #111;
    color: #fff;
    box-shadow: -3px 0 16px rgba(0, 0, 0, 0.14);
    outline: none;
}
.feedback-edge-tab.is-active {
    visibility: hidden;
    pointer-events: none;
}
.feedback-edge-tab__icon {
    font-size: 1.2rem;
    line-height: 1;
}

.feedback-panel {
    position: fixed;
    inset: 0;
    z-index: 1055;
    pointer-events: none;
    visibility: hidden;
}
.feedback-panel.is-open {
    pointer-events: auto;
    visibility: visible;
}
.feedback-panel-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    opacity: 0;
    transition: opacity 0.2s ease;
}
.feedback-panel.is-open .feedback-panel-backdrop {
    opacity: 1;
}
.feedback-panel-sheet {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: min(100%, 400px);
    max-width: 100%;
    background: #fff;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.25s ease;
}
.feedback-panel.is-open .feedback-panel-sheet {
    transform: translateX(0);
}
.feedback-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--c-gray-200, #e5e5e5);
}
.feedback-panel-body {
    padding: 18px;
    overflow-y: auto;
    flex: 1;
}
