/* ===== Landing Page Styles ===== */
.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: 1920px) {
    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: rgba(20, 20, 20, 0.8); 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:#e5e5ea; color:#111; }
.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: repeat(4, 1fr);
    gap: 14px;
    flex: 0 0 auto;
}
.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;
}
.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; }

/* Dual KPI Card (Rechnungen geschrieben / offen) */
.kpi-card.kpi-dual{ min-width: 160px; }
.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; }

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

/* 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;
}
.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: #f5f5f7; color: #111; }
.theme-dark .btn-add-order:hover{ background: #fff; color: #111; }

/* 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;
    max-height: calc(100vh - 360px);
}

.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; }
.orders-table .col-notizen, .orders-table .cell-notizen { flex: 1; }
.orders-table .col-tech, .orders-table .cell-tech { width: 72px; text-align: center; }
.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; }

/* 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 */
.client-cell{ display:flex; flex-direction:column; gap:2px; line-height:1.2; }
.client-dentist{ font-weight: 800; color:#111; }
.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; 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; }

/* 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.18) !important; /* kräftigeres Rot */
}

.deadline-critical td::before,
.deadline-critical td::after {
    content: "";
    position: absolute;
    left: -1px;
    right: -1px;
    pointer-events: none;
}
.deadline-critical td::before { top: 0; border-top: 3px solid #ff2d55; }
.deadline-critical td::after  { bottom: 0; border-bottom: 3px solid #ff2d55; }
.deadline-critical td:first-child { box-shadow: inset 3px 0 0 #ff2d55; }
.deadline-critical td:last-child  { box-shadow: inset -3px 0 0 #ff2d55; }

.deadline-critical:hover td {
    background: rgba(255, 59, 48, 0.26) !important; /* noch deutlicher im Hover */
}

.deadline-critical:hover {
    box-shadow: 0 6px 24px rgba(255, 59, 48, 0.45) !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;
}

/* 14 days preview */
.preview-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: 0 0 auto;
}
.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;
}

/* Sidebar unten: Notizen + Kalender nebeneinander */
.sidebar-bottom { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; flex: 1; }

.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%;
}
.calendar-scroll-wrapper {
    max-height: 420px; /* ca. 2 Monate sichtbar, 3. durch Scrollen erreichbar */
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    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:flex; flex-direction: column; gap:8px; } /* zuvor 12px */
.calendar-container + .calendar-container { padding-top: 8px; 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-bottom: 6px;
} /* Tizen/Flex-Bug vermeiden, Abstand nach unten */
.calendar-month {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color:#1d1d1f;
    line-height: 1.2;
} /* stabilere Platzierung */
.calendar-weekdays { display:grid; grid-template-columns: repeat(7, 1fr); gap:4px; text-align:center; color:#6e6e73; font-weight:600; font-size:11px; } /* kleiner */
.calendar-grid { display:grid; grid-template-columns: repeat(7, 1fr); gap:6px; } /* enger */
.calendar-day { text-align:center; padding:6px 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; } /* 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;
}

.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: center;
    padding: 14px 18px !important;
}

.note-text {
    flex: 1;
    cursor: pointer;
    transition: color 0.2s ease;
}

.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;
}

.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: repeat(4, 1fr); gap: 10px; }
    .kpi-card{ padding: 12px 10px; }
    .kpi-label{ font-size: 10px; }
    .kpi-value{ font-size: 22px; }
}
@media (max-width: 1024px) {
    .dash-kpis{ grid-template-columns: repeat(3, 1fr); }
}
@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; padding-bottom: 8px; }
.dash-note-row{
    display:flex;
    align-items:flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(248,249,250,0.8);
    border: 1px solid rgba(0,0,0,0.06);
}
.dash-note-text{ font-weight: 650; color:#111; line-height:1.35; flex: 1; }
.dash-note-actions{ display:flex; gap:8px; align-items:center; }
.dash-note-btn{
    width: 34px; height: 34px;
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,0.12);
    background: rgba(255,255,255,0.9);
    cursor:pointer;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    font-weight: 900;
}
.dash-note-btn:hover{ transform: translateY(-1px); background: rgba(0,0,0,0.02); }
.dash-note-btn.delete{ color:#ff3b30; border-color: rgba(255,59,48,0.25); background: rgba(255,59,48,0.08); }
.dash-note-btn.delete:hover{ background: rgba(255,59,48,0.12); }
.theme-dark .dash-note-row{ background: rgba(28,28,30,0.9); border-color: rgba(255,255,255,0.08); }
.theme-dark .dash-note-text{ color:#e5e5ea; }
.theme-dark .dash-note-btn{ background: rgba(28,28,30,0.9); border-color: rgba(255,255,255,0.1); color:#e5e5ea; }
.theme-dark .dash-note-btn.delete{ color:#ff453a; border-color: rgba(255,69,58,0.35); background: rgba(255,69,58,0.18); }
@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); }

/* Notes split modal */
.notes-split-grid{ display:grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.notes-col{ border: 1px solid rgba(0,0,0,0.06); border-radius: 14px; padding: 12px; background: rgba(248,249,250,0.55); }
.notes-col-header{ display:flex; align-items:center; justify-content:space-between; gap: 10px; margin-bottom: 10px; }
.notes-col-title{ font-weight: 900; color:#111; }
.theme-dark .notes-col{ background: rgba(28,28,30,0.6); border-color: rgba(255,255,255,0.08); }
.theme-dark .notes-col-title{ color:#e5e5ea; }
@media (max-width: 820px){ .notes-split-grid{ grid-template-columns: 1fr; } }

/* 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; }

/* 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; }