/* ROEM - Workshop Portal Stylesheet */
:root {
    --bg-base: #07090e;
    --bg-surface: #0e131d;
    --bg-card: #131a27;
    --bg-card-hover: #172132;
    --bg-glass: rgba(14, 19, 29, 0.88);
    --border: rgba(255, 255, 255, 0.09);
    --border-light: rgba(255, 255, 255, 0.15);
    --border-lime: rgba(163, 230, 53, 0.4);
    --lime: #a3e635;
    --lime-hover: #bef264;
    --lime-dark: #65a30d;
    --lime-glow: rgba(163, 230, 53, 0.18);
    --cyan: #38bdf8;
    --cyan-glow: rgba(56, 189, 248, 0.15);
    --amber: #fbbf24;
    --red: #f87171;
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --text-dim: #64748b;
    --font-main: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 25px rgba(163, 230, 53, 0.2);
}

[data-theme="light"] {
    --bg-base: #f1f5f9;
    --bg-surface: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f8fafc;
    --bg-glass: rgba(255, 255, 255, 0.94);
    --border: #e2e8f0;
    --border-light: #cbd5e1;
    --border-lime: rgba(101, 163, 13, 0.4);
    --lime: #4d7c0f;
    --lime-hover: #3f6212;
    --lime-dark: #166534;
    --lime-glow: rgba(77, 124, 15, 0.15);
    --cyan: #0284c7;
    --cyan-glow: rgba(2, 132, 199, 0.15);
    --amber: #d97706;
    --red: #dc2626;
    --text-main: #0f172a;
    --text-muted: #475569;
    --text-dim: #64748b;
    --shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.08);
    --shadow-glow: 0 0 20px rgba(77, 124, 15, 0.12);
}

[data-theme="light"] body {
    background-color: var(--bg-base);
    background-image: 
        radial-gradient(circle at 50% 0%, rgba(77, 124, 15, 0.05) 0%, transparent 60%),
        radial-gradient(circle at 100% 100%, rgba(2, 132, 199, 0.04) 0%, transparent 50%),
        linear-gradient(rgba(0, 0, 0, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.03) 1px, transparent 1px);
}

/* Google Material Symbols Outlined styling */
.material-symbols-outlined {
    font-family: 'Material Symbols Outlined';
    font-weight: normal;
    font-style: normal;
    font-size: 1.25rem;
    line-height: 1;
    display: inline-block;
    text-transform: none;
    letter-spacing: normal;
    word-wrap: normal;
    white-space: nowrap;
    direction: ltr;
    vertical-align: middle;
    user-select: none;
}

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

body {
    background-color: var(--bg-base);
    background-image: 
        radial-gradient(circle at 50% 0%, rgba(163, 230, 53, 0.07) 0%, transparent 60%),
        radial-gradient(circle at 100% 100%, rgba(56, 189, 248, 0.04) 0%, transparent 50%),
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 40px 40px, 40px 40px;
    color: var(--text-main);
    font-family: var(--font-main);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   PIN LOCK SCREEN
   ========================================================================== */
.pin-screen-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.pin-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 36px 32px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), var(--shadow-glow);
    text-align: center;
    backdrop-filter: blur(16px);
    position: relative;
    overflow: hidden;
}

.pin-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--lime), transparent);
}

.pin-logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.pin-logo img {
    height: 38px;
    width: auto;
    object-fit: contain;
}

.pin-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: rgba(163, 230, 53, 0.12);
    border: 1px solid rgba(163, 230, 53, 0.3);
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--lime);
    margin-bottom: 12px;
}

.pin-badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--lime);
    box-shadow: 0 0 8px var(--lime);
}

.pin-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.02em;
    margin-bottom: 6px;
}

.pin-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 24px;
}

/* PIN Input Display */
.pin-input-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.pin-input-field {
    width: 260px;
    height: 54px;
    background: var(--bg-card);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 0 0 0 14px;
    font-size: 2rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--lime);
    text-align: center;
    letter-spacing: 14px;
    outline: none;
    transition: all 0.2s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

.pin-input-field::placeholder {
    color: var(--text-dim);
    letter-spacing: 8px;
    font-size: 1.2rem;
    font-weight: 400;
    opacity: 0.35;
}

.pin-input-field:focus {
    border-color: var(--lime);
    box-shadow: 0 0 18px var(--lime-glow), inset 0 2px 4px rgba(0, 0, 0, 0.4);
    background: var(--bg-surface);
}

.pin-error-msg {
    min-height: 22px;
    font-size: 0.85rem;
    color: var(--red);
    font-weight: 600;
    margin-bottom: 20px;
}

/* On-screen Keypad */
.pin-keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    max-width: 300px;
    margin: 0 auto 20px;
}

.key-btn {
    height: 60px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-size: 1.35rem;
    font-weight: 700;
    font-family: var(--font-mono);
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.key-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-lime);
    color: var(--lime);
    transform: translateY(-1px);
}

.key-btn:active {
    transform: translateY(1px) scale(0.96);
    background: rgba(163, 230, 53, 0.15);
}

.key-btn.action {
    font-size: 0.95rem;
    color: var(--text-muted);
}

.key-btn.action:hover {
    color: var(--red);
}

.pin-hidden-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 1px;
    height: 1px;
}

/* Shake Animation */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-10px); }
    40%, 80% { transform: translateX(10px); }
}

.shake {
    animation: shake 0.4s ease-in-out;
}

/* ==========================================================================
   WORKSHOP DASHBOARD
   ========================================================================== */
.workshop-app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Top Navigation Bar */
.ws-navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 12px 24px;
}

.ws-nav-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.ws-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: var(--text-main);
}

.ws-brand img {
    height: 32px;
    width: auto;
}

.ws-brand-title {
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ws-tag {
    font-size: 0.7rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(163, 230, 53, 0.15);
    color: var(--lime);
    border: 1px solid rgba(163, 230, 53, 0.3);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.ws-nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ws-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.ws-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--lime);
    box-shadow: 0 0 8px var(--lime);
}

.ws-btn-ghost {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ws-btn-ghost:hover {
    color: var(--text-main);
    border-color: var(--border-light);
    background: rgba(255, 255, 255, 0.04);
}

.ws-btn-logout:hover {
    color: var(--red);
    border-color: rgba(248, 113, 113, 0.3);
}

/* ==========================================================================
   MAIN CONTENT & TABS
   ========================================================================== */
.ws-main {
    flex: 1;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 32px 24px 64px;
}

/* Tab Selector */
.ws-tabs-bar {
    display: flex;
    gap: 8px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    padding: 6px;
    border-radius: var(--radius-lg);
    margin-bottom: 32px;
    max-width: 600px;
}

.ws-tab-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 18px;
    border-radius: var(--radius-md);
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-main);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ws-tab-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.03);
}

.ws-tab-btn.active {
    background: var(--bg-card);
    color: var(--lime);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4), inset 0 0 0 1px rgba(163, 230, 53, 0.3);
}

.ws-tab-icon {
    font-size: 1.15rem;
}

/* Tab Panels */
.ws-panel {
    display: none;
}

.ws-panel.active {
    display: block;
    animation: fadeIn 0.25s ease-out;
}

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

/* ==========================================================================
   SEARCH BOX STYLES
   ========================================================================== */
.search-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    margin-bottom: 32px;
    box-shadow: var(--shadow-card);
    position: relative;
}

.search-header {
    margin-bottom: 20px;
}

.search-title {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.search-input-wrapper {
    position: relative;
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.search-input {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    font-family: var(--font-mono);
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--text-main);
    text-transform: uppercase;
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--lime);
    box-shadow: 0 0 0 3px var(--lime-glow);
    background: var(--bg-card-hover);
}

.search-input::placeholder {
    font-family: var(--font-main);
    font-size: 1rem;
    letter-spacing: normal;
    text-transform: none;
    color: var(--text-dim);
}

.search-btn {
    background: var(--lime);
    color: #000;
    border: none;
    border-radius: var(--radius-md);
    padding: 0 32px;
    font-family: var(--font-main);
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.search-btn:hover {
    background: var(--lime-hover);
    box-shadow: 0 0 20px var(--lime-glow);
    transform: translateY(-1px);
}

.search-btn:active {
    transform: translateY(1px);
}

/* Quick pills / suggestions */
.quick-pills {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.quick-pills-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-dim);
    margin-right: 4px;
}

.pill-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 9999px;
    padding: 5px 12px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
}

.pill-btn:hover {
    background: rgba(163, 230, 53, 0.1);
    border-color: rgba(163, 230, 53, 0.3);
    color: var(--lime);
}

/* ==========================================================================
   RESULTS & CARDS
   ========================================================================== */
.results-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Loading State */
.ws-loading {
    padding: 48px 24px;
    text-align: center;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(163, 230, 53, 0.15);
    border-top-color: var(--lime);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

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

/* Empty / Error state */
.ws-message-card {
    padding: 36px 28px;
    border-radius: var(--radius-lg);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    text-align: center;
}

.ws-message-card.error {
    border-color: rgba(248, 113, 113, 0.3);
    background: rgba(248, 113, 113, 0.05);
}

.ws-message-icon {
    font-size: 2.2rem;
    margin-bottom: 12px;
}

.ws-message-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.ws-message-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    max-width: 500px;
    margin: 0 auto;
}

/* ==========================================================================
   VEHICLE / VIN RESULT CARDS
   ========================================================================== */
.veh-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
    transition: all 0.2s ease;
}

.veh-card:hover {
    border-color: var(--border-light);
}

.veh-card.selected {
    border-color: var(--lime);
    box-shadow: 0 0 25px var(--lime-glow);
}

.veh-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.veh-title-wrap {
    flex: 1;
    min-width: 260px;
}

.veh-brand-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 6px;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: var(--cyan);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.veh-title {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-main);
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
}

.veh-series-code {
    font-size: 1.1rem;
    color: var(--lime);
    font-weight: 700;
}

/* Full VIN Badge */
.veh-vin-badge {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 10px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.veh-vin-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-dim);
}

.veh-vin-code {
    font-family: var(--font-mono);
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    color: var(--lime);
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.veh-vin-code:hover {
    color: var(--lime-hover);
}

.copy-icon {
    font-size: 0.85rem;
    opacity: 0.6;
}

/* Spec Grid */
.veh-specs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.spec-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.spec-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-dim);
}

.spec-value {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main);
}

.spec-value.mono {
    font-family: var(--font-mono);
    color: var(--lime);
}

/* Action button inside card */
.veh-actions {
    display: flex;
    gap: 12px;
}

.ws-btn-primary {
    background: rgba(163, 230, 53, 0.12);
    border: 1px solid rgba(163, 230, 53, 0.35);
    color: var(--lime);
    padding: 10px 18px;
    border-radius: var(--radius-md);
    font-family: var(--font-main);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.ws-btn-primary:hover {
    background: var(--lime);
    color: #000;
    box-shadow: 0 0 20px var(--lime-glow);
}

/* Multi-match selection container */
.multi-match-banner {
    background: rgba(56, 189, 248, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: var(--radius-md);
    padding: 14px 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--cyan);
    font-size: 0.95rem;
    font-weight: 600;
}

/* ==========================================================================
   PART & ECU RESULT CARDS
   ========================================================================== */
.part-overview-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
}

.part-overview-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--lime), var(--cyan));
}

.part-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.part-number-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.part-number-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-dim);
}

.part-number-value {
    font-family: var(--font-mono);
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: var(--lime);
    line-height: 1;
}

.part-cat-position {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
    font-size: 0.88rem;
    color: var(--text-muted);
}

.part-cat-label {
    font-weight: 600;
    color: var(--text-dim);
}

.part-cat-value {
    font-family: var(--font-mono);
    font-weight: 800;
    font-size: 0.98rem;
    color: var(--lime);
    letter-spacing: 0.05em;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(56, 189, 248, 0.35);
    padding: 3px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
}

.part-cat-value:hover {
    background: rgba(56, 189, 248, 0.12);
    border-color: #38bdf8;
}

.part-cat-prefix {
    color: #38bdf8; /* Błękitny kod grupy BMW (HG UG) */
    font-family: var(--font-mono);
    font-weight: 800;
    letter-spacing: 0.08em;
    margin-right: 7px;
    padding-right: 7px;
    border-right: 1px solid rgba(56, 189, 248, 0.35);
}

.part-cat-digits {
    color: var(--lime);
    font-family: var(--font-mono);
    font-weight: 800;
    letter-spacing: 0.06em;
}

.part-cat-group {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.part-cat-group strong {
    font-family: var(--font-mono);
    color: var(--text-main);
}

.part-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.part-ecu-badge {
    padding: 6px 14px;
    border-radius: 8px;
    background: rgba(163, 230, 53, 0.15);
    border: 1px solid rgba(163, 230, 53, 0.35);
    color: var(--lime);
    font-weight: 800;
    font-size: 0.9rem;
    letter-spacing: 0.03em;
}

.part-diag-badge {
    padding: 6px 12px;
    border-radius: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 700;
}

.part-name-block {
    margin-bottom: 24px;
}

.part-friendly-title {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 6px;
    color: var(--text-main);
}

.part-raw-name {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--cyan);
    margin-bottom: 8px;
}

.part-friendly-desc {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* ==========================================================================
   OFICJALNE METRYKI ETK & SCHEMATY MONTAŻOWE
   ========================================================================== */
.part-etk-metrics-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
    margin-bottom: 24px;
}

.part-metric-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid var(--border);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.part-metric-chip:hover {
    border-color: rgba(56, 189, 248, 0.4);
    background: rgba(15, 23, 42, 0.9);
}

.part-metric-chip .metric-icon {
    font-size: 1.35rem;
    color: #38bdf8;
}

.part-metric-chip .metric-body {
    display: flex;
    flex-direction: column;
}

.part-metric-chip .metric-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.part-metric-chip .metric-value {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-main);
    font-family: var(--font-mono);
}

.part-metric-chip.status-chip.status-discontinued {
    border-color: rgba(245, 158, 11, 0.35);
    background: rgba(245, 158, 11, 0.08);
}

.part-metric-chip.status-chip.status-discontinued .metric-icon,
.part-metric-chip.status-chip.status-discontinued .metric-value {
    color: #fbbf24;
}

.part-metric-chip.status-chip.status-active {
    border-color: rgba(163, 230, 53, 0.35);
    background: rgba(163, 230, 53, 0.08);
}

.part-metric-chip.status-chip.status-active .metric-icon,
.part-metric-chip.status-chip.status-active .metric-value {
    color: var(--lime);
}

/* Karta schematu montażowego ETK */
.part-diagram-card {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.75) 0%, rgba(10, 15, 29, 0.85) 100%);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    margin-bottom: 28px;
}

.diagram-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 14px;
}

.diagram-card-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.diagram-card-badges {
    display: flex;
    align-items: center;
    gap: 8px;
}

.diagram-callout-badge {
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.4);
    color: #38bdf8;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.diagram-tab-badge {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.82rem;
    font-family: var(--font-mono);
}

.diagram-preview-box {
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #ffffff;
    border: 1px solid var(--border);
    cursor: pointer;
    max-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
}

.diagram-preview-box:hover {
    border-color: #38bdf8;
    box-shadow: 0 4px 20px rgba(56, 189, 248, 0.2);
}

.diagram-preview-img {
    max-width: 100%;
    max-height: 280px;
    object-fit: contain;
    padding: 8px;
    transition: transform 0.3s ease;
}

.diagram-preview-box:hover .diagram-preview-img {
    transform: scale(1.02);
}

.diagram-zoom-hint {
    position: absolute;
    bottom: 10px;
    right: 12px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(4px);
    color: #38bdf8;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(56, 189, 248, 0.35);
}

/* Lightbox dla schematów */
.diagram-lightbox-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.diagram-lightbox-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
}

.diagram-lightbox-content {
    position: relative;
    z-index: 10000;
    background: #0f172a;
    border: 1px solid rgba(56, 189, 248, 0.4);
    border-radius: var(--radius-lg);
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7);
    overflow: hidden;
}

.diagram-lightbox-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: rgba(15, 23, 42, 0.95);
}

.diagram-lightbox-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-main);
}

.diagram-lightbox-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.diagram-lightbox-close:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.diagram-lightbox-body {
    padding: 16px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
}

.diagram-lightbox-body img {
    max-width: 100%;
    max-height: 65vh;
    object-fit: contain;
}

.diagram-lightbox-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border);
    font-size: 0.9rem;
    color: #38bdf8;
    font-weight: 700;
    background: rgba(15, 23, 42, 0.95);
}

/* Pigułki ETK w wierszach tabeli zamienników */
.rep-etk-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
    margin-bottom: 4px;
}

.rep-etk-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    font-family: var(--font-mono);
    padding: 2px 7px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text-dim);
}

.rep-etk-pill .material-symbols-outlined {
    font-size: 0.85rem;
    color: #38bdf8;
}

.rep-etk-pill.pill-name {
    color: var(--text-main);
    font-family: var(--font-main);
    font-weight: 600;
}

.rep-etk-pill.pill-disc {
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.3);
    background: rgba(245, 158, 11, 0.08);
}

.rep-etk-pill.pill-act {
    color: var(--lime);
    border-color: rgba(163, 230, 53, 0.3);
    background: rgba(163, 230, 53, 0.08);
}

.rep-etk-pill.pill-price {
    color: #ffffff;
    border-color: rgba(163, 230, 53, 0.45);
    background: rgba(163, 230, 53, 0.12);
    font-weight: 700;
}

.rep-etk-pill.pill-price strong {
    color: var(--lime);
}

.rep-etk-pill.pill-price .material-symbols-outlined {
    color: var(--lime);
    font-size: 0.9rem;
}

.rep-core-tag {
    font-size: 0.7rem;
    color: #fbbf24;
    background: rgba(245, 158, 11, 0.2);
    padding: 1px 5px;
    border-radius: 3px;
    margin-left: 4px;
}

/* Karta ceny katalogowej ASO (BMW Price.1 + NBP) */
.part-price-card {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.7) 0%, rgba(15, 23, 42, 0.85) 100%);
    border: 1px solid rgba(163, 230, 53, 0.35);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-top: 18px;
    margin-bottom: 24px;
}

.part-price-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.part-price-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--lime);
}

.part-price-badge .material-symbols-outlined {
    font-size: 1.15rem;
}

.part-price-nbp-note {
    font-size: 0.78rem;
    color: var(--text-dim);
    font-family: var(--font-mono);
}

.part-price-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.part-price-main {
    display: flex;
    align-items: baseline;
    gap: 14px;
    flex-wrap: wrap;
}

.price-val-eur {
    font-size: 2.1rem;
    font-weight: 900;
    font-family: var(--font-mono);
    color: #ffffff;
    letter-spacing: -0.02em;
    line-height: 1;
}

.price-val-pln {
    font-size: 1.4rem;
    font-weight: 800;
    font-family: var(--font-mono);
    color: var(--lime);
    letter-spacing: -0.01em;
}

.price-badge-sub {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-dim);
    background: rgba(255, 255, 255, 0.06);
    padding: 3px 8px;
    border-radius: 4px;
}

.part-price-details {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 4px;
}

.price-chip-dealer {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: var(--text-muted);
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
}

.price-chip-dealer strong {
    color: #38bdf8;
}

.price-chip-core {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: #fbbf24;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
}

.price-chip-core .material-symbols-outlined {
    font-size: 1rem;
}

/* ==========================================================================
   REPLACEMENT LIST LAYOUT
   ========================================================================== */
.replacement-section {
    margin-top: 32px;
}

.section-subheading-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.section-subheading {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.rep-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.rep-tool-btn,
.rep-copy-all-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-light);
    color: var(--text-main);
    padding: 7px 13px;
    border-radius: var(--radius-sm);
    font-family: var(--font-main);
    font-size: 0.83rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.rep-tool-btn:hover,
.rep-copy-all-btn:hover {
    background: rgba(163, 230, 53, 0.15);
    border-color: rgba(163, 230, 53, 0.4);
    color: var(--lime);
}

.rep-btn-print:hover {
    background: rgba(56, 189, 248, 0.15);
    border-color: rgba(56, 189, 248, 0.4);
    color: var(--cyan);
}

.rep-btn-csv:hover {
    background: rgba(251, 191, 36, 0.15);
    border-color: rgba(251, 191, 36, 0.4);
    color: var(--amber);
}

.rep-list-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

/* Toolbar with filters & search */
.rep-list-toolbar {
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.rep-filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.rep-filter-btn {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 9999px;
    padding: 6px 14px;
    color: var(--text-muted);
    font-family: var(--font-main);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.rep-filter-btn:hover {
    color: var(--text-main);
    border-color: var(--border-light);
    background: rgba(255, 255, 255, 0.03);
}

.rep-filter-btn.active {
    background: rgba(163, 230, 53, 0.15);
    border-color: rgba(163, 230, 53, 0.4);
    color: var(--lime);
}

.rep-filter-search-box {
    min-width: 220px;
    flex: 1;
    max-width: 320px;
}

.rep-filter-input {
    width: 100%;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 7px 12px;
    color: var(--text-main);
    font-family: var(--font-main);
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.rep-filter-input:focus {
    outline: none;
    border-color: var(--lime);
    box-shadow: 0 0 0 2px var(--lime-glow);
}

.rep-filter-input::placeholder {
    color: var(--text-dim);
}

/* Replacements Table / List */
.rep-table-wrap {
    display: flex;
    flex-direction: column;
}

.rep-table-header {
    display: grid;
    grid-template-columns: 210px 190px 1fr 120px;
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid var(--border);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-dim);
}

.rep-list-row {
    display: grid;
    grid-template-columns: 210px 190px 1fr 120px;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    transition: all 0.15s ease;
    gap: 16px;
}

.rep-list-row:last-child {
    border-bottom: none;
}

.rep-list-row:hover {
    background: var(--bg-card-hover);
}

.rep-list-row.is-direct {
    background: rgba(163, 230, 53, 0.02);
}

/* Column 1: Badge */
.rep-badge-col {
    display: flex;
    align-items: center;
    gap: 6px;
}

.rep-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.rep-tag.tag-successor {
    background: rgba(163, 230, 53, 0.12);
    border: 1px solid rgba(163, 230, 53, 0.3);
    color: var(--lime);
}

.rep-tag.tag-predecessor {
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: var(--cyan);
}

.rep-tag.tag-hw-succ {
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: #fbbf24;
}

.rep-tag.tag-hw-pred {
    background: rgba(217, 119, 6, 0.12);
    border: 1px solid rgba(217, 119, 6, 0.35);
    color: #f59e0b;
}

/* Source switch tabs (ISTA 1:1 vs Hardware Family / Risk) */
.ws-source-switch {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.ws-source-tab-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 16px;
    color: var(--text-muted);
    font-family: var(--font-main);
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.ws-source-tab-btn:hover {
    color: var(--text-main);
    border-color: var(--border-light);
}

.ws-source-tab-btn.active {
    background: rgba(163, 230, 53, 0.12);
    border-color: rgba(163, 230, 53, 0.4);
    color: var(--lime);
}

.ws-source-tab-btn.active.is-risk {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.4);
    color: #fbbf24;
}

.ws-source-count {
    font-size: 0.75rem;
    padding: 2px 7px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.08);
}

.ws-source-tab-btn.active .ws-source-count {
    background: rgba(163, 230, 53, 0.25);
    color: var(--lime);
}

.ws-source-tab-btn.active.is-risk .ws-source-count {
    background: rgba(245, 158, 11, 0.25);
    color: #fbbf24;
}

/* Hardware Family / Risk Disclaimer Banner */
.ws-risk-disclaimer-card {
    background: rgba(245, 158, 11, 0.05);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-left: 4px solid #f59e0b;
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-bottom: 16px;
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.ws-risk-disclaimer-card .ws-risk-icon {
    font-size: 1.6rem;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 2px;
}

.ws-risk-disclaimer-card .ws-risk-content {
    flex: 1;
    min-width: 0;
}

.ws-risk-disclaimer-card .ws-risk-title {
    font-size: 0.98rem;
    font-weight: 800;
    color: #fbbf24;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.ws-risk-badge {
    background: rgba(245, 158, 11, 0.2);
    border: 1px solid rgba(245, 158, 11, 0.45);
    color: #fef08a;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ws-risk-disclaimer-card .ws-risk-desc {
    font-size: 0.86rem;
    line-height: 1.5;
    color: var(--text-main);
}

.ws-risk-callout {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed rgba(245, 158, 11, 0.25);
    font-size: 0.84rem;
    color: #fde68a;
    line-height: 1.45;
}

/* Column 2: Part Number */
.rep-part-col {
    display: flex;
    align-items: center;
    min-width: 0;
    white-space: nowrap;
}

.rep-part-code {
    font-family: var(--font-mono);
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    color: var(--lime);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    border-radius: 6px;
    background: rgba(163, 230, 53, 0.05);
    border: 1px solid transparent;
    transition: all 0.15s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.rep-part-code:hover {
    color: var(--lime-hover);
    background: rgba(163, 230, 53, 0.12);
    border-color: rgba(163, 230, 53, 0.3);
}

.rep-part-digits {
    font-family: var(--font-mono);
    font-weight: 800;
    white-space: nowrap;
}

.rep-part-code .copy-icon {
    font-size: 0.95rem;
    opacity: 0.45;
    transition: opacity 0.15s ease;
}

.rep-part-code:hover .copy-icon {
    opacity: 1;
}

/* Column 3: Description */
.rep-desc-col {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.rep-variant-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rep-variant-comment {
    font-size: 0.8rem;
    color: var(--text-dim);
}

/* Column 4: Action button */
.rep-action-col {
    display: flex;
    justify-content: flex-end;
}

.rep-view-btn {
    background: transparent;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    padding: 7px 14px;
    font-family: var(--font-main);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.rep-view-btn:hover {
    background: var(--lime);
    border-color: var(--lime);
    color: #000;
    box-shadow: 0 0 15px var(--lime-glow);
}

/* Empty list message */
.matrix-empty-msg {
    padding: 32px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Vehicle Applications Section */
.vehicles-section {
    margin-top: 36px;
}

.series-accordion {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.series-group {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.series-group-header {
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.02);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s ease;
}

.series-group-header:hover {
    background: rgba(255, 255, 255, 0.04);
}

.series-group-title {
    font-size: 1rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 10px;
}

.series-group-badge {
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(163, 230, 53, 0.12);
    color: var(--lime);
    font-weight: 700;
}

.series-group-count {
    font-size: 0.8rem;
    color: var(--text-dim);
}

.series-group-content {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
}

.model-pill-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.model-pill-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
}

.model-pill-desc {
    font-size: 0.8rem;
    color: var(--text-dim);
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */
@media (max-width: 768px) {
    .ws-navbar {
        padding: 10px 16px;
    }

    .ws-main {
        padding: 20px 16px 48px;
    }

    .search-card {
        padding: 20px 16px;
    }

    .search-input-wrapper {
        flex-direction: column;
    }

    .search-btn {
        padding: 14px 20px;
        justify-content: center;
    }

    .part-overview-card {
        padding: 20px 16px;
    }

    .part-number-value {
        font-size: 1.75rem;
    }

    .veh-card {
        padding: 20px 16px;
    }

    .veh-title {
        font-size: 1.35rem;
    }

    .veh-specs-grid {
        grid-template-columns: 1fr;
    }

    .rep-table-header {
        display: none;
    }

    .rep-list-row {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 16px;
    }

    .rep-action-col {
        justify-content: flex-start;
    }

    .rep-view-btn {
        width: 100%;
        text-align: center;
    }

    .rep-filter-search-box {
        max-width: 100%;
        min-width: 100%;
    }
}

/* ==========================================================================
   PRINT STYLESHEET - Dedykowany wydruk specyfikacji zamienników do A4 / PDF
   ========================================================================== */
.ws-print-sheet {
    display: none;
}

@media print {
    @page {
        size: A4 portrait;
        margin: 14mm 12mm 14mm 12mm;
    }

    *, *::before, *::after {
        box-shadow: none !important;
        text-shadow: none !important;
    }

    html, body {
        background: #ffffff !important;
        color: #000000 !important;
        font-family: Arial, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
        font-size: 10pt !important;
        line-height: 1.4 !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Ukrywamy całą aplikację warsztatową i interfejs ekranowy */
    #pinScreen,
    #workshopApp,
    .ws-navbar,
    .ws-tabs-bar,
    .search-card,
    .part-overview-card,
    .veh-card,
    .ws-source-switch,
    .ws-risk-disclaimer-card,
    .rep-list-toolbar,
    .section-subheading-wrap,
    .rep-action-col {
        display: none !important;
    }

    /* Wyświetlamy wyłącznie czysty dokument arkusza */
    .ws-print-sheet {
        display: block !important;
        width: 100% !important;
        background: #ffffff !important;
        color: #111111 !important;
        padding: 0 !important;
    }

    .print-header {
        border-bottom: 2pt solid #111111;
        padding-bottom: 12px;
        margin-bottom: 16px;
    }

    .print-logo-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 6px;
    }

    .print-brand {
        font-size: 18pt;
        font-weight: 800;
        letter-spacing: -0.5px;
        color: #000000;
    }

    .print-date {
        font-size: 8.5pt;
        color: #555555;
    }

    /* Eksponowany baner oficjalnej grupy katalogowej BMW */
    .print-catalog-group-banner {
        background: #f0f4f8;
        border: 1.5pt solid #0f172a;
        border-radius: 4px;
        padding: 8px 14px;
        margin-bottom: 12px;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .print-group-tag {
        font-size: 8pt;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        color: #334155;
    }

    .print-group-main {
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .print-group-prefix {
        font-family: Consolas, 'Courier New', monospace;
        font-size: 16pt;
        font-weight: 900;
        letter-spacing: 1.5px;
        color: #0f172a;
        background: #e2e8f0;
        padding: 2px 10px;
        border-radius: 4px;
        border: 1pt solid #cbd5e1;
    }

    .print-group-title {
        font-size: 10.5pt;
        font-weight: 800;
        color: #1e293b;
    }

    .print-meta-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px 16px;
        background: #f7f8f9;
        border: 1pt solid #d0d7de;
        border-radius: 4px;
        padding: 10px 14px;
        margin-bottom: 14px;
        font-size: 9pt;
    }

    .print-meta-item span {
        color: #555555;
        font-size: 8pt;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .print-meta-item strong {
        color: #111111;
        font-size: 9.5pt;
    }

    .print-part-no-11 {
        font-family: Consolas, 'Courier New', monospace !important;
        font-size: 10.5pt !important;
        font-weight: 800 !important;
        color: #000000 !important;
        letter-spacing: 0.5px !important;
    }

    .print-part-no-7 {
        font-family: Consolas, 'Courier New', monospace !important;
        font-size: 11pt !important;
        font-weight: 800 !important;
        color: #000000 !important;
        letter-spacing: 0.8px !important;
        white-space: nowrap !important;
    }

    .print-raw-box {
        margin-top: 16px;
        padding: 10px 14px;
        background: #f8f9fa;
        border: 1pt dashed #bbb;
        border-radius: 4px;
        font-size: 8.5pt;
        page-break-inside: avoid;
    }

    .print-raw-box-title {
        font-weight: 800;
        text-transform: uppercase;
        font-size: 7.5pt;
        letter-spacing: 0.5px;
        color: #555;
        margin-bottom: 6px;
    }

    .print-raw-numbers-grid {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
    }

    .print-raw-pill {
        font-family: Consolas, 'Courier New', monospace;
        font-size: 9.5pt;
        font-weight: 700;
        color: #111;
        background: #eef1f4;
        border: 1pt solid #d0d7de;
        padding: 2px 7px;
        border-radius: 3px;
        display: inline-block;
        white-space: nowrap;
    }

    .print-table {
        width: 100%;
        border-collapse: collapse;
        margin-top: 10px;
        font-size: 9pt;
    }

    .print-table th {
        background: #e9ecef !important;
        color: #111111 !important;
        border: 1pt solid #888888;
        padding: 7px 9px;
        text-align: left;
        font-weight: 800;
        font-size: 8.5pt;
        text-transform: uppercase;
        letter-spacing: 0.4px;
    }

    /* Poszerzona kolumna z numerami sterowników, zapobiegająca zawijaniu wierszy */
    .print-table th:nth-child(2),
    .print-table td.print-part-no-7 {
        width: 190px !important;
        min-width: 190px !important;
        max-width: 220px !important;
        white-space: nowrap !important;
        word-break: keep-all !important;
    }

    .print-table td {
        border: 1pt solid #ced4da;
        padding: 6px 9px;
        vertical-align: top;
        page-break-inside: avoid;
    }

    .print-table tr:nth-child(even) td {
        background: #fcfcfd !important;
    }

    .print-footer {
        margin-top: 24px;
        border-top: 1pt solid #cccccc;
        padding-top: 8px;
        font-size: 8pt;
        color: #666666;
        display: flex;
        justify-content: space-between;
    }
}

/* ==========================================================================
   ROEM UI ENHANCEMENTS: BRAND, BADGES, HISTORY & MODALS
   ========================================================================== */

.roem-logo-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--lime);
    color: #052e16;
    font-weight: 900;
    font-size: 1.6rem;
    letter-spacing: 2px;
    padding: 10px 24px;
    border-radius: var(--radius-md);
    box-shadow: 0 0 25px var(--lime-glow);
    font-family: var(--font-mono);
}

.ws-brand-badge {
    background: var(--lime);
    color: #052e16;
    font-weight: 900;
    font-size: 1.15rem;
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    letter-spacing: 1px;
    font-family: var(--font-mono);
}

.ws-user-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-main);
}
.ws-user-icon {
    font-size: 1.15rem;
    color: var(--lime);
}

/* Sekcja historii użytkownika (10 sterowników + 10 VIN) */
.ws-history-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}
@media (max-width: 860px) {
    .ws-history-section { grid-template-columns: 1fr; }
}
.ws-history-col {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    box-shadow: var(--shadow-card);
}
.ws-history-head {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}
.ws-history-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 32px;
    align-items: center;
}
.history-chip {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.82rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.15s ease;
    font-family: var(--font-main);
}
.history-chip:hover {
    border-color: var(--lime);
    background: var(--bg-card-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--lime-glow);
}
.history-chip-code {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--lime);
}
.history-chip-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ws-history-empty {
    font-size: 0.82rem;
    color: var(--text-dim);
    font-style: italic;
}

/* Modal zmiany PIN */
.ws-modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(5px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}
.ws-modal-overlay.active { display: flex; }
.ws-modal-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 440px;
    padding: 24px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.6);
}
.ws-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.ws-modal-header h3 { font-size: 1.15rem; font-weight: 700; color: var(--text-main); }
.ws-modal-close { cursor: pointer; border: none; background: transparent; font-size: 1.2rem; }
.ws-form-group { margin-bottom: 16px; }
.ws-form-group label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.ws-form-group input {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    box-sizing: border-box;
    font-family: var(--font-mono);
}
.ws-form-group input:focus { border-color: var(--lime); outline: none; box-shadow: 0 0 10px var(--lime-glow); }
.ws-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}
.change-pin-alert {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    margin-bottom: 16px;
}
.change-pin-alert.error { background: rgba(248, 113, 113, 0.15); border: 1px solid rgba(248, 113, 113, 0.4); color: #fca5a5; }
.change-pin-alert.success { background: rgba(163, 230, 53, 0.15); border: 1px solid rgba(163, 230, 53, 0.4); color: var(--lime); }

