/* Bauunternehmen Daniel Buss – Premium Zeiterfassung für Bauunternehmen */
/* Bauunternehmen Daniel Buss Corporate Design */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=DM+Sans:wght@400;500;700&display=swap');

:root {
    /* Primary Colors - Bauunternehmen Daniel Buss Signal-Orange (#ef7c00) Theme */
    --primary-50:  #fff4e6;
    --primary-100: #ffe2bf;
    --primary-200: #ffc380;
    --primary-300: #ffa340;
    --primary-400: #ef8c00;
    --primary-500: #ef7c00;   /* Signal-Orange – Markenfarbe / Kontrastfarbe */
    --primary-600: #c66400;   /* dunkles Orange – als Text auf Weiß lesbar */
    --primary-700: #9c4f00;   /* dunkler – fett/Überschriften */
    --primary-800: #783b00;
    --primary-900: #4d2700;
    /* Marken-Tokens */
    --brand-orange: #ef7c00;
    --brand-yellow: var(--brand-orange); /* Alias – Variablenname historisch beibehalten */
    --brand-ink: #1a1a1a;     /* Textfarbe AUF Orange (dunkel, AA-konform) */
    --brand-charcoal: #1c1d21;
    --brand-charcoal-2: #2a2c33;
    
    /* Neutral Colors - Light Gray Theme */
    --neutral-50: #f9fafb;
    --neutral-100: #f3f4f6;
    --neutral-200: #e5e7eb;
    --neutral-300: #d1d5db;
    --neutral-400: #9ca3af;
    --neutral-500: #6b7280;
    --neutral-600: #4b5563;
    --neutral-700: #374151;
    --neutral-800: #1f2937;
    --neutral-900: #111827;
    
    /* Status Colors */
    --success: #22c55e;
    --success-light: #dcfce7;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --info: #3b82f6;
    --info-light: #dbeafe;
    
    /* Background Colors - Light Gray */
    --bg-gradient-start: #f3f4f6;
    --bg-gradient-mid: #f9fafb;
    --bg-gradient-end: #f3f4f6;
    --bg-card: rgba(255, 255, 255, 0.95);
    --bg-card-hover: rgba(255, 255, 255, 1);
    --surface: #ffffff;        /* Karten-/Eingabeflächen (im Dark-Mode dunkel) */
    --surface-2: #ffffff;      /* erhabene Flächen */

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.08);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 40px rgba(239, 124, 0, 0.30);
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-2xl: 32px;
    --radius-full: 9999px;
    
    /* Typography */
    --font-primary: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-secondary: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    
    /* Transitions */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

body {
    font-family: var(--font-primary);
    font-weight: 400;
    line-height: 1.6;
    color: var(--neutral-800);
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-mid) 50%, var(--bg-gradient-end) 100%);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Ionicons - Prevent layout shift */
ion-icon {
    display: inline-block;
    width: 1em;
    height: 1em;
    font-size: 1.25rem;
    vertical-align: middle;
    visibility: visible !important;
}

/* Sidebar icons specific size */
.nav-link ion-icon {
    width: 22px;
    height: 22px;
    min-width: 22px;
    min-height: 22px;
    font-size: 22px;
}

/* Button icons */
.btn ion-icon {
    width: 18px;
    height: 18px;
    font-size: 18px;
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.5);
    padding: 24px;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    box-shadow: var(--shadow-md);
    overflow-y: auto;
    overflow-x: hidden;
}

/* Sidebar Scrollbar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

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

.sidebar::-webkit-scrollbar-thumb {
    background: var(--neutral-300);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--neutral-400);
}

.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 32px 40px;
    min-height: 100vh;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 0 32px;
    margin: 0 -24px 8px -24px;
    padding-left: 24px;
    padding-right: 24px;
    border-bottom: 1px solid var(--neutral-200);
}

.logo-image {
    width: 196px;
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

.logo-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-600) 100%);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-glow);
}

.logo-icon svg,
.logo-icon ion-icon {
    width: 28px;
    height: 28px;
    color: white;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-800) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

/* Navigation */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    margin-right: -12px;
    padding-right: 12px;
}

.nav-section {
    margin-top: 24px;
}

.nav-section-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--neutral-400);
    padding: 8px 16px;
    margin-bottom: 4px;
}

.nav-menu {
    list-style: none;
}

.nav-item {
    margin-bottom: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: var(--radius-lg);
    color: var(--neutral-600);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    min-height: 50px;
}

.nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-500);
    border-radius: 0 4px 4px 0;
    transform: scaleY(0);
    transition: transform var(--transition-normal);
}

.nav-link:hover {
    background: var(--primary-50);
    color: var(--neutral-800);
}

.nav-link.active {
    background: linear-gradient(135deg, var(--primary-100) 0%, var(--primary-50) 100%);
    color: var(--primary-700);
    font-weight: 600;
}

.nav-link.active::before {
    transform: scaleY(1);
}

.nav-link ion-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
}

.nav-badge {
    margin-left: auto;
    background: var(--danger);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    min-width: 22px;
    text-align: center;
}

/* User Profile in Sidebar */
.sidebar-profile {
    flex-shrink: 0;
    margin-top: 20px;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary-50) 0%, transparent 100%);
    border-radius: var(--radius-xl);
    border: 1px solid var(--primary-100);
}

.sidebar-profile-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.sidebar-profile-avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--primary-400) 0%, var(--primary-600) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: var(--shadow-md);
    flex-shrink: 0;
}

img.sidebar-profile-avatar {
    object-fit: cover;
    background: none;
}

.sidebar-profile-details h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--neutral-800);
    margin-bottom: 2px;
}

.sidebar-profile-details span {
    font-size: 0.8rem;
    color: var(--neutral-500);
}

.sidebar-profile-actions {
    display: flex;
    gap: 8px;
}

.sidebar-profile-actions .btn {
    flex: 1;
    padding: 10px;
    font-size: 0.85rem;
}

/* Header */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
}

.page-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--neutral-900);
    letter-spacing: -0.5px;
}

.page-subtitle {
    color: var(--neutral-500);
    font-size: 1rem;
    margin-top: 4px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Cards */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
    overflow: visible;
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.card-header {
    padding: 24px 28px 16px;
    border-bottom: 1px solid var(--neutral-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--neutral-800);
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-title ion-icon {
    color: var(--primary-500);
}

.card-body {
    padding: 24px 28px;
}

.card-footer {
    padding: 16px 28px;
    background: var(--neutral-50);
    border-top: 1px solid var(--neutral-100);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: all var(--transition-normal);
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

a.stat-card:hover {
    color: inherit;
    text-decoration: none;
}

.stat-card-active,
.stat-card.stat-card-active:hover {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 2px var(--primary-200), var(--shadow-md);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon ion-icon {
    font-size: 1.6rem;
}

.stat-icon.primary {
    background: linear-gradient(135deg, var(--primary-100) 0%, var(--primary-200) 100%);
    color: var(--primary-700);
}

.stat-icon.success {
    background: linear-gradient(135deg, var(--success-light) 0%, #bbf7d0 100%);
    color: var(--success);
}

.stat-icon.warning {
    background: linear-gradient(135deg, var(--warning-light) 0%, #fed7aa 100%);
    color: var(--warning);
}

.stat-icon.info {
    background: linear-gradient(135deg, var(--info-light) 0%, #bfdbfe 100%);
    color: var(--info);
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--neutral-500);
    margin-bottom: 4px;
    font-weight: 500;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--neutral-900);
    line-height: 1.2;
}

.stat-change {
    font-size: 0.8rem;
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

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

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

/* Time Tracking Widget */
.time-tracker {
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-600) 50%, var(--primary-700) 100%);
    border-radius: var(--radius-2xl);
    padding: 32px;
    color: white;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-xl), var(--shadow-glow);
}

.time-tracker::before {
    content: none;
}

.time-tracker-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    position: relative;
    z-index: 1;
}

.time-tracker-title {
    font-size: 1.1rem;
    font-weight: 600;
    opacity: 0.9;
}

.time-tracker-date {
    font-size: 0.9rem;
    opacity: 0.7;
}

.current-time-display {
    font-size: 4rem;
    font-weight: 800;
    text-align: center;
    margin: 24px 0;
    font-family: var(--font-secondary);
    letter-spacing: -2px;
    position: relative;
    z-index: 1;
    text-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.current-time-display span {
    font-size: 2rem;
    opacity: 0.7;
}

.time-tracker-status {
    text-align: center;
    padding: 12px 20px;
    background: rgba(255,255,255,0.15);
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 1;
}

.time-tracker-status-label {
    font-size: 0.85rem;
    opacity: 0.8;
    margin-bottom: 4px;
}

.time-tracker-status-value {
    font-size: 1.1rem;
    font-weight: 700;
}

.time-tracker-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    position: relative;
    z-index: 1;
}

.time-btn {
    padding: 16px 20px;
    border: none;
    border-radius: var(--radius-lg);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all var(--transition-normal);
}

.time-btn ion-icon {
    font-size: 1.3rem;
}

.time-btn.primary {
    background: var(--surface);
    color: var(--primary-700);
}

.time-btn.primary:hover {
    background: var(--neutral-100);
    transform: scale(1.02);
}

.time-btn.secondary {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
}

.time-btn.secondary:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.02);
}

.time-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Construction Site Selector */
.site-selector {
    margin-top: 20px;
    position: relative;
    z-index: 1;
}

.site-selector label {
    display: block;
    font-size: 0.85rem;
    opacity: 0.8;
    margin-bottom: 8px;
}

.site-selector select {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: var(--radius-lg);
    background: rgba(255,255,255,0.15);
    color: white;
    font-family: inherit;
    font-size: 0.95rem;
    cursor: pointer;
    backdrop-filter: blur(10px);
}

.site-selector select option {
    background: var(--neutral-800);
    color: white;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-lg);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition-normal);
    white-space: nowrap;
}

.btn ion-icon {
    font-size: 1.2rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-600) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(212, 168, 83, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 168, 83, 0.4);
}

.btn-secondary {
    background: var(--neutral-100);
    color: var(--neutral-700);
}

.btn-secondary:hover {
    background: var(--neutral-200);
}

.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, #16a34a 100%);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning) 0%, #ea580c 100%);
    color: white;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--neutral-200);
    color: var(--neutral-700);
}

.btn-outline:hover {
    border-color: var(--primary-500);
    color: var(--primary-600);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1.05rem;
}

.btn-icon {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: var(--radius-md);
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--neutral-700);
    margin-bottom: 8px;
}

.form-label.required::after {
    content: ' *';
    color: var(--danger);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--neutral-200);
    border-radius: var(--radius-lg);
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--neutral-800);
    background: var(--surface);
    transition: all var(--transition-fast);
}

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

.form-input::placeholder {
    color: var(--neutral-400);
}

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

.form-hint {
    font-size: 0.8rem;
    color: var(--neutral-500);
    margin-top: 6px;
}

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

/* Generic Custom Select (for form selects) */
.custom-select-generic {
    position: relative;
    width: 100%;
    z-index: 100;
}

.custom-select-generic.open {
    z-index: 99999;
}

.custom-select-generic .custom-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--surface);
    border: 2px solid var(--neutral-200);
    border-radius: var(--radius-lg);
    color: var(--neutral-800);
    font-size: 0.95rem;
    font-weight: 400;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    z-index: 1;
}

.custom-select-generic .custom-select-trigger:hover {
    border-color: var(--neutral-300);
}

.custom-select-generic.open .custom-select-trigger,
.custom-select-generic .custom-select-trigger:focus {
    border-color: var(--primary-400);
    box-shadow: 0 0 0 4px var(--primary-100);
    z-index: 2;
}

.custom-select-generic.open .custom-select-trigger {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.custom-select-generic .trigger-text {
    flex: 1;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.custom-select-generic .trigger-text.placeholder {
    color: var(--neutral-400);
}

.custom-select-generic .trigger-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 12px;
    color: var(--neutral-400);
    transition: transform var(--transition-fast);
}

.custom-select-generic .trigger-icon ion-icon {
    font-size: 18px;
}

.custom-select-generic.open .trigger-icon {
    transform: rotate(180deg);
}

.custom-select-generic .custom-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    border: 2px solid var(--primary-400);
    border-top: 1px solid var(--neutral-200);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    max-height: 180px;
    overflow-y: auto;
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity var(--transition-fast), visibility var(--transition-fast), transform var(--transition-fast);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.custom-select-generic .custom-select-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.custom-select-generic .custom-select-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    cursor: pointer;
    transition: all var(--transition-fast);
    border-bottom: 1px solid var(--neutral-100);
    background: var(--surface);
    color: var(--neutral-700);
}

.custom-select-generic .custom-select-option:last-child {
    border-bottom: none;
}

.custom-select-generic .custom-select-option:hover {
    background: var(--neutral-50);
    color: var(--neutral-900);
}

.custom-select-generic .custom-select-option.selected {
    background: var(--primary-50);
    color: var(--primary-700);
    font-weight: 500;
}

.custom-select-generic .custom-select-option .option-content {
    flex: 1;
}

.custom-select-generic .custom-select-option .option-title {
    font-size: 0.95rem;
}

.custom-select-generic .custom-select-option .option-check {
    margin-left: 8px;
    color: var(--primary-500);
    opacity: 0;
    font-size: 18px;
}

.custom-select-generic .custom-select-option.selected .option-check {
    opacity: 1;
}

/* Ensure containers don't clip the dropdown */
.card {
    overflow: visible;
}

.card-body {
    overflow: visible;
}

.form-group {
    overflow: visible;
}

.filter-group {
    overflow: visible;
    position: relative;
    z-index: 100;
}

.filter-form {
    position: relative;
    z-index: 1000;
    overflow: visible;
}

.filter-row {
    overflow: visible;
    position: relative;
    z-index: 100;
}

/* Filter card must be above everything else */
.card:has(.filter-form),
.card.filter-card {
    position: relative;
    z-index: 1000 !important;
    overflow: visible !important;
}

.card:has(.filter-form) .card-body,
.card.filter-card .card-body {
    overflow: visible !important;
}

.card.filter-card select,
.card.filter-card .form-select {
    position: relative;
    z-index: 1001 !important;
}

/* Ensure ALL elements after filter don't overlap the dropdown */
.card.filter-card ~ *:not(.modal-overlay) {
    position: relative;
    z-index: 1 !important;
}

/* Approval entries should not overlap filter */
.approval-entries,
.approval-day,
.approval-entry {
    position: relative;
    z-index: 1;
}

/* Native select dropdown fix */
.filter-group select,
.filter-form select {
    position: relative;
    z-index: inherit;
}

/* When select is focused/open, raise its container */
.filter-group:focus-within {
    z-index: 10000 !important;
}

.modal-body {
    overflow: visible;
}

.modal-content {
    overflow: visible;
}

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

/* Tables */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-lg);
}

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

.table th,
.table td {
    padding: 16px 20px;
    text-align: left;
}

.table th {
    background: var(--neutral-50);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--neutral-500);
    border-bottom: 2px solid var(--neutral-200);
}

.table td {
    border-bottom: 1px solid var(--neutral-100);
    font-size: 0.95rem;
}

.table tbody tr {
    transition: background var(--transition-fast);
}

.table tbody tr:hover {
    background: var(--neutral-50);
}

.table-actions {
    display: flex;
    gap: 8px;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

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

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

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

.badge-secondary {
    background: var(--neutral-200);
    color: var(--neutral-600);
}

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

/* Toggle Switch */
.toggle-switch {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.toggle-switch input {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 48px;
    height: 26px;
    background: var(--neutral-300);
    border-radius: 13px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: var(--surface);
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--primary-500);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(22px);
}

.toggle-label {
    font-size: 0.95rem;
    color: var(--neutral-700);
}

/* User Avatar */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.avatar-primary {
    background: linear-gradient(135deg, var(--primary-400) 0%, var(--primary-600) 100%);
    color: white;
}

.avatar-lg {
    width: 64px;
    height: 64px;
    font-size: 1.3rem;
    border-radius: var(--radius-lg);
}

.avatar-xl {
    width: 96px;
    height: 96px;
    font-size: 2rem;
    border-radius: var(--radius-xl);
}

/* Avatar Upload */
.avatar-upload-container {
    position: relative;
    display: inline-block;
}

.avatar-upload-container img.avatar {
    border-radius: 50%;
    border: 4px solid white;
    box-shadow: var(--shadow-md);
}

.avatar-upload-container .avatar:not(img) {
    border-radius: 50%;
    border: 4px solid white;
    box-shadow: var(--shadow-md);
}

.avatar-upload-btn {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 36px;
    height: 36px;
    background: var(--primary-500);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-md);
    border: 3px solid white;
}

.avatar-upload-btn:hover {
    background: var(--primary-600);
    transform: scale(1.1);
}

.avatar-upload-btn ion-icon {
    font-size: 1rem;
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 32px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--neutral-200);
    border-radius: 1px;
}

.timeline-item {
    position: relative;
    padding-bottom: 24px;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -32px;
    top: 4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-500);
    border: 3px solid white;
    box-shadow: var(--shadow-md);
}

.timeline-content {
    background: var(--neutral-50);
    padding: 16px 20px;
    border-radius: var(--radius-lg);
}

.timeline-time {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary-600);
    margin-bottom: 4px;
}

.timeline-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--neutral-800);
}

.timeline-subtitle {
    font-size: 0.85rem;
    color: var(--neutral-500);
    margin-top: 2px;
}

.timeline-location {
    font-size: 0.8rem;
    color: var(--neutral-400);
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.timeline-location ion-icon {
    font-size: 0.9rem;
    color: var(--primary-500);
}

/* Calendar */
.calendar {
    width: 100%;
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    margin-bottom: 16px;
}

.calendar-title {
    font-size: 1.1rem;
    font-weight: 700;
}

.calendar-nav {
    display: flex;
    gap: 8px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.calendar-weekday {
    text-align: center;
    padding: 12px 0;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--neutral-500);
}

.calendar-weekday.weekend {
    color: var(--primary-500);
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}

.calendar-day:hover {
    background: var(--primary-50);
}

.calendar-day.other-month {
    color: var(--neutral-300);
}

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

.calendar-day.has-entry::after {
    content: '';
    position: absolute;
    bottom: 4px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
}

.calendar-day.vacation {
    background: var(--info-light);
    color: var(--info);
}

.calendar-day.sick {
    background: var(--warning-light);
    color: var(--warning);
}

/* Modals */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--surface);
    border-radius: var(--radius-2xl);
    width: 90%;
    max-width: 560px;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.95) translateY(20px);
    transition: transform var(--transition-normal);
    box-shadow: var(--shadow-xl);
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

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

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

.modal-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: var(--neutral-100);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--neutral-200);
}

.modal-body {
    padding: 24px 28px;
    max-height: 60vh;
    overflow-y: auto;
    overflow-x: visible;
}

/* Allow dropdowns to overflow modal-body when open */
.modal-body:has(.custom-select-generic.open) {
    overflow: visible;
}

.modal-footer {
    padding: 20px 28px;
    border-top: 1px solid var(--neutral-100);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* New Modal Overlay System */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 20px;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-dialog {
    background: var(--surface);
    border-radius: var(--radius-2xl);
    width: 100%;
    max-width: 480px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.modal-overlay.active .modal-dialog {
    transform: scale(1) translateY(0);
}

/* Sick Modal Header */
.modal-header.sick-header {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    border-bottom: none;
}

.modal-header-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.modal-header-info {
    flex: 1;
    text-align: left;
}

.modal-header.sick-header .modal-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #92400e;
    margin: 0;
    text-align: left;
}

.modal-header.sick-header .modal-subtitle {
    font-size: 0.85rem;
    color: #a16207;
    margin: 2px 0 0 0;
    text-align: left;
}

/* Upload Modal Header */
.modal-header.upload-header {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    border-bottom: none;
    position: relative;
}

.modal-header.upload-header .modal-header-icon {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.modal-header.upload-header .modal-title {
    color: #1e40af;
    text-align: left;
}

.modal-header.upload-header .modal-subtitle {
    font-size: 0.85rem;
    color: #3b82f6;
    margin: 2px 0 0 0;
    text-align: left;
}

.modal-header.upload-header .modal-close-btn {
    color: #1e40af;
}

/* Upload Dropzone */
.upload-dropzone {
    border: 2px dashed var(--neutral-300);
    border-radius: var(--radius-xl);
    padding: 32px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--neutral-50);
    margin-bottom: 20px;
    position: relative;
}

.upload-dropzone:hover,
.upload-dropzone.dragover {
    border-color: var(--primary-400);
    background: var(--primary-50);
}

.upload-dropzone.dragover {
    transform: scale(1.02);
}

.upload-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.dropzone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.dropzone-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary-100) 0%, var(--primary-200) 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: var(--primary-600);
    margin-bottom: 8px;
}

.dropzone-text {
    font-size: 0.95rem;
    color: var(--neutral-600);
    margin: 0;
}

.dropzone-link {
    color: var(--primary-600);
    font-weight: 600;
    text-decoration: underline;
}

.dropzone-hint {
    font-size: 0.8rem;
    color: var(--neutral-400);
    margin: 0;
}

/* File Preview */
.dropzone-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--neutral-200);
}

.dropzone-preview .preview-icon {
    font-size: 2rem;
    color: var(--primary-500);
}

.dropzone-preview .preview-name {
    flex: 1;
    font-weight: 500;
    color: var(--neutral-700);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropzone-preview .preview-remove {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--neutral-400);
    cursor: pointer;
    padding: 0;
    display: flex;
    transition: color 0.2s;
}

.dropzone-preview .preview-remove:hover {
    color: var(--danger);
}

/* Modal Large */
.modal-dialog.modal-lg {
    max-width: 640px;
}

/* Badge Small */
.badge-sm {
    font-size: 0.65rem;
    padding: 2px 6px;
}

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

@media (max-width: 768px) {
    .upload-dropzone {
        padding: 24px 16px;
    }
    
    .dropzone-icon {
        width: 48px;
        height: 48px;
        font-size: 1.5rem;
    }
}

.modal-close-btn {
    position: absolute;
    right: 16px;
    top: 16px;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #92400e;
    transition: all 0.2s ease;
}

.modal-close-btn:hover {
    background: var(--surface);
}

/* Sick Alert Box */
.sick-alert {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: #fef2f2 !important;
    border: 1px solid #fecaca !important;
    border-radius: 12px;
    margin-bottom: 20px;
}

.sick-alert-icon {
    width: 40px;
    height: 40px;
    background: #fee2e2;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #dc2626;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.sick-alert-content {
    flex: 1;
}

.sick-alert-content strong {
    display: block;
    color: #991b1b;
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.sick-alert-content p {
    color: #b91c1c;
    font-size: 0.85rem;
    margin: 0;
    line-height: 1.5;
}

/* Checkbox Item */
.sick-checklist {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--neutral-200);
}

.checkbox-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--neutral-700);
}

.checkbox-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin: 0;
    cursor: pointer;
    accent-color: var(--warning);
}

/* Mobile Form Stack */
.form-grid.mobile-stack {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Mobile Modal Optimizations */
@media (max-width: 768px) {
    .modal-overlay {
        padding: 0;
        align-items: flex-end;
    }
    
    .modal-dialog {
        max-width: 100%;
        max-height: 90vh;
        border-radius: 24px 24px 0 0;
        transform: translateY(100%);
    }
    
    .modal-overlay.active .modal-dialog {
        transform: translateY(0);
    }
    
    .modal-header.sick-header {
        padding: 24px 20px;
        position: relative;
    }
    
    .modal-close-btn {
        right: 12px;
        top: 12px;
    }
    
    .modal-body {
        padding: 20px;
        max-height: 50vh;
        overflow-y: auto;
    }
    
    .modal-footer {
        padding: 16px 20px;
        padding-bottom: calc(16px + env(safe-area-inset-bottom));
        flex-direction: column;
    }
    
    .btn-mobile-full {
        width: 100%;
        justify-content: center;
    }
    
    .form-grid.mobile-stack {
        grid-template-columns: 1fr;
    }
    
    .sick-alert {
        flex-direction: column;
        text-align: center;
    }
    
    .sick-alert-icon {
        margin: 0 auto;
    }
}

/* ==========================================
   YEAR CALENDAR - Vacation Overview
   ========================================== */

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.year-display {
    font-weight: 700;
    font-size: 1rem;
    min-width: 60px;
    text-align: center;
}

.calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 20px;
    padding: 12px 16px;
    background: var(--neutral-50);
    border-radius: var(--radius-lg);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--neutral-600);
}

.legend-line {
    width: 24px;
    height: 4px;
    border-radius: 2px;
    flex-shrink: 0;
}

.legend-line.sick {
    background: #f87171;
}

.year-calendar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.month-block {
    background: var(--surface);
    border-radius: var(--radius-xl);
    padding: 16px;
    border: 1px solid var(--neutral-100);
    box-shadow: var(--shadow-sm);
}

.month-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--neutral-800);
    margin-bottom: 12px;
    text-align: center;
}

.month-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 6px;
}

.month-header span {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--neutral-400);
    text-align: center;
    padding: 4px 0;
}

.month-header .weekend {
    color: var(--neutral-300);
}

.month-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.month-days .day {
    position: relative;
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--neutral-700);
    border-radius: 6px;
    cursor: default;
    transition: all 0.15s ease;
    overflow: hidden;
}

.month-days .day .day-number {
    position: relative;
    z-index: 2;
    line-height: 1;
}

.month-days .day.empty {
    background: transparent;
}

.month-days .day.weekend {
    color: var(--neutral-400);
    background: var(--neutral-50);
}

.month-days .day.holiday {
    background: #f3f4f6;
    color: var(--neutral-400);
}

.month-days .day.today {
    background: var(--primary-50);
}

.month-days .day.today .day-number {
    background: var(--primary-500);
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Vacation Lines Container */
.day-lines {
    position: absolute;
    bottom: 2px;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 1px;
}

.vacation-line {
    height: 3px;
    background: var(--line-color, #3b82f6);
    border-radius: 1.5px;
    position: relative;
}

/* Line positions for continuous effect */
.vacation-line.pos-start {
    margin-left: 50%;
    border-radius: 1.5px 0 0 1.5px;
}

.vacation-line.pos-end {
    margin-right: 50%;
    border-radius: 0 1.5px 1.5px 0;
}

.vacation-line.pos-middle {
    margin-left: -2px;
    margin-right: -2px;
    border-radius: 0;
}

.vacation-line.pos-single {
    margin-left: 20%;
    margin-right: 20%;
}

.vacation-line.sick {
    background: #f87171;
}

/* Hover effect */
.month-days .day:not(.empty):hover {
    transform: scale(1.15);
    z-index: 10;
    box-shadow: var(--shadow-md);
    background: var(--surface);
}

/* Responsive Calendar */
@media (max-width: 1200px) {
    .year-calendar {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .year-calendar {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .month-block {
        padding: 12px;
    }
}

@media (max-width: 600px) {
    .year-calendar {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .month-block {
        padding: 14px;
    }
    
    .month-days .day {
        font-size: 0.8rem;
    }
    
    .calendar-legend {
        gap: 10px;
        padding: 10px 12px;
    }
    
    .legend-item {
        font-size: 0.75rem;
    }
    
    .legend-line {
        width: 20px;
        height: 3px;
    }
}

/* Alerts */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 20px;
}

.alert ion-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.alert-success {
    background: var(--success-light);
    color: #15803d;
    border: 1px solid #86efac;
}

.alert-warning {
    background: var(--warning-light);
    color: #b45309;
    border: 1px solid #fcd34d;
}

.alert-danger {
    background: var(--danger-light);
    color: #b91c1c;
    border: 1px solid #fca5a5;
}

.alert-info {
    background: var(--info-light);
    color: #1d4ed8;
    border: 1px solid #93c5fd;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 440px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-2xl);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

.login-header {
    padding: 40px 40px 32px;
    text-align: center;
    background: linear-gradient(135deg, var(--primary-50) 0%, transparent 100%);
}

.login-logo-image {
    height: 106px;
    width: auto;
    max-width: 100%;
    margin: 0 auto 16px;
    display: block;
}

.login-logo {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-600) 100%);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: var(--shadow-glow);
}

.login-logo ion-icon {
    font-size: 2.5rem;
    color: white;
}

.login-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--neutral-900);
    margin-bottom: 8px;
}

.login-subtitle {
    color: var(--neutral-500);
    font-size: 0.95rem;
}

.login-body {
    padding: 32px 40px 40px;
}

.login-form .form-group {
    margin-bottom: 24px;
}

.login-footer {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid var(--neutral-100);
    margin-top: 24px;
}

.login-footer a {
    color: var(--primary-600);
    text-decoration: none;
    font-weight: 600;
}

.login-footer a:hover {
    text-decoration: underline;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    background: var(--neutral-100);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.empty-state-icon ion-icon {
    font-size: 2.5rem;
    color: var(--neutral-400);
}

.empty-state-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--neutral-700);
    margin-bottom: 8px;
}

.empty-state-text {
    color: var(--neutral-500);
    max-width: 320px;
    margin: 0 auto 24px;
}

/* Progress Bars */
.progress-bar-container {
    background: var(--neutral-200);
    border-radius: var(--radius-full);
    height: 8px;
    overflow: hidden;
}

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

.progress-bar.primary {
    background: linear-gradient(90deg, var(--primary-400) 0%, var(--primary-600) 100%);
}

.progress-bar.success {
    background: linear-gradient(90deg, #4ade80 0%, var(--success) 100%);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 4px;
    background: var(--neutral-100);
    padding: 4px;
    border-radius: var(--radius-lg);
}

.tab {
    padding: 12px 24px;
    border: none;
    background: none;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--neutral-500);
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.tab:hover {
    color: var(--neutral-700);
}

.tab.active {
    background: var(--surface);
    color: var(--neutral-800);
    box-shadow: var(--shadow-sm);
}

/* Notifications Dropdown */
.notifications-dropdown {
    position: relative;
}

.notifications-btn {
    position: relative;
}

.notifications-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    background: var(--danger);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

.notifications-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 360px;
    background: var(--surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-normal);
    z-index: 100;
}

.notifications-dropdown.open .notifications-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Grid Layouts */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

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

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

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

@media (max-width: 992px) {
    .sidebar {
        width: 240px;
    }
    
    .main-content {
        margin-left: 240px;
        padding: 24px;
    }
    
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        padding: 16px;
    }
    
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
    
    .page-title {
        font-size: 1.5rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .mobile-menu-btn {
        display: flex !important;
    }
}

.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 101;
    width: 48px;
    height: 48px;
    background: var(--bg-card);
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.mobile-menu-btn ion-icon {
    font-size: 1.5rem;
    color: var(--neutral-700);
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--neutral-500); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-primary { color: var(--primary-600); }

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

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.p-0 { padding: 0; }
.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }
.p-4 { padding: 32px; }

.d-none { display: none; }
.d-flex { display: flex; }
.d-block { display: block; }
.d-inline-block { display: inline-block; }

.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }

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

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

.animate-fadeIn {
    animation: fadeIn 0.3s ease-out;
}

.animate-slideUp {
    animation: slideUp 0.4s ease-out;
}

.animate-pulse {
    animation: pulse 2s infinite;
}

/* Custom Site Selector Dropdown */
.custom-select-wrapper {
    position: relative;
    width: 100%;
}

.custom-select {
    position: relative;
    width: 100%;
    z-index: 50;
}

.custom-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-lg);
    color: white;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all var(--transition-fast);
}

.custom-select-trigger:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

.custom-select-trigger.open {
    border-color: rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.custom-select-trigger .trigger-text {
    flex: 1;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.custom-select-trigger .trigger-text.placeholder {
    opacity: 0.7;
}

.custom-select-trigger .trigger-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 12px;
    transition: transform var(--transition-fast);
}

.custom-select-trigger.open .trigger-icon {
    transform: rotate(180deg);
}

.custom-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--brand-charcoal-2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-top: none;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    max-height: 220px;
    overflow-y: auto;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-fast);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.custom-select-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.custom-select-search {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    position: sticky;
    top: 0;
    background: var(--brand-charcoal-2);
    z-index: 1;
}

.custom-select-search input {
    width: 100%;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    color: white;
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
}

.custom-select-search input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.custom-select-search input:focus {
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.15);
}

.custom-select-options {
    padding: 8px;
}

.custom-select-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    color: rgba(255, 255, 255, 0.9);
}

.custom-select-option:hover {
    background: rgba(255, 255, 255, 0.15);
}

.custom-select-option.selected {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.custom-select-option .option-icon {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.custom-select-option .option-icon ion-icon {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
}

.custom-select-option .option-content {
    flex: 1;
    min-width: 0;
}

.custom-select-option .option-title {
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.custom-select-option .option-subtitle {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 2px;
}

.custom-select-option .option-badge {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    flex-shrink: 0;
}

.custom-select-empty {
    padding: 24px 16px;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
}

.custom-select-empty ion-icon {
    font-size: 2rem;
    display: block;
    margin: 0 auto 8px;
    opacity: 0.5;
}

/* Scrollbar styling for dropdown */
.custom-select-dropdown::-webkit-scrollbar {
    width: 6px;
}

.custom-select-dropdown::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.custom-select-dropdown::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.custom-select-dropdown::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Site selector spacing */
.site-selector {
    margin-top: 20px;
    margin-bottom: 24px;
    position: relative;
    z-index: 50;
}

/* Time tracker needs overflow visible for dropdown */
.time-tracker {
    overflow: visible;
}

.time-tracker-buttons {
    position: relative;
    z-index: 1;
}

/* Print Styles */
@media print {
    .sidebar,
    .header-actions,
    .btn,
    .mobile-menu-btn,
    .mobile-nav {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0;
        padding: 0;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* ==========================================
   MOBILE BOTTOM NAVIGATION
   ========================================== */

.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--neutral-200);
    padding: 8px 0;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
    z-index: 1000;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
    justify-content: space-around;
    align-items: center;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    text-decoration: none;
    color: var(--neutral-500);
    font-size: 0.65rem;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
    min-width: 64px;
}

.mobile-nav-item ion-icon {
    font-size: 1.5rem;
    margin-bottom: 4px;
    transition: all 0.2s ease;
}

.mobile-nav-item span {
    white-space: nowrap;
}

.mobile-nav-item.active {
    color: var(--primary-600);
}

.mobile-nav-item.active ion-icon {
    color: var(--primary-600);
    transform: scale(1.1);
}

.mobile-nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 3px;
    background: var(--primary-500);
    border-radius: 0 0 4px 4px;
}

/* Body padding when mobile nav is present */
.has-mobile-nav {
    padding-bottom: calc(70px + env(safe-area-inset-bottom));
}

/* Desktop: Hide mobile nav */
@media (min-width: 769px) {
    .mobile-nav {
        display: none !important;
    }
    
    .has-mobile-nav {
        padding-bottom: 0;
    }
}

/* Mobile: Show mobile nav, hide sidebar */
@media (max-width: 768px) {
    .sidebar {
        display: none !important;
    }
    
    .mobile-menu-btn {
        display: none !important;
    }
    
    .mobile-nav {
        display: flex !important;
    }
    
    .main-content {
        margin-left: 0 !important;
        padding: 16px !important;
        padding-bottom: calc(90px + env(safe-area-inset-bottom)) !important;
    }
    
    /* Mobile optimizations */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .page-header .btn {
        width: 100%;
    }
    
    .time-tracker {
        padding: 20px;
    }
    
    .current-time {
        font-size: 3rem;
    }
    
    .time-tracker-buttons {
        flex-direction: column;
    }
    
    .time-tracker-buttons .btn {
        width: 100%;
    }
    
    .card {
        margin-bottom: 16px;
    }
    
    .table-container {
        margin: 0 -16px;
        padding: 0 16px;
        overflow-x: auto;
    }
    
    .form-grid {
        grid-template-columns: 1fr !important;
    }
    
    .modal-content {
        margin: 16px;
        max-height: calc(100vh - 120px);
        overflow-y: auto;
    }
}

/* Extra small devices */
@media (max-width: 375px) {
    .mobile-nav-item {
        min-width: 56px;
        padding: 8px 8px;
    }
    
    .mobile-nav-item ion-icon {
        font-size: 1.3rem;
    }
    
    .mobile-nav-item span {
        font-size: 0.6rem;
    }
    
    .current-time {
        font-size: 2.5rem;
    }
}

/* Safe area for notched devices */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .mobile-nav {
        padding-bottom: calc(8px + env(safe-area-inset-bottom));
    }
}

/* Standalone PWA mode */
@media (display-mode: standalone) {
    .mobile-nav {
        background: rgba(255, 255, 255, 0.98);
    }
    
    body {
        overscroll-behavior-y: contain;
    }
}

/* Mobile Admin Menu */
.mobile-admin-menu {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-admin-menu.open {
    display: block;
    opacity: 1;
}

.mobile-admin-menu-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface);
    border-radius: 20px 20px 0 0;
    max-height: 80vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    padding-bottom: env(safe-area-inset-bottom);
}

.mobile-admin-menu.open .mobile-admin-menu-content {
    transform: translateY(0);
}

.mobile-admin-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--neutral-200);
    position: sticky;
    top: 0;
    background: var(--surface);
    z-index: 1;
}

.mobile-admin-menu-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--neutral-900);
}

.mobile-admin-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--neutral-100);
    color: var(--neutral-600);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.3rem;
}

.mobile-admin-menu-items {
    padding: 12px 0;
}

.mobile-admin-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    text-decoration: none;
    color: var(--neutral-700);
    font-size: 1rem;
    font-weight: 500;
    transition: background 0.2s;
}

.mobile-admin-item:hover,
.mobile-admin-item:active {
    background: var(--neutral-50);
}

.mobile-admin-item.active {
    color: var(--primary-600);
    background: var(--primary-50);
}

.mobile-admin-item ion-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
}

.mobile-admin-divider {
    height: 1px;
    background: var(--neutral-200);
    margin: 8px 24px;
}

/* =================================================================
   Bauunternehmen Daniel Buss – Marken-Overrides (Signal-Orange #ef7c00)
   Sorgt für lesbaren Kontrast: dunkle Schrift AUF gelben Flächen,
   Anthrazit-Hero mit gelbem Akzent.
   ================================================================= */

/* Primäre Aktionsbuttons: Gelb mit schwarzer Schrift */
.btn-primary {
    background: linear-gradient(135deg, #ef7c00 0%, #e07300 100%);
    color: var(--brand-ink);
    box-shadow: 0 4px 15px rgba(239, 124, 0, 0.35);
}
.btn-primary:hover {
    box-shadow: 0 6px 22px rgba(239, 124, 0, 0.5);
}
.btn-primary ion-icon { color: var(--brand-ink); }

.btn-outline:hover { border-color: var(--primary-500); color: var(--primary-700); }

/* Avatare / Logo-Icon: dunkle Initialen auf Gelb */
.avatar-primary,
.sidebar-profile-avatar,
.avatar-upload-btn,
.logo-icon {
    background: linear-gradient(135deg, #ef7c00 0%, #d96400 100%);
    color: var(--brand-ink);
}
.logo-icon svg, .logo-icon ion-icon,
.avatar-upload-btn ion-icon { color: var(--brand-ink); }

/* Logo-Schriftzug: kräftiges Anthrazit (auf hellem Sidebar-Hintergrund lesbar) */
.logo-text {
    background: none;
    -webkit-text-fill-color: var(--brand-charcoal);
    color: var(--brand-charcoal);
}

/* Badges */
.badge-primary { background: var(--primary-500); color: var(--brand-ink); }

/* Kleine Akzent-Icons, die sonst gelb-auf-weiß unsichtbar wären → dunkles Gold */
.card-title ion-icon,
.timeline-location ion-icon,
.dropzone-preview .preview-icon,
.calendar-weekday.weekend,
.custom-select-generic .custom-select-option .option-check,
.text-primary { color: var(--primary-700); }

/* Kalender-„Heute" und Monatsmarker: schwarze Schrift auf Gelb */
.calendar-day.today,
.month-days .day.today .day-number { color: var(--brand-ink) !important; }

/* HERO – Zeiterfassungs-Panel: Anthrazit statt Gelb, damit weiße Schrift
   lesbar bleibt; Uhr & Haupt-Button in Signal-Orange als Akzent */
.time-tracker {
    background: linear-gradient(145deg, var(--brand-charcoal) 0%, var(--brand-charcoal-2) 100%);
    color: #fff;
    box-shadow: var(--shadow-xl), 0 0 50px rgba(239,124,0,0.12);
    border: 1px solid rgba(239,124,0,0.15);
}
.current-time-display { color: var(--brand-yellow); text-shadow: 0 4px 24px rgba(239,124,0,0.25); }
.time-tracker-status { background: rgba(255,255,255,0.08); }
/* Haupt-Stempelbutton in Signal-Orange */
.time-btn.primary { background: var(--brand-yellow); color: var(--brand-ink); }
.time-btn.primary:hover { background: #ef8c00; }
.time-btn.primary ion-icon { color: var(--brand-ink); }

/* Login-Logo-Container */
.login-logo {
    background: linear-gradient(135deg, #ef7c00 0%, #d96400 100%);
    color: var(--brand-ink);
}

/* Fokus-Ringe in Signal-Orange */
.form-input:focus, .form-select:focus, .form-textarea:focus,
input:focus, select:focus, textarea:focus {
    outline: none;
}

/* =================================================================
   Material-Modul – Tap-Raster für schnelle Erfassung
   ================================================================= */
.material-cat-title {
    font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px;
    color: var(--neutral-500); margin: 18px 4px 10px;
}
.material-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 12px;
}
.material-tile {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 6px; min-height: 104px; padding: 14px 10px; cursor: pointer;
    background: var(--surface); border: 2px solid var(--neutral-200); border-radius: var(--radius-lg);
    font-family: inherit; color: var(--neutral-800); text-align: center;
    transition: transform .12s ease, border-color .15s ease, box-shadow .15s ease;
    -webkit-tap-highlight-color: transparent;
}
.material-tile:hover { border-color: var(--primary-500); box-shadow: var(--shadow-md); }
.material-tile:active { transform: scale(.96); }
.material-tile.tapped { border-color: var(--primary-500); background: var(--primary-50);
    box-shadow: 0 0 0 4px rgba(239,124,0,.35); transform: scale(.96); }
.material-tile ion-icon { font-size: 1.9rem; color: var(--neutral-700); }
.material-tile-name { font-size: .9rem; font-weight: 700; line-height: 1.15; }
.material-tile-unit { font-size: .72rem; color: var(--neutral-500); font-weight: 600; }
.material-tile-custom { border-style: dashed; }
.material-tile-custom ion-icon { color: var(--primary-700); }
.material-tile-badge {
    position: absolute; top: -8px; right: -8px; min-width: 24px; height: 24px; padding: 0 6px;
    display: none; align-items: center; justify-content: center;
    background: var(--brand-yellow); color: var(--brand-ink); border: 2px solid #fff;
    border-radius: var(--radius-full); font-size: .78rem; font-weight: 800; box-shadow: var(--shadow-sm);
}
/* Heute-Liste */
.material-row { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--neutral-100); }
.material-row:last-child { border-bottom: none; }
.material-row-icon { width: 42px; height: 42px; flex-shrink: 0; border-radius: var(--radius-md);
    background: var(--primary-50); display: flex; align-items: center; justify-content: center; }
.material-row-icon ion-icon { font-size: 1.4rem; color: var(--primary-700); }
.material-row-main { flex: 1; min-width: 0; }
.material-row-name { font-weight: 700; font-size: .95rem; }
.material-row-sub { font-size: .8rem; color: var(--neutral-500); }
.material-row-qty { font-weight: 800; font-size: 1rem; color: var(--neutral-800); white-space: nowrap; }
.material-row-del { background: none; border: none; cursor: pointer; color: var(--neutral-400);
    padding: 8px; border-radius: var(--radius-md); transition: all .15s; }
.material-row-del:hover { color: var(--danger); background: var(--danger-light); }
.material-row-del ion-icon { font-size: 1.2rem; }
@media (max-width: 640px) {
    .material-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
    .material-tile { min-height: 96px; }
}

/* =================================================================
   DARK MODE – Bauunternehmen Daniel Buss
   Aktiviert über <html data-theme="dark">. Nutzt die vorhandenen
   CSS-Variablen (Neutralskala invertiert) + gezielte Overrides.
   ================================================================= */
:root[data-theme="dark"] {
    /* Neutralskala für dunkle Oberflächen (hell = Text, dunkel = Fläche) */
    --neutral-50:  #1b1d22;
    --neutral-100: #24272e;
    --neutral-200: #333741;
    --neutral-300: #454b56;
    --neutral-400: #6a7280;
    --neutral-500: #9aa1ad;
    --neutral-600: #b8bdc7;
    --neutral-700: #d3d7de;
    --neutral-800: #e9ebef;
    --neutral-900: #f6f7f9;

    /* Flächen / Hintergründe */
    --surface:        #1f2228;
    --surface-2:      #262a31;
    --bg-card:        #1f2228;
    --bg-card-hover:  #262a31;
    --bg-gradient-start: #131418;
    --bg-gradient-mid:   #181a1e;
    --bg-gradient-end:   #131418;

    /* Gelb-Tints für Highlights dunkel (statt Pastellgelb) + helle Akzentschrift */
    --primary-50:  #26261a;
    --primary-100: #33311c;
    --primary-200: #454121;
    --primary-600: #d96400;
    --primary-700: #ef7c00;

    /* Status-Tints dunkel */
    --success-light: rgba(34,197,94,0.16);
    --warning-light: rgba(245,158,11,0.16);
    --danger-light:  rgba(239,68,68,0.16);
    --info-light:    rgba(59,130,246,0.16);

    /* Schatten kräftiger */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.5);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.5);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.55);
    --shadow-xl: 0 20px 60px rgba(0,0,0,0.65);
    color-scheme: dark;
}

/* Dezente Ränder statt heller Linien */
:root[data-theme="dark"] .sidebar { border-right-color: rgba(255,255,255,0.06); }
:root[data-theme="dark"] .login-card { border-color: rgba(255,255,255,0.08); }
:root[data-theme="dark"] .login-header { background: linear-gradient(135deg, rgba(239,124,0,0.07) 0%, transparent 70%); }
:root[data-theme="dark"] .card,
:root[data-theme="dark"] .stat-card { border: 1px solid rgba(255,255,255,0.05); }

/* Firmenlogo: hell (logo_dark.png mit schwarzer Schrift) ist Default für hellen Hintergrund;
   im Dark-Mode wird auf logo.png (weiße Schrift + Orange-Dach) umgeswitcht – Brand-Orange bleibt sichtbar. */
:root[data-theme="dark"] .logo-image,
:root[data-theme="dark"] .login-logo-image { content: url('../images/logo.png'); }

/* Navigation */
:root[data-theme="dark"] .nav-link:hover { background: rgba(255,255,255,0.05); color: var(--neutral-900); }
:root[data-theme="dark"] .nav-link.active {
    background: rgba(239,124,0,0.13);
    color: var(--brand-yellow);
}
:root[data-theme="dark"] .sidebar-profile {
    background: rgba(239,124,0,0.06);
    border-color: rgba(239,124,0,0.14);
}

/* Akzent-Icons/-Texte: auf Dunkel in Signal-Orange statt dunklem Gold */
:root[data-theme="dark"] .card-title ion-icon,
:root[data-theme="dark"] .timeline-location ion-icon,
:root[data-theme="dark"] .dropzone-preview .preview-icon,
:root[data-theme="dark"] .calendar-weekday.weekend,
:root[data-theme="dark"] .custom-select-generic .custom-select-option .option-check,
:root[data-theme="dark"] .text-primary,
:root[data-theme="dark"] .material-row-icon ion-icon { color: var(--brand-yellow); }
:root[data-theme="dark"] .material-row-icon { background: rgba(239,124,0,0.12); }

/* Badges – dunkle Tints + helle Schrift */
:root[data-theme="dark"] .badge-success { background: rgba(34,197,94,0.18);  color: #4ade80; }
:root[data-theme="dark"] .badge-warning { background: rgba(245,158,11,0.18); color: #fbbf24; }
:root[data-theme="dark"] .badge-danger  { background: rgba(239,68,68,0.18);  color: #f87171; }
:root[data-theme="dark"] .badge-info    { background: rgba(59,130,246,0.18); color: #60a5fa; }
:root[data-theme="dark"] .badge-secondary { background: var(--neutral-100); color: var(--neutral-600); }

/* Alerts – dunkle Tints + helle Schrift */
:root[data-theme="dark"] .alert-success { background: rgba(34,197,94,0.12);  color: #86efac; }
:root[data-theme="dark"] .alert-info    { background: rgba(59,130,246,0.12); color: #93c5fd; }
:root[data-theme="dark"] .alert-warning { background: rgba(245,158,11,0.12); color: #fcd34d; }
:root[data-theme="dark"] .alert-danger  { background: rgba(239,68,68,0.12);  color: #fca5a5; }

/* Eingaben */
:root[data-theme="dark"] .form-input,
:root[data-theme="dark"] .form-select,
:root[data-theme="dark"] .form-textarea { background: var(--surface-2); }
:root[data-theme="dark"] input[type="date"],
:root[data-theme="dark"] input[type="month"],
:root[data-theme="dark"] input[type="time"] { color-scheme: dark; }

/* Schalt-Knopf bleibt weiß */
:root[data-theme="dark"] .toggle-slider::before { background: #ffffff; }

/* Custom-Select (Baustellen-Dropdown) im Dark-Mode lesbar */
:root[data-theme="dark"] .custom-select-generic .custom-select-option { color: var(--neutral-700); }
:root[data-theme="dark"] .custom-select-generic .custom-select-option:hover {
    background: rgba(255,255,255,0.06); color: var(--neutral-900);
}
:root[data-theme="dark"] .custom-select-generic .custom-select-option.selected {
    background: rgba(239,124,0,0.15); color: var(--brand-yellow);
}

/* =================================================================
   Theme-Umschalter (unten links in der Sidebar / auf dem Login)
   ================================================================= */
.theme-toggle {
    display: flex; align-items: center; gap: 10px;
    width: 100%; margin-top: 10px; padding: 10px 14px;
    background: var(--neutral-100); border: 1px solid var(--neutral-200);
    border-radius: var(--radius-lg); cursor: pointer;
    color: var(--neutral-600); font-family: inherit; font-size: 0.85rem; font-weight: 600;
    transition: background var(--transition-fast);
}
.theme-toggle:hover { background: var(--neutral-200); color: var(--neutral-800); }
.theme-toggle .tt-icon { font-size: 1.15rem; flex-shrink: 0; }
.theme-toggle .tt-label { white-space: nowrap; }
.theme-toggle .tt-track {
    margin-left: auto; flex-shrink: 0;
    width: 42px; height: 24px; border-radius: 999px;
    background: var(--neutral-300); position: relative; transition: background var(--transition-fast);
}
.theme-toggle .tt-knob {
    position: absolute; top: 3px; left: 3px; width: 18px; height: 18px;
    border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    transition: transform var(--transition-fast);
}
:root[data-theme="dark"] .theme-toggle .tt-track { background: var(--brand-yellow); }
:root[data-theme="dark"] .theme-toggle .tt-knob { transform: translateX(18px); }

/* Fixe Variante auf der Login-Seite (unten links) */
.theme-toggle-fixed {
    position: fixed; left: 20px; bottom: 20px; width: auto; margin: 0; z-index: 50;
    background: var(--surface); box-shadow: var(--shadow-md);
}

/* Offenes Baustellen-/Custom-Select-Dropdown über die nachfolgenden Kacheln heben.
   .card erzeugt via backdrop-filter einen Stacking-Context, der den hohen z-index
   des Dropdowns sonst einsperrt – darum die Karte selbst anheben, solange offen. */
.card:has(.custom-select-dropdown.open) { position: relative; z-index: 50; }
.material-layout > div:has(.custom-select-dropdown.open) { position: relative; z-index: 50; }

/* =================================================================
   LOGIN-STARTSCREEN – Orange Bühne mit weißem Logo
   Erst Splash (orange + Logo weiß), dann Login-Card eingeblendet.
   Reine CSS-Animation, JS-frei.
   ================================================================= */
.login-splash {
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: var(--brand-orange);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    will-change: opacity, visibility;
    animation: bussSplashOut 0.5s cubic-bezier(0.4, 0, 0.2, 1) 1.45s forwards;
}

.login-splash::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(255,255,255,0.10) 0%, transparent 60%);
    pointer-events: none;
}

.login-splash-logo {
    width: min(78vw, 460px);
    height: auto;
    max-height: 60vh;
    /* Logo komplett weiß – ursprüngliche Farben werden invertiert */
    filter: brightness(0) invert(1);
    opacity: 0;
    transform: scale(0.94);
    animation: bussSplashLogoIn 0.75s cubic-bezier(0.16, 1, 0.3, 1) 0.1s forwards;
}

@keyframes bussSplashLogoIn {
    to { opacity: 1; transform: scale(1); }
}

@keyframes bussSplashOut {
    to { opacity: 0; visibility: hidden; pointer-events: none; }
}

/* Login-Card wird erst nach dem Splash eingeblendet */
body.login-page .login-card {
    opacity: 0;
    transform: translateY(28px);
    animation: bussLoginIn 0.55s cubic-bezier(0.16, 1, 0.3, 1) 1.6s forwards;
}

@keyframes bussLoginIn {
    to { opacity: 1; transform: translateY(0); }
}

/* Theme-Toggle (unten links) ebenfalls erst nach dem Splash */
body.login-page .theme-toggle-fixed {
    opacity: 0;
    animation: bussToolsIn 0.4s ease-out 1.95s forwards;
}

@keyframes bussToolsIn {
    to { opacity: 1; }
}

/* Reduced Motion: keine Animation, alles sofort sichtbar */
@media (prefers-reduced-motion: reduce) {
    .login-splash { animation: bussSplashOut 0.01s linear 0s forwards; }
    .login-splash-logo { animation: none; opacity: 1; transform: none; }
    body.login-page .login-card,
    body.login-page .theme-toggle-fixed { animation: none; opacity: 1; transform: none; }
}
