/* DokTrack Dashboard – Styles */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,500;0,9..40,700&family=DM+Mono:wght@400;500&display=swap');

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg: #f0f2f5;
    --bg-warm: #faf9f7;
    --white: #ffffff;
    --slate-900: #0f172a;
    --slate-800: #1e293b;
    --slate-700: #334155;
    --slate-500: #64748b;
    --slate-400: #94a3b8;
    --slate-300: #cbd5e1;
    --slate-200: #e2e8f0;
    --slate-100: #f1f5f9;
    --primary: #1565c0;
    --primary-light: #1976d2;
    --primary-bg: #e3f2fd;
    --text: #1e293b;
    --text-secondary: #64748b;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 4px 6px rgba(15, 23, 42, 0.05), 0 2px 4px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 10px 25px rgba(15, 23, 42, 0.08), 0 4px 10px rgba(15, 23, 42, 0.04);
    --radius: 6px;
    --radius-lg: 10px;
    --dok-ok: #059669;
    --dok-ok-bg: #ecfdf5;
    --dok-ok-border: #a7f3d0;
    --dok-fehlt: #dc2626;
    --dok-fehlt-bg: #fef2f2;
    --dok-fehlt-border: #fecaca;
    --dok-teilweise: #d97706;
    --dok-teilweise-bg: #fffbeb;
    --dok-teilweise-border: #fde68a;
    --font: 'DM Sans', system-ui, -apple-system, sans-serif;
    --font-mono: 'DM Mono', 'Menlo', 'Consolas', monospace;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ========== HEADER ========== */
.header {
    background: var(--primary);
    color: #fff;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-lg);
}

.header-inner {
    max-width: 1640px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 20px;
    height: 64px;
}

.logo {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    white-space: nowrap;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo::before {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 2px;
    flex-shrink: 0;
}

.kw-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255,255,255,0.06);
    border-radius: 8px;
    padding: 3px;
}

.nav-btn {
    background: transparent;
    border: none;
    color: var(--slate-400);
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-family: var(--font);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.nav-btn:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.nav-btn:active {
    transform: scale(0.97);
}

.nav-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none;
}

.kw-arrow {
    font-size: 22px;
    padding: 4px 10px;
    color: #fff;
}

.kw-arrow:hover {
    background: rgba(255,255,255,0.15);
}

.nav-btn-heute {
    color: var(--slate-300);
    font-size: 13px;
}

.kw-label {
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: 500;
    min-width: 110px;
    text-align: center;
    color: #fff;
    letter-spacing: 0.5px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-btn-sync {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.nav-btn-sync:hover {
    background: rgba(255, 255, 255, 0.35);
    color: #fff;
}

.nav-btn-sync.syncing {
    pointer-events: none;
    opacity: 0.6;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.nav-btn-sync.syncing .sync-icon {
    animation: spin 0.8s linear infinite;
}

.nav-btn-smb {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.nav-btn-smb:hover {
    background: rgba(255, 255, 255, 0.3);
    color: #fff;
}

.nav-btn-smb.syncing {
    pointer-events: none;
    opacity: 0.6;
}

/* Suchfeld */
.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 8px;
    font-size: 13px;
    opacity: 0.5;
    pointer-events: none;
}

.search-input {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    padding: 6px 28px 6px 28px;
    border-radius: 6px;
    font-family: var(--font);
    font-size: 14px;
    width: 180px;
    transition: width 0.2s, border-color 0.15s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    width: 240px;
    background: rgba(255,255,255,0.12);
}

.search-input::placeholder {
    color: var(--slate-400);
    font-size: 13px;
}

.search-clear {
    position: absolute;
    right: 4px;
    background: none;
    border: none;
    color: var(--slate-400);
    font-size: 16px;
    cursor: pointer;
    padding: 2px 6px;
    line-height: 1;
    opacity: 0;
    transition: opacity 0.15s;
}

.search-input:not(:placeholder-shown) ~ .search-clear {
    opacity: 1;
}

.search-clear:hover {
    color: #fff;
}

.filter-select {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--slate-300);
    padding: 6px 12px;
    border-radius: 6px;
    font-family: var(--font);
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.15s;
}

.filter-select:hover {
    border-color: rgba(255,255,255,0.2);
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary);
}

.filter-select option {
    color: var(--text);
    background: #fff;
}

.datum-bereich {
    font-size: 12px;
    color: var(--slate-500);
    margin-left: auto;
    font-family: var(--font-mono);
}

/* ========== SYNC STATUS BAR ========== */
.sync-status-bar {
    max-width: 1640px;
    margin: 0 auto;
    padding: 0 28px;
}

.sync-status-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 8px 14px;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    font-size: 11px;
    color: var(--slate-500);
    font-family: var(--font-mono);
}

.sync-status-inner .sync-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.sync-dot-ok { background: var(--dok-ok); }
.sync-dot-error { background: var(--dok-fehlt); }
.sync-dot-unknown { background: var(--slate-300); }

.sync-status-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.sync-status-item span {
    color: var(--slate-400);
}

.sync-status-label {
    font-family: var(--font);
    font-weight: 500;
    color: var(--text-secondary);
}

/* ========== TOOLBAR BAR ========== */
.toolbar-bar {
    background: #f3e8ff;
    border-bottom: 1px solid #e0cffc;
}

.toolbar-inner {
    max-width: 1640px;
    margin: 0 auto;
    padding: 5px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-family: var(--font);
}

.toolbar-btn {
    padding: 4px 12px;
    font-size: 13px;
    font-family: var(--font);
    font-weight: 500;
    background: #fff;
    color: #6b21a8;
    border: 1px solid #d8b4fe;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 5px;
}
.toolbar-btn:hover { background: #ede9fe; }
.toolbar-btn.syncing { opacity: 0.5; pointer-events: none; }
.toolbar-btn.syncing .sync-icon { animation: spin 0.8s linear infinite; }

/* ========== SUMMARY CARDS ========== */
.summary {
    max-width: 1640px;
    margin: 16px auto;
    padding: 0 28px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

.card {
    border-radius: var(--radius);
    padding: 14px 16px;
    box-shadow: var(--shadow-sm);
    border: none;
    text-align: center;
    transition: box-shadow 0.2s, transform 0.15s;
    position: relative;
    overflow: hidden;
    background: var(--white);
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.card-clickable {
    cursor: pointer;
    user-select: none;
}

.card-active {
    box-shadow: 0 0 0 2px var(--primary), var(--shadow-md);
    transform: translateY(-1px);
}

.card-primary {
    background: var(--primary-bg);
    border: 1px solid #bbdefb;
}

.card-green {
    background: var(--dok-ok-bg);
    border: 1px solid var(--dok-ok-border);
}

.card-orange {
    background: var(--dok-teilweise-bg);
    border: 1px solid var(--dok-teilweise-border);
}

.card-red {
    background: var(--dok-fehlt-bg);
    border: 1px solid var(--dok-fehlt-border);
}

.card-value {
    font-family: var(--font-mono);
    font-size: 26px;
    font-weight: 500;
    color: var(--slate-800);
    line-height: 1.1;
}

.card-primary .card-value {
    color: var(--primary);
}

.card-value-green {
    color: var(--dok-ok);
}

.card-value-orange {
    color: var(--dok-teilweise);
}

.card-value-red {
    color: var(--dok-fehlt);
}

.card-label {
    font-size: 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 500;
    margin-top: 4px;
}

/* Gesamt-Fortschrittsbalken */
.summary-progress {
    max-width: 1640px;
    margin: 0 auto 12px;
    padding: 0 28px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.progress-bar-outer {
    height: 18px;
    background: var(--slate-200);
    border-radius: 9px;
    flex: 1;
    overflow: hidden;
    display: flex;
}

.progress-segment-ok {
    background: var(--dok-ok);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-segment-teil {
    background: var(--dok-teilweise);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-segment-fehlt {
    background: var(--dok-fehlt);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-pct {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    min-width: 42px;
    text-align: right;
}

/* ========== SYNC INFO TOAST ========== */
.sync-info {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 150;
    padding: 12px 20px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    border: 1px solid;
    transform: translateY(10px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 400px;
}

.sync-info.visible {
    transform: translateY(0);
    opacity: 1;
}

.sync-running {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #bfdbfe;
}

.sync-ok {
    background: var(--dok-ok-bg);
    color: var(--dok-ok);
    border-color: var(--dok-ok-border);
}

.sync-error {
    background: var(--dok-fehlt-bg);
    color: var(--dok-fehlt);
    border-color: var(--dok-fehlt-border);
}

/* ========== LOADING ========== */
.loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
    font-size: 14px;
}

@keyframes loadPulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

.loading-dots {
    display: inline-flex;
    gap: 4px;
    margin-left: 6px;
}

.loading-dots span {
    width: 5px;
    height: 5px;
    background: var(--primary);
    border-radius: 50%;
    animation: loadPulse 1.2s ease-in-out infinite;
}

.loading-dots span:nth-child(2) { animation-delay: 0.15s; }
.loading-dots span:nth-child(3) { animation-delay: 0.3s; }

.error {
    max-width: 1640px;
    margin: 20px auto;
    padding: 14px 20px;
    background: var(--dok-fehlt-bg);
    border: 1px solid var(--dok-fehlt-border);
    border-radius: var(--radius);
    color: #991b1b;
    font-size: 13px;
}

/* ========== TAGE CONTAINER ========== */
.tage-container {
    max-width: 1640px;
    margin: 12px auto 40px;
    padding: 0 28px;
}

/* ========== TAG SECTION ========== */
.tag-section {
    margin-bottom: 12px;
    animation: fadeSlideIn 0.3s ease both;
}

.tag-section:nth-child(1) { animation-delay: 0s; }
.tag-section:nth-child(2) { animation-delay: 0.05s; }
.tag-section:nth-child(3) { animation-delay: 0.1s; }
.tag-section:nth-child(4) { animation-delay: 0.15s; }
.tag-section:nth-child(5) { animation-delay: 0.2s; }
.tag-section:nth-child(6) { animation-delay: 0.25s; }
.tag-section:nth-child(7) { animation-delay: 0.3s; }

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tag-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: var(--white);
    border-radius: var(--radius) var(--radius) 0 0;
    border: 1px solid var(--border);
    border-bottom: none;
    border-left: 4px solid var(--primary);
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
}

.tag-header:hover {
    background: #f8f9fa;
}

.tag-header.collapsed {
    border-radius: var(--radius);
    border-bottom: 1px solid var(--border);
}

.tag-arrow {
    font-size: 10px;
    transition: transform 0.2s ease;
    color: var(--slate-400);
    width: 16px;
    text-align: center;
}

.tag-header.collapsed .tag-arrow {
    transform: rotate(-90deg);
}

.tag-title {
    font-weight: 700;
    font-size: 17px;
    color: var(--text);
}

.tag-count {
    font-size: 13px;
    font-family: var(--font-mono);
    color: var(--text-secondary);
    background: var(--slate-100);
    padding: 2px 8px;
    border-radius: 4px;
}

.tag-stats {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 13px;
    color: var(--text-secondary);
}

.tag-progress {
    width: 60px;
    height: 4px;
    background: var(--slate-200);
    border-radius: 2px;
    overflow: hidden;
}

.tag-progress-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.5s ease;
}

.tag-progress-fill-ok { background: var(--dok-ok); }
.tag-progress-fill-teil { background: var(--dok-teilweise); }
.tag-progress-fill-fehlt { background: var(--dok-fehlt); }

.dok-complete-badge {
    font-weight: 700;
    font-family: var(--font-mono);
    font-size: 11px;
}

.dok-complete-badge-good { color: var(--dok-ok); }
.dok-complete-badge-warn { color: var(--dok-teilweise); }
.dok-complete-badge-bad { color: var(--dok-fehlt); }

/* ========== ORDER TABLE ========== */
.tag-body {
    overflow-x: clip;
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    transition: max-height 0.3s ease;
}

.order-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    font-size: 12.5px;
}

.order-table thead {
    position: sticky;
    top: 64px; /* Header-Höhe */
    z-index: 10;
}

.order-table th {
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--slate-500);
    background: var(--slate-100);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

/* Dokument-Spalten visuell hervorheben */
.order-table th.dok-header {
    background: var(--primary-bg);
    color: var(--primary);
    text-align: center;
    font-weight: 700;
    position: relative;
}

.order-table th.dok-header:first-of-type::before {
    content: '';
    position: absolute;
    left: 0;
    top: 4px;
    bottom: 4px;
    width: 1px;
    background: var(--primary);
    opacity: 0.2;
}

.order-table td {
    padding: 6px 10px;
    border-bottom: 1px solid var(--border-light);
    white-space: nowrap;
    font-feature-settings: 'tnum';
}

.order-table tr {
    cursor: pointer;
    transition: background 0.1s ease;
}

.order-table tbody tr:hover {
    background: #e8f0fe;
}

.order-table tr:last-child td {
    border-bottom: none;
}

.order-table .col-right {
    text-align: right;
}

.order-table .col-center {
    text-align: center;
}

.order-table .col-mono {
    font-family: var(--font-mono);
    font-size: 12px;
}

/* Zeilen-Status mit dezenter Hintergrundfarbe + Border */
.row-komplett {
    border-left: 3px solid var(--dok-ok);
    background: rgba(5, 150, 105, 0.02);
}

.row-komplett:hover {
    background: rgba(5, 150, 105, 0.06) !important;
}

.row-teilweise {
    border-left: 3px solid var(--dok-teilweise);
    background: rgba(217, 119, 6, 0.02);
}

.row-teilweise:hover {
    background: rgba(217, 119, 6, 0.06) !important;
}

.row-fehlend {
    border-left: 3px solid var(--dok-fehlt);
    background: rgba(220, 38, 38, 0.015);
}

.row-fehlend:hover {
    background: rgba(220, 38, 38, 0.05) !important;
}

/* ========== SORTIERBARE SPALTEN ========== */
.order-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background 0.15s, color 0.15s;
}

.order-table th.sortable:hover {
    background: var(--slate-200);
    color: var(--slate-800);
}

.sort-arrow {
    font-size: 9px;
    margin-left: 3px;
    color: var(--primary);
    vertical-align: middle;
}

.sort-arrow-inactive {
    color: var(--slate-300);
}

/* ========== DOKUMENT ICONS ========== */
.dok-ok {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--dok-ok-bg);
    color: var(--dok-ok);
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.15s;
    border: 1px solid var(--dok-ok-border);
}

.dok-ok:hover {
    background: var(--dok-ok);
    color: #fff;
    text-decoration: none;
    transform: scale(1.1);
}

.dok-fehlt {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--slate-100);
    color: var(--slate-300);
    font-size: 10px;
    border: 1px solid var(--border);
}

.dok-hochgeladen {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--dok-ok);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.15s;
    box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.2);
}

.dok-hochgeladen:hover {
    transform: scale(1.1);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.3);
    text-decoration: none;
}

.dok-geloescht {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--dok-fehlt-bg);
    color: var(--dok-fehlt);
    font-size: 12px;
    font-weight: 700;
    border: 1px solid var(--dok-fehlt-border);
    cursor: default;
}

.dok-archiviert {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #f1f5f9;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 700;
    border: 1px solid #e2e8f0;
    cursor: default;
}

/* ========== RG-TYP BADGE ========== */
.badge-rg-modus {
    display: inline-block;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 3px;
    font-weight: 600;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.badge-rg-wochen {
    background: #e3f2fd;
    color: #1565c0;
}

.badge-rg-direkt {
    background: #fff3e0;
    color: #e65100;
}

/* Nicht erwartete Dokument-Zelle */
.dok-nicht-erwartet {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--slate-100);
    color: var(--slate-200);
    font-size: 10px;
    border: 1px dashed var(--slate-200);
    opacity: 0.5;
}

.dok-nicht-erwartet.dok-bonus {
    background: #f0fdf4;
    color: #86efac;
    border: 1px dashed #86efac;
    opacity: 0.7;
}

/* ========== PROGRESS BAR (inline in table) ========== */
.progress-cell {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 80px;
}

.progress-mini {
    flex: 1;
    height: 4px;
    background: var(--slate-200);
    border-radius: 2px;
    overflow: hidden;
}

.progress-mini-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.4s ease;
}

.progress-mini-fill-100 { background: var(--dok-ok); }
.progress-mini-fill-50 { background: var(--dok-teilweise); }
.progress-mini-fill-25 { background: var(--dok-teilweise); }
.progress-mini-fill-0 { background: var(--slate-300); }

.progress-label {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 500;
    min-width: 28px;
    text-align: right;
}

.progress-label-100 { color: var(--dok-ok); }
.progress-label-50 { color: var(--dok-teilweise); }
.progress-label-25 { color: var(--dok-teilweise); }
.progress-label-0 { color: var(--slate-400); }

/* ========== MODAL ========== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.modal-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 900px;
    width: 100%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    transform: scale(0.96) translateY(8px);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border);
}

.modal-overlay.visible .modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--slate-100);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.modal-header h3 {
    font-size: 14px;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.15s;
    line-height: 1;
}

.modal-close:hover {
    background: var(--slate-200);
    color: var(--text);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
}

.pos-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
}

.pos-table th {
    padding: 8px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--slate-500);
    border-bottom: 1px solid var(--border);
    background: var(--slate-100);
}

.pos-table td {
    padding: 7px 12px;
    border-bottom: 1px solid var(--border-light);
    font-feature-settings: 'tnum';
}

.pos-table .col-right {
    text-align: right;
}

/* ========== DOKUMENT-VORSCHAU ========== */
.dok-preview {
    cursor: pointer;
}

.preview-container {
    display: flex;
    flex-direction: column;
    height: 70vh;
}

.preview-toolbar {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.preview-btn {
    display: inline-block;
    padding: 6px 14px;
    background: var(--primary);
    color: #fff;
    border-radius: var(--radius);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s;
}

.preview-btn:hover {
    background: var(--primary-light);
    text-decoration: none;
}

.preview-iframe {
    flex: 1;
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--slate-100);
}

/* ========== KEINE DATEN ========== */
.keine-daten {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-secondary);
}

.keine-daten-icon {
    font-size: 40px;
    margin-bottom: 12px;
    opacity: 0.3;
}

.keine-daten p {
    font-size: 14px;
}

/* ========== CHECKBOX & AUSWAHL ========== */
.col-checkbox {
    width: 32px;
    min-width: 32px;
    padding-left: 8px !important;
    padding-right: 4px !important;
}

.row-check,
.select-all-check {
    width: 15px;
    height: 15px;
    cursor: pointer;
    accent-color: var(--primary);
}

tr.row-selected {
    background: rgba(21, 101, 192, 0.08) !important;
}

tr.row-selected td {
    border-color: rgba(21, 101, 192, 0.15);
}

/* Gelöschte Aufträge */
tr.row-geloescht {
    opacity: 0.45;
}

tr.row-geloescht td {
    color: var(--slate-400);
}

.badge-geloescht {
    display: inline-block;
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 3px;
    background: var(--slate-200);
    color: var(--slate-500);
    margin-left: 6px;
    text-decoration: none;
    font-weight: 500;
    vertical-align: middle;
}

/* Ausgeblendet-Button */
.nav-btn-ausgeblendet {
    font-size: 11px;
    opacity: 0.7;
}

.nav-btn-ausgeblendet:hover {
    opacity: 1;
}

/* Einblenden-Button in Modal */
.btn-einblenden {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    padding: 4px 10px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.btn-einblenden:hover {
    background: var(--primary-light);
}

/* ========== FLOATING ACTION BAR ========== */
.action-bar {
    position: fixed;
    bottom: -80px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--slate-900);
    color: #fff;
    padding: 12px 24px;
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
    z-index: 300;
    transition: bottom 0.3s ease;
    font-size: 13px;
}

.action-bar.visible {
    bottom: 24px;
}

.action-bar-text {
    white-space: nowrap;
}

.action-bar-text strong {
    color: var(--primary-light);
    font-size: 16px;
}

.action-bar-btn {
    padding: 8px 18px;
    border: none;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.action-bar-btn-cancel {
    background: var(--slate-700);
    color: var(--slate-200);
}

.action-bar-btn-cancel:hover {
    background: var(--slate-500);
}

.action-bar-btn-hide {
    background: #ef4444;
    color: #fff;
}

.action-bar-btn-hide:hover {
    background: #dc2626;
}

.action-bar-btn-manuell {
    background: #7c3aed;
    color: #fff;
}

.action-bar-btn-manuell:hover {
    background: #6d28d9;
}

/* ========== MANUELL OK (Lila) ========== */
.dok-manuell {
    color: #7c3aed;
    background: #ede9fe;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    border: 1.5px solid #a78bfa;
    cursor: help;
}

/* Klickbare fehlende Doks */
.dok-fehlt-klick {
    cursor: pointer;
    transition: all 0.15s;
}

.dok-fehlt-klick:hover {
    color: #7c3aed;
    background: #ede9fe;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Manuell-OK Modal Inputs */
.manuell-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    font-family: inherit;
    background: var(--white);
    color: var(--text-primary);
    transition: border-color 0.15s;
    box-sizing: border-box;
}

.manuell-input:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

/* Historie-Button */
.nav-btn-historie {
    font-size: 11px;
    opacity: 0.7;
}

.nav-btn-historie:hover {
    opacity: 1;
}

/* Historie-Badges */
.badge-historie {
    display: inline-block;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 3px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.historie-gesetzt {
    background: #ede9fe;
    color: #7c3aed;
}

.historie-reset {
    background: #fef2f2;
    color: #ef4444;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
    .summary {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .header-inner {
        flex-wrap: wrap;
        height: auto;
        padding: 10px 0;
        gap: 8px;
    }

    .datum-bereich {
        display: none;
    }

    .header-actions {
        width: 100%;
        justify-content: center;
    }

    .summary {
        grid-template-columns: repeat(3, 1fr);
        padding: 0 12px;
        gap: 6px;
    }

    .card {
        padding: 10px;
    }

    .card-value {
        font-size: 20px;
    }

    .tage-container {
        padding: 0 12px;
    }

    .tag-stats {
        display: none;
    }

    .sync-status-inner {
        flex-wrap: wrap;
        gap: 8px;
    }
}
