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

:root {
  --primary: #3B82F6; 
  --primary-hover: #2563EB;
  --primary-light: #EFF6FF;
  
  --bg-gradient: linear-gradient(135deg, #E2E8F0 0%, #CBD5E1 100%); 
  --card-bg: rgba(255, 255, 255, 0.7);
  --text-dark: #0F172A; 
  --text-muted: #64748B;
  --border-color: rgba(255, 255, 255, 0.8);
  
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Plus Jakarta Sans', sans-serif; -webkit-tap-highlight-color: transparent; }
body { background: var(--bg-gradient); color: var(--text-dark); display: flex; flex-direction: column; min-height: 100vh; overflow-x: hidden; position: relative; }

@keyframes popIn {
  0% { opacity: 0; transform: scale(0.9) translateY(20px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes slideInTab {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes pulseGlow {
  0% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(59, 130, 246, 0); }
  100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
}

#loginScreen { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }
.login-box { background: var(--card-bg); padding: 48px 40px; border-radius: 24px; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,0.6); width: 100%; max-width: 400px; text-align: center; border: 1px solid var(--border-color); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); animation: popIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;}
.form-group { margin-bottom: 20px; text-align: left; width: 100%; }
.form-group label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 8px; letter-spacing: 0.3px;}

.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 14px 16px; border: 1px solid rgba(226, 232, 240, 0.8); border-radius: 12px; font-size: 16px; outline: none; transition: all 0.2s ease; background: rgba(248, 250, 252, 0.8); resize: vertical; color: var(--text-dark); }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--primary); background: #FFF; box-shadow: 0 0 0 4px var(--primary-light); transform: translateY(-2px); }

.btn-primary { width: 100%; padding: 14px; background: var(--primary); color: white; border: none; border-radius: 12px; font-size: 14px; font-weight: 700; cursor: pointer; transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); display: flex; justify-content: center; align-items: center; gap: 8px; box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3); }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4); }
.btn-primary:active { transform: scale(0.96); } 
.btn-outline { background: transparent; color: var(--text-dark); border: 1px solid rgba(226, 232, 240, 0.8); box-shadow: none; }
.btn-outline:hover { background: rgba(255,255,255,0.9); border-color: var(--border-color); transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0,0,0,0.05); }

#loginError { color: var(--danger); font-size: 13px; margin-top: 15px; display: none; font-weight: 600; padding: 10px; background: #FEF2F2; border-radius: 8px; border: 1px solid #FCA5A5; animation: popIn 0.3s ease;}

#appWrapper { display: none; flex-direction: column; flex: 1; }

header { background: rgba(255, 255, 255, 0.7); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); height: 75px; padding: 0 5%; border-bottom: 1px solid var(--border-color); display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 20px; position: sticky; top: 0; z-index: 1000; box-shadow: 0 4px 30px rgba(0, 0, 0, 0.03); }
.logo-container { display: flex; align-items: center; gap: 12px; font-size: 20px; font-weight: 800; color: var(--text-dark); flex-shrink: 0; text-decoration: none; width: 250px; letter-spacing: -0.5px; transition: transform 0.2s;}
.logo-container:active { transform: scale(0.95); }
.logo-icon { background: var(--primary); color: white; padding: 8px; border-radius: 10px; display: flex; box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3);}

.top-nav { display: flex; gap: 6px; align-items: center; justify-content: center; overflow-x: auto; white-space: nowrap; scrollbar-width: none; flex-grow: 1; -webkit-overflow-scrolling: touch; }
.top-nav::-webkit-scrollbar { display: none; }
.top-nav a { text-decoration: none; color: var(--text-muted); font-weight: 600; font-size: 13px; padding: 10px 16px; border-radius: 10px; transition: all 0.2s; cursor: pointer; position: relative;}
.top-nav a:hover, .top-nav a.active { color: var(--primary); background: var(--primary-light); transform: translateY(-1px); }
.top-nav a:active { transform: scale(0.95); }

.user-profile { display: flex; align-items: center; gap: 8px; cursor: pointer; background: rgba(254, 242, 242, 0.8); padding: 8px 14px; border-radius: 10px; border: 1px solid rgba(254, 226, 226, 0.8); transition: all 0.2s;}
.user-profile:hover { background: #FEE2E2; transform: translateY(-1px); }
.user-profile:active { transform: scale(0.95); }

.main-container { flex: 1; padding: 32px 5%; max-width: 1400px; margin: 0 auto; width: 100%; }
.tab-content { display: none; }
.tab-content.active { display: block; animation: slideInTab 0.3s ease-out forwards; }

.card-panel { background: var(--card-bg); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-radius: 20px; padding: 24px; border: 1px solid var(--border-color); box-shadow: 0 10px 30px -10px rgba(0,0,0,0.05), inset 0 1px 0 rgba(255,255,255,0.6); overflow-x: auto; height: fit-content; width: 100%; transition: transform 0.3s ease, box-shadow 0.3s ease; }
.card-panel:hover { box-shadow: 0 15px 40px -10px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,0.6); }
.panel-title { font-size: 17px; font-weight: 800; margin-bottom: 24px; display: flex; align-items: center; gap: 10px; color: var(--text-dark); justify-content: space-between; letter-spacing: -0.3px;}

.welcome-widget { background: linear-gradient(135deg, var(--primary) 0%, #1E3A8A 100%); border-radius: 20px; padding: 32px; color: white; display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; box-shadow: 0 15px 30px -5px rgba(59, 130, 246, 0.3); position: relative; overflow: hidden; border: 1px solid rgba(255,255,255,0.1); transition: transform 0.3s;}
.welcome-widget:hover { transform: translateY(-3px); box-shadow: 0 20px 40px -5px rgba(59, 130, 246, 0.4); }
.welcome-widget::after { content: ''; position: absolute; top: -50%; right: -5%; width: 400px; height: 400px; background: radial-gradient(circle, rgba(255,255,255,0.12) 0%, transparent 60%); border-radius: 50%; pointer-events: none; }
.welcome-text h1 { font-size: 26px; font-weight: 800; margin-bottom: 8px; letter-spacing: -0.5px; display: flex; align-items: center; gap: 10px;}
.welcome-text p { font-size: 14px; opacity: 0.9; font-weight: 500;}
.welcome-date { background: rgba(255,255,255,0.15); backdrop-filter: blur(10px); padding: 12px 20px; border-radius: 14px; font-weight: 700; font-size: 14px; border: 1px solid rgba(255,255,255,0.1); display: flex; align-items: center; gap: 8px; z-index: 2;}

.weather-widget { background: rgba(255, 255, 255, 0.2); backdrop-filter: blur(10px); padding: 12px 16px; border-radius: 14px; display: flex; align-items: center; gap: 12px; border: 1px solid rgba(255, 255, 255, 0.2); margin-top: 10px; width: fit-content;}
.weather-widget svg { color: #FCD34D; }
.weather-info { display: flex; flex-direction: column; }
.weather-info span:first-child { font-weight: 800; font-size: 14px; }
.weather-info span:last-child { font-size: 11px; opacity: 0.9; }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 30px; }
.stat-card { background: var(--card-bg); backdrop-filter: blur(20px); border: 1px solid var(--border-color); border-radius: 16px; padding: 24px; box-shadow: 0 4px 10px rgba(0,0,0,0.02); transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); cursor: pointer; }
.stat-card:hover { transform: translateY(-5px); box-shadow: 0 15px 30px -5px rgba(0,0,0,0.08); border-color: rgba(255,255,255,1); }
.stat-card:active { transform: scale(0.96); }
.stat-card h4 { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.8px; font-weight: 700; margin-bottom: 12px;}
.stat-card .number { font-size: 32px; font-weight: 800; color: var(--text-dark); margin-bottom: 6px; letter-spacing: -1px;}

.calendar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; }
.cal-day { background: rgba(255, 255, 255, 0.6); border-radius: 16px; padding: 16px; border: 1px solid var(--border-color); min-height: 170px; transition: transform 0.2s; display: flex; flex-direction: column; justify-content: space-between; }
.cal-day:hover { background: rgba(255, 255, 255, 0.9); transform: translateY(-3px); box-shadow: 0 10px 20px rgba(0,0,0,0.05); }
.cal-day.today { border: 2px solid var(--primary); background: #FFF; position: relative; }
.cal-day.today::before { content: ''; position: absolute; top: -4px; right: -4px; width: 12px; height: 12px; background: var(--primary); border-radius: 50%; box-shadow: 0 0 0 4px #FFF; animation: pulseGlow 2s infinite; }
.cal-date { font-size: 14px; font-weight: 800; color: var(--text-dark); margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; }
.cal-date span { font-size: 11px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; }
.cal-events-wrap { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.cal-event { font-size: 12px; padding: 10px; border-radius: 10px; font-weight: 600; display: flex; flex-direction: column; gap: 4px; cursor: pointer; transition: all 0.2s; box-shadow: 0 2px 4px rgba(0,0,0,0.02); position: relative; overflow: hidden; }
.cal-event:hover { transform: scale(1.03); box-shadow: 0 4px 8px rgba(0,0,0,0.05); }
.cal-event:active { transform: scale(0.98); }
.cal-event .del-event { position: absolute; top: 5px; right: 5px; color: inherit; opacity: 0; transition: 0.2s; background: rgba(255,255,255,0.5); border-radius: 4px; padding: 2px;}
.cal-event:hover .del-event { opacity: 1; }
.cal-event .del-event:hover { background: rgba(255,255,255,0.9); }

.event-uvv { background: #FEF2F2; color: var(--danger); border-left: 3px solid var(--danger); }
.event-site { background: var(--primary-light); color: var(--primary); border-left: 3px solid var(--primary); }
.event-customer { background: #F3E8FF; color: #7E22CE; border-left: 3px solid #9333EA; }
.event-internal { background: #F1F5F9; color: #334155; border-left: 3px solid #64748B; }

.content-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 30px; align-items: start; }
.left-column { display: flex; flex-direction: column; gap: 24px; }

.search-bar { width: 100%; max-width: 250px; padding: 10px 16px; border: 1px solid rgba(226, 232, 240, 0.8); border-radius: 10px; font-size: 13px; font-weight: 500; outline: none; background: rgba(248, 250, 252, 0.7); transition: 0.2s; backdrop-filter: blur(10px); }
.search-bar:focus { border-color: var(--primary); background: #FFF; box-shadow: 0 0 0 3px var(--primary-light); transform: translateY(-1px); }

.data-table { width: 100%; border-collapse: collapse; min-width: 600px; }
.data-table th { text-align: left; padding: 14px 12px; color: var(--text-muted); font-size: 12px; font-weight: 700; border-bottom: 1px solid var(--border-color); text-transform: uppercase; letter-spacing: 0.8px;}
.data-table td { padding: 16px 12px; border-bottom: 1px solid rgba(226, 232, 240, 0.5); font-size: 13px; font-weight: 500; vertical-align: middle; transition: 0.2s; color: var(--text-dark);}
.data-table tbody tr { transition: all 0.2s; }
.data-table tbody tr:hover td { background-color: rgba(255, 255, 255, 0.8); }

.status-badge { padding: 6px 10px; border-radius: 6px; font-size: 11px; font-weight: 700; display: inline-block; letter-spacing: 0.5px; text-transform: uppercase;}
.status-available { background: #ECFDF5; color: #059669; border: 1px solid #A7F3D0;}
.status-rented { background: #EFF6FF; color: var(--primary); border: 1px solid #BFDBFE;}
.status-workshop { background: #FEF2F2; color: var(--danger); border: 1px solid #FECACA;}

.action-group { display: flex; gap: 4px; background: rgba(241, 245, 249, 0.7); padding: 4px; border-radius: 8px; width: fit-content; backdrop-filter: blur(4px);}
.btn-icon { background: transparent; border: none; cursor: pointer; color: var(--text-muted); transition: all 0.2s; padding: 6px; border-radius: 6px; display: flex; align-items: center; justify-content: center;}
.btn-icon:hover { background: #FFF; color: var(--text-dark); box-shadow: 0 2px 5px rgba(0,0,0,0.05); transform: translateY(-1px); }
.btn-icon:active { transform: scale(0.9); }
.btn-icon.view:hover { color: var(--primary); }
.btn-icon.edit:hover { color: #D97706; }
.btn-icon.delete:hover { color: var(--danger); background: #FEE2E2;}

.custom-select { padding: 10px 14px; border-radius: 10px; border: 1px solid rgba(226, 232, 240, 0.8); font-size: 13px; font-weight: 600; outline: none; cursor: pointer; background: rgba(248, 250, 252, 0.8); width: 100%; transition: 0.2s; color: var(--text-dark);}
.custom-select:focus { border-color: var(--primary); background: #FFF; box-shadow: 0 0 0 3px var(--primary-light); transform: translateY(-1px);}

.fab-container { position: fixed; bottom: 30px; right: 30px; z-index: 1500; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.fab-menu { display: none; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.fab-menu.active { display: flex; animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.fab-item { background: var(--card-bg); backdrop-filter: blur(10px); padding: 12px 20px; border-radius: 30px; border: 1px solid var(--border-color); color: var(--text-dark); font-weight: 700; font-size: 13px; cursor: pointer; display: flex; align-items: center; gap: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); transition: all 0.2s; text-decoration: none;}
.fab-item:hover { transform: translateX(-5px); background: #FFF; color: var(--primary); }
.fab-main { width: 56px; height: 56px; background: var(--primary); color: white; border-radius: 50%; display: flex; justify-content: center; align-items: center; cursor: pointer; box-shadow: 0 10px 25px rgba(59, 130, 246, 0.5); transition: all 0.3s; border: none; }
.fab-main:hover { transform: scale(1.05) rotate(90deg); background: var(--primary-hover); }
.fab-main:active { transform: scale(0.95); }

.action-board { display: flex; flex-direction: column; gap: 16px; width: 100%; }
.action-item { display: flex; gap: 14px; padding: 18px; border-radius: 16px; border: 1px solid var(--border-color); transition: all 0.3s; background: rgba(255,255,255,0.7); backdrop-filter: blur(10px); cursor: pointer;}
.action-item:hover { transform: translateX(-5px); box-shadow: 0 10px 20px -5px rgba(0,0,0,0.05); background: #FFF; }

.alert-danger { background: rgba(254, 242, 242, 0.7); border-color: rgba(254, 202, 202, 0.6); }
.alert-danger .action-icon { background: #FEE2E2; color: var(--danger); }
.alert-warning { background: rgba(255, 251, 235, 0.7); border-color: rgba(253, 230, 138, 0.6); }
.alert-warning .action-icon { background: #FEF3C7; color: #D97706; }

.action-icon { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.action-content h5 { font-size: 13px; margin-bottom: 4px; color: var(--text-dark); font-weight: 800;}
.action-content p { font-size: 12px; color: var(--text-muted); line-height: 1.4; margin-bottom: 0; font-weight: 500;}

.modal-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(15, 23, 42, 0.3); z-index: 2000; align-items: center; justify-content: center; padding: 20px; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); transition: opacity 0.3s ease; }
.modal-overlay.active { display: flex; }
.modal-content { background: rgba(255,255,255,0.95); border-radius: 24px; padding: 32px; width: 100%; max-width: 650px; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.2); max-height: 90vh; overflow-y: auto; border: 1px solid rgba(255,255,255,0.5); opacity: 0; }
.modal-overlay.active .modal-content { animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }

.modal-actions { display: flex; gap: 12px; margin-top: 32px; }
.btn-secondary { width: 100%; padding: 12px; background: rgba(241, 245, 249, 0.8); color: var(--text-dark); border: 1px solid rgba(226, 232, 240, 0.8); border-radius: 12px; font-size: 14px; font-weight: 700; cursor: pointer; transition: all 0.2s; }
.btn-secondary:hover { background: #E2E8F0; transform: translateY(-1px); }
.btn-secondary:active { transform: scale(0.96); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.report-section { margin-bottom: 20px; background: rgba(248, 250, 252, 0.5); padding: 16px; border-radius: 16px; border: 1px solid rgba(226, 232, 240, 0.6);}
.report-section h4 { color: var(--text-dark); font-size: 12px; text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 12px; display: flex; align-items: center; gap: 6px;}
.report-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px;}
.report-item { display: flex; flex-direction: column; gap: 4px; }
.report-label { font-size: 11px; color: var(--text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;}
.report-value { font-size: 14px; color: var(--text-dark); font-weight: 700;}

/* ==========================================
   PROFI-DRUCKSTYLING (KEINE UI-LEAKS)
   ========================================== */
/* ==========================================
   PROFI-DRUCKSTYLING (KEINE UI-LEAKS)
   ========================================== */
@media print {
  html, body {
    background: #ffffff !important;
    background-image: none !important;
    color: #000000 !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  
  /* Blendet die gesamte App-Oberfläche aus */
  #appWrapper, .fab-container, .modal-actions, .no-print, header, nav {
    display: none !important;
  }

  /* Modal-Overlays rigoros ausblenden, wenn Rechnung ODER Angebot gedruckt wird */
  body.is-printing-invoice .modal-overlay,
  body.is-printing-offer .modal-overlay {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
  }
  
  /* Aktiviert das reine DIN-A4 Rechnungs-Druckblatt */
  body.is-printing-invoice #printInvoiceContainer {
    display: block !important;
    position: relative !important;
    width: 100% !important;
    background: #ffffff !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  /* Aktiviert das reine DIN-A4 Angebots-Druckblatt */
  body.is-printing-offer #printOfferContainer {
    display: block !important;
    position: relative !important;
    width: 100% !important;
    background: #ffffff !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  
  /* Für den Fall, dass parallel Maschinen- oder Projektakten gedruckt werden */
  body:not(.is-printing-invoice):not(.is-printing-offer) .modal-overlay.active {
    display: block !important;
    position: absolute !important;
    left: 0;
    top: 0;
    width: 100% !important;
    background: #ffffff !important;
    backdrop-filter: none !important;
    box-shadow: none !important;
  }
  body:not(.is-printing-invoice):not(.is-printing-offer) .modal-overlay.active .modal-content {
    max-width: 100% !important;
    width: 100% !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
  }
}

@media (max-width: 768px) { 
  header { flex-wrap: wrap; height: auto; padding: 16px 5% 0 5%; }
  .logo-container { flex: 1; }
  .top-nav { width: 100%; order: 3; justify-content: flex-start; padding-bottom: 12px; margin-top: 8px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); } 
  .content-grid { grid-template-columns: 1fr; } 
  .form-grid, .report-grid { grid-template-columns: 1fr; } 
  .welcome-widget { flex-direction: column; align-items: flex-start; gap: 16px; padding: 24px; }
}