/**
 * Zeitpilot - CSS v2.1
 * Professionelles Dark/Light Theme Design
 */

/* =====================================================
   CSS VARIABLES - DARK MODE (Default)
   ===================================================== */
:root {
    /* Colors */
    --bg-dark: #0a0f1a;
    --bg-darker: #060a12;
    --bg-card: #111827;
    --bg-card-hover: #1a2332;
    --bg-input: #1f2937;

    --text-primary: #f9fafb;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;

    --border-color: #374151;
    --border-light: #4b5563;

    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --primary-light: rgba(59, 130, 246, 0.1);

    --success: #10b981;
    --success-light: rgba(16, 185, 129, 0.1);

    --warning: #f59e0b;
    --warning-light: rgba(245, 158, 11, 0.1);

    --danger: #ef4444;
    --danger-light: rgba(239, 68, 68, 0.1);

    --info: #06b6d4;
    --info-light: rgba(6, 182, 212, 0.1);

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.6);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;

    /* Layout */
    --sidebar-width: 260px;
    --header-height: 64px;
}

/* =====================================================
   LIGHT MODE
   ===================================================== */
[data-theme="light"] {
    --bg-dark: #f3f4f6;
    --bg-darker: #e5e7eb;
    --bg-card: #ffffff;
    --bg-card-hover: #f9fafb;
    --bg-input: #f3f4f6;

    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;

    --border-color: #e5e7eb;
    --border-light: #d1d5db;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);
}

/* =====================================================
   THEME TOGGLE BUTTON
   ===================================================== */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: var(--radius-md);
    background: var(--bg-input);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.theme-toggle:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
    font-size: 1.25rem;
}

/* Dark mode: zeige Sonne (um zu Light zu wechseln) */
:root .theme-toggle .icon-sun { display: block; }
:root .theme-toggle .icon-moon { display: none; }

/* Light mode: zeige Mond (um zu Dark zu wechseln) */
[data-theme="light"] .theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: block; }

/* =====================================================
   SKELETON LOADER
   ===================================================== */
.skeleton {
    background: linear-gradient(90deg, var(--bg-input) 25%, var(--bg-card-hover) 50%, var(--bg-input) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-sm);
}

.skeleton-text {
    height: 1em;
    margin-bottom: 0.5em;
}

.skeleton-text:last-child {
    width: 60%;
}

.skeleton-card {
    height: 100px;
    margin-bottom: 1rem;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* =====================================================
   BREADCRUMB NAVIGATION
   ===================================================== */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    padding: 0.5rem 0;
}

.breadcrumb a {
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.breadcrumb a:hover {
    color: var(--primary);
}

.breadcrumb .separator {
    color: var(--text-muted);
}

.breadcrumb .current {
    color: var(--text-primary);
    font-weight: 500;
}

/* =====================================================
   RESET & BASE
   ===================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-hover);
}

img {
    max-width: 100%;
    height: auto;
}

/* =====================================================
   APP LAYOUT
   ===================================================== */
.app {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-darker);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    overflow-y: auto;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-color);
}

.sidebar-logo img {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    object-fit: contain;
}

.logo-icon {
    font-size: 2rem;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.sidebar-nav {
    flex: 1;
    padding: var(--space-md);
    overflow-y: auto;
}

.nav-group {
    margin-bottom: var(--space-lg);
}

.nav-group-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: var(--space-sm) var(--space-md);
    margin-bottom: var(--space-xs);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    margin-bottom: var(--space-xs);
}

.nav-item:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--primary-light);
    color: var(--primary);
}

.nav-icon {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
}

.nav-label {
    font-size: 0.9rem;
    font-weight: 500;
}

.sidebar-footer {
    padding: var(--space-lg);
    border-top: 1px solid var(--border-color);
}

.user-menu {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.user-name {
    font-size: 0.875rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.logout-btn {
    font-size: 0.875rem;
    color: var(--danger);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    background: var(--danger-light);
    text-align: center;
    transition: all var(--transition-fast);
}

.logout-btn:hover {
    background: var(--danger);
    color: white;
}

/* Main Content */
.main {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    height: var(--header-height);
    background: var(--bg-darker);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-xl);
    position: sticky;
    top: 0;
    z-index: 50;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.content {
    flex: 1;
    padding: var(--space-xl);
    overflow-y: auto;
}

/* =====================================================
   CARDS
   ===================================================== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.card-header {
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
}

.card-body {
    padding: var(--space-lg);
}

.card-footer {
    padding: var(--space-lg);
    border-top: 1px solid var(--border-color);
    background: var(--bg-darker);
}

/* =====================================================
   BUTTONS
   ===================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #059669;
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-warning:hover:not(:disabled) {
    background: #d97706;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #dc2626;
}

.btn-secondary {
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-card-hover);
    border-color: var(--border-light);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover:not(:disabled) {
    background: var(--bg-card);
    color: var(--text-primary);
}

.btn-sm {
    padding: var(--space-xs) var(--space-md);
    font-size: 0.8rem;
}

.btn-lg {
    padding: var(--space-md) var(--space-xl);
    font-size: 1rem;
}

.btn-icon {
    padding: var(--space-sm);
    width: 36px;
    height: 36px;
}

.btn-group {
    display: flex;
    gap: var(--space-sm);
}

/* =====================================================
   FORMS
   ===================================================== */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-label {
    display: block;
    margin-bottom: var(--space-sm);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: all var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

select.form-control {
    cursor: pointer;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-lg);
}

.form-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: var(--space-xs);
}

.form-error {
    font-size: 0.8rem;
    color: var(--danger);
    margin-top: var(--space-xs);
}

/* =====================================================
   TABLES
   ===================================================== */
.table-container {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: var(--space-md);
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    background: var(--bg-darker);
}

.table tr:hover {
    background: var(--bg-card-hover);
}

.table-actions {
    display: flex;
    gap: var(--space-sm);
    justify-content: flex-end;
}

/* =====================================================
   BADGES & TAGS
   ===================================================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-primary {
    background: var(--primary-light);
    color: var(--primary);
}

.badge-success {
    background: var(--success-light);
    color: var(--success);
}

.badge-warning {
    background: var(--warning-light);
    color: var(--warning);
}

.badge-danger {
    background: var(--danger-light);
    color: var(--danger);
}

.badge-info {
    background: var(--info-light);
    color: var(--info);
}

/* Status Badges */
.status-offen {
    background: var(--warning-light);
    color: var(--warning);
}

.status-erinnerung {
    background: var(--danger-light);
    color: var(--danger);
}

.status-bezahlt {
    background: var(--success-light);
    color: var(--success);
}

/* =====================================================
   STATS & DASHBOARD
   ===================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
}

.stat-value.positive {
    color: var(--success);
}

.stat-value.negative {
    color: var(--danger);
}

.stat-change {
    font-size: 0.875rem;
    margin-top: var(--space-sm);
}

/* =====================================================
   GRID LAYOUTS
   ===================================================== */
.grid {
    display: grid;
    gap: var(--space-lg);
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1024px) {
    .grid-3, .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }
}

/* =====================================================
   MODALS
   ===================================================== */
.modal-container {
    position: fixed;
    inset: 0;
    z-index: 2100;
    display: none;
}

.modal-container.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.modal {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modalIn 0.2s ease;
    z-index: 2100;
}

.modal-lg {
    max-width: 800px;
}

.modal-xl {
    max-width: 1200px;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: var(--space-sm);
    line-height: 1;
    transition: color var(--transition-fast);
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: var(--space-lg);
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: var(--space-lg);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: var(--space-md);
}

/* =====================================================
   TOASTS
   ===================================================== */
.toast-container {
    position: fixed;
    bottom: var(--space-xl);
    right: var(--space-xl);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-md) var(--space-lg);
    min-width: 300px;
    max-width: 450px;
    display: flex;
    align-items: center;
    gap: var(--space-md);
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast.toast-out {
    animation: toastOut 0.3s ease forwards;
}

@keyframes toastOut {
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

.toast-icon {
    font-size: 1.25rem;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    margin-bottom: var(--space-xs);
}

.toast-message {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.error {
    border-left: 4px solid var(--danger);
}

.toast.warning {
    border-left: 4px solid var(--warning);
}

.toast.info {
    border-left: 4px solid var(--info);
}

/* =====================================================
   LOADING STATES
   ===================================================== */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.skeleton {
    background: linear-gradient(90deg, var(--bg-input) 25%, var(--bg-card-hover) 50%, var(--bg-input) 75%);
    background-size: 200% 100%;
    animation: skeleton 1.5s ease-in-out infinite;
    border-radius: var(--radius-md);
}

@keyframes skeleton {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* =====================================================
   EMPTY STATES
   ===================================================== */
.empty-state {
    text-align: center;
    padding: var(--space-2xl);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: var(--space-lg);
    opacity: 0.5;
}

.empty-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--space-sm);
}

.empty-message {
    color: var(--text-muted);
    margin-bottom: var(--space-lg);
}

/* =====================================================
   PROJECT/INVOICE CARDS
   ===================================================== */
.project-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.project-header {
    padding: var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
}

.project-info {
    flex: 1;
}

.project-name {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: var(--space-xs);
}

.project-client {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.project-meta {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.project-invoice-nr {
    font-family: monospace;
    background: var(--bg-input);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
}

.project-body {
    padding: var(--space-lg);
}

.project-positions {
    margin-bottom: var(--space-lg);
}

.position-item {
    display: flex;
    justify-content: space-between;
    padding: var(--space-sm) 0;
    border-bottom: 1px dashed var(--border-color);
}

.position-item:last-child {
    border-bottom: none;
}

.position-name {
    flex: 1;
}

.position-qty {
    width: 80px;
    text-align: center;
    color: var(--text-muted);
}

.position-price {
    width: 100px;
    text-align: right;
    font-weight: 500;
}

.project-total {
    display: flex;
    justify-content: space-between;
    padding: var(--space-md);
    background: var(--bg-darker);
    border-radius: var(--radius-md);
    font-size: 1.125rem;
    font-weight: 600;
}

.project-footer {
    padding: var(--space-lg);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-darker);
}

/* =====================================================
   TIMER
   ===================================================== */
.timer-display {
    font-family: monospace;
    font-size: 1.5rem;
    font-weight: 600;
    background: var(--bg-input);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
}

.timer-display.running {
    color: var(--success);
    animation: pulse 2s ease-in-out infinite;
}

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

/* =====================================================
   MOBILE MENU TOGGLE
   ===================================================== */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: var(--space-md);
    left: var(--space-md);
    z-index: 200;
    width: 44px;
    height: 44px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 10px;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-fast);
}

.mobile-menu-toggle:hover {
    background: var(--bg-card-hover);
    border-color: var(--primary);
}

.mobile-menu-toggle.active {
    background: var(--primary);
    border-color: var(--primary);
}

.mobile-menu-toggle.active .hamburger-line {
    background: white;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.hamburger-line {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all var(--transition-fast);
}

/* Mobile Overlay */
.mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 90;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.mobile-overlay.active {
    display: block;
    opacity: 1;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 1024px) {
    .mobile-menu-toggle {
        display: flex;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform var(--transition-normal);
        box-shadow: var(--shadow-xl);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main {
        margin-left: 0;
    }

    .header {
        padding: 0 var(--space-lg);
        padding-left: calc(var(--space-lg) + 60px); /* Platz fuer Menu-Button */
    }

    .content {
        padding: var(--space-lg);
    }

    /* Header anpassen auf Mobile */
    .global-search {
        display: none;
    }

    .header-stats {
        display: none;
    }

    /* Sidebar Close Button auf Mobile */
    .sidebar-close-mobile {
        display: block;
        position: absolute;
        top: var(--space-md);
        right: var(--space-md);
        background: none;
        border: none;
        color: var(--text-muted);
        font-size: 1.5rem;
        cursor: pointer;
        padding: var(--space-sm);
        z-index: 101;
    }

    .sidebar-close-mobile:hover {
        color: var(--danger);
    }
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .modal {
        margin: var(--space-md);
        max-height: calc(100vh - var(--space-xl));
    }

    .toast-container {
        left: var(--space-md);
        right: var(--space-md);
        bottom: var(--space-md);
    }

    .toast {
        min-width: auto;
    }
}

/* =====================================================
   UTILITIES
   ===================================================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--space-sm); }
.mt-2 { margin-top: var(--space-md); }
.mt-3 { margin-top: var(--space-lg); }
.mt-4 { margin-top: var(--space-xl); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--space-sm); }
.mb-2 { margin-bottom: var(--space-md); }
.mb-3 { margin-bottom: var(--space-lg); }
.mb-4 { margin-bottom: var(--space-xl); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: var(--space-sm); }
.gap-2 { gap: var(--space-md); }
.gap-3 { gap: var(--space-lg); }

.hidden { display: none !important; }
.visible { display: block; }

.w-full { width: 100%; }
.h-full { height: 100%; }

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* =====================================================
   NOTIFICATIONS
   ===================================================== */
.notification-bell {
    position: relative;
}

.bell-icon {
    font-size: 1.25rem;
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--danger);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: badgePulse 2s ease-in-out infinite;
}

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

.notification-item {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    border-bottom: 1px solid var(--border-color);
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item:hover {
    background: var(--bg-card-hover);
}

.notification-item.unread {
    background: var(--primary-light);
    border-left: 3px solid var(--primary);
}

.notification-item.unread:hover {
    background: rgba(59, 130, 246, 0.15);
}

.notification-icon {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-input);
    border-radius: var(--radius-full);
    flex-shrink: 0;
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: var(--space-xs);
    color: var(--text-primary);
}

.notification-message {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-xs);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notification-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* =====================================================
   BACKUP & DATA MANAGEMENT
   ===================================================== */
.backup-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.backup-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md);
    background: var(--bg-input);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.backup-info {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.backup-filename {
    font-weight: 500;
    font-family: monospace;
    font-size: 0.85rem;
}

.backup-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.backup-actions {
    display: flex;
    gap: var(--space-sm);
}

/* =====================================================
   CLIENT PORTAL LINK
   ===================================================== */
.portal-link-container {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-input);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.portal-link-input {
    flex: 1;
    font-family: monospace;
    font-size: 0.8rem;
    background: var(--bg-darker);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
}

/* =====================================================
   EXPORT PANEL
   ===================================================== */
.export-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-lg);
}

.export-card {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.export-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.export-icon {
    font-size: 2.5rem;
    margin-bottom: var(--space-md);
}

.export-title {
    font-weight: 600;
    margin-bottom: var(--space-xs);
}

.export-description {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* =====================================================
   TABS
   ===================================================== */
.tabs {
    display: flex;
    gap: var(--space-xs);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: var(--space-lg);
}

.tab {
    padding: var(--space-md) var(--space-lg);
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all var(--transition-fast);
}

.tab:hover {
    color: var(--text-primary);
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* =====================================================
   DROPDOWN MENU
   ===================================================== */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 200px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 100;
    display: none;
    overflow: hidden;
}

.dropdown-menu.show {
    display: block;
    animation: dropdownIn 0.15s ease;
}

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

.dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.dropdown-item:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: var(--space-xs) 0;
}

/* =====================================================
   FORM INPUTS (aliased for new pages)
   ===================================================== */
.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    transition: all var(--transition-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-muted);
}

.form-select {
    cursor: pointer;
    appearance: auto;
}

textarea.form-input,
.form-textarea {
    min-height: 80px;
    resize: vertical;
}

/* =====================================================
   TOOLBAR
   ===================================================== */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-md);
    padding: var(--space-md) 0;
}

.toolbar-left,
.toolbar-right {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

/* =====================================================
   MODAL OVERLAY (for new page modals)
   ===================================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 2100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
}

.modal-overlay .modal {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modalIn 0.2s ease;
}

.modal-overlay .modal-body {
    overflow-y: auto;
    flex: 1;
}

/* =====================================================
   GRID-3 LAYOUT FOR KANBAN / 3-COLUMN
   ===================================================== */
.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 1024px) {
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .grid-3 {
        grid-template-columns: 1fr;
    }
}

/* =====================================================
   DOCUMENT UPLOAD (Drag & Drop)
   ===================================================== */
.upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-2xl);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    background: var(--bg-input);
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: var(--primary);
    background: var(--primary-light);
}

.upload-zone-icon {
    font-size: 3rem;
    margin-bottom: var(--space-md);
    opacity: 0.5;
}

.upload-zone-text {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* =====================================================
   FILE/DOCUMENT LIST
   ===================================================== */
.file-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.file-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-input);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}

.file-item:hover {
    background: var(--bg-card-hover);
}

.file-icon {
    font-size: 1.5rem;
    width: 40px;
    text-align: center;
    flex-shrink: 0;
}

.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* =====================================================
   VACATION CALENDAR
   ===================================================== */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.calendar-header {
    background: var(--bg-darker);
    padding: var(--space-sm);
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
}

.calendar-day {
    padding: var(--space-sm);
    text-align: center;
    min-height: 40px;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
    position: relative;
}

.calendar-day.today {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 700;
}

.calendar-day.weekend {
    color: var(--text-muted);
    opacity: 0.6;
}

.calendar-day.other-month {
    opacity: 0.3;
}

.calendar-day .event-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
}

/* =====================================================
   ACTIVITY LOG
   ===================================================== */
.activity-item {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-md);
    border-bottom: 1px solid var(--border-color);
    transition: background var(--transition-fast);
}

.activity-item:hover {
    background: var(--bg-card-hover);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    background: var(--bg-input);
}

.activity-content {
    flex: 1;
    min-width: 0;
}

.activity-title {
    font-weight: 500;
    font-size: 0.9rem;
}

.activity-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* =====================================================
   PROGRESS BAR
   ===================================================== */
.progress {
    height: 8px;
    background: var(--bg-input);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--primary);
    border-radius: var(--radius-full);
    transition: width var(--transition-normal);
}

.progress-bar.success { background: var(--success); }
.progress-bar.warning { background: var(--warning); }
.progress-bar.danger { background: var(--danger); }

/* =====================================================
   PAYROLL SPECIFIC
   ===================================================== */
.payroll-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--space-md);
    padding: var(--space-lg);
    background: var(--bg-darker);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-lg);
}

.payroll-item {
    text-align: center;
}

.payroll-item-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: var(--space-xs);
}

.payroll-item-value {
    font-size: 1.25rem;
    font-weight: 700;
}

/* =====================================================
   SIDEBAR MOBILE TOGGLE
   ===================================================== */
.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: var(--space-sm);
}

@media (max-width: 1024px) {
    .sidebar-toggle {
        display: block;
    }
}

/* =====================================================
   RESPONSIVE TABLE SCROLL
   ===================================================== */
@media (max-width: 768px) {
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table {
        min-width: 600px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* =====================================================
   SERVER CREDENTIALS CARD
   ===================================================== */
.credential-card {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    margin-bottom: var(--space-sm);
}

.credential-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-xs);
}

.credential-value {
    font-family: monospace;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
}

.credential-value .copy-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: var(--space-xs);
    font-size: 0.85rem;
    transition: color var(--transition-fast);
}

.credential-value .copy-btn:hover {
    color: var(--primary);
}

/* =====================================================
   QR CODE DISPLAY
   ===================================================== */
.qr-container {
    text-align: center;
    padding: var(--space-lg);
}

.qr-container img,
.qr-container canvas {
    max-width: 200px;
    border-radius: var(--radius-md);
    border: 4px solid white;
    box-shadow: var(--shadow-md);
}

.qr-label {
    margin-top: var(--space-md);
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* =====================================================
   GLOBALE SUCHE
   ===================================================== */
.global-search {
    position: relative;
    flex: 0 1 300px;
    margin-right: var(--space-md);
}

.global-search .search-input {
    width: 100%;
    padding: 0.5rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: all var(--transition-fast);
}

.global-search .search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.global-search .search-input::placeholder {
    color: var(--text-muted);
}

.search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    cursor: pointer;
    transition: background var(--transition-fast);
    border-bottom: 1px solid var(--border-color);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: var(--bg-card-hover);
}

.search-result-item .icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-light);
    border-radius: var(--radius-sm);
    font-size: 1rem;
}

.search-result-item .info {
    flex: 1;
    min-width: 0;
}

.search-result-item .title {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-item .subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-item .type-badge {
    font-size: 0.7rem;
    padding: 2px 6px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
}

.search-no-results {
    padding: var(--space-lg);
    text-align: center;
    color: var(--text-muted);
}

.search-loading {
    padding: var(--space-lg);
    text-align: center;
    color: var(--text-muted);
}

/* =====================================================
   SCHNELLAKTIONEN DROPDOWN
   ===================================================== */
.quick-actions-dropdown {
    position: relative;
}

.quick-actions-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    z-index: 1000;
}

.quick-actions-menu a {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    color: var(--text-primary);
    transition: background var(--transition-fast);
    border-bottom: 1px solid var(--border-color);
}

.quick-actions-menu a:last-child {
    border-bottom: none;
}

.quick-actions-menu a:hover {
    background: var(--bg-card-hover);
}

.quick-actions-menu a span:first-child {
    width: 24px;
    text-align: center;
}

/* =====================================================
   HEADER STATS
   ===================================================== */
.header-stats {
    display: flex;
    gap: var(--space-sm);
    margin-left: var(--space-md);
}

.header-stat {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--bg-input);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
}

.header-stat.danger {
    background: var(--danger-light);
    color: var(--danger);
}

.header-stat.warning {
    background: var(--warning-light);
    color: var(--warning);
}

.header-stat.success {
    background: var(--success-light);
    color: var(--success);
}

/* =====================================================
   NOTIFICATIONS PANEL
   ===================================================== */
.notifications-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: var(--bg-card);
    border-left: 1px solid var(--border-color);
    box-shadow: var(--shadow-xl);
    z-index: 2000;
    transition: right var(--transition-normal);
    display: flex;
    flex-direction: column;
}

.notifications-panel.open {
    right: 0;
}

.notifications-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md);
    border-bottom: 1px solid var(--border-color);
}

.notifications-panel-header h3 {
    margin: 0;
}

.notifications-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-md);
}

.notification-item {
    display: flex;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: var(--bg-input);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-sm);
    transition: all var(--transition-fast);
}

.notification-item:hover {
    background: var(--bg-card-hover);
}

.notification-item.unread {
    border-left: 3px solid var(--primary);
}

.notification-item .icon {
    font-size: 1.25rem;
}

.notification-item .content {
    flex: 1;
}

.notification-item .title {
    font-weight: 500;
    margin-bottom: 2px;
}

.notification-item .message {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.notification-item .time {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.notification-empty {
    text-align: center;
    padding: var(--space-xl);
    color: var(--text-muted);
}

.notifications-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1999;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all var(--transition-normal);
}

.notifications-overlay.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* =====================================================
   KEYBOARD SHORTCUTS MODAL
   ===================================================== */
.shortcuts-modal .shortcuts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
}

.shortcut-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm);
    background: var(--bg-input);
    border-radius: var(--radius-sm);
}

.shortcut-item kbd {
    display: inline-block;
    padding: 2px 6px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: monospace;
    font-size: 0.85rem;
}

/* Print Styles */
@media print {
    .sidebar,
    .header,
    .btn,
    .toast-container,
    .modal-container {
        display: none !important;
    }

    .main {
        margin-left: 0;
    }

    .content {
        padding: 0;
    }

    body {
        background: white;
        color: black;
    }
}

/* =====================================================
   DASHBOARD WIDGETS - NEUE WIDGETS
   ===================================================== */

/* Grid fuer 3 Widgets */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

@media (max-width: 1200px) {
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .grid-3 {
        grid-template-columns: 1fr;
    }
}

/* Pending Reminders Widget */
.reminder-section {
    margin-bottom: 0.75rem;
}

.reminder-section:last-child {
    margin-bottom: 0;
}

.reminder-section-header {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.reminder-widget-item {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    gap: 0.75rem;
    align-items: center;
    padding: 0.5rem;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    margin-bottom: 0.25rem;
}

.reminder-widget-item:last-child {
    margin-bottom: 0;
}

.reminder-info {
    min-width: 0;
}

.reminder-number {
    font-weight: 600;
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reminder-client {
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reminder-amount {
    font-weight: 600;
    font-size: 0.875rem;
    text-align: right;
}

.reminder-days {
    font-size: 0.75rem;
    font-weight: 500;
    min-width: 60px;
    text-align: right;
}

.reminder-actions {
    display: flex;
    gap: 0.25rem;
}

.reminder-actions .btn-xs {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* Email Stats Widget */
.email-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.email-stat {
    text-align: center;
    padding: 0.5rem;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
}

.email-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
}

.email-stat-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.email-recent-header {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.email-recent-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.email-recent-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.5rem;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
}

.email-recipient {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.email-type {
    font-size: 0.65rem;
}

/* Portal Stats Widget */
.portal-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.portal-stat {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
}

.portal-stat-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: var(--radius-sm);
    font-size: 1rem;
}

.portal-stat-info {
    flex: 1;
}

.portal-stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1;
}

.portal-stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.portal-period {
    margin-top: 0.5rem;
    text-align: center;
}

/* Button XS */
.btn-xs {
    padding: 0.2rem 0.4rem;
    font-size: 0.7rem;
    border-radius: var(--radius-sm);
}

/* =====================================================
   RESPONSIVE: MOBILE
   ===================================================== */
@media (max-width: 768px) {
    .global-search {
        display: none;
    }

    .header-stats {
        display: none;
    }

    .quick-actions-menu {
        right: auto;
        left: 50%;
        transform: translateX(-50%);
    }

    .email-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .portal-stats-grid {
        grid-template-columns: 1fr;
    }

    .reminder-widget-item {
        grid-template-columns: 1fr auto;
    }

    .reminder-amount,
    .reminder-days {
        display: none;
    }
}

/* =====================================================
   MOBILE PWA ENHANCEMENTS (max-width: 480px)
   ===================================================== */
@media (max-width: 480px) {
    /* Content Padding */
    .content {
        padding: 0.75rem !important;
    }

    /* Header kompakter */
    .header {
        height: 54px;
        padding: 0 0.75rem;
        padding-left: calc(0.75rem + 52px);
    }

    /* Karten */
    .card {
        border-radius: 10px;
    }

    .card-header {
        padding: 0.875rem 1rem;
    }

    .card-body {
        padding: 1rem;
    }

    /* Statistik-Kacheln: 2 Spalten */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.5rem;
    }

    .stat-card {
        padding: 0.875rem;
    }

    .stat-value {
        font-size: 1.4rem;
    }

    /* Tabellen: horizontal scrollbar */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 8px;
    }

    table th, table td {
        white-space: nowrap;
        font-size: 0.82rem;
        padding: 0.6rem 0.75rem;
    }

    /* Buttons: größere Touch-Targets */
    .btn {
        min-height: 40px;
        padding: 0.5rem 0.875rem;
        font-size: 0.85rem;
    }

    .btn-sm {
        min-height: 34px;
    }

    /* Action-Buttons in Tabellen */
    .action-buttons {
        display: flex;
        gap: 0.25rem;
        flex-wrap: nowrap;
    }

    /* Modals: fast full-screen */
    .modal {
        margin: 0.5rem !important;
        max-height: calc(100vh - 1rem) !important;
        border-radius: 14px;
    }

    .modal-lg, .modal-xl {
        max-width: 100%;
        margin: 0.25rem !important;
    }

    /* Form Inputs */
    .form-control, .form-select {
        min-height: 44px;
        font-size: 16px !important; /* Verhindert iOS-Zoom */
        border-radius: 8px;
    }

    /* Form-Rows: 1 Spalte */
    .form-row {
        grid-template-columns: 1fr !important;
        gap: 0.75rem;
    }

    /* Dashboard-Widgets: 1 Spalte */
    .dashboard-grid {
        grid-template-columns: 1fr !important;
    }

    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr !important;
    }

    /* Tabs: scrollbar statt umbrechen */
    .tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
        scrollbar-width: none;
    }

    .tabs::-webkit-scrollbar {
        display: none;
    }

    .tab-btn {
        min-width: auto;
        padding: 0.6rem 0.875rem;
        font-size: 0.8rem;
        white-space: nowrap;
    }

    /* Sidebar komplett verstecken bis aktiv */
    .sidebar {
        width: 280px;
        z-index: 3000;
    }

    /* Page-Titel kleiner */
    .page-title {
        font-size: 1.1rem;
    }

    /* Toasts: breiter */
    .toast-container {
        left: 0.5rem !important;
        right: 0.5rem !important;
        bottom: 0.5rem !important;
    }

    .toast {
        min-width: auto !important;
        width: 100%;
    }

    /* Notification-Dropdown */
    .notification-dropdown,
    .user-dropdown {
        width: calc(100vw - 1rem);
        right: 0.5rem;
        left: auto;
    }

    /* Portal-Seiten */
    .portal-stats-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 0.5rem;
    }

    /* E-Mail-Stats */
    .email-stats-grid {
        grid-template-columns: 1fr 1fr !important;
    }

    /* Quick-Actions-Menu zentriert */
    .quick-actions-menu {
        left: 0.5rem;
        right: 0.5rem;
        width: auto;
        transform: none;
    }

    /* Chat-Messages */
    .chat-message {
        max-width: 90%;
    }

    /* Filter-Bar: gestapelt */
    .filter-bar {
        flex-direction: column;
        gap: 0.5rem;
    }

    .filter-bar .form-control,
    .filter-bar .form-select {
        width: 100%;
    }

    /* Reminder Widget */
    .reminder-widget-item {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }

    .reminder-amount, .reminder-days {
        display: none;
    }

    /* Rechnung / Angebot Details */
    .invoice-header,
    .quote-header {
        flex-direction: column;
        gap: 0.75rem;
    }

    /* Badge in Tabellen kleiner */
    .badge {
        font-size: 0.68rem;
        padding: 2px 6px;
    }

    /* Progress Bars */
    .progress {
        height: 6px;
    }

    /* Section Header Button-Gruppe */
    .section-header {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .section-header .btn {
        font-size: 0.78rem;
        padding: 0.4rem 0.75rem;
    }
}

/* =====================================================
   EXTRA KLEIN (max-width: 360px)
   ===================================================== */
@media (max-width: 360px) {
    .content {
        padding: 0.5rem !important;
    }

    .stats-grid {
        grid-template-columns: 1fr !important;
    }

    .card-header {
        padding: 0.75rem;
    }

    .card-body {
        padding: 0.75rem;
    }

    .portal-stats-grid {
        grid-template-columns: 1fr !important;
    }
}

/* =====================================================
   TOUCH UX VERBESSERUNGEN (alle Mobilgeräte)
   ===================================================== */
@media (hover: none) and (pointer: coarse) {
    /* Hover-Effekte entfernen auf Touch-Geräten */
    .btn:hover {
        opacity: 1;
        transform: none;
    }

    /* Aktive States für Touch */
    .btn:active {
        opacity: 0.75;
        transform: scale(0.98);
    }

    .card:hover {
        border-color: var(--border-color);
    }

    /* Größere Scroll-Bereiche */
    .table-responsive, .tabs {
        scroll-snap-type: none;
    }

    /* Link-Buttons: mindestens 44px hoch */
    a.btn, button.btn {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

/* =====================================================
   DARK MODE + MOBILE OPTIMIERUNGEN
   ===================================================== */
@media (max-width: 768px) and (prefers-color-scheme: dark) {
    .form-control, .form-select {
        /* Besserer Kontrast auf dunklen Displays */
        background-color: var(--bg-input, #1e293b);
    }
}
