/* BMX Inwentaryzacja – neutral gray, enterprise UI */
:root {
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --color-bg: #f5f6f8;
    --color-surface: #ffffff;
    --color-text: #111827;
    --color-text-muted: #6b7280;
    --color-accent: #4b5563;
    --color-accent-hover: #374151;
    --color-border: #e5e7eb;
    --color-input-border: #d1d5db;
    --color-table-header: #f3f4f6;
    --color-nav-bg: #1f2937;
    --color-nav-active: #374151;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --radius: 4px;
    --transition-subtle: 0.12s ease;
    --container: 1200px;
    --safe-area-top: env(safe-area-inset-top, 0px);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
}

/* ---- Layout: header & nav (dark gray) ---- */
.app-header {
    background: var(--color-nav-bg);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    padding-top: var(--safe-area-top);
    z-index: 100;
}

.app-header-inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: nowrap;
}

.app-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.app-logo img {
    height: 44px;
    width: auto;
    object-fit: contain;
    vertical-align: middle;
}

.app-logo:hover img {
    opacity: 0.9;
}

.app-nav {
    display: flex;
    align-items: center;
    gap: 0;
    flex-wrap: wrap;
}

.app-nav a {
    color: #e5e7eb;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    transition: background-color var(--transition-subtle), color var(--transition-subtle);
}

.app-nav a:hover {
    background: var(--color-nav-active);
    color: #fff;
}

.app-nav .nav-user {
    margin-left: 0.5rem;
    padding-left: 0.75rem;
    border-left: 1px solid #4b5563;
    font-size: 0.8125rem;
    color: #9ca3af;
}
.app-nav a.nav-admin-panel {
    font-weight: 600;
    color: #fbbf24;
}
.app-nav a.nav-admin-panel:hover {
    color: #fcd34d;
}

.app-nav .btn {
    background: #4b5563;
    color: #fff;
    border: none;
}
.app-nav .btn:hover {
    background: #374151;
    color: #fff;
}

.app-nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.35rem;
    margin-left: 0.35rem;
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1;
    border-radius: 999px;
    vertical-align: middle;
}
.app-nav-badge--assembly {
    background: #fef9c3;
    color: #a16207;
}

/* ---- Main content ---- */
.app-main {
    flex: 1;
    max-width: var(--container);
    margin: 0 auto;
    width: 100%;
    padding: 1rem;
}

/* ---- Page title (center only) & spacing ---- */
.page-title {
    font-size: 1.375rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--color-text);
    text-align: center;
}

.mb-1 { margin-bottom: 1rem; }
.mt-1 { margin-top: 1rem; }

/* ---- Empty state messages: center ---- */
.empty-state {
    text-align: center;
    color: var(--color-text-muted);
    padding: 1rem 0;
    margin: 0;
}

/* ---- Dashboard intro (center) ---- */
.dashboard-intro {
    text-align: center;
    color: var(--color-text-muted);
    margin: 0 0 1rem;
}

/* ---- Dashboard: alert summary cards ---- */
.dash-alerts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 1rem 0;
    justify-content: center;
}

.dash-alert-card {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    color: var(--color-text);
    font-size: 0.9375rem;
    transition: border-color var(--transition-subtle), background-color var(--transition-subtle);
}

.dash-alert-card:hover {
    border-color: var(--color-input-border);
    background: var(--color-bg);
}

.dash-alert-label {
    font-weight: 500;
}

.badge {
    display: inline-block;
    min-width: 1.5rem;
    padding: 0.125rem 0.375rem;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.25;
    text-align: center;
    background: var(--color-accent);
    color: #fff;
    border-radius: 9999px;
}
.badge.badge--success, .badge-success { background: #0d9488; color: #fff; }
.badge.badge--secondary, .badge-secondary { background: #64748b; color: #fff; }
.badge.badge--primary, .badge-primary { background: var(--color-accent); color: #fff; }

/* ---- Dashboard: module cards grid (landing-style) ---- */
.dash-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin: 1.5rem 0;
}

@media (max-width: 640px) {
    .dash-grid {
        grid-template-columns: 1fr;
    }
}

.dash-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: border-color var(--transition-subtle), background-color var(--transition-subtle);
}

.dash-card:hover {
    border-color: var(--color-input-border);
    background: var(--color-bg);
}

.dash-icon {
    width: 40px;
    height: 40px;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-table-header);
    border-radius: var(--radius);
    color: var(--color-accent);
}

.dash-icon svg {
    flex-shrink: 0;
}

.dash-title {
    font-size: 1.0625rem;
    font-weight: 600;
    margin: 0 0 0.5rem;
    color: var(--color-text);
}

.dash-desc {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    line-height: 1.5;
    margin: 0 0 0.75rem;
}

.dash-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-accent);
    text-decoration: none;
}

.dash-link:hover {
    color: var(--color-accent-hover);
    text-decoration: underline;
}

.dashboard-section-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 1.5rem 0 0.5rem;
    color: var(--color-text);
}

.dash-quick-actions {
    margin-top: 1rem;
}

.dash-quick-actions-top {
    margin-top: 0;
    margin-bottom: 1rem;
}

.dash-quick-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* ---- Cards ---- */
.card {
    background: var(--color-surface);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
}

.card h2,
.card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--color-text);
    text-align: center;
}

.card p {
    font-size: 0.9375rem;
    color: var(--color-text-muted);
    line-height: 1.5;
}

.card-icon {
    width: 40px;
    height: 40px;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-table-header);
    border-radius: var(--radius);
    color: var(--color-accent);
}

/* ---- Buttons ---- */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--color-accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: inherit;
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.btn:hover {
    background: var(--color-accent-hover);
    color: #fff;
}

.btn-primary {
    background: #374151;
    color: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.btn-primary:hover {
    background: #1f2937;
    color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.btn-secondary {
    background: transparent;
    color: #4b5563;
    border: 1.5px solid #d1d5db;
}
.btn-secondary:hover {
    background: var(--color-table-header);
    border-color: #9ca3af;
    color: var(--color-text);
}

.btn-danger {
    background: #b91c1c;
    color: #fff;
    border-radius: 8px;
}
.btn-danger:hover {
    background: #991b1b;
    color: #fff;
}

.btn-outline-danger {
    background: transparent;
    color: #b91c1c;
    border: 2px solid #b91c1c;
    border-radius: 8px;
}
.btn-outline-danger:hover {
    background: #fef2f2;
    color: #991b1b;
    border-color: #991b1b;
}

.btn-outline-secondary {
    background: transparent;
    color: #4b5563;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
}
.btn-outline-secondary:hover {
    background: var(--color-table-header);
    border-color: #9ca3af;
    color: var(--color-text);
}

.btn-sm {
    padding: 0.35rem 0.65rem;
    font-size: 0.8125rem;
    border-radius: 6px;
}
.btn-primary.btn-sm,
.btn-danger.btn-sm { border-radius: 6px; }

/* Touch targets >= 44px (G) */
.btn--touch,
.select--touch,
.input--touch {
    min-height: 44px;
}
.btn--touch {
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.btn-sm.btn--touch {
    min-width: 44px;
    min-height: 44px;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--color-text);
}

/* Scan row: Skanuj button + input (E, G) */
.scan-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem;
}
.scan-row .form-group--flex {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}
.scan-row .form-group--flex .input {
    flex: 1;
    min-width: 140px;
}
.btn-scan {
    background: var(--color-accent);
    color: #fff;
    padding: 0.6rem 1.25rem;
    font-weight: 600;
    white-space: nowrap;
}
.btn-scan:hover {
    background: var(--color-accent-hover);
    color: #fff;
}

/* Sticky scan bar (mobile, 56px) */
.scan-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
}
.scan-bar--sticky {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    height: 56px;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08);
}
.scan-bar--sticky .input {
    flex: 1;
    min-width: 0;
}
.scan-bar--sticky[aria-hidden="true"] {
    display: none;
}
body.has-bottom-scanbar .app-main {
    padding-bottom: 72px;
}

.form-row--wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}
.text-muted {
    color: var(--color-text-muted);
}

.exemplar-list {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0;
    font-size: 0.875rem;
}
.exemplar-list li {
    padding: 0.25rem 0;
    border-bottom: 1px solid var(--color-border);
}
.exemplar-list li:last-child { border-bottom: none; }

/* MM – strona przesunięcia międzymagazynowego */
.mm-page {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 0.5rem;
}
.mm-section {
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
    border-radius: var(--radius);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
}
.mm-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    flex-wrap: wrap;
}
.mm-section-title .mm-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    min-width: 20px;
    max-width: 20px;
    min-height: 20px;
    max-height: 20px;
    color: var(--color-text-muted);
}
.mm-section-title .mm-icon svg {
    width: 20px;
    height: 20px;
    min-width: 20px;
    max-width: 20px;
    min-height: 20px;
    max-height: 20px;
    display: block;
    flex-shrink: 0;
}
.mm-section-title .mm-source-summary-bar {
    margin-left: auto;
}
.mm-arrow-sep {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0;
    color: var(--color-text-muted);
}
.mm-arrow-sep svg,
.mm-arrow-sep > svg {
    flex: 0 0 24px;
}
.mm-arrow-sep svg {
    width: 24px;
    height: 24px;
    min-width: 24px;
    max-width: 24px;
    min-height: 24px;
    max-height: 24px;
    display: block;
    flex-shrink: 0;
}
@media (min-width: 768px) {
    .mm-sections-ab {
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        align-items: start;
        gap: 0.5rem 1rem;
    }
    .mm-arrow-sep { padding: 1.5rem 0 0; }
}
.mm-target-center {
    max-width: 32rem;
    margin-left: auto;
    margin-right: auto;
}
.mm-grid {
    display: grid;
    gap: 0.5rem 1rem;
    grid-template-columns: 1fr;
}
@media (min-width: 600px) {
    .mm-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
    .mm-grid { grid-template-columns: repeat(4, 1fr); }
}
.mm-grid .form-group {
    margin-bottom: 0;
}
.mm-target-rack-slot-wrap {
    display: grid;
    gap: 0.5rem 1rem;
    grid-template-columns: 1fr 1fr;
    grid-column: 1 / -1;
}
@media (min-width: 900px) {
    .mm-target-rack-slot-wrap { grid-column: span 2; }
}
.mm-target-rack-slot-wrap--hidden {
    display: none !important;
}
.mm-target-tiles {
    margin-top: 1.25rem;
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.mm-target-tiles-label {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    margin: 0 0 0.6rem;
}
.mm-target-tiles-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}
.mm-target-tiles-row:empty,
.mm-target-tiles-row[hidden] { display: none; }
.mm-target-tiles-row#mm-target-tiles-main {
    min-height: 2.75rem;
}
.mm-tile {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.75rem;
    min-height: 2.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.9375rem;
    border: 1.5px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface);
    color: var(--color-text);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.mm-tile:hover {
    border-color: var(--color-accent, #2563eb);
    background: rgba(37, 99, 235, 0.06);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
.mm-tile--loc {
    font-weight: 600;
    min-width: 4.5rem;
    padding: 0.6rem 1.25rem;
    font-size: 1rem;
}
.mm-tile--loc:hover {
    border-width: 2px;
}
.mm-tile--rack,
.mm-tile--floor {
    min-width: 3rem;
}
.mm-tile--slot {
    min-width: 2.5rem;
}
.mm-target-add-wrap {
    margin-top: 1rem;
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.mm-target-add-wrap .text-muted { margin: 0; }
.mm-source-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    align-items: flex-start;
}
.mm-source-search {
    flex: 1;
    min-width: 0;
    max-width: 28rem;
}
.mm-source-by-location {
    flex: 1;
    min-width: 18rem;
    max-width: 26rem;
}
.mm-source-by-location-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.75rem;
}
.mm-source-by-location-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    margin-bottom: 0.75rem;
}
.mm-source-by-location-filters .form-group {
    margin-bottom: 0;
}
.mm-source-by-location-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 20rem;
    overflow-y: auto;
}
.mm-source-by-loc-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
}
.mm-source-by-loc-row-name {
    flex: 1;
    min-width: 0;
    font-size: 0.9375rem;
}
.mm-source-by-loc-row-qty {
    flex-shrink: 0;
}
.mm-source-by-loc-qty-select {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
}
.mm-source-by-loc-add {
    flex-shrink: 0;
    margin: 0;
}
.mm-source-summary-bar {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
    padding: 0.5rem 0;
}
.mm-source-summary-bar strong { color: var(--color-text); }
.mm-exemplar-rows {
    list-style: none;
    padding: 0;
    margin: 0;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    max-height: 320px;
    overflow-y: auto;
}
.mm-exemplar-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--color-border);
    min-height: 48px;
}
.mm-exemplar-row:last-child { border-bottom: none; }
.mm-exemplar-add-btn {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
    color: var(--color-accent);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.mm-exemplar-add-btn:hover:not(:disabled) {
    background: var(--color-table-header);
    border-color: var(--color-accent);
}
.mm-exemplar-add-btn:disabled {
    cursor: default;
    color: var(--color-text-muted);
    background: var(--color-table-header);
}
.mm-exemplar-add-btn svg {
    width: 18px;
    height: 18px;
    min-width: 18px;
    max-width: 18px;
    min-height: 18px;
    max-height: 18px;
    display: block;
    flex-shrink: 0;
}
.mm-exemplar-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}
.mm-exemplar-ident {
    font-weight: 600;
    font-size: 0.9375rem;
}
.mm-exemplar-model {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}
.mm-exemplar-badges {
    flex-shrink: 0;
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}
.mm-exemplar-search-wrap {
    margin-bottom: 0.5rem;
}
.mm-exemplar-search-wrap .input { width: 100%; max-width: 280px; }

/* MM: wyszukiwarka modelu (przed wyborem lokalizacji) */
.mm-search-first { margin-bottom: 1rem; }
.mm-model-search-wrap { position: relative; max-width: 360px; }
.mm-model-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 2px;
    max-height: 280px;
    overflow-y: auto;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    z-index: 30;
}
.mm-model-search-item {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    text-align: left;
    border: none;
    background: none;
    font-size: 0.9375rem;
    cursor: pointer;
    color: var(--color-text);
}
.mm-model-search-item:hover { background: var(--color-table-header); }
.mm-model-search-item--empty { color: var(--color-text-muted); cursor: default; }
.mm-search-product-panel { margin-top: 0.75rem; padding: 0.75rem 0; border-top: 1px solid var(--color-border); }
.mm-search-product-name { font-weight: 600; font-size: 1rem; margin: 0 0 0.25rem; }

/* MM: lista modeli z kafelkami binów (A1, B2, C3) – kafelki i wybór ilości */
.mm-product-bins-list { list-style: none; margin: 0; padding: 0; }
.mm-product-bins-row { padding: 0.6rem 0; border-bottom: 1px solid var(--color-border); display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.mm-product-bins-row:last-child { border-bottom: none; }
.mm-product-bins-name { font-weight: 600; font-size: 0.9375rem; min-width: 140px; }
.mm-product-bins-tiles { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: stretch; }
.mm-add-line-form {
  display: inline-flex;
  margin: 0;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
}
.mm-bin-tile {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border: 1.5px solid var(--color-border, #e5e7eb);
  border-radius: 10px;
  background: var(--color-surface, #fff);
  font-size: 0.875rem;
  min-height: 44px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.mm-bin-tile:hover { border-color: var(--color-input-border, #d1d5db); }
.mm-bin-tile-label {
  font-weight: 600;
  min-width: 2.5rem;
  color: var(--color-text);
}
.mm-bin-tile-qty {
  color: var(--color-text-muted);
  font-size: 0.8125rem;
  white-space: nowrap;
}
.mm-bin-tile-qty-select {
  font-size: 0.875rem;
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--color-input-border, #d1d5db);
  background: var(--color-surface);
  min-width: 2.8rem;
  min-height: 36px;
  cursor: pointer;
}
.mm-bin-tile-qty-select:hover { border-color: #9ca3af; }
.mm-bin-tile-qty-select:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px rgba(75, 85, 99, 0.15);
}
.mm-bin-tile-add {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: #059669;
  color: #fff;
  border-radius: 8px;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s ease;
}
.mm-bin-tile-add:hover { background: #047857; }
.mm-bin-tile-add:focus-visible { outline: 2px solid #059669; outline-offset: 2px; }
.mm-page-premium .mm-bin-tile {
    border-radius: 12px;
    padding: 0.55rem 0.85rem;
    min-height: 48px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.mm-page-premium .mm-bin-tile-qty-select {
    min-height: 40px;
    min-width: 3rem;
}
.mm-page-premium .mm-bin-tile-add {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    border-radius: 10px;
}
.mm-cart-item-bin { font-weight: 600; color: var(--color-accent); margin-left: 0.25rem; }

.input--sm { font-size: 0.9375rem; padding: 0.4rem 0.6rem; }
.mm-exemplar-menu-wrap {
    position: relative;
    flex-shrink: 0;
}
.mm-exemplar-menu-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--color-text-muted);
    cursor: pointer;
    border-radius: var(--radius);
    padding: 0;
}
.mm-exemplar-menu-btn:hover {
    background: var(--color-table-header);
    color: var(--color-text);
}
.mm-exemplar-menu-btn svg { display: block; }
.mm-exemplar-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 2px;
    min-width: 160px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    z-index: 20;
    padding: 0.25rem 0;
}
.mm-exemplar-dropdown-item {
    display: block;
    padding: 0.5rem 0.75rem;
    font-size: 0.9375rem;
    color: var(--color-text);
    text-decoration: none;
    white-space: nowrap;
}
.mm-exemplar-dropdown-item:hover {
    background: var(--color-table-header);
}
.mm-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.15rem 0.4rem;
    font-size: 0.6875rem;
    font-weight: 500;
    border-radius: 3px;
    text-transform: uppercase;
}
.mm-badge--jammed {
    background: #fef3c7;
    color: #92400e;
}
.mm-badge--damaged {
    background: #fee2e2;
    color: #991b1b;
}
.mm-badge svg {
    width: 10px;
    height: 10px;
    min-width: 10px;
    max-width: 10px;
    min-height: 10px;
    max-height: 10px;
    display: block;
    flex-shrink: 0;
}

/* Bin transfer (przesunięcie regał–regał) – spójne z MM premium */
.bin-transfer-page.mm-page-premium {
    padding-bottom: 1.5rem;
}
.bin-transfer-page .bin-transfer-sections {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
@media (min-width: 1024px) {
    .bin-transfer-page .bin-transfer-sections {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1rem 1.25rem;
        align-items: start;
    }
    .bin-transfer-page .bin-transfer-scope-card {
        grid-column: 1 / -1;
    }
}
.bin-transfer-hint {
    font-weight: 400;
}
.bin-transfer-card {
    margin-bottom: 0;
}
.bin-transfer-page .mm-workflow-step .mm-step-heading {
    margin-bottom: 0.85rem;
}
.bin-source-bin-step {
    border-left: 3px solid color-mix(in srgb, var(--color-accent) 45%, transparent);
}
.bin-target-bin-step {
    border-left: 3px solid color-mix(in srgb, #059669 40%, transparent);
}
.bin-transfer-scope-card {
    border-left: 3px solid color-mix(in srgb, #d97706 38%, transparent);
}
.bin-transfer-scope-placeholder {
    margin: 0.5rem 0 0;
}
.bin-transfer-card .form-actions {
    margin-top: 0.5rem;
    margin-bottom: 0;
}
.bin-mode-form {
    margin-bottom: 1rem;
}
.bin-mode-fieldset {
    border: none;
    padding: 0;
    margin: 0 0 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    align-items: center;
}
.bin-mode-option {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-right: 0;
    cursor: pointer;
}
.bin-mode-option input { margin: 0; }
.mm-grid .form-group--full {
    grid-column: 1 / -1;
}
.bin-rack-tiles--grid,
.bin-column-tiles--grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    justify-content: flex-start;
    align-items: stretch;
    margin-top: 0.35rem;
    max-width: 100%;
}
.bin-rack-tile.mm-tile {
    flex-direction: column;
    gap: 0.12rem;
    min-width: 3.15rem;
    min-height: 2.85rem;
    padding: 0.4rem 0.55rem;
    font-weight: 700;
    font-size: 0.9375rem;
    line-height: 1.15;
    border-width: 1.5px;
    border-radius: 10px;
}
.bin-rack-tile__letter {
    font-weight: 700;
    font-size: 0.9375rem;
}
.bin-rack-tile__floor {
    font-weight: 400;
    font-size: 0.72rem;
    color: var(--color-text-muted);
    line-height: 1.2;
}
.bin-rack-tile.is-selected.mm-tile {
    border-color: var(--color-accent);
    background: color-mix(in srgb, var(--color-accent) 14%, var(--color-surface));
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--color-accent) 32%, transparent);
}
.bin-column-tile.mm-tile {
    min-width: 2.65rem;
    min-height: 2.65rem;
    font-weight: 700;
    font-size: 0.9375rem;
    border-radius: 10px;
}
.bin-column-tile.is-selected.mm-tile {
    border-color: var(--color-accent);
    background: color-mix(in srgb, var(--color-accent) 14%, var(--color-surface));
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--color-accent) 32%, transparent);
}
.bin-subtitle {
    font-size: 0.9375rem;
    font-weight: 600;
    margin: 0 0 0.5rem;
    color: var(--color-text);
}
.bin-scope-list-wrap,
.bin-exceptions-add-wrap,
.bin-exceptions-list-wrap {
    margin-bottom: 1.25rem;
}
.bin-scope-list-wrap .bin-subtitle,
.bin-exceptions-list-wrap .bin-subtitle {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}
.bin-scope-list,
.bin-exceptions-list {
    list-style: none;
    padding: 0;
    margin: 0;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    max-height: 280px;
    overflow-y: auto;
}
.bin-scope-item,
.bin-exception-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 0.75rem;
    border-bottom: 1px solid var(--color-border);
    flex-wrap: wrap;
}
.bin-scope-item:last-child,
.bin-exception-item:last-child {
    border-bottom: none;
}
.bin-scope-item-info,
.bin-exception-item .mm-exemplar-ident {
    flex: 1;
    min-width: 0;
}
.bin-scope-item-badges,
.bin-exception-item .mm-badge {
    flex-shrink: 0;
}
.bin-btn-add-exception,
.bin-btn-exception {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    padding: 0;
    border: 2px solid var(--color-primary, #2563eb);
    background: var(--color-surface);
    color: var(--color-primary, #2563eb);
    border-radius: var(--radius);
    cursor: pointer;
    flex-shrink: 0;
}
.bin-btn-add-exception:hover,
.bin-btn-exception:hover {
    background: var(--color-primary, #2563eb);
    color: #fff;
}
.bin-btn-add-exception svg,
.bin-btn-exception svg {
    display: block;
    flex-shrink: 0;
}
.bin-in-exception-label {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    min-width: 4.5rem;
}
.bin-scan-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}
.bin-scan-row .input-scan {
    flex: 1;
    min-width: 180px;
}
.bin-remove-exception-form {
    margin-left: auto;
}
.bin-btn-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--color-text-muted);
    border-radius: var(--radius);
    cursor: pointer;
}
.bin-btn-remove:hover {
    color: #b91c1c;
    background: #fef2f2;
}
.bin-btn-remove svg {
    display: block;
}
/* Podsumowanie – osobny box, czytelne (w sekcji premium bez zagnieżdżonej .mm-section) */
.bin-summary-box {
    margin-top: 1.25rem;
    margin-bottom: 1.25rem;
    padding: 1rem 1.25rem;
    background: var(--color-table-header);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    border-left: 4px solid color-mix(in srgb, var(--color-accent) 55%, transparent);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.bin-summary-box-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.75rem;
    color: var(--color-text);
}
.bin-summary-dl {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.5rem 1.5rem;
    margin: 0;
    font-size: 0.9375rem;
}
.bin-summary-dl dt {
    margin: 0;
    font-weight: 600;
    color: var(--color-text-muted);
}
.bin-summary-dl dd {
    margin: 0;
    font-weight: 500;
    color: var(--color-text);
}
.bin-summary-dl .bin-summary-final {
    font-weight: 700;
    color: var(--color-text);
}
.bin-summary-dl .bin-summary-final-value {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--color-primary, #2563eb);
}
.bin-cta-wrap {
    margin: 1rem 0 0;
}
.bin-cta {
    width: 100%;
    max-width: 100%;
}
@media (min-width: 600px) {
    .bin-cta {
        max-width: 320px;
        width: auto;
    }
}

.mm-cart-empty {
    padding: 1rem;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.9375rem;
}
.mm-cart-list {
    list-style: none;
    padding: 0;
    margin: 0 0 0.75rem;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}
.mm-cart-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--color-border);
}
.mm-cart-item:last-child { border-bottom: none; }
.mm-cart-item-ident { font-weight: 600; font-size: 0.875rem; }
.mm-cart-item-model { font-size: 0.75rem; color: var(--color-text-muted); margin-left: 0.25rem; }
.mm-cart-item-badges { flex-shrink: 0; display: flex; gap: 0.2rem; }
.mm-cart-item-remove {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: var(--radius);
    background: transparent;
    color: var(--color-text-muted);
    cursor: pointer;
    margin-left: auto;
}
.mm-cart-item-qty { display: flex; align-items: center; gap: 0.25rem; margin-left: auto; flex-shrink: 0; }
.mm-cart-qty-num { min-width: 1.5rem; text-align: center; font-size: 0.875rem; }
.mm-cart-item-remove:hover { color: #b91c1c; background: #fef2f2; }
.mm-cart-item-remove svg {
    width: 18px;
    height: 18px;
    min-width: 18px;
    max-width: 18px;
    min-height: 18px;
    max-height: 18px;
    display: block;
    flex-shrink: 0;
}

/* PZ: wyszukiwarka z lupka */
.pz-add-section { }
.pz-add-row {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0.5rem;
}
.pz-scan-btn { flex-shrink: 0; min-height: 48px; display: inline-flex; align-items: center; gap: 0.35rem; }
.pz-search-main {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 0.45rem 0.75rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.pz-search-main:focus-within { border-color: var(--color-accent); box-shadow: 0 0 0 3px rgba(75, 85, 99, 0.12); }
.pz-search-icon { display: flex; align-items: center; color: var(--color-text-muted); flex-shrink: 0; }
.pz-search-main:focus-within .pz-search-icon { color: var(--color-accent); }
.pz-search-input { border: none; background: transparent; flex: 1; min-width: 0; padding: 0.35rem 0; font-size: 1rem; }
.pz-search-input:focus { outline: none; }
.pz-search-input::placeholder { color: var(--color-text-muted); opacity: 0.85; }
.pz-add-btn { flex-shrink: 0; min-height: 48px; padding: 0.5rem 1.25rem; font-weight: 600; }
.pz-search-by-model { position: relative; margin-top: 0.5rem; }
.pz-search-results {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    margin-top: 2px;
    max-height: 320px;
    overflow-y: auto;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    z-index: 15;
}
.pz-search-result-item {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    width: 100%;
    padding: 0.6rem 0.85rem;
    text-align: left;
    border: none;
    background: none;
    font-size: 0.9rem;
    color: var(--color-text);
    cursor: pointer;
    border-bottom: 1px solid var(--color-border);
}
.pz-search-result-item:last-child { border-bottom: none; }
.pz-search-result-item:hover { background: var(--color-table-header); }
.pz-search-result-item--empty { color: var(--color-text-muted); cursor: default; }
.pz-search-result-name { font-weight: 600; font-size: 0.9rem; }
.pz-search-result-meta { font-size: 0.8125rem; color: var(--color-text-muted); }
.pz-search-result-variant { font-size: 0.8125rem; }
.pz-search-selected { margin-top: 0.75rem; padding: 0.65rem 0.85rem; background: var(--color-table-header); border: 1px solid var(--color-border); border-radius: 10px; }
.pz-search-selected-label { font-weight: 600; display: block; margin-bottom: 0.4rem; font-size: 0.95rem; }
.pz-search-add-form { }
.pz-search-add-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.pz-qty-stepper { display: inline-flex; align-items: stretch; gap: 0; border: 1px solid var(--color-border); border-radius: 8px; overflow: hidden; background: var(--color-surface); }
.pz-qty-step-btn { min-width: 40px; min-height: 40px; border: none; background: var(--color-table-header); font-size: 1.15rem; line-height: 1; font-weight: 600; color: var(--color-accent); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.pz-qty-step-btn:hover { background: var(--color-border); }
.pz-qty-step-input { width: 3rem; min-height: 40px; text-align: center; font-size: 1rem; font-weight: 600; border: none; border-left: 1px solid var(--color-border); border-right: 1px solid var(--color-border); border-radius: 0; margin: 0; -moz-appearance: textfield; }
.pz-qty-step-input::-webkit-outer-spin-button, .pz-qty-step-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pz-qty-step-val { display: inline-flex; align-items: center; justify-content: center; min-width: 2rem; min-height: 40px; text-align: center; font-size: 1rem; font-weight: 700; border-left: 1px solid var(--color-border); border-right: 1px solid var(--color-border); padding: 0 0.35rem; }
.pz-qty-stepper--cart .pz-qty-step-btn { min-width: 36px; min-height: 36px; font-size: 1rem; text-decoration: none; }

/* PZ: Cel domyslny */
.pz-target-section { }
.pz-location-tiles { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.75rem; }
.pz-location-tile-form { margin: 0; }
.pz-loc-tile {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 5rem; min-height: 44px; padding: 0.5rem 1rem;
    font-weight: 600; font-size: 0.9rem;
    border: 2px solid var(--color-border); border-radius: 10px;
    background: var(--color-surface); color: var(--color-text);
    cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
.pz-loc-tile:hover { border-color: var(--color-accent); background: var(--color-table-header); }
.pz-loc-tile--active { border-color: var(--color-accent); background: var(--color-table-header); box-shadow: 0 0 0 1px var(--color-accent); font-weight: 700; }
.pz-placement-details { margin-top: 0.5rem; }
.pz-placement-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; }
.pz-target-summary { margin-top: 0.5rem; font-size: 0.9rem; padding: 0.4rem 0.65rem; background: var(--color-table-header); border-radius: 8px; display: inline-block; }

/* PZ: Koszyk karty */
.pz-cart-section { }
.pz-cart-counter { font-size: 0.875rem; font-weight: 600; color: var(--color-text-muted); margin-left: auto; }
.pz-cart-list { display: flex; flex-direction: column; gap: 0.5rem; }
.pz-cart-card { border: 1px solid var(--color-border); border-radius: 10px; padding: 0.75rem 1rem; background: var(--color-surface); }
.pz-cart-card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.5rem; }
.pz-cart-card-info { flex: 1; min-width: 0; }
.pz-cart-card-name { font-weight: 600; font-size: 0.95rem; display: block; }
.pz-cart-card-meta { font-size: 0.8125rem; color: var(--color-text-muted); display: block; margin-top: 0.15rem; }
.pz-cart-card-remove { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px; color: var(--color-text-muted); text-decoration: none; flex-shrink: 0; transition: background 0.15s, color 0.15s; }
.pz-cart-card-remove:hover { background: #fef2f2; color: #b91c1c; }
.pz-cart-card-body { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin-top: 0.5rem; }
.pz-cart-card-qty { display: flex; align-items: center; gap: 0.35rem; }
.pz-cart-card-qty-label { font-size: 0.85rem; font-weight: 500; color: var(--color-text-muted); }
.pz-cart-card-loc { display: flex; align-items: center; gap: 0.35rem; }
.pz-cart-card-loc-badge { font-size: 0.85rem; font-weight: 600; padding: 0.25rem 0.5rem; background: var(--color-table-header); border: 1px solid var(--color-border); border-radius: 6px; }
.pz-cart-card-loc-badge--flash { animation: pz-loc-badge-flash 0.55s ease; }
@keyframes pz-loc-badge-flash {
    0% { box-shadow: 0 0 0 0 var(--color-accent, #2563eb); }
    40% { box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.35); }
    100% { box-shadow: 0 0 0 0 transparent; }
}

/* PZ: Wybór wariantu kolorystycznego (wyszukiwarka) */
.pz-variant-picker {
    margin-top: 0.5rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: var(--color-table-header);
}
.pz-variant-picker-label { margin: 0 0 0.5rem 0; font-size: 0.875rem; font-weight: 600; color: var(--color-text-muted); }
.pz-variant-chips { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 0.5rem; }
.pz-variant-chip {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.35rem 0.65rem;
    width: 100%; text-align: left;
    padding: 0.55rem 0.75rem; min-height: 44px;
    border: 2px solid var(--color-border); border-radius: 8px;
    background: var(--color-surface); color: var(--color-text);
    font: inherit; cursor: pointer;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.pz-variant-chip:hover { border-color: var(--color-accent); background: var(--color-table-header); }
.pz-variant-chip--active { border-color: var(--color-accent); background: var(--color-table-header); box-shadow: 0 0 0 1px var(--color-accent); font-weight: 600; }
.pz-variant-chip-title { font-weight: 600; font-size: 0.9rem; }
.pz-variant-chip-meta { font-size: 0.8125rem; }
.pz-variant-picker-cancel { margin-top: 0.25rem; }

/* PZ: Kafelki lokalizacji w koszyku */
.pz-cart-card-loc-panel { padding-top: 0.65rem; margin-top: 0.65rem; border-top: 1px solid var(--color-border); }
.pz-loc-row { margin-bottom: 0.5rem; }
.pz-loc-row-label { display: block; font-size: 0.8125rem; font-weight: 600; color: var(--color-text-muted); margin-bottom: 0.3rem; }
.pz-bin-tiles { display: flex; flex-wrap: wrap; gap: 0.35rem; }
/* Koszyk PZ: nadpisanie flex → siatka (wyższa specyficzność niż .pz-bin-tiles) */
.pz-bin-tiles.pz-cart-rack-grid,
.pz-bin-tiles.pz-cart-slot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(2.75rem, 1fr));
    gap: 0.4rem;
    max-width: 100%;
}
.pz-bin-tiles.pz-cart-rack-grid .pz-bin-tile,
.pz-bin-tiles.pz-cart-slot-grid .pz-bin-tile { min-height: 44px; }
.pz-bin-tile {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 2.5rem; min-height: 40px; padding: 0.3rem 0.6rem;
    text-align: center; font-weight: 600; font-size: 0.85rem;
    border: 2px solid var(--color-border); border-radius: 8px;
    background: var(--color-surface); color: var(--color-text);
    cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
.pz-bin-tile:hover { border-color: var(--color-accent); background: var(--color-table-header); }
.pz-bin-tile--active { border-color: var(--color-accent); background: var(--color-table-header); box-shadow: 0 0 0 1px var(--color-accent); }
.pz-line-loc-save { margin-top: 0.35rem; }

/* PZ: Finalizacja */
.pz-finalize-section { }
.pz-finalize-note { margin-bottom: 0.75rem; }
.pz-finalize-note label { display: block; font-weight: 500; margin-bottom: 0.25rem; font-size: 0.875rem; }
.pz-finalize-summary { margin-bottom: 0.75rem; font-size: 0.95rem; }
.pz-finalize-summary p { margin: 0; }
.pz-finalize-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }

/* ---- PZ premium redesign ---- */
.pz-page-premium { display: flex; flex-direction: column; gap: 0.85rem; }
.pz-header-section {
    border: 1px solid var(--color-border);
    background: linear-gradient(180deg, var(--color-surface) 0%, var(--color-table-header) 100%);
    padding: 0.95rem 1rem;
}
.pz-header-section .page-title { margin: 0; font-size: 1.28rem; letter-spacing: 0.01em; text-align: left; }
.pz-header-main { display: flex; flex-direction: column; gap: 0.35rem; min-width: 0; }
.pz-header-subtitle { margin: 0; color: var(--color-text-muted); font-size: 0.88rem; }
.pz-header-summary { display: flex; flex-wrap: wrap; gap: 0.42rem; margin-top: 0.15rem; }
.pz-header-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.78rem;
    color: var(--color-text-muted);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 999px;
    padding: 0.22rem 0.58rem;
}
.pz-header-chip strong { color: var(--color-text); }
.pz-header-actions { margin-left: auto; align-self: flex-start; }
.pz-header-section { display: flex; gap: 0.8rem; align-items: flex-start; }

.pz-add-section--premium,
.pz-target-section--premium,
.pz-cart-section--premium { border: 1px solid var(--color-border); }

.pz-operational-bar {
    background: linear-gradient(180deg, var(--color-surface), var(--color-table-header));
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 0.4rem;
    gap: 0.45rem;
}
.pz-scan-btn--premium {
    min-height: 50px;
    border-radius: 10px;
    padding: 0.55rem 0.9rem;
    font-weight: 700;
    border: 1px solid color-mix(in srgb, var(--color-accent) 40%, var(--color-border));
    background: var(--color-table-header);
    color: var(--color-text);
}
.pz-scan-btn--premium:hover { border-color: var(--color-accent); color: var(--color-accent); background: var(--color-surface); }
.pz-search-main {
    border-width: 1.5px;
    border-radius: 10px;
    padding: 0.58rem 0.82rem;
    min-height: 50px;
}
.pz-search-main:focus-within { box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-accent) 16%, transparent); }
.pz-search-input { padding: 0.2rem 0; }
.pz-search-input::placeholder { opacity: 0.72; }
.pz-add-btn--premium {
    min-height: 50px;
    border-radius: 10px;
    padding: 0.55rem 1.05rem;
    font-weight: 700;
    border: 1px solid color-mix(in srgb, var(--color-accent) 68%, #000 8%);
    background: linear-gradient(180deg, color-mix(in srgb, var(--color-accent) 90%, #fff 10%), var(--color-accent));
    box-shadow: 0 6px 14px color-mix(in srgb, var(--color-accent) 22%, transparent);
}
.pz-add-btn--premium:hover { transform: translateY(-1px); box-shadow: 0 8px 18px color-mix(in srgb, var(--color-accent) 26%, transparent); }

/* PZ: skanowanie aparatem (modal na stronie PZ) */
.pz-camera-modal { z-index: 1005; }
.pz-camera-modal-content { max-width: min(420px, 100%); width: 100%; }
.pz-camera-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.pz-camera-modal-header h3 {
    margin: 0;
    flex: 1;
    min-width: 0;
    font-size: 1.05rem;
}
.pz-camera-modal-close-x {
    display: none;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin: -0.35rem -0.25rem -0.35rem 0;
    padding: 0;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--color-text);
    cursor: pointer;
}
.pz-camera-modal-close-x:hover {
    background: color-mix(in srgb, var(--color-text) 8%, transparent);
}
.pz-camera-modal-close-x:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}
.pz-camera-video-wrap {
    position: relative;
}
.pz-camera-scan-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
}
.pz-camera-scan-frame {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 82%;
    max-width: 300px;
    height: clamp(72px, 22vw, 112px);
    border: 2px solid rgba(255, 255, 255, 0.92);
    border-radius: 6px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.48);
}
.pz-camera-consent { display: flex; flex-direction: column; gap: 0.65rem; margin-bottom: 0.5rem; }
.pz-camera-consent .btn { width: 100%; }
.pz-camera-modal-close { width: 100%; margin-top: 0.75rem; }
.pz-camera-scan-ui .scanner-modal-video-wrap { margin-bottom: 0; }
.pz-camera-manual-fallback {
    margin-top: 0.65rem;
    padding-top: 0.65rem;
    border-top: 1px solid var(--color-border);
}
.pz-camera-manual-hint { margin-bottom: 0.45rem; font-size: 0.88rem; }
.pz-camera-manual-row { display: flex; flex-wrap: wrap; gap: 0.45rem; align-items: stretch; }
.pz-camera-manual-row .input { flex: 1; min-width: 0; min-height: 44px; }
.pz-camera-manual-row .btn { flex-shrink: 0; min-height: 44px; }

.pz-location-tiles {
    display: inline-flex;
    gap: 0.35rem;
    padding: 0.2rem;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background: var(--color-table-header);
}
.pz-loc-tile {
    min-width: 6.2rem;
    min-height: 42px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--color-text-muted);
    font-weight: 600;
}
.pz-loc-tile--active {
    background: var(--color-surface);
    border-color: var(--color-accent);
    color: var(--color-text);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}
.pz-placement-grid { gap: 0.85rem; }
.pz-target-summary {
    margin-top: 0.65rem;
    font-size: 0.82rem;
    padding: 0.3rem 0.6rem;
    border-radius: 999px;
    border: 1px solid var(--color-border);
    background: color-mix(in srgb, var(--color-table-header) 72%, var(--color-surface));
}

.pz-cart-section .mm-section-title { display: flex; align-items: baseline; gap: 0.55rem; flex-wrap: wrap; }
.pz-cart-counter { font-size: 0.8rem; font-weight: 600; color: var(--color-text-muted); margin-left: auto; }
.pz-cart-list { gap: 0.65rem; }
.pz-cart-card {
    border-radius: 12px;
    padding: 0.78rem 0.95rem;
    background: linear-gradient(180deg, var(--color-surface), color-mix(in srgb, var(--color-table-header) 60%, var(--color-surface)));
}
.pz-cart-card-name { font-size: 0.96rem; font-weight: 700; }
.pz-cart-card-meta { font-size: 0.8rem; }
.pz-cart-card-loc-badge { border-radius: 999px; padding: 0.23rem 0.56rem; }

.pz-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.34rem;
    padding: 1.3rem 0.85rem 1.15rem;
    color: var(--color-text-muted);
}
.pz-empty-icon {
    width: 2.1rem;
    height: 2.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid var(--color-border);
    background: var(--color-table-header);
}
.pz-empty-title { margin: 0; font-size: 0.94rem; font-weight: 600; color: var(--color-text); }
.pz-empty-text { margin: 0; font-size: 0.85rem; }

/* ---- Zadania (premium, spójność z PZ) ---- */
.tasks-page-premium {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}
.tasks-page-premium > .mm-section {
    margin-bottom: 0;
}
.tasks-header-section {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.85rem 1rem;
    border: 1px solid var(--color-border);
    background: linear-gradient(180deg, var(--color-surface) 0%, var(--color-table-header) 100%);
    padding: 0.95rem 1rem;
}
.tasks-header-main {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
    flex: 1;
}
.tasks-page-title {
    margin: 0;
    font-size: 1.28rem;
    letter-spacing: 0.01em;
    text-align: left;
}
.tasks-header-subtitle {
    margin: 0;
    color: var(--color-text-muted);
    font-size: 0.88rem;
}
.tasks-header-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.42rem;
    margin-top: 0.1rem;
}
.tasks-header-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.78rem;
    color: var(--color-text-muted);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 999px;
    padding: 0.22rem 0.58rem;
}
.tasks-header-chip strong {
    color: var(--color-text);
}
.tasks-header-chip--status {
    max-width: 100%;
}
.tasks-header-actions {
    margin-left: auto;
    flex-shrink: 0;
}
.tasks-btn-add-premium {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 50px;
    border-radius: 10px;
    padding: 0.55rem 1.05rem;
    font-weight: 700;
    border: 1px solid color-mix(in srgb, var(--color-accent) 68%, #000 8%);
    background: linear-gradient(180deg, color-mix(in srgb, var(--color-accent) 90%, #fff 10%), var(--color-accent));
    box-shadow: 0 6px 14px color-mix(in srgb, var(--color-accent) 22%, transparent);
    text-decoration: none;
}
.tasks-btn-add-premium:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px color-mix(in srgb, var(--color-accent) 26%, transparent);
    color: #fff;
}
.tasks-btn-add-premium svg {
    flex-shrink: 0;
}

.tasks-filters-section {
    border: 1px solid var(--color-border);
    background: linear-gradient(180deg, var(--color-surface), color-mix(in srgb, var(--color-table-header) 55%, var(--color-surface)));
}
.tasks-filters-heading {
    margin: 0 0 0.65rem;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--color-text);
}
.tasks-filters-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.65rem 1rem;
    align-items: end;
}
.tasks-filter-field--search {
    grid-column: 1 / -1;
}
.tasks-filter-label {
    display: block;
    margin-bottom: 0.32rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--color-text-muted);
}
.tasks-filter-input {
    width: 100%;
    min-height: 44px;
}
.tasks-search-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    min-height: 44px;
    padding: 0.45rem 0.75rem;
    border: 1.5px solid var(--color-border);
    border-radius: 10px;
    background: var(--color-surface);
}
.tasks-search-wrap:focus-within {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-accent) 16%, transparent);
}
.tasks-search-icon {
    display: inline-flex;
    color: var(--color-text-muted);
    flex-shrink: 0;
}
.tasks-search-input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    font: inherit;
    color: var(--color-text);
    padding: 0.15rem 0;
}
.tasks-search-input:focus {
    outline: none;
}
.tasks-search-input::placeholder {
    opacity: 0.72;
}
.tasks-filters-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.75rem;
    padding-top: 0.65rem;
    border-top: 1px solid var(--color-border);
}
.tasks-btn-filter {
    min-height: 44px;
    padding: 0.5rem 1.15rem;
    border-radius: 10px;
    font-weight: 600;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
}
.tasks-btn-filter:hover {
    border-color: color-mix(in srgb, var(--color-text) 22%, var(--color-border));
    background: var(--color-table-header);
}

.tasks-status-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.35rem;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background: var(--color-table-header);
}
.tasks-status-tab {
    padding: 0.48rem 0.85rem;
    border-radius: 10px;
    text-decoration: none;
    color: var(--color-text);
    font-size: 0.88rem;
    font-weight: 500;
    border: 1px solid transparent;
    background: transparent;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.tasks-status-tab:hover {
    background: var(--color-surface);
    border-color: var(--color-border);
}
.tasks-status-tab--active {
    background: var(--color-surface);
    border-color: var(--color-border);
    box-shadow: 0 1px 2px color-mix(in srgb, #000 6%, transparent);
    font-weight: 600;
}

.tasks-list-section {
    padding: 0.65rem 0.85rem 0.85rem;
}
.tasks-feed {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.tasks-feed__head {
    display: grid;
    grid-template-columns: minmax(7rem, 2fr) minmax(5.5rem, 1.1fr) minmax(5.5rem, auto) minmax(4.5rem, 7rem) minmax(4.5rem, 7.5rem) minmax(5.5rem, auto);
    gap: 0.5rem 0.85rem;
    align-items: center;
    padding: 0.35rem 0.5rem 0.55rem;
    margin-bottom: 0.25rem;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    border-bottom: 1px solid var(--color-border);
}
.tasks-item {
    display: grid;
    grid-template-columns: minmax(7rem, 2fr) minmax(5.5rem, 1.1fr) minmax(5.5rem, auto) minmax(4.5rem, 7rem) minmax(4.5rem, 7.5rem) minmax(5.5rem, auto);
    gap: 0.5rem 0.85rem;
    align-items: center;
    padding: 0.72rem 0.5rem;
    border-bottom: 1px solid color-mix(in srgb, var(--color-border) 85%, transparent);
}
.tasks-item:last-child {
    border-bottom: none;
}
.tasks-item__title {
    min-width: 0;
    font-size: 0.96rem;
    font-weight: 600;
    line-height: 1.35;
}
.tasks-item__title a {
    color: var(--color-text);
    text-decoration: none;
}
.tasks-item__title a:hover {
    text-decoration: underline;
    color: var(--color-accent);
}
.tasks-item__person {
    font-size: 0.86rem;
    color: var(--color-text-muted);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tasks-item__meta {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    display: flex;
    flex-direction: column;
    gap: 0.08rem;
}
.tasks-meta-label {
    display: none;
}
.tasks-meta-value {
    color: var(--color-text-muted);
}
.tasks-item__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.65rem;
    justify-content: flex-end;
}
.tasks-action-link {
    font-size: 0.86rem;
    font-weight: 500;
    color: var(--color-accent);
    text-decoration: none;
    padding: 0.25rem 0.15rem;
    border-radius: 6px;
}
.tasks-action-link:hover {
    text-decoration: underline;
}

.task-status-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    border: 1px solid var(--color-border);
    background: var(--color-table-header);
    color: var(--color-text);
    white-space: nowrap;
}
.task-status-badge--todo {
    background: color-mix(in srgb, var(--color-table-header) 70%, var(--color-surface));
    color: var(--color-text-muted);
}
.task-status-badge--doing {
    border-color: color-mix(in srgb, var(--color-accent) 35%, var(--color-border));
    background: color-mix(in srgb, var(--color-accent) 12%, var(--color-surface));
    color: var(--color-text);
}
.task-status-badge--done {
    border-color: color-mix(in srgb, #0d9488 40%, var(--color-border));
    background: color-mix(in srgb, #0d9488 14%, var(--color-surface));
    color: color-mix(in srgb, #0f766e 90%, var(--color-text));
}
.task-status-badge--canceled {
    background: var(--color-table-header);
    color: var(--color-text-muted);
    border-style: dashed;
}

.tasks-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.34rem;
    padding: 1.5rem 0.85rem 1.25rem;
    color: var(--color-text-muted);
}
.tasks-empty-icon {
    width: 2.1rem;
    height: 2.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid var(--color-border);
    background: var(--color-table-header);
    color: var(--color-text-muted);
}
.tasks-empty-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-text);
}
.tasks-empty-text {
    margin: 0;
    font-size: 0.85rem;
    max-width: 22rem;
}
.tasks-pagination-meta {
    margin: 0.65rem 0 0;
    font-size: 0.82rem;
    color: var(--color-text-muted);
}

/* ---- Klienci (premium, spójność z Zadaniami / PZ) ---- */
.clients-page-premium {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}
.clients-page-premium > .mm-section {
    margin-bottom: 0;
}
.clients-header-section {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.85rem 1rem;
    border: 1px solid var(--color-border);
    background: linear-gradient(180deg, var(--color-surface) 0%, var(--color-table-header) 100%);
    padding: 0.95rem 1rem;
}
.clients-header-main {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
    flex: 1;
}
.clients-page-title {
    margin: 0;
    font-size: 1.28rem;
    letter-spacing: 0.01em;
    text-align: left;
}
.clients-header-subtitle {
    margin: 0;
    color: var(--color-text-muted);
    font-size: 0.88rem;
}
.clients-header-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.42rem;
    margin-top: 0.1rem;
}
.clients-header-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.78rem;
    color: var(--color-text-muted);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 999px;
    padding: 0.22rem 0.58rem;
}
.clients-header-chip strong {
    color: var(--color-text);
}
.clients-header-actions {
    margin-left: auto;
    flex-shrink: 0;
}
.clients-btn-add-premium {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 50px;
    border-radius: 10px;
    padding: 0.55rem 1.05rem;
    font-weight: 700;
    border: 1px solid color-mix(in srgb, var(--color-accent) 68%, #000 8%);
    background: linear-gradient(180deg, color-mix(in srgb, var(--color-accent) 90%, #fff 10%), var(--color-accent));
    box-shadow: 0 6px 14px color-mix(in srgb, var(--color-accent) 22%, transparent);
    text-decoration: none;
}
.clients-btn-add-premium:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px color-mix(in srgb, var(--color-accent) 26%, transparent);
    color: #fff;
}
.clients-btn-add-premium svg {
    flex-shrink: 0;
}

.clients-toolbar-slot:not([hidden]) {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
    gap: 0.65rem 1rem;
    align-items: end;
}

.clients-list-section {
    padding: 0.65rem 0.85rem 0.85rem;
}
.clients-feed {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.clients-feed__head {
    display: grid;
    grid-template-columns: minmax(7rem, 1.85fr) minmax(5.5rem, 0.95fr) minmax(6.5rem, 1.15fr) minmax(5.5rem, 1.1fr) minmax(5.5rem, auto) minmax(5.5rem, auto);
    gap: 0.5rem 0.85rem;
    align-items: center;
    padding: 0.35rem 0.5rem 0.55rem;
    margin-bottom: 0.25rem;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    border-bottom: 1px solid var(--color-border);
}
.clients-item {
    display: grid;
    grid-template-columns: minmax(7rem, 1.85fr) minmax(5.5rem, 0.95fr) minmax(6.5rem, 1.15fr) minmax(5.5rem, 1.1fr) minmax(5.5rem, auto) minmax(5.5rem, auto);
    gap: 0.5rem 0.85rem;
    align-items: center;
    padding: 0.72rem 0.5rem;
    border-bottom: 1px solid color-mix(in srgb, var(--color-border) 85%, transparent);
}
.clients-item:last-child {
    border-bottom: none;
}
.clients-item__name {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
}
.clients-item__name-link {
    font-size: 0.96rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--color-text);
    text-decoration: none;
}
.clients-item__name-link:hover {
    color: var(--color-accent);
    text-decoration: underline;
}
.clients-item__alias {
    font-size: 0.78rem;
    color: var(--color-text-muted);
    line-height: 1.3;
    overflow-wrap: anywhere;
}
.clients-item__phone {
    font-size: 0.86rem;
    color: var(--color-text-muted);
    min-width: 0;
    overflow-wrap: anywhere;
}
.clients-placeholder {
    font-size: 0.84rem;
    color: color-mix(in srgb, var(--color-text-muted) 88%, transparent);
    font-style: italic;
}
.clients-item__bike-text,
.clients-item__note-text {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    font-size: 0.84rem;
    color: var(--color-text-muted);
    line-height: 1.35;
    overflow-wrap: anywhere;
}
.clients-item__note .clients-item__note-text {
    color: color-mix(in srgb, var(--color-text-muted) 92%, var(--color-text));
}
.clients-item__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.65rem;
    justify-content: flex-end;
}
.clients-action-link {
    font-size: 0.86rem;
    font-weight: 500;
    color: var(--color-accent);
    text-decoration: none;
    padding: 0.25rem 0.15rem;
    border-radius: 6px;
}
.clients-action-link:hover {
    text-decoration: underline;
}

.clients-due-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    border: 1px solid var(--color-border);
    background: var(--color-table-header);
    color: var(--color-text);
    white-space: nowrap;
}
.clients-due-badge--none {
    background: transparent;
    border-style: dashed;
    border-color: color-mix(in srgb, var(--color-border) 90%, transparent);
    color: var(--color-text-muted);
    font-weight: 500;
}
.clients-due-badge--neutral {
    background: var(--color-table-header);
    color: var(--color-text-muted);
}
.clients-due-badge--soon {
    border-color: color-mix(in srgb, var(--color-accent) 32%, var(--color-border));
    background: color-mix(in srgb, var(--color-accent) 10%, var(--color-surface));
    color: var(--color-text);
}
.clients-due-badge--overdue {
    border-color: color-mix(in srgb, #b45309 45%, var(--color-border));
    background: color-mix(in srgb, #b45309 10%, var(--color-surface));
    color: color-mix(in srgb, #92400e 95%, var(--color-text));
}

.clients-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.34rem;
    padding: 1.5rem 0.85rem 1.25rem;
    color: var(--color-text-muted);
}
.clients-empty-icon {
    width: 2.1rem;
    height: 2.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid var(--color-border);
    background: var(--color-table-header);
    color: var(--color-text-muted);
}
.clients-empty-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-text);
}
.clients-empty-text {
    margin: 0;
    font-size: 0.85rem;
    max-width: 22rem;
}

.clients-pagination {
    margin-top: 0.85rem;
    padding-top: 0.65rem;
    border-top: 1px solid var(--color-border);
}
.clients-pagination-info {
    font-size: 0.82rem;
}
.clients-pagination-list a {
    border-radius: 8px;
    padding: 0.4rem 0.65rem;
    font-size: 0.86rem;
    font-weight: 500;
}

/* Rowery: Na montaż w tabeli */
.bikes-actions-cell { white-space: nowrap; }
.bikes-actions-cell .btn { vertical-align: middle; }
.bikes-assembly-row-trigger { display: inline-flex; align-items: center; margin-left: 0.5rem; vertical-align: middle; }
.bikes-assembly-checkbox-label { display: inline-flex; align-items: center; gap: 0.5rem; cursor: pointer; font-weight: 500; margin: 0.5rem 0 0; }
.bikes-assembly-bins-wrap .label { display: block; margin-bottom: 0.35rem; font-weight: 500; }
.bikes-assembly-bins-msg { font-size: 0.9rem; }
@media (max-width: 768px) {
    .bikes-actions-cell { white-space: normal; }
    .bikes-assembly-row-trigger { margin-left: 0; margin-top: 0.5rem; }
}

/* Rowery + widok produktu: modal kolejki montażu */
#bikes-assembly-modal .bikes-assembly-modal-content,
#product-assembly-queue-modal .bikes-assembly-modal-content {
    max-width: 28rem;
    width: 100%;
    padding: 1.35rem 1.35rem 1.25rem;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}
#bikes-assembly-modal .bikes-assembly-modal-title,
#product-assembly-queue-modal .bikes-assembly-modal-title {
    margin: 0 0 0.25rem 0;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}
#bikes-assembly-modal .bikes-assembly-modal-lead,
#product-assembly-queue-modal .bikes-assembly-modal-lead {
    margin: 0 0 0.85rem 0;
    font-size: 0.9rem;
}
#bikes-assembly-modal .bikes-assembly-product-block,
#product-assembly-queue-modal .bikes-assembly-product-block {
    padding: 0.65rem 0.85rem;
    margin-bottom: 1rem;
    background: var(--color-table-header);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.35;
    word-break: break-word;
}
#bikes-assembly-modal .bikes-assembly-product-block {
    position: relative;
    z-index: 2;
}
#bikes-assembly-modal .bikes-assembly-product-row {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
}
#bikes-assembly-modal .bikes-assembly-product-name {
    flex: 1;
    min-width: 0;
}
#bikes-assembly-modal .bikes-assembly-variant-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 10px;
    background: var(--color-surface, #fff);
    color: var(--color-text-muted, #64748b);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.15s;
}
#bikes-assembly-modal .bikes-assembly-variant-btn:hover {
    background: var(--color-surface, #fff);
    border-color: var(--color-accent, #2563eb);
    color: var(--color-accent, #2563eb);
}
#bikes-assembly-modal .bikes-assembly-variant-btn:focus-visible {
    outline: 2px solid var(--color-accent, #2563eb);
    outline-offset: 2px;
}
#bikes-assembly-modal .bikes-assembly-variant-btn svg {
    transition: transform 0.2s ease;
}
#bikes-assembly-modal .bikes-assembly-variant-btn--open svg {
    transform: rotate(180deg);
}
#bikes-assembly-modal .bikes-assembly-variant-list {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--color-border, #e5e7eb);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    max-height: 14rem;
    overflow-y: auto;
}
#bikes-assembly-modal .bikes-assembly-variant-option {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
    width: 100%;
    text-align: left;
    padding: 0.55rem 0.65rem;
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 8px;
    background: var(--color-surface, #fff);
    font: inherit;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
#bikes-assembly-modal .bikes-assembly-variant-option:hover {
    border-color: var(--color-accent, #2563eb);
    background: rgba(37, 99, 235, 0.04);
}
#bikes-assembly-modal .bikes-assembly-variant-option--current {
    border-color: var(--color-accent, #2563eb);
    box-shadow: 0 0 0 1px var(--color-accent, #2563eb);
}
#bikes-assembly-modal .bikes-assembly-variant-option-title {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--color-text, #111827);
}
#bikes-assembly-modal .bikes-assembly-variant-option-meta {
    font-size: 0.75rem;
    color: var(--color-text-muted, #64748b);
}
@media (max-width: 480px) {
    #bikes-assembly-modal .bikes-assembly-variant-btn {
        width: 44px;
        height: 44px;
    }
    #bikes-assembly-modal .bikes-assembly-variant-option {
        min-height: 48px;
        padding: 0.65rem 0.75rem;
    }
}
#bikes-assembly-modal .bikes-assembly-modal-form,
#product-assembly-queue-modal .bikes-assembly-modal-form {
    display: flex;
    flex-direction: column;
    gap: 0;
}
#bikes-assembly-modal .bikes-assembly-field,
#product-assembly-queue-modal .bikes-assembly-field {
    margin-bottom: 1rem;
}
#bikes-assembly-modal .bikes-assembly-field .label,
#product-assembly-queue-modal .bikes-assembly-field .label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    font-size: 0.875rem;
}
#bikes-assembly-modal .bikes-assembly-modal-qty,
#product-assembly-queue-modal .bikes-assembly-modal-qty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}
#bikes-assembly-modal .bikes-assembly-modal-qty-btn,
#product-assembly-queue-modal .bikes-assembly-modal-qty-btn {
    min-width: 44px;
    min-height: 44px;
    padding: 0 0.65rem;
    font-size: 1.15rem;
    line-height: 1;
    font-weight: 600;
    border-radius: 10px;
}
#bikes-assembly-modal .bikes-assembly-modal-qty-input,
#product-assembly-queue-modal .bikes-assembly-modal-qty-input {
    width: 4rem;
    text-align: center;
    font-size: 1.05rem;
    font-weight: 600;
    padding: 0.5rem 0.35rem;
    border-radius: 10px;
}
#bikes-assembly-modal .bikes-assembly-qty-hint,
#product-assembly-queue-modal .bikes-assembly-qty-hint {
    text-align: center;
    font-size: 0.8125rem;
}
#bikes-assembly-modal .bikes-assembly-target-grid,
#product-assembly-queue-modal .bikes-assembly-target-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
    margin-top: 0.35rem;
}
@media (max-width: 420px) {
    #bikes-assembly-modal .bikes-assembly-target-grid,
    #product-assembly-queue-modal .bikes-assembly-target-grid {
        grid-template-columns: 1fr;
    }
}
#bikes-assembly-modal .bikes-assembly-target-tile,
#product-assembly-queue-modal .bikes-assembly-target-tile {
    display: block;
    margin: 0;
    cursor: pointer;
    position: relative;
}
#bikes-assembly-modal .bikes-assembly-target-tile input,
#product-assembly-queue-modal .bikes-assembly-target-tile input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
    white-space: nowrap;
}
#bikes-assembly-modal .bikes-assembly-target-tile-body,
#product-assembly-queue-modal .bikes-assembly-target-tile-body {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-height: 4.5rem;
    padding: 0.75rem 0.85rem;
    border: 2px solid var(--color-border);
    border-radius: 10px;
    background: var(--color-surface);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
#bikes-assembly-modal .bikes-assembly-target-tile:hover .bikes-assembly-target-tile-body,
#product-assembly-queue-modal .bikes-assembly-target-tile:hover .bikes-assembly-target-tile-body {
    border-color: var(--color-text-muted);
}
#bikes-assembly-modal .bikes-assembly-target-tile:has(input:focus-visible) .bikes-assembly-target-tile-body,
#product-assembly-queue-modal .bikes-assembly-target-tile:has(input:focus-visible) .bikes-assembly-target-tile-body {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}
#bikes-assembly-modal .bikes-assembly-target-tile:has(input:checked) .bikes-assembly-target-tile-body,
#product-assembly-queue-modal .bikes-assembly-target-tile:has(input:checked) .bikes-assembly-target-tile-body {
    border-color: var(--color-accent);
    background: var(--color-table-header);
    box-shadow: 0 0 0 1px var(--color-accent);
}
#bikes-assembly-modal .bikes-assembly-target-tile-title,
#product-assembly-queue-modal .bikes-assembly-target-tile-title {
    font-weight: 700;
    font-size: 0.95rem;
}
#bikes-assembly-modal .bikes-assembly-target-tile-desc,
#product-assembly-queue-modal .bikes-assembly-target-tile-desc {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    line-height: 1.3;
}
#bikes-assembly-modal .bikes-assembly-modal-more,
#product-assembly-queue-modal .bikes-assembly-modal-more {
    margin-bottom: 1rem;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: var(--color-surface);
    overflow: hidden;
}
#bikes-assembly-modal .bikes-assembly-modal-more-summary,
#product-assembly-queue-modal .bikes-assembly-modal-more-summary {
    padding: 0.6rem 0.85rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.875rem;
    list-style: none;
    user-select: none;
}
#bikes-assembly-modal .bikes-assembly-modal-more-summary::-webkit-details-marker,
#product-assembly-queue-modal .bikes-assembly-modal-more-summary::-webkit-details-marker {
    display: none;
}
#bikes-assembly-modal .bikes-assembly-modal-more-summary::after,
#product-assembly-queue-modal .bikes-assembly-modal-more-summary::after {
    content: "";
    float: right;
    width: 0.5rem;
    height: 0.5rem;
    margin-top: 0.35rem;
    border-right: 2px solid var(--color-text-muted);
    border-bottom: 2px solid var(--color-text-muted);
    transform: rotate(45deg);
    transition: transform 0.2s ease;
}
#bikes-assembly-modal .bikes-assembly-modal-more[open] .bikes-assembly-modal-more-summary::after,
#product-assembly-queue-modal .bikes-assembly-modal-more[open] .bikes-assembly-modal-more-summary::after {
    transform: rotate(-135deg);
    margin-top: 0.5rem;
}
#bikes-assembly-modal .bikes-assembly-modal-more-inner,
#product-assembly-queue-modal .bikes-assembly-modal-more-inner {
    padding: 0 0.85rem 0.85rem;
    border-top: 1px solid var(--color-border);
    font-size: 0.9rem;
}
#bikes-assembly-modal .bikes-assembly-modal-more-inner .form-group:first-child,
#product-assembly-queue-modal .bikes-assembly-modal-more-inner .form-group:first-child {
    margin-top: 0.75rem;
}
#bikes-assembly-modal .bikes-assembly-modal-actions,
#product-assembly-queue-modal .bikes-assembly-modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.25rem;
    margin-bottom: 0;
}
#bikes-assembly-modal .bikes-assembly-modal-actions .btn-primary,
#product-assembly-queue-modal .bikes-assembly-modal-actions .btn-primary {
    flex: 1 1 auto;
    min-width: 10rem;
    padding: 0.55rem 1rem;
    font-weight: 600;
}

.mm-actions-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--color-border);
}
.mm-note-inline {
    max-width: 280px;
}
.mm-note-inline .input { padding: 0.4rem 0.5rem; font-size: 0.875rem; }
.mm-toast {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    max-width: 90vw;
    animation: mm-toast-in 0.2s ease;
}
@keyframes mm-toast-in {
    from { opacity: 0; transform: translateX(-50%) translateY(8px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.mm-toast--success { background: #d1fae5; color: #065f46; }
.mm-toast--warning { background: #fef3c7; color: #92400e; }
.mm-toast--error { background: #fee2e2; color: #991b1b; }
.mm-summary-block {
    padding: 0.75rem;
    background: var(--color-table-header);
    border-radius: var(--radius);
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
}
.mm-summary-block p { margin: 0.25rem 0; }
.mm-submit-wrap { margin-top: 0.75rem; }
.mm-submit-wrap .btn { min-height: 44px; padding: 0.5rem 1.25rem; font-weight: 600; }

/* MM – tryb z egzemplarza (Skąd tylko do odczytu, nacisk na Dokąd) */
.mm-source-readonly .mm-source-summary {
    margin: 0 0 0.75rem;
    padding: 0.75rem;
    background: var(--color-table-header);
    border-radius: var(--radius);
    font-size: 0.9375rem;
}
.mm-dokad-prominent .card-title {
    font-size: 1.125rem;
}

/* Table as cards on mobile (G) */
@media (max-width: 767px) {
    .table-wrap--cards-mobile .table thead { display: none; }
    .table-wrap--cards-mobile .table tbody tr {
        display: block;
        border: 1px solid var(--color-border);
        border-radius: var(--radius);
        margin-bottom: 0.5rem;
        padding: 0.75rem;
        background: var(--color-surface);
    }
    .table-wrap--cards-mobile .table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: none;
        padding: 0.25rem 0;
    }
    .table-wrap--cards-mobile .table td::before {
        content: attr(data-label);
        font-weight: 600;
        margin-right: 0.5rem;
        flex-shrink: 0;
    }
    .table-wrap--cards-mobile .table td:last-child { border-bottom: none; }
}
.table-wrap--cards-mobile .table td[data-label] { }
/* Add data-label in view if using cards-mobile; else we use th text via JS or skip */
@media (max-width: 767px) {
    .table-wrap--cards-mobile .table td:nth-child(1)::before { content: 'Produkt'; }
    .table-wrap--cards-mobile .table td:nth-child(2)::before { content: 'SKU'; }
    .table-wrap--cards-mobile .table td:nth-child(3)::before { content: 'Kod'; }
    .table-wrap--cards-mobile .table td:nth-child(4)::before { content: 'Ilość'; }
    .table-wrap--cards-mobile .table td:nth-child(5)::before { content: 'Akcje'; }
    .table-wrap--cards-mobile .table--mm-summary td:nth-child(1)::before { content: 'Identyfikator'; }
    .table-wrap--cards-mobile .table--mm-summary td:nth-child(2)::before { content: 'Produkt'; }
    .table-wrap--cards-mobile .table--mm-summary td:nth-child(3)::before { content: 'Akcje'; }
}

/* ---- Tables (full-width, left-aligned) ---- */
.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

/* Na mobile: przycisk "Zobacz egzemplarze" w pierwszej kolumnie (bez przewijania w prawo) */
.stocks-egzemplarze-mobile { display: none; }
.stocks-egzemplarze-desktop { }
@media (max-width: 767px) {
    .table-wrap--stocks-egzemplarze .stocks-egzemplarze-mobile { display: table-cell; }
    .table-wrap--stocks-egzemplarze .stocks-egzemplarze-desktop { display: none; }
    .table-wrap--stocks-egzemplarze .stocks-egzemplarze-mobile .btn-block-mobile { width: 100%; }
.table-wrap--stocks-egzemplarze tbody tr:hover { background: var(--color-table-header); }
.table-wrap--stocks-egzemplarze thead th { background: var(--color-table-header); font-weight: 600; padding: 0.6rem 0.5rem; border-bottom: 2px solid var(--color-border); }
}

/* Flagi w tabeli Stany: ikonki uszkodzony / zakleszczony (spójne z widokiem egzemplarza) */
.stocks-flagi-th { white-space: nowrap; }
.stocks-flagi-cell { white-space: nowrap; vertical-align: middle; }
.stocks-flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    margin-right: 0.25rem;
}
.stocks-flag:last-child { margin-right: 0; }
.stocks-flag--damaged .stocks-flag-icon--off { color: var(--color-text-muted, #6b7280); }
.stocks-flag--stuck .stocks-flag-icon--off { color: var(--color-text-muted, #6b7280); }
.stocks-flag--stuck.stocks-flag--on { background: #dc2626; color: #fff; box-shadow: 0 1px 3px rgba(220, 38, 38, 0.35); }
.stocks-flag--stuck.stocks-flag--on .stocks-flag-icon { color: #fff; }
.stocks-flag-icon { display: inline-flex; }
.stocks-flag-icon svg { display: block; }

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.table th,
.table td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.table th {
    background: var(--color-table-header);
    font-weight: 600;
    color: var(--color-text);
}

.table tbody tr:hover {
    background: #f9fafb;
    transition: background-color var(--transition-subtle);
}

.table a {
    color: #374151;
    text-decoration: none;
}
.table a:hover {
    text-decoration: underline;
}

/* ---- Forms ---- */
.form-group {
    margin-bottom: 0.75rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--color-text);
    margin-bottom: 0.25rem;
    text-align: left;
}

.input,
.select,
textarea {
    width: 100%;
    max-width: 400px;
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
    font-family: inherit;
    border: 1px solid var(--color-input-border);
    border-radius: var(--radius);
    background: var(--color-surface);
    color: var(--color-text);
    transition: border-color var(--transition-subtle);
}

.input:focus,
.select:focus,
textarea:focus {
    outline: none;
    border-color: #6b7280;
}
.input:focus-visible,
.select:focus-visible,
textarea:focus-visible,
.btn:focus-visible,
a:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

textarea {
    min-height: 80px;
    resize: vertical;
}

.input-scan {
    font-size: 1rem;
    padding: 0.5rem 0.75rem;
    max-width: 100%;
}

.form-hint {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin: 0 0 0.75rem;
}

.form-section-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 1rem 0 0.5rem;
    color: var(--color-text);
}

.form-error {
    display: block;
    font-size: 0.875rem;
    color: #b91c1c;
    margin-top: 0.25rem;
}

/* ---- Breadcrumb ---- */
.breadcrumb {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.breadcrumb a {
    color: var(--color-accent);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb-sep {
    margin: 0 0.35rem;
}

/* ---- Location detail view ---- */
.location-header-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}
.location-header-actions {
    flex-shrink: 0;
}
.location-code-muted {
    font-size: 0.9375rem;
    color: var(--color-text-muted);
    margin: 0 0 1rem;
}

.btn-wz-orange {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 44px;
    padding: 0.5rem 1rem;
    background: #ea580c;
    color: #fff;
    border: none;
    border-radius: var(--radius, 4px);
    font-weight: 500;
    text-decoration: none;
}
.btn-wz-orange:hover {
    background: #c2410c;
    color: #fff;
}
.btn-wz-orange svg {
    flex-shrink: 0;
}

.btn-wz-orange-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 0.5rem;
    background: #ea580c;
    color: #fff;
    border: none;
    border-radius: var(--radius, 4px);
    text-decoration: none;
}
.btn-wz-orange-icon:hover {
    background: #c2410c;
    color: #fff;
}

.btn-mm-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 0.35rem 0.5rem;
    border-radius: var(--radius);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
}
.btn-mm-icon:hover {
    background: var(--color-table-header);
    color: var(--color-text);
}

.location-flag-badge {
    display: inline-block;
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    margin-right: 0.25rem;
    margin-bottom: 0.25rem;
}
.location-flag-badge--jammed {
    background: #fef3c7;
    color: #92400e;
}
.location-flag-badge--damage {
    background: #fee2e2;
    color: #991b1b;
}
.location-flag-badge--missing {
    background: #e5e7eb;
    color: #374151;
}

.location-summary-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
}

.location-summary-card {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    min-width: 140px;
}

.location-summary-label {
    display: block;
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    margin-bottom: 0.25rem;
}

.location-summary-value {
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--color-text);
}

.location-table-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.75rem;
    color: var(--color-text);
}

.location-filters {
    margin-bottom: 1rem;
}

.location-filters .filter-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem;
}

.location-filters .filter-row label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text);
}

/* ---- Account page ---- */
.account-card {
    margin-bottom: 1.5rem;
    max-width: 480px;
}

.account-card-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 1rem;
    color: var(--color-text);
}

/* Avatar – okrągły, stały rozmiar 80×80, object-fit: cover */
.account-avatar-wrap,
.profile-avatar-wrap {
    margin: 0 0 1rem;
}

.account-avatar-wrap,
.profile-avatar-wrap {
    display: inline-block;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.account-avatar,
.profile-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.account-initials,
.profile-avatar-initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--color-table-header);
    color: var(--color-accent);
    font-size: 1.5rem;
    font-weight: 600;
}

/* ---- Alerts / Flash ---- */
.msg,
.alert {
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
}

.msg.success,
.alert-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.msg.error,
.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.msg.info,
.alert-info {
    background: #f0f9ff;
    color: #075985;
    border: 1px solid #bae6fd;
}

/* ---- Landing: hero & features ---- */
.hero {
    padding: 2rem 1rem 3rem;
    text-align: center;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
}

.hero h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

.hero .subtitle {
    font-size: 1rem;
    color: var(--color-text-muted);
    max-width: 560px;
    margin: 0 auto 1rem;
}

.cta {
    display: inline-block;
    background: #374151;
    color: #fff;
    font-weight: 500;
    font-size: 0.9375rem;
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius);
    text-decoration: none;
    transition: background-color var(--transition-subtle);
}

.cta:hover {
    background: #1f2937;
    color: #fff;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

/* ---- Footer (landing) ---- */
.app-footer {
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    padding: 1rem;
    margin-top: auto;
}

.footer-inner {
    max-width: var(--container);
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.footer-copy {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}

.footer-links {
    display: flex;
    gap: 1rem;
}

.footer-links a {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    text-decoration: none;
    transition: color var(--transition-subtle);
}

.footer-links a:hover {
    color: var(--color-accent);
}

/* ---- Mobile ---- */
@media (max-width: 640px) {
    .app-header-inner {
        flex-direction: row;
        align-items: center;
        flex-wrap: nowrap;
    }
    .app-nav {
        justify-content: flex-start;
    }
    .hero {
        padding: 1.5rem 1rem 2rem;
    }
    .footer-inner {
        flex-direction: column;
        text-align: center;
    }
}

/* ---- Nav toggle (JS) ---- */
.nav-toggle {
    display: none;
    color: #fff;
}

@media (max-width: 768px) {
    .nav-toggle {
        display: block;
        background: none;
        border: none;
        padding: 0.5rem;
        cursor: pointer;
        color: #fff;
    }
    .app-nav.collapsed {
        display: none;
    }
    .app-nav:not(.collapsed) {
        display: flex;
    }
}

/* ---- Chat module ---- */
.chat-layout {
    display: flex;
    gap: 1rem;
    min-height: 400px;
    text-align: left;
}
.chat-sidebar {
    width: 300px;
    flex-shrink: 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1rem;
}
.chat-sidebar-section--channels {
    margin-top: 0;
    padding-top: 0;
    margin-bottom: 0.5rem;
}
.chat-sidebar-section--private {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border, #e5e7eb);
    padding-left: 0.25rem;
    border-left: 3px solid var(--color-border, #e5e7eb);
    margin-left: -0.25rem;
    padding-left: 0.5rem;
}
.chat-sidebar h3 {
    margin: 0 0 0.75rem;
    font-size: 0.9375rem;
}
.chat-sidebar p {
    margin: 0.5rem 0;
}
.chat-sidebar a {
    color: var(--color-accent);
    text-decoration: none;
}
.chat-sidebar a:hover {
    text-decoration: underline;
}
.chat-sidebar a.unread {
    font-weight: 600;
}
.chat-sidebar a.active {
    background: var(--color-table-header);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius);
}
/* Kanały systemowe: lista na górze, pogrubione nazwy, czas i badge po prawej */
.chat-channel-list {
    list-style: none;
    margin: 0 0 0.5rem;
    padding: 0;
}
.chat-channel-item {
    margin: 0.25rem 0;
}
.chat-thread-row {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.chat-thread-row .chat-channel-link,
.chat-thread-row > a {
    flex: 1;
    min-width: 0;
}
.chat-thread-menu {
    position: relative;
    flex-shrink: 0;
}
.chat-thread-menu-btn {
    padding: 0.2rem 0.4rem;
    border: none;
    background: transparent;
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    border-radius: var(--radius);
}
.chat-thread-menu-btn:hover {
    color: var(--color-accent);
    background: var(--color-table-header);
}
.chat-thread-menu-dropdown {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 2px;
    min-width: 160px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 100;
    padding: 0.25rem 0;
}
.chat-thread-menu-dropdown a {
    display: block;
    padding: 0.4rem 0.75rem;
    color: var(--color-text);
    text-decoration: none;
    font-size: 0.9rem;
}
.chat-thread-menu-dropdown a:hover {
    background: var(--color-table-header);
}
.chat-channel-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    color: var(--color-accent);
    text-decoration: none;
    padding: 0.35rem 0;
    font-weight: 600;
}
.chat-channel-link:hover {
    text-decoration: underline;
}
.chat-channel-link.unread,
.chat-channel-link.is-unread {
    font-weight: 700;
}
.chat-channel-link.active {
    background: var(--color-table-header);
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    margin-left: -0.5rem;
    margin-right: -0.5rem;
    border-radius: var(--radius);
}
.chat-channel-name {
    font-weight: 600;
    flex: 1;
    min-width: 0;
}
.chat-channel-meta {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}
.chat-channel-time {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    font-weight: 500;
}
.chat-channel-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: #e02424;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    border-radius: 999px;
}
.chat-thread-list a.is-unread .chat-thread-name {
    font-weight: 600;
}
.chat-thread-list .chat-thread-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: #e02424;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    border-radius: 999px;
}
.chat-thread-list {
    list-style: none;
    margin: 0.5rem 0 0;
    padding: 0;
}
.chat-thread-list li {
    margin: 0.25rem 0;
}
.chat-thread-list .badge {
    display: inline-block;
    background: #dc2626;
    color: #fff;
    font-size: 0.7rem;
    padding: 0 0.35rem;
    border-radius: 10px;
    margin-left: 0.25rem;
}

/* Sekcja DM – zwijanie/rozwijanie */
.chat-dm-section {
    margin-top: 0.75rem;
}
.chat-dm-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    min-height: 44px;
    padding: 0.5rem 0.6rem;
    margin: 0 0 0.25rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-table-header, #f1f5f9);
    color: var(--color-text);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
}
.chat-dm-toggle:hover {
    background: var(--color-border);
}
.chat-dm-toggle-chevron {
    flex-shrink: 0;
    font-size: 1rem;
    line-height: 1;
    width: 1.25rem;
    text-align: center;
}
.chat-dm-toggle-count {
    margin-left: auto;
    font-weight: 500;
    color: var(--color-text-muted);
    font-size: 0.875rem;
}
.chat-dm-section--collapsed .chat-thread-list--dm {
    display: none;
}
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    min-width: 0;
}
.chat-placeholder {
    padding: 2rem;
    color: var(--color-text-muted);
}
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    max-height: min(60vh, 500px);
    display: flex;
    flex-direction: column;
    align-items: stretch;
}
.chat-msg {
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}
.chat-msg:last-child {
    border-bottom: none;
}
.chat-msg-content {
    flex: 1;
    min-width: 0;
    text-align: left;
}
.chat-msg-header {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}
.chat-msg-sender {
    font-weight: 600;
    font-size: 0.875rem;
}
.chat-msg-time {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}
.chat-msg-body {
    margin: 0.25rem 0 0;
    font-size: 0.9375rem;
    text-align: left;
}
.chat-msg--own {
    flex-direction: row-reverse;
    margin-left: auto;
    max-width: 85%;
}
.chat-msg--own .chat-msg-content {
    text-align: right;
}
.chat-msg--own .chat-msg-header {
    flex-direction: row-reverse;
}
.chat-send-form {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    border-top: 1px solid var(--color-border);
    background: var(--color-surface, #fff);
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.04);
    position: sticky;
    bottom: 0;
    z-index: 10;
}
.chat-cooldown-hint {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    align-self: center;
}
.chat-send-form input[type="text"] {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--color-input-border);
    border-radius: var(--radius);
}

.chat-avatar-img, .chat-avatar-initials {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-block;
    vertical-align: middle;
}
.chat-avatar-img {
    object-fit: cover;
}
.chat-avatar-initials {
    background: var(--color-accent);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 28px;
    text-align: center;
}

/* Historia dokumentów – kolumna „Utworzył” (avatar + imię i nazwisko) */
.history-created-by {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.history-created-by-avatar {
    flex-shrink: 0;
}
.history-avatar-img,
.history-avatar-initials {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-block;
    vertical-align: middle;
}
.history-avatar-img {
    object-fit: cover;
}
.history-avatar-initials {
    background: var(--color-accent);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 28px;
    text-align: center;
}
.history-created-by-name {
    white-space: nowrap;
}
.history-created-by--with-actions {
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
}
.history-created-by-link {
    margin-left: 0.25rem;
    min-height: 44px;
}

.move-view-doc-card {
    padding: 1.25rem 1.5rem;
}
.move-view-meta {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.25rem 1.5rem;
    align-items: baseline;
}
.move-view-meta dt {
    font-weight: 600;
    color: var(--color-text-muted, #6b7280);
    min-width: 5rem;
}
.move-view-creator {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
}
.move-view-creator-avatar {
    flex-shrink: 0;
}
.move-view-creator-avatar .history-avatar-img,
.move-view-creator-avatar .history-avatar-initials {
    width: 36px;
    height: 36px;
    font-size: 0.8rem;
    line-height: 36px;
}
.move-view-creator-name {
    font-weight: 500;
}
.move-view-user-btn {
    min-height: 44px;
    padding: 0.5rem 1rem;
}

/* Historia dokumentów – filtr „Pokaż unieważnione” (3 stany: tylko ważne → wszystkie → tylko unieważnione) */
.history-filters {
    max-width: 520px;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 1rem 1.5rem;
}
.history-show-cancelled-wrap {
    flex-shrink: 0;
}
.history-show-cancelled {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.5rem 0.4rem 0.25rem;
    border-radius: var(--radius);
    color: var(--color-text, #1a202c);
    text-decoration: none;
    font-size: 0.9375rem;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background-color 0.15s, border-color 0.15s;
}
.history-show-cancelled:hover {
    background: var(--color-table-header, #f8fafc);
    border-color: var(--color-border, #e5e7eb);
}
.history-show-cancelled:focus {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}
.history-show-cancelled-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid var(--color-border, #cbd5e0);
    border-radius: 4px;
    flex-shrink: 0;
    background: var(--color-surface, #fff);
    transition: border-color 0.15s, background 0.15s;
}
.history-show-cancelled:hover .history-show-cancelled-box {
    border-color: var(--color-accent);
}
.history-show-cancelled--all .history-show-cancelled-box,
.history-show-cancelled--cancelled .history-show-cancelled-box {
    border-color: var(--color-accent);
    background: rgba(37, 99, 235, 0.08);
}
.history-show-cancelled-box-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-accent);
}
.history-show-cancelled-box-inner--empty {
    width: 0;
    height: 0;
}
.history-show-cancelled-box-inner--minus {
    color: var(--color-accent);
}
.history-show-cancelled-label {
    font-weight: 500;
}
.history-show-cancelled-state {
    font-size: 0.8125rem;
    color: var(--color-text-muted, #64748b);
}

.chat-thread-avatar-wrap {
    position: relative;
    display: inline-block;
    margin-right: 0.5rem;
    vertical-align: middle;
}
.chat-thread-avatar, .chat-msg-avatar {
    display: inline-block;
    vertical-align: middle;
}
.chat-thread-avatar-wrap .chat-thread-avatar { margin-right: 0; }
.chat-user-status {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid var(--color-surface, #fff);
    box-sizing: border-box;
}
.chat-user-status--online { background: #22c55e; }
.chat-user-status--offline { background: var(--color-text-muted, #94a3b8); }
.chat-msg {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}
.chat-msg-avatar {
    flex-shrink: 0;
}

/* Chat: sidebar search & sections */
.chat-sidebar-search { margin-bottom: 0.75rem; }
.chat-search-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--color-input-border, #ddd);
    border-radius: var(--radius);
    font-size: 0.9375rem;
}
.chat-sidebar-section { margin-top: 1rem; }
.chat-channel-icon {
    display: inline-flex;
    flex-shrink: 0;
    width: 1.125rem;
    height: 1.125rem;
    margin-right: 0.5rem;
    vertical-align: middle;
    color: var(--color-text-muted, #64748b);
}
.chat-channel-link:hover .chat-channel-icon { color: var(--color-accent); }
.chat-sidebar-heading {
    font-size: 0.875rem;
    font-weight: 600;
    margin: 0 0 0.5rem;
    color: var(--color-text-muted, #64748b);
}
.chat-channel-item .chat-thread-preview,
.chat-thread-list .chat-thread-preview {
    font-size: 0.8125rem;
    color: var(--color-text-muted, #64748b);
    margin: 0.125rem 0 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.chat-channel-list--placeholders { opacity: 0.6; }
.chat-channel-item--placeholder .chat-channel-name { font-weight: 500; }
.chat-new-dm-link { display: inline-block; margin-bottom: 0.5rem; }

/* Chat: placeholder main (no thread selected) */
.chat-placeholder-box {
    padding: 2.5rem 1.5rem;
    text-align: center;
    color: var(--color-text-muted, #64748b);
}
.chat-placeholder-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text, #1a202c);
    margin: 0 0 0.5rem;
}
.chat-placeholder-text { margin-bottom: 1rem; }
.section-desc-placeholder { visibility: hidden; display: block; }
.chat-placeholder-block { margin-bottom: 1.25rem; text-align: left; }
.chat-placeholder-block-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text-muted, #64748b);
    margin: 0 0 0.5rem;
}
.chat-placeholder-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.chat-placeholder-list li { margin: 0.25rem 0; }
.chat-placeholder-list a {
    color: var(--color-accent);
    text-decoration: none;
    font-size: 0.9375rem;
}
.chat-placeholder-list a:hover { text-decoration: underline; }
.chat-placeholder-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; margin-top: 1rem; }

/* Chat: thread header (desktop) */
.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-surface);
}
.chat-header-info { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; min-width: 0; }
.chat-header-avatar { flex-shrink: 0; }
.chat-header-avatar .chat-avatar-img,
.chat-header-avatar .chat-avatar-initials { width: 32px; height: 32px; font-size: 0.75rem; line-height: 32px; }
.chat-header-title { margin: 0; font-size: 1rem; font-weight: 600; }
.chat-header-meta, .chat-header-role, .chat-header-last { font-size: 0.8125rem; color: var(--color-text-muted); }
.chat-header-actions { display: flex; gap: 0.35rem; flex-shrink: 0; }

/* Chat: message types */
.chat-msg-type-tag {
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-weight: 600;
}
.chat-msg-type-tag--urgent { background: #fef3c7; color: #92400e; border: 1px solid #f59e0b; }
.chat-msg-type-tag--task { background: #d1fae5; color: #065f46; border: 1px solid #10b981; }
.chat-msg--urgent .chat-msg-body {
  background: #fff7ed;
  border-left: 4px solid #ea580c;
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
  box-shadow: inset 0 0 0 1px rgba(234, 88, 12, 0.12);
}
.chat-msg--task .chat-msg-body { border-left: 3px solid #10b981; padding-left: 0.5rem; }
.chat-msg-body a.chat-body-link { color: var(--color-accent); text-decoration: underline; }
.chat-msg-body a.chat-body-link:focus { outline: 2px solid var(--color-accent); outline-offset: 2px; }

/* Chat: input area with quick actions */
.chat-input { flex-direction: column; align-items: stretch; padding: 0.75rem 1rem 1rem; gap: 0; }
.chat-input-quick {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.5rem;
  margin-bottom: 0.5rem;
}
.chat-input-quick--presets {
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 0.65rem;
}
.chat-quick-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text-muted, #6b7280);
  flex-shrink: 0;
  line-height: 1.25;
  padding: 0.15rem 0;
  margin: 0;
}
.chat-quick-presets-btns {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  flex: 1;
  min-width: 0;
}
.chat-input-quick--tools {
  justify-content: flex-start;
  margin-bottom: 0.75rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--color-border, #e5e7eb);
  gap: 0.4rem;
}
.chat-input-quick--tools .chat-quick-btn {
  background: var(--color-table-header, #f8fafc);
  border-color: var(--color-border, #e5e7eb);
}
.chat-quick-msg {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 500;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: transparent;
    color: var(--color-text);
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}
.chat-quick-msg:hover { background: var(--color-table-header, #f3f4f6); border-color: #9ca3af; }
.chat-quick-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 500;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface);
    color: var(--color-text);
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}
.chat-quick-icon { display: inline-flex; flex-shrink: 0; }
.chat-quick-icon svg { vertical-align: middle; }
.chat-quick-btn:hover { background: var(--color-table-header, #f1f5f9); border-color: #9ca3af; }
.chat-quick-btn.chat-quick-active { background: #fef3c7; border-color: #f59e0b; color: #92400e; }
.chat-quick-btn.chat-quick-active .chat-quick-icon svg { stroke: currentColor; }
.chat-msg-type-tag .chat-msg-type-icon { display: inline-flex; vertical-align: middle; margin-right: 0.2rem; }
.chat-msg-type-tag .chat-msg-type-icon svg { display: block; }
.chat-msg-type-tag--urgent .chat-msg-type-icon svg { stroke: currentColor; }
.chat-msg-type-tag--task .chat-msg-type-icon svg { stroke: currentColor; }
.chat-input-row {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
  width: 100%;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}
.chat-input-textarea {
  flex: 1;
  min-height: 52px;
  max-height: 220px;
  padding: 0.65rem 0.9rem;
  border: 2px solid var(--color-border, #e5e7eb);
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.9375rem;
  line-height: 1.45;
  resize: none;
  background: var(--color-surface, #fff);
  color: var(--color-text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.chat-input-textarea::placeholder {
  color: var(--color-text-muted, #9ca3af);
}
.chat-input-textarea:hover { border-color: var(--color-input-border, #d1d5db); }
.chat-input-textarea:focus {
  outline: none;
  border-color: var(--color-accent, #2563eb);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}
.chat-input-textarea.chat-textarea--urgent-draft {
  background: #fff7ed;
  border-color: #fb923c;
  color: #9a3412;
}
.chat-input-textarea.chat-textarea--urgent-draft:focus {
  border-color: #ea580c;
  box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.22);
}
.chat-send-form .chat-input-row .btn.chat-send-btn {
  flex-shrink: 0;
  align-self: flex-end;
  min-height: 48px;
  height: auto;
  padding: 0.55rem 1rem;
  border-radius: 10px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
.chat-send-btn-icon {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
}
.chat-send-btn-icon svg,
.chat-send-plane-svg {
  display: block;
}
.chat-send-plane-svg {
  stroke: currentColor;
}
.chat-send-btn:disabled .chat-send-plane-svg {
  opacity: 0.65;
}
.chat-input-hint {
  display: block;
  font-size: 0.75rem;
  color: var(--color-text-muted, #6b7280);
  margin-top: 0.35rem;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 520px) {
  .chat-input-quick--presets {
    flex-direction: column;
    align-items: stretch;
  }
  .chat-quick-presets-btns {
    width: 100%;
  }
  .chat-quick-presets-btns .chat-quick-btn {
    flex: 1 1 calc(50% - 0.25rem);
    min-width: 8.5rem;
    justify-content: center;
  }
}

/* Chat: link modal */
.chat-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.chat-modal[hidden] { display: none; }
.chat-modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.4); }
.chat-modal-content {
    position: relative;
    background: var(--color-surface);
    border-radius: var(--radius);
    padding: 1.25rem;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}
.chat-modal-content h3 { margin: 0 0 0.5rem; font-size: 1rem; }
.chat-modal-hint { font-size: 0.875rem; color: var(--color-text-muted); margin-bottom: 0.75rem; }
.chat-modal-content label { display: block; margin-top: 0.5rem; font-weight: 500; }
.chat-modal-input { width: 100%; padding: 0.5rem; margin-top: 0.25rem; }
.chat-modal-actions { margin-top: 1rem; display: flex; gap: 0.5rem; }
.chat-link-search-block { margin-top: 0.75rem; }
.chat-link-search-block:first-of-type { margin-top: 0; }
.chat-link-results {
  list-style: none; margin: 0.25rem 0 0; padding: 0; max-height: 12rem; overflow-y: auto;
  border: 1px solid var(--color-border, #ddd); border-radius: 6px; background: var(--color-bg, #fff);
}
.chat-link-result-item {
  padding: 0.5rem 0.6rem; cursor: pointer; font-size: 0.9rem;
  border-bottom: 1px solid var(--color-border, #eee);
}
.chat-link-result-item:last-child { border-bottom: none; }
.chat-link-result-item:hover,
.chat-link-result-item:focus { background: var(--color-bg-hover, #f0f0f0); outline: none; }

/* Chat: new DM page */
.chat-new-dm-form .form-group { margin-bottom: 1rem; }
.chat-user-search { width: 100%; }
.chat-user-results {
    list-style: none;
    margin: 0.25rem 0 0;
    padding: 0;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    max-height: 220px;
    overflow-y: auto;
    background: var(--color-surface);
}
.chat-user-result-item {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    gap: 0.625rem;
}
.chat-user-result-item:last-child { border-bottom: none; }
.chat-user-result-item:hover { background: var(--color-table-header, #f1f5f9); }
.chat-user-result-avatar {
    flex-shrink: 0;
}
.chat-user-result-avatar .chat-avatar-img,
.chat-user-result-avatar .chat-avatar-initials { width: 26px; height: 26px; font-size: 0.7rem; line-height: 26px; }
.chat-user-result-info { display: flex; flex-direction: column; gap: 0.125rem; min-width: 0; }
.chat-user-result-name { font-weight: 600; }
.chat-user-result-role { font-size: 0.8125rem; color: var(--color-text-muted); }
.chat-user-result-email { font-size: 0.75rem; color: var(--color-text-muted); }
.chat-new-dm-context-card {
    background: var(--color-table-header, #f1f5f9);
    border-radius: var(--radius);
    padding: 1rem;
    border: 1px solid var(--color-border);
}
.chat-new-dm-context-card p { margin-bottom: 0.5rem; }
.chat-new-dm-context-card label { display: block; margin-top: 0.75rem; }
.chat-new-dm-context-card label:first-of-type { margin-top: 0; }
.chat-new-dm-context-card .chat-new-dm-input { margin-top: 0.25rem; }
.chat-new-dm-input {
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
}
.chat-new-dm-input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 2px rgba(var(--color-accent-rgb, 59, 130, 246), 0.2);
}
.chat-new-dm-preview {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--color-table-header, #f1f5f9);
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
}
.chat-new-dm-preview-avatar .chat-avatar-initials,
.chat-new-dm-preview-avatar .chat-avatar-img { width: 36px; height: 36px; line-height: 36px; font-size: 0.875rem; }
.chat-new-dm-preview-avatar .chat-avatar-img { object-fit: cover; }
.chat-new-dm-preview-name { font-weight: 600; }
.chat-new-dm-preview-meta { font-size: 0.8125rem; color: var(--color-text-muted); }
.chat-new-dm-type { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.chat-new-dm-type-segmented {
    display: inline-flex;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--color-surface);
}
.chat-new-dm-type-segmented .chat-type-radio {
    margin: 0;
    font-weight: normal;
    cursor: pointer;
}
.chat-new-dm-type-segmented .chat-type-radio input { position: absolute; opacity: 0; pointer-events: none; }
.chat-new-dm-type-segmented .chat-type-radio { display: block; padding: 0.4rem 0.75rem; border-right: 1px solid var(--color-border); }
.chat-new-dm-type-segmented .chat-type-radio:last-child { border-right: none; }
.chat-new-dm-type-segmented .chat-type-radio:has(input:checked) { background: var(--color-accent); color: #fff; }
.chat-type-radio { font-weight: normal; cursor: pointer; }
.chat-new-dm-textarea {
    width: 100%;
    min-height: 120px;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
}
.chat-new-dm-textarea:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 2px rgba(var(--color-accent-rgb, 59, 130, 246), 0.2);
}

.chat-avatar-img, .chat-avatar-initials {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-block;
    vertical-align: middle;
}
.chat-avatar-img { object-fit: cover; }
.chat-avatar-initials {
    background: var(--color-accent);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 28px;
    text-align: center;
}

/* ---- Avatar crop modal ---- */
.avatar-crop-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.avatar-crop-modal--open {
    display: flex;
}
.avatar-crop-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.6);
}
.avatar-crop-dialog {
    position: relative;
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    padding: 1.5rem;
    max-width: 90vw;
    max-height: 90vh;
    overflow: auto;
}
.avatar-crop-dialog h3 {
    margin: 0 0 0.5rem;
    font-size: 1.125rem;
}
.avatar-crop-hint {
    margin: 0 0 1rem;
    font-size: 0.875rem;
    color: var(--color-text-muted);
}
.avatar-crop-wrap {
    max-width: 400px;
    max-height: 400px;
    margin-bottom: 1rem;
    overflow: hidden;
}
.avatar-crop-wrap img {
    max-width: 100%;
    display: block;
}
.avatar-crop-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

/* Hard to pick (utrudnione wydanie) indicator and modal */
.hard-to-pick-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    margin-left: 0.35rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: #b91c1c;
    border: 1px solid #b91c1c;
    border-radius: 50%;
    cursor: pointer;
    vertical-align: middle;
    transition: background-color var(--transition-subtle), color var(--transition-subtle);
}
.hard-to-pick-indicator:hover {
    background-color: #b91c1c;
    color: #fff;
}
.hard-to-pick-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0.15s, opacity 0.15s;
}
.hard-to-pick-modal.hard-to-pick-modal-visible {
    visibility: visible;
    opacity: 1;
}
.hard-to-pick-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
}
.hard-to-pick-modal-content {
    position: relative;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.25rem;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.hard-to-pick-modal-content h3 {
    margin: 0 0 0.75rem 0;
    font-size: 1.1rem;
}
.hard-to-pick-modal-note {
    margin: 0 0 0.5rem 0;
    white-space: pre-wrap;
    word-break: break-word;
}
.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

/* ---- Egzemplarze w pozycji ---- */
.btn-egzemplarze {
    background: transparent;
    border: none;
    color: var(--color-accent);
    font-size: 0.9rem;
    padding: 0.25rem 0;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.btn-egzemplarze:hover {
    color: var(--color-accent-hover);
}
/* Parametry modelu: grid 2–3 cols desktop, 1 mobile */
.parametry-modelu .parametry-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem 1.5rem;
}
.parametry-modelu .parametr { display: flex; flex-direction: column; gap: 0.15rem; }
.parametry-modelu .parametr-label { font-size: 0.8rem; color: var(--color-text-muted); }
.parametry-modelu .parametr-value { font-weight: 500; }
.parametry-modelu .parametry-empty { font-size: 0.9rem; }
@media (max-width: 600px) {
    .parametry-modelu .parametry-grid { grid-template-columns: 1fr; }
}

/* Dostępne warianty kolorystyczne: mniejsze kafelki, tylko kolor + ilość + Na montaż */
.product-color-variants {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
}
.product-color-variant-card {
    padding: 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
}
.product-color-variant-card .product-color-variant-color {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
    color: var(--color-text);
}
.product-color-variant-card .product-color-variant-color-link {
    color: var(--color-accent, #2563eb);
    text-decoration: none;
}
.product-color-variant-card .product-color-variant-color-link:hover {
    text-decoration: underline;
}
.product-color-variant-card .product-color-variant-qty {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
}
.product-color-variant-card .product-assembly-row-controls {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: wrap;
}
.product-color-variant-card .product-variant-qty-input { width: 3rem; text-align: center; font-size: 0.9rem; padding: 0.25rem; }
.product-color-variant-card .product-variant-assembly-btn {
  flex-shrink: 0;
  background: #c2410c;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 500;
}
.product-color-variant-card .product-variant-assembly-btn:hover { background: #9a3412; color: #fff; }
@media (max-width: 768px) {
    .product-color-variants { grid-template-columns: 1fr; }
    .product-color-variant-card .product-assembly-row-controls .btn { flex: 1; min-width: 0; }
}

/* Zobacz egzemplarze modal: wider desktop, full-screen mobile */
#bin-items-modal .hard-to-pick-modal-content {
    max-width: min(90vw, 1100px);
    width: 100%;
}
#bin-items-modal .hard-to-pick-modal-content .table-wrap {
    max-height: 60vh;
    overflow: auto;
}
@media (max-width: 768px) {
    #bin-items-modal.hard-to-pick-modal { padding: 0; align-items: stretch; }
    #bin-items-modal .hard-to-pick-modal-content {
        max-width: 100%; width: 100%; height: 100%; max-height: 100vh;
        border-radius: 0; display: flex; flex-direction: column;
    }
    #bin-items-modal .hard-to-pick-modal-content .table-wrap {
        max-height: none; flex: 1; overflow: auto;
    }
}

/* Tappable status icons: min 44px hit area */
.flag-badge.flag-tappable {
    min-width: 44px; min-height: 44px;
    cursor: pointer;
}
.flag-badge.flag-tappable:hover { opacity: 1; }
/* Jammed toggle: 44px hit area for mobile, cursor pointer */
.flag-badge.flag-damage-toggle {
    cursor: pointer;
}
.flag-badge.flag-damage-toggle:hover { opacity: 1; }
.flag-badge.flag-damage-no-perm { cursor: default; }
.flag-badge.flag-jammed-toggle {
    min-width: 44px; min-height: 44px;
    cursor: pointer;
    padding: 11px;
    margin: -11px;
}
.flag-badge.flag-jammed-toggle:hover { opacity: 1; }
.flag-badge.flag-jammed-no-perm { cursor: default; }

/* ---- Flagi egzemplarzy (SVG ikony) ---- */
.flag-badge { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.flag-badge svg { display: block; }
.flag-damage { color: #b91c1c; }
.flag-jammed { color: #dc2626; }
.flag-complete { color: #15803d; }

/* Strony z dolnym paskiem „Skanuj” – unikaj zasłaniania przycisków */
.has-bottom-scanbar { padding-bottom: 120px; }

/* ---- Widok egzemplarza v2: layout operacyjny ---- */
.egz-page-v2 .egz-back-link { margin-bottom: 0.75rem; }
.egz-header-v2 { padding: 1.25rem 1rem; text-align: center; }
.egz-title-main { font-size: 1.75rem; font-weight: 700; margin: 0 0 0.25rem; letter-spacing: 0.02em; display: inline-flex; align-items: center; gap: 0.35rem; }
.egz-title-sub { font-size: 1rem; color: var(--color-text-muted); margin: 0 0 0.75rem; }
.egz-copy-btn--title { color: var(--color-text); background: var(--color-table-header); border: 1px solid var(--color-border); }
.egz-copy-btn--title:hover { color: var(--color-accent); border-color: var(--color-accent); }
.egz-header-highlights { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.6rem; margin: 0.5rem 0 0.25rem; }
.egz-highlight-chip { text-align: left; border: 1px solid var(--color-border); border-radius: var(--radius); padding: 0.55rem 0.7rem; background: var(--color-table-header); }
.egz-highlight-label { display: block; font-size: 0.74rem; color: var(--color-text-muted); margin-bottom: 0.15rem; text-transform: uppercase; letter-spacing: 0.03em; }
.egz-highlight-value { font-size: 1rem; font-weight: 700; color: var(--color-text); }
.egz-meta-badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; margin-top: 0.5rem; }
.egz-meta-badge { font-size: 0.8rem; color: var(--color-text-muted); background: var(--color-table-header); padding: 0.25rem 0.5rem; border-radius: var(--radius); }
.egz-assembly-badge-wrap { margin: 0.5rem 0 0; }
.egz-assembly-badge { display: inline-block; font-size: 0.85rem; padding: 0.3rem 0.6rem; border-radius: var(--radius); background: #d1fae5; color: #065f46; text-decoration: none; font-weight: 500; }
.egz-assembly-badge:hover { background: #a7f3d0; color: #064e3b; }
.egz-layout-two-col { display: grid; gap: 1rem; }
@media (min-width: 768px) {
    .egz-layout-two-col { grid-template-columns: 1fr 280px; align-items: start; }
}
.egz-section { margin-bottom: 0; }
.egz-section-title { font-size: 0.95rem; font-weight: 600; margin: 0 0 0.6rem; color: var(--color-text); }
.egz-data-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem 1rem; }
.egz-data-item--full { grid-column: 1 / -1; }
.egz-data-label { display: block; font-size: 0.8rem; color: var(--color-text-muted); margin-bottom: 0.2rem; }
.egz-data-value { font-size: 0.95rem; }
.egz-copy-wrap { display: inline-flex; align-items: center; gap: 0.35rem; }
.egz-copy-btn { display: inline-flex; padding: 0.25rem; background: none; border: none; border-radius: var(--radius); color: var(--color-text-muted); cursor: pointer; }
.egz-copy-btn:hover { background: var(--color-table-header); color: var(--color-accent); }
.egz-params-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem 0.75rem; font-size: 0.9rem; }
.egz-param-label { display: block; color: var(--color-text-muted); font-size: 0.8rem; }
.egz-param-value { font-size: 0.9rem; }
.egz-history-empty { margin: 0; font-size: 0.9rem; }
.egz-history-list { list-style: none; margin: 0; padding: 0; }
.egz-history-item { padding: 0.4rem 0; border-bottom: 1px solid var(--color-border); font-size: 0.9rem; display: flex; justify-content: space-between; gap: 0.5rem; }
.egz-history-item:last-child { border-bottom: none; }
.egz-history-label { font-weight: 500; }
.egz-history-meta { color: var(--color-text-muted); font-size: 0.85rem; flex-shrink: 0; }
.egz-btn-form { display: inline; margin: 0; }
/* Wydaj egzemplarz = zielony; Na montaż = pomarańczowy */
.egz-btn-wz { background: #059669; color: #fff; box-shadow: 0 1px 2px rgba(5, 150, 105, 0.2); }
.egz-btn-wz:hover { background: #047857; color: #fff; }
.egz-btn-assembly { background: #c2410c; color: #fff; box-shadow: 0 1px 2px rgba(194, 65, 12, 0.2); }
.egz-btn-assembly:hover { background: #9a3412; color: #fff; }
.egz-btns-muted .egz-btn-wz { background: #059669; color: #fff; box-shadow: 0 1px 2px rgba(5, 150, 105, 0.2); }
.egz-btns-muted .egz-btn-wz:hover { background: #047857; color: #fff; }

.egz-header-card { }
.egz-header-main { }
.egz-id { font-size: 1.5rem; font-weight: 700; margin: 0 0 0.25rem; letter-spacing: 0.02em; }
.egz-model-name { font-size: 1rem; color: var(--color-text-muted); margin: 0 0 0.75rem; }
.egz-status-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.egz-status-chip { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.45rem 0.85rem; border-radius: 999px; font-size: 0.9rem; font-weight: 500; border: 1.5px solid; min-height: 44px; transition: background 0.15s, color 0.15s, box-shadow 0.15s; }
.egz-status-chip:not(.egz-status-chip-readonly) { cursor: pointer; }
.egz-status-chip.egz-status-chip-readonly { cursor: default; }
.egz-chip-icon { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.egz-chip-label { white-space: nowrap; }
/* Stonowane kolory chipów: Uszkodzony / Zakleszczony mniej wyraziste, minimalistyczny design */
.egz-chips-muted.egz-status-chips .egz-chip-complete { background: #ecfdf5; border-color: #10b981; color: #047857; }
.egz-chips-muted.egz-status-chips .egz-chip-complete.egz-chip-active { background: #059669; border-color: #059669; color: #fff; box-shadow: none; }
.egz-chips-muted.egz-status-chips .egz-chip-damaged { background: #f8fafc; border-color: #e2e8f0; color: #64748b; }
.egz-chips-muted.egz-status-chips .egz-chip-damaged.egz-chip-active { background: #fee2e2; border-color: #fca5a5; color: #b91c1c; box-shadow: none; }
.egz-chips-muted.egz-status-chips .egz-chip-stuck { background: #f8fafc; border-color: #e2e8f0; color: #64748b; }
.egz-chips-muted.egz-status-chips .egz-chip-stuck.egz-chip-active { background: #ffedd5; border-color: #fdba74; color: #c2410c; box-shadow: none; }
.egz-status-chip.egz-chip-complete { background: #ecfdf5; border-color: #10b981; color: #047857; }
.egz-status-chip.egz-chip-damaged { background: #f8fafc; border-color: #e2e8f0; color: #64748b; }
.egz-status-chip.egz-chip-stuck { background: #f8fafc; border-color: #e2e8f0; color: #64748b; }
.egz-status-chip.egz-chip-complete.egz-chip-active { background: #059669; border-color: #059669; color: #fff; box-shadow: 0 1px 2px rgba(5, 150, 105, 0.2); }
.egz-status-chip.egz-chip-complete.egz-chip-active .egz-chip-icon { color: #fff; }
.egz-status-chip.egz-chip-damaged.egz-chip-active { background: #fee2e2; border-color: #fca5a5; color: #b91c1c; box-shadow: 0 1px 2px rgba(248, 113, 113, 0.2); }
.egz-status-chip.egz-chip-damaged.egz-chip-active .egz-chip-icon { color: #b91c1c; }
.egz-status-chip.egz-chip-stuck.egz-chip-active { background: #ffedd5; border-color: #fdba74; color: #c2410c; box-shadow: 0 1px 2px rgba(251, 146, 60, 0.2); }
.egz-status-chip.egz-chip-stuck.egz-chip-active .egz-chip-icon { color: #c2410c; }
.egz-status-chip:not(.egz-status-chip-readonly):hover { opacity: 0.92; }
.egz-status-chip.egz-chip-damaged:not(.egz-chip-active):hover { background: #f1f5f9; border-color: #cbd5e1; }
.egz-status-chip.egz-chip-stuck:not(.egz-chip-active):hover { background: #f1f5f9; border-color: #cbd5e1; }
.egz-actions-warehouse-card { }
.egz-actions-warehouse { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.egz-btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem; padding: 0.85rem 1.25rem; border-radius: var(--radius); font-size: 1rem; font-weight: 600; text-decoration: none; min-height: 48px; transition: opacity 0.15s, box-shadow 0.15s; border: none; }
.egz-btn:hover { opacity: 0.92; }
.egz-btn-icon { display: inline-flex; align-items: center; justify-content: center; }
/* Akcje egzemplarza: statusy + notatka w jednym boxie */
.egz-actions-card .egz-actions-row { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-start; }
.egz-actions-card .egz-status-col { flex: 0 0 auto; }
.egz-actions-card .egz-note-col { flex: 1 1 260px; min-width: 0; }
.egz-location-tile {
    margin-top: 0.8rem;
    width: 100%;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.55rem;
    align-items: center;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: linear-gradient(180deg, var(--color-surface), var(--color-table-header));
    color: var(--color-text);
    padding: 0.65rem 0.75rem;
    text-align: left;
    cursor: pointer;
}
.egz-location-tile:hover { border-color: var(--color-accent); }
.egz-location-icon { color: var(--color-accent); display: inline-flex; }
.egz-location-text { display: inline-flex; flex-direction: column; min-width: 0; }
.egz-location-text > span { color: var(--color-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 0.85rem; }
.egz-location-action { font-size: 0.8rem; color: var(--color-accent); font-weight: 600; }
.egz-note-label { display: block; font-size: 0.9rem; font-weight: 500; margin: 0 0 0.35rem; }
.egz-note-optional { font-weight: 400; color: var(--color-text-muted); font-size: 0.85rem; }
.egz-note-textarea { width: 100%; min-height: 4rem; resize: vertical; }
.egz-note-actions { margin: 0.5rem 0 0; }
.egz-note-form-wrap { margin-top: 0.5rem; }
.egz-note-save-row { margin-top: 0.75rem; }
.egz-btn-note-save {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    padding: 0.65rem 1.1rem; min-height: 44px;
    background: var(--color-primary, #2563eb); color: #fff;
    border: none; border-radius: var(--radius); font-size: 0.95rem; font-weight: 600;
    cursor: pointer; transition: opacity 0.15s, box-shadow 0.15s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}
.egz-btn-note-save:hover { opacity: 0.92; box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25); }
@media (max-width: 640px) {
    .egz-actions-card .egz-actions-row { flex-direction: column; }
    .egz-actions-card .egz-status-col { width: 100%; }
    .egz-actions-card .egz-note-col { width: 100%; }
    .egz-actions-card .egz-note-textarea { min-height: 5rem; }
    .egz-actions-card .egz-note-col .btn { width: 100%; min-height: 48px; }
    .egz-btn-note-save { width: 100%; }
}
.egz-parametry-section { }
.egz-parametry-section .parametry-grid { font-size: 0.9rem; }
.egz-parametry-section .parametr-label { color: var(--color-text-muted); }
/* Toast */
.egz-toast { position: fixed; top: 1rem; left: 50%; transform: translateX(-50%) translateY(-8px); background: #1f2937; color: #fff; padding: 0.5rem 1rem; border-radius: 8px; font-size: 0.9rem; box-shadow: 0 4px 12px rgba(0,0,0,0.2); z-index: 1100; opacity: 0; visibility: hidden; transition: opacity 0.2s, transform 0.2s, visibility 0.2s; }
.egz-toast.egz-toast-visible { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.egz-toast-error { background: #b91c1c; }
.egz-toast.egz-toast-error-visible { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
@media (max-width: 640px) {
    .egz-actions-warehouse { flex-direction: column; }
    .egz-actions-warehouse .egz-btn { width: 100%; }
    .egz-btn-form { display: block; }
    .egz-btn-form .egz-btn { width: 100%; }
    .egz-id { font-size: 1.35rem; }
    .egz-data-grid { grid-template-columns: 1fr; }
    .egz-params-grid { grid-template-columns: 1fr; }
    .egz-header-highlights { grid-template-columns: 1fr; }
    .egz-modal-backdrop { padding: 0.6rem; }
    .egz-modal-shell { max-height: 94vh; }
    .egz-modal-body iframe { min-height: 60vh; }
    .egz-modal-footer { flex-direction: column-reverse; }
    .egz-modal-footer .btn { width: 100%; }
}
.egz-note-box { background: var(--color-table-header); padding: 0.75rem 1rem; border-radius: var(--radius); margin: 0.5rem 0; }
.egz-note-author { display: flex; align-items: center; gap: 0.5rem; margin: 0.35rem 0 0; font-size: 0.85rem; color: var(--color-text-muted); }
.egz-note-author-avatar { flex-shrink: 0; }
.egz-note-author-img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.egz-note-author-initials { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: var(--color-accent); color: #fff; font-size: 0.7rem; font-weight: 600; }
.egz-note-author-name { font-weight: 500; color: var(--color-text); }
.egz-modal-bottom-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000; background: var(--color-surface); border-radius: 12px 12px 0 0; box-shadow: 0 -4px 20px rgba(0,0,0,0.15); padding: 1.25rem; max-height: 80vh; overflow-y: auto; transform: translateY(100%); visibility: hidden; opacity: 0; pointer-events: none; transition: transform 0.2s, opacity 0.2s, visibility 0.2s; }
.egz-modal-bottom-sheet.egz-modal-open { transform: translateY(0); visibility: visible; opacity: 1; pointer-events: auto; }
.egz-modal-backdrop { position: fixed; inset: 0; background: rgba(2, 8, 23, 0.45); z-index: 999; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 0.2s, visibility 0.2s; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.egz-modal-backdrop.egz-modal-open { opacity: 1; visibility: visible; pointer-events: auto; }
.egz-modal-shell { width: min(1100px, 98vw); max-height: 88vh; background: var(--color-surface); border-radius: 12px; border: 1px solid var(--color-border); box-shadow: 0 16px 44px rgba(2, 8, 23, 0.28); transform: translateY(8px); transition: transform 0.2s ease; display: flex; flex-direction: column; overflow: hidden; }
.egz-modal-open .egz-modal-shell { transform: translateY(0); }
.egz-modal-header { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; padding: 0.85rem 1rem; border-bottom: 1px solid var(--color-border); }
.egz-modal-header h3 { margin: 0; font-size: 1rem; }
.egz-modal-subtitle { margin: 0; padding: 0.7rem 1rem 0.6rem; color: var(--color-text-muted); font-size: 0.9rem; }
.egz-modal-close { border: 1px solid var(--color-border); background: var(--color-table-header); width: 32px; height: 32px; border-radius: 8px; font-size: 1.3rem; line-height: 1; cursor: pointer; color: var(--color-text); }
.egz-modal-close:hover { border-color: var(--color-accent); color: var(--color-accent); }
.egz-modal-body { padding: 0 1rem 0.9rem; }
.egz-modal-body iframe { width: 100%; min-height: 62vh; border: 1px solid var(--color-border); border-radius: 10px; background: #fff; }
.egz-modal-footer { display: flex; justify-content: flex-end; gap: 0.6rem; padding: 0.8rem 1rem 1rem; border-top: 1px solid var(--color-border); }
@media (min-width: 641px) {
    .egz-modal-bottom-sheet { left: 50%; right: auto; bottom: auto; top: 50%; transform: translate(-50%, -50%) translateY(20px); max-height: 70vh; width: 400px; border-radius: 12px; }
    .egz-modal-bottom-sheet.egz-modal-open { transform: translate(-50%, -50%) translateY(0); }
}

/* ---- Skaner magazynowy ---- */
.scanner-warehouse { max-width: 520px; margin: 0 auto; padding: 0 1rem 2rem; }
.scanner-header { margin-bottom: 1rem; }
.scanner-hint { font-size: 0.9rem; color: var(--color-text-muted); margin: 0.25rem 0 0; }
.scanner-card .scanner-controls { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1rem; }
.scanner-btn { min-height: 44px; padding: 0.6rem 1rem; font-size: 1rem; }
.scanner-btn--primary { flex: 1; min-width: 160px; }
.scanner-loading { margin: 0.5rem 0; color: var(--color-text-muted); }
.scanner-result-title { margin: 0 0 0.75rem; font-size: 1.1rem; }
.scanner-bike-card { background: var(--color-table-header); padding: 0.75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; }
.scanner-bike-card p { margin: 0.25rem 0; font-size: 0.95rem; }
.scanner-assign { margin-top: 1rem; }
.scanner-assign h4 { margin: 0 0 0.5rem; font-size: 1rem; }
.scanner-assign .form-group { margin-bottom: 0.75rem; }
.scanner-assign .scanner-btn { margin-right: 0.5rem; margin-top: 0.25rem; }
.scanner-notfound-barcode { margin: 0.5rem 0; font-size: 0.9rem; color: var(--color-text-muted); }
.scanner-empty-text { color: var(--color-text-muted); text-align: center; padding: 1.5rem; margin: 0; }
.scanner-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 1rem; visibility: hidden; }
.scanner-modal.scanner-modal-visible { visibility: visible; }
.scanner-modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.7); }
.scanner-modal-content { position: relative; background: var(--color-surface); border-radius: 8px; padding: 1.25rem; max-width: 100%; width: 360px; box-shadow: 0 4px 20px rgba(0,0,0,0.2); }
.scanner-modal-content h3 { margin: 0 0 0.5rem; }
.scanner-modal-hint { font-size: 0.9rem; color: var(--color-text-muted); margin: 0 0 0.75rem; }
.scanner-modal-video-wrap { width: 100%; aspect-ratio: 1; background: #000; border-radius: var(--radius); overflow: hidden; margin-bottom: 1rem; }
.scanner-modal-video-wrap video { width: 100%; height: 100%; object-fit: cover; }
.scanner-modal-content .btn { width: 100%; }
.scanner-modal-content--safe {
    width: min(100vw - 2rem, 400px);
    max-height: min(92vh, 640px);
    margin-bottom: max(0.5rem, env(safe-area-inset-bottom, 0px));
    margin-top: max(0.5rem, env(safe-area-inset-top, 0px));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.scanner-page-premium {
    max-width: 640px;
    margin: 0 auto;
    padding: 0 1rem calc(2rem + env(safe-area-inset-bottom, 0px));
    padding-left: max(1rem, env(safe-area-inset-left, 0px));
    padding-right: max(1rem, env(safe-area-inset-right, 0px));
}
.scanner-premium-header { margin-bottom: 1.25rem; }
.scanner-premium-header .page-title { margin-bottom: 0.35rem; }
.scanner-premium-desc { font-size: 0.9rem; color: var(--color-text-muted); margin: 0 0 0.75rem; line-height: 1.45; }
.scanner-back-link { display: inline-block; font-size: 0.875rem; color: var(--color-text-muted); text-decoration: none; margin-bottom: 0.5rem; }
.scanner-back-link:hover { text-decoration: underline; }
.scanner-section { margin-bottom: 1rem; }
.scanner-section-title { font-size: 1rem; margin: 0 0 0.75rem; }
.scanner-result-primary { font-size: 1.15rem; font-weight: 600; margin: 0 0 0.5rem; }
.scanner-status-block { margin: 0.75rem 0; }
.scanner-actions-block { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--color-border); }
.scanner-muted { color: var(--color-text-muted); font-size: 0.9rem; }
.scanner-quick-toggle { display: flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; color: var(--color-text-muted); cursor: pointer; }
.scanner-quick-toggle input { width: 1.1rem; height: 1.1rem; }

.scanner-hub-tiles { display: flex; flex-direction: column; gap: 0.75rem; }
.scanner-hub-tile {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.1rem;
    border-radius: var(--radius, 8px);
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    text-decoration: none;
    color: inherit;
    transition: background 0.15s, border-color 0.15s;
    min-height: 72px;
}
.scanner-hub-tile:hover { background: var(--color-table-header); border-color: var(--color-border); }
.scanner-hub-tile-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--color-table-header);
    color: var(--color-text-muted);
}
.scanner-hub-tile-icon svg { width: 24px; height: 24px; }
.scanner-hub-tile-body { flex: 1; min-width: 0; }
.scanner-hub-tile-title { font-size: 1.05rem; margin: 0 0 0.25rem; font-weight: 600; }
.scanner-hub-tile-desc { font-size: 0.875rem; color: var(--color-text-muted); margin: 0; line-height: 1.4; }
.scanner-hub-tile-arrow { flex-shrink: 0; align-self: center; color: var(--color-text-muted); }
.scanner-hub-tile--produkty .scanner-hub-tile-icon { background: rgba(59, 130, 246, 0.12); color: #2563eb; }
.scanner-hub-tile--pz .scanner-hub-tile-icon { background: rgba(16, 185, 129, 0.12); color: #059669; }
.scanner-hub-tile--assembly .scanner-hub-tile-icon { background: rgba(245, 158, 11, 0.15); color: #d97706; }
.scanner-hub-tile--mm .scanner-hub-tile-icon { background: rgba(139, 92, 246, 0.12); color: #7c3aed; }
.scanner-hub-tile--stany .scanner-hub-tile-icon { background: rgba(100, 116, 139, 0.15); color: #475569; }

.empty-state-card {
    padding: 1.25rem 1rem;
    border-radius: var(--radius);
    border: 1px dashed var(--color-border);
    text-align: center;
}
.empty-state-title { font-weight: 600; margin: 0 0 0.35rem; }
.empty-state-hint { font-size: 0.875rem; color: var(--color-text-muted); margin: 0.5rem 0 0; }

/* Przypisz kod do roweru – lista wyników */
.scanner-assign-barcode .assign-step { margin-bottom: 1rem; }
.assign-search-results { margin: 0.75rem 0; max-height: 50vh; overflow-y: auto; }
.assign-result-row { padding: 0.75rem 1rem; border: 1px solid var(--color-border); border-radius: var(--radius); margin-bottom: 0.5rem; cursor: pointer; transition: background 0.15s; }
.assign-result-row:hover { background: var(--color-table-header); }
.assign-result-row__main { font-weight: 600; margin-bottom: 0.25rem; }
.assign-result-row__meta { font-size: 0.85rem; color: var(--color-text-muted); }
.assign-result-row--disabled { cursor: default; opacity: 0.7; }
.assign-result-row--disabled:hover { background: transparent; }

/* Skaner – ekran wyboru akcji: style w assets/user-dashboard.css (spójne z dashboardem) */

/* Skaner – Informacje o rowerze (SBI) – mobile-first, minimal */
.sbi { max-width: 600px; margin: 0 auto; padding: 0 max(0.75rem, env(safe-area-inset-left, 0px)) calc(2rem + env(safe-area-inset-bottom, 0px)) max(0.75rem, env(safe-area-inset-right, 0px)); }
.sbi-entry-hint { font-size: 0.8125rem; line-height: 1.45; margin: 0.5rem 0 0; }
.sbi-main-assembly-wrap { margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid var(--color-border); }
.sbi-header { margin-bottom: 0.75rem; }
.sbi-back { display: inline-flex; align-items: center; gap: 0.2rem; font-size: 0.8125rem; color: var(--color-text-muted); text-decoration: none; margin-bottom: 0.35rem; }
.sbi-back:hover { color: var(--color-accent); }
.sbi-title { font-size: 1.125rem; font-weight: 600; margin: 0; }

.sbi-scan { margin-bottom: 0.75rem; }
.sbi-scan-row { display: flex; gap: 0.5rem; align-items: stretch; }
.sbi-scan-btn { display: inline-flex; align-items: center; gap: 0.4rem; min-height: 48px; padding: 0 1rem; font-size: 0.9375rem; white-space: nowrap; flex-shrink: 0; }
.sbi-scan-btn svg { flex-shrink: 0; }
.sbi-scan-input { flex: 1; min-width: 0; min-height: 48px; font-size: 1rem; }
.sbi-loading { font-size: 0.875rem; color: var(--color-text-muted); margin: 0.5rem 0 0; }

.sbi-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 0.75rem 1rem; margin-bottom: 0.625rem; }
.sbi-section-title { font-size: 0.875rem; font-weight: 600; margin: 0 0 0.5rem; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.03em; }
.sbi-muted { font-size: 0.8125rem; color: var(--color-text-muted); margin: 0.35rem 0 0; }

.sbi-product-name { font-size: 1.0625rem; font-weight: 600; margin: 0 0 0.5rem; }
.sbi-product-params { }
.sbi-row { display: flex; gap: 0.5rem; font-size: 0.875rem; line-height: 1.6; }
.sbi-row-k { min-width: 5.5rem; flex-shrink: 0; color: var(--color-text-muted); }
.sbi-row-v { font-weight: 500; }

/* Availability section */
.sbi-avail-grid { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.35rem; }
.sbi-avail-item { }
.sbi-avail-total { font-size: 0.8125rem; color: var(--color-text-muted); }

/* Stock quantity badges */
.sbi-sq { display: inline-block; font-size: 0.8125rem; font-weight: 600; padding: 0.2rem 0.6rem; border-radius: 9999px; line-height: 1.35; }
.sbi-sq--yes { background: #d1fae5; color: #065f46; }
.sbi-sq--no { background: #f3f4f6; color: #9ca3af; }
.sbi-sq--none { background: #f3f4f6; color: #9ca3af; font-style: italic; }

/* Insight badges */
.sbi-insights { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.sbi-badge { display: inline-block; font-size: 0.8125rem; font-weight: 500; padding: 0.25rem 0.625rem; border-radius: var(--radius); line-height: 1.35; }
.sbi-badge--ok { background: #d1fae5; color: #065f46; }
.sbi-badge--warn { background: #fef3c7; color: #92400e; }
.sbi-badge--info { background: #dbeafe; color: #1e40af; }
.sbi-badge--neutral { background: #f3f4f6; color: #6b7280; }

/* Color variants */
.sbi-variants-list { display: flex; flex-direction: column; gap: 0.5rem; }
.sbi-vcard { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 0.625rem 0.75rem; }
.sbi-vcard--wh-only { border-left: 3px solid #d97706; }
.sbi-vcard-main { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.3rem; }
.sbi-vcard-color { font-weight: 600; font-size: 0.9rem; }
.sbi-vcard-qty { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.sbi-vcard-hint { font-size: 0.75rem; color: #b45309; margin-bottom: 0.35rem; }
.sbi-vcard-btns { display: flex; gap: 0.35rem; }
.sbi-asm-btn { min-height: 40px; padding: 0.4rem 0.75rem; font-size: 0.8125rem; font-weight: 600; white-space: nowrap; border-radius: var(--radius); border: none; cursor: pointer; font-family: inherit; transition: opacity 0.12s; }
.sbi-asm-btn:disabled { opacity: 0.5; cursor: default; }
.sbi-asm-salon { background: #059669; color: #fff; }
.sbi-asm-salon:hover:not(:disabled) { background: #047857; }
.sbi-asm-client { background: #d97706; color: #fff; }
.sbi-asm-client:hover:not(:disabled) { background: #b45309; }

.sbi-next-btn { display: flex; align-items: center; justify-content: center; gap: 0.4rem; width: 100%; min-height: 48px; font-size: 0.9375rem; margin-top: 0.5rem; }

.sbi-confirm { position: relative; background: var(--color-surface); border-radius: 8px; padding: 1.25rem; max-width: 100%; width: 320px; box-shadow: 0 4px 20px rgba(0,0,0,0.2); text-align: center; }
.sbi-confirm h3 { margin: 0 0 0.35rem; font-size: 1rem; }
.sbi-confirm-product { font-weight: 600; font-size: 0.875rem; margin: 0 0 0.35rem; }
.sbi-confirm-text { font-size: 0.8125rem; color: var(--color-text-muted); margin: 0 0 0.75rem; }
.sbi-confirm-actions { display: flex; gap: 0.5rem; justify-content: center; }
.sbi-confirm-btn { min-width: 90px; min-height: 44px; font-size: 0.9375rem; }

.sbi-toast { position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%); padding: 0.625rem 1.25rem; border-radius: var(--radius); font-size: 0.875rem; font-weight: 500; color: #fff; z-index: 2000; box-shadow: 0 4px 12px rgba(0,0,0,0.15); text-align: center; max-width: 90vw; }
.sbi-toast--success { background: #059669; }
.sbi-toast--error { background: #b91c1c; }

@media (max-width: 480px) {
    .sbi-vcard-main { flex-direction: column; align-items: flex-start; }
    .sbi-vcard-btns { width: 100%; }
    .sbi-asm-btn { flex: 1; text-align: center; }
}

/* Skaner – placeholder „W trakcie budowy” */
.scanner-placeholder { max-width: 520px; margin: 0 auto; padding: 0 1rem 1.5rem; }
.scanner-placeholder-header { margin-bottom: 1rem; }
.scanner-placeholder-card { padding: 1.25rem; }
.scanner-placeholder-lead { font-size: 1.05rem; font-weight: 600; margin: 0 0 0.5rem; }
.scanner-placeholder-desc { font-size: 0.9rem; color: var(--color-text-muted); margin: 0 0 1rem; line-height: 1.45; }
.scanner-placeholder-actions { margin: 0; }

.msg.muted { color: var(--color-text-muted); }

/* Alerty: tabs and Brak na salonie */
.alerts-tabs { display: flex; gap: 0.5rem; margin-bottom: 0.5rem; flex-wrap: wrap; }
.alerts-tab { padding: 0.5rem 1rem; border-radius: var(--radius); text-decoration: none; color: var(--color-text); background: var(--color-table-header); }
.alerts-tab:hover { background: var(--color-border); }
.alerts-tab--active { background: var(--color-primary); color: #fff; }
.alerts-desc { color: var(--color-text-muted); font-size: 0.95rem; margin: 0.25rem 0; }
.alerts-count { margin: 0 0 0.75rem; }
.alerts-filters { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.alerts-filters .input { margin: 0; }
.pagination-wrap { margin-top: 1rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
.pagination-info { margin: 0; font-size: 0.9rem; color: var(--color-text-muted); }
.pagination { list-style: none; margin: 0; padding: 0; display: flex; gap: 0.25rem; flex-wrap: wrap; }
.pagination a { display: block; padding: 0.35rem 0.6rem; border-radius: 4px; text-decoration: none; background: var(--color-table-header); color: var(--color-text); }
.pagination a:hover { background: var(--color-border); }
.pagination a.active { background: var(--color-primary); color: #fff; }

/* ---- Rowery: lista – wyszukiwarka, filtry, tabela ---- */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.bikes-filters-quick { }
.bikes-filters-heading { margin: 0 0 0.75rem; font-size: 1rem; font-weight: 600; }
.bikes-search-form { }
.bikes-search-main {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    max-width: 100%;
    margin-bottom: 1rem;
    background: linear-gradient(to bottom, #fafafa, #f3f4f6);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.bikes-search-main:focus-within {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(75, 85, 99, 0.15), 0 1px 3px rgba(0, 0, 0, 0.06);
    background: var(--color-surface);
}
.bikes-search-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.04);
    border-radius: 8px;
    color: var(--color-text-muted);
}
.bikes-search-main:focus-within .bikes-search-icon { color: var(--color-accent); background: rgba(75, 85, 99, 0.08); }
.bikes-search-icon svg { width: 22px; height: 22px; }
.bikes-search-input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    font-size: 1.05rem;
    padding: 0.35rem 0;
    letter-spacing: 0.01em;
}
.bikes-search-input::placeholder { color: var(--color-text-muted); opacity: 0.9; }
.bikes-search-input:focus { outline: none; }
.bikes-search-clear {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 1.4rem;
    line-height: 1;
    font-weight: 300;
    transition: background 0.15s ease, color 0.15s ease;
}
.bikes-search-clear:hover { background: rgba(0, 0, 0, 0.06); color: var(--color-text); }
.bikes-filters-more-btn { display: none; }
.bikes-filters-row { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; }
.bikes-filters-row .form-group { margin: 0; }
.bikes-filter-buttons { display: flex; gap: 0.5rem; }
.bikes-filters-advanced { }
.bikes-filters-advanced-summary { cursor: pointer; padding: 0.5rem 0; font-weight: 500; }
.bikes-filters-advanced-content { padding-top: 0.5rem; }
.bikes-results-bar { }
.bikes-results-stats { margin: 0; font-size: 0.95rem; }
.bikes-results-sep { margin: 0 0.5rem; color: var(--color-text-muted); }
.table--bikes thead { background: var(--color-table-header); }
.table--bikes thead th { font-weight: 600; padding: 0.6rem 0.5rem; border-bottom: 2px solid var(--color-border); }
.bikes-row-clickable { cursor: pointer; }
.bikes-row-clickable:hover { background: var(--color-table-header); }
.bikes-badge { display: inline-block; padding: 0.3rem 0.6rem; border-radius: 6px; font-size: 0.8125rem; font-weight: 600; border: 1px solid transparent; }
.bikes-badge--salon { background: #d1fae5; color: #065f46; border-color: rgba(5, 95, 70, 0.2); }
.bikes-badge--magazyn { background: #e0e7ff; color: #3730a3; border-color: rgba(55, 48, 163, 0.2); }
.bikes-badge--brak { background: #f3f4f6; color: var(--color-text-muted); border-color: #e5e7eb; }
.bikes-hard-to-pick { display: inline-flex; margin-left: 0.25rem; color: #b45309; vertical-align: middle; }

/* ---- Bikes list: mobile compact cards v7 (model główny, marka pod, SKU + ilość — kompakt, ilość wyżej) ---- */
@media (max-width: 767px) {
    .table-responsive-cards .table--bikes tbody tr {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-rows: auto auto auto;
        grid-auto-rows: auto;
        column-gap: 0.4rem;
        row-gap: 0.04rem;
        align-items: start;
        padding: 0.28rem 0.5rem;
        margin-bottom: 0.35rem;
    }
    /* Wyższa specyficzność niż .table-responsive-cards .table td — bez flex „etykieta | wartość” z responsive.css */
    .table-responsive-cards .table--bikes tbody td {
        display: block;
        border-bottom: none;
        min-height: 0;
        padding: 0;
        justify-content: unset;
        align-items: unset;
        gap: 0;
    }
    /* Wiersz 1: model / nazwa — główna linia karty */
    .table-responsive-cards .table--bikes .bikes-cell-name {
        grid-column: 1 / -1;
        grid-row: 1;
        min-width: 0;
        font-weight: 600;
        font-size: 0.9375rem;
        color: var(--color-text, #111827);
        line-height: 1.25;
        word-break: break-word;
        padding: 0;
        margin: 0;
        border-bottom: none;
        max-width: 100%;
    }
    .table-responsive-cards .table--bikes .bikes-cell-name::before { display: none; }
    /* Wiersz 2: marka — drugorzędna typografia */
    .table-responsive-cards .table--bikes tbody td.bikes-cell-brand {
        grid-column: 1 / -1;
        grid-row: 2;
        align-self: start;
        width: fit-content;
        max-width: 100%;
        font-size: 0.75rem;
        font-weight: 500;
        color: var(--color-text-muted, #6b7280);
        line-height: 1.3;
        padding: 0.06rem 0 0;
        margin: 0;
        border-bottom: none;
        text-transform: none;
    }
    .table-responsive-cards .table--bikes tbody td.bikes-cell-brand::before { display: none; }
    /* Wiersz 3: SKU (lewo) | łączna ilość (prawo), wyrównanie do góry wiersza */
    .table-responsive-cards .table--bikes .bikes-cell-sku {
        grid-column: 1;
        grid-row: 3;
        justify-self: start;
        align-self: start;
        font-size: 0.72rem;
        color: var(--color-text-muted, #6b7280);
        white-space: nowrap;
        padding-top: 0.1rem;
    }
    .table-responsive-cards .table--bikes .bikes-cell-sku::before { display: none; }
    .table-responsive-cards .table--bikes .bikes-cell-qty {
        grid-column: 2;
        grid-row: 3;
        justify-self: end;
        align-self: start;
        padding: 0.1rem 0 0;
        font-weight: 700;
        font-size: 0.875rem;
        text-align: right;
        line-height: 1.2;
    }
    .table-responsive-cards .table--bikes .bikes-cell-qty::before { display: none; }
    /* Szczegóły po rozwinięciu — pełna szerokość, kolejne wiersze po wierszu 3 */
    .table-responsive-cards .table--bikes .bikes-cell-detail {
        display: none;
        grid-column: 1 / -1;
        grid-row: auto;
    }
    .table-responsive-cards .table--bikes tr.bikes-row-expanded .bikes-cell-detail {
        display: flex;
        justify-content: space-between;
        align-items: center;
        min-height: 44px;
        padding: 0.3rem 0;
        border-bottom: 1px solid var(--color-border, #e5e7eb);
    }
    .table-responsive-cards .table--bikes tr.bikes-row-expanded .bikes-cell-detail:last-child {
        border-bottom: none;
    }
    .table-responsive-cards .table--bikes .bikes-actions-cell {
        flex-wrap: wrap;
        gap: 0.5rem;
        justify-content: stretch;
        padding-top: 0.5rem;
    }
    .table-responsive-cards .table--bikes .bikes-actions-cell::before { display: none; }
    .table-responsive-cards .table--bikes .bikes-actions-cell .btn {
        flex: 1 1 0%;
        text-align: center;
        min-height: 40px;
    }
}

/* ---- Widok produktu: szybkie akcje (Montaż, Przyjęcie), stan, modal kolejki ---- */
.product-quick-actions { }
.product-quick-actions-grid {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
    max-width: none;
}
.product-quick-actions-main {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: stretch;
    flex: 1 1 auto;
    min-width: min(100%, 16rem);
}
.product-quick-actions-main .product-assembly-trigger {
    flex: 1 1 140px;
    min-width: 0;
}
.product-quick-actions-main .product-receive-btn {
    flex: 1 1 140px;
    min-width: 0;
}
.product-quick-actions-spacer {
    flex: 1 1 2rem;
    min-width: 1rem;
    height: 1px;
    align-self: center;
}
.product-quick-actions-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-left: auto;
}
.product-quick-stock-hint { margin-top: 0.65rem; font-size: 0.875rem; }
.product-assembly-trigger { display: inline-flex; }
.product-assembly-trigger .product-open-assembly-modal { width: 100%; justify-content: center; }
.product-action-montaz-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 48px;
    width: 100%;
    padding: 0.55rem 1.2rem;
    font-weight: 600;
    font-size: 0.9375rem;
    border-radius: 10px;
    background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
    color: #1e293b;
    border: 1.5px solid #cbd5e1;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 1px 2px rgba(15, 23, 42, 0.06);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.product-action-montaz-btn:hover {
    filter: none;
    border-color: var(--color-primary, #2563eb);
    color: var(--color-primary, #1d4ed8);
    background: linear-gradient(180deg, #fff 0%, #f1f5f9 100%);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.95) inset, 0 2px 8px rgba(37, 99, 235, 0.12);
}
.product-action-montaz-btn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08) inset;
}
.product-action-montaz-btn:focus-visible {
    outline: 2px solid var(--color-accent, #2563eb);
    outline-offset: 2px;
}
.product-action-montaz-btn svg { flex-shrink: 0; opacity: 0.85; }
.product-action-montaz-btn--compact {
    min-height: 44px;
    padding: 0.45rem 0.85rem;
    font-size: 0.875rem;
}
.product-action-montaz-btn--table {
    min-height: 40px;
    width: auto;
    padding: 0.4rem 0.75rem;
    font-size: 0.8125rem;
}
.product-receive-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 48px;
    width: 100%;
    padding: 0.55rem 1.2rem;
    font-weight: 600;
    font-size: 0.9375rem;
    border-radius: 10px;
    background: var(--color-surface);
    color: var(--color-text);
    border: 1.5px solid var(--color-border);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.product-receive-btn:hover {
    background: var(--color-table-header);
    border-color: var(--color-text-muted);
    color: var(--color-text);
}
.product-receive-btn:active {
    background: var(--color-border);
}
.product-receive-btn:focus-visible {
    outline: 2px solid var(--color-accent, #2563eb);
    outline-offset: 2px;
}
.product-receive-btn svg { flex-shrink: 0; color: var(--color-text-muted); }
.product-action-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    padding: 0;
    border-radius: 10px;
    border: 1.5px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text-muted);
    text-decoration: none;
    box-sizing: border-box;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.product-action-icon-btn:hover {
    background: var(--color-table-header);
    color: var(--color-text);
    border-color: var(--color-text-muted);
}
.product-action-icon-btn:active {
    transform: scale(0.98);
}
.product-action-icon-btn:focus-visible {
    outline: 2px solid var(--color-accent, #2563eb);
    outline-offset: 2px;
}
.product-action-icon-btn svg { flex-shrink: 0; }
.product-action-icon-btn--warn {
    color: #dc2626;
    border-color: #fecaca;
    background: #fff;
}
.product-action-icon-btn--warn:hover {
    background: #fef2f2;
    border-color: #f87171;
    color: #b91c1c;
}
.product-action-icon-btn--edit {
    color: var(--color-text-muted);
}
/* Egzemplarze w tabeli stanu – wyraźna akcja secondary */
.product-stock-egz-btn,
.btn-egzemplarze {
    border-radius: 8px;
    font-weight: 600;
    min-height: 40px;
    padding: 0.4rem 0.85rem;
}
.product-stock-place { display: flex; flex-direction: column; gap: 0.15rem; }
.product-stock-place-name { font-weight: 600; }
.product-stock-place-meta { font-size: 0.8125rem; line-height: 1.35; }
.table--product-stock thead th { font-weight: 600; }
.product-color-variant-assembly-trigger { display: block; margin-top: 0.5rem; }
.product-color-variant-assembly-trigger .product-open-assembly-modal {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    width: 100%;
    justify-content: center;
    min-height: 44px;
}

/* Modal montażu (widok produktu): meta + stepper premium */
#product-assembly-queue-modal .bikes-assembly-product-block.product-assembly-queue-product-block {
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}
#product-assembly-queue-modal .bikes-assembly-product-name {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
}
#product-assembly-queue-modal .bikes-assembly-product-meta {
    margin-top: 0.35rem;
    font-size: 0.8125rem;
    line-height: 1.4;
    display: none;
}
#product-assembly-queue-modal .product-assembly-premium-qty {
    background: var(--color-table-header);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 0.35rem;
    gap: 0.35rem;
    max-width: 13rem;
    margin-left: auto;
    margin-right: auto;
}
#product-assembly-queue-modal .product-assembly-qty-step {
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
    font-weight: 700;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
#product-assembly-queue-modal .product-assembly-qty-step:hover {
    border-color: var(--color-text-muted);
    background: var(--color-surface);
}
#product-assembly-queue-modal .product-assembly-qty-input {
    border: 1px solid transparent;
    background: transparent;
    font-variant-numeric: tabular-nums;
    -moz-appearance: textfield;
}
#product-assembly-queue-modal .product-assembly-qty-input::-webkit-outer-spin-button,
#product-assembly-queue-modal .product-assembly-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
#product-assembly-queue-modal .bikes-assembly-target-tile-body {
    border-width: 1.5px;
    min-height: 4rem;
}
#product-assembly-queue-modal .product-assembly-queue-submit-btn {
    border-radius: 10px;
    padding: 0.6rem 1.15rem;
    font-weight: 600;
}

/* Modal zgłoszenia problemu (produkt) */
.product-report-problem-modal-inner {
    padding: 1.35rem 1.25rem 1.25rem;
    border-radius: 12px;
}
.product-report-problem-title {
    margin: 0 0 0.35rem 0;
    font-size: 1.15rem;
    font-weight: 700;
}
.product-report-problem-section .label {
    display: block;
    margin-bottom: 0.45rem;
    font-weight: 600;
    font-size: 0.875rem;
}
.product-problem-place-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr));
    gap: 0.5rem;
}
.product-problem-place-tile {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0.65rem 0.5rem;
    text-align: center;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.3;
    border-radius: 10px;
    border: 1.5px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.product-problem-place-tile:hover {
    border-color: var(--color-text-muted);
    background: var(--color-table-header);
}
.product-problem-place-tile.is-selected {
    border-color: var(--color-accent, #2563eb);
    background: var(--color-table-header);
    box-shadow: 0 0 0 1px var(--color-accent, #2563eb);
}
.product-problem-type-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}
.product-problem-type-tile {
    display: block;
    margin: 0;
    cursor: pointer;
    position: relative;
}
.product-problem-type-tile input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
    white-space: nowrap;
}
.product-problem-type-tile-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 3.25rem;
    padding: 0.65rem 0.5rem;
    border: 1.5px solid var(--color-border);
    border-radius: 10px;
    background: var(--color-surface);
    font-weight: 600;
    font-size: 0.875rem;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.product-problem-type-tile:hover .product-problem-type-tile-body {
    border-color: var(--color-text-muted);
}
.product-problem-type-tile:has(input:focus-visible) .product-problem-type-tile-body {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}
.product-problem-type-tile:has(input:checked) .product-problem-type-tile-body {
    border-color: var(--color-accent, #2563eb);
    background: var(--color-table-header);
    box-shadow: 0 0 0 1px var(--color-accent, #2563eb);
}
.product-problem-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}
.product-problem-actions .btn-primary {
    flex: 1 1 auto;
    min-width: 8rem;
}

.product-receive-modal-content { max-width: 640px; }
.product-receive-rows { margin-bottom: 0.75rem; }
.product-receive-row-inner { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: flex-end; }
.product-receive-row-inner .form-group { margin: 0; min-width: 100px; }
.product-receive-row-remove-wrap { margin-left: auto; }
.product-receive-sum { margin: 0.5rem 0; }
.product-receive-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.75rem; }

@media (max-width: 768px) {
    .product-receive-row-inner { flex-direction: column; align-items: stretch; }
}
@media (max-width: 768px) {
    .product-quick-actions-grid {
        flex-direction: column;
        align-items: stretch;
    }
    .product-quick-actions-spacer {
        display: none;
    }
    .product-quick-actions-icons {
        margin-left: 0;
        justify-content: flex-start;
    }
    .table--product-stock .product-stock-egz-btn { width: 100%; justify-content: center; }
}
@media (max-width: 768px) {
    .bikes-search-main { padding: 0.6rem 0.75rem; border-radius: 10px; }
    .bikes-search-icon { width: 36px; height: 36px; }
    .bikes-filters-more-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        margin-bottom: 0.75rem;
        padding: 0.6rem 1rem;
        font-size: 1rem;
        font-weight: 500;
        color: var(--color-primary);
        background: transparent;
        border: 1px solid var(--color-primary);
        border-radius: 10px;
        cursor: pointer;
    }
    .bikes-filters-more-btn:hover { background: rgba(37, 99, 235, 0.08); }
    .bikes-filters-mobile-wrap .bikes-filters-row {
        display: none;
        flex-direction: column;
    }
    .bikes-filters-mobile-wrap.is-open .bikes-filters-row {
        display: flex;
    }
    .bikes-filters-row { flex-direction: column; }
    .bikes-filter-buttons { width: 100%; }
}

/* ---- Montaż (assembly) ---- */
.assembly-header {
    border: 1px solid var(--color-border);
    background: linear-gradient(180deg, var(--color-surface) 0%, var(--color-table-header) 100%);
}
.assembly-header-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.9rem 1rem;
}
.assembly-header-text { flex: 1; min-width: 0; }
.assembly-desc { color: var(--color-text-muted); font-size: 0.9rem; margin: 0.2rem 0 0; }
.assembly-header .page-title { margin: 0; font-size: 1.3rem; letter-spacing: 0.01em; }
.assembly-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.55rem;
    margin-top: 0;
    flex-shrink: 0;
}
.assembly-stats--desktop { }
.assembly-stat {
    background: var(--color-surface);
    border-radius: var(--radius);
    padding: 0.55rem 0.75rem;
    text-align: center;
    border: 1px solid var(--color-border);
}
.assembly-stat-value { display: block; font-size: 1.15rem; font-weight: 700; color: var(--color-text); line-height: 1.2; }
.assembly-stat-label { font-size: 0.75rem; color: var(--color-text-muted); }
.assembly-stat--new { border-left: 3px solid #3b82f6; }
.assembly-stat--in_progress { border-left: 3px solid #eab308; }
.assembly-stat--done { border-left: 3px solid #22c55e; }
.assembly-stat--rejected { border-left: 3px solid #6b7280; }
.assembly-header--centered .assembly-header-inner { justify-content: center; }
.assembly-header--centered .assembly-header-text { text-align: center; }
.assembly-header--centered .assembly-desc { margin-bottom: 0.25rem; }

.assembly-quick-add { border: 1px solid var(--color-border); }
.assembly-quick-add-title { font-size: 1rem; margin: 0 0 0.9rem; font-weight: 700; }
.assembly-add-form {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    gap: 0.9rem 1rem;
    align-items: start;
}
.assembly-add-form .form-group { margin: 0; }
.assembly-form-group { min-width: 0; }
.assembly-form-group--model { grid-column: 1 / -1; }
.assembly-form-group--controls {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    gap: 0.85rem 1rem;
    align-items: start;
    justify-items: start;
}
.assembly-form-group--note { grid-column: 1 / -1; }
.assembly-form-group--action { grid-column: 1 / -1; }
.assembly-search-wrap { position: relative; min-width: 220px; width: 100%; }
.assembly-search-main {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--color-surface);
    border: 1.5px solid var(--color-border);
    border-radius: 12px;
    padding: 0.62rem 0.9rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.assembly-search-main:focus-within {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-accent) 18%, transparent);
}
.assembly-search-icon { display: flex; align-items: center; color: var(--color-text-muted); flex-shrink: 0; }
.assembly-search-main:focus-within .assembly-search-icon { color: var(--color-accent); }
.assembly-search-input { border: none; background: transparent; flex: 1; min-width: 0; padding: 0.2rem 0; font-size: 1rem; }
.assembly-search-input:focus { outline: none; }
.assembly-search-input::placeholder { color: var(--color-text-muted); opacity: 0.72; }
.assembly-search-filters-btn {
    margin-top: 0.46rem;
    border-radius: 10px;
    min-height: 36px;
    padding: 0.3rem 0.62rem;
    font-weight: 500;
    border: 1px solid var(--color-border);
    background: var(--color-table-header);
    color: var(--color-text-muted);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    width: fit-content;
}
.assembly-search-filters-btn-icon {
    width: 1.05rem;
    height: 1.05rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.assembly-search-filters-btn-text {
    font-size: 0.76rem;
    letter-spacing: 0.01em;
}
.assembly-model-filters {
    margin-top: 0.45rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: var(--color-table-header);
}
.assembly-model-filters-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.55rem;
}
.assembly-search-filters-btn:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
    background: var(--color-surface);
}
.assembly-variants-wrap { margin-top: 0.65rem; }
.assembly-variants-label { font-size: 0.85rem; font-weight: 600; margin-bottom: 0.35rem !important; }
.assembly-variants-list { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.assembly-variant-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
    background: var(--color-surface);
    border: 1.5px solid var(--color-border);
    border-radius: 8px;
    cursor: pointer;
    color: var(--color-text);
    transition: border-color 0.15s ease, background 0.15s ease;
}
.assembly-variant-btn:hover { border-color: var(--color-accent); background: var(--color-table-header); }
.assembly-search-results {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    margin-top: 2px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    max-height: 280px;
    overflow-y: auto;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.assembly-search-item {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    text-align: left;
    background: none;
    border: none;
    font-size: 0.95rem;
    cursor: pointer;
    color: var(--color-text);
    border-bottom: 1px solid var(--color-border);
}
.assembly-search-item:last-child { border-bottom: none; }
.assembly-search-item:hover { background: var(--color-table-header); }
.assembly-search-item--empty { color: var(--color-text-muted); cursor: default; }
.assembly-selected-product { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.assembly-selected-product #assembly-selected-name { font-weight: 600; }
.assembly-qty-stepper {
    display: inline-flex;
    align-items: stretch;
    gap: 0;
    border: 1.5px solid var(--color-border);
    border-radius: 12px;
    overflow: hidden;
    background: var(--color-surface);
    width: fit-content;
    max-width: 100%;
}
.assembly-qty-btn { min-width: 48px; min-height: 48px; border: none; background: var(--color-table-header); font-size: 1.2rem; line-height: 1; color: var(--color-text); font-weight: 600; }
.assembly-qty-btn:hover { background: color-mix(in srgb, var(--color-border) 65%, var(--color-surface)); }
.assembly-qty-input { width: 3.8rem; min-height: 48px; text-align: center; font-size: 1.05rem; font-weight: 700; border: none; border-left: 1px solid var(--color-border); border-right: 1px solid var(--color-border); border-radius: 0; margin: 0; -moz-appearance: textfield; }
.assembly-qty-input::-webkit-outer-spin-button, .assembly-qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.assembly-target-radio, .assembly-priority-radio { display: flex; gap: 1rem; flex-wrap: wrap; }
.assembly-target-radio label, .assembly-priority-radio label { font-weight: normal; cursor: pointer; }
.assembly-add-cta { min-height: 44px; }
.form-group--inline .label, .form-group .label { display: block; margin-bottom: 0.25rem; font-weight: 500; }

.assembly-chips { margin-bottom: 0.75rem; }
.assembly-list { display: flex; flex-direction: column; gap: 0.5rem; }
.assembly-card {
    display: block;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: inherit;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    transition: background 0.15s ease, border-color 0.15s ease;
}
.assembly-card:hover { background: var(--color-table-header); border-color: var(--color-accent); }
.assembly-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.35rem;
}
.assembly-card-main { flex: 1; min-width: 0; margin-bottom: 0; }
.assembly-card-name { font-size: 1rem; display: block; }
.assembly-card-meta { font-size: 0.9rem; color: var(--color-text-muted); display: block; }
.assembly-card-qty { font-weight: 600; margin-left: 0.5rem; }
.assembly-card-meta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.65rem; font-size: 0.8125rem; color: var(--color-text-muted); margin-top: 0.25rem; }
.assembly-card-who { display: inline-flex; align-items: center; gap: 0.35rem; }
.assembly-card-author-avatar { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; overflow: hidden; background: var(--color-table-header); flex-shrink: 0; }
.assembly-author-img { width: 100%; height: 100%; object-fit: cover; }
.assembly-author-initials { font-size: 0.7rem; font-weight: 600; color: var(--color-text-muted); }
.assembly-card-notes { font-size: 0.85rem; margin-top: 0.35rem; color: var(--color-text-muted); }
.assembly-card-location {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.5rem;
    background: var(--color-table-header);
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
}
.assembly-card-location-tile {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 1.75rem;
    padding: 0 0.4rem;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.02em;
    background: var(--color-accent);
    color: #fff;
    border-radius: 4px;
    box-sizing: border-box;
}
.assembly-card-location-floor {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    font-weight: 500;
    white-space: nowrap;
}
.assembly-card-location-label { font-size: 0.85rem; color: var(--color-text-muted); display: inline-flex; align-items: center; gap: 0.25rem; }
.assembly-rejection { color: #b91c1c; }

.assembly-badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
}
.assembly-badge--new { background: #dbeafe; color: #1d4ed8; }
.assembly-badge--in_progress { background: #fef9c3; color: #a16207; }
.assembly-badge--done { background: #dcfce7; color: #166534; }
.assembly-badge--rejected { background: #f3f4f6; color: #6b7280; }
.assembly-badge--target-salon { background: #dbeafe; color: #1d4ed8; }
.assembly-badge--target-client { background: #e0e7ff; color: #3730a3; }

/* Ikony statusu na kartach: X (odrzucone), ptaszek (gotowe), spinner (w trakcie) */
.assembly-status-icon { display: inline-flex; align-items: center; justify-content: center; margin-right: 0.25rem; font-weight: 700; }
.assembly-status-icon--rejected { color: #b91c1c; font-size: 1rem; }
.assembly-status-icon--done { color: #166534; font-size: 1rem; }
.assembly-status-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 0.35rem;
    vertical-align: middle;
    border: 2px solid #f97316;
    border-top-color: transparent;
    border-radius: 50%;
    animation: assembly-spin 0.7s linear infinite;
}
@keyframes assembly-spin {
    to { transform: rotate(360deg); }
}

/* Modal Rozpocznij: kafelki lokalizacji w modalu */
.assembly-start-modal-bins { margin: 0.75rem 0; }
.assembly-start-modal-bins-loading { font-size: 0.9rem; margin: 0; }
.assembly-start-modal-bins-tiles {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.5rem 0 0;
}
.assembly-start-modal-bins-empty { font-size: 0.9rem; margin: 0.5rem 0 0; }
.assembly-start-manual-label { margin-top: 0.75rem !important; }

/* Modal Gotowe: kafelki lokalizacji */
.assembly-done-bins { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0; }
.assembly-done-bin-tile {
    display: inline-block;
    min-width: 3rem;
    padding: 0.5rem 0.75rem;
    text-align: center;
    font-weight: 600;
    border: 2px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.assembly-done-bin-tile:hover { background: #dcfce7; border-color: #22c55e; }
.assembly-done-bin-tile.assembly-done-bin-tile--selected { background: #dcfce7; border-color: #22c55e; font-weight: 600; }
.assembly-done-bin-tile small { display: block; font-weight: normal; font-size: 0.75rem; color: var(--color-text-muted); margin-top: 0.15rem; }

/* Lista v2: karta z linkiem + szybkie akcje */
.assembly-card-v2 { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0.5rem; padding: 0.65rem 0.85rem; }
.assembly-card--client { border-left: 4px solid #b91c1c; background: #fef2f2; }
.assembly-card--client:hover { background: #fee2e2; }
.assembly-card-v2 .assembly-card-link { flex: 1; min-width: 0; text-decoration: none; color: inherit; display: block; }
.assembly-card-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
    flex-shrink: 0;
}
.assembly-card-quick-actions .btn {
    min-height: 40px;
    padding: 0.4rem 0.85rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 8px;
    white-space: nowrap;
}
.assembly-card-quick-actions .btn-sm { min-height: 40px; padding: 0.4rem 0.85rem; font-size: 0.875rem; }
.assembly-card-quick-actions .btn-primary { background: var(--color-accent); color: #fff; border: 1px solid var(--color-accent); }
.assembly-card-quick-actions .btn-primary:hover { filter: brightness(1.08); }
.assembly-card-manage-actions {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    padding-left: 0.6rem;
    margin-left: 0.35rem;
    border-left: 1px solid var(--color-border);
}
.assembly-card-quick-actions > .assembly-card-manage-actions:first-child {
    margin-left: 0;
    padding-left: 0;
    border-left: none;
}
.assembly-quick-btn-done {
    background: var(--color-surface);
    color: #166534;
    border: 1.5px solid #22c55e;
    font-weight: 600;
}
.assembly-quick-btn-done:hover {
    background: #dcfce7;
    border-color: #16a34a;
    color: #166534;
}
.assembly-quick-btn-reject {
    background: transparent;
    color: var(--color-text-muted);
    border: 1.5px solid var(--color-border);
    font-weight: 600;
}
.assembly-quick-btn-reject:hover {
    background: #fef2f2;
    border-color: #dc2626;
    color: #b91c1c;
}
.assembly-quick-action-form { display: inline-flex; margin: 0; }
.assembly-quick-action-form .btn { margin: 0; }

/* Szybkie dodawanie: segmenty, podgląd, dostępność */
.assembly-segment {
    display: inline-flex;
    flex-wrap: nowrap;
    gap: 0.26rem;
    padding: 0.14rem;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: color-mix(in srgb, var(--color-table-header) 65%, transparent);
    width: fit-content;
    max-width: 100%;
    box-sizing: border-box;
}
.assembly-segment-item { display: inline-flex; align-items: center; margin: 0; cursor: pointer; font-weight: normal; flex: 0 0 auto; }
.assembly-segment-item input { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.assembly-segment-item span {
    padding: 0.4rem 0.74rem;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    width: auto;
    min-width: 0;
    text-align: center;
    font-weight: 600;
    color: var(--color-text-muted);
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.assembly-segment-item:hover span { color: var(--color-text); background: color-mix(in srgb, var(--color-surface) 72%, transparent); }
.assembly-segment-item:has(input:checked) span { background: var(--color-surface); border-color: var(--color-accent); color: var(--color-text); box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1); }
.assembly-target-wrap { width: fit-content; max-width: 100%; }
.assembly-selected-wrap { width: 100%; }
.assembly-preview-card { padding: 1rem 1.25rem; margin: 0.5rem 0; max-width: 420px; margin-left: auto; margin-right: auto; text-align: center; }
.assembly-preview-card-inner { display: flex; flex-direction: column; align-items: center; gap: 0.35rem; }
.assembly-preview-name { display: block; font-size: 1.05rem; }
.assembly-preview-meta { font-size: 0.9rem; margin: 0; }
.assembly-availability { margin: 0; font-size: 0.9rem; }
.assembly-note-textarea { resize: vertical; min-height: 2.8rem; overflow: auto; border-radius: 12px; border-width: 1.5px; }
.assembly-add-cta-wrap { width: 100%; margin-top: 0.35rem; padding-top: 0.7rem; border-top: 1px solid var(--color-border); }
.assembly-add-cta {
    display: block;
    width: 100%;
    max-width: 360px;
    margin: 0 auto;
    padding: 0.8rem 1.25rem;
    font-size: 0.98rem;
    font-weight: 700;
    min-height: 50px;
    border-radius: 12px;
    border: 1px solid color-mix(in srgb, var(--color-accent) 70%, #000 6%);
    background: linear-gradient(180deg, color-mix(in srgb, var(--color-accent) 88%, #fff 12%), var(--color-accent));
    box-shadow: 0 6px 14px color-mix(in srgb, var(--color-accent) 24%, transparent);
}
.assembly-add-cta:hover { transform: translateY(-1px); box-shadow: 0 8px 18px color-mix(in srgb, var(--color-accent) 28%, transparent); }
.assembly-add-cta:disabled { opacity: 0.55; transform: none; box-shadow: none; }
.assembly-availability { font-size: 0.9rem; color: var(--color-text-muted); margin: 0.25rem 0; }
.assembly-availability-warning { margin: 0.5rem 0; }
.assembly-list-count { margin-bottom: 0.5rem; font-size: 0.95rem; }
.assembly-list-panel { border: 1px solid var(--color-border); }
.assembly-list-title { margin-bottom: 0.65rem; }
.assembly-status-segment {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.35rem;
    overflow-x: auto;
    padding: 0.2rem;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background: var(--color-table-header);
    scrollbar-width: thin;
}
.assembly-status-tab {
    flex: 0 0 auto;
    border-radius: 10px;
    min-height: 38px;
    padding: 0.5rem 0.85rem;
    background: transparent;
    border: 1px solid transparent;
    color: var(--color-text-muted);
    font-weight: 600;
}
.assembly-status-tab.alerts-tab--active {
    background: var(--color-surface);
    border-color: var(--color-accent);
    color: var(--color-text);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}
.assembly-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.35rem;
    padding: 1.4rem 1rem 1.2rem;
    color: var(--color-text-muted);
}
.assembly-empty-icon {
    width: 2.2rem;
    height: 2.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid var(--color-border);
    background: var(--color-table-header);
    color: var(--color-text-muted);
}
.assembly-empty-title { margin: 0; font-size: 0.95rem; font-weight: 600; color: var(--color-text); }
.assembly-empty-text { margin: 0; font-size: 0.86rem; }

/* Widok szczegółów zgłoszenia (premium) */
.assembly-detail-page {
    max-width: 1100px;
    margin: 0 auto;
    padding-bottom: 1.25rem;
}
.assembly-view-card--hero {
    border-radius: 12px;
    border: 1px solid color-mix(in srgb, var(--color-border) 92%, #9ca3af);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    padding: 1.1rem 1.25rem 1.25rem;
}
.assembly-view-hero-top {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 0.85rem;
}
.assembly-view-back {
    font-weight: 600;
}
.assembly-view-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
    gap: 1.25rem 1.75rem;
    align-items: start;
}
.assembly-view-title {
    font-size: clamp(1.35rem, 2.2vw, 1.65rem);
    margin: 0 0 0.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}
.assembly-view-subtitle {
    font-size: 1rem;
    margin: 0 0 0.85rem;
    line-height: 1.45;
}
.assembly-view-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 0.5rem;
    align-items: center;
    margin-bottom: 1rem;
}
.assembly-view-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.28rem 0.65rem;
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.2;
    border: 1px solid var(--color-border);
    background: var(--color-table-header);
    color: var(--color-text);
}
.assembly-view-chip--muted {
    color: var(--color-text-muted);
    font-weight: 600;
}
.assembly-view-author {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    margin-bottom: 1rem;
    border-radius: 10px;
    background: var(--color-table-header);
    border: 1px solid var(--color-border);
}
.assembly-view-author-avatar--lg {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 50%;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, var(--color-table-header), var(--color-bg));
    border: 1px solid var(--color-border);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}
.assembly-view-author-avatar--initials {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-accent);
}
.assembly-view-author-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}
.assembly-view-author-name {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--color-text);
}
.assembly-view-author-email {
    font-size: 0.8125rem;
    word-break: break-word;
}
.assembly-view-meta-dl {
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.assembly-view-meta-row {
    display: grid;
    grid-template-columns: 9.5rem minmax(0, 1fr);
    gap: 0.5rem 1rem;
    align-items: baseline;
    font-size: 0.9rem;
}
.assembly-view-meta-row dt {
    margin: 0;
    color: var(--color-text-muted);
    font-weight: 500;
}
.assembly-view-meta-row dd {
    margin: 0;
    font-weight: 500;
    color: var(--color-text);
}
.assembly-view-params-panel {
    padding: 1rem 1.1rem;
    border-radius: 12px;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    border-left: 3px solid color-mix(in srgb, var(--color-accent) 42%, transparent);
}
.assembly-view-params-title {
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
    color: var(--color-text-muted);
    margin: 0 0 0.75rem;
}
.assembly-view-params-dl {
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}
.assembly-view-params-item dt {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
    font-weight: 600;
    margin: 0 0 0.2rem;
}
.assembly-view-params-item dd {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text);
    line-height: 1.35;
}
.assembly-view-params-empty {
    font-size: 0.9rem;
    line-height: 1.45;
}
.assembly-view-section--card {
    margin-top: 1rem;
    padding: 1rem 1.15rem;
    border: 1px solid color-mix(in srgb, var(--color-border) 92%, #9ca3af);
    border-radius: 12px;
    background: var(--color-surface);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.assembly-view-section--card.mm-section {
    border-left: 3px solid color-mix(in srgb, var(--color-accent) 35%, transparent);
}
.assembly-view-section-title {
    font-size: 1.05rem;
    margin: 0 0 0.65rem;
    font-weight: 600;
}
.assembly-view-note-block + .assembly-view-note-block {
    margin-top: 0.85rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--color-border);
}
.assembly-view-value--multiline {
    margin-top: 0.25rem;
}
.assembly-view-bins-hint {
    font-size: 0.9rem;
}
.assembly-view-actions--card {
    margin-top: 1rem;
    padding: 1rem 1.15rem;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background: var(--color-table-header);
}
.assembly-cta--secondary {
    min-height: 44px;
}

/* Legacy grid (inne miejsca) */
.assembly-view-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem 1.5rem; margin: 1rem 0; }
.assembly-view-grid-item--full { grid-column: 1 / -1; }
.assembly-view-label { display: block; font-size: 0.85rem; color: var(--color-text-muted); margin-bottom: 0.2rem; }
.assembly-view-value { display: block; }
.assembly-view-section:not(.assembly-view-section--card) {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
}
.assembly-view-availability { margin: 0; font-size: 0.95rem; }
.assembly-view-rejection { background: #fef2f2; border: 1px solid #fecaca; border-radius: var(--radius); padding: 0.75rem; }
.assembly-rejection-text { margin: 0; color: #b91c1c; }
.assembly-view-history { list-style: none; margin: 0; padding: 0; }
.assembly-view-history li { padding: 0.35rem 0; border-bottom: 1px solid var(--color-border); font-size: 0.9rem; }
.assembly-view-history li:last-child { border-bottom: none; }
.assembly-cta { min-height: 44px; padding: 0.5rem 1rem; }

.assembly-view-dl { display: grid; grid-template-columns: auto 1fr; gap: 0.25rem 1.5rem; margin: 1rem 0; }
.assembly-view-dl dt { grid-column: 1; color: var(--color-text-muted); font-weight: 500; }
.assembly-view-dl dd { grid-column: 2; margin: 0; }
.assembly-view-meta { color: var(--color-text-muted); font-size: 0.95rem; margin: 0.25rem 0; }
.assembly-view-actions:not(.assembly-view-actions--card) {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}
.assembly-view-actions .assembly-action-form { margin: 0; }
.assembly-edit-note { margin-top: 0.75rem; }
.assembly-edit-note summary { cursor: pointer; font-weight: 500; }
.assembly-reject-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.75rem; }
.mt-1 { margin-top: 0.5rem; }

@media (max-width: 900px) {
    .assembly-view-hero-grid {
        grid-template-columns: 1fr;
    }
    .assembly-view-params-panel {
        order: 2;
    }
    .assembly-view-hero-main {
        order: 1;
    }
    .assembly-view-meta-row {
        grid-template-columns: 1fr;
        gap: 0.15rem;
    }
}

@media (max-width: 768px) {
    .assembly-stats--desktop { display: none !important; }
    .assembly-header .page-title { font-size: 1.18rem; }
    .assembly-add-form {
        display: flex;
        flex-direction: column;
        gap: 0.8rem;
    }
    .assembly-form-group--controls {
        display: flex;
        flex-direction: column;
        gap: 0.8rem;
    }
    .assembly-search-wrap { max-width: none; }
    .assembly-search-main { min-height: 50px; }
    .assembly-search-filters-btn { width: 100%; min-height: 42px; margin-top: 0.55rem; justify-content: center; }
    .assembly-model-filters-grid { grid-template-columns: 1fr; }
    .assembly-qty-stepper { max-width: none; width: 100%; }
    .assembly-qty-btn { min-width: 52px; min-height: 50px; }
    .assembly-qty-input { min-height: 50px; width: 100%; }
    .assembly-card-meta-row { flex-direction: column; align-items: flex-start; }
    .assembly-card-v2 { flex-direction: column; }
    .assembly-card-quick-actions { width: 100%; }
    .assembly-card-quick-actions .btn { width: 100%; justify-content: center; min-height: 48px; }
    .assembly-card-manage-actions {
        width: 100%;
        display: flex;
        flex-direction: row;
        gap: 0.4rem;
        padding-left: 0;
        margin-left: 0;
        border-left: none;
        border-top: 1px solid var(--color-border);
        padding-top: 0.4rem;
        margin-top: 0.25rem;
    }
    .assembly-card-manage-actions .btn { flex: 1; justify-content: center; min-height: 48px; }
    .assembly-segment { width: 100%; }
    .assembly-segment-item { flex: 1; }
    .assembly-segment-item span { display: block; text-align: center; width: 100%; min-height: 42px; display: inline-flex; align-items: center; justify-content: center; }
    .assembly-note-textarea { min-height: 3.2rem; }
    .assembly-add-cta { max-width: none; min-height: 52px; }
    .assembly-status-segment { margin-bottom: 0.8rem; }
    .assembly-status-tab { min-height: 44px; padding: 0.58rem 0.9rem; }
    .assembly-view-grid { grid-template-columns: 1fr; }
    .assembly-detail-page .assembly-view-actions--card {
        flex-direction: column;
        align-items: stretch;
        gap: 0.65rem;
    }
    .assembly-detail-page .assembly-view-actions--card > .btn,
    .assembly-detail-page .assembly-view-actions--card .assembly-action-form .btn {
        width: 100%;
        justify-content: center;
        min-height: 48px;
    }
    .assembly-detail-page .assembly-view-card--hero {
        padding: 1rem 1rem 1.15rem;
    }
    .assembly-view-chips .assembly-badge {
        font-size: 0.78rem;
    }
}

/* ---- Formularz klienta (create/update) ---- */
.client-form-card .card { }
.client-form .form-group { margin-bottom: 1rem; }
.client-form-title-wrap { }
.client-form-title-wrap .client-form-input { width: 100%; max-width: 560px; }
.client-form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 0.5rem;
}
.client-form-row .form-group { margin-bottom: 0; flex: 1; min-width: 140px; }
.client-form-row .client-form-input { width: 100%; max-width: 200px; }
.client-form-bike-wrap { position: relative; max-width: 400px; }
.client-form-bike-wrap .client-form-input { width: 100%; }
.client-bike-results { max-width: 100%; }
.client-form-bike-selected { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.25rem; }
.client-form-bike-selected span { font-weight: 500; }
.client-form-description-wrap .client-form-input { width: 100%; max-width: 560px; min-height: 100px; }
.client-form-actions {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}
.client-form-input { min-height: 2.25rem; }

@media (max-width: 768px) {
    .client-form-row { flex-direction: column; }
    .client-form-row .client-form-input { max-width: none; }
    .client-form-title-wrap .client-form-input { max-width: none; }
    .client-form-description-wrap .client-form-input { max-width: none; }
}

/* ---- Skróty klawiszowe ---- */
.shortcuts-page .shortcuts-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 1.5rem;
    align-items: start;
}
@media (max-width: 900px) {
    .shortcuts-page .shortcuts-layout { grid-template-columns: 1fr; }
}
.shortcuts-page .shortcuts-main { min-width: 0; }
.shortcuts-page .shortcuts-group { margin-bottom: 1rem; }
.shortcuts-page .shortcuts-group-title { font-size: 1rem; margin: 0 0 0.75rem 0; padding: 0; }
.shortcuts-page .shortcuts-list { list-style: none; margin: 0; padding: 0; }
.shortcuts-page .shortcut-row {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) minmax(140px, auto) auto auto;
    gap: 0.75rem;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--color-border);
}
.shortcuts-page .shortcut-row:last-child { border-bottom: none; }
.shortcuts-page .shortcut-row-label { font-weight: 500; }
.shortcuts-page .shortcut-row-field {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.shortcuts-page .shortcut-capture {
    min-width: 10rem;
    text-align: left;
}
.shortcuts-page .shortcut-capture--listening {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}
.shortcuts-page .shortcut-capture.shortcut-input--conflict,
.shortcuts-page .shortcut-row-field.shortcut-input--conflict .shortcut-capture {
    border-color: #dc2626;
    background-color: #fef2f2;
}
.shortcuts-page .shortcut-default-hint {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    cursor: help;
    border: 1px solid var(--color-border);
    border-radius: 50%;
    width: 1.1rem;
    height: 1.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.shortcuts-page .shortcut-capture-error { font-size: 0.8rem; margin-top: 0.25rem; }
.shortcuts-page .shortcut-row-status { font-size: 0.85rem; }
.shortcuts-page .shortcut-status--active { color: #059669; }
.shortcuts-page .shortcut-status--conflict { color: #dc2626; font-weight: 500; }
.shortcuts-page .shortcut-status--default { color: var(--color-text-muted); }
.shortcuts-page .shortcuts-actions-top,
.shortcuts-page .shortcuts-actions-bottom { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.shortcuts-page .shortcut-test-area-section .shortcut-test-area {
    min-height: 3rem;
    padding: 0.75rem;
    border: 1px dashed var(--color-border);
    border-radius: var(--radius);
    background: var(--color-bg);
    font-size: 0.9rem;
    color: var(--color-text-muted);
}
.shortcuts-page .shortcut-test-area:focus { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.shortcuts-page .shortcuts-sidebar { position: sticky; top: 1rem; }
.shortcuts-page .shortcuts-sidebar .card { margin-bottom: 1rem; }
.shortcuts-page .shortcuts-sidebar-title { font-size: 0.95rem; margin: 0 0 0.5rem 0; }
.shortcuts-page .shortcuts-sidebar-list { list-style: none; margin: 0; padding: 0; font-size: 0.9rem; }
.shortcuts-page .shortcuts-sidebar-list li { padding: 0.25rem 0; }
.shortcuts-page .shortcuts-sidebar-list kbd { font-size: 0.8em; padding: 0.1em 0.35em; border-radius: 3px; background: var(--color-table-header); border: 1px solid var(--color-border); }
.shortcuts-page .shortcuts-sidebar-hints { list-style: none; margin: 0; padding: 0; font-size: 0.85rem; color: var(--color-text-muted); }
.shortcuts-page .shortcuts-sidebar-hints li { padding: 0.2rem 0; }
.shortcuts-page .shortcuts-workflow-section .shortcuts-workflow-list { list-style: none; margin: 0 0 0.75rem 0; padding: 0; }
.shortcuts-page .shortcuts-workflow-list li { padding: 0.35rem 0; }
.shortcuts-page .shortcuts-workflow-label { display: inline-flex; align-items: center; gap: 0.5rem; cursor: pointer; }
@media (max-width: 900px) {
    .shortcuts-page .shortcut-row { grid-template-columns: 1fr 1fr; }
    .shortcuts-page .shortcut-row-status { grid-column: 1; }
    .shortcuts-page .shortcut-row-reset { grid-column: 2; }
}

/* ---- Klienci: Nowy klient (premium) ---- */
.clients-create-premium {
    padding: 1.25rem 1.35rem 1.5rem;
    border-radius: 14px;
    border: 1px solid var(--color-border);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.clients-create-hero { margin-bottom: 1.25rem; }
.clients-create-title { margin: 0 0 0.35rem 0; font-size: 1.35rem; }
.clients-create-lead { margin: 0; font-size: 0.95rem; max-width: 42rem; }
.clients-create-section {
    padding: 1rem 0;
    border-top: 1px solid var(--color-border);
}
.clients-create-section:first-of-type { border-top: 0; padding-top: 0; }
.clients-create-section-head {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}
.clients-create-section-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--color-table-header) 80%, transparent);
    color: var(--color-text-muted);
}
.clients-create-section-title { margin: 0; font-size: 1.02rem; font-weight: 600; }
.clients-create-section-hint { margin: 0.15rem 0 0 0; font-size: 0.82rem; }
.clients-create-field label { font-weight: 600; font-size: 0.88rem; }
.clients-create-label-icon { display: inline-flex; vertical-align: middle; margin-right: 0.25rem; opacity: 0.75; }
.clients-create-label-icon svg { width: 16px; height: 16px; }
.clients-create-input {
    width: 100%;
    max-width: 100%;
    border-radius: 10px;
    border-width: 1.5px;
    min-height: 44px;
}
.clients-create-input--date { max-width: 220px; }
.clients-create-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem 1rem;
}
.clients-create-bike-selected {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
    margin-top: 0.5rem;
    border-radius: 10px;
}
.clients-create-bike-picked-name { font-weight: 600; }
.clients-create-bike-results { margin-top: 0.35rem; }
.clients-create-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
}
.clients-create-submit { min-height: 46px; padding-left: 1.35rem; padding-right: 1.35rem; }
@media (max-width: 768px) {
    .clients-create-grid-3 { grid-template-columns: 1fr; }
    .clients-create-input--date { max-width: 100%; }
}

/* —— Lokalizacje (premium lista + magazyn) —— */
.locations-page-premium {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 0.5rem 1.5rem;
}
.locations-premium-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}
.locations-premium-title { margin: 0; }
.locations-premium-lead { margin: 0.35rem 0 0; max-width: 36rem; font-size: 0.95rem; }
.locations-premium-chips {
    margin-top: 0.65rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}
.locations-premium-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--color-text-muted);
    background: var(--color-table-header);
    border: 1px solid var(--color-border);
}
.locations-premium-cta { align-self: center; min-height: 44px; }
.locations-shortcuts {
    margin-bottom: 1.25rem;
    padding: 0.85rem 1rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem 1rem;
}
.locations-shortcuts-label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
}
.locations-shortcuts-pills { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.locations-shortcut-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
    transition: background var(--transition-subtle), border-color var(--transition-subtle);
}
.locations-shortcut-pill:hover {
    border-color: var(--color-input-border);
    background: var(--color-table-header);
}
.locations-shortcut-pill--emphasis {
    border-color: color-mix(in srgb, var(--color-accent) 35%, var(--color-border));
    background: color-mix(in srgb, var(--color-table-header) 50%, var(--color-surface));
}
.locations-premium-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}
.locations-premium-card {
    display: flex;
    flex-direction: column;
    padding: 1.1rem 1.15rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--color-border);
    transition: border-color var(--transition-subtle), box-shadow var(--transition-subtle), transform var(--transition-subtle);
}
.locations-premium-card:hover {
    border-color: color-mix(in srgb, var(--color-accent) 30%, var(--color-border));
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}
.locations-premium-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}
.locations-premium-code {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
    text-transform: uppercase;
}
.locations-premium-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    background: color-mix(in srgb, var(--color-table-header) 80%, transparent);
    color: var(--color-text-muted);
}
.locations-premium-name { margin: 0 0 0.25rem; font-size: 1.15rem; }
.locations-premium-meta { margin: 0 0 0.85rem; font-size: 0.85rem; }
.locations-premium-link { align-self: flex-start; min-height: 40px; }
.locations-empty-card { padding: 2rem; text-align: center; }

.locations-warehouse-premium {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 0.5rem 1.5rem;
}
.locations-warehouse-title { margin-bottom: 0.25rem; }
.locations-warehouse-lead {
    margin: 0 0 1rem;
    max-width: 40rem;
    font-size: 0.95rem;
}
.mag-floor-tiles-premium {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.25rem;
}
.mag-floor-tile-premium {
    display: block;
    background: var(--color-surface);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    text-decoration: none;
    color: inherit;
    transition: all 0.15s ease;
    border: 2px solid transparent;
}
.mag-floor-tile-premium:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}
.mag-floor-tile-premium__label { font-size: 1.25rem; font-weight: 700; }
.mag-floor-tile-premium__meta {
    margin-top: 0.5rem;
    font-size: 1.05rem;
    color: var(--color-text-muted);
}

/* Regał / kolumna – akcje w jednym rzędzie */
.regal-row-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
}
.regal-row-actions--mobile {
    margin-top: 0.5rem;
}
.regal-action-mm {
    border-color: color-mix(in srgb, #2563eb 40%, var(--color-border));
    color: #1d4ed8;
    background: color-mix(in srgb, #eff6ff 70%, var(--color-surface));
}
.regal-action-mm:hover {
    background: color-mix(in srgb, #dbeafe 80%, var(--color-surface));
}
.regal-action-wz {
    border-color: color-mix(in srgb, #059669 40%, var(--color-border));
    color: #047857;
    background: color-mix(in srgb, #ecfdf5 70%, var(--color-surface));
}
.regal-action-wz:hover {
    background: color-mix(in srgb, #d1fae5 80%, var(--color-surface));
}

/* MM – delikatny premium (spójność z PZ / dashboard) */
.mm-page-premium {
    padding-bottom: 1.5rem;
}
.mm-page-premium .mm-page-header .page-title {
    margin-bottom: 0;
}
.mm-page-premium .mm-section {
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    border-color: color-mix(in srgb, var(--color-border) 92%, #9ca3af);
}
.mm-page-premium .mm-search-first {
    border-left: 3px solid color-mix(in srgb, var(--color-accent) 45%, transparent);
}

/* MM – nagłówek strony i status */
.mm-page-header {
    margin-bottom: 1.25rem;
    padding: 1rem 0 1.1rem;
    border-bottom: 1px solid var(--color-border);
}
.mm-page-header__row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
}
.mm-page-header__eyebrow {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
    margin: 0 0 0.2rem;
    font-weight: 600;
}
.mm-page-header__title {
    margin: 0;
    font-size: clamp(1.25rem, 2.5vw, 1.5rem);
    line-height: 1.2;
}
.mm-page-header__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}
.mm-page-header__flow {
    margin: 0.65rem 0 0;
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}
.mm-flow-arrow {
    opacity: 0.45;
    padding: 0 0.12rem;
}
.mm-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.2;
}
.mm-pill--accent {
    background: color-mix(in srgb, var(--color-accent) 18%, var(--color-surface));
    color: var(--color-accent);
    border: 1px solid color-mix(in srgb, var(--color-accent) 35%, transparent);
}
.mm-pill--success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}
.mm-pill--muted {
    background: var(--color-table-header);
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
}

/* MM – kroki workflow */
.mm-workflow-step {
    scroll-margin-top: 0.5rem;
}
.mm-step-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.65rem;
    margin-bottom: 0.35rem;
}
.mm-step-heading .mm-section-title--step {
    flex: 1 1 12rem;
    margin-bottom: 0;
}
.mm-step-badge {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    border-radius: 10px;
    background: linear-gradient(
        145deg,
        var(--color-accent),
        color-mix(in srgb, var(--color-accent) 72%, #1e293b)
    );
    color: #fff;
    font-weight: 700;
    font-size: 0.9375rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.05rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}
.mm-cart-section .mm-step-heading {
    align-items: center;
}
.mm-cart-inline-count {
    margin-left: auto;
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--color-text-muted);
    background: var(--color-table-header);
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    border: 1px solid var(--color-border);
}
.mm-section-lead {
    margin: 0 0 1rem;
    font-size: 0.9375rem;
    line-height: 1.45;
}
.mm-search-product-hint {
    margin: 0 0 0.5rem;
    font-size: 0.875rem;
}

/* MM – wyszukiwarka hero */
.mm-field-label--hero {
    font-size: 0.8125rem;
    font-weight: 600;
    margin: 0 0 0.5rem;
    color: var(--color-text);
}
.mm-field-label--hero label {
    cursor: text;
}
.mm-model-search-wrap--hero {
    position: relative;
    max-width: 100%;
    width: 100%;
}
.mm-model-search-wrap--hero .mm-input-icon--search {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-muted);
    pointer-events: none;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mm-model-search-wrap--hero .input--mm-hero {
    width: 100%;
    padding-left: 2.75rem;
    min-height: 52px;
    font-size: 1.0625rem;
    border-radius: 12px;
    border-width: 1.5px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.mm-model-search-wrap--hero .input--mm-hero:focus {
    outline: none;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-accent) 22%, transparent);
}

/* MM – źródło: siatka filtrów i szybkie kafelki */
.mm-source-grid-filters {
    display: grid;
    gap: 0.65rem 1rem;
    grid-template-columns: 1fr;
}
@media (min-width: 640px) {
    .mm-source-grid-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
.mm-source-quick-tiles {
    margin-bottom: 1rem;
}
.mm-source-quick-tiles .mm-target-tiles-label {
    text-align: left;
    width: 100%;
}
.mm-source-quick-tiles .mm-target-tiles-row {
    justify-content: flex-start;
}

/* MM – źródło: kafelki rajek / kolumn (Magazyn) */
.mm-src-warehouse-pickers {
    margin-top: 0.35rem;
}
.mm-src-rack-tiles--grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    justify-content: flex-start;
    align-items: stretch;
    max-width: 100%;
}
.mm-tile--src-rack,
.mm-tile--src-col {
    min-width: 2.65rem;
    min-height: 2.85rem;
    font-weight: 700;
    font-size: 0.9375rem;
}
.mm-tile--src-rack.is-active,
.mm-tile--src-col.is-active {
    border-color: var(--color-accent);
    background: color-mix(in srgb, var(--color-accent) 14%, var(--color-surface));
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--color-accent) 32%, transparent);
}
.mm-src-hotkey-hint {
    font-weight: 400;
    font-size: 0.72rem;
}
.mm-cart-section .mm-icon--cart svg {
    display: block;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

/* MM – cel: pełna szerokość (nie wąski box) */
.mm-target-section {
    max-width: none;
    margin-left: 0;
    margin-right: 0;
    border-left: 3px solid color-mix(in srgb, #059669 40%, transparent);
}
.mm-target-lead {
    margin-bottom: 1rem;
}
.mm-target-hint {
    font-size: 0.8125rem;
    margin: 0;
    max-width: 28rem;
}
.mm-btn-cart-add {
    min-height: 48px;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
    font-weight: 600;
}

/* MM – koszyk premium */
.mm-cart-section {
    border-left: 3px solid color-mix(in srgb, #d97706 38%, transparent);
}
.mm-cart-lead {
    margin-bottom: 1rem;
}
.mm-cart-list--premium {
    max-height: min(55vh, 28rem);
    overflow-y: auto;
    padding: 0;
    margin: 0 0 0.5rem;
    list-style: none;
    border: none;
    background: transparent;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}
.mm-cart-list--premium .mm-cart-card {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
    padding: 0.85rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background: color-mix(in srgb, var(--color-surface) 94%, var(--color-table-header));
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.mm-cart-card__body {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    flex: 1 1 12rem;
    min-width: 0;
}
.mm-cart-card__label {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
    font-weight: 600;
}
.mm-cart-card__title {
    font-weight: 600;
    font-size: 0.9375rem;
}
.mm-cart-card__loc {
    font-size: 0.8125rem;
}
.mm-cart-card__ident {
    font-weight: 700;
    font-size: 0.9375rem;
}
.mm-cart-card__qty {
    flex-shrink: 0;
}
.mm-cart-card__badges {
    flex-shrink: 0;
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}
.mm-cart-empty--premium {
    text-align: center;
    padding: 2rem 1rem;
    border: 1px dashed color-mix(in srgb, var(--color-border) 85%, var(--color-text-muted));
    border-radius: 12px;
    background: color-mix(in srgb, var(--color-table-header) 45%, var(--color-surface));
    margin-bottom: 0.25rem;
}
.mm-cart-empty__icon {
    display: flex;
    justify-content: center;
    margin-bottom: 0.75rem;
    color: var(--color-text-muted);
    opacity: 0.88;
}
.mm-cart-empty__title {
    font-weight: 600;
    font-size: 1.05rem;
    margin: 0 0 0.35rem;
    color: var(--color-text);
}
.mm-cart-empty__text {
    margin: 0;
    font-size: 0.9375rem;
    color: var(--color-text-muted);
    max-width: 26rem;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.45;
}

/* MM – skaner w koszyku */
.mm-scan-panel.scan-row--mm {
    align-items: stretch;
    margin-top: 1.25rem;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    background: var(--color-table-header);
    border: 1px solid var(--color-border);
}
.mm-scan-form {
    display: flex;
    flex: 1;
    gap: 0.5rem;
    min-width: 0;
    align-items: stretch;
}
.mm-scan-form .input {
    flex: 1;
    min-width: 0;
    min-height: 48px;
}
.mm-scan-panel .btn-scan {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
}

.mm-actions-bar--footer {
    border-top: none;
    margin-top: 1rem;
    padding-top: 0;
}
.mm-actions-bar--footer .mm-note-inline {
    flex: 1 1 14rem;
    max-width: none;
    min-width: 0;
}
.mm-hint-msg {
    margin-top: 0.5rem;
    font-size: 0.875rem;
}
