/* ============================
   InsolenApp – Haupt-CSS
   ============================ */

:root {
    --primary:        #1d5fa8;
    --primary-dark:   #154d8e;
    --primary-light:  #dbeafe;
    --sidebar-bg:     #0f2847;
    --sidebar-text:   #b8cfea;
    --sidebar-active: #2d7dd2;
    --sidebar-width:  260px;
    --topbar-height:  72px;
    --border-radius:  10px;
    --shadow:         0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
    --shadow-md:      0 4px 12px rgba(0,0,0,.1);
    --body-bg:        #edf2f9;
    --card-border:    #d0dff0;
}

* { box-sizing: border-box; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #edf2f9;
    color: #1a2e4a;
    margin: 0;
}

/* ===== LAYOUT ===== */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 100;
    transition: width .25s ease, transform .25s ease;
    box-shadow: 3px 0 16px rgba(0,0,0,.22);
}

.sidebar.collapsed { width: 64px; }
.sidebar.collapsed .sidebar-brand,
.sidebar.collapsed .nav-link span,
.sidebar.collapsed .nav-section-label,
.sidebar.collapsed .user-details { display: none; }

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    background: var(--sidebar-active);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(45,125,210,.4);
}

.brand-name {
    display: block;
    color: #f8fafc;
    font-weight: 700;
    font-size: 1.05rem;
    line-height: 1.2;
}

.brand-firma {
    display: block;
    color: #94a3b8;
    font-size: 0.72rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 170px;
}

/* Nav */
.nav-list {
    list-style: none;
    margin: 0;
    padding: 12px 0;
    flex: 1;
    overflow-y: auto;
}

.nav-section-label {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #475569;
    padding: 12px 16px 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: 0;
    font-size: 0.9rem;
    transition: background .15s, color .15s;
    margin: 1px 8px;
    border-radius: 8px;
}

.nav-link i { font-size: 1.05rem; flex-shrink: 0; }

.nav-link:hover {
    background: rgba(255,255,255,.08);
    color: #f1f5f9;
}

.nav-link.active {
    background: var(--sidebar-active);
    color: #fff;
    font-weight: 500;
}

.nav-link-primary {
    background: rgba(37,99,235,.25) !important;
    color: #93c5fd !important;
    border: 1px solid rgba(59,130,246,.3);
    margin-top: 6px;
}
.nav-link-primary:hover { background: rgba(37,99,235,.4) !important; }
.nav-link-primary.active { background: var(--primary) !important; color: #fff !important; }

/* Versionsnummer */
.nav-version {
    font-size: 0.65rem;
    color: rgba(255,255,255,.25);
    text-align: center;
    padding: 6px 0 2px;
    letter-spacing: 0.03em;
}
.sidebar.collapsed .nav-version { display: none; }

/* Sidebar Footer */
.sidebar-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-top: 1px solid rgba(255,255,255,.08);
}

.user-avatar { font-size: 1.6rem; color: #64748b; flex-shrink: 0; }

.user-name {
    display: block;
    color: #e2e8f0;
    font-size: 0.85rem;
    font-weight: 500;
}

.user-role {
    display: block;
    color: #64748b;
    font-size: 0.72rem;
}

.btn-logout {
    margin-left: auto;
    color: #64748b;
    font-size: 1.2rem;
    text-decoration: none;
    transition: color .15s;
}
.btn-logout:hover { color: #ef4444; }

/* ===== MAIN CONTENT ===== */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left .25s ease;
}

.main-content.sidebar-collapsed {
    margin-left: 64px;
}

.topbar {
    height: var(--topbar-height);
    background: linear-gradient(100deg, #0f2847 0%, #1a5a96 55%, #2980b9 100%);
    border-bottom: none;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 20px 0 24px;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 2px 12px rgba(15,40,80,.3);
}

.topbar-logo {
    height: 52px;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
    margin-left: auto;
}

.topbar-breadcrumb { color: rgba(255,255,255,.75) !important; font-size: 0.88rem; }
.topbar-breadcrumb .text-muted { color: rgba(255,255,255,.75) !important; }

.btn-patientenakte {
    background: transparent;
    border: 1.5px solid #4a6080;
    color: #2d3e52;
    font-weight: 500;
}
.btn-patientenakte:hover { background: #e8ecf2; border-color: #2d3e52; color: #1a2a3a; }
.badge-patientenakte { background: #2d3e52; color: #fff; font-weight: 600; }

.btn-toggle-sidebar {
    background: rgba(255,255,255,.12);
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: #fff;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background .15s;
}
.btn-toggle-sidebar:hover { background: rgba(255,255,255,.22); }

.page-content {
    padding: 28px 28px;
    flex: 1;
    background: linear-gradient(160deg, #e1e0e0 0%, #cfcfcf 100%);
    min-height: calc(100vh - var(--topbar-height));
}

/* ===== PAGE HEADER ===== */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #12355e;
    margin: 0;
}

.page-subtitle {
    color: #64748b;
    margin: 2px 0 0;
    font-size: 0.9rem;
}

/* ===== CARDS ===== */
.card {
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius);
    box-shadow: 0 1px 4px rgba(15,50,100,.07);
    background: #fff;
    /* overflow: visible – Dropdowns/Selects dürfen über den Kartenrand hinausgehen.
       Karten mit Flush-Tabellen erhalten overflow:hidden per inline-style oder .card-table-flush */
}
/* Karten mit randloser Tabelle brauchen overflow:hidden für die border-radius-Ecken */
.card.card-table-flush { overflow: hidden; }

.card-header {
    background: linear-gradient(to right, #f4f8fd, #eef4fc);
    border-bottom: 1px solid var(--card-border);
    padding: 14px 20px;
    border-radius: var(--border-radius) var(--border-radius) 0 0 !important;
}

.card-title { font-weight: 600; color: #1a3660; }

.card-footer {
    background: #f4f8fd;
    border-top: 1px solid var(--card-border);
    padding: 10px 20px;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

/* ===== STAT CARDS ===== */
.stat-card {
    background: #fff;
    border-radius: var(--border-radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: var(--shadow);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.stat-card-primary .stat-icon { background: #dbeafe; color: var(--primary); }
.stat-card-success .stat-icon { background: #dcfce7; color: #16a34a; }
.stat-card-warning .stat-icon { background: #fef3c7; color: #d97706; }
.stat-card-info .stat-icon { background: #dcfce7; color: #2e9e46; }
.badge-abholung { background: #71d77c !important; color: #1a2e4a !important; }

.stat-value { font-size: 2rem; font-weight: 700; line-height: 1; color: #12355e; }
.stat-label { color: #64748b; font-size: 0.85rem; margin-top: 2px; }

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    color: #94a3b8;
}
.empty-state i { font-size: 3rem; display: block; margin-bottom: 12px; }
.empty-state p { margin-bottom: 16px; }

/* ===== LOGIN ===== */
.login-page {
    min-height: 100vh;
    width: 100%;
    display: flex;
    flex-direction: row;
    background-image: url('/img/login-bg.jpg');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-color: #1a3a55; /* Fallback wenn kein Bild */
}

/* Linke Seite: Logo + Tagline */
.login-left {
    flex: 0 0 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 60px 40px 60px 260px;
}

.login-logo-img {
    max-width: 420px;
    max-height: 220px;
    width: auto;
    height: auto;
    object-fit: contain;
    margin-bottom: 36px;
    filter: drop-shadow(0 4px 20px rgba(0,0,0,0.5));
}

.login-tagline {
    text-align: left;
}

.login-tagline-title {
    font-size: 2.8rem !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    border-bottom: 3px solid #7ecef4;
    padding-bottom: 10px;
    margin: 0 0 16px 0 !important;
    display: inline-block;
    text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

.login-tagline-text {
    color: #ffffff !important;
    font-size: 1.2rem !important;
    line-height: 1.7;
    max-width: 420px;
    margin: 0;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

/* Rechte Seite: Formular */
.login-right {
    flex: 0 0 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 100px 40px 20px;
}

/* Karte — feste dunkle Farbe als Fallback + Glaseffekt darüber */
.login-card {
    background-color: #0e3a5e !important; /* solide Fallback-Farbe */
    background: rgba(10, 45, 80, 0.88) !important;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255,255,255,0.2) !important;
    border-radius: 20px !important;
    padding: 44px 40px;
    width: 100%;
    max-width: 410px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5) !important;
    color: #fff !important;
}

.login-card * { color: inherit; }

.login-card-title {
    text-align: center;
    color: #7ecef4 !important;
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 28px;
}

.login-label {
    color: #ffffff !important;
    font-weight: 500;
    margin-bottom: 5px;
    display: block;
    font-size: 0.9rem;
}

.login-input,
.login-input.form-control {
    background: rgba(255,255,255,0.92) !important;
    border: none !important;
    border-radius: 6px !important;
    color: #0f2235 !important;
    font-size: 0.95rem;
}

.login-input:focus,
.login-input.form-control:focus {
    background: #fff !important;
    box-shadow: 0 0 0 3px rgba(126,206,244,0.5) !important;
    outline: none !important;
}

.login-eye-btn {
    background: rgba(255,255,255,0.92) !important;
    border: none !important;
    border-left: 1px solid rgba(0,0,0,0.1) !important;
    color: #444 !important;
    padding: 0 14px;
}
.login-eye-btn:hover { background: #fff !important; color: #0e3a5e !important; }

/* Anmelden-Button — gut sichtbar */
button.btn-login,
.btn.btn-login {
    display: block !important;
    width: 100% !important;
    background-color: #1e88e5 !important;
    background: #1e88e5 !important;
    border: none !important;
    color: #ffffff !important;
    padding: 12px 0 !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
    letter-spacing: 0.04em;
    transition: background-color 0.2s;
    cursor: pointer;
}

button.btn-login:hover:not(:disabled),
.btn.btn-login:hover:not(:disabled) {
    background-color: #1565c0 !important;
    background: #1565c0 !important;
    color: #fff !important;
}

button.btn-login:disabled,
.btn.btn-login:disabled { opacity: 0.65 !important; cursor: not-allowed; }

.login-demo-hint {
    margin-top: 18px;
    text-align: center;
    color: rgba(255,255,255,0.55) !important;
    font-size: 0.82rem;
}
.login-demo-hint strong { color: rgba(255,255,255,0.82) !important; }
.login-demo-hint i { color: rgba(255,255,255,0.55) !important; }

/* Alert im Login */
.login-card .alert-danger {
    background: rgba(220,53,69,0.25) !important;
    border-color: rgba(220,53,69,0.5) !important;
    color: #ffc0c0 !important;
}

/* Responsive */
@media (max-width: 860px) {
    .login-page { flex-direction: column; }
    .login-left {
        flex: none;
        padding: 36px 30px 20px;
        align-items: center;
        text-align: center;
    }
    .login-logo-img { max-width: 180px; max-height: 80px; margin-bottom: 24px; }
    .login-right { flex: none; padding: 0 20px 40px; }
    .login-tagline-title { font-size: 1.5rem !important; }
}

/* ===== ZUBEHÖR DRAG & DROP ===== */
.zubehoer-sortlist { user-select: none; }

.zubehoer-item {
    transition: background 0.15s, box-shadow 0.15s, opacity 0.15s;
    cursor: default;
}

.zubehoer-drag-handle {
    color: #94a3b8;
    cursor: grab;
    font-size: 1rem;
    padding: 2px 2px;
    flex-shrink: 0;
    transition: color 0.15s;
}
.zubehoer-drag-handle:hover { color: #2563eb; }
.zubehoer-drag-handle:active { cursor: grabbing; }

.zubehoer-item.dragging {
    opacity: 0.4;
    box-shadow: inset 0 0 0 2px #93c5fd;
    background: #eff6ff;
}

.zubehoer-item.drag-over {
    background: #dbeafe;
    box-shadow: 0 -3px 0 0 #2563eb inset;
}

/* ===== FEHLSTELLUNGEN BILDKARTEN ===== */
.fehlst-img-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.fehlst-card {
    position: relative;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    padding: 8px 6px 6px;
    text-align: center;
    cursor: pointer;
    transition: all 0.18s ease;
    background: #fff;
    user-select: none;
}

.fehlst-card:hover {
    border-color: var(--primary);
    background: #eff6ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37,99,235,0.15);
}

.fehlst-card.selected {
    border-color: var(--primary);
    border-width: 2.5px;
    background: #dbeafe;
}

.fehlst-card img {
    width: 100%;
    height: 72px;
    object-fit: contain;
    pointer-events: none;
}

.fehlst-card span {
    display: block;
    font-size: 0.72rem;
    font-weight: 500;
    margin-top: 5px;
    color: #374151;
    line-height: 1.2;
}

.fehlst-card.selected span { color: var(--primary); font-weight: 600; }

.fehlst-check {
    position: absolute;
    top: 4px;
    right: 4px;
    color: var(--primary);
    font-size: 0.9rem;
}

/* ===== BEGLEITBESCHWERDEN BILDKARTEN ===== */
.beschwerd-group-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    margin: 0 0 6px 2px;
}

.beschwerd-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

.beschwerd-card {
    position: relative;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    padding: 8px 6px 6px;
    text-align: center;
    cursor: pointer;
    transition: all 0.18s ease;
    background: #fff;
    user-select: none;
}

.beschwerd-card:hover {
    border-color: #ef4444;
    background: #fff5f5;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239,68,68,0.15);
}

.beschwerd-card.selected {
    border-color: #ef4444;
    border-width: 2.5px;
    background: #fee2e2;
}

.beschwerd-card img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    pointer-events: none;
}

.beschwerd-card span {
    display: block;
    font-size: 0.7rem;
    font-weight: 500;
    margin-top: 5px;
    color: #374151;
    line-height: 1.2;
}

.beschwerd-card.selected span { color: #dc2626; font-weight: 700; }

.beschwerd-seite {
    position: absolute;
    top: 4px;
    left: 6px;
    font-size: 0.6rem;
    font-weight: 800;
    color: #64748b;
    background: #f1f5f9;
    border-radius: 4px;
    padding: 1px 4px;
    line-height: 1.4;
}

.beschwerd-card.selected .beschwerd-seite {
    background: #fecaca;
    color: #dc2626;
}

.beschwerd-check {
    position: absolute;
    top: 4px;
    right: 4px;
    color: #ef4444;
    font-size: 0.9rem;
}

/* ===== WIZARD ===== */
.wizard-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    overflow-x: auto;
    padding: 8px 0;
}

.wizard-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.wizard-step-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background .2s, color .2s;
}

.wizard-step.active .wizard-step-circle {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 0 0 4px rgba(37,99,235,.2);
}

.wizard-step.done .wizard-step-circle {
    background: #1565c0;
    color: #fff;
}

.wizard-step-label {
    font-size: 0.72rem;
    color: #94a3b8;
    white-space: nowrap;
}
.wizard-step.active .wizard-step-label { color: var(--primary); font-weight: 600; }
.wizard-step.done .wizard-step-label { color: #1565c0; }
.wizard-step.clickable { cursor: pointer; }
.wizard-step.clickable:hover .wizard-step-circle { background: #0d47a1; transform: scale(1.1); transition: transform .15s; }
.wizard-step.clickable:hover .wizard-step-label { color: #0d47a1; }

.wizard-step-line {
    flex: 1;
    height: 2px;
    background: #e2e8f0;
    min-width: 20px;
    max-width: 60px;
    margin-bottom: 22px;
    transition: background .2s;
}
.wizard-step-line.done { background: #1565c0; }

.wizard-card { border-radius: var(--border-radius); }
.wizard-card .card-body { padding: 28px; }

/* ===== FUSS-KARTEN ===== */
.fuss-karte {
    border-radius: var(--border-radius);
    border: 2px solid #e2e8f0;
    overflow: hidden;
    height: 100%;
}
.fuss-links { border-color: #93c5fd; }
.fuss-rechts { border-color: #86efac; }

.fuss-karte-header {
    padding: 10px 16px;
    font-size: 0.9rem;
    font-weight: 600;
}
.fuss-links .fuss-karte-header { background: #dbeafe; color: #1d4ed8; }
.fuss-rechts .fuss-karte-header { background: #dcfce7; color: #15803d; }

.fuss-karte-body { padding: 16px; }

/* ===== FEHLSTELLUNGEN ===== */
.fehlstellung-grid { display: flex; flex-direction: column; gap: 6px; }

.fehlstellung-check {
    padding: 6px 10px;
    border-radius: 6px;
    transition: background .15s;
}
.fehlstellung-check:hover { background: #f8fafc; }
.fehlstellung-check.checked { background: #fef3c7; }

/* ===== PRODUKTKONFIGURATOR ===== */

.konfig-progress { display: flex; align-items: center; }
.konfig-step { display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 64px; }
.konfig-step-dot {
    width: 34px; height: 34px; border-radius: 50%;
    border: 2px solid #cbd5e1; background: #fff; color: #94a3b8;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.85rem; font-weight: 600; transition: all 0.2s;
}
.konfig-step.active .konfig-step-dot { border-color: var(--primary,#2563eb); background: var(--primary,#2563eb); color: #fff; box-shadow: 0 0 0 4px rgba(37,99,235,0.15); }
.konfig-step.done  .konfig-step-dot  { border-color: #1565c0; background: #1565c0; color: #fff; }
.konfig-step-label { font-size: 0.72rem; color: #94a3b8; font-weight: 500; white-space: nowrap; }
.konfig-step.active .konfig-step-label { color: var(--primary,#2563eb); font-weight: 600; }
.konfig-step.done  .konfig-step-label { color: #1565c0; }
.konfig-step-line { flex: 1; height: 2px; background: #e2e8f0; margin-bottom: 22px; transition: background 0.2s; min-width: 10px; }
.konfig-step-line.done { background: #1565c0; }

/* Erreichbarer (bereits besuchter) Schritt – klickbar */
.konfig-step.erreichbar { cursor: pointer; }
.konfig-step.erreichbar .konfig-step-dot {
    border-color: #1565c0;
    background: #1565c0;
    color: #fff;
    transition: all 0.2s;
}
.konfig-step.erreichbar:hover .konfig-step-dot {
    background: var(--primary,#2563eb);
    border-color: var(--primary,#2563eb);
    box-shadow: 0 0 0 4px rgba(37,99,235,0.18);
    transform: scale(1.1);
}
.konfig-step.erreichbar .konfig-step-label { color: #1565c0; }
.konfig-step.erreichbar:hover .konfig-step-label { color: var(--primary,#2563eb); }

/* Kacheln allgemein */
.konfig-kachel {
    position: relative; border: 2px solid #e2e8f0; border-radius: 12px;
    padding: 20px 12px 16px; text-align: center; cursor: pointer;
    background: #fff; transition: all 0.2s; height: 100%;
    display: flex; flex-direction: column; align-items: center; gap: 6px; user-select: none;
}
.konfig-kachel:hover { border-color: #93c5fd; background: #f0f7ff; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(37,99,235,0.1); }
.konfig-kachel.selected { border-color: var(--primary,#2563eb); background: #eff6ff; box-shadow: 0 0 0 3px rgba(37,99,235,0.15); }
.konfig-kachel-check { position: absolute; top: 8px; right: 8px; color: var(--primary,#2563eb); font-size: 1.15rem; line-height: 1; }
.konfig-kachel-icon { font-size: 2.2rem; color: #94a3b8; }
.konfig-kachel.selected .konfig-kachel-icon { color: var(--primary,#2563eb); }
.konfig-kachel-code { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; background: #e2e8f0; color: #475569; padding: 2px 8px; border-radius: 10px; text-transform: uppercase; }
.konfig-kachel.selected .konfig-kachel-code { background: rgba(37,99,235,0.12); color: var(--primary,#2563eb); }
.konfig-kachel-name { font-size: 0.85rem; font-weight: 600; color: #344054; line-height: 1.3; }
.konfig-kachel-preis { font-size: 0.78rem; color: #64748b; }

/* Zusatz-Karten */
.konfig-zusatz-karte { border: 2px solid #e2e8f0; border-radius: 10px; padding: 14px 16px; background: #fff; transition: border-color 0.15s, background 0.15s; height: 100%; }
.konfig-zusatz-karte.selected { border-color: var(--primary,#2563eb); background: #eff6ff; }
.konfig-lr-toggle {
    width: 36px; height: 36px; border-radius: 8px; border: 2px solid #cbd5e1;
    background: #f8fafc; color: #64748b; display: flex; align-items: center;
    justify-content: center; font-weight: 700; font-size: 0.88rem;
    cursor: pointer; transition: all 0.15s; user-select: none;
}
.konfig-lr-toggle:hover { border-color: #93c5fd; background: #eff6ff; }
.konfig-lr-toggle.aktiv { border-color: var(--primary,#2563eb); background: var(--primary,#2563eb); color: #fff; }

/* Schuh-Karten */
.konfig-schuh-karte {
    position: relative; border: 2px solid #e2e8f0; border-radius: 10px;
    padding: 12px; text-align: center; cursor: pointer; background: #fff;
    transition: all 0.2s; user-select: none;
}
.konfig-schuh-karte:hover { border-color: #93c5fd; background: #f0f7ff; }
.konfig-schuh-karte.selected { border-color: var(--primary,#2563eb); background: #eff6ff; box-shadow: 0 0 0 3px rgba(37,99,235,0.15); }

/* Kategorie-Karten */
.konfig-kat-karte {
    position: relative; border: 2px solid #e2e8f0; border-radius: 12px;
    overflow: hidden; cursor: pointer; background: #fff; transition: all 0.2s;
    height: 100%; display: flex; flex-direction: column; user-select: none;
}
.konfig-kat-karte:hover { border-color: #93c5fd; transform: translateY(-2px); box-shadow: 0 4px 16px rgba(37,99,235,0.1); }
.konfig-kat-karte.selected { border-color: var(--primary,#2563eb); box-shadow: 0 0 0 3px rgba(37,99,235,0.15); }
.konfig-kat-karte.highlight.selected { border-color: var(--primary,#2563eb); box-shadow: 0 0 0 3px rgba(37,99,235,0.15); }
.konfig-kat-highlight-badge {
    position: absolute; top: 10px; left: 10px; z-index: 3;
    background: linear-gradient(90deg, #f59e0b, #d97706);
    color: #fff; font-size: 0.72rem; font-weight: 700;
    padding: 3px 10px; border-radius: 20px;
    letter-spacing: 0.03em;
    box-shadow: 0 2px 6px rgba(245,158,11,0.4);
}
.konfig-kat-bild { height: 160px; background: #ffffff; border-bottom: 1px solid #e2e8f0; display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 8px; }
.konfig-kat-bild img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.konfig-kat-bild-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.konfig-kat-body { padding: 12px 14px; flex-grow: 1; background: #f3f5f8; }
.konfig-kat-kategorie { font-size: 1.05rem; text-transform: uppercase; letter-spacing: 0.06em; color: #4a6fa5; font-weight: 700; margin-bottom: 6px; }
.konfig-kat-text { font-size: 0.85rem; color: #344054; line-height: 1.4; margin-top: 2px; }
.konfig-kat-preise { display: flex; flex-wrap: wrap; gap: 4px; }

/* Leistungs-Badges (Kasse / Privat) */
.konfig-leistung-badge {
    display: inline-flex; align-items: center; font-size: 0.75rem; font-weight: 600;
    padding: 3px 10px; border-radius: 12px; white-space: nowrap;
}
.konfig-leistung-badge.kasse  { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.konfig-leistung-badge.privat { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }

/* Modell-Karten */
.konfig-modell-karte {
    position: relative; border: 2px solid #e2e8f0; border-radius: 12px;
    overflow: hidden; cursor: pointer; background: #fff; transition: all 0.2s;
    height: 100%; display: flex; flex-direction: column; user-select: none;
}
.konfig-modell-karte:hover { border-color: #93c5fd; transform: translateY(-2px); box-shadow: 0 4px 16px rgba(37,99,235,0.1); }
.konfig-modell-karte.selected { border-color: var(--primary,#2563eb); box-shadow: 0 0 0 3px rgba(37,99,235,0.15); }
.konfig-modell-bild {
    height: 160px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 10px 10px 0 0;
}
.konfig-modell-bild img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 12px;
    transition: opacity 0.2s ease;
}
.konfig-modell-bild-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.konfig-modell-body { padding: 12px 14px; flex-grow: 1; }

/* Zoom-Button auf Einlagenkarte */
.konfig-zoom-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 3;
    background: rgba(255,255,255,0.85);
    border: none;
    border-radius: 6px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: #2563eb;
    opacity: 0;
    cursor: pointer;
    transition: opacity 0.2s, background 0.15s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
.konfig-modell-karte:hover .konfig-zoom-btn { opacity: 1; }
.konfig-zoom-btn:hover { background: #2563eb; color: #fff; }

/* ── Zubehör Bild-Zoom ── */
.konfig-zub-zoom {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    width: min(80vw, 520px);
    box-shadow: 0 20px 60px rgba(15,40,80,0.25);
    animation: lbSlideUp 0.22s cubic-bezier(.22,.68,0,1.2);
}
.konfig-zub-zoom-body {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: #fff;
    min-height: 200px;
}
.konfig-zub-zoom-body img {
    max-width: 100%;
    max-height: 60vh;
    object-fit: contain;
    border-radius: 8px;
}

/* ── Lightbox ── */
.konfig-lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: rgba(15,40,80,0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: lbFadeIn 0.2s ease;
    backdrop-filter: blur(4px);
}
@keyframes lbFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.konfig-lightbox {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    width: min(90vw, 820px);
    max-height: 92vh;
    box-shadow: 0 24px 80px rgba(15,40,80,0.25);
    animation: lbSlideUp 0.25s cubic-bezier(.22,.68,0,1.2);
}
@keyframes lbSlideUp {
    from { transform: translateY(30px) scale(0.97); opacity: 0; }
    to   { transform: translateY(0) scale(1); opacity: 1; }
}

.konfig-lightbox-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: linear-gradient(to right, #1a3660, #2563eb);
    color: #fff;
    flex-shrink: 0;
}
.konfig-lightbox-close {
    background: rgba(255,255,255,0.15);
    border: none;
    border-radius: 8px;
    color: #fff;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.15s;
}
.konfig-lightbox-close:hover { background: rgba(255,255,255,0.3); }

.konfig-lightbox-bild-wrap {
    position: relative;
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    overflow: hidden;
}

.konfig-lightbox-bild-frame {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 380px;
    max-height: 60vh;
    overflow: hidden;
}

/* Ken-Burns-Effekt */
.konfig-lightbox-img.kenburns {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    animation: kenburns 8s ease-in-out forwards;
}
@keyframes kenburns {
    0%   { transform: scale(1)    translate(0, 0); }
    50%  { transform: scale(1.08) translate(-1%, 1%); }
    100% { transform: scale(1.04) translate(1%, -0.5%); }
}

.konfig-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    background: rgba(37,99,235,0.12);
    border: 1px solid rgba(37,99,235,0.2);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1a3660;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background 0.15s, transform 0.15s;
}
.konfig-lightbox-nav.left  { left: 14px; }
.konfig-lightbox-nav.right { right: 14px; }
.konfig-lightbox-nav:hover {
    background: rgba(37,99,235,0.18);
    transform: translateY(-50%) scale(1.1);
}

.konfig-lightbox-thumbs {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    background: #f4f8fd;
    border-top: 1px solid #dde6f0;
    overflow-x: auto;
    flex-shrink: 0;
    justify-content: center;
}
.konfig-lightbox-thumb {
    width: 64px;
    height: 48px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    opacity: 0.55;
    border: 2px solid transparent;
    transition: opacity 0.2s, border-color 0.2s, transform 0.15s;
    flex-shrink: 0;
}
.konfig-lightbox-thumb:hover  { opacity: 0.85; transform: scale(1.05); }
.konfig-lightbox-thumb.active { opacity: 1; border-color: #2563eb; }

/* Slideshow-Navigation */
.konfig-modell-slide-nav {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.konfig-modell-karte:hover .konfig-modell-slide-nav {
    opacity: 1;
}
.konfig-slide-btn {
    pointer-events: all;
    background: rgba(255,255,255,0.92);
    border: none;
    color: #1e40af;
    font-size: 1rem;
    width: 32px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
    transition: background 0.15s, color 0.15s, transform 0.15s;
    flex-shrink: 0;
}
.konfig-slide-btn:first-child {
    border-radius: 0 8px 8px 0;
}
.konfig-slide-btn:last-child {
    border-radius: 8px 0 0 8px;
}
.konfig-slide-btn:hover {
    background: #2563eb;
    color: #fff;
    transform: scaleY(1.05);
}
.konfig-slide-dots {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    align-items: center;
    pointer-events: none;
}
.konfig-slide-dots .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    transition: all 0.2s;
}
.konfig-slide-dots .dot.active {
    background: #fff;
    width: 18px;
    border-radius: 3px;
}

/* Pill-Inhalte */
.konfig-pill-name { }
.konfig-pill-preis { font-size: 0.72rem; font-weight: 600; opacity: 0.75; }
.konfig-zubehoer-pill.selected .konfig-pill-preis { opacity: 1; }
.konfig-pill-check { color: var(--primary,#2563eb); font-size: 0.85rem; margin-left: 2px; }
.konfig-zubehoer-pill.selected .konfig-pill-check { color: var(--primary,#2563eb); }

/* Pill mit Bild */
.konfig-zubehoer-pill.mit-bild {
    flex-direction: column;
    align-items: center;
    padding: 10px 12px 8px;
    min-width: 120px;
    gap: 6px;
}
.konfig-pill-bild-wrap {
    position: relative;
    cursor: zoom-in;
    border-radius: 6px;
    overflow: hidden;
    display: block;
    line-height: 0;
}
.konfig-pill-zoom-overlay {
    position: absolute;
    inset: 0;
    background: rgba(37,99,235,0.0);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.3rem;
    opacity: 0;
    transition: opacity 0.18s, background 0.18s;
}
.konfig-pill-bild-wrap:hover .konfig-pill-zoom-overlay {
    opacity: 1;
    background: rgba(37,99,235,0.45);
}
.konfig-pill-img {
    width: 100px;
    height: 75px;
    object-fit: contain;
    border-radius: 6px;
    background: #f1f5f9;
    display: block;
}
.konfig-zubehoer-pill.mit-bild .konfig-pill-name {
    font-size: 0.78rem;
    text-align: center;
    line-height: 1.2;
}
.konfig-zubehoer-pill.mit-bild .konfig-pill-preis {
    font-size: 0.68rem;
}

/* Zubehör-Bild in Einstellungen */
.zubehoer-bild-vorschau {
    position: relative;
    width: 64px;
    height: 48px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}
.zubehoer-bild-vorschau img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.zubehoer-bild-delete {
    position: absolute;
    top: -1px;
    right: -1px;
    background: #ef4444;
    border: none;
    border-radius: 0 4px 0 4px;
    color: #fff;
    width: 16px;
    height: 16px;
    font-size: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}
.zubehoer-bild-delete:hover { background: #dc2626; }

/* Zubehör-Pills */
.konfig-zubehoer-label { font-size: 0.75rem; font-weight: 700; color: #6c757d; text-transform: uppercase; letter-spacing: 0.05em; }
.konfig-zubehoer-pill {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 7px 16px; border-radius: 20px; border: 2px solid #e2e8f0;
    background: #f8fafc; color: #344054; font-size: 0.85rem; font-weight: 500;
    cursor: pointer; transition: all 0.15s; user-select: none;
}
.konfig-zubehoer-pill:hover { border-color: #93c5fd; background: #eff6ff; }
.konfig-zubehoer-pill.selected { border-color: var(--primary,#2563eb); background: #eff6ff; color: var(--primary,#2563eb); font-weight: 600; }

/* ===== PATIENTENAKTE POPUP ===== */
.pa-modal-body {
    padding: 28px 28px 24px 28px;
    background: #fff;
    color: #212529;
    max-height: 75vh;
    overflow-y: auto;
}
.pa-section {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 16px;
}
.pa-section:last-child { margin-bottom: 0; }
.pa-section-header {
    display: flex;
    align-items: center;
    padding: 11px 18px;
    background: #f8f9fa;
    cursor: pointer;
    user-select: none;
    font-weight: 600;
    color: #344054;
    font-size: 0.9rem;
    transition: background 0.15s;
}
.pa-section-header:hover { background: #e9ecef; }
.pa-section-body {
    padding: 20px 22px;
    background: #fff;
    border-top: 1px solid #dee2e6;
}
.pa-section-body .row { row-gap: 14px; }
.pa-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #6c757d;
    margin-bottom: 3px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* ===== KUNDENLISTE ===== */
.kunden-liste { border: 1px solid #e2e8f0; border-radius: 8px; }

.kunden-item {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: background .15s;
}
.kunden-item:last-child { border-bottom: none; }
.kunden-item:hover { background: #f8fafc; }
.kunden-item.selected { background: #dbeafe; border-left: 3px solid var(--primary); }

/* ===== ZUSAMMENFASSUNG ===== */
.summary-block {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    height: 100%;
}
.summary-block-header {
    background: #f8fafc;
    padding: 8px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
    border-bottom: 1px solid #e2e8f0;
}
.summary-block-body { padding: 14px; }
.summary-block-body dl { margin: 0; }
.summary-block-body dt { font-weight: 500; color: #64748b; font-size: 0.8rem; }
.summary-block-body dd { margin-bottom: 6px; }

/* ===== UNTERSCHRIFT ===== */
.signature-canvas-wrapper {
    position: relative;
    display: inline-block;
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    overflow: hidden;
    cursor: crosshair;
    background: #f8fafc;
    width: 100%;
    max-width: 750px;
}

.signature-canvas {
    display: block;
    width: 100%;
    height: 250px;
    touch-action: none;
}

.signature-hint {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    color: #cbd5e1;
    font-size: 0.8rem;
    pointer-events: none;
    white-space: nowrap;
}

/* ===== MODAL OVERLAY ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-overlay .modal-dialog {
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    margin: 0;
}

/* ===== TABELLEN ===== */
.table th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: .05em; color: #64748b; }
.table td { font-size: 0.9rem; }

/* ===== SCAN-CANVAS ===== */
.scan-toolbar .card-body { background: #f8fafc; }

.scan-canvas-wrapper {
    position: relative;
    background: #1e293b;
    border-radius: 8px;
    overflow: hidden;
    height: 380px;
    cursor: grab;
    user-select: none;
}
.scan-canvas-wrapper:active { cursor: grabbing; }

.scan-canvas {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.scan-canvas.scan-loading { opacity: .4; }

.scan-canvas-controls {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 10;
}
.scan-canvas-controls .btn {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}

.scan-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #fff;
    font-size: 0.9rem;
    background: rgba(0,0,0,.4);
    pointer-events: none;
}

.scan-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #475569;
    pointer-events: none;
}
.scan-placeholder i { font-size: 3rem; opacity: .3; }
.scan-placeholder span { font-size: 0.85rem; }

.threshold-block {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 12px;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
.spin { display: inline-block; animation: spin .8s linear infinite; }

/* ===== KONFIG-PREISBALKEN ===== */
.konfig-preisbalken {
    display: flex;
    align-items: stretch;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}
.konfig-pb-pos {
    flex: 1;
    padding: 9px 14px;
    border-right: 1px solid #e2e8f0;
}
.konfig-pb-label {
    font-size: 0.72rem;
    color: #6b7280;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: .02em;
}
.konfig-pb-betrag {
    font-weight: 600;
    color: #111827;
    font-size: 0.95rem;
    font-variant-numeric: tabular-nums;
    margin-top: 1px;
}
.konfig-pb-gesamt {
    background: linear-gradient(135deg, #1a5a96, #12355e);
    color: #fff;
    padding: 9px 18px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 140px;
    flex-shrink: 0;
}
.konfig-pb-gesamt-label {
    font-size: 0.7rem;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: .02em;
    white-space: nowrap;
}
.konfig-pb-gesamt-betrag {
    font-size: 1.1rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    margin-top: 1px;
}
/* Pauschalpreis: großer Preis auf Kategorie-Karte */
.konfig-kat-pauschalpreis {
    font-size: 1.35rem;
    font-weight: 700;
    color: #1e40af;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}
.konfig-kat-pauschalpreis-hint {
    font-size: 0.72rem;
    color: #9ca3af;
}

/* ===== RESPONSIVE – Tablet (769px–1100px) ===== */
@media (min-width: 769px) and (max-width: 1100px) {
    /* Sidebar automatisch auf Icon-Breite reduzieren */
    .sidebar { width: 64px; }
    .sidebar .sidebar-brand,
    .sidebar .nav-link span,
    .sidebar .nav-section-label,
    .sidebar .user-details { display: none; }
    .main-content { margin-left: 64px; }

    /* Seiteninhalte weniger Padding */
    .page-content { padding: 16px; }

    /* Page-header */
    .page-title { font-size: 1.1rem; }
    .page-header { flex-wrap: wrap; gap: 8px; }

    /* Wizard */
    .wizard-step-label { font-size: 0.65rem; }
    .wizard-card .card-body { padding: 18px; }
    .wizard-step-circle { width: 30px; height: 30px; font-size: 0.8rem; }
    .wizard-step-line { max-width: 36px; }

    /* Produktkonfigurator Fortschritt */
    .konfig-step-label { font-size: 0.65rem; }
    .konfig-step { min-width: 50px; }

    /* Scan-Layout: Sidebar schmal halten */
    .scan-sidebar { width: 170px !important; }

    /* Auftragsübersicht: Aktionsspalte anpassen */
    .table th, .table td { padding: .4rem .5rem; font-size: 0.82rem; }

    /* Druckvorschau: Canvase scrollen */
    .druckvorschau-sidebar { width: 220px; }

    /* Einstellungen-Grid schmaler */
    .scanner-card { min-width: 0; }

    /* Stat-Karten */
    .stat-value { font-size: 1.5rem; }
    .stat-icon { width: 44px; height: 44px; font-size: 1.2rem; }

    /* Nav-Tabs in Einstellungen */
    .nav-tabs .nav-link { font-size: 0.82rem; padding: 6px 10px; }

    /* Einstellungen-Daten: Sidebar-Nav kompakt */
    .einstellungen-nav .nav-link { font-size: 0.82rem; padding: 6px 8px; }
    .einstellungen-nav .nav-link i { font-size: 0.9rem; }
}

/* ===== RESPONSIVE – Mobil (<= 768px) ===== */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .page-content { padding: 12px; }

    /* Page-Header: Wrap + kleinere Titel/Buttons */
    .page-header { flex-wrap: wrap; gap: 8px; }
    .page-title { font-size: 1rem; }
    .page-header .btn { font-size: 0.82rem; }

    /* Wizard Fortschritt */
    .wizard-step-label { display: none; }
    .wizard-step-circle { width: 28px; height: 28px; font-size: 0.75rem; }
    .wizard-step-line { min-width: 6px; max-width: 20px; }
    .wizard-card .card-body { padding: 14px; }
    .wizard-card .card-footer { padding: 10px 14px; }

    /* Produktkonfigurator Fortschritt */
    .konfig-step-label { display: none; }
    .konfig-step-dot { width: 26px; height: 26px; font-size: 0.75rem; }
    .konfig-step { min-width: 30px; }
    .konfig-step-line { min-width: 6px; }

    /* Stat-Karten */
    .stat-value { font-size: 1.4rem; }
    .stat-icon { width: 44px; height: 44px; font-size: 1.2rem; }

    /* Scan-Layout */
    .scan-layout { flex-direction: column; height: auto !important; }
    .scan-sidebar { width: 100% !important; flex-direction: row; flex-wrap: wrap; }

    /* Druckvorschau */
    .druckvorschau-layout { flex-direction: column; }
    .druckvorschau-sidebar { width: 100%; position: static; }
    .canvas-pair { flex-direction: column; }

    /* Tabellen: horizontal scrollen + kompaktere Zellen */
    .table th, .table td { font-size: 0.82rem; padding: .35rem .5rem; }

    /* Karten Padding */
    .card-body { padding: 14px; }
    .card-header { padding: 10px 14px; }

    /* Nav-Tabs scrollbar wenn zu viele Tabs */
    .nav-tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .nav-tabs .nav-link { font-size: 0.8rem; padding: 6px 10px; white-space: nowrap; }

    /* Formulare */
    .form-label { font-size: 0.85rem; margin-bottom: 3px; }

    /* Fehlstellungen Bildgrid: 3 Spalten statt 4 */
    .fehlst-img-grid { grid-template-columns: repeat(3, 1fr); }

    /* Begleitbeschwerden: 3 Spalten statt 5 */
    .beschwerd-grid { grid-template-columns: repeat(3, 1fr); }

    /* Konfig-Kacheln: 2-spaltig statt 3+ */
    .konfig-preisbalken { flex-wrap: wrap; }
    .konfig-pb-gesamt { min-width: 100%; border-top: 1px solid #e2e8f0; }

    /* Einstellungen-Daten: Nav horizontal scrollen auf Mobile */
    .einstellungen-nav { flex-direction: row !important; overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; gap: 4px; }
    .einstellungen-nav .nav-link { white-space: nowrap; font-size: 0.78rem; padding: 5px 8px; }

    /* Unterschrift Canvas */
    .signature-canvas { height: 180px; }

    /* Patientenakte Modal */
    .pa-modal-body { padding: 14px; }

    /* Topbar kompakter */
    .topbar { padding: 0 12px; }
    .topbar-logo { height: 38px; }
}

/* ===== FILIAL-FARBPUNKT ===== */
.filiale-dot {
    width: 10px;
    height: 10px;
    min-width: 10px;
    border-radius: 50%;
    display: inline-block;
    border: 1.5px solid rgba(0,0,0,.15);
    flex-shrink: 0;
    cursor: help;
}

/* ===== AUFTRAGSÜBERSICHT GRUPPEN ===== */
.auftrag-gruppe {
    border-bottom: 1px solid #e2e8f0;
}
.auftrag-gruppe:last-child {
    border-bottom: none;
}
.auftrag-gruppe-header {
    padding: 10px 16px;
    background: #f8faff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
    transition: background 0.15s;
}
.auftrag-gruppe-header:hover {
    background: #edf2fb;
}
.auftrag-gruppe .table {
    margin-bottom: 0;
}

/* ===== BILDSCHIRMSCHONER ===== */
.screensaver-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 22, 45, 0.82);
    backdrop-filter: blur(18px) saturate(0.6);
    -webkit-backdrop-filter: blur(18px) saturate(0.6);
    cursor: pointer;
    animation: screensaverFadeIn 0.6s ease forwards;
}

@keyframes screensaverFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.screensaver-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    text-align: center;
    animation: screensaverPulse 4s ease-in-out infinite;
}

@keyframes screensaverPulse {
    0%, 100% { transform: scale(1);    opacity: 1; }
    50%       { transform: scale(1.04); opacity: 0.85; }
}

.screensaver-logo {
    width: clamp(220px, 35vw, 480px);
    height: auto;
    filter: drop-shadow(0 0 40px rgba(255,255,255,0.25)) brightness(1.1);
    user-select: none;
    pointer-events: none;
}

.screensaver-hint {
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.9rem;
    letter-spacing: 0.08em;
    font-weight: 300;
    user-select: none;
}

/* App-Wrapper bekommt keinen eigenen Blur – der Overlay macht das via backdrop-filter */
.app-wrapper.screensaver-aktiv {
    pointer-events: none;
}

/* ===== NAV TABS – inaktive Tabs immer lesbar ===== */
.nav-tabs .nav-link:not(.active) {
    color: #344054;
}
.nav-tabs .nav-link:not(.active):hover {
    color: #111827;
    background: #f0f2f5;
}

/* ===== EINSTELLUNGEN ===== */
.einst-section-header {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1d5fa8;
    border-bottom: 2px solid #dbeafe;
    padding-bottom: 8px;
    margin-bottom: 16px;
}

/* ===== SCAN-ANSICHT ===== */
@media print {
    .page-header, .card:not(.scan-print-card), .sidebar, .topbar { display: none !important; }
    #scan-bild { max-width: 100% !important; width: 100% !important; }
}

/* ===== GLOBAL SUCHE ===== */
.global-suche {
    position: relative;
    flex: 1;
    max-width: 420px;
    margin: 0 16px;
}

.global-suche-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.global-suche-icon {
    position: absolute;
    left: 12px;
    color: #64748b;
    font-size: 0.9rem;
    pointer-events: none;
    z-index: 1;
}

.global-suche-input {
    width: 100%;
    padding: 8px 36px 8px 36px;
    border: 1px solid #d0dff0;
    border-radius: 8px;
    background: #f4f8fd;
    color: #1a2e4a;
    font-size: 0.875rem;
    transition: border-color .15s, background .15s;
    outline: none;
}

.global-suche-input:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(29,95,168,.1);
}

.global-suche-clear {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 0;
    font-size: 0.85rem;
    line-height: 1;
}
.global-suche-clear:hover { color: #ef4444; }

.global-suche-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #d0dff0;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    z-index: 500;
    overflow: hidden;
    max-height: 360px;
    overflow-y: auto;
}

.global-suche-gruppe-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #94a3b8;
    padding: 8px 14px 4px;
    background: #f8fafc;
}

.global-suche-item {
    padding: 9px 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    font-size: 0.88rem;
    transition: background .12s;
    border-bottom: 1px solid #f1f5f9;
}
.global-suche-item:last-child { border-bottom: none; }
.global-suche-item:hover { background: #eff6ff; }

.global-suche-leer {
    padding: 12px 14px;
    color: #94a3b8;
    font-size: 0.85rem;
    text-align: center;
}

.global-suche-loading {
    padding: 12px 14px;
    color: #64748b;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
}

