@media (pointer: coarse) {
  input,
  select,
  textarea {
    font-size: 16px !important;
  }
}

/* ===== Landing Page Styles ===== */
:root{
    --ui-muted-900:#1f2937;
    --ui-muted-800:#374151;
    --ui-muted-700:#4b5563;
    --ui-muted-600:#6b7280;
    --ui-muted-500:#8b9098;
    --ui-muted-bg:#f3f4f6;
    --ui-muted-bg-strong:#e5e7eb;
    --ui-muted-dark-bg:rgba(255,255,255,0.08);
    --ui-alert:#d14545;
}
.lp-body{--lp-bg:#f7f8fb;--lp-text:#0a0a0a;--lp-muted:#6b7280;--lp-primary:#2563EB;--lp-accent:#111827;--lp-card:#ffffff;--lp-ring:rgba(37,99,235,.25)}
.lp-container{max-width:840px;margin:0 auto;padding:0 20px}
.lp-header{position:sticky;top:0;background:rgba(255,255,255,.8);backdrop-filter:saturate(140%) blur(10px);z-index:40;border-bottom:1px solid rgba(0,0,0,.05)}
.lp-header-inner{display:flex;align-items:center;justify-content:space-between;height:64px}
.lp-logo{font-weight:700;letter-spacing:.2px}
.lp-nav{display:flex;gap:14px;align-items:center}
.lp-nav-link{color:var(--lp-muted);text-decoration:none;font-size:14px}
.lp-btn{display:inline-flex;align-items:center;justify-content:center;padding:14px 20px;border-radius:14px;text-decoration:none;border:1px solid transparent;font-weight:600}
.lp-btn.primary{background:#2563EB;color:#fff}
.lp-btn.ghost{background:transparent;border-color:rgba(0,0,0,.12);color:#111}
.lp-btn.lg{min-width:220px}

.lp-hero{position:relative;overflow:hidden}
.lp-hero-gradient{position:absolute;inset:0;background:radial-gradient(1200px 700px at 20% -10%, #FFF7E6 0%, transparent 60%),radial-gradient(1200px 700px at 90% 10%, #EAF5FF 0%, transparent 60%), #FFFFFF;}
.lp-hero-gradient{pointer-events:none}
.lp-hero-inner{display:grid;grid-template-columns:1.1fr .9fr;gap:28px;align-items:center;padding:60px 0}
.lp-hero-center{display:block}
.lp-hero-center .lp-hero-copy{max-width:840px;margin:0 auto;text-align:center}
.lp-badge{display:inline-flex;align-items:center;gap:8px;background:rgba(0,0,0,.04);border:1px solid rgba(0,0,0,.08);padding:6px 12px;border-radius:999px;color:#374151;font-size:13px;margin-bottom:12px}
.lp-hero-title.center{text-align:center}
.lp-hero-sub.center{text-align:center;margin-bottom:22px}
.lp-hero-ctas.center{justify-content:center;margin-bottom:34px}
.lp-mockup{margin-top:34px}
.mockup-card{border-radius:16px;box-shadow:0 8px 24px rgba(0,0,0,.06);border:1px solid rgba(0,0,0,.06);overflow:hidden}
.lp-hero-copy{position:relative;z-index:1;color:#0a0a0a}
.lp-hero-title{font-size:56px;line-height:1.1;margin:0 0 8px;font-weight:800;letter-spacing:-0.02em}
@media (min-width: 768px){.lp-hero-title{font-size:64px}}
@media (min-width: 1200px){.lp-hero-title{font-size:72px}}
.lp-hero-sub{color:var(--lp-muted);font-size:18px;margin:0 0 24px}
.lp-hero-ctas{display:flex;gap:12px;margin-bottom:0}
.lp-bullets{margin:10px 0 0 18px;color:var(--lp-muted);font-size:14px}
.lp-hero-shot{position:relative}
.lp-shot-wrap{position:relative;border-radius:16px;box-shadow:0 20px 50px rgba(0,0,0,.12);overflow:hidden;border:1px solid rgba(0,0,0,.06);transform:translateY(8px)}
.lp-shot{display:block;width:100%;height:auto;background:#fff}
.lp-hero-brand{display:flex;align-items:center;justify-content:center;background:#fff;font-weight:800;letter-spacing:.4px;font-size:clamp(26px,4.2vw,40px);padding:28px;border-radius:14px}

.lp-section{padding:88px 0}
@media (max-width: 900px){.lp-section{padding:64px 0}}
.lp-kicker{text-transform:uppercase;font-size:12px;letter-spacing:.12em;color:var(--lp-muted);margin-bottom:6px}
.lp-h2{font-size:clamp(28px,2.8vw,32px);margin:0 0 10px}
.center{text-align:center}
.lp-grid-2{display:grid;grid-template-columns:1fr 1fr;gap:28px}
.lp-list{margin:10px 0 0 0;padding:0;list-style:none}
.lp-list li{display:flex;gap:10px;align-items:flex-start;margin:8px 0;color:#374151}
.lp-ico{font-size:18px}
.lp-tech-card{background:#fff;border:1px solid rgba(0,0,0,.06);border-radius:16px;padding:20px;box-shadow:0 8px 24px rgba(0,0,0,.04)}
.lp-tech-illustration{font-size:38px;margin-bottom:10px}
.lp-icon{width:28px;height:28px;stroke:#4B5563;stroke-width:1.5;fill:none;display:inline-block}

.lp-trust{position:relative;padding:72px 0}
.lp-trust-bg{position:absolute;inset:0;background:url('uploads/image_20250914_134525_6541d0.jpg') center/cover no-repeat;opacity:.09}
.lp-testimonials{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;margin-top:10px;overflow-x:auto;padding-bottom:4px}
.lp-testimonials::-webkit-scrollbar{height:8px}
.lp-testimonials::-webkit-scrollbar-thumb{background:rgba(0,0,0,.08);border-radius:999px}
.lp-t{display:flex;gap:12px;align-items:flex-start;background:rgba(255,255,255,.75);border:1px solid rgba(0,0,0,.06);border-radius:14px;padding:14px}
.lp-t-img{width:48px;height:48px;border-radius:50%;object-fit:cover}
.lp-t-name{font-weight:700}
.lp-t-lab{color:var(--lp-muted);font-size:12px;margin-bottom:4px}

.lp-cards{display:grid;grid-template-columns:repeat(3,1fr);gap:18px;margin-top:14px}
.lp-card{background:#fff;border:1px solid rgba(0,0,0,.06);border-radius:16px;padding:20px;box-shadow:0 8px 24px rgba(0,0,0,.04);display:flex;flex-direction:column;justify-content:space-between;min-height:160px}
.lp-card-ico{margin-bottom:8px}
.lp-icon{width:28px;height:28px;stroke:#4B5563;stroke-width:1.5;fill:none;display:inline-block}
.oi{font-size:32px;line-height:1}

.lp-faq details{background:#fff;border:1px solid rgba(0,0,0,.08);border-radius:12px;padding:12px 14px;margin:10px 0}
.lp-faq summary{cursor:pointer;font-weight:600}
.lp-faq p{color:#374151;margin:8px 0 0}

.lp-subscribe{display:flex;gap:8px;margin-top:8px}
.lp-subscribe input{flex:1;border:1px solid rgba(0,0,0,.15);border-radius:10px;padding:10px 12px;outline:2px solid transparent;outline-offset:2px}
.lp-subscribe input:focus{outline-color:var(--lp-ring)}
.lp-sub-hint{color:var(--lp-muted);font-size:12px;margin-top:6px}
.lp-quote{background:linear-gradient(180deg,#fff, #f8fafc);border:1px solid rgba(0,0,0,.06);border-radius:14px;padding:18px}
.lp-quote blockquote{margin:0 0 6px;font-size:16px}
.lp-quote cite{color:var(--lp-muted);font-size:12px}

.lp-auth{padding:40px 0;border-top:1px solid rgba(0,0,0,.06)}
.lp-auth h2{font-size:clamp(24px,3.2vw,32px);margin-bottom:18px;text-align:center}
.form-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;align-items:end}
.lp-auth .form-grid{max-width:980px;margin:0 auto}
.form-grid label{display:flex;flex-direction:column;gap:6px;font-size:16px;color:#111;font-weight:600}
.form-grid input,.form-grid select{height:46px;border:1.5px solid rgba(0,0,0,.18);border-radius:12px;padding:12px 14px;font-size:16px}
.form-grid input:focus,.form-grid select:focus{outline:2px solid var(--lp-ring);outline-offset:2px}
.lp-contract{grid-column:span 2}
.lp-submit{grid-column:4/5;justify-self:end}
@media (max-width: 900px){.form-grid{grid-template-columns:1fr}.lp-contract{grid-column:auto}.lp-submit{grid-column:auto}}
.lp-contract{border:2px solid rgba(0,0,0,.12);padding:20px 16px 16px;border-radius:14px;background:#fff;box-shadow:0 8px 24px rgba(0,0,0,.04);position:relative}
.lp-contract legend{display:inline-block;background:#fff;padding:0 8px;margin:0 0 8px 8px;font-size:16px;font-weight:700;color:#111;line-height:1}
.lp-check{display:flex;gap:8px;align-items:center}

.lp-footer{border-top:1px solid rgba(0,0,0,.06);background:#fff;padding:28px 0}
.lp-footer-3{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}
.lp-container .form-grid{max-width:1100px;margin:0 auto}
.lp-foot-title{font-weight:700;margin-bottom:8px}
.lp-foot-bottom{margin-top:16px;border-top:1px solid rgba(0,0,0,.06);padding-top:10px;color:var(--lp-muted);font-size:12px}
.lp-toast{position:fixed;left:50%;bottom:20px;transform:translateX(-50%);background:#111;color:#fff;padding:10px 14px;border-radius:10px;z-index:1000}

@media (max-width: 900px){
  .lp-hero-inner{grid-template-columns:1fr;gap:16px}
  .lp-grid-2{grid-template-columns:1fr}
  .lp-cards{grid-template-columns:1fr}
  .lp-testimonials{grid-template-columns:repeat(3,80%)}
  .lp-footer-3{grid-template-columns:1fr}
}
/* Apple-inspired Labor-Board Design */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', system-ui, sans-serif;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #1d1d1f;
    height: 100vh;
    overflow: hidden;
    font-size: 18px;
    line-height: 1.6;
    font-weight: 500;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
}

/* Override: Landingpage braucht Scrollen */
.lp-body{
    height: auto;
    min-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
}

/* 4K Optimizations */
@media (min-width: 3840px) {
    body {
        font-size: 24px;
    }
    
    .header-left .logo-single-line {
        font-size: 32px;
    }
    
    #currentTime { font-size: 56px; }
    
    #currentDate { font-size: 22px; }
    
    .section-header h2 {
        font-size: 32px;
    }
    
    .section-header h3 {
        font-size: 26px;
    }
    
    .orders-table th {
        font-size: 18px;
        padding: 16px 20px;
    }
    
    .orders-table td {
        font-size: 20px;
        padding: 20px;
    }
    
    .tech-name {
        font-size: 22px;
    }
    
    .notes-list li {
        font-size: 18px;
        padding: 16px 20px;
    }
    
    .simple-progress-container {
        height: 26px;
        border-radius: 13px;
    }
    
    .legend-title {
        font-size: 20px;
    }
    
    .legend-item {
        font-size: 16px;
    }
    
    .legend-color {
        width: 16px;
        height: 16px;
    }
    
    .percentage {
        font-size: 22px;
    }
    
    .utilization-numbers {
        font-size: 18px;
    }
}

/* Large Display Optimizations */
@media (min-width: 2560px) {
    body {
        font-size: 20px;
    }
    
    .header-left .logo-single-line {
        font-size: 28px;
    }
    
    #currentTime { font-size: 40px; }
    
    .section-header h2 {
        font-size: 28px;
    }
    
    .orders-table td {
        font-size: 18px;
    }
    
    .tech-name {
        font-size: 20px;
    }
}

/* Header Styles */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 40px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 0.5px solid rgba(0, 0, 0, 0.1);
    height: 100px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

/* Safe areas + Drawer + FAB */
.main-content { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
.fab-add { bottom: calc(16px + env(safe-area-inset-bottom)); }
.drawer-backdrop { position:fixed; inset:0; background:rgba(0,0,0,.35); z-index:120; }
.sidebar { transition: transform .25s ease; }
.sidebar.drawer { position: fixed; top: 100px; right: 0; width: 86%; max-width: 420px; height: calc(100vh - 100px); background: rgba(255,255,255,0.95); transform: translateX(100%); z-index: 130; }
.sidebar.drawer.open { transform: translateX(0); }
.drawer-toggle { display:none; }

.header-left .logo-container {
    display: flex;
    align-items: center;
    height: 50px;
}

/* Dynamisches Logo links oben */
.logo-dynamic img { height: 44px; width: auto; display: block; object-fit: contain; }
.logo-dynamic.fallback-text { display:flex; flex-direction:column; line-height:1; }
.logo-dynamic.fallback-text .line1 { font-weight:600; letter-spacing:-0.3px; }
.logo-dynamic.fallback-text .line2 { font-weight:600; letter-spacing:-0.3px; }

.header-left .logo-single-line {
    font-size: 26px;
    font-weight: 600;
    color: #1d1d1f;
    letter-spacing: -0.3px;
    margin: 0;
    white-space: nowrap;
}

.header-center {
    text-align: center;
}

#currentTime { font-size: 26px; font-weight: 700; color: #111; font-variant-numeric: tabular-nums; letter-spacing: -0.5px; line-height: 1; }
#currentDate { font-size: 15px; font-weight: 500; color: #6e6e73; letter-spacing: 0.5px; margin-top: 6px; }

.header-right { text-align: right; display:flex; align-items:center; gap:36px; }
.mobile-link { display:inline-flex; align-items:center; justify-content:center; height:36px; padding:0 12px; border-radius:8px; border:1px solid rgba(0,0,0,0.12); background:rgba(255,255,255,0.9); color:#111; text-decoration:none; font-weight:600; font-size:14px; white-space:nowrap; line-height:1; }
.mobile-link:hover { background: rgba(0,0,0,0.02); border-color: rgba(0,0,0,0.18); transform: translateY(-1px); transition: all 0.15s ease; }
.theme-dark .mobile-link { background: rgba(28,28,30,0.9); border-color: rgba(255,255,255,0.08); color:#e5e5ea; }
.theme-dark .mobile-link:hover { background: rgba(255,255,255,0.06); }

/* Theme toggle switch */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background: #d1d1d6; transition: .2s; border-radius: 9999px; border: 1px solid rgba(0,0,0,0.15); }
.slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; top: 2.5px; background: #fff; transition: .2s; border-radius: 50%; box-shadow: 0 1px 2px rgba(0,0,0,0.2); }
.switch input:checked + .slider { background: #0a84ff; }
.switch input:checked + .slider:before { transform: translateX(20px); background: #fff; }

/* Dark theme */
.theme-dark body { background: linear-gradient(135deg, #0a0a0a 0%, #121212 100%); color: #e5e5ea; }
.theme-dark .header { background: #000; border-bottom-color: rgba(255,255,255,0.06); }
.theme-dark #currentTime { color: #fafafa; }
.theme-dark #currentDate { color: #a1a1a6; }
.theme-dark .orders-section, .theme-dark .utilization-section, .theme-dark .notes-section, .theme-dark .calendar-section { background: rgba(22,22,24,0.9); border-color: rgba(255,255,255,0.06); }
.theme-dark .orders-table th { background: rgba(28,28,30,0.9); color: #a1a1a6; border-bottom-color: rgba(255,255,255,0.06); }
.theme-dark .orders-table td { background: rgba(22,22,24,0.9); color: #e5e5ea; }
.theme-dark .orders-table tbody tr:hover td { background: rgba(255,255,255,0.03); }
.theme-dark .orders-table tbody tr td::before, .theme-dark .orders-table tbody tr td::after { border-color: rgba(255,255,255,0.06); }
.theme-dark .btn-add-dashboard { background:#1c1c1e; color:#f5f5f7; border:1px solid rgba(255,255,255,0.10); }
.theme-dark .btn-add-dashboard:hover { background:#2c2c2e; color:#fff; }
.theme-dark .btn-gear { background: rgba(28,28,30,0.9); border-color: rgba(255,255,255,0.08); color:#e5e5ea; }
.theme-dark .notes-list li { background: rgba(28,28,30,0.9); color:#e5e5ea; border-left-color: #0a84ff; }
.theme-dark .calendar-day { background: rgba(28,28,30,0.9); color:#e5e5ea; border-color: rgba(255,255,255,0.06); }
.theme-dark .calendar-day.today { background: rgba(10,132,255,0.2); border-color: rgba(10,132,255,0.4); color:#0a84ff; }
.theme-dark .live-badge { background: #30d158; }
.theme-dark .offline-badge { background: #ff453a; }
.theme-dark .units-badge { background: rgba(10,132,255,0.18); color:#0a84ff; }
.theme-dark .notes-clickable:hover { color:#0a84ff; }
.theme-dark .tech-badge { background:#2c2c2e; border-color: rgba(255,255,255,0.1); color:#e5e5ea; }
.theme-dark .tech-badge.olli { background:#2c2c2e; }
.theme-dark .tech-badge.sergey { background:#223022; }
.theme-dark .tech-badge.alex { background:#2c1f26; }
.theme-dark .simple-progress-container { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.06); box-shadow:none; }
.theme-dark .progress-segment.remaining { background: linear-gradient(90deg, #1c1c1e, #2c2c2e); }
.theme-dark .orders-table tbody tr:hover { box-shadow: 0 6px 18px rgba(0,0,0,0.7); }
.theme-dark .deadline-critical td { background: rgba(255,69,58,0.18) !important; }
.theme-dark .deadline-critical:hover td { background: rgba(255,69,58,0.28) !important; }
.theme-dark .btn-secondary { background: rgba(255,255,255,0.06); color:#e5e5ea; border-color: rgba(255,255,255,0.08); }
.theme-dark .modal-content { background: rgba(22,22,24,0.97); border-color: rgba(255,255,255,0.06); }
.theme-dark .modal-actions { background: rgba(28,28,30,0.8); border-top-color: rgba(255,255,255,0.06); }

.btn-gear { display:inline-flex; align-items:center; justify-content:center; width:36px; height:36px; border-radius:8px; border: 1px solid rgba(0,0,0,0.12); background: rgba(255,255,255,0.9); text-decoration:none; line-height:1; color:#1d1d1f; transition: all 0.15s ease; font-size:14px; }
.btn-gear svg { width:18px; height:18px; }
.btn-gear:hover { background: rgba(0,0,0,0.02); border-color: rgba(0,0,0,0.18); transform: translateY(-1px); }
.btn-gear.text { width: auto; height: 36px; padding: 0 12px; font-weight: 600; font-size: 14px; white-space: nowrap; }
.theme-dark .btn-gear.text { background: rgba(28,28,30,0.9); border-color: rgba(255,255,255,0.08); color:#e5e5ea; }
.theme-dark .btn-gear:hover { background: rgba(255,255,255,0.06); }

/* Icon-Buttons (Lupe, Undo, Redo) angleichen */
.btn-icon { display:inline-flex; align-items:center; justify-content:center; width:36px; height:36px; border-radius:8px; border:1px solid rgba(0,0,0,0.12); background: rgba(255,255,255,0.9); cursor:pointer; transition: all .15s ease; }
.btn-icon:hover { background: rgba(0,0,0,0.03); transform: translateY(-1px); }
.btn-icon svg { width:18px; height:18px; }
.theme-dark .btn-icon { background: rgba(28,28,30,0.9); border-color: rgba(255,255,255,0.08); color:#e5e5ea; }
.theme-dark .btn-icon:hover { background: rgba(255,255,255,0.06); }
.btn-icon[aria-disabled="true"], .btn-icon.btn-icon--disabled { opacity:.45; pointer-events:auto; }
/* Versandt-Toggle als Pill-Button gestalten */
#toggleShipped { width:auto; padding:0 10px; font-size:13px; font-weight:600; }
#toggleShipped[aria-pressed="true"] { background:#007aff; color:#fff; border-color:#007aff; }
.theme-dark #toggleShipped[aria-pressed="true"] { background:#0a84ff; border-color:#0a84ff; color:#fff; }

.status-display {
    font-size: 18px;
    color: #6e6e73;
    font-weight: 500;
}

.separator {
    margin: 0 8px;
    color: #d1d1d6;
}

.live-badge {
    background: #34c759;
    color: white;
    padding: 4px 10px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    animation: pulse 2s infinite;
}
.offline-badge { background: #ff3b30; color: white; padding: 4px 10px; border-radius: 10px; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; animation: none; }

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* Main Content */
.main-content {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 100px);
    margin-top: 100px;
    gap: 24px;
    padding: 24px;
}

/* Dashboard: KPI Row + Body layout */
.dash-kpis{
    display:grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px;
    flex: 0 0 auto;
    align-items: stretch;
}
.kpi-card{
    background: rgba(255,255,255,0.86);
    backdrop-filter: blur(18px) saturate(180%);
    -webkit-backdrop-filter: blur(18px) saturate(180%);
    border: 0.5px solid rgba(0,0,0,0.1);
    border-radius: 14px;
    padding: 14px 14px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.04);
    cursor: default;
    user-select:none;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    min-height: 70px;
    height: auto;
    box-sizing: border-box;
}
.kpi-card.kpi-clickable,
.kpi-card.kpi-action{ cursor:pointer; }
.kpi-card:focus{ outline: 2px solid #007aff; outline-offset: 2px; }

/* KPI Icon Styles */
.kpi-icon{
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.kpi-icon svg{ width: 18px; height: 18px; }
.kpi-icon-blue{
    background: linear-gradient(135deg, #e8f0fe, #d4e4fc);
    color: #4285f4;
}
.kpi-icon-yellow{
    background: linear-gradient(135deg, #fef7e0, #fcefc7);
    color: #f9ab00;
}
.kpi-icon-gray{
    background: linear-gradient(135deg, #f1f3f5, #e9ecef);
    color: #6c757d;
}
.kpi-icon-orange{
    background: linear-gradient(135deg, #fff4e6, #ffe8cc);
    color: #ff9500;
}
.theme-dark .kpi-icon-blue{ background: linear-gradient(135deg, #1a3a5c, #1e4976); color: #8ab4f8; }
.theme-dark .kpi-icon-yellow{ background: linear-gradient(135deg, #3d3218, #4a3d1f); color: #fdd663; }
.theme-dark .kpi-icon-gray{ background: linear-gradient(135deg, #2d2d2d, #3a3a3a); color: #adb5bd; }
.theme-dark .kpi-icon-orange{ background: linear-gradient(135deg, #3d2a14, #4a3318); color: #ffb74d; }

.kpi-content{ display: flex; flex-direction: column; gap: 2px; }
.kpi-label{ font-size: 11px; color:#6e6e73; letter-spacing: .12em; font-weight: 800; }
.kpi-value{ font-size: 26px; font-weight: 800; color:#111; margin-top: 2px; }
.kpi-action{
    background: linear-gradient(180deg, #111827, #0b1220);
    border-color: rgba(255,255,255,0.08);
    color:#fff;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}
.kpi-label-invert{ color: rgba(255,255,255,0.75); }
.kpi-action-title{ font-size: 18px; font-weight: 800; margin-top: 2px; }
.kpi-action-plus{ font-size: 24px; font-weight: 300; opacity: .95; }
.kpi-action-left{ display:flex; flex-direction:column; gap:2px; }

/* Rechnungen KPI (orange Akzent) */
.kpi-invoices{
    cursor: pointer;
    border-color: rgba(255,149,0,0.25);
    background: linear-gradient(180deg, #fffbf5, #fff8ed);
}
.kpi-invoices .kpi-value{ color: #ff9500; }
.theme-dark .kpi-invoices{
    border-color: rgba(255,214,10,0.2);
    background: linear-gradient(180deg, #2a2518, #1f1c14);
}
.theme-dark .kpi-invoices .kpi-value{ color: #ffd60a; }
.kpi-my-day-card{
    border-color: rgba(0,122,255,0.22);
    background: linear-gradient(180deg, #f5fbff, #eef7ff);
    text-align: left;
}
.kpi-my-day-value{
    color:#007aff;
    font-size:18px;
    font-weight:900;
    line-height:1.1;
}
.theme-dark .kpi-my-day-card{
    border-color: rgba(100,210,255,0.22);
    background: linear-gradient(180deg, #172433, #111827);
}
.theme-dark .kpi-my-day-value{color:#64d2ff}

/* Kombinierte Box: Aufgaben & Versand (Techniker-Pills + Lieferplan + heute/morgen) */
.kpi-tasks-shipping-card{
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 10px;
    min-width: 0;
    padding: 12px 16px;
}
.kpi-tasks-shipping-head{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.kpi-tasks-shipping-head .kpi-label{ line-height: 1.1; }
.kpi-tasks-shipping-stats{
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 2px 8px;
    border-radius: 10px;
}
.kpi-tasks-shipping-stats:hover{ background: rgba(0,0,0,0.04); }
.theme-dark .kpi-tasks-shipping-stats:hover{ background: rgba(255,255,255,0.06); }
.kpi-tasks-shipping-controls{
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.kpi-tasks-shipping-controls .delivery-tech-pills{ flex: 1 1 auto; min-width: 0; }
.kpi-tasks-shipping-controls .delivery-plan-btn{ flex: 0 0 auto; }

/* Bestellung/Notiz KPI-Box (oben) */
.kpi-orders-notes-card{ position: relative; cursor: pointer; min-width: 0; }
.kpi-add-note-btn{
    position: absolute;
    top: 10px;
    right: 12px;
    border: 1px solid rgba(0,122,255,0.28);
    background: rgba(0,122,255,0.08);
    color: #0057d9;
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    line-height: 1;
}
.kpi-add-note-btn:hover{ background: rgba(0,122,255,0.14); }
.theme-dark .kpi-add-note-btn{ background: rgba(10,132,255,0.18); border-color: rgba(10,132,255,0.4); color: #64d2ff; }

/* Dual KPI Card (Rechnungen geschrieben / offen) */
.kpi-card.kpi-dual{ min-width: 0; }
.kpi-content-dual{ display: flex; flex-direction: column; gap: 4px; }
.kpi-dual-row{
    display: flex;
    align-items: center;
    gap: 10px;
}
.kpi-dual-item{
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
}
.kpi-dual-value{
    font-size: 20px;
    font-weight: 800;
    line-height: 1.1;
}
.kpi-dual-label{
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #8e8e93;
}
.kpi-dual-done .kpi-dual-value{ color: #34c759; }
.kpi-dual-pending .kpi-dual-value{ color: #ff9500; }
.kpi-dual-divider{
    width: 1px;
    height: 28px;
    background: rgba(0,0,0,0.1);
}
.theme-dark .kpi-dual-divider{ background: rgba(255,255,255,0.15); }
.theme-dark .kpi-dual-label{ color: #a1a1a6; }

.kpi-tech-overview-card{
    grid-column: auto;
}
.kpi-tech-overview-content{
    flex: 1;
    min-width: 0;
    height: 100%;
    gap: 4px;
    justify-content: center;
}
.kpi-tech-overview-top{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
}
.kpi-tech-overview-card .kpi-label{
    line-height: 1.1;
}
.kpi-tech-planner-btn{
    padding: 0;
    flex-shrink: 0;
    font-size: 10px;
    line-height: 1;
}
.kpi-tech-overview-list{
    display:flex;
    align-items:center;
    gap:0;
    min-width: 0;
    width: 100%;
    flex: 1;
}
.kpi-tech-item{
    display:flex;
    flex-direction: column;
    align-items:center;
    justify-content:center;
    gap: 2px;
    min-width: 0;
    flex: 1 1 0;
    padding: 0 14px;
}
.kpi-tech-item + .kpi-tech-item{
    border-left: 1px solid rgba(0,0,0,0.08);
}
.kpi-tech-name{
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #8e8e93;
    line-height: 1.1;
    flex-shrink: 0;
}
.kpi-tech-value{
    font-size: 20px;
    font-weight: 800;
    line-height: 1.1;
}
.kpi-tech-value.low{ color:#34c759; }
.kpi-tech-value.medium{ color:#007aff; }
.kpi-tech-value.high{ color:#ff9500; }
.kpi-tech-value.critical{ color:#ff3b30; }
.kpi-tech-meta{
    display: none;
}
.theme-dark .kpi-tech-name{ color:#a1a1a6; }
.theme-dark .kpi-tech-item + .kpi-tech-item{
    border-left-color: rgba(255,255,255,0.12);
}

/* ===== Team-Panel (kompakte Karten in KPI-Zeile) ===== */
.kpi-tech-panel{
    grid-column: auto;
    flex-direction: row;
    align-items: stretch;
    gap: 10px;
    padding: 10px 12px;
    min-height: 70px;
    overflow: hidden;
}
.kpi-tech-bar .kpi-tech-content{
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    justify-content: center;
}
.kpi-tech-top-row{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    min-height: 0;
}
.kpi-tech-top-row .kpi-label{
    line-height: 1;
    margin: 0;
}
.kpi-tech-alle-chip{
    border: 1px solid rgba(0,0,0,0.12);
    background: rgba(255,255,255,0.7);
    color: #475569;
    border-radius: 999px;
    padding: 1px 7px;
    font-size: 9px;
    font-weight: 800;
    cursor: pointer;
    line-height: 1.4;
    transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.kpi-tech-alle-chip:hover{ background: rgba(0,122,255,0.08); border-color: rgba(0,122,255,0.35); color: #007aff; }
.kpi-tech-alle-chip.is-active{
    background: rgba(0,122,255,0.12);
    border-color: #007aff;
    color: #007aff;
}
.kpi-tech-panel-grid{
    display: flex;
    align-items: stretch;
    gap: 4px;
    width: 100%;
    min-width: 0;
    flex: 1;
}
.kpi-tech-card{
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 5px 6px;
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.10);
    background: rgba(248,249,250,0.92);
    min-width: 0;
    flex: 1 1 0;
    cursor: pointer;
    transition: border-color .12s ease, box-shadow .12s ease, background .12s ease;
    text-align: left;
}
.kpi-tech-card:hover{ background: rgba(0,122,255,0.04); border-color: rgba(0,122,255,0.28); }
.kpi-tech-card.is-active{
    border-color: #007aff;
    box-shadow: inset 0 0 0 1px rgba(0,122,255,0.35);
    background: rgba(0,122,255,0.06);
}
.kpi-tech-card:focus-visible{ outline: 2px solid #007aff; outline-offset: 1px; }
.kpi-tech-card-head{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    min-width: 0;
}
.kpi-tech-card-title{
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    flex: 1;
    flex-wrap: wrap;
    line-height: 1.1;
}
.kpi-tech-card-name{
    font-size: 10px;
    font-weight: 800;
    color: #1d1d1f;
    white-space: nowrap;
}
.kpi-tech-since{
    font-size: 8px;
    font-weight: 600;
    color: #64748b;
    white-space: nowrap;
}
.kpi-tech-since.is-muted{ color: #94a3b8; }
.kpi-tech-stamp-btn{
    flex: none;
    align-self: center;
    border: 1px solid rgba(0,0,0,0.14);
    background: rgba(255,255,255,0.9);
    color: #1d1d1f;
    border-radius: 6px;
    padding: 1px 7px;
    min-width: 86px;
    font-size: 8px;
    font-weight: 800;
    line-height: 1.3;
    text-align: center;
    white-space: nowrap;
    cursor: pointer;
    transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.kpi-tech-stamp-btn:hover:not(:disabled){
    border-color: rgba(0,122,255,0.4);
    color: #007aff;
    background: #fff;
}
.kpi-tech-stamp-btn:disabled{ opacity: 0.5; cursor: default; }
.kpi-tech-stamp-btn:focus-visible{ outline: 2px solid #007aff; outline-offset: 1px; }
.kpi-tech-status-dot{
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: #c7c7cc;
    flex: none;
}
.kpi-tech-status-dot.is-online{ background: #22c55e; }
.kpi-tech-status-dot.is-offline{ background: #94a3b8; }
.kpi-tech-status-dot.is-vacation{ background: #64748b; }
.kpi-tech-card-load{
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 4px;
    line-height: 1;
}
.kpi-tech-load-label{
    font-size: 8px;
    font-weight: 700;
    color: #64748b;
}
.kpi-tech-load-label--critical{ color: #ef4444; }
.kpi-tech-load-label--medium{ color: #f97316; }
.kpi-tech-load-label--low{ color: #94a3b8; }
.kpi-tech-load-pct{
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
}
.kpi-tech-load-pct--critical{ color: #ef4444; }
.kpi-tech-load-pct--medium{ color: #f97316; }
.kpi-tech-load-pct--low{ color: #94a3b8; }
.kpi-tech-card-bar{
    height: 4px;
    border-radius: 999px;
    background: rgba(0,0,0,0.08);
    overflow: hidden;
}
.kpi-tech-card-bar-fill{
    height: 100%;
    border-radius: 999px;
    transition: width .2s ease;
}
.kpi-tech-bar--critical{ background: linear-gradient(90deg, #ef4444, #dc2626); }
.kpi-tech-bar--medium{ background: linear-gradient(90deg, #fb923c, #f97316); }
.kpi-tech-bar--low{ background: linear-gradient(90deg, #cbd5e1, #94a3b8); }
.kpi-tech-bar--none{ background: transparent; }
.kpi-tech-card-meta{
    font-size: 11.5px;
    font-weight: 700;
    color: #64748b;
    line-height: 1.1;
}
.kpi-tech-card.is-invoice .kpi-tech-card-load,
.kpi-tech-card.is-invoice .kpi-tech-card-bar,
.kpi-tech-card.is-invoice .kpi-tech-card-meta{ display: none; }
.kpi-tech-card-invoice{
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 6px;
    margin-top: 2px;
}
.kpi-tech-invoice-stat{
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    flex: 1;
    min-width: 0;
}
.kpi-tech-invoice-num{
    font-size: 15px;
    font-weight: 800;
    color: #1d1d1f;
    line-height: 1;
}
.kpi-tech-invoice-lbl{
    font-size: 9px;
    font-weight: 700;
    color: #64748b;
    text-transform: lowercase;
    line-height: 1;
}
.theme-dark .kpi-tech-invoice-num{ color: #f5f5f7; }
.theme-dark .kpi-tech-invoice-lbl{ color: #a1a1a6; }

.theme-dark .kpi-tech-alle-chip{
    background: rgba(44,44,46,0.75);
    border-color: rgba(255,255,255,0.12);
    color: #d1d5db;
}
.theme-dark .kpi-tech-alle-chip.is-active{
    background: rgba(10,132,255,0.22);
    border-color: #0a84ff;
    color: #0a84ff;
}
.theme-dark .kpi-tech-card{
    background: rgba(44,44,46,0.72);
    border-color: rgba(255,255,255,0.12);
}
.theme-dark .kpi-tech-card:hover{ background: rgba(10,132,255,0.12); }
.theme-dark .kpi-tech-card.is-active{
    background: rgba(10,132,255,0.18);
    border-color: #0a84ff;
}
.theme-dark .kpi-tech-card-name{ color: #f5f5f7; }
.theme-dark .kpi-tech-since{ color: #a1a1a6; }
.theme-dark .kpi-tech-card-meta{ color: #a1a1a6; }
.theme-dark .kpi-tech-card-bar{ background: rgba(255,255,255,0.10); }
.theme-dark .kpi-tech-stamp-btn{
    background: rgba(28,28,30,0.9);
    border-color: rgba(255,255,255,0.14);
    color: #f5f5f7;
}
.theme-dark .kpi-tech-stamp-btn:hover:not(:disabled){
    border-color: rgba(10,132,255,0.45);
    color: #0a84ff;
}
.theme-dark .kpi-tech-panel{ background: rgba(28,28,30,0.92); border-color: rgba(255,255,255,0.08); }

/* Legacy / ungenutzt */
.kpi-tech-panel-head,
.kpi-tech-panel-title,
.kpi-tech-panel-head-right,
.kpi-tech-panel-summary,
.kpi-tech-du-badge,
.kpi-tech-clock-btn,
.kpi-tech-card-clock{ display: none !important; }

/* ===== Kombinierte Techniker-Leiste (Legacy-Segmente) ===== */
.kpi-tech-bar .kpi-tech-content{ flex: 1; min-width: 0; }
.kpi-tech-bar .kpi-tech-overview-list{
    display: flex;
    align-items: stretch;
    gap: 6px;
    flex-wrap: nowrap;
    width: 100%;
    min-width: 0;
}
.kpi-tech-seg{
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1 1 0;
    min-width: 0;
    padding: 4px 7px;
    border: 1px solid rgba(0,0,0,0.10);
    border-radius: 10px;
    background: rgba(255,255,255,0.6);
    cursor: pointer;
    transition: background .12s ease, border-color .12s ease, box-shadow .12s ease;
    overflow: hidden;
    white-space: nowrap;
}
.kpi-tech-seg:hover{ background: rgba(0,122,255,0.06); }
.kpi-tech-seg.is-active{
    background: rgba(0,122,255,0.10);
    border-color: rgba(0,122,255,0.5);
    box-shadow: inset 0 0 0 1px rgba(0,122,255,0.25);
}
.kpi-tech-seg:focus-visible{ outline: 2px solid #007aff; outline-offset: 2px; }
.kpi-tech-dot{
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #c7c7cc;
    flex: none;
}
.kpi-tech-dot[data-tech="Oli" i],
.kpi-tech-dot[data-tech="Olli" i]{ background:#34c759; }
.kpi-tech-dot[data-tech="Sergey" i]{ background:#af52de; }
.kpi-tech-dot[data-tech="Alex" i]{ background:#007aff; }
.kpi-tech-dot[data-tech="Meli" i],
.kpi-tech-dot[data-tech="Melli" i]{ background:#ff9500; }
.kpi-tech-seg-name{
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.2px;
    color: #8e8e93;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 0 1 auto;
    line-height: 1;
}
.kpi-tech-seg-count{
    font-size: 15px;
    font-weight: 800;
    color: #1d1d1f;
    margin-left: auto;
    line-height: 1;
    flex: 0 0 auto;
}
.kpi-tech-pct{
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    flex: 0 0 auto;
    white-space: nowrap;
}
.kpi-tech-pct.low{ color:#34c759; }
.kpi-tech-pct.medium{ color:#007aff; }
.kpi-tech-pct.high{ color:#ff9500; }
.kpi-tech-pct.critical{ color:#ff3b30; }
.theme-dark .kpi-tech-seg{ background: rgba(44,44,46,0.6); border-color: rgba(255,255,255,0.12); }
.theme-dark .kpi-tech-seg:hover{ background: rgba(10,132,255,0.14); }
.theme-dark .kpi-tech-seg.is-active{ background: rgba(10,132,255,0.22); border-color:#0a84ff; }
.theme-dark .kpi-tech-seg-name{ color:#a1a1a6; }
.theme-dark .kpi-tech-seg-count{ color:#f5f5f7; }

.kpi-tech-pin{
    border: none;
    background: transparent;
    padding: 0;
    margin: 0;
    cursor: pointer;
    flex: 0 0 auto;
    line-height: 0;
    border-radius: 8px;
}
.kpi-tech-pin:focus-visible{ outline: 2px solid #007aff; outline-offset: 2px; }
.kpi-tech-pin-svg .kpi-tech-pin-body{ fill:#ef4444; }
.kpi-tech-pin-svg .kpi-tech-pin-center{ fill:#fff; }
.kpi-tech-pin-svg .kpi-tech-pin-check{ stroke:#22c55e; opacity:0; }
.kpi-tech-pin-svg .kpi-tech-pin-vacation{ fill:#2563eb; opacity:0; }
.kpi-tech-pin.is-green .kpi-tech-pin-body{ fill:#22c55e; filter: drop-shadow(0 0 4px rgba(34,197,94,.45)); }
.kpi-tech-pin.is-green .kpi-tech-pin-check{ opacity:1; stroke:#fff; }
.kpi-tech-pin.is-vacation .kpi-tech-pin-body{ fill:#64748b; }
.kpi-tech-pin.is-vacation .kpi-tech-pin-vacation{ opacity:1; fill:#fff; }
.kpi-tech-pin.is-lunch-reminder{ animation: checkinLunchPulse 1.8s ease-in-out infinite; }

/* Versand-Box (gleiche Struktur wie Rechnungen: Icon links + Label oben + Zahlen darunter) */
.theme-dark .kpi-tech-seg.is-active{ background: rgba(10,132,255,0.22); border-color:#0a84ff; }

/* ===== Check-in / Zeiterfassung ===== */
.kpi-checkin-card{
    min-width: 0;
    gap: 8px;
    padding: 10px 12px;
    cursor: pointer;
}
.checkin-pin-btn{
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
    flex: 0 0 auto;
    border-radius: 12px;
    transition: transform .25s ease, filter .25s ease;
    line-height: 0;
}
.checkin-pin-btn:focus-visible{
    outline: 2px solid #007aff;
    outline-offset: 3px;
}
.checkin-pin{
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.checkin-pin-svg .checkin-pin-body{ fill:#ef4444; }
.checkin-pin-svg .checkin-pin-center{ fill:#fff; }
.checkin-pin-svg .checkin-pin-check{ stroke:#22c55e; opacity:0; }
.checkin-pin-svg .checkin-pin-vacation{ fill:#2563eb; opacity:0; }
.checkin-pin.is-green .checkin-pin-body{ fill:#22c55e; filter: drop-shadow(0 0 8px rgba(34,197,94,.55)); }
.checkin-pin.is-green .checkin-pin-check{ opacity:1; }
.checkin-pin.is-vacation .checkin-pin-body{ fill:#64748b; filter:none; }
.checkin-pin.is-vacation .checkin-pin-vacation{ opacity:1; }
.checkin-pin.is-red .checkin-pin-body{ fill:#ef4444; }
.checkin-pin.is-lunch-reminder{
    animation: checkinLunchPulse 1.8s ease-in-out infinite;
}
@keyframes checkinLunchPulse{
    0%, 100%{ transform: scale(1); }
    50%{ transform: scale(1.12); }
}
.checkin-status-text{
    font-size: 11px;
    font-weight: 700;
    color: #1d1d1f;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.theme-dark .checkin-status-text{ color:#f5f5f7; }
.kpi-tech-checkin-dot.is-checkin-red{
    box-shadow: 0 0 0 2px #fff, 0 0 0 3px #ef4444;
}
.kpi-tech-checkin-dot.is-checkin-green{
    box-shadow: 0 0 0 2px #fff, 0 0 0 3px #22c55e;
}
.kpi-tech-checkin-dot.is-checkin-vacation{
    box-shadow: 0 0 0 2px #fff, 0 0 0 3px #64748b;
}
.kpi-tech-checkin-dot.is-checkin-lunch{
    animation: checkinLunchPulse 1.8s ease-in-out infinite;
}
#dashTimeTrackingModal{
    z-index: 2500;
}
.time-tracking-modal-content{
    width: min(920px, 96vw);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}
.time-tracking-body{
    padding: 16px 24px 8px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.time-tracking-summary{
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    border-radius: 14px;
    background: linear-gradient(180deg, #fff7ed, #ffffff);
    border: 1px solid rgba(249,115,22,.18);
}
.time-tracking-summary-kicker{
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #64748b;
}
.time-tracking-summary-title{
    font-size: 24px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.1;
}
.time-tracking-summary-status{
    margin-top: 6px;
    font-size: 14px;
    font-weight: 700;
    color: #ef4444;
}
.time-tracking-summary-status.clocked_in,
.time-tracking-summary-status.checked_in{ color:#22c55e; }
.time-tracking-summary-status.vacation{ color:#2563eb; }
.time-tracking-summary-worked{
    margin-top: 4px;
    font-size: 13px;
    color: #64748b;
}
.time-tracking-summary-actions{
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 0 0 auto;
}
.time-tracking-sessions{
    font-size:13px;
    color:#64748b;
}
.time-tracking-sessions ul{
    margin:6px 0 0;
    padding-left:18px;
}
.time-tracking-panel{
    padding: 14px 16px;
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 12px;
    background: #fff;
}
.time-tracking-panel h4{
    margin: 0 0 8px;
    font-size: 15px;
}
.time-tracking-hint{
    margin: 0 0 12px;
    font-size: 13px;
    color: #64748b;
}
.time-tracking-form-grid{
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}
.time-tracking-form label span,
.time-tracking-notes span{
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 4px;
}
.time-tracking-form input{
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font: inherit;
}
.time-tracking-notes{
    display: block;
    margin-top: 12px;
}
.time-tracking-split{
    display: grid;
    grid-template-columns: 1.2fr .8fr;
    gap: 16px;
}
.time-tracking-week-table{
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.time-tracking-week-row{
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(0,0,0,.06);
    font-size: 13px;
}
.time-tracking-absence-list{
    margin: 0;
    padding-left: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 13px;
}
.time-tracking-empty,
.time-tracking-loading,
.time-tracking-error{
    font-size: 13px;
    color: #64748b;
}
.time-tracking-error{ color:#ef4444; }
.time-tracking-toast-container{
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 1200;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.time-tracking-toast{
    background: #0f172a;
    color: #fff;
    padding: 12px 16px;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(15,23,42,.18);
    transition: all .28s ease;
}
.time-tracking-toast.success{ background:#166534; }
.time-tracking-toast.error{ background:#991b1b; }
.btn-danger{
    background:#ef4444;
    color:#fff;
    border:none;
}
.btn-danger:hover{ background:#dc2626; }
.theme-dark .time-tracking-panel{
    background: rgba(28,28,30,0.92);
    border-color: rgba(255,255,255,0.10);
}
.theme-dark .time-tracking-summary{
    background: linear-gradient(180deg, rgba(249,115,22,.12), rgba(28,28,30,0.92));
    border-color: rgba(249,115,22,.22);
}
.theme-dark .time-tracking-summary-title{ color:#f5f5f7; }
@media (max-width: 860px){
    .time-tracking-summary{ flex-direction: column; }
    .time-tracking-split{ grid-template-columns: 1fr; }
    .time-tracking-form-grid{ grid-template-columns: 1fr; }
    .time-tracking-week-row{ grid-template-columns: 1fr; }
}

.kpi-versand-card{ min-width: 0; position: relative; }
.kpi-versand-labelrow{ display: block; }
/* Klickbares Versand-Icon (oeffnet den Lieferplan) */
.kpi-icon-btn{
    border: none;
    cursor: pointer;
    padding: 0;
    transition: transform .12s ease, filter .12s ease;
}
.kpi-icon-btn:hover{ filter: brightness(1.05); transform: translateY(-1px); }
.kpi-icon-btn:focus-visible{ outline: 2px solid #007aff; outline-offset: 2px; }

/* "Neuer Auftrag": wichtigste Pflichtfelder schwarz umranden (wie mobile Eingabemaske) */
#dashOrderModal .dash-important-input{
    border: 2px solid #111 !important;
    box-shadow: 0 0 0 1px rgba(0,0,0,.04);
}
#dashOrderModal .dash-important-input:focus{
    outline: none;
    border-color: #000 !important;
    box-shadow: 0 0 0 3px rgba(0,0,0,.12);
}
.theme-dark #dashOrderModal .dash-important-input{
    border-color: #f5f5f7 !important;
}
.theme-dark #dashOrderModal .dash-important-input:focus{
    border-color: #fff !important;
    box-shadow: 0 0 0 3px rgba(255,255,255,.18);
}
.kpi-shipping-stats{
    cursor: pointer;
    border-radius: 10px;
    transition: background .12s ease;
}
.kpi-shipping-stats:hover{ background: rgba(0,0,0,0.04); }
.theme-dark .kpi-shipping-stats:hover{ background: rgba(255,255,255,0.06); }
/* Lieferplan-Button absolut oben rechts, damit die Zahlen exakt mit Rechnungen fluchten */
.kpi-versand-labelrow .delivery-plan-btn{
    position: absolute;
    top: 12px;
    right: 14px;
    margin-left: 0;
    padding: 5px 10px;
    font-size: 11px;
}
@media (max-width: 900px){
    .dash-kpis{ grid-template-columns: repeat(2, 1fr); }
    .kpi-card{ height: auto; min-height: 70px; }
    .kpi-tech-panel{ grid-column: 1 / -1; }
    .kpi-tech-panel-grid{ flex-wrap: wrap; }
    .kpi-tech-card{ flex: 1 1 calc(50% - 4px); min-width: 88px; }
    .kpi-tech-overview-card{ grid-column: 1 / -1; }
    .kpi-tech-overview-list{ flex-wrap: wrap; row-gap: 14px; }
    .kpi-tech-item{ flex-basis: calc(50% - 1px); }
}
@media (max-width: 760px){
    .dash-kpis{ grid-template-columns: 1fr; }
    .kpi-tech-overview-top{ flex-wrap: wrap; }
    .kpi-tech-overview-list{ flex-wrap: wrap; row-gap: 6px; }
    .kpi-tech-item{ width: calc(50% - 1px); }
    .kpi-tech-item:nth-child(odd){ border-left: none; }
}

.dash-body{
    display:flex;
    gap: 24px;
    min-height: 0;
    flex: 1;
}

/* ===== Techniker-Abgaben Leiste ===== */
.delivery-bar{
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 10px 0 2px;
    padding: 8px 12px;
    border-radius: 14px;
    background: rgba(255,255,255,0.78);
    border: 0.5px solid rgba(0,0,0,0.08);
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
}
.delivery-bar-label{
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #8e8e93;
}
.delivery-tech-pills{
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}
.delivery-tech-pill{
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1px solid rgba(0,0,0,0.12);
    background: #fff;
    color: #1d1d1f;
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.delivery-tech-pill .pill-dot{
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: #c7c7cc;
    flex: none;
}
.delivery-tech-pill[data-tech="Oli"] .pill-dot{ background: #34c759; }
.delivery-tech-pill[data-tech="Sergey"] .pill-dot{ background: #af52de; }
.delivery-tech-pill[data-tech="Alex"] .pill-dot{ background: #007aff; }
.delivery-tech-pill[aria-pressed="true"]{
    background: #007aff;
    border-color: #007aff;
    color: #fff;
}
.delivery-tech-pill[aria-pressed="true"] .pill-dot{ background: rgba(255,255,255,0.9); }
.delivery-plan-btn{
    margin-left: auto;
    border: 1px solid rgba(0,122,255,0.28);
    background: rgba(0,122,255,0.08);
    color: #0057d9;
    border-radius: 999px;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}
.delivery-plan-btn:hover{ background: rgba(0,122,255,0.14); }
.delivery-plan-count{
    margin-left: auto;
    color: #007aff;
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
}
.delivery-tech-pills--modal{ margin-left: 8px; }
.theme-dark .delivery-bar{ background: rgba(28,28,30,0.7); border-color: rgba(255,255,255,0.10); }
.theme-dark .delivery-tech-pill{ background: rgba(44,44,46,0.95); border-color: rgba(255,255,255,0.14); color: #e5e5ea; }
.theme-dark .delivery-tech-pill[aria-pressed="true"]{ background: #0a84ff; border-color: #0a84ff; color: #fff; }

/* ===== Lieferplan: grosses Fenster + 2 Wochen auf einen Blick ===== */
#dashDeliveryPlanModal .modal-content.delivery-plan-modal-content{
    width: 96vw;
    max-width: 1360px;
    height: 92vh;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
}
.delivery-plan-body{
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 12px 20px 8px;
}
.delivery-plan-body .ship-week-toolbar{ flex: 0 0 auto; }
.delivery-plan-grid{
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 12px;
    align-content: start;
    padding: 2px;
}
.delivery-plan-grid .ship-week-day{
    min-width: 0;
    max-width: none;
    min-height: 150px;
}
@media (max-width: 1180px){
    .delivery-plan-grid{ grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (max-width: 820px){
    .delivery-plan-grid{ grid-template-columns: repeat(3, minmax(0, 1fr)); }
    #dashDeliveryPlanModal .modal-content.delivery-plan-modal-content{ width: 98vw; height: 94vh; }
}

/* ===== Inline 2-Wochen-Plan (Umschalter Liste/Plan, TV-Kiosk) ===== */
.delivery-inline-plan{ margin-top: 4px; }
.delivery-inline-plan-head{
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin: 4px 2px 14px;
}
.delivery-inline-plan-titles{ display: flex; flex-direction: column; gap: 2px; }
.delivery-inline-plan-meta{ font-size: 14px; font-weight: 800; color: #1d1d1f; }
.delivery-inline-plan-count{ font-size: 12px; font-weight: 600; color: #8e8e93; }
.delivery-inline-plan .delivery-plan-grid{
    flex: none;
    overflow: visible;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}
.theme-dark .delivery-inline-plan-meta{ color: #f5f5f7; }

/* Klickbare Plan-Kacheln (oeffnen die Karteikarte wie in der Liste) */
.ship-week-item.is-clickable{
    cursor: pointer;
    transition: background .12s ease, transform .12s ease, box-shadow .12s ease;
}
.ship-week-item.is-clickable:hover{
    background: rgba(0,122,255,0.08);
    transform: translateY(-1px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}
.ship-week-item.is-clickable:focus-visible{
    outline: 2px solid #007aff;
    outline-offset: 2px;
}
.theme-dark .ship-week-item.is-clickable:hover{ background: rgba(10,132,255,0.18); }

/* Rechnungs-Kacheln (Meli-Ansicht): oranger Akzent wie Rechnungen-KPI */
.ship-week-item.is-invoice{
    border-left: 3px solid #ff9500;
}
.ship-week-item.is-invoice.is-clickable:hover{ background: rgba(255,149,0,0.10); }
.theme-dark .ship-week-item.is-invoice{ border-left-color: #ffd60a; }
.theme-dark .ship-week-item.is-invoice.is-clickable:hover{ background: rgba(255,214,10,0.16); }

/* Meli-Kalender: Sektion "Aelter als 2 Wochen" ueber volle Breite, Kacheln fliessend */
.delivery-plan-grid .ship-week-day.is-older-col{
    grid-column: 1 / -1;
    min-height: 0;
}
.ship-week-older-list{
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.invoice-list-row{
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border: 1px solid rgba(0,0,0,0.08);
    border-left: 3px solid #ff9500;
    border-radius: 10px;
    background: rgba(255,255,255,0.86);
    cursor: pointer;
    transition: background .12s ease;
}
.invoice-list-row:hover{ background: rgba(255,149,0,0.10); }
.invoice-list-row:focus-visible{ outline: 2px solid #007aff; outline-offset: 2px; }
.invoice-row-patient{ font-weight: 800; color: #1d1d1f; min-width: 0; flex: 0 1 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.invoice-row-dentist{ color: #6e6e73; min-width: 0; flex: 1 1 auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.invoice-row-units{ color: #1d1d1f; font-weight: 700; flex: 0 0 auto; white-space: nowrap; }
.invoice-row-tech{ flex: 0 0 auto; display: flex; gap: 4px; }
.invoice-row-date{ color: #8e8e93; font-weight: 600; flex: 0 0 auto; white-space: nowrap; }
.theme-dark .invoice-list-row{ background: rgba(36,36,38,0.95); border-color: rgba(255,255,255,0.10); border-left-color: #ffd60a; }
.theme-dark .invoice-list-row:hover{ background: rgba(255,214,10,0.16); }
.theme-dark .invoice-row-patient,
.theme-dark .invoice-row-units{ color: #f5f5f7; }
@media (max-width: 700px){
    .invoice-row-dentist{ display: none; }
}

/* Rechnungs-Zusammenfassung (Meli) */
#dashInvoiceSummaryModal .invoice-summary-content{ width: 92vw; max-width: 640px; }
.invoice-summary-facts{
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 18px;
    margin-bottom: 16px;
}
.invoice-summary-fact-label{
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #8e8e93;
}
.invoice-summary-fact-value{
    font-size: 15px;
    font-weight: 700;
    color: #1d1d1f;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}
.invoice-summary-section-title{
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #8e8e93;
    margin: 6px 0 8px;
}
.invoice-summary-footer{ display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.theme-dark .invoice-summary-fact-value{ color: #f5f5f7; }

/* ===== Lieferplan: Spalten-Highlights (reuse ship-week-*) ===== */
.ship-week-day.is-overdue{
    background: rgba(255,59,48,0.07);
    border-color: rgba(255,59,48,0.28);
}
.ship-week-day.is-overdue .ship-week-day-name{ color: #c4261d; }
.ship-week-day.is-tomorrow{
    background: rgba(0,122,255,0.06);
    border-color: rgba(0,122,255,0.30);
}
.ship-week-day.is-tomorrow .ship-week-day-name{ color: #0057d9; }
.ship-week-item-initials{
    font-size: 10px;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.15;
    min-width: 0;
    flex: 1;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #1d1d1f;
}
.theme-dark .ship-week-item-initials{ color: #f5f5f7; }
.theme-dark .ship-week-day.is-overdue{ background: rgba(255,69,58,0.14); border-color: rgba(255,69,58,0.34); }
.theme-dark .ship-week-day.is-tomorrow{ background: rgba(10,132,255,0.14); border-color: rgba(10,132,255,0.34); }

/* ===== Abgaben-Banner (taegliche Erinnerung) ===== */
.delivery-banner-backdrop{
    position: fixed;
    inset: 0;
    z-index: 2400;
    background: rgba(0,0,0,0.35);
    backdrop-filter: blur(3px);
}
.delivery-banner{
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 2410;
    width: min(640px, 92vw);
    max-height: 84vh;
    overflow: auto;
    background: rgba(255,255,255,0.98);
    color: #1d1d1f;
    border-radius: 22px;
    box-shadow: 0 24px 70px rgba(0,0,0,0.28);
    padding: 24px 26px 18px;
}
.delivery-banner h2{
    margin: 0 0 14px;
    text-align: center;
    font-size: 26px;
    font-weight: 1000;
    letter-spacing: -0.3px;
}
.delivery-banner-section{ margin-top: 14px; }
.delivery-banner-section-title{
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #6e6e73;
    margin-bottom: 8px;
}
.delivery-banner-section.is-overdue .delivery-banner-section-title{ color: #c4261d; }
.delivery-banner-row{
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    color: inherit;
    font: inherit;
    text-align: left;
    padding: 10px 12px;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 14px;
    background: rgba(248,249,250,0.92);
    margin-bottom: 8px;
}
.delivery-banner-row.is-clickable{
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.delivery-banner-row.is-clickable:hover,
.delivery-banner-row.is-clickable:focus-visible{
    border-color: rgba(0,122,255,0.42);
    box-shadow: 0 5px 16px rgba(0,122,255,0.12);
    transform: translateY(-1px);
    outline: none;
}
.delivery-banner-row:disabled{
    cursor: default;
    opacity: .72;
}
.delivery-banner-row.is-overdue{
    border-color: rgba(255,59,48,0.28);
    background: rgba(255,59,48,0.06);
}
.delivery-banner-initials{ font-size: 10px; font-weight: 800; letter-spacing: -0.02em; min-width: 48px; }
.delivery-banner-dentist{ flex: 1; min-width: 0; font-weight: 700; }
.delivery-banner-patient{ color: #6e6e73; font-weight: 600; }
.delivery-banner-time{
    border-radius: 999px;
    background: rgba(0,122,255,0.10);
    color: #007aff;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}
.delivery-banner-row.is-overdue .delivery-banner-time{ background: rgba(255,59,48,0.12); color: #c4261d; }
.delivery-banner-open{
    color: #007aff;
    font-size: 12px;
    font-weight: 850;
    white-space: nowrap;
}
.delivery-banner-row:disabled .delivery-banner-open{ color: #8e8e93; }
.delivery-banner-footnote{
    margin-top: 12px;
    color: #8e8e93;
    font-size: 13px;
    font-weight: 700;
}
.delivery-banner-actions{
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}
.delivery-banner-empty{
    text-align: center;
    color: #6e6e73;
    font-weight: 700;
    padding: 10px 0 4px;
}
.theme-dark .delivery-banner{ background: rgba(28,28,30,0.98); color: #f5f5f7; }
.theme-dark .delivery-banner-row{ background: rgba(255,255,255,0.07); border-color: rgba(255,255,255,0.12); }
.theme-dark .delivery-banner-patient,
.theme-dark .delivery-banner-footnote{ color: #a1a1a6; }

/* Orders Section (Left Column) */
.orders-section {
    flex: 2;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    padding: 20px;
    border-radius: 16px;
    border: 0.5px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
    overflow-y: auto;
    overflow-x: hidden; /* verhindert horizontalen Scrollbalken unten */
    display: flex;
    flex-direction: column;
}

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

/* Fallbacks für Browser ohne Flexbox-Gap (z. B. einige TV-Browser) */
.header-right > * + * { margin-left: 36px; }
.section-actions > * + * { margin-left: 28px; }
.section-actions > * { margin-bottom: 6px; }

/* Wenn gap unterstützt wird, die Fallback-Margins entfernen */
@supports (gap: 1rem) {
    .header-right > * + * { margin-left: 0; }
    .section-actions > * + * { margin-left: 0; }
    .section-actions > * { margin-bottom: 0; }
}

/* Header: responsive, ohne Layout-/Funktionsänderung (nur damit nichts abgeschnitten wird) */
@media (max-width: 1100px) {
    .header { padding-left: 24px; padding-right: 24px; }
    .header-right { gap: 18px; }
    .header-right .order-count { font-size: 16px; }
}

@media (max-width: 600px) {
    .header-right { gap: 12px; }
    .header-right .order-count { font-size: 14px; }
}

@media (max-width: 926px) and (orientation: landscape) {
    .header-right { gap: 12px; }
    .header-right .order-count { font-size: 14px; }
}

/* Fallback-Abstände (nur wenn gap NICHT unterstützt wird) auch responsiv verkleinern */
@supports not (gap: 1rem) {
    @media (max-width: 1100px) { .header-right > * + * { margin-left: 18px; } }
    @media (max-width: 600px) { .header-right > * + * { margin-left: 12px; } }
    @media (max-width: 926px) and (orientation: landscape) { .header-right > * + * { margin-left: 12px; } }
}

/* Dashboard Add Buttons */
.btn-add-dashboard { background:#111; color:#fff; border:none; padding:12px 16px; border-radius:8px; font-size:14px; font-weight:600; cursor:pointer; transition: background .15s ease, transform .15s ease; min-height:44px; }
.btn-add-dashboard:hover { background:#000; transform: translateY(-1px); }

.section-header h2 { font-size: 20px; font-weight: 600; }
.section-header h3 { font-size: 16px; font-weight: 600; }

/* Navigation Buttons (Screenshot-Style) */
.btn-pill{
    background: #fff;
    border: 1px solid rgba(0,0,0,0.12);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    color: #1d1d1f;
    cursor: pointer;
    transition: all 0.15s ease;
}
.btn-pill:hover{ background: #f5f5f7; }
.theme-dark .btn-pill{ background: #2c2c2e; border-color: rgba(255,255,255,0.12); color: #f5f5f7; }
.theme-dark .btn-pill:hover{ background: #3a3a3c; }

.nav-arrows{
    display: flex;
    gap: 0;
    border: 1px solid rgba(0,0,0,0.12);
    border-radius: 8px;
    overflow: hidden;
}
.btn-nav{
    background: #fff;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    color: #6e6e73;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-nav + .btn-nav{ border-left: 1px solid rgba(0,0,0,0.08); }
.btn-nav:hover{ background: #f5f5f7; color: #1d1d1f; }
.btn-nav:disabled, .btn-nav[aria-disabled="true"]{ opacity: 0.4; cursor: default; }
.btn-nav.active{ background: #007aff; color: #fff; }
.btn-nav.active:hover{ background: #0066d6; }
.theme-dark .nav-arrows{ border-color: rgba(255,255,255,0.12); }
.theme-dark .btn-nav{ background: #2c2c2e; color: #8e8e93; }
.theme-dark .btn-nav + .btn-nav{ border-left-color: rgba(255,255,255,0.08); }
.theme-dark .btn-nav:hover{ background: #3a3a3c; color: #f5f5f7; }
.theme-dark .btn-nav.active{ background: #0a84ff; color: #fff; }
.theme-dark .btn-nav.active:hover{ background: #409cff; }

/* Versand-Toggle (Text-Button in der Gruppe) */
#toggleShipped.btn-nav{
    width: auto;
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 700;
    color: #1d1d1f;
    position: relative;
    z-index: 25;
    pointer-events: auto;
}
.theme-dark #toggleShipped.btn-nav{ color: #f5f5f7; }
#toggleShipped[aria-pressed="true"]{ background: #007aff; color: #fff; }
.theme-dark #toggleShipped[aria-pressed="true"]{ background: #0a84ff; color: #fff; }

/* "+" Button (schwarzer Квадрат) */
.btn-add-order{
    background: #111;
    color: #fff;
    font-size: 20px;
    font-weight: 300;
    min-width: 36px;
}
.btn-add-order:hover{ background: #000; color: #fff; }
.theme-dark .btn-add-order{ background: #1c1c1e; color: #f5f5f7; border:1px solid rgba(255,255,255,0.10); }
.theme-dark .btn-add-order:hover{ background: #2c2c2e; color: #fff; }

/* Text-Buttons in nav-arrows zentrieren */
.btn-nav.btn-nav-text{ justify-content: center; }

/* Table Styles */
.table-container {
    background: transparent;
    border-radius: 12px;
    overflow-y: auto;
    overflow-x: hidden; /* keine horizontale Leiste */
    flex: 1;
    min-height: 400px; /* Layout stabil halten, auch bei 0 Suchtreffern (kein Sprung) */
    max-height: calc(100vh - 360px);
}

/* "Keine Ergebnisse"-Zeile: haelt die Tabelle sichtbar auf Hoehe */
.orders-empty-cell {
    padding: 48px 16px !important;
    text-align: center;
    color: #8e8e93;
    font-weight: 600;
    font-size: 14px;
}
.theme-dark .orders-empty-cell { color: #a1a1a6; }
/* Im mobilen Karten-Layout (tr als Grid) Platzhalter ueber volle Breite */
#ordersTableBody tr.orders-empty-row { grid-template-columns: 1fr !important; grid-template-areas: none !important; }
#ordersTableBody tr.orders-empty-row td { grid-area: auto !important; }

.orders-table {
    width: 100%;
    border-collapse: separate; /* zurück: kein Gitternetz */
    border-spacing: 0; /* kompakt, ohne vertikales Gitter */
    table-layout: fixed;
}

.orders-table th {
    background: rgba(248, 249, 250, 0.8);
    padding: 4px 8px;
    text-align: left;
    font-weight: 600;
    font-size: 16px;
    color: #6e6e73;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-bottom: 0.5px solid rgba(0, 0, 0, 0.1); /* nur unten, keine Box */
    position: sticky;
    top: 0;
    z-index: 10;
}

/* Spaltenbreiten definieren */
.orders-table .col-ter, .orders-table .cell-ter { width: 100px; }
.orders-table .col-einh, .orders-table .cell-einh { width: 60px; text-align: center; }
.orders-table .col-behandler, .orders-table .cell-behandler { width: 180px; }
.notizen-inner{ display: inline-flex; align-items: center; gap: 4px; max-width: 100%; min-width: 0; }
.attachment-slot{ display: inline-flex; align-items: center; justify-content: center; width: 16px; min-width: 16px; flex-shrink: 0; }
.attachment-inline{ font-size: 13px; text-decoration: none; line-height: 1; }
.orders-table .col-notizen, .orders-table .cell-notizen { flex: 1; }
.orders-table .col-tech, .orders-table .cell-tech { width: 72px; text-align: right; padding-right: 8px; }
.orders-table .col-status, .orders-table .cell-status { width: 100px; text-align: right; }

/* Termin-Zelle: Datum + Uhrzeit inline */
.cell-ter{
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}
.ter-date{ font-weight: 700; color: #1d1d1f; }
.ter-time{ color: #8e8e93; margin-left: 4px; }
.theme-dark .ter-date{ color: #f5f5f7; }
.theme-dark .ter-time{ color: #8e8e93; }
.appointment-chip{
    display:block;
    width:max-content;
    max-width:110px;
    margin-top:4px;
    padding:2px 7px;
    border-radius:999px;
    background:rgba(0,122,255,0.10);
    color:#007aff;
    border:1px solid rgba(0,122,255,0.16);
    font-size:10px;
    font-weight:850;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}
.theme-dark .appointment-chip{background:rgba(100,210,255,0.14);border-color:rgba(100,210,255,0.20);color:#64d2ff}

/* Einheiten */
.units-number{
    font-size: 15px;
    font-weight: 600;
    color: #1d1d1f;
}
.theme-dark .units-number{ color: #f5f5f7; }

/* Notizen farbig */
.cell-notizen{
    font-size: 14px;
    color: #6e6e73;
}
.cell-notizen.note-urgent{
    color: #ff6b35;
    font-weight: 500;
}
.theme-dark .cell-notizen{ color: #8e8e93; }
.theme-dark .cell-notizen.note-urgent{ color: #ff9f1c; }

/* Notiz-Chip (wie Screenshot) */
.note-chip{
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 214, 10, 0.22);
    border: 1px solid rgba(255, 214, 10, 0.30);
    color: #6b4e00;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}
.note-chip--empty{
    background: rgba(0,0,0,0.04);
    border-color: rgba(0,0,0,0.08);
    color: #8e8e93;
    font-weight: 750;
}
.theme-dark .note-chip{
    background: rgba(255, 214, 10, 0.16);
    border-color: rgba(255, 214, 10, 0.26);
    color: #ffd60a;
}
.theme-dark .note-chip--empty{
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.12);
    color: #a1a1a6;
}

/* Status als Pill */
.status-pill{
    display: inline-block;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}
.status-pill.status-neu{ background: #e8f5e9; color: #2e7d32; }
.status-pill.status-in-arbeit{ background: #fff3e0; color: #ef6c00; }
.status-pill.status-fertig{ background: #e3f2fd; color: #1976d2; }
.status-pill.status-versandt{ background: #f3e5f5; color: #7b1fa2; }
.theme-dark .status-pill.status-neu{ background: rgba(46,125,50,0.2); color: #81c784; }
.theme-dark .status-pill.status-in-arbeit{ background: rgba(239,108,0,0.2); color: #ffb74d; }
.theme-dark .status-pill.status-fertig{ background: rgba(25,118,210,0.2); color: #64b5f6; }
.theme-dark .status-pill.status-versandt{ background: rgba(123,31,162,0.2); color: #ba68c8; }

/* Kulanz Badge */
.kulanz-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    background: #fff3e0;
    color: #e67e22;
    margin-right: 6px;
    white-space: nowrap;
}
.theme-dark .kulanz-badge {
    background: rgba(230, 126, 34, 0.2);
    color: #f5a623;
}

/* Auftrags-Menü Button (bei versandten Aufträgen) */
.order-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin-left: 6px;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: #f5f5f5;
    color: #666;
    cursor: pointer;
    transition: all 0.15s ease;
    vertical-align: middle;
}
.order-menu-btn:hover {
    background: #e0e0e0;
    color: #333;
}
.theme-dark .order-menu-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #aaa;
}
.theme-dark .order-menu-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* Versand Button */
.ship-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #4caf50 0%, #2e7d32 100%);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}
.ship-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}
.ship-btn:active {
    transform: translateY(0);
}
.theme-dark .ship-btn {
    background: linear-gradient(135deg, #66bb6a 0%, #388e3c 100%);
    box-shadow: 0 2px 8px rgba(102, 187, 106, 0.3);
}

/* Legacy */
.orders-table th:nth-child(1), .orders-table td:nth-child(1) { width: 100px; }
.orders-table th:nth-child(2), .orders-table td:nth-child(2) { width: 60px; }
.orders-table th:nth-child(3), .orders-table td:nth-child(3) { width: 12%; }
.orders-table th:nth-child(4), .orders-table td:nth-child(4) { width: 12%; }
.orders-table th:nth-child(5), .orders-table td:nth-child(5) { width: 14%; }
.orders-table th:nth-child(6), .orders-table td:nth-child(6) { width: 30%; }
.orders-table th:nth-child(7), .orders-table td:nth-child(7) { width: 11%; }
.orders-table th:nth-child(8), .orders-table td:nth-child(8) { width: 11%; }

/* Dashboard Table v2 (Screenshot-like columns) */
.orders-table--v2 th{ font-size: 13px; padding: 10px 10px; }
.orders-table--v2 td{ padding: 10px 10px; font-size: 14px; }
.orders-table--v2 th:nth-child(1), .orders-table--v2 td:nth-child(1) { width: 12%; }
.orders-table--v2 th:nth-child(2), .orders-table--v2 td:nth-child(2) { width: 8%; }
.orders-table--v2 th:nth-child(3), .orders-table--v2 td:nth-child(3) { width: 26%; }
.orders-table--v2 th:nth-child(4), .orders-table--v2 td:nth-child(4) { width: 28%; }
.orders-table--v2 th:nth-child(5), .orders-table--v2 td:nth-child(5) { width: 14%; }
.orders-table--v2 th:nth-child(6), .orders-table--v2 td:nth-child(6) { width: 12%; }

/* Behandler / Patient cell - nebeneinander */
.client-cell{ display:flex; flex-direction:row; gap:6px; align-items:baseline; line-height:1.3; flex-wrap:wrap; }
.client-dentist{ font-weight: 800; color:#111; }
.client-dentist::after{ content:" •"; color:#8e8e93; font-weight:400; }
.client-patient{ color:#6e6e73; font-weight: 650; }
.theme-dark .client-dentist{ color:#e5e5ea; }
.theme-dark .client-patient{ color:#a1a1a6; }

/* Technician initials chips */
.tech-initials{ display:flex; align-items:center; justify-content:flex-end; gap:8px; flex-wrap: wrap; }
.tech-chip{
    width: 30px;
    height: 30px;
    border-radius: 9999px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    font-weight: 900;
    font-size: 11px;
    letter-spacing: .02em;
    border: 1px solid rgba(0,0,0,0.12);
    background: rgba(248,249,250,0.9);
    color:#111;
}
.theme-dark .tech-chip{ background: rgba(28,28,30,0.9); border-color: rgba(255,255,255,0.1); color:#e5e5ea; }
.tech-chip.oli{ background:#fff5cc; border-color:#ffe58f; }
.tech-chip.sergey{ background:#eaffea; border-color:#b7f5c0; }
.tech-chip.alex{ background:#ffe6f1; border-color:#ffc2d8; }
.theme-dark .tech-chip.oli{ background: rgba(255,214,10,0.18); border-color: rgba(255,214,10,0.35); color:#ffd60a; }
.theme-dark .tech-chip.sergey{ background: rgba(48,209,88,0.18); border-color: rgba(48,209,88,0.35); color:#30d158; }
.theme-dark .tech-chip.alex{ background: rgba(255,45,85,0.18); border-color: rgba(255,45,85,0.35); color:#ff2d55; }
.tech-chip.unassigned{ background: rgba(255,149,0,0.12); border-color: rgba(255,149,0,0.3); color:#ff9500; }

/* erste/letzte Kopfzelle werden über Zeilenlinien gestaltet */

/* Attachments: Preview/Icons (Dashboard + Detail Modal) */
.attachment-preview{
    margin-top: 10px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.attachment-item{ display:flex; }
.attachment-pill{
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(0,0,0,0.10);
    background: rgba(255,255,255,0.92);
    max-width: 100%;
}
.attachment-ico{ font-size: 14px; }
.attachment-name{
    font-size: 12px;
    font-weight: 850;
    color: #111;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 260px;
}
.attachment-link{
    text-decoration: none;
    color: inherit;
    font-weight: 1000;
}
.attachment-del{
    margin-left: auto;
    border: none;
    background: transparent;
    color: #ff3b30;
    font-size: 16px;
    font-weight: 1000;
    cursor: pointer;
    line-height: 1;
}
.theme-dark .attachment-pill{
    border-color: rgba(255,255,255,0.12);
    background: rgba(28,28,30,0.72);
}
.theme-dark .attachment-name{ color:#e5e5ea; }

/* Attachments: Thumbnail Grid (Detail Modal) */
.attachment-preview--grid{
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.attach-tile{
    position: relative;
    display: grid;
    grid-template-rows: 54px auto;
    gap: 6px;
    align-items: start;
}
.attach-thumb{
    display: block;
    width: 100%;
    height: 54px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.12);
    background: rgba(0,0,0,0.04);
}
.attach-thumb img{
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.attach-fallback{
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    font-size: 18px;
    font-weight: 900;
    color: #111;
}
.attach-caption{
    font-size: 12px;
    font-weight: 850;
    color: #111;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 28px;
}
.attach-remove{
    position: absolute;
    right: 6px;
    top: 6px;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    border: 1px solid rgba(0,0,0,0.12);
    background: rgba(255,255,255,0.9);
    color: #ff3b30;
    font-weight: 1000;
    cursor: pointer;
    line-height: 1;
}
.attach-tile--broken .attach-thumb{ background: rgba(255,59,48,0.08); }
.theme-dark .attach-thumb{ border-color: rgba(255,255,255,0.12); background: rgba(255,255,255,0.06); }
.theme-dark .attach-caption{ color:#e5e5ea; }
.theme-dark .attach-remove{ border-color: rgba(255,255,255,0.14); background: rgba(28,28,30,0.85); }

.orders-table td {
    padding: 6px 8px;
    font-size: 14px;
    vertical-align: middle;
    background: rgba(255, 255, 255, 0.8);
    line-height: 1.3;
    position: relative;
    border: none; /* keine Zell-Gitterlinien */
}

.orders-table tbody tr {
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.orders-table tbody tr td:first-child { 
    box-shadow: inset 1px 0 0 rgba(0, 0, 0, 0.08); /* linke Außenkante */
}
.orders-table tbody tr td:last-child  { 
    box-shadow: inset -1px 0 0 rgba(0, 0, 0, 0.08); /* rechte Außenkante */
}

/* seitliche Linien werden über first/last geregelt */

/* durchgehende Top-/Bottom-Linien je Zeile */
.orders-table tbody tr td::before,
.orders-table tbody tr td::after {
    content: "";
    position: absolute;
    left: -1px; /* minimal überlappen, verhindert Fugen */
    right: -1px;
    pointer-events: none;
}
.orders-table tbody tr td::before { top: 0; border-top: 1px solid rgba(0, 0, 0, 0.08); }
.orders-table tbody tr td::after  { bottom: 0; border-bottom: 1px solid rgba(0, 0, 0, 0.08); }

.orders-table tbody tr:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0,0,0,0.06); }
.orders-table tbody tr:hover td { background: rgba(0,0,0,0.02); }
.orders-table tr.order-highlight { animation: none; }
.orders-table tr.order-highlight td { background: rgba(10,132,255,0.12) !important; }
.theme-dark .orders-table tr.order-highlight td { background: rgba(10,132,255,0.18) !important; }
@keyframes orderFlash { 0%{background:rgba(10,132,255,0.15);} 100%{background:transparent;} }

/* Hover-Farbe für durchgehende Linien anpassen */
.orders-table tbody tr:hover td:first-child { box-shadow: inset 1px 0 0 rgba(0, 122, 255, 0.2); }
.orders-table tbody tr:hover td:last-child  { box-shadow: inset -1px 0 0 rgba(0, 122, 255, 0.2); }
.orders-table tbody tr:hover td::before   { border-top-color: rgba(0, 122, 255, 0.2); }
.orders-table tbody tr:hover td::after    { border-bottom-color: rgba(0, 122, 255, 0.2); }

/* Status Pills */
.status-fertig {
    background: rgba(52, 199, 89, 0.1);
    color: #34c759;
    padding: 4px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: capitalize;
}

.status-in-arbeit {
    background: rgba(255, 149, 0, 0.1);
    color: #ff9500;
    padding: 4px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: capitalize;
}

.status-neu {
    background: rgba(0, 122, 255, 0.1);
    color: #007aff;
    padding: 4px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: capitalize;
}

.status-versandt {
    background: rgba(142, 142, 147, 0.1);
    color: #8e8e93;
    padding: 4px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: capitalize;
}

/* Clickable Elements */
.status-clickable {
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.status-clickable:hover { transform: scale(1.02); box-shadow: none; }

/* Dashboard: Delete-Button in Zeile */
.status-actions { display:flex; align-items:center; justify-content: space-between; width: 100%; gap:8px; }
.btn-row-delete { background: transparent; color:#1d1d1f; border:1px solid rgba(0,0,0,0.16); border-radius:6px; padding:2px 6px; cursor:pointer; transition: all 0.15s ease; font-size: 0; display:inline-flex; align-items:center; justify-content:center; }
.btn-row-delete:hover { background: rgba(0,0,0,0.03); transform: translateY(-1px); }
.btn-row-delete svg { width:16px; height:16px; stroke:#1d1d1f; }

/* Sicherstellen, dass der Delete-Button in der Status-Spalte sichtbar bleibt */
.orders-table td:last-child { white-space: nowrap; }

.notes-clickable {
    cursor: pointer;
    transition: color 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: normal;
    hyphens: none;
}
/* Anhang-Icon in Notizen: inline und ohne Zeilenumbruch */
.notes-clickable a { display: inline-block; vertical-align: middle; margin-left: 6px; }

.notes-clickable:hover { color: #007aff; }
.timeline-inline-btn{
    width: 22px;
    height: 22px;
    border-radius: 999px;
    border: 1px solid rgba(0,122,255,.22);
    background: rgba(0,122,255,.10);
    color: #007aff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
    flex: 0 0 auto;
}
.timeline-inline-btn:hover{
    background: #007aff;
    color: #fff;
}
.theme-dark .timeline-inline-btn{
    border-color: rgba(10,132,255,.35);
    background: rgba(10,132,255,.18);
    color: #66b7ff;
}

/* Dashboard Notiz-Editor */
.dash-note-editor-backdrop{
    position: fixed;
    inset: 0;
    z-index: 2200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0,0,0,.42);
    backdrop-filter: blur(10px);
}
.dash-note-editor-dialog{
    width: min(760px, 96vw);
    max-height: min(82vh, 760px);
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 22px;
    border-radius: 18px;
    background: rgba(255,255,255,.98);
    border: 1px solid rgba(0,0,0,.10);
    box-shadow: 0 24px 80px rgba(0,0,0,.28);
}
.dash-note-editor-dialog h3{
    margin: 0;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -.02em;
}
.dash-note-editor-context{
    color: #6e6e73;
    font-size: 13px;
    font-weight: 700;
}
.dash-note-editor-textarea{
    width: 100%;
    min-height: 260px;
    max-height: 52vh;
    resize: vertical;
    overflow: auto;
    padding: 14px 16px;
    border: 1px solid rgba(0,0,0,.16);
    border-radius: 12px;
    background: #fff;
    color: #1d1d1f;
    font: inherit;
    font-size: 15px;
    line-height: 1.45;
}
.dash-note-editor-textarea:focus{
    outline: 3px solid rgba(0,122,255,.18);
    border-color: #007aff;
}
.dash-note-editor-actions{
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.dash-note-editor-actions button{
    min-height: 44px;
    justify-content: center;
}
.dash-record-note-btn{
    width: 100%;
    min-height: 44px;
    margin: 0 0 10px;
    border: none;
    border-radius: 12px;
    background: #0a84ff;
    color: #fff;
    font-weight: 800;
    font-size: 14px;
    cursor: pointer;
}
.dash-record-note-btn:hover{ background:#006fe6; }
.dash-dictation-overlay{
    position: fixed;
    inset: 0;
    z-index: 2600;
    background: rgba(15,23,42,.42);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
}
.dash-dictation-dialog{
    width: min(620px, 96vw);
    max-height: 92vh;
    overflow: auto;
    background: #fff;
    border-radius: 18px;
    border: 1px solid rgba(15,23,42,.08);
    box-shadow: 0 24px 70px rgba(15,23,42,.24);
    padding: 22px;
}
.dash-dictation-dialog h3{ margin:0 0 8px; font-size:18px; }
.dash-dictation-consent{
    margin: 0 0 14px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255,149,0,.10);
    border: 1px solid rgba(255,149,0,.18);
    color: #6b4b13;
    font-size: 13px;
    font-weight: 700;
}
.dash-dictation-controls{ display:grid; grid-template-columns:minmax(0,1fr) 110px; gap:10px; margin-bottom:10px; }
.dash-dictation-status{ min-height:18px; margin:0 0 10px; color:#6b7280; font-size:12px; font-weight:700; }
.dash-dictation-status.ok{ color:#1f8f3a; }
.dash-dictation-status.error{ color:#d14545; }
.dash-dictation-dialog textarea{
    width:100%;
    min-height:150px;
    border:1px solid rgba(0,0,0,.12);
    border-radius:14px;
    padding:12px;
    font:inherit;
    resize:vertical;
}
.dash-transcript-preview{
    margin-top: 12px;
    padding: 12px;
    border-radius: 14px;
    background: rgba(10,132,255,.06);
    border: 1px solid rgba(10,132,255,.12);
    color: #374151;
    font-size: 13px;
    line-height: 1.45;
}
.dash-transcript-preview.hidden{ display:none; }
.dash-transcript-preview strong{ display:block; margin-top:8px; }
.dash-dictation-actions{ display:flex; justify-content:flex-end; gap:10px; margin-top:14px; }
.theme-dark .dash-note-editor-dialog{
    background: rgba(22,22,24,.98);
    border-color: rgba(255,255,255,.12);
    color: #f5f5f7;
}
.theme-dark .dash-note-editor-context{ color: #a1a1a6; }
.theme-dark .dash-note-editor-textarea{
    background: rgba(255,255,255,.08);
    border-color: rgba(255,255,255,.16);
    color: #f5f5f7;
}
.theme-dark .dash-dictation-dialog{ background:#1c1c1e; color:#f5f5f7; border-color:rgba(255,255,255,.10); }
.theme-dark .dash-dictation-dialog textarea{ background:rgba(255,255,255,.08); color:#fff; border-color:rgba(255,255,255,.14); }
.theme-dark .dash-transcript-preview{ background:rgba(100,210,255,.10); border-color:rgba(100,210,255,.16); color:#d1d5db; }

/* Dashboard Gesprächsverlauf Drawer */
.dash-timeline-backdrop{
    position: fixed;
    inset: 0;
    z-index: 2300;
    background: rgba(0,0,0,.24);
    backdrop-filter: blur(4px);
}
.dash-timeline-drawer{
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 2310;
    width: min(520px, 96vw);
    display: flex;
    flex-direction: column;
    background: rgba(255,255,255,.98);
    color: #1d1d1f;
    border-left: 1px solid rgba(0,0,0,.10);
    box-shadow: -24px 0 70px rgba(0,0,0,.22);
}
.dash-timeline-head{
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 22px 22px 16px;
    border-bottom: 1px solid rgba(0,0,0,.08);
}
.dash-timeline-kicker{
    display: inline-flex;
    margin-bottom: 6px;
    color: #007aff;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .06em;
}
.dash-timeline-head h3{
    margin: 0;
    font-size: 23px;
    line-height: 1.08;
    letter-spacing: -.03em;
}
.dash-timeline-head p{
    margin: 6px 0 0;
    color: #6e6e73;
    font-size: 13px;
    font-weight: 700;
}
.dash-timeline-close{
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: 1px solid rgba(0,0,0,.10);
    background: rgba(0,0,0,.04);
    color: inherit;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}
.dash-timeline-body{
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 18px 22px 24px;
}
.dash-timeline-list{
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.dash-timeline-item{
    display: grid;
    grid-template-columns: 34px 1fr;
    gap: 10px;
}
.dash-timeline-dot{
    width: 28px;
    height: 28px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,122,255,.10);
    color: #007aff;
    font-weight: 900;
    font-size: 13px;
    margin-top: 4px;
}
.dash-timeline-card{
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 18px;
    background: rgba(248,249,250,.92);
    padding: 13px 14px;
    box-shadow: 0 10px 28px rgba(0,0,0,.06);
}
.dash-timeline-meta{
    color: #8e8e93;
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 5px;
}
.dash-timeline-title{
    font-size: 15px;
    font-weight: 900;
    color: #1d1d1f;
    margin-bottom: 7px;
}
.dash-timeline-text,
.dash-timeline-summary{
    max-height: 260px;
    overflow-y: auto;
    color: #3a3a3c;
    font-size: 14px;
    line-height: 1.45;
    white-space: normal;
    overflow-wrap: anywhere;
}
.dash-timeline-text.is-editable{
    appearance: none;
    display: block;
    width: 100%;
    border: 0;
    padding: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: text;
    font: inherit;
}
.dash-timeline-text.is-editable:hover{
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}
.dash-timeline-card-actions{
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}
.dash-timeline-edit,
.dash-timeline-delete{
    appearance: none;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}
.dash-timeline-edit{
    border: 1px solid rgba(0,122,255,.24);
    background: rgba(0,122,255,.08);
    color: #0057d9;
}
.dash-timeline-edit:hover{
    background: rgba(0,122,255,.14);
}
.dash-timeline-delete{
    border: 1px solid rgba(255,59,48,.22);
    background: rgba(255,59,48,.08);
    color: #c4261d;
}
.dash-timeline-delete:hover{
    background: rgba(255,59,48,.14);
}
.dash-timeline-inline-edit{
    margin-top: 10px;
    display: grid;
    gap: 10px;
}
.dash-timeline-inline-editor{
    width: 100%;
    min-height: 120px;
    resize: vertical;
    border: 1px solid rgba(0,0,0,.14);
    border-radius: 12px;
    padding: 10px 12px;
    font: inherit;
    line-height: 1.45;
    color: #1d1d1f;
    background: #fff;
}
.dash-timeline-inline-editor:focus{
    outline: 3px solid rgba(0,122,255,.16);
    border-color: #007aff;
}
.dash-timeline-inline-actions{
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.dash-timeline-inline-actions button{
    min-height: 38px;
    justify-content: center;
}
.dash-timeline-summary{
    margin-top: 10px;
    padding: 10px;
    border-radius: 12px;
    background: rgba(0,122,255,.08);
}
.dash-timeline-summary strong,
.dash-timeline-actions strong{
    display: block;
    margin-bottom: 5px;
    color: #007aff;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .06em;
}
.dash-timeline-actions{
    margin-top: 10px;
    padding: 10px;
    border-radius: 12px;
    background: rgba(255,149,0,.10);
    color: #3a3a3c;
    font-size: 13px;
}
.dash-timeline-actions ul{
    margin: 0;
    padding-left: 18px;
}
.dash-timeline-attachments{
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}
.dash-timeline-thumb{
    width: 74px;
    height: 58px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,.10);
    background: #fff;
}
.dash-timeline-thumb img{
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.dash-timeline-file,
.dash-timeline-link{
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(0,0,0,.05);
    color: #007aff;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
    overflow-wrap: anywhere;
}
.dash-timeline-link{
    margin-top: 10px;
}
.dash-timeline-empty{
    padding: 22px;
    border-radius: 18px;
    background: rgba(0,0,0,.04);
    color: #6e6e73;
    font-weight: 800;
    text-align: center;
}
.dash-timeline-footer{
    display: grid;
    grid-template-columns: 1fr 1fr 54px;
    gap: 12px;
    padding: 14px 22px calc(14px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(0,0,0,.08);
    background: rgba(255,255,255,.96);
}
.dash-timeline-footer button,
.dash-timeline-footer a{
    min-height: 42px;
    justify-content: center;
    text-align: center;
    text-decoration: none;
}
.dash-timeline-record[disabled]{
    opacity: .72;
    cursor: wait;
}
.dash-timeline-record{
    background: #c62828 !important;
    border-color: #c62828 !important;
    color: #fff !important;
}
.dash-timeline-add-note{
    min-width: 54px;
    padding-inline: 0;
    border-radius: 14px;
    font-size: 26px;
    line-height: 1;
    font-weight: 900;
}
.dash-timeline-composer{
    padding: 12px 22px;
    border-top: 1px solid rgba(0,0,0,.08);
    background: rgba(255,255,255,.98);
    display: grid;
    gap: 8px;
}
.dash-timeline-composer[hidden]{
    display: none;
}
.dash-timeline-composer-text{
    width: 100%;
    min-height: 92px;
    border: 1px solid rgba(0,0,0,.14);
    border-radius: 12px;
    padding: 10px 12px;
    font: inherit;
    resize: vertical;
}
.dash-timeline-composer-actions{
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.theme-dark .dash-timeline-backdrop{ background: rgba(0,0,0,.44); }
.theme-dark .dash-timeline-drawer{
    background: rgba(22,22,24,.98);
    color: #f5f5f7;
    border-left-color: rgba(255,255,255,.12);
}
.theme-dark .dash-timeline-head,
.theme-dark .dash-timeline-footer{ border-color: rgba(255,255,255,.10); }
.theme-dark .dash-timeline-head p,
.theme-dark .dash-timeline-meta,
.theme-dark .dash-timeline-empty{ color: #a1a1a6; }
.theme-dark .dash-timeline-close,
.theme-dark .dash-timeline-empty,
.theme-dark .dash-timeline-card{
    background: rgba(255,255,255,.07);
    border-color: rgba(255,255,255,.12);
}
.theme-dark .dash-timeline-title{ color: #f5f5f7; }
.theme-dark .dash-timeline-text,
.theme-dark .dash-timeline-summary,
.theme-dark .dash-timeline-actions{ color: #e5e5ea; }
.theme-dark .dash-timeline-summary{ background: rgba(10,132,255,.16); }
.theme-dark .dash-timeline-actions{ background: rgba(255,159,10,.14); }
.theme-dark .dash-timeline-file,
.theme-dark .dash-timeline-link{ background: rgba(255,255,255,.08); color: #66b7ff; }
.theme-dark .dash-timeline-edit{ background: rgba(10,132,255,.16); border-color: rgba(10,132,255,.30); color: #8fc7ff; }
.theme-dark .dash-timeline-delete{ background: rgba(255,69,58,.16); border-color: rgba(255,69,58,.28); color: #ff9f9a; }
.theme-dark .dash-timeline-inline-editor{ background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.16); color: #f5f5f7; }
.theme-dark .dash-timeline-footer{ background: rgba(22,22,24,.96); }
.theme-dark .dash-timeline-composer{ background: rgba(22,22,24,.98); border-color: rgba(255,255,255,.10); }
.theme-dark .dash-timeline-composer-text{ background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.16); color: #f5f5f7; }

/* Eingabefelder in Notizen-Spalte sollen die volle Breite nutzen */
.orders-table td:nth-child(6) input,
.orders-table td:nth-child(6) textarea {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Allgemein klickbare Tabellenzellen (Inline-Edit) */
.cell-clickable {
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    border-radius: 6px;
}

.cell-clickable:hover {
    background: rgba(0, 122, 255, 0.08);
}

/* Units Badge */
.units-badge {
    background: rgba(0, 122, 255, 0.1);
    color: #007aff;
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    min-width: 28px;
    text-align: center;
    display: inline-block;
}

/* Deadline Logic - Critical Rows */
.deadline-critical td {
    position: relative;
    background: rgba(255, 59, 48, 0.07) !important;
}

.deadline-critical td::before,
.deadline-critical td::after {
    content: none;
}
.deadline-critical td:first-child,
.deadline-critical td:last-child{
    box-shadow: none;
}

.deadline-critical .cell-ter{
    position: relative;
}
.deadline-critical .cell-ter::before{
    content: none !important;
    display: none !important;
}

.deadline-critical:hover td {
    background: rgba(255, 59, 48, 0.11) !important;
}

.deadline-critical:hover {
    box-shadow: none !important;
}
.theme-dark .deadline-critical td {
    background: rgba(255, 69, 58, 0.13) !important;
}
.theme-dark .deadline-critical:hover td {
    background: rgba(255, 69, 58, 0.19) !important;
}

.deadline-pending td {
    background: rgba(255, 149, 0, 0.10) !important;
}
.deadline-pending .cell-ter {
    color: #b45309;
    font-weight: 800;
}
.deadline-pending:hover td {
    background: rgba(255, 149, 0, 0.17) !important;
}
.theme-dark .deadline-pending td {
    background: rgba(255, 159, 10, 0.16) !important;
}

/* Versandt Rows - Faded */
.versandt-faded {
    opacity: 0.6;
}

.versandt-faded td {
    background: rgba(142, 142, 147, 0.1) !important;
    color: #8e8e93 !important;
    border-color: rgba(142, 142, 147, 0.2) !important;
}

.versandt-faded:hover td {
    background: rgba(142, 142, 147, 0.15) !important;
    border-color: rgba(142, 142, 147, 0.3) !important;
}

/* Sidebar (Right Column) */
.sidebar {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px; /* kompakter nach oben */
    overflow-y: auto;
    overflow-x: visible;
}

/* Nachrichten / Posteingang */
.messages-section{
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 16px;
    padding: 14px 20px 10px 14px;
    border: 0.5px solid rgba(0,0,0,0.1);
    box-shadow: 0 4px 24px rgba(0,0,0,0.04);
    flex: 1 1 0;
    min-height: 180px;
    cursor: pointer;
    display:flex;
    flex-direction:column;
    overflow-y: auto;
    overflow-x: hidden;
}
.messages-section:hover{
    box-shadow: 0 8px 28px rgba(0,0,0,0.08);
}
.messages-section-hint{
    font-size: 12px;
    font-weight: 700;
    color:#8e8e93;
    margin-top: 2px;
}
.messages-section-count{
    min-width: 34px;
    height: 34px;
    border-radius: 17px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    background: rgba(37,99,235,0.08);
    border: 1px solid rgba(37,99,235,0.18);
    color:#2563EB;
    font-weight: 800;
    font-size: 14px;
}
.messages-preview{
    display:flex;
    flex-direction:column;
    gap:10px;
    min-height: 0;
}
.messages-preview-card{
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 14px;
    background: rgba(248,249,250,0.82);
    padding: 14px;
}
.messages-preview-card.priority-critical{ border-left: 4px solid #ff3b30; }
.messages-preview-card.priority-high{ border-left: 4px solid #ff9500; }
.messages-preview-card.priority-normal{ border-left: 4px solid #007aff; }
.messages-preview-card.priority-low{ border-left: 4px solid #8e8e93; }
.messages-preview-top{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
}
.messages-channel-badge{
    display:inline-flex;
    align-items:center;
    border-radius: 999px;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 800;
    border: 1px solid rgba(0,0,0,0.1);
    background: rgba(255,255,255,0.86);
    color:#1d1d1f;
}
.messages-channel-badge.channel-whatsapp{
    background: rgba(48,209,88,0.12);
    border-color: rgba(48,209,88,0.25);
    color:#248a3d;
}
.messages-channel-badge.channel-email{
    background: rgba(0,122,255,0.1);
    border-color: rgba(0,122,255,0.22);
    color:#007aff;
}
.messages-preview-time{
    font-size: 12px;
    font-weight: 700;
    color:#8e8e93;
}
.messages-preview-sender{
    margin-top: 10px;
    font-size: 15px;
    font-weight: 900;
    color:#111;
}
.messages-preview-subject{
    margin-top: 4px;
    font-size: 14px;
    font-weight: 800;
    color:#1d1d1f;
}
.messages-preview-text{
    margin-top: 6px;
    font-size: 13px;
    line-height: 1.4;
    color:#6e6e73;
    white-space: normal;
    overflow-wrap: anywhere;
}
.messages-preview-footer{
    margin-top: 10px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:8px;
    flex-wrap:wrap;
}
.messages-priority-badge{
    display:inline-flex;
    align-items:center;
    border-radius: 999px;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 800;
}
.messages-priority-badge.priority-critical{ background: rgba(255,59,48,0.12); color:#ff3b30; }
.messages-priority-badge.priority-high{ background: rgba(255,149,0,0.14); color:#ff9500; }
.messages-priority-badge.priority-normal{ background: rgba(0,122,255,0.12); color:#007aff; }
.messages-priority-badge.priority-low{ background: rgba(142,142,147,0.14); color:#6e6e73; }
.messages-preview-linked{
    font-size: 12px;
    font-weight: 700;
    color:#8e8e93;
}
.messages-preview-secondary-list{
    display:flex;
    flex-direction:column;
    gap:8px;
}
.messages-preview-secondary{
    display:flex;
    gap:8px;
    align-items:flex-start;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(248,249,250,0.6);
    border: 1px solid rgba(0,0,0,0.05);
}
.messages-preview-secondary-time{
    flex-shrink:0;
    font-size: 12px;
    font-weight: 800;
    color:#1d1d1f;
}
.messages-preview-secondary-text{
    min-width:0;
    font-size: 12px;
    color:#6e6e73;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* Adaptive message cards */
.messages-adaptive-list{
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}
.msg-card{
    border: 1px solid rgba(0,0,0,0.08);
    border-left: 4px solid var(--ui-muted-500);
    border-radius: 12px;
    background: rgba(248,249,250,0.82);
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.msg-card.channel-email{ border-left-color: #3b82f6; }
.msg-card.channel-whatsapp{ border-left-color: #25D366; }
.msg-card-top{ display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.msg-card-time{ font-size: 12px; font-weight: 700; color: #8e8e93; flex-shrink: 0; }
.msg-card-sender{ font-size: 14px; font-weight: 900; color: #111; }
.msg-card-subject{
    font-size: 13px;
    font-weight: 800;
    color: #1d1d1f;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.msg-card-preview{ font-size: 12px; color: #6e6e73; line-height: 1.35; }
.msg-card-footer{ display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.msg-card-links{ font-size: 11px; font-weight: 700; color: #8e8e93; }

.msg-size-large .msg-card{ padding: 14px 16px; gap: 6px; }
.msg-size-large .msg-card-sender{ font-size: 15px; }
.msg-size-large .msg-card-subject{ font-size: 14px; }
.msg-size-large .msg-card-preview{ font-size: 13px; }

.msg-size-medium .msg-card{ padding: 10px 12px; gap: 3px; }
.msg-size-medium .msg-card-sender{ font-size: 13px; }
.msg-size-medium .msg-card-subject{ font-size: 12px; }
.msg-size-medium .msg-card-preview{
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 11px;
    color: #8e8e93;
}

.msg-size-compact .msg-card--compact{
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 10px;
}
.msg-size-compact .msg-card-sender{ font-size: 12px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.msg-size-compact .msg-card-subject{ font-size: 12px; font-weight: 600; color: #6e6e73; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.msg-size-compact .msg-card-preview{ font-size: 11px; color: #8e8e93; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 2; min-width: 0; }
.msg-size-compact .msg-card-time{ font-size: 11px; flex-shrink: 0; }

.theme-dark .msg-card{ background: rgba(28,28,30,0.9); border-color: rgba(255,255,255,0.08); }
.theme-dark .msg-card-sender{ color: #f5f5f7; }
.theme-dark .msg-card-subject{ color: #e5e5ea; }
.theme-dark .msg-card-preview{ color: #a1a1a6; }
.theme-dark .msg-card-time{ color: #a1a1a6; }
.theme-dark .msg-card-links{ color: #a1a1a6; }

.messages-empty{
    border: 1px dashed rgba(0,0,0,0.15);
    border-radius: 12px;
    background: rgba(248,249,250,0.65);
    padding: 18px 14px;
    color:#8e8e93;
}
.messages-empty-title{
    font-size: 14px;
    font-weight: 800;
    color:#1d1d1f;
}
.messages-empty-sub{
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.4;
}
.theme-dark .messages-section{
    background: rgba(22,22,24,0.9);
    border-color: rgba(255,255,255,0.06);
}
.theme-dark .messages-section:hover{ box-shadow: 0 8px 28px rgba(0,0,0,0.45); }
.theme-dark .messages-section-hint{ color:#8e8e93; }
.theme-dark .messages-section-count{
    background: rgba(138,180,255,0.14);
    border-color: rgba(138,180,255,0.25);
    color:#8ab4ff;
}
.theme-dark .messages-preview-card,
.theme-dark .messages-preview-secondary{
    background: rgba(28,28,30,0.9);
    border-color: rgba(255,255,255,0.08);
}
.theme-dark .messages-preview-sender,
.theme-dark .messages-preview-subject,
.theme-dark .messages-empty-title,
.theme-dark .messages-preview-secondary-time{
    color:#f5f5f7;
}
.theme-dark .messages-preview-text,
.theme-dark .messages-preview-linked,
.theme-dark .messages-preview-secondary-text,
.theme-dark .messages-preview-time,
.theme-dark .messages-empty-sub{
    color:#a1a1a6;
}
.theme-dark .messages-channel-badge{
    background: rgba(44,44,46,0.95);
    border-color: rgba(255,255,255,0.14);
    color:#e5e5ea;
}
.theme-dark .messages-channel-badge.channel-whatsapp{
    background: rgba(48,209,88,0.18);
    border-color: rgba(48,209,88,0.35);
    color:#30d158;
}
.theme-dark .messages-channel-badge.channel-email{
    background: rgba(10,132,255,0.18);
    border-color: rgba(10,132,255,0.3);
    color:#8ab4ff;
}
.theme-dark .messages-empty{
    background: rgba(28,28,30,0.72);
    border-color: rgba(255,255,255,0.15);
}
.btn-link{
    border:none;
    background:transparent;
    color:#2563EB;
    font-weight: 800;
    cursor:pointer;
    padding: 6px 8px;
    border-radius: 10px;
}
.btn-link:hover{ background: rgba(37,99,235,0.08); }
.theme-dark .btn-link{ color:#8ab4ff; }
.theme-dark .btn-link:hover{ background: rgba(138,180,255,0.12); }

.preview-container{ display:flex; flex-direction:column; gap:10px; padding: 6px 2px 2px 2px; }
.preview-row{ display:grid; grid-template-columns: 44px 1fr; gap: 10px; align-items:center; }
.preview-avatar{
    width: 32px; height: 32px; border-radius: 10px;
    background: rgba(248,249,250,0.9);
    border: 1px solid rgba(0,0,0,0.08);
    display:flex; align-items:center; justify-content:center;
    font-weight: 900; color:#111; font-size: 12px;
}
.theme-dark .preview-avatar{ background: rgba(28,28,30,0.9); border-color: rgba(255,255,255,0.1); color:#e5e5ea; }
.preview-meta{ display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom: 6px; }
.preview-name{ font-weight: 900; color:#111; font-size: 14px; }
.preview-jobs{ color:#6e6e73; font-weight:700; font-size: 12px; }
.theme-dark .preview-name{ color:#e5e5ea; }
.theme-dark .preview-jobs{ color:#a1a1a6; }
.preview-track{
    position: relative;
    height: 32px;
    border-radius: 12px;
    background: rgba(248,249,250,0.8);
    border: 1px solid rgba(0,0,0,0.06);
    overflow:hidden;
}
.theme-dark .preview-track{ background: rgba(28,28,30,0.9); border-color: rgba(255,255,255,0.08); }
.preview-grid{
    position:absolute; inset:0;
    background-image: linear-gradient(to right, rgba(0,0,0,0.06) 1px, transparent 1px);
    background-size: calc(100% / 14) 100%;
    opacity: .6;
}
.theme-dark .preview-grid{
    background-image: linear-gradient(to right, rgba(255,255,255,0.08) 1px, transparent 1px);
    opacity: .45;
}
.preview-bars{ position:absolute; inset:0; }
.preview-bar{
    position:absolute;
    height: 6px;
    border-radius: 9999px;
    background: #ff3b30;
}
.preview-bar.s-green{ background: #30d158; }
.preview-bar.s-yellow{ background: #ffd60a; }
.preview-bar.s-red{ background: #ff3b30; }
.preview-bar.s-gray{ background: #8e8e93; }

/* Utilization Section */
.utilization-section {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 16px;
    padding: 7px 10px; /* noch kompakter */
    border: 0.5px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
    flex: 0 0 auto; /* höhe nicht ausdehnen */
    display: flex;
    flex-direction: column;
    margin-bottom: 4px; /* dichter zu den Kacheln darunter */
}

.utilization-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 0 0 auto;
}

/* Timeline Chart (Gantt-Style wie Screenshot) */
.timeline-container{
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.timeline-row{
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.timeline-tech{
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #f0f0f5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: #1d1d1f;
    flex-shrink: 0;
    border: 1px solid rgba(0,0,0,0.06);
}
.timeline-tech.melli{ background: #fff0f5; color: #af52de; border-color: rgba(175,82,222,0.2); }

.timeline-chart{
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Gantt Track */
.gantt-track{
    position: relative;
    background: linear-gradient(to right, 
        rgba(0,0,0,0.02) 0%, rgba(0,0,0,0.02) 100%);
    border-radius: 6px;
    min-height: 32px;
    overflow: hidden;
}

.gantt-weekend-stripe{
    position: absolute;
    top: 0;
    bottom: 0;
    background: rgba(99, 102, 241, 0.08);
    z-index: 0;
}

.gantt-bar{
    position: absolute;
    height: 6px;
    border-radius: 3px;
    z-index: 1;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.gantt-bar:hover{
    transform: scaleY(1.5);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    z-index: 10;
}

.timeline-days{
    display: flex;
    gap: 1px;
}

.timeline-day{
    flex: 1;
    text-align: center;
    font-size: 9px;
    color: #8e8e93;
    min-width: 16px;
    padding: 3px 1px;
    border-radius: 4px;
    background: #f5f5f7;
}
.timeline-day span{ 
    display: block; 
    font-size: 11px; 
    font-weight: 600; 
    color: #1d1d1f; 
}

/* Wochenende (Samstag + Sonntag) */
.timeline-day.weekend{
    background: #e8e8f0;
}
.timeline-day.weekend span{
    color: #6366f1;
}

.timeline-jobs{
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    min-width: 70px;
    text-align: right;
    padding-top: 4px;
    flex-shrink: 0;
}
.timeline-jobs .jobs-count{
    font-size: 12px;
    font-weight: 600;
    color: #8e8e93;
    white-space: nowrap;
}
.timeline-jobs .jobs-percent{
    font-size: 15px;
    font-weight: 800;
    color: #ff9500;
    padding: 4px 10px;
    background: rgba(255, 149, 0, 0.12);
    border-radius: 10px;
    white-space: nowrap;
    margin-top: 2px;
}
.timeline-jobs .jobs-percent.good{
    color: #007aff;
    background: rgba(0, 122, 255, 0.12);
}
.timeline-jobs .jobs-percent.complete{
    color: #34c759;
    background: rgba(52, 199, 89, 0.12);
}
.theme-dark .timeline-jobs .jobs-count{ color: #a1a1a6; }
.theme-dark .timeline-jobs .jobs-percent{ background: rgba(255, 149, 0, 0.2); }
.theme-dark .timeline-jobs .jobs-percent.good{ background: rgba(0, 122, 255, 0.2); }
.theme-dark .timeline-jobs .jobs-percent.complete{ background: rgba(52, 199, 89, 0.2); }

/* Melli Progress Bar */
.melli-progress{
    display: flex;
    height: 24px;
    border-radius: 6px;
    overflow: hidden;
    background: #f5f5f7;
}
.melli-bar-written{ background: #34c759; }
.melli-bar-open{ background: #8e8e93; }
.melli-bar-overdue{ background: #ff3b30; }

.melli-legend-inline{
    display: flex;
    gap: 12px;
    margin-top: 6px;
    font-size: 11px;
    color: #6e6e73;
}
.melli-leg{ display: flex; align-items: center; gap: 4px; }
.melli-leg .dot{ width: 8px; height: 8px; border-radius: 50%; }
.melli-leg .dot.written{ background: #34c759; }
.melli-leg .dot.open{ background: #8e8e93; }
.melli-leg .dot.overdue{ background: #ff3b30; }

/* Dark Mode */
.theme-dark .timeline-tech{ background: #2c2c2e; color: #f5f5f7; border-color: rgba(255,255,255,0.08); }
.theme-dark .timeline-tech.melli{ background: #3d2a3d; color: #d8a8f0; }
.theme-dark .gantt-track{ background: rgba(255,255,255,0.03); }
.theme-dark .gantt-weekend-stripe{ background: rgba(99, 102, 241, 0.15); }
.theme-dark .timeline-day{ background: #2c2c2e; color: #6e6e73; }
.theme-dark .timeline-day span{ color: #f5f5f7; }
.theme-dark .timeline-day.weekend{ background: #252530; }
.theme-dark .timeline-day.weekend span{ color: #818cf8; }
.theme-dark .melli-progress{ background: #2c2c2e; }

/* Melli – Rechnungen Überblick */
.melli-section { margin-top: 8px; padding-top: 6px; border-top: 1px dashed rgba(0,0,0,0.1); }
.melli-bar { height: 14px; }
.melli-open { background: linear-gradient(90deg,#8e8e93,#b0b0b5); }
.melli-written { background: linear-gradient(90deg,#34c759,#30d158); }
.melli-overdue { background: linear-gradient(90deg,#ff3b30,#ff2d55); }
.melli-legend { display:flex; gap:10px; justify-content:center; margin-top:6px; flex-wrap:wrap; }
.melli-legend .melli-legend-label { font-weight:700; color:#111; margin-right:6px; }
.melli-legend-item { display:flex; align-items:center; gap:6px; font-size:12px; color:#1d1d1f; }
.melli-legend-color { width:12px; height:12px; border-radius:3px; display:inline-block; }
.melli-legend-color.melli-open { background: linear-gradient(135deg,#8e8e93,#b0b0b5); }
.melli-legend-color.melli-written { background: linear-gradient(135deg,#34c759,#30d158); }
.melli-legend-color.melli-overdue { background: linear-gradient(135deg,#ff3b30,#ff2d55); }
.theme-dark .melli-section { border-top-color: rgba(255,255,255,0.12); }
.theme-dark .melli-legend-item { color:#e5e5ea; }

.utilization-bar {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.utilization-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
}

.tech-name {
    font-weight: 600;
    font-size: 19px;
    color: #1d1d1f;
}

/* Dark: Techniker-/Bereichsüberschrift gut lesbar machen */
.theme-dark .tech-name { color: #e5e5ea; }

.utilization-stats {
    font-size: 14px;
    color: #6e6e73;
    font-weight: 500;
}

/* Simple 3-Segment Progress Bar */
.simple-progress-container {
    height: 20px;
    background: rgba(142, 142, 147, 0.2);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    display: flex;
    margin-bottom: 4px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.15);
}

.progress-segment {
    height: 100%;
    transition: width 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
}

.progress-segment.completed {
    background: linear-gradient(90deg, #34c759, #30d158);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.progress-segment.in-progress {
    background: linear-gradient(90deg, #ff9500, #ff7a00); /* orange/gelb für laufend */
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.progress-segment.new {
    background: linear-gradient(90deg, #007aff, #40a8ff); /* blau für Neu/Geplant */
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.progress-segment.remaining {
    background: linear-gradient(90deg, #f2f2f7, #e5e5ea);
    border-left: 1px solid rgba(0, 0, 0, 0.05);
}

/* Simplified Utilization Numbers */
.utilization-numbers {
    font-size: 15px;
    color: #6e6e73;
    font-weight: 500;
    margin-bottom: 4px;
    text-align: center;
}

/* Global Progress Legend */
.global-progress-legend { margin-top: 8px; padding: 6px 8px; background: rgba(248, 249, 250, 0.8); border-radius: 8px; border: 1px solid rgba(0, 0, 0, 0.05); }

/* Dark Mode: Legende abtönen */
.theme-dark .global-progress-legend { background: rgba(28,28,30,0.9); border-color: rgba(255,255,255,0.06); }
.theme-dark .legend-title { color: #e5e5ea; }
.theme-dark .legend-item { color: #a1a1a6; }
.theme-dark .legend-color { box-shadow: none; }
.theme-dark .legend-color.remaining { border-color: rgba(255,255,255,0.06); }

.legend-title { display:none; }

.legend-items { display:flex; align-items:center; justify-content:center; gap:14px; flex-wrap:wrap; }
.legend-items.legend-inline { gap:10px; }

.legend-item { display:flex; align-items:center; gap:6px; color:#1d1d1f; font-weight:500; font-size:12px; }
.legend-item.legend-label { font-weight:700; color:#374151; margin-right:4px; }

.legend-color { width:10px; height:10px; border-radius:3px; box-shadow:0 1px 2px rgba(0,0,0,0.1); }

.legend-color.completed {
    background: linear-gradient(135deg, #34c759, #30d158);
}

.legend-color.in-progress {
    background: linear-gradient(135deg, #007aff, #40a8ff);
}

.legend-color.new {
    background: linear-gradient(135deg, #007aff, #40a8ff);
}

.legend-color.remaining {
    background: linear-gradient(135deg, #f2f2f7, #e5e5ea);
    border: 1px solid #d1d1d6;
}

.percentage {
    font-weight: 600;
    font-size: 18px;
    color: #1d1d1f;
}

.percentage.low {
    color: #34c759;
}

.percentage.medium {
    color: #ff9500;
}

.percentage.high {
    color: #ff9500;
}

.percentage.critical {
    color: #ff3b30;
}

/* Notes Section */
.notes-section {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 16px;
    padding: 16px;
    border: 0.5px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

/* Sidebar unten: Bestellzeile oben, Kalender darunter */
.sidebar-bottom { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; flex: 0 0 auto; min-width: 0; }
.sidebar-bottom--stacked{
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-shrink: 0;
}
.calendar-dual{
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.calendar-section--half{
    padding: 10px;
    height: auto;
    min-width: 0;
}
.calendar-section--half .section-header{ margin-bottom: 4px; }
.calendar-section--half .calendar-header{ margin-bottom: 4px; }
.calendar-section--half .calendar-month{ font-size: 13px; }
.calendar-section--half .calendar-weekdays span{ font-size: 11px; }
.calendar-section--half .calendar-grid button,
.calendar-section--half .calendar-grid .calendar-day{ font-size: 12px; padding: 4px 2px; }

.notes-section--ticker{
    cursor: pointer;
    padding: 10px 14px;
    flex: 0 0 auto;
    min-height: 0;
}
.notes-section--ticker:hover{ background: rgba(0,0,0,0.02); }
.notes-ticker-header{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}
.notes-ticker-header h3{ font-size: 14px; }
.notes-ticker-line{
    font-size: 13px;
    font-weight: 600;
    color: #1d1d1f;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 20px;
}
.ticker-text{
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
.ticker-count{
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 800;
    color: #8e8e93;
}
.theme-dark .notes-ticker-line{ color: #e5e5ea; }
.theme-dark .ticker-count{ color: #a1a1a6; }
.theme-dark .notes-section--ticker:hover{ background: rgba(255,255,255,0.03); }

.calendar-section { 
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 16px;
    padding: 14px; /* zuvor 16px */
    border: 0.5px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
    display: flex; flex-direction: column; height: 100%;
    min-width: 0;
}
.calendar-scroll-wrapper {
    max-height: 560px; /* 2 komplette Monate sichtbar (inkl. 31 Tage) */
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(0,0,0,0.2) transparent;
}
.calendar-scroll-wrapper::-webkit-scrollbar { width: 6px; }
.calendar-scroll-wrapper::-webkit-scrollbar-track { background: transparent; }
.calendar-scroll-wrapper::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.2); border-radius: 3px; }
.theme-dark .calendar-scroll-wrapper::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); }

.calendar-container { display:block; margin:0; padding:0 0 8px 0; overflow:hidden; }
.calendar-container + .calendar-container { margin-top: 10px; padding-top: 12px; border-top: 1px solid rgba(0,0,0,0.06); }
.theme-dark .calendar-container + .calendar-container { border-top-color: rgba(255,255,255,0.08); }
.calendar-today-pill{
    font-size: 12px;
    font-weight: 800;
    color: #2563EB;
    background: rgba(37,99,235,0.08);
    border: 1px solid rgba(37,99,235,0.18);
    border-radius: 9999px;
    padding: 6px 10px;
}
.theme-dark .calendar-today-pill{ color:#8ab4ff; background: rgba(138,180,255,0.14); border-color: rgba(138,180,255,0.25); }
.calendar-header {
    display: block;
    text-align: center;
    margin: 0 0 8px 0;
} /* Tizen/Flex-Bug vermeiden, Abstand nach unten */
.calendar-month {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color:#1d1d1f;
    line-height: 1.3;
    white-space: nowrap;
} /* stabilere Platzierung */

/* Full-HD clarity: avoid blur/subpixel softness on the always-visible dashboard shell. */
@media (min-width: 1200px) and (max-width: 2559px) {
    body:not(.lp-body) {
        font-size: 18px;
        text-rendering: optimizeLegibility;
    }

    .header,
    .kpi-card,
    .orders-section,
    .messages-section,
    .notes-section,
    .calendar-section {
        background: rgba(255, 255, 255, 0.96);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        border-width: 1px;
        box-shadow: 0 4px 18px rgba(15, 23, 42, 0.055);
    }

    .header {
        border-bottom-color: rgba(15, 23, 42, 0.08);
    }

    .orders-table th {
        background: #f8f9fa;
        border-bottom-width: 1px;
    }

    .orders-table td {
        background: rgba(255, 255, 255, 0.94);
    }

    .orders-table tbody tr {
        transition: background-color 0.18s ease, box-shadow 0.18s ease;
    }

    .logo-dynamic img {
        image-rendering: auto;
    }
}
.calendar-weekdays { display:grid; grid-template-columns: repeat(7, 1fr); gap:4px; margin-bottom: 6px; text-align:center; color:#6e6e73; font-weight:600; font-size:11px; line-height:1.2; } /* kleiner */
.calendar-weekdays > span { display:flex; align-items:center; justify-content:center; min-height:18px; white-space:nowrap; }
.calendar-grid { display:grid; grid-template-columns: repeat(7, 1fr); gap:6px; grid-auto-rows:minmax(28px, auto); } /* enger */
.calendar-grid > div { min-height: 28px; }
.calendar-day { display:flex; align-items:center; justify-content:center; min-height:28px; text-align:center; padding:0; border-radius:8px; background: rgba(248,249,250,0.8); color:#1d1d1f; border:1px solid rgba(0,0,0,0.05); font-size:12px; line-height:1.1; white-space:nowrap; overflow:hidden; } /* kleiner */
.calendar-day.today { background: rgba(0,122,255,0.12); border-color: rgba(0,122,255,0.3); color:#007aff; font-weight:700; }

@media (max-width: 926px) and (orientation: landscape) {
    .sidebar-bottom { grid-template-columns: 1fr; }
}

.notes-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.notes-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.notes-list li {
    padding: 14px 18px;
    background: rgba(248, 249, 250, 0.8);
    border-radius: 10px;
    font-size: 16px;
    color: #1d1d1f;
    border-left: 3px solid #007aff;
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    font-weight: 500;
}

.notes-list li:hover {
    background: rgba(0, 122, 255, 0.08);
    transform: translateX(4px);
}

/* Dashboard Note Items */
.note-item-dashboard {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 14px 18px !important;
    gap: 10px;
    min-width: 0;
}

.note-text {
    flex: 1;
    display: block;
    min-width: 0;
    cursor: pointer;
    transition: color 0.2s ease;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.note-text:hover {
    color: #007aff;
}

.btn-delete-note {
    background: rgba(255, 59, 48, 0.1);
    color: #ff3b30;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    flex-shrink: 0;
}

.btn-delete-note:hover {
    background: rgba(255, 59, 48, 0.2);
    transform: scale(1.1);
}

/* Multi-Techniker Anzeige */
.tech-assignments {
    font-size: 14px;
    line-height: 1.4;
    font-weight: 600;
}

.multi-tech {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.tech-assignment {
    display: inline-block;
    background: rgba(0, 122, 255, 0.1);
    color: #007aff;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid rgba(0, 122, 255, 0.2);
    white-space: nowrap;
}

.units-small {
    font-size: 12px;
    color: #555;
    font-weight: 500;
    margin-left: 2px;
}

/* Nicht zugewiesene Techniker */
.tech-unassigned {
    color: #ff9500;
    font-style: italic;
    font-weight: 500;
    background: rgba(255, 149, 0, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid rgba(255, 149, 0, 0.3);
}

.tech-clickable {
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    user-select: none;
}

.tech-clickable:hover {
    background: rgba(255, 149, 0, 0.2);
    border-color: rgba(255, 149, 0, 0.5);
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(255, 149, 0, 0.3);
}

/* High Volume Indicator */
.high-volume-indicator { display:inline-flex; align-items:center; justify-content:center; margin-left:6px; }
.high-volume-icon { width: 24px; height: 24px; color: #ff9500; }
.orders-table tbody tr:hover .high-volume-icon { color: #ff7a00; }

@keyframes pulse {
    0%, 100% { 
        transform: scale(1); 
        opacity: 1;
    }
    50% { 
        transform: scale(1.1); 
        opacity: 0.8;
    }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .dash-kpis{ grid-template-columns: minmax(0, 3fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
    .kpi-card{ padding: 12px 10px; gap: 8px; }
    .kpi-icon{ width: 30px; height: 30px; border-radius: 8px; }
    .kpi-icon svg{ width: 15px; height: 15px; }
    .kpi-label{ font-size: 10px; letter-spacing: .08em; }
    .kpi-value{ font-size: 22px; }
    .kpi-dual-value{ font-size: 17px; }
    .kpi-dual-label{ font-size: 8px; }
    .kpi-dual-divider{ height: 22px; }
    .kpi-tech-value{ font-size: 16px; }
    .kpi-tech-name{ font-size: 8px; }
    .kpi-tech-item{ padding: 0 10px; }
    .kpi-tech-planner-btn{ font-size: 9px; }
}
@media (max-width: 1024px) {
    .dash-kpis{ grid-template-columns: minmax(0, 3fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
    .kpi-card{ padding: 10px 8px; gap: 6px; }
    .kpi-icon{ width: 26px; height: 26px; border-radius: 7px; }
    .kpi-icon svg{ width: 13px; height: 13px; }
    .kpi-label{ font-size: 9px; }
    .kpi-value{ font-size: 18px; }
    .kpi-dual-value{ font-size: 15px; }
    .kpi-dual-label{ font-size: 7px; }
    .kpi-dual-divider{ height: 18px; }
    .kpi-tech-value{ font-size: 14px; }
    .kpi-tech-name{ font-size: 7px; }
    .kpi-tech-item{ padding: 0 6px; }
    .kpi-tech-planner-btn{ font-size: 8px; }
}
@media (max-width: 768px) {
    .dash-body { flex-direction: column; }
}

/* Kartenlayout auch in iPhone-Querformat (bis 900px) */
@media (max-width: 900px) {
    .orders-section { min-height: calc(100vh - 100px); }
    .orders-table { display: block; }
    .orders-table thead { display: none; }
    .table-container { overflow-y:auto; max-height:none; }
    #ordersTableBody { display: grid; grid-template-columns: 1fr; gap: 10px; }
    #ordersTableBody tr { display: grid; grid-template-columns: 72px 1fr; grid-template-areas:
        'term units'
        'client client'
        'notes notes'
        'tech status';
        padding: 10px; border: 1px solid rgba(0,0,0,0.1); border-radius:12px; background:#fff; }
    #ordersTableBody td { border:none; box-shadow:none !important; padding: 4px 4px; font-size: 12px; line-height:1.35; }
    #ordersTableBody td::before, #ordersTableBody td::after { content: none !important; }
    #ordersTableBody td:nth-child(1){ grid-area: term; font-weight:700; }
    #ordersTableBody td:nth-child(2){ grid-area: units; justify-self:end; }
    #ordersTableBody td:nth-child(3){ grid-area: client; }
    #ordersTableBody td:nth-child(4){ grid-area: notes; }
    #ordersTableBody td:nth-child(5){ grid-area: tech; }
    #ordersTableBody td:nth-child(6){ grid-area: status; justify-self:end; }
}

/* Robust mobile rules: greifen bis 600px Breite (iPhone 12–15 inkl.) */
@media (max-width: 600px) {
    .header { padding: 14px 16px; height: 76px; }
    #currentTime { font-size: 22px; }
    #currentDate { font-size: 13px; }
    .main-content { margin-top: 76px; height: calc(100vh - 76px); padding: 12px; gap: 12px; }
    .dash-body { flex-direction: column; gap: 12px; }
    .dash-kpis{ grid-template-columns: 1fr 1fr; gap: 12px; }
    .drawer-toggle { display:inline-flex !important; margin-right:8px; }
    .sidebar { display:none; }
    .sidebar.drawer { display:block; }
    .orders-table { display:block; }
    .orders-table thead { display:none; }
    .table-container { overflow-y:auto; max-height:none; }
    #ordersTableBody { display: grid; grid-template-columns: 1fr; gap: 10px; }
    #ordersTableBody tr { display: grid; grid-template-columns: 72px 1fr; grid-template-areas:
        'term units'
        'client client'
        'notes notes'
        'tech status';
        padding: 8px; border: 1px solid rgba(0,0,0,0.1); border-radius:12px; background:#fff; }
    #ordersTableBody td { border:none; box-shadow:none !important; padding: 4px; font-size: 11px; line-height:1.3; }
    #ordersTableBody td:nth-child(1){ grid-area: term; font-weight:700; }
    #ordersTableBody td:nth-child(2){ grid-area: units; justify-self:end; }
    #ordersTableBody td:nth-child(3){ grid-area: client; }
    #ordersTableBody td:nth-child(4){ grid-area: notes; }
    #ordersTableBody td:nth-child(5){ grid-area: tech; }
    #ordersTableBody td:nth-child(6){ grid-area: status; justify-self:end; }
}

@media (max-width: 480px) {
    .header { padding: 14px 16px; height: 76px; }
    .main-content { margin-top: 76px; height: calc(100vh - 76px); padding: 12px; gap: 12px; }
    .dash-body { flex-direction: column; gap: 12px; }
    .dash-kpis{ grid-template-columns: 1fr 1fr; gap: 12px; }
    .drawer-toggle { display:inline-flex !important; margin-right:8px; }
    .sidebar { display:none; }
    .sidebar.drawer { display:block; }
    .orders-table { display:block; }
    .orders-table thead { display:none; }
    .table-container { overflow-y:auto; max-height:none; }
    #ordersTableBody { display: grid; grid-template-columns: 1fr; gap: 10px; }
    #ordersTableBody tr { display: grid; grid-template-columns: 72px 1fr; grid-template-areas:
        'term units'
        'client client'
        'notes notes'
        'tech status';
        padding: 12px; border: 1px solid rgba(0,0,0,0.1); border-radius:12px; background:#fff; }
    #ordersTableBody td { border:none; box-shadow:none !important; padding: 6px 4px; font-size: 14px; }
    #ordersTableBody td:nth-child(1){ grid-area: term; font-weight:700; }
    #ordersTableBody td:nth-child(2){ grid-area: units; justify-self:end; }
    #ordersTableBody td:nth-child(3){ grid-area: client; }
    #ordersTableBody td:nth-child(4){ grid-area: notes; }
    #ordersTableBody td:nth-child(5){ grid-area: tech; }
    #ordersTableBody td:nth-child(6){ grid-area: status; justify-self:end; }
}

/* Notes modal list */
.dash-notes-modal-list{
    display:flex;
    flex-direction:column;
    gap:10px;
    min-height: 360px;
    max-height: 520px;
    overflow-y: auto;
    padding: 16px;
}
.dash-notes-modal-list::-webkit-scrollbar{ width: 8px; }
.dash-notes-modal-list::-webkit-scrollbar-thumb{ background: rgba(17,24,39,0.12); border-radius: 999px; }
.dash-note-card{
    position: relative;
    display:grid;
    grid-template-columns: 34px 1fr auto;
    align-items:center;
    gap: 14px;
    min-height: 72px;
    padding: 16px 14px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid rgba(17,24,39,0.08);
    box-shadow: 0 1px 2px rgba(17,24,39,0.03);
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.dash-note-card:hover{
    border-color: rgba(37,99,235,0.18);
    box-shadow: 0 8px 24px rgba(17,24,39,0.07);
    transform: translateY(-1px);
}
.dash-note-icon{
    width: 28px;
    height: 28px;
    border-radius: 9px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    color:#2563eb;
    background: rgba(37,99,235,0.08);
}
.dash-note-icon svg,
.notes-col-icon svg{
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.dash-note-icon--note{ color:#eab308; background: rgba(234,179,8,0.12); }
.dash-note-icon--link{ color:#2563eb; background: rgba(37,99,235,0.10); }
.dash-note-icon--calendar{ color:#22c55e; background: rgba(34,197,94,0.12); }
.dash-note-icon--alert{ color:#f97316; background: rgba(249,115,22,0.12); }
.dash-note-icon--bell{ color:#8b5cf6; background: rgba(139,92,246,0.12); }
.dash-note-content{
    min-width: 0;
    display:flex;
    flex-direction:column;
    gap: 7px;
}
.dash-note-meta{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap: 12px;
    min-width: 0;
    color:#6b7280;
    font-size:12px;
    font-weight: 650;
}
.dash-note-meta > span{
    display:flex;
    align-items:center;
    gap:8px;
    min-width:0;
}
.dash-note-meta time{
    flex-shrink:0;
    color:#6b7280;
    font-weight: 500;
}
.dash-note-number{
    color:#2563eb;
    font-weight: 800;
}
.dash-note-status{
    display:inline-flex;
    align-items:center;
    border-radius: 999px;
    padding: 3px 9px;
    background: rgba(34,197,94,0.10);
    color:#15803d;
    font-size:11px;
    font-weight: 800;
}
.dash-note-text{
    color:#111827;
    font-size:14px;
    font-weight: 700;
    line-height:1.35;
    overflow-wrap:anywhere;
}
.dash-note-footer{ display:flex; gap:8px; flex-wrap:wrap; }
.dash-note-reminder{
    color:#6b7280;
    font-size: 11px;
    font-weight: 700;
    border-radius:999px;
    padding: 3px 8px;
    background: rgba(17,24,39,0.05);
}
.dash-note-actions{
    display:flex;
    align-items:center;
    gap: 4px;
    opacity: .45;
    transition: opacity .18s ease;
}
.dash-note-card:hover .dash-note-actions,
.dash-note-actions:focus-within{ opacity: 1; }
.dash-note-btn{
    width: 28px;
    height: 28px;
    border-radius: 9px;
    border: 1px solid transparent;
    background: transparent;
    color:#6b7280;
    cursor:pointer;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    font-weight: 900;
}
.dash-note-btn:hover{ background: rgba(17,24,39,0.06); color:#111827; }
.dash-note-btn.delete:hover{ color:#dc2626; background: rgba(220,38,38,0.08); }
.dash-note-empty{
    min-height: 120px;
    display:flex;
    align-items:center;
    justify-content:center;
    color:#6b7280;
    font-weight:700;
    border: 1px dashed rgba(17,24,39,0.14);
    border-radius: 12px;
    background: rgba(248,250,252,0.75);
}
.theme-dark .dash-notes-modal-list::-webkit-scrollbar-thumb{ background: rgba(255,255,255,0.16); }
.theme-dark .dash-note-card{ background: rgba(28,28,30,0.92); border-color: rgba(255,255,255,0.08); box-shadow:none; }
.theme-dark .dash-note-card:hover{ border-color: rgba(96,165,250,0.26); box-shadow: 0 12px 30px rgba(0,0,0,0.28); }
.theme-dark .dash-note-text{ color:#e5e7eb; }
.theme-dark .dash-note-meta,
.theme-dark .dash-note-meta time,
.theme-dark .dash-note-reminder{ color:#a1a1aa; }
.theme-dark .dash-note-btn{ color:#a1a1aa; }
.theme-dark .dash-note-btn:hover{ background: rgba(255,255,255,0.08); color:#fff; }
.theme-dark .dash-note-empty{ background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.12); color:#a1a1aa; }
@media (max-width: 926px) and (orientation: landscape) {
    .header {
        padding: 12px 20px;
        height: 70px;
    }
    
    .header-left .logo {
        font-size: 20px;
    }
    
    .time-display .time {
        font-size: 28px;
    }
    
    .time-display .date {
        font-size: 13px;
    }
    
    .status-display {
        font-size: 13px;
    }
    
    .main-content {
        margin-top: 70px;
        height: calc(100vh - 70px);
        padding: 16px;
        gap: 16px;
    }
    
    .orders-section,
    .utilization-section,
    .notes-section {
        padding: 16px;
    }
    
    .section-header h2 {
        font-size: 18px;
    }
    
    .section-header h3 {
        font-size: 16px;
    }
    
    .orders-table th,
    .orders-table td {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .sidebar {
        gap: 16px;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* Smooth Animations */
.fade-in {
    animation: fadeIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Focus States */
*:focus {
    outline: 2px solid #007aff;
    outline-offset: 2px;
}

/* Dashboard Modal (re-uses admin style language) */
.modal { position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.4); backdrop-filter: blur(8px); display: none; align-items: center; justify-content: center; }
.modal-content { background: rgba(255,255,255,0.95); backdrop-filter: blur(20px) saturate(180%); border-radius: 16px; max-width: 600px; width: 90%; max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 40px rgba(0,0,0,0.2); border: 0.5px solid rgba(255,255,255,0.2); animation: fadeIn 0.3s ease; }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 24px 32px; border-bottom: 0.5px solid rgba(0,0,0,0.1); }
.modal-header h3 { font-size: 18px; font-weight: 600; color: #1d1d1f; letter-spacing: -0.2px; }
.modal .close { font-size: 24px; font-weight: 300; color: #6e6e73; cursor: pointer; line-height: 1; transition: color 0.2s ease; }
.modal .close:hover { color: #1d1d1f; }
.close-btn{ font-size: 24px; font-weight: 300; color: #6e6e73; cursor: pointer; line-height: 1; transition: color 0.2s ease; border:none; background:transparent; padding: 4px 8px; border-radius: 10px; }
.close-btn:hover{ color:#1d1d1f; background: rgba(0,0,0,0.04); }
.theme-dark .close-btn{ color:#a1a1a6; }
.theme-dark .close-btn:hover{ color:#e5e5ea; background: rgba(255,255,255,0.06); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; padding: 24px 32px; }
.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-group.full-width { grid-column: 1 / -1; }
.form-group label { font-size: 13px; font-weight: 600; color: #1d1d1f; text-transform: uppercase; letter-spacing: 0.5px; }
.form-group input, .form-group select, .form-group textarea { padding: 12px 16px; border: 0.5px solid rgba(0,0,0,0.2); border-radius: 8px; font-size: 14px; background: rgba(255,255,255,0.8); color: #1d1d1f; transition: all 0.2s ease; }
.modal-actions { display: flex; justify-content: flex-end; gap: 12px; padding: 24px 32px; border-top: 0.5px solid rgba(0,0,0,0.1); background: rgba(248,249,250,0.8); }
.btn { padding: 10px 20px; border: none; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.2s ease; display: inline-flex; align-items: center; gap: 6px; letter-spacing: -0.1px; }
.btn-primary { background: #007aff; color: #fff; box-shadow: 0 2px 8px rgba(0,122,255,0.3); }
.btn-secondary { background: rgba(142,142,147,0.1); color: #1d1d1f; border: 0.5px solid rgba(0,0,0,0.1); }

/* Multi-Techniker Zuweisungen im Dashboard */
.dash-assignments-list{
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
}
.dash-assignment-row{
    display: flex;
    align-items: center;
    gap: 8px;
}
.dash-assignment-row .dash-tech-select{
    flex: 1;
    padding: 10px 12px;
    border: 0.5px solid rgba(0,0,0,0.2);
    border-radius: 8px;
    font-size: 14px;
    background: rgba(255,255,255,0.8);
    color: #1d1d1f;
}
.dash-assignment-row .dash-units-input{
    width: 90px;
    padding: 10px 12px;
    border: 0.5px solid rgba(0,0,0,0.2);
    border-radius: 8px;
    font-size: 14px;
    background: rgba(255,255,255,0.8);
    color: #1d1d1f;
    text-align: center;
}
.dash-assign-del{
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: rgba(0,0,0,0.04);
    color: #6e6e73;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.dash-assign-del:hover{
    background: rgba(255,59,48,0.1);
    color: #ff3b30;
}
.dash-assignments-actions{
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 8px;
}
.dash-assignments-hint{
    font-size: 12px;
    color: #8e8e93;
    font-weight: 500;
}
.btn-sm{
    padding: 6px 12px;
    font-size: 12px;
}
.theme-dark .dash-assignment-row .dash-tech-select,
.theme-dark .dash-assignment-row .dash-units-input{
    background: rgba(28,28,30,0.9);
    border-color: rgba(255,255,255,0.12);
    color: #e5e5ea;
}
.theme-dark .dash-assign-del{
    background: rgba(255,255,255,0.06);
    color: #a1a1a6;
}
.theme-dark .dash-assign-del:hover{
    background: rgba(255,69,58,0.18);
    color: #ff453a;
}
.theme-dark .dash-assignments-hint{ color: #a1a1a6; }
.appointment-chain-grid{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:10px;
}
.appointment-chain-grid > div{
    border:0.5px solid rgba(0,0,0,0.10);
    border-radius:12px;
    background:rgba(255,255,255,0.55);
    padding:10px;
    display:grid;
    grid-template-columns:1fr 96px;
    gap:8px;
}
.appointment-chain-grid span{
    grid-column:1 / -1;
    font-size:12px;
    font-weight:800;
    color:#1d1d1f;
}
.appointment-chain-grid > div{min-width:0}
.appointment-chain-grid input{min-width:0;width:100%;box-sizing:border-box;padding:9px 10px}
.theme-dark .appointment-chain-grid > div{background:rgba(255,255,255,0.05);border-color:rgba(255,255,255,0.10)}
.theme-dark .appointment-chain-grid span{color:#f5f5f7}
@media (max-width: 720px){
    .appointment-chain-grid{grid-template-columns:1fr}
}
/* Karteikarte (schmales Detail-Panel): Terminkette immer einspaltig, Felder bleiben in ihrer Box */
#orderDetailModal .appointment-chain-grid{grid-template-columns:1fr}

/* Notes split modal */
.dash-notes-dialog{
    width: min(1120px, calc(100vw - 48px));
    max-width: 1120px;
    max-height: min(86vh, 760px);
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(17,24,39,0.08);
    border-radius: 10px;
    box-shadow: 0 28px 70px rgba(17,24,39,0.22);
}
.dash-notes-dialog .modal-header{
    padding: 18px 24px;
    min-height: 56px;
    background:#fff;
}
.dash-notes-dialog .modal-header h3{
    font-size:16px;
    font-weight:750;
    color:#111827;
}
.dash-notes-tabs{
    display:flex;
    align-items:center;
    gap: 24px;
    padding: 0 24px;
    height: 58px;
    border-bottom: 1px solid rgba(17,24,39,0.08);
    background:#fff;
}
.dash-notes-tab{
    position:relative;
    height: 58px;
    border:0;
    background:transparent;
    color:#9ca3af;
    font-size:14px;
    font-weight:750;
    cursor:pointer;
}
.dash-notes-tab.active{ color:#2563eb; }
.dash-notes-tab.active::after{
    content:"";
    position:absolute;
    left:0;
    right:0;
    bottom:-1px;
    height:3px;
    border-radius:999px 999px 0 0;
    background:#2563eb;
}
.dash-notes-body{
    padding: 20px 24px 24px;
    background:#fff;
}
.notes-split-grid{
    display:grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    gap: 18px;
}
.notes-col{
    min-width:0;
    display:flex;
    flex-direction:column;
    overflow:hidden;
    border: 1px solid rgba(17,24,39,0.08);
    border-radius: 12px;
    background:#fff;
}
.notes-col-header{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap: 14px;
    padding: 16px 16px 12px;
}
.notes-col-heading{
    display:flex;
    align-items:center;
    gap: 10px;
    min-width: 0;
}
.notes-col-icon{
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    flex-shrink:0;
}
.notes-col-icon--orders{ color:#2563eb; background: rgba(37,99,235,0.09); }
.notes-col-icon--notes{ color:#eab308; background: rgba(234,179,8,0.12); }
.notes-col-title{
    margin:0;
    font-size:16px;
    font-weight:800;
    color:#111827;
}
.dash-notes-add-btn{
    height: 34px;
    padding: 0 14px;
    border-radius: 8px;
    border: 1px solid rgba(17,24,39,0.08);
    background:#fff;
    color:#111827;
    font-size:13px;
    font-weight:750;
    cursor:pointer;
    box-shadow: 0 1px 2px rgba(17,24,39,0.04);
}
.dash-notes-add-btn:hover{
    border-color: rgba(37,99,235,0.22);
    color:#2563eb;
    background:#f8fafc;
}
.notes-col-footer{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap: 12px;
    padding: 14px 16px;
    border-top:1px solid rgba(17,24,39,0.08);
    color:#9ca3af;
    font-size:12px;
    font-weight:650;
    background:#fff;
}
.notes-sort-btn{
    border:0;
    background:transparent;
    color:#9ca3af;
    cursor:pointer;
    font:inherit;
    padding:0;
}
.notes-sort-btn::after{
    content:"⌄";
    margin-left: 8px;
    color:#9ca3af;
}
.notes-sort-btn:hover{ color:#2563eb; }
.theme-dark .dash-notes-dialog,
.theme-dark .dash-notes-dialog .modal-header,
.theme-dark .dash-notes-tabs,
.theme-dark .dash-notes-body,
.theme-dark .notes-col,
.theme-dark .notes-col-footer{
    background: rgba(22,22,24,0.97);
    border-color: rgba(255,255,255,0.08);
}
.theme-dark .dash-notes-dialog .modal-header h3,
.theme-dark .notes-col-title,
.theme-dark .dash-notes-add-btn{ color:#e5e7eb; }
.theme-dark .dash-notes-tab{ color:#71717a; }
.theme-dark .dash-notes-tab.active{ color:#60a5fa; }
.theme-dark .dash-notes-tab.active::after{ background:#60a5fa; }
.theme-dark .dash-notes-add-btn{
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.10);
}
.theme-dark .notes-col-footer,
.theme-dark .notes-sort-btn{ color:#a1a1aa; }
@media (max-width: 900px){
    .dash-notes-dialog{ width: calc(100vw - 24px); max-height: 92vh; }
    .dash-notes-body{ padding: 16px; }
    .notes-split-grid{ grid-template-columns: 1fr; }
    .dash-notes-modal-list{ min-height: 220px; max-height: 360px; }
}
@media (max-width: 620px){
    .notes-col-header,
    .notes-col-footer{ align-items:flex-start; flex-direction:column; }
    .dash-note-card{ grid-template-columns: 30px 1fr; align-items:flex-start; }
    .dash-note-actions{ grid-column: 2; opacity:1; }
    .dash-note-meta{ align-items:flex-start; flex-direction:column; gap:6px; }
}

.dash-messages-modal-list{
    display:flex;
    flex-direction:column;
    gap:12px;
    max-height: 70vh;
    overflow-y:auto;
}
.messages-modal-count{
    color:#6e6e73;
    font-weight:700;
    font-size:14px;
}
.message-row{
    border: 1px solid rgba(0,0,0,0.08);
    border-left: 4px solid transparent;
    border-radius: 14px;
    background: rgba(248,249,250,0.86);
    padding: 14px;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
}
.message-row.priority-critical{ border-left-color:#ff3b30; }
.message-row.priority-high{ border-left-color:#ff9500; }
.message-row.priority-normal{ border-left-color:#007aff; }
.message-row.priority-low{ border-left-color:#8e8e93; }
.message-row-top{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:10px;
    flex-wrap:wrap;
}
.message-row-badges{
    display:flex;
    gap:8px;
    flex-wrap:wrap;
}
.message-row-time{
    font-size: 12px;
    font-weight: 700;
    color:#8e8e93;
}
.message-row-sender{
    margin-top: 10px;
    font-size: 15px;
    font-weight: 900;
    color:#111;
}
.message-row-subject{
    margin-top: 4px;
    font-size: 14px;
    font-weight: 800;
    color:#1d1d1f;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.message-row-preview{
    margin-top: 6px;
    font-size: 13px;
    line-height: 1.45;
    color:#6e6e73;
    white-space: normal;
    overflow-wrap: anywhere;
}
.message-row-meta{
    margin-top: 10px;
    display:flex;
    gap:10px;
    flex-wrap:wrap;
    align-items: center;
    font-size: 12px;
    font-weight: 700;
    color:#8e8e93;
}
.msg-done-btn{
    margin-left: auto;
    border: 1px solid rgba(0,0,0,0.12);
    border-radius: 8px;
    padding: 4px 10px;
    background: rgba(17,24,39,0.06);
    color: var(--ui-muted-800);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s;
}
.msg-done-btn:hover{
    background: rgba(17,24,39,0.12);
}
.theme-dark .msg-done-btn{
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.14);
    color: #e5e7eb;
}
.theme-dark .msg-done-btn:hover{
    background: rgba(255,255,255,0.14);
}
.theme-dark .message-row{
    background: rgba(28,28,30,0.92);
    border-color: rgba(255,255,255,0.08);
}
.theme-dark .message-row-sender,
.theme-dark .message-row-subject{
    color:#f5f5f7;
}
.message-row-preview--clamp{
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.message-row:hover{
    background: rgba(0,122,255,0.04);
    box-shadow: 0 1px 6px rgba(0,0,0,0.06);
}
.message-row.has-history .message-row-sender::after{
    content: '';
    display: inline-block;
    width: 6px; height: 6px;
    background: #007aff;
    border-radius: 50%;
    margin-left: 6px;
    vertical-align: middle;
}
.msg-history-hint{
    font-size: 11px;
    font-weight: 600;
    color: #007aff;
    cursor: pointer;
}

/* Message Detail Modal */
.msg-detail-meta{
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.msg-detail-date{
    font-size: 13px;
    font-weight: 700;
    color: #8e8e93;
}
.msg-detail-subject{
    font-size: 17px;
    font-weight: 900;
    color: #111;
    margin-bottom: 8px;
}
.msg-detail-preview{
    font-size: 14px;
    line-height: 1.55;
    color: #3a3a3c;
    margin-bottom: 20px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
.msg-detail-history{
    border-top: 1px solid rgba(0,0,0,0.08);
    padding-top: 16px;
}
.msg-detail-history-title{
    font-size: 14px;
    font-weight: 900;
    color: #111;
    margin-bottom: 12px;
}
.msg-detail-history-list{
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 50vh;
    overflow-y: auto;
}
.msg-history-entry{
    background: rgba(248,249,250,0.86);
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 10px;
    padding: 10px 12px;
}
.msg-history-entry-header{
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}
.msg-history-entry-from{
    font-size: 12px;
    font-weight: 800;
    color: #111;
}
.msg-history-entry-time{
    font-size: 11px;
    font-weight: 700;
    color: #8e8e93;
    flex-shrink: 0;
}
.msg-history-entry-text{
    font-size: 13px;
    line-height: 1.45;
    color: #3a3a3c;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
.msg-detail-no-history{
    margin-top: 16px;
    padding: 14px;
    border: 1px dashed rgba(0,0,0,0.12);
    border-radius: 10px;
    font-size: 13px;
    color: #8e8e93;
    line-height: 1.5;
}
.msg-detail-no-history code{
    background: rgba(0,0,0,0.06);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 12px;
}

/* Dark mode: Detail Modal */
.theme-dark .msg-detail-subject{ color: #f5f5f7; }
.theme-dark .msg-detail-preview{ color: #d1d1d6; }
.theme-dark .msg-detail-history{ border-top-color: rgba(255,255,255,0.08); }
.theme-dark .msg-detail-history-title{ color: #f5f5f7; }
.theme-dark .msg-history-entry{ background: rgba(28,28,30,0.9); border-color: rgba(255,255,255,0.08); }
.theme-dark .msg-history-entry-from{ color: #f5f5f7; }
.theme-dark .msg-history-entry-time{ color: #a1a1a6; }
.theme-dark .msg-history-entry-text{ color: #d1d1d6; }
.theme-dark .msg-detail-no-history{ border-color: rgba(255,255,255,0.1); color: #a1a1a6; }
.theme-dark .msg-detail-no-history code{ background: rgba(255,255,255,0.08); }
.theme-dark .message-row:hover{ background: rgba(255,255,255,0.04); }
.theme-dark .message-row.has-history .message-row-sender::after{ background: #0a84ff; }
.theme-dark .msg-history-hint{ color: #0a84ff; }

.theme-dark .message-row-time,
.theme-dark .message-row-preview,
.theme-dark .message-row-meta,
.theme-dark .messages-modal-count{
    color:#a1a1a6;
}

/* Versandarten: Verlauf & Ausblick */
.ship-week-toolbar{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    margin-bottom: 14px;
}
.ship-week-meta{
    color: #6e6e73;
    font-weight: 700;
    font-size: 13px;
}
.ship-week-actions{
    display:flex;
    align-items:center;
    gap:8px;
    flex-shrink:0;
}
.ship-week-nav-btn{
    min-width: 44px;
    justify-content:center;
}
.ship-week-grid{
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 2px 2px 8px 2px;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
}
.ship-week-day{
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 14px;
    background: rgba(248,249,250,0.7);
    min-height: 240px;
    min-width: 190px;
    max-width: 190px;
    display: flex;
    flex-direction: column;
    scroll-snap-align: start;
}
.ship-week-day.is-past{
    background: rgba(245,245,247,0.88);
}
.ship-week-day.is-today{
    border-color: rgba(0,122,255,0.35);
    box-shadow: 0 0 0 2px rgba(0,122,255,0.08);
}
.ship-week-day.is-weekend{
    background: rgba(240,240,245,0.92);
}
.ship-week-day-head{
    padding: 12px 12px 8px 12px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}
.ship-week-day-name{
    font-size: 14px;
    font-weight: 900;
    color: #111;
}
.ship-week-day-date{
    font-size: 12px;
    color: #6e6e73;
    margin-top: 2px;
}
.ship-week-day-count{
    font-size: 12px;
    font-weight: 700;
    color: #8e8e93;
    padding: 8px 12px 0 12px;
}
.ship-week-day-list{
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px 10px 10px 10px;
}
.ship-week-item{
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 12px;
    background: rgba(255,255,255,0.86);
    padding: 8px 9px;
}
.ship-week-item-top{
    display: flex;
    align-items: center;
    margin-bottom: 4px;
}
.ship-week-item-footer{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-top: 7px;
}
.ship-week-time{
    font-size: 10px;
    font-weight: 800;
    color: #1d1d1f;
    flex-shrink: 0;
    white-space: nowrap;
}
.ship-week-status{
    font-size: 11px;
    font-weight: 800;
    color: #6e6e73;
    background: rgba(0,0,0,0.06);
    border-radius: 999px;
    padding: 2px 8px;
}
.ship-week-title{
    font-size: 13px;
    font-weight: 800;
    color: #111;
    line-height: 1.3;
}
.ship-week-sub{
    font-size: 12px;
    color: #6e6e73;
    line-height: 1.25;
    margin-top: 2px;
}
.ship-week-techs{
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
    flex: 1;
}
.ship-week-tech-badge{
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    border: 1px solid rgba(0,0,0,0.12);
    background: rgba(255,255,255,0.9);
    color: #1d1d1f;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 800;
}
.ship-week-tech-badge.oli{ background:#fff5cc; border-color:#ffe58f; }
.ship-week-tech-badge.sergey{ background:#eaffea; border-color:#b7f5c0; }
.ship-week-tech-badge.alex{ background:#ffe6f1; border-color:#ffc2d8; }
.ship-week-tech-badge.unassigned{
    background: rgba(255,149,0,0.12);
    border-color: rgba(255,149,0,0.3);
    color: #ff9500;
}
.ship-week-empty{
    border: 1px dashed rgba(0,0,0,0.15);
    border-radius: 10px;
    background: rgba(255,255,255,0.65);
    color: #8e8e93;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    padding: 14px 10px;
}
.ship-week-grid::-webkit-scrollbar { height: 8px; }
.ship-week-grid::-webkit-scrollbar-track { background: transparent; }
.ship-week-grid::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.18); border-radius: 999px; }
@media (max-width: 820px){
    .ship-week-toolbar{ flex-direction: column; align-items: flex-start; }
    .ship-week-day{
        min-width: 230px;
        max-width: 230px;
    }
}
.theme-dark .ship-week-meta{ color:#a1a1a6; }
.theme-dark .ship-week-grid::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.18); }
.theme-dark .ship-week-day{
    background: rgba(28,28,30,0.82);
    border-color: rgba(255,255,255,0.1);
}
.theme-dark .ship-week-day.is-past{
    background: rgba(38,38,40,0.92);
}
.theme-dark .ship-week-day.is-today{
    border-color: rgba(10,132,255,0.45);
    box-shadow: 0 0 0 2px rgba(10,132,255,0.14);
}
.theme-dark .ship-week-day.is-weekend{
    background: rgba(44,44,48,0.96);
}
.theme-dark .ship-week-day-head{ border-bottom-color: rgba(255,255,255,0.08); }
.theme-dark .ship-week-day-name{ color:#f5f5f7; }
.theme-dark .ship-week-day-date{ color:#a1a1a6; }
.theme-dark .ship-week-day-count{ color:#8e8e93; }
.theme-dark .ship-week-item{
    background: rgba(36,36,38,0.95);
    border-color: rgba(255,255,255,0.1);
}
.theme-dark .ship-week-time{ color:#f5f5f7; }
.theme-dark .ship-week-status{
    color:#d1d1d6;
    background: rgba(255,255,255,0.12);
}
.theme-dark .ship-week-title{ color:#f5f5f7; }
.theme-dark .ship-week-sub{ color:#a1a1a6; }
.theme-dark .ship-week-tech-badge{
    background: rgba(44,44,46,0.95);
    border-color: rgba(255,255,255,0.14);
    color:#e5e5ea;
}
.theme-dark .ship-week-tech-badge.oli{ background: rgba(255,214,10,0.18); border-color: rgba(255,214,10,0.35); color:#ffd60a; }
.theme-dark .ship-week-tech-badge.sergey{ background: rgba(48,209,88,0.18); border-color: rgba(48,209,88,0.35); color:#30d158; }
.theme-dark .ship-week-tech-badge.alex{ background: rgba(255,45,85,0.18); border-color: rgba(255,45,85,0.35); color:#ff2d55; }
.theme-dark .ship-week-tech-badge.unassigned{ background: rgba(255,149,0,0.18); border-color: rgba(255,149,0,0.35); color:#ff9f0a; }
.theme-dark .ship-week-empty{
    border-color: rgba(255,255,255,0.18);
    background: rgba(58,58,60,0.55);
    color:#a1a1a6;
}

/* Note editor */
.note-editor-reminder-row{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin-top: 10px; }
.note-editor-reminder-row input[type="datetime-local"]{ flex: 1; min-width: 220px; }

/* Detailmodal mit geöffneter Notiz: Gesprächsverlauf links groß sichtbar halten */
#orderDetailModal .modal-content.detail-notes-open #orderDetailForm {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
}

#orderDetailModal .modal-content.detail-notes-open .detail-card--conversation {
    flex: 1 1 auto;
    min-height: 260px;
    display: flex;
    flex-direction: column;
}

#orderDetailModal .modal-content.detail-notes-open #detailConvList {
    flex: 1 1 auto;
    min-height: 180px;
    max-height: none;
    overflow-y: auto;
    padding-right: 4px;
}

#orderDetailModal .modal-content.detail-notes-open .detail-conv-add {
    margin-top: 10px;
    flex: 0 0 auto;
}

#orderDetailModal .modal-content.detail-notes-open #detailToggleFields,
#orderDetailModal .modal-content.detail-notes-open #detailEditFields,
#orderDetailModal .modal-content.detail-notes-open .detail-card--actions {
    flex: 0 0 auto;
}

#orderDetailModal .modal-content.detail-notes-open #detailToggleFields {
    margin-top: auto;
}

.detail-card {
    background: #fff;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 14px;
    padding: 12px;
}

.detail-card-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.detail-card-title {
    flex: 1;
    font-weight: 900;
}

.detail-card--summary {
    background: #fffaf0;
    border-color: rgba(255,149,0,0.24);
}

.detail-conv-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 260px;
    overflow-y: auto;
}

.detail-conv-item {
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 12px;
    padding: 9px 10px;
    background: rgba(248,249,250,0.92);
}

.detail-conv-item-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.detail-conv-date {
    color: #6b7280;
    font-weight: 850;
}

.detail-conv-src {
    border-radius: 999px;
    background: rgba(0,122,255,0.10);
    color: #2563eb;
    padding: 2px 7px;
    font-size: 12px;
    font-weight: 900;
}

.detail-conv-del {
    margin-left: auto;
    border: 0;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    font-size: 18px;
}

.detail-conv-text {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    line-height: 1.4;
}

.detail-conv-add {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
}

.detail-conv-add textarea {
    min-height: 58px;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.12);
    padding: 8px 10px;
    resize: vertical;
}

.detail-toggle-fields {
    border: 1px solid rgba(0,0,0,0.08);
    background: rgba(248,249,250,0.92);
    border-radius: 12px;
    padding: 8px 10px;
    text-align: left;
    font-weight: 850;
}

.detail-edit-fields.is-collapsed {
    display: none;
}

.detail-actions-compact {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

/* Calendar reminder popup */
.calendar-section{ position: relative; }
.reminder-popup{
    position: absolute;
    left: 12px;
    right: 12px;
    top: 56px;
    z-index: 60;
    padding: 12px 12px;
    border-radius: 14px;
    border: 2px solid rgba(255,59,48,0.8);
    background: rgba(255,255,255,0.96);
    box-shadow: 0 12px 30px rgba(255,59,48,0.18), 0 18px 40px rgba(0,0,0,0.12);
}
.theme-dark .reminder-popup{
    background: rgba(22,22,24,0.96);
    border-color: rgba(255,69,58,0.75);
    box-shadow: 0 12px 30px rgba(255,69,58,0.22), 0 18px 40px rgba(0,0,0,0.55);
}

/* Kritische Erinnerung: großer Overlay-Alarm (fast halber Bildschirm) */
.reminder-backdrop{
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    backdrop-filter: blur(2px);
    z-index: 1900;
}
.theme-dark .reminder-backdrop{ background: rgba(0,0,0,0.45); }

.reminder-popup.is-critical{
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(860px, 92vw);
    max-height: 60vh;
    min-height: 46vh;
    overflow: hidden;
    z-index: 2000;
    padding: 24px 24px 0 24px;
    border-width: 3px;
    box-shadow: 0 14px 40px rgba(255,59,48,0.22), 0 26px 60px rgba(0,0,0,0.18);
    display: flex;
    flex-direction: column;
    justify-content: stretch;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(12px);
    border-radius: 22px;
}
.theme-dark .reminder-popup.is-critical{
    background: rgba(28,28,30,0.86);
}

.reminder-body{
    display:flex;
    flex-direction:column;
    align-items:center;
    text-align:center;
    gap: 8px;
    padding: 8px 6px 0;
    flex: 1 1 auto;
    justify-content: flex-start;
}
.reminder-hero{ margin-top: 2px; }
.reminder-hero-icon{
    width: 52px; height: 52px;
    border-radius: 9999px;
    display:flex; align-items:center; justify-content:center;
    background: radial-gradient(circle at 30% 30%, #ff6b62, #ff3b30 60%, #d92b21 100%);
    color: #fff;
    font-weight: 1000;
    font-size: 28px;
    box-shadow: 0 10px 22px rgba(255,59,48,0.25);
}
.reminder-heading{ font-size: 28px; font-weight: 1000; color:#111; letter-spacing: -0.3px; }
.theme-dark .reminder-heading{ color:#f2f2f7; }
.reminder-sub{ font-size: 16px; font-weight: 700; color: rgba(60,60,67,0.7); margin-top: -6px; }
.theme-dark .reminder-sub{ color: rgba(235,235,245,0.65); }
/* Kritische Erinnerung: SEHR großer prominenter Text in der Mitte */
.reminder-popup.is-critical .reminder-text{
    font-size: 48px;
    line-height: 1.2;
    font-weight: 900;
    margin: 40px 0;
    text-align: center;
    color: #1d1d1f;
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}
.theme-dark .reminder-popup.is-critical .reminder-text{ color: #f2f2f7; }

/* Non-critical: keep compact title styles */
.reminder-title{ display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom: 8px; }
.reminder-title strong{ font-weight: 900; color:#111; }
.theme-dark .reminder-title strong{ color:#e5e5ea; }
.reminder-badges{ display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.urgency-badge{
    font-size: 11px;
    font-weight: 900;
    padding: 4px 8px;
    border-radius: 9999px;
    border: 1px solid rgba(0,0,0,0.12);
    background: rgba(248,249,250,0.9);
    color:#111;
}
.urgency-badge.eilig{ background: rgba(255,149,0,0.14); border-color: rgba(255,149,0,0.32); color:#ff9500; }
.urgency-badge.kritisch{ background: rgba(255,59,48,0.14); border-color: rgba(255,59,48,0.32); color:#ff3b30; }
.theme-dark .urgency-badge{ background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.12); color:#e5e5ea; }
.theme-dark .urgency-badge.eilig{ background: rgba(255,214,10,0.16); border-color: rgba(255,214,10,0.28); color:#ffd60a; }
.theme-dark .urgency-badge.kritisch{ background: rgba(255,69,58,0.18); border-color: rgba(255,69,58,0.30); color:#ff453a; }
.reminder-text{ font-weight: 750; color:#111; line-height: 1.35; margin-bottom: 10px; }
.theme-dark .reminder-text{ color:#e5e5ea; }
.reminder-actions{ display:flex; gap:12px; justify-content:space-between; align-items:stretch; margin-top: 18px; }

/* Buttons am unteren Rand des Fensters fixiert */
.reminder-actions-row{
    display: flex;
    gap: 0;
    justify-content: stretch;
    align-items: stretch;
    margin-top: auto;
    margin-left: -24px;
    margin-right: -24px;
    flex-shrink: 0;
    border-top: 1px solid rgba(0,0,0,0.08);
    background: rgba(248,249,250,0.6);
    border-radius: 0 0 22px 22px;
}
.theme-dark .reminder-actions-row{
    border-top-color: rgba(255,255,255,0.1);
    background: rgba(40,40,42,0.6);
}
.reminder-action-btn{
    appearance: none;
    border: none;
    border-right: 1px solid rgba(0,0,0,0.08);
    background: transparent;
    color: #007aff;
    font-weight: 600;
    font-size: 17px;
    padding: 18px 12px;
    border-radius: 0;
    cursor: pointer;
    line-height: 1.15;
    text-align: center;
    flex: 1 1 0;
    transition: background 0.15s ease;
}
.reminder-action-btn:first-child{ border-radius: 0 0 0 22px; }
.reminder-action-btn:last-child{ border-right: none; border-radius: 0 0 22px 0; }
.reminder-action-btn br{ content:""; }
.reminder-action-btn:hover{ background: rgba(0,0,0,0.04); }
.reminder-action-btn:active{ background: rgba(0,0,0,0.08); }
.theme-dark .reminder-action-btn{
    border-right-color: rgba(255,255,255,0.1);
    color: #0a84ff;
}
.theme-dark .reminder-action-btn:hover{ background: rgba(255,255,255,0.06); }

/* "Erledigt" blau hervorgehoben */
.reminder-action-done{
    background: #007aff;
    color: #fff;
    font-weight: 700;
    border-right: none;
}
.reminder-action-done:hover{ background: #0066d6; }
.reminder-action-done:active{ background: #005cc5; }
.theme-dark .reminder-action-done{
    background: #0a84ff;
    color: #fff;
}
.theme-dark .reminder-action-done:hover{ background: #007aff; }

/* Legacy/fallback für alte Struktur */
.reminder-snooze-group{ display:none; }
.reminder-done-btn{ display:none; }

/* Techniker-Badges mit fester Optik */
.tech-badge { display:inline-block; padding:4px 10px; border-radius:9999px; border:1px solid rgba(0,0,0,0.12); background:#f6f7f9; color:#1d1d1f; font-weight:600; }
.tech-badge.olli   { background:#fff5cc; border-color:#ffe58f; }
.tech-badge.sergey { background:#eaffea; border-color:#b7f5c0; }
.tech-badge.alex   { background:#ffe6f1; border-color:#ffc2d8; }
/* Multi-Techniker Kapseln vererben Badge-Style */
.multi-tech .tech-assignment { background: #eef2f7; border-color: rgba(0,0,0,0.1); color: #1d1d1f; }

/* ===== Muted User-Facing Palette ===== */
.lp-body{
    --lp-primary: var(--ui-muted-800);
    --lp-ring: rgba(55,65,81,0.18);
}
.lp-btn.primary{
    background: var(--ui-muted-800);
    color: #fff;
}
.lp-hero-gradient{
    background:
        radial-gradient(1200px 700px at 20% -10%, #f7f7f7 0%, transparent 60%),
        radial-gradient(1200px 700px at 90% 10%, #eceff2 0%, transparent 60%),
        #ffffff;
}

.switch input:checked + .slider,
#toggleShipped[aria-pressed="true"],
.btn-nav.active,
.btn-primary{
    background: var(--ui-muted-800);
    border-color: var(--ui-muted-800);
    color: #fff;
}
.theme-dark #toggleShipped[aria-pressed="true"],
.theme-dark .btn-nav.active{
    background: #d1d5db;
    border-color: #d1d5db;
    color: #111;
}
.kpi-card:focus,
.btn-nav:focus,
.btn-primary:focus{
    outline-color: var(--ui-muted-700);
}

.live-badge{
    background: #34c759;
    color: #fff;
}
.offline-badge{
    background: #ff3b30;
    color: #fff;
}
.theme-dark .live-badge{
    background: #30d158;
    color: #fff;
}
.theme-dark .offline-badge{
    background: #ff453a;
    color: #fff;
}

.kpi-icon-blue,
.kpi-icon-yellow,
.kpi-icon-gray,
.kpi-icon-orange{
    background: linear-gradient(135deg, var(--ui-muted-bg), var(--ui-muted-bg-strong));
    color: var(--ui-muted-700);
}
.theme-dark .kpi-icon-blue,
.theme-dark .kpi-icon-yellow,
.theme-dark .kpi-icon-gray,
.theme-dark .kpi-icon-orange{
    background: linear-gradient(135deg, #2f3136, #3c4047);
    color: #d1d5db;
}
.kpi-icon-gray{
    background: linear-gradient(135deg, #fff7d6, #fde68a);
    color: #c28b00;
}
.kpi-icon-orange{
    background: linear-gradient(135deg, #fee2e2, #fca5a5);
    color: #c23b3b;
}
.theme-dark .kpi-icon-gray{
    background: linear-gradient(135deg, #4a3c10, #6b5a16);
    color: #ffd166;
}
.theme-dark .kpi-icon-orange{
    background: linear-gradient(135deg, #4a1f1f, #6a2d2d);
    color: #ff8a8a;
}
.kpi-invoices{
    border-color: rgba(0,0,0,0.08);
    background: rgba(255,255,255,0.86);
}
.theme-dark .kpi-invoices{
    border-color: rgba(255,255,255,0.08);
    background: rgba(22,22,24,0.9);
}
.kpi-invoices .kpi-value,
.kpi-dual-done .kpi-dual-value,
.kpi-dual-pending .kpi-dual-value,
.kpi-tech-value.low,
.kpi-tech-value.medium{
    color: var(--ui-muted-900);
}
.kpi-tech-value.high{
    color: #d4a017;
}
.kpi-tech-value.critical{
    color: #d14545;
}
.theme-dark .kpi-invoices .kpi-value,
.theme-dark .kpi-dual-done .kpi-dual-value,
.theme-dark .kpi-dual-pending .kpi-dual-value,
.theme-dark .kpi-tech-value.low,
.theme-dark .kpi-tech-value.medium{
    color: #f3f4f6;
}
.theme-dark .kpi-tech-value.high{
    color: #ffd166;
}
.theme-dark .kpi-tech-value.critical{
    color: #ff7b72;
}

.ter-shipped{
    display: block;
    font-size: 10px;
    color: var(--ui-muted-700);
    font-weight: 600;
    margin-top: 2px;
}
.theme-dark .ter-shipped{
    color: #d1d5db;
}

.cell-notizen.note-urgent,
.theme-dark .cell-notizen.note-urgent{
    color: var(--ui-muted-800);
    font-weight: 600;
}

.note-chip,
.theme-dark .note-chip,
.kulanz-badge,
.theme-dark .kulanz-badge{
    background: rgba(17,24,39,0.06);
    border-color: rgba(17,24,39,0.12);
    color: var(--ui-muted-800);
}
.theme-dark .note-chip,
.theme-dark .kulanz-badge{
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.14);
    color: #e5e7eb;
}

.status-pill.status-neu,
.status-pill.status-in-arbeit,
.status-pill.status-fertig,
.status-pill.status-versandt{
    background: rgba(17,24,39,0.06);
    color: var(--ui-muted-800);
    border: 1px solid rgba(17,24,39,0.12);
}
.theme-dark .status-pill.status-neu,
.theme-dark .status-pill.status-in-arbeit,
.theme-dark .status-pill.status-fertig,
.theme-dark .status-pill.status-versandt{
    background: rgba(255,255,255,0.08);
    color: #e5e7eb;
    border-color: rgba(255,255,255,0.14);
}

/* Techniker-Farben: originale Farbzuordnung beibehalten (definiert weiter oben) */

.tech-chip.unassigned,
.ship-week-tech-badge.unassigned{
    background: rgba(255,149,0,0.12);
    border-color: rgba(255,149,0,0.3);
    color: #ff9500;
}
.theme-dark .tech-chip.unassigned,
.theme-dark .ship-week-tech-badge.unassigned{
    background: rgba(255,149,0,0.18);
    border-color: rgba(255,149,0,0.35);
    color: #ffb454;
}

.messages-preview-card.priority-critical{ border-left-color: var(--ui-muted-800); }
.messages-preview-card.priority-high{ border-left-color: var(--ui-muted-700); }
.messages-preview-card.priority-normal{ border-left-color: var(--ui-muted-500); }
.messages-preview-card.channel-email{ border-left-color: #3b82f6; }
.messages-preview-card.channel-whatsapp{ border-left-color: #25D366; }
.messages-priority-badge.priority-critical,
.messages-priority-badge.priority-high,
.messages-priority-badge.priority-normal{
    background: rgba(17,24,39,0.08);
    color: var(--ui-muted-800);
}
.theme-dark .messages-priority-badge.priority-critical,
.theme-dark .messages-priority-badge.priority-high,
.theme-dark .messages-priority-badge.priority-normal{
    background: rgba(255,255,255,0.08);
    color: #e5e7eb;
}
.messages-channel-badge.channel-email{
    background: rgba(59,130,246,0.12);
    border-color: rgba(59,130,246,0.26);
    color: #2563eb;
}
.messages-channel-badge.channel-whatsapp{
    background: rgba(37,211,102,0.12);
    border-color: rgba(37,211,102,0.28);
    color: #128C7E;
}
.theme-dark .messages-channel-badge.channel-email{
    background: rgba(96,165,250,0.18);
    border-color: rgba(96,165,250,0.32);
    color: #93c5fd;
}
.theme-dark .messages-channel-badge.channel-whatsapp{
    background: rgba(37,211,102,0.18);
    border-color: rgba(37,211,102,0.34);
    color: #25D366;
}
.message-row.channel-email{ border-left-color: #3b82f6; }
.message-row.channel-whatsapp{ border-left-color: #25D366; }

.urgency-badge.eilig,
.urgency-badge.kritisch,
.theme-dark .urgency-badge.eilig,
.theme-dark .urgency-badge.kritisch{
    background: rgba(17,24,39,0.08);
    border-color: rgba(17,24,39,0.14);
    color: var(--ui-muted-800);
}
.theme-dark .urgency-badge.eilig,
.theme-dark .urgency-badge.kritisch{
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.14);
    color: #e5e7eb;
}
.dash-note-card .urgency-badge{
    border-radius: 999px;
    padding: 3px 9px;
    font-size: 11px;
    text-transform: none;
}
.dash-note-card .urgency-badge.normal{
    background: rgba(17,24,39,0.05);
    border-color: rgba(17,24,39,0.08);
    color:#374151;
}
.dash-note-card .urgency-badge.eilig{
    background: rgba(249,115,22,0.12);
    border-color: rgba(249,115,22,0.18);
    color:#c2410c;
}
.dash-note-card .urgency-badge.kritisch{
    background: rgba(220,38,38,0.12);
    border-color: rgba(220,38,38,0.18);
    color:#b91c1c;
}
.theme-dark .dash-note-card .urgency-badge.normal{
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.12);
    color:#e5e7eb;
}
.theme-dark .dash-note-card .urgency-badge.eilig{
    background: rgba(249,115,22,0.18);
    border-color: rgba(249,115,22,0.24);
    color:#fdba74;
}
.theme-dark .dash-note-card .urgency-badge.kritisch{
    background: rgba(248,113,113,0.18);
    border-color: rgba(248,113,113,0.24);
    color:#fca5a5;
}

.notes-clickable:hover,
.theme-dark .notes-clickable:hover,
.reminder-action-btn,
.theme-dark .reminder-action-btn,
.reminder-action-done,
.theme-dark .reminder-action-done{
    color: var(--ui-muted-800);
}
.reminder-action-done,
.theme-dark .reminder-action-done{
    background: rgba(17,24,39,0.08);
}

.ship-btn{
    background: linear-gradient(135deg, var(--ui-muted-800) 0%, var(--ui-muted-900) 100%);
    box-shadow: 0 2px 8px rgba(31, 41, 55, 0.22);
}
.ship-btn:hover{
    box-shadow: 0 4px 12px rgba(31, 41, 55, 0.28);
}

.calendar-day.today,
.theme-dark .calendar-day.today{
    background: rgba(59,130,246,0.12);
    border-color: rgba(59,130,246,0.28);
    color: #2563eb;
}
.theme-dark .calendar-day.today{
    background: rgba(96,165,250,0.16);
    border-color: rgba(96,165,250,0.34);
    color: #93c5fd;
}

.high-volume-icon{
    color: #ff9500;
}

.my-day-overlay{
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(15, 23, 42, 0.42);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 22px;
}

.my-day-shell{
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 22px;
    background: #f8f9fa;
    border: 1px solid rgba(255,255,255,0.7);
    box-shadow: 0 28px 80px rgba(0,0,0,0.24);
}

.my-day-shell-header{
    position: relative;
    z-index: 2;
    flex-shrink: 0;
    min-height: 72px;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    background: rgba(255,255,255,0.96);
    border-bottom: 1px solid rgba(0,0,0,0.08);
}

.my-day-shell-kicker{
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6b7280;
}

.my-day-shell-header h2{
    margin: 0;
    font-size: 24px;
    line-height: 1.1;
    color: #1d1d1f;
}

.my-day-tech-select{
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #4b5563;
    font-size: 14px;
    font-weight: 700;
}

.my-day-tech-select select{
    min-width: 150px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,0.14);
    background: #fff;
    color: #1d1d1f;
    padding: 0 12px;
    font-weight: 700;
}

.my-day-frame{
    flex: 1;
    min-height: 0;
    height: calc(100vh - 132px);
    position: relative;
    z-index: 1;
    width: 100%;
    border: 0;
    background: #fff;
}

.my-day-launch{
    flex: 1;
    min-height: 280px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 32px;
    text-align: center;
    color: #4b5563;
    background: #fff;
}

.my-day-launch strong{
    font-size: 22px;
    color: #1d1d1f;
}

.my-day-launch span{
    max-width: 520px;
    font-size: 15px;
    line-height: 1.5;
}

.theme-dark .my-day-shell{
    background: #111827;
    border-color: rgba(255,255,255,0.08);
}

.theme-dark .my-day-shell-header{
    background: rgba(31,41,55,0.96);
    border-bottom-color: rgba(255,255,255,0.08);
}

.theme-dark .my-day-shell-header h2,
.theme-dark .my-day-tech-select{
    color: #e5e7eb;
}

.theme-dark .my-day-launch{
    background: #111827;
    color: #cbd5e1;
}

.theme-dark .my-day-launch strong{
    color: #f8fafc;
}

@media (max-width: 760px){
    .my-day-overlay{padding: 0}
    .my-day-shell{border-radius: 0}
    .my-day-shell-header{flex-wrap: wrap;align-items: flex-start}
    .my-day-tech-select{margin-left: 0;width: 100%;justify-content: space-between}
    .my-day-tech-select select{flex: 1}
    .my-day-frame{height: calc(100vh - 136px)}
}

/* ===== Dark Mode Korrekturen Hauptdashboard ===== */
.theme-dark .kpi-card{
    background: rgba(28,28,30,0.92);
    border-color: rgba(255,255,255,0.08);
    color: #e5e5ea;
}
.theme-dark .kpi-card .kpi-label{ color: #a1a1a6; }
.theme-dark .kpi-card .kpi-value{ color: #f5f5f7; }
.theme-dark .kpi-tech-overview-card{ background: rgba(28,28,30,0.92); border-color: rgba(255,255,255,0.08); }
.theme-dark .kpi-tech-panel{ background: rgba(28,28,30,0.92); border-color: rgba(255,255,255,0.08); }
.theme-dark .kpi-tech-value{ color: #f5f5f7; }

.theme-dark #orderSearchInput{
    background: #1c1c1e !important;
    color: #f5f5f7 !important;
    border-color: rgba(255,255,255,0.12) !important;
}
.theme-dark #orderSearchInput::placeholder{ color: #8e8e93; }

.theme-dark .btn-add-dashboard,
.theme-dark .dash-notes-add-btn{
    background: #1c1c1e !important;
    color: #f5f5f7 !important;
    border: 1px solid rgba(255,255,255,0.10) !important;
}
.theme-dark .btn-add-dashboard:hover,
.theme-dark .dash-notes-add-btn:hover{
    background: #2c2c2e !important;
    color: #fff !important;
}
.theme-dark .btn-add-order{
    background: #1c1c1e !important;
    color: #f5f5f7 !important;
    border: 1px solid rgba(255,255,255,0.10) !important;
}
.theme-dark .btn-add-order:hover{
    background: #2c2c2e !important;
    color: #fff !important;
}

/* Rechnungsmodal: Arbeitsinformationen */
.invoice-context{
    margin-top: 10px;
    display: grid;
    gap: 8px;
}
.invoice-context--empty{
    color: #8e8e93;
    font-size: 12px;
    font-weight: 650;
}
.invoice-context-entry{
    border: 1px solid rgba(0,0,0,0.07);
    background: rgba(0,0,0,0.025);
    border-radius: 10px;
    padding: 8px 10px;
}
.invoice-context-meta{
    color: #6e6e73;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .02em;
}
.invoice-context-title{
    color: #1d1d1f;
    font-size: 12px;
    font-weight: 800;
    margin-top: 3px;
}
.invoice-context-text{
    color: #3a3a3c;
    font-size: 12px;
    font-weight: 650;
    line-height: 1.35;
    margin-top: 3px;
    overflow-wrap: anywhere;
}
.theme-dark .invoice-context--empty{ color: #8e8e93; }
.theme-dark .invoice-context-entry{
    border-color: rgba(255,255,255,0.10);
    background: rgba(255,255,255,0.045);
}
.theme-dark .invoice-context-meta{ color: #a1a1a6; }
.theme-dark .invoice-context-title{ color: #f5f5f7; }
.theme-dark .invoice-context-text{ color: #d1d5db; }

.dash-pending-banner{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    flex-wrap:wrap;
    margin:0 16px 12px;
    padding:14px 18px;
    border-radius:14px;
    border:1px solid #93c5fd;
    background:linear-gradient(135deg,#eff6ff,#dbeafe);
}
.dash-pending-banner-text{
    display:flex;
    flex-direction:column;
    gap:4px;
    font-size:13px;
    color:#334155;
}
.dash-pending-banner-text strong{
    font-size:15px;
    color:#1d4ed8;
}
body.dash-awaiting-identity > .header,
body.dash-awaiting-identity > .main-content,
body.dash-awaiting-identity > .dash-pending-banner{
    visibility:hidden;
}
.dash-identity-overlay{
    position:fixed;
    inset:0;
    z-index:10050;
    background:rgba(15,23,42,.55);
    display:flex;
    align-items:center;
    justify-content:center;
    padding:20px;
}
.dash-identity-card{
    width:min(460px,96vw);
    background:#fff;
    border-radius:18px;
    padding:24px;
    box-shadow:0 20px 40px rgba(0,0,0,.18);
}
.dash-identity-btn-dismiss{
    border-style:dashed;
    color:#64748b;
    background:#f8fafc;
}
.dash-identity-btn-dismiss .dash-identity-dismiss-icon{
    font-size:28px;
    line-height:1;
    font-weight:300;
    color:#475569;
}
.dash-identity-btn-dismiss:hover,
.dash-identity-btn-dismiss.is-busy{
    border-color:#94a3b8;
    background:#f1f5f9;
    color:#334155;
}
.dash-identity-btn.is-busy{
    border-color:#f97316;
    background:#fff7ed;
    box-shadow:0 0 0 2px rgba(249,115,22,.25);
}
.dash-identity-btn:disabled{
    cursor:wait;
    opacity:.92;
}
.dash-identity-card-head{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:12px;
    margin-bottom:8px;
}
.dash-identity-close{
    border:none;
    background:transparent;
    font-size:26px;
    line-height:1;
    color:#64748b;
    cursor:pointer;
    padding:0 4px;
}
.dash-identity-close:hover{ color:#0f172a; }
.dash-identity-chip{
    display:inline-flex;
    align-items:center;
    gap:8px;
    padding:6px 10px 6px 12px;
    border-radius:999px;
    background:#fff7ed;
    border:1px solid #fdba74;
    color:#9a3412;
    font-size:12px;
    font-weight:600;
    white-space:nowrap;
}
.dash-identity-chip strong{ font-weight:800; }
.dash-identity-chip-close{
    border:none;
    background:transparent;
    font-size:18px;
    line-height:1;
    color:#c2410c;
    cursor:pointer;
    padding:0 2px;
}
.dash-identity-card h2{
    margin:0 0 8px;
    font-size:22px;
    text-align:center;
}
.dash-identity-card p{
    margin:0 0 16px;
    color:#64748b;
    font-size:14px;
    line-height:1.45;
}
.dash-identity-grid{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:10px;
}
.dash-identity-btn{
    border:1px solid #cbd5e1;
    background:#fff;
    border-radius:12px;
    padding:14px 12px;
    font-size:15px;
    font-weight:700;
    cursor:pointer;
    display:flex;
    align-items:center;
    justify-content:center;
    gap:10px;
    min-height:54px;
}
.dash-identity-btn:hover{
    border-color:#f97316;
    background:#fff7ed;
}
.dash-identity-dot{
    width:12px;
    height:12px;
    border-radius:50%;
    flex-shrink:0;
}
.theme-dark .dash-pending-banner{
    background:linear-gradient(135deg,rgba(30,58,138,.35),rgba(30,64,175,.25));
    border-color:rgba(147,197,253,.35);
}
.theme-dark .dash-pending-banner-text{ color:#cbd5e1; }
.theme-dark .dash-pending-banner-text strong{ color:#93c5fd; }
.theme-dark .dash-identity-card{
    background:#1c1c1e;
    color:#f5f5f7;
}
.theme-dark .dash-identity-card p{ color:#8e8e93; }
.theme-dark .dash-identity-btn{
    background:#2c2c2e;
    border-color:#38383a;
    color:#f5f5f7;
}
.theme-dark .dash-identity-btn-dismiss{ background:#1f1f22; color:#a1a1aa; }
.theme-dark .dash-identity-btn-dismiss .dash-identity-dismiss-icon{ color:#d4d4d8; }
.theme-dark .dash-identity-btn.is-busy{ background:rgba(249,115,22,.18); border-color:#fb923c; }
.theme-dark .dash-identity-chip{
    background:rgba(249,115,22,.15);
    border-color:rgba(251,146,60,.45);
    color:#fdba74;
}
.theme-dark .dash-identity-close{ color:#8e8e93; }
.theme-dark .dash-identity-close:hover{ color:#f5f5f7; }
@media (max-width:640px){
    .dash-identity-grid{ grid-template-columns:1fr; }
}
