/* =====================================================
   Helpdesk-Ticketsystem - Stylesheet
   Mobile-first responsive Design
   ===================================================== */

:root {
    /* Indigo-basierte Enterprise-Palette */
    --primary: #4F46E5;
    --primary-dark: #4338CA;
    --primary-light: #EEF2FF;
    --primary-hover: #6366F1;
    --success: #10B981;
    --success-light: #D1FAE5;
    --warning: #F59E0B;
    --warning-light: #FEF3C7;
    --danger: #EF4444;
    --danger-light: #FEE2E2;
    --info: #06B6D4;
    --info-light: #CFFAFE;
    /* Slate-Graustufen (wärmer als pure Grays) */
    --gray-50: #F8FAFC;
    --gray-100: #F1F5F9;
    --gray-200: #E2E8F0;
    --gray-300: #CBD5E1;
    --gray-400: #94A3B8;
    --gray-500: #64748B;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1E293B;
    --gray-900: #0F172A;
    /* Radius & Schatten */
    --radius: 10px;
    --radius-sm: 6px;
    --radius-lg: 14px;
    --shadow: 0 1px 3px rgba(15,23,42,0.08), 0 1px 2px rgba(15,23,42,0.04);
    --shadow-md: 0 4px 6px -1px rgba(15,23,42,0.08), 0 2px 4px -2px rgba(15,23,42,0.04);
    --shadow-lg: 0 10px 25px -5px rgba(15,23,42,0.1), 0 8px 10px -6px rgba(15,23,42,0.06);
    --shadow-indigo: 0 4px 14px -2px rgba(79,70,229,0.15);
    /* Sidebar */
    --sidebar-bg: #0F172A;
    --sidebar-width: 260px;
    /* Transitions */
    --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    font-family: 'Fira Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: var(--gray-800);
    background: var(--gray-100);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-dark); text-decoration: none; }
img, video { max-width: 100%; height: auto; }
code, .font-mono { font-family: 'Fira Code', 'Menlo', monospace; }

/* =====================================================
   Layout
   ===================================================== */
.layout-public {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.public-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 1.25rem 1rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.public-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
    pointer-events: none;
}
.public-header h1 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}
.public-header .subtitle {
    font-size: 0.85rem;
    opacity: 0.85;
    font-weight: 400;
}
.public-content {
    flex: 1;
    padding: 1rem;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

/* Admin Layout */
.layout-admin {
    display: flex;
    min-height: 100vh;
}
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    transition: transform var(--transition-slow);
    border-right: 1px solid rgba(255,255,255,0.06);
    display: flex;
    flex-direction: column;
}
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
}
.sidebar-bottom {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding: 0.25rem 0;
    flex-shrink: 0;
}
.sidebar-bottom a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 1.25rem;
    color: rgba(255,255,255,0.45);
    font-size: 0.82rem;
    font-weight: 450;
    transition: all var(--transition);
    text-decoration: none;
}
.sidebar-bottom a svg {
    width: 15px;
    height: 15px;
    min-width: 15px;
    flex-shrink: 0;
    opacity: 0.6;
    pointer-events: none;
}
.sidebar-bottom a:hover, .sidebar-logout-btn:hover {
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.85);
}
.sidebar-logout-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 1.25rem;
    color: rgba(255,255,255,0.45);
    font-size: 0.8rem;
    font-weight: 450;
    background: none;
    border: none;
    cursor: pointer;
    width: 100%;
    text-align: left;
    font-family: inherit;
}
.sidebar-logout-btn svg { width: 15px; height: 15px; min-width: 15px; flex-shrink: 0; opacity: 0.6; }
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }
.sidebar-header {
    padding: 1.25rem 1.25rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #818CF8, #C084FC);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.sidebar-header .user-info {
    font-size: 0.78rem;
    color: var(--gray-400);
    margin-top: 0.35rem;
    line-height: 1.4;
}
.sidebar-nav { padding: 0.5rem 0; overflow-y: auto; }
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1.25rem;
    color: rgba(255,255,255,0.55);
    font-size: 0.875rem;
    font-weight: 450;
    transition: all var(--transition);
    text-decoration: none;
    border-left: 3px solid transparent;
    margin: 1px 0;
}
.sidebar-nav a svg {
    width: 16px;
    height: 16px;
    min-width: 16px;
    min-height: 16px;
    max-width: 16px;
    max-height: 16px;
    flex-shrink: 0;
    opacity: 0.7;
    transition: opacity var(--transition);
}
.sidebar-nav a:hover {
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.9);
    border-left-color: rgba(255,255,255,0.15);
}
.sidebar-nav a:hover svg { opacity: 1; }
.sidebar-nav a.active {
    background: rgba(79,70,229,0.15);
    color: #A5B4FC;
    border-left-color: var(--primary);
    font-weight: 550;
}
.sidebar-nav a.active svg { opacity: 1; color: #A5B4FC; }
.sidebar-nav .nav-divider {
    border-top: 1px solid rgba(255,255,255,0.06);
    margin: 0.5rem 0;
}
.sidebar-nav .nav-label {
    padding: 0.75rem 1.25rem 0.25rem;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.3);
    font-weight: 600;
}
.sidebar-version {
    padding: 0.75rem 1.25rem;
    font-size: 0.65rem;
    color: rgba(255,255,255,0.2);
    border-top: 1px solid rgba(255,255,255,0.06);
    font-family: 'Fira Code', monospace;
    letter-spacing: 0.02em;
}
.admin-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 1.75rem 2rem;
    min-height: 100vh;
    max-width: 100%;
}
#main-content {
    overflow-x: hidden;
}
.admin-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
    gap: 1rem;
}
.admin-topbar h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.02em;
}

.menu-toggle {
    display: none;
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 1.2rem;
    transition: background var(--transition);
}
.menu-toggle:hover { background: var(--primary-dark); }
.menu-toggle svg { pointer-events: none; }

/* =====================================================
   Komponenten
   ===================================================== */

/* Cards */
.card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 1rem;
    border: 1px solid var(--gray-200);
    transition: box-shadow var(--transition);
    max-width: 100%;
}
.card:hover {
    box-shadow: var(--shadow-md);
}
.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    background: var(--gray-50);
}
.card-header h2, .card-header h3 {
    font-size: 1rem;
    font-weight: 650;
    color: var(--gray-900);
    letter-spacing: -0.01em;
}
.card-body { padding: 1.25rem; }
.card-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
    gap: 1rem;
    margin-bottom: 1.75rem;
}
.stat-card {
    background: white;
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    text-align: center;
    border: 1px solid var(--gray-200);
    border-top: 3px solid var(--gray-300);
    transition: all var(--transition);
    position: relative;
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.stat-card .stat-value {
    font-family: 'Fira Code', monospace;
    font-size: 1.85rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
}
.stat-card .stat-label {
    font-size: 0.78rem;
    color: var(--gray-500);
    margin-top: 0.35rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.stat-card.stat-danger { border-top-color: var(--danger); }
.stat-card.stat-danger .stat-value { color: var(--danger); }
.stat-card.stat-warning { border-top-color: var(--warning); }
.stat-card.stat-warning .stat-value { color: var(--warning); }
.stat-card.stat-success { border-top-color: var(--success); }
.stat-card.stat-success .stat-value { color: var(--success); }
.stat-card.stat-info { border-top-color: var(--info); }
.stat-card.stat-info .stat-value { color: var(--info); }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 550;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    line-height: 1.4;
    font-family: inherit;
    letter-spacing: 0.01em;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); text-decoration: none; }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); box-shadow: var(--shadow-indigo); }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #059669; }
.btn-warning { background: var(--warning); color: white; }
.btn-warning:hover { background: #D97706; }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #DC2626; }
.btn-secondary { background: white; color: var(--gray-700); border: 1px solid var(--gray-300); }
.btn-secondary:hover { background: var(--gray-50); border-color: var(--gray-400); }
.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.8rem; border-radius: var(--radius-sm); }
.btn-lg { padding: 0.85rem 1.75rem; font-size: 1.05rem; border-radius: var(--radius); }
.btn-block { width: 100%; }

/* Forms */
.form-group {
    margin-bottom: 1rem;
}
.form-group label {
    display: block;
    margin-bottom: 0.375rem;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--gray-700);
}
.form-group label .required {
    color: var(--danger);
    margin-left: 2px;
}
.form-control {
    width: 100%;
    padding: 0.6rem 0.85rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color var(--transition), box-shadow var(--transition);
    background: white;
    color: var(--gray-800);
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}
.form-control::placeholder { color: var(--gray-400); }
textarea.form-control { min-height: 120px; resize: vertical; }
select.form-control { appearance: auto; }
.form-hint {
    font-size: 0.8rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
}
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.form-inline {
    display: flex;
    gap: 0.5rem;
    align-items: end;
    flex-wrap: wrap;
}
.form-inline .form-group { margin-bottom: 0; }

/* Datetime Input */
.datetime-input-group {
    position: relative;
}
input[type="datetime-local"].form-control {
    min-height: 44px;
    font-size: 1rem;
    padding-right: 0.5rem;
}
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    padding: 4px;
    opacity: 0.7;
}
input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

/* File Upload */
.file-upload-area {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    background: var(--gray-50);
}
.file-upload-area:hover,
.file-upload-area.dragover {
    border-color: var(--primary);
    background: var(--primary-light);
}
.file-upload-area .upload-icon {
    font-size: 2.5rem;
    color: var(--gray-400);
    margin-bottom: 0.5rem;
}
.file-upload-area p {
    color: var(--gray-600);
    margin-bottom: 0.25rem;
}
.file-upload-area .upload-hint {
    font-size: 0.8rem;
    color: var(--gray-400);
}
.file-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}
.file-preview-item {
    width: 100px;
    position: relative;
}
.file-preview-item img {
    width: 100px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--gray-200);
}
.file-preview-placeholder {
    width: 100px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-100);
    border-radius: 4px;
    font-size: 24px;
}
.file-preview-name {
    font-size: 0.7rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-top: 4px;
}
.file-preview-item .remove-file {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--danger);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Alerts */
.alert {
    padding: 0.8rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    font-size: 0.875rem;
    border-left: 4px solid;
    animation: alertSlideIn 0.3s ease-out;
}
@keyframes alertSlideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}
.alert-success { background: var(--success-light); border-color: var(--success); color: #065F46; }
.alert-error { background: var(--danger-light); border-color: var(--danger); color: #991B1B; }
.alert-warning { background: var(--warning-light); border-color: var(--warning); color: #92400E; }
.alert-info { background: var(--info-light); border-color: var(--info); color: #155E75; }

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}
.status-draft { background: var(--gray-200); color: var(--gray-600); }
.status-submitted { background: var(--info-light); color: var(--info); }
.status-incomplete { background: var(--warning-light); color: var(--warning); }
.status-complete { background: #e0e7ff; color: #3730a3; }
.status-accepted { background: var(--primary-light); color: var(--primary); }
.status-progress { background: #fef3c7; color: #b45309; }
.status-waiting { background: #fef9c3; color: #a16207; }
.status-resolved { background: var(--success-light); color: var(--success); }
.status-closed { background: var(--gray-200); color: var(--gray-600); }
.status-rejected { background: var(--danger-light); color: var(--danger); }

.severity-critical { background: var(--danger-light); color: var(--danger); }
.severity-high { background: #ffedd5; color: #c2410c; }
.severity-medium { background: var(--warning-light); color: var(--warning); }
.severity-low { background: var(--success-light); color: var(--success); }

/* Tables */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    margin: 0 -1px;
}
table {
    width: 100%;
    border-collapse: collapse;
}
th, td {
    padding: 0.7rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
    font-size: 0.875rem;
}
th {
    font-weight: 600;
    color: var(--gray-500);
    background: var(--gray-50);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}
tbody tr { transition: background var(--transition); }
tbody tr:nth-child(even) { background: rgba(248,250,252,0.5); }
tbody tr:hover { background: var(--primary-light); }

/* Comments / Timeline */
.timeline { list-style: none; }
.timeline-item {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--gray-100);
}
.timeline-item:last-child { border-bottom: none; }
.timeline-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8rem;
    flex-shrink: 0;
}
.timeline-avatar.internal {
    background: var(--warning-light);
    color: var(--warning);
}
.timeline-content { flex: 1; min-width: 0; }
.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.375rem;
}
.timeline-author { font-weight: 600; font-size: 0.9rem; }
.timeline-date { font-size: 0.8rem; color: var(--gray-500); }
.timeline-text {
    font-size: 0.9rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}
.internal-badge {
    background: var(--warning-light);
    color: var(--warning);
    font-size: 0.7rem;
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
}

/* History */
.history-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.5rem 0;
    font-size: 0.85rem;
    color: var(--gray-600);
    border-bottom: 1px solid var(--gray-100);
}
.history-item:last-child { border-bottom: none; }
.history-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gray-400);
    margin-top: 6px;
    flex-shrink: 0;
}

/* SLA Display (legacy) */
.sla-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.sla-item {
    padding: 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
}
.sla-item.sla-ok { border-color: var(--success); background: var(--success-light); }
.sla-item.sla-warning { border-color: var(--warning); background: var(--warning-light); }
.sla-item.sla-violated { border-color: var(--danger); background: var(--danger-light); }
.sla-item.sla-paused { border-color: var(--gray-400); background: var(--gray-100); }
.sla-item.sla-completed { border-color: var(--success); background: var(--success-light); }
.sla-label { font-size: 0.8rem; font-weight: 600; margin-bottom: 0.25rem; }
.sla-value { font-size: 1.25rem; font-weight: 700; }
.sla-deadline { font-size: 0.8rem; color: var(--gray-600); margin-top: 0.25rem; }

/* SLA Progress Bars */
.sla-progress-item {
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    margin-bottom: 1rem;
    transition: border-color 0.2s;
}
.sla-progress-item:last-child { margin-bottom: 0; }
.sla-progress-item.sla-ok { border-left: 4px solid var(--success); background: var(--success-light); }
.sla-progress-item.sla-warning { border-left: 4px solid var(--warning); background: var(--warning-light); }
.sla-progress-item.sla-violated { border-left: 4px solid var(--danger); background: var(--danger-light); }
.sla-progress-item.sla-paused { border-left: 4px solid var(--gray-400); background: var(--gray-100); }
.sla-progress-item.sla-completed { border-left: 4px solid var(--success); background: var(--success-light); }

.sla-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.sla-progress-label {
    font-weight: 700;
    font-size: 0.9rem;
    display: block;
}
.sla-progress-sublabel {
    font-size: 0.75rem;
    color: var(--gray-500);
}
.sla-progress-status {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
}
.sla-progress-item.sla-ok .sla-progress-status { color: var(--success); }
.sla-progress-item.sla-warning .sla-progress-status { color: #b45309; }
.sla-progress-item.sla-violated .sla-progress-status { color: var(--danger); }
.sla-progress-item.sla-paused .sla-progress-status { color: var(--gray-500); }
.sla-progress-item.sla-completed .sla-progress-status { color: var(--success); }

.sla-progress-icon {
    font-size: 1rem;
}

.sla-progress-bar-container {
    width: 100%;
    height: 10px;
    background: rgba(0,0,0,0.08);
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 0.4rem;
}
.sla-progress-bar {
    height: 100%;
    border-radius: 5px;
    transition: width 0.6s ease;
    min-width: 2px;
}

.sla-progress-footer {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--gray-500);
}

/* Violated pulsing effect */
.sla-progress-item.sla-violated .sla-progress-bar {
    animation: sla-pulse 2s ease-in-out infinite;
}
@keyframes sla-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* SLA Mini Bars (Ticket-Liste / Dashboard) */
.sla-mini {
    min-width: 80px;
}
.sla-mini-bar {
    width: 100%;
    height: 8px;
    background: rgba(0,0,0,0.08);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.2rem;
}
.sla-mini-bar > div {
    height: 100%;
    border-radius: 4px;
    transition: width 0.4s ease;
    min-width: 2px;
}
.sla-mini-label {
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
}
.sla-mini-pulse .sla-mini-bar > div {
    animation: sla-pulse 2s ease-in-out infinite;
}

/* Highlight time-critical rows in ticket lists */
tr.sla-row-violated {
    background: var(--danger-light) !important;
}
tr.sla-row-violated td { color: var(--danger) !important; }
tr.sla-row-violated td a { color: var(--danger) !important; font-weight: 700; }
tr.sla-row-warning {
    background: var(--warning-light) !important;
}

/* SLA Compact Line Display (Ticket-Detail) */
.sla-line-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    border-left: 5px solid var(--success);
    border-bottom: 1px solid var(--gray-200);
    transition: border-color 0.5s, background 0.3s;
}
.sla-line-item:last-child { border-bottom: none; }
.sla-line-item.sla-line-completed { border-left-color: var(--success); background: var(--success-light); }
.sla-line-item.sla-line-ok { border-left-color: var(--success); }
.sla-line-item.sla-line-warning { border-left-color: var(--warning); background: var(--warning-light); }
.sla-line-item.sla-line-violated { border-left-color: var(--danger); background: var(--danger-light); }
.sla-line-item.sla-line-paused { border-left-color: var(--gray-400); background: var(--gray-100); }

.sla-line-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.sla-line-label {
    font-size: 0.9rem;
}
.sla-line-label strong {
    font-weight: 700;
}
.sla-line-sub {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-left: 0.5rem;
}
.sla-line-time {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-variant-numeric: tabular-nums;
}
.sla-line-countdown {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--gray-800);
}
.sla-line-overdue {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--danger);
    animation: sla-pulse 2s ease-in-out infinite;
}
.sla-line-done {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--success);
}
.sla-line-paused {
    font-size: 0.9rem;
    color: var(--gray-500);
}
.sla-line-unit {
    font-size: 0.75rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.sla-line-bar {
    width: 100%;
    height: 10px;
    background: var(--gray-200);
    border-radius: 5px;
    overflow: hidden;
}
.sla-line-bar-fill {
    height: 100%;
    border-radius: 5px;
    transition: width 1s ease, background 0.5s;
    background: var(--success);
    min-width: 2px;
}
.sla-line-item.sla-line-violated .sla-line-bar-fill {
    animation: sla-pulse 2s ease-in-out infinite;
}
.sla-line-footer {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--gray-500);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.25rem;
    padding: 1rem 0;
    flex-wrap: wrap;
}
.pagination a, .pagination span {
    padding: 0.5rem 0.875rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.85rem;
    color: var(--gray-700);
    text-decoration: none;
}
.pagination a:hover { background: var(--gray-100); }
.pagination .active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Ticket Info Box */
.ticket-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}
.info-item { padding: 0.5rem 0; }
.info-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.info-value { font-size: 0.95rem; margin-top: 0.125rem; }

/* Attachments Grid */
.attachments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.5rem;
}
.attachment-item {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
}
.attachment-item img {
    width: 100%;
    height: 80px;
    object-fit: cover;
}
.attachment-item .attachment-name {
    padding: 0.25rem 0.5rem;
    font-size: 0.65rem;
    color: var(--gray-600);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.comment-attachments .attachments-grid {
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 0.35rem;
}
.comment-attachments .attachment-item img {
    height: 60px;
}
.comment-attachments .attachment-item .attachment-name {
    font-size: 0.6rem;
    padding: 0.15rem 0.35rem;
}

/* Notice Box */
.notice-box {
    background: var(--warning-light);
    border: 1px solid var(--warning);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
    color: #92400e;
    line-height: 1.5;
}
.notice-box strong { display: block; margin-bottom: 0.25rem; }

/* Confirmation Page */
.confirm-box {
    text-align: center;
    padding: 2rem 1rem;
}
.confirm-icon {
    font-size: 4rem;
    color: var(--success);
    margin-bottom: 1rem;
}
.confirm-ticket-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin: 1rem 0;
    padding: 0.75rem;
    background: var(--primary-light);
    border-radius: var(--radius);
    display: inline-block;
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--gray-200);
    margin-bottom: 1rem;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.tabs::-webkit-scrollbar {
    display: none;
}
.tab {
    padding: 0.75rem 1.25rem;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--gray-500);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
}
.tab:hover { color: var(--gray-700); }
.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Filter Bar */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 1rem;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
}
.filter-bar .form-control {
    width: auto;
    min-width: 150px;
}
.filter-bar select.form-control {
    min-width: 130px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--gray-500);
}
.empty-state .empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Login Page */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-900);
    padding: 1rem;
    position: relative;
    overflow: hidden;
}
.login-page::before {
    content: '';
    position: absolute;
    top: -30%;
    left: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(79,70,229,0.25) 0%, transparent 70%);
    pointer-events: none;
}
.login-page::after {
    content: '';
    position: absolute;
    bottom: -20%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(124,58,237,0.15) 0%, transparent 70%);
    pointer-events: none;
}
.login-box {
    background: rgba(255,255,255,0.97);
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
}
.login-box h1 {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    color: var(--gray-900);
    letter-spacing: -0.02em;
}
.login-box .login-subtitle {
    text-align: center;
    color: var(--gray-500);
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

/* =====================================================
   Responsive — Tablet (max 1024px)
   ===================================================== */
@media (max-width: 1024px) {
    .admin-content {
        padding: 1.25rem;
    }
    .grid-2-1 {
        grid-template-columns: 1fr;
    }
    .grid-1-1 {
        grid-template-columns: 1fr;
    }
}

/* =====================================================
   Responsive — Mobile (max 768px)
   ===================================================== */
@media (max-width: 768px) {
    /* Scroll-Lock wenn Sidebar offen */
    html.sidebar-open,
    html.sidebar-open body {
        overflow: hidden !important;
        height: 100% !important;
    }

    /* Sidebar: Off-Canvas mit Overlay */
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
        box-shadow: 10px 0 30px rgba(0,0,0,0.3);
    }
    /* Overlay hinter der Sidebar */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.4);
        z-index: 99;
    }
    .sidebar-overlay.active {
        display: block;
    }

    .admin-content {
        margin-left: 0;
        padding: 0;
    }

    /* Fixed Topbar mit Menü-Button */
    .admin-topbar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 91;
        background: white;
        border-bottom: 1px solid var(--gray-200);
        padding: 0.65rem 1rem;
        margin: 0;
        gap: 0.5rem;
        box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    }

    /* Abstand unter der fixed Topbar */
    #main-content {
        padding: 3.5rem 1rem 1rem 1rem;
    }
    .admin-topbar h1 {
        font-size: 1.05rem;
        order: 2;
        flex: 1;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .menu-toggle {
        display: flex;
    }

    /* Grids → einspaltig */
    .form-row,
    .sla-info,
    .ticket-info,
    .grid-2-1,
    .grid-1-1 {
        grid-template-columns: 1fr !important;
    }

    /* Filter stacking */
    .filter-bar {
        flex-direction: column;
    }
    .filter-bar .form-control,
    .filter-bar select.form-control {
        width: 100%;
        min-width: 0;
    }

    /* Stats: 2er Grid */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    /* =====================================================
       Tabellen → Card-Layout auf Mobile
       ===================================================== */
    .table-responsive table,
    .table-responsive thead,
    .table-responsive tbody,
    .table-responsive th,
    .table-responsive td,
    .table-responsive tr {
        display: block;
    }
    .table-responsive thead {
        display: none;
    }
    .table-responsive tbody tr {
        background: white;
        border: 1px solid var(--gray-200);
        border-radius: var(--radius-sm);
        margin-bottom: 0.6rem;
        padding: 0.6rem 0.75rem;
    }
    .table-responsive tbody tr:nth-child(even) {
        background: white;
    }
    .table-responsive tbody tr:hover {
        background: var(--gray-50);
    }
    .table-responsive td {
        border-bottom: none;
        padding: 0.25rem 0;
        font-size: 0.82rem;
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 0.5rem;
    }
    .table-responsive td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 0.7rem;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: var(--gray-500);
        min-width: 90px;
        flex-shrink: 0;
    }
    .table-responsive td:empty {
        display: none;
    }

    /* Inline-Formulare und Action-Buttons wrappen */
    .d-flex { flex-wrap: wrap; }
    .form-control-inline {
        width: 100%;
        min-width: 0;
    }
    .text-nowrap {
        white-space: normal;
    }

    /* Buttons */
    .btn {
        padding: 0.5rem 0.9rem;
        font-size: 0.82rem;
    }
    .btn-sm {
        padding: 0.3rem 0.55rem;
        font-size: 0.75rem;
    }
    .btn-lg {
        padding: 0.75rem 1.25rem;
        font-size: 0.95rem;
    }

    /* Karten */
    .card-header {
        padding: 0.75rem 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    .card-body {
        padding: 1rem;
    }

    /* Action-Button Gruppen in Tabellen */
    .form-inline-action {
        display: inline-block;
        margin-bottom: 0.25rem;
    }

    /* Pagination */
    .pagination {
        gap: 0.15rem;
    }
    .pagination a, .pagination span {
        padding: 0.4rem 0.6rem;
        font-size: 0.78rem;
    }

    /* SLA Mini */
    .sla-mini {
        min-width: 60px;
    }

    /* Bestätigungsbox */
    .confirm-ticket-number {
        font-size: 1.1rem;
        word-break: break-all;
    }

    /* Kommentar-Formular */
    .comment-form-section {
        padding-top: 0.75rem;
    }

    /* Timeline */
    .timeline-item {
        gap: 0.6rem;
    }
    .timeline-avatar {
        width: 30px;
        height: 30px;
        font-size: 0.7rem;
    }

    /* Tabs */
    .tab {
        padding: 0.6rem 0.9rem;
        font-size: 0.82rem;
    }

    /* Attachments */
    .attachments-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }

    /* QR-Codes: URL auf Mobile ausblenden */
    .qr-ticket-url {
        display: none;
    }
}

/* =====================================================
   Responsive — Small Phone (max 480px)
   ===================================================== */
@media (max-width: 480px) {
    .public-content {
        padding: 0.6rem;
    }
    .admin-content {
        padding: 0.6rem;
    }
    .card-body {
        padding: 0.75rem;
    }
    .card-header {
        padding: 0.6rem 0.75rem;
    }

    /* Stats: 2 Spalten, kompakter */
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }
    .stat-card {
        padding: 0.75rem;
    }
    .stat-card .stat-value {
        font-size: 1.4rem;
    }
    .stat-card .stat-label {
        font-size: 0.68rem;
    }

    /* Tabellen: noch kompakter */
    th, td {
        padding: 0.4rem;
        font-size: 0.72rem;
    }

    /* Große Buttons: volle Breite */
    .btn-lg {
        width: 100%;
        justify-content: center;
    }

    /* Login */
    .login-box {
        padding: 1.5rem;
    }
    .login-box h1 {
        font-size: 1.25rem;
    }

    /* Flex: vertikal */
    .d-flex:not(.tabs):not(.gap-sm) {
        flex-direction: column;
        align-items: stretch;
    }
    .d-flex .btn {
        width: 100%;
        justify-content: center;
    }

    /* Public Header */
    .public-header {
        padding: 1rem 0.75rem;
    }
    .public-header h1 {
        font-size: 1.05rem;
    }

    /* Ticket-Info */
    .info-item {
        padding: 0.35rem 0;
    }
    .info-label {
        font-size: 0.68rem;
    }
    .info-value {
        font-size: 0.85rem;
    }

    /* SLA-Anzeige */
    .sla-line-countdown, .sla-line-overdue {
        font-size: 0.95rem;
    }
    .sla-line-label strong {
        font-size: 0.85rem;
    }

    /* Beschreibungsbox */
    .description-box {
        padding: 0.75rem;
        font-size: 0.85rem;
    }

    /* Datei-Upload */
    .file-upload-area {
        padding: 1.25rem;
    }
    .file-upload-area .upload-icon {
        font-size: 2rem;
    }

    /* History */
    .history-item {
        font-size: 0.78rem;
    }
}

/* =====================================================
   Skip Link (Accessibility)
   ===================================================== */
.skip-link {
    position: absolute;
    top: -100%;
    left: 0;
    background: var(--primary);
    color: white;
    padding: 0.75rem 1.5rem;
    z-index: 9999;
    font-weight: 600;
    border-radius: 0 0 var(--radius) 0;
    text-decoration: none;
}
.skip-link:focus {
    top: 0;
}

/* =====================================================
   Header Utility Classes (public layout)
   ===================================================== */
.header-user-bar {
    margin-top: 0.5rem;
    font-size: 0.85rem;
}
.header-link {
    color: white;
    text-decoration: none;
}
.header-link:hover {
    text-decoration: underline;
}
.header-link-subtle {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
}
.header-link-subtle:hover {
    color: white;
    text-decoration: underline;
}
.public-footer {
    text-align: center;
    padding: 1rem;
    color: var(--gray-400);
    font-size: 0.8rem;
}

/* =====================================================
   Utility Classes
   ===================================================== */
/* Display */
.d-none { display: none; }
.d-flex { display: flex; }
.d-grid { display: grid; }
.d-inline { display: inline; }
.d-inline-flex { display: inline-flex; }

/* Flexbox */
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }

/* Gap */
.gap-xs { gap: 0.25rem; }
.gap-sm { gap: 0.5rem; }
.gap-md { gap: 1rem; }
.gap-lg { gap: 1.5rem; }

/* Text */
.text-center { text-align: center; }
.text-sm { font-size: 0.85rem; }
.text-xs { font-size: 0.75rem; }
.text-muted { color: var(--gray-500); }
.text-muted-light { color: var(--gray-400); }
.text-prewrap { white-space: pre-wrap; }
.text-nowrap { white-space: nowrap; }
.text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fw-600 { font-weight: 600; }

/* Margin */
.mt-xs { margin-top: 0.25rem; }
.mt-sm { margin-top: 0.5rem; }
.mt-md { margin-top: 1rem; }
.mt-lg { margin-top: 1.5rem; }
.mb-xs { margin-bottom: 0.25rem; }
.mb-sm { margin-bottom: 0.5rem; }
.mb-md { margin-bottom: 1rem; }
.mb-lg { margin-bottom: 1.5rem; }

/* Padding */
.p-0 { padding: 0; }
.p-sm { padding: 0.5rem; }
.p-md { padding: 1rem; }
.p-lg { padding: 2rem; }

/* Grid */
.grid-2-1 { grid-template-columns: 2fr 1fr; }
.grid-1-1 { grid-template-columns: 1fr 1fr; }

/* Common patterns */
.card-body-flush { padding: 0; }
.form-inline-action { display: inline; }
.back-link { margin-bottom: 1rem; }
.section-title { margin-bottom: 1rem; font-size: 1rem; color: var(--gray-600); }
.separator { margin: 1.5rem 0; border: none; border-top: 1px solid var(--gray-200); }
.pin-input { font-size: 1.25rem; text-align: center; letter-spacing: 0.5rem; }
.pin-input-lg { font-size: 1.5rem; text-align: center; letter-spacing: 0.5rem; }
.input-readonly { background: var(--gray-100); }
.code-display { padding: 0.625rem 0.875rem; background: var(--gray-100); border-radius: var(--radius); font-family: monospace; font-size: 1.1rem; letter-spacing: 0.2em; }
.video-placeholder { height: 80px; display: flex; align-items: center; justify-content: center; background: var(--gray-100); font-size: 1.5rem; }
.video-placeholder-sm { height: 60px; display: flex; align-items: center; justify-content: center; background: var(--gray-100); font-size: 1.2rem; }
.video-placeholder-lg { height: 120px; display: flex; align-items: center; justify-content: center; background: var(--gray-100); font-size: 2rem; }
.attachment-audio { grid-column: 1 / -1; padding: 0.5rem; }
.attachment-audio audio { width: 100%; max-width: 400px; }
.attachment-video { grid-column: 1 / -1; padding: 0.5rem; }
.comment-form-section { margin-top: 1rem; border-top: 1px solid var(--gray-200); padding-top: 1rem; }
.textarea-sm { min-height: 80px; }
.textarea-md { min-height: 60px; }
.form-control-inline { width: auto; min-width: 120px; padding: 0.375rem 0.5rem; font-size: 0.85rem; }
.description-box { white-space: pre-wrap; margin-top: 0.5rem; padding: 1rem; background: var(--gray-50); border-radius: var(--radius); }
.escalation-item { padding: 0.5rem 0; border-bottom: 1px solid var(--gray-100); font-size: 0.85rem; }
.badge-telegram { background: #0088cc; color: #fff; font-size: 0.65rem; }
.badge-email { background: var(--gray-200); color: var(--gray-600); font-size: 0.65rem; }
.badge-system { font-size: 0.65rem; background: var(--gray-200); color: var(--gray-600); }
.sla-text-ok { color: #059669; }
.sla-text-warning { color: #b45309; }
.sla-text-danger { color: #dc2626; }
.btn-customer-login { background: #059669; }
.btn-customer-login:hover { background: #047857; }
.login-page-customer { background: linear-gradient(135deg, #059669 0%, #047857 100%); }
.qr-preview-img { max-width: 300px; margin-bottom: 1rem; }
.qr-print-img { max-width: 400px; width: 100%; margin-bottom: 1rem; }
.qr-ticket-url { font-size: 0.75rem; word-break: break-all; }

/* =====================================================
   Loading Spinner
   ===================================================== */
.btn.is-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}
.btn.is-loading::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
.btn-secondary.is-loading::after {
    border-color: rgba(0,0,0,0.15);
    border-top-color: var(--gray-700);
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* (Responsive rules merged into main responsive block above) */

/* Print */
@media print {
    .sidebar, .menu-toggle, .admin-topbar, .filter-bar, .btn, .skip-link { display: none !important; }
    .admin-content { margin-left: 0 !important; }
    .card { box-shadow: none; border: 1px solid #ddd; }
}

/* =====================================================
   Dark Mode (aktiviert via data-theme="dark" auf <html>)
   ===================================================== */
html[data-theme="dark"] {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #1e3a5f;
    --success: #22c55e;
    --success-light: #14532d;
    --warning: #f59e0b;
    --warning-light: #451a03;
    --danger: #ef4444;
    --danger-light: #450a0a;
    --info: #06b6d4;
    --info-light: #083344;
    --gray-50: #111827;
    --gray-100: #1f2937;
    --gray-200: #374151;
    --gray-300: #4b5563;
    --gray-400: #6b7280;
    --gray-500: #9ca3af;
    --gray-600: #d1d5db;
    --gray-700: #e5e7eb;
    --gray-800: #f3f4f6;
    --gray-900: #f9fafb;
    --shadow: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.3), 0 4px 6px -2px rgba(0,0,0,0.2);
}
html[data-theme="dark"] body {
    background: #0f172a;
    color: var(--gray-800);
}
html[data-theme="dark"] .card,
html[data-theme="dark"] .filter-bar,
html[data-theme="dark"] .stat-card {
    background: #1e293b;
}
html[data-theme="dark"] .form-control {
    background: #1e293b;
    border-color: var(--gray-300);
    color: var(--gray-800);
}
html[data-theme="dark"] .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}
html[data-theme="dark"] .sidebar {
    background: #0f172a;
}
html[data-theme="dark"] .sidebar-header {
    border-bottom-color: #334155;
}
html[data-theme="dark"] .sidebar-nav a:hover,
html[data-theme="dark"] .sidebar-nav a.active {
    background: #334155;
}
html[data-theme="dark"] .sidebar-nav .nav-divider {
    border-top-color: #334155;
}
html[data-theme="dark"] .card-header {
    border-bottom-color: #334155;
}
html[data-theme="dark"] .card-footer {
    background: #1a2332;
    border-top-color: #334155;
}
html[data-theme="dark"] table th {
    background: #1a2332;
}
html[data-theme="dark"] table td,
html[data-theme="dark"] table th {
    border-bottom-color: #334155;
}
html[data-theme="dark"] tr:hover {
    background: #1a2332;
}
html[data-theme="dark"] .login-page {
    background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%);
}
html[data-theme="dark"] .login-box {
    background: #1e293b;
    color: var(--gray-800);
}
html[data-theme="dark"] .public-header {
    background: #1e3a5f;
}
html[data-theme="dark"] .file-upload-area {
    background: #1a2332;
    border-color: var(--gray-300);
}
html[data-theme="dark"] .file-upload-area:hover,
html[data-theme="dark"] .file-upload-area.dragover {
    background: #1e3a5f;
    border-color: var(--primary);
}
html[data-theme="dark"] .alert-success { background: var(--success-light); color: #86efac; }
html[data-theme="dark"] .alert-error { background: var(--danger-light); color: #fca5a5; }
html[data-theme="dark"] .alert-warning { background: var(--warning-light); color: #fcd34d; }
html[data-theme="dark"] .alert-info { background: var(--info-light); color: #67e8f9; }
html[data-theme="dark"] .status-draft { background: #334155; color: var(--gray-500); }
html[data-theme="dark"] .status-submitted { background: var(--info-light); color: var(--info); }
html[data-theme="dark"] .status-incomplete { background: var(--warning-light); color: var(--warning); }
html[data-theme="dark"] .status-complete { background: #312e81; color: #a5b4fc; }
html[data-theme="dark"] .status-accepted { background: var(--primary-light); color: var(--primary); }
html[data-theme="dark"] .status-progress { background: var(--warning-light); color: var(--warning); }
html[data-theme="dark"] .status-waiting { background: #422006; color: #fbbf24; }
html[data-theme="dark"] .status-resolved { background: var(--success-light); color: var(--success); }
html[data-theme="dark"] .status-closed { background: #334155; color: var(--gray-500); }
html[data-theme="dark"] .status-rejected { background: var(--danger-light); color: var(--danger); }
html[data-theme="dark"] .severity-critical { background: var(--danger-light); color: var(--danger); }
html[data-theme="dark"] .severity-high { background: #431407; color: #fb923c; }
html[data-theme="dark"] .severity-medium { background: var(--warning-light); color: var(--warning); }
html[data-theme="dark"] .severity-low { background: var(--success-light); color: var(--success); }
html[data-theme="dark"] .timeline-item { border-bottom-color: #334155; }
html[data-theme="dark"] .timeline-avatar { background: var(--primary-light); color: var(--primary); }
html[data-theme="dark"] .history-item { border-bottom-color: #334155; }
html[data-theme="dark"] .pagination a,
html[data-theme="dark"] .pagination span {
    border-color: #334155;
    color: var(--gray-700);
}
html[data-theme="dark"] .pagination a:hover { background: #334155; }
html[data-theme="dark"] .sla-line-bar { background: #334155; }
html[data-theme="dark"] .sla-progress-bar-container { background: rgba(255,255,255,0.08); }
html[data-theme="dark"] .sla-mini-bar { background: rgba(255,255,255,0.08); }
html[data-theme="dark"] .notice-box { background: var(--warning-light); border-color: var(--warning); color: #fcd34d; }
html[data-theme="dark"] .sla-text-ok { color: #4ade80 !important; }
html[data-theme="dark"] .sla-text-warning { color: #fbbf24 !important; }
html[data-theme="dark"] .sla-text-danger { color: #f87171 !important; }
html[data-theme="dark"] .public-footer { color: var(--gray-400); }
html[data-theme="dark"] img,
html[data-theme="dark"] video { opacity: 0.9; }
