* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #070614;
  --bg2: #0f0e1f;
  --bg3: #1a1830;
  --accent: #00b1e6;
  --accent2: #0090c0;
  --text: #e2e8f0;
  --text2: #94a3b8;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius: 12px;
  --nav-height: 70px;
  --header-height: 56px;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

/* Login */
.login-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}
.login-logo { width: 120px; margin-bottom: 16px; }
.login-container h1 { color: var(--accent); margin-bottom: 32px; font-size: 24px; }
.login-container form { width: 100%; max-width: 340px; }

/* Header */
.app-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--header-height);
  background: rgba(7,6,20,0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0,177,230,0.15);
  display: flex; align-items: center; padding: 0 16px; gap: 10px;
}
.header-logo { height: 32px; }
.header-title { font-weight: 700; font-size: 16px; color: var(--accent); }

/* Content */
.content {
  padding: calc(var(--header-height) + 12px) 16px calc(var(--nav-height) + 16px);
  max-width: 800px;
  margin: 0 auto;
  min-height: 100vh;
}

/* Bottom Nav */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-height);
  background: rgba(7,6,20,0.97);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(0,177,230,0.15);
  display: flex; justify-content: space-around; align-items: center;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.nav-btn {
  background: none; border: none; color: var(--text2);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  font-size: 10px; padding: 8px 16px; cursor: pointer;
  transition: color 0.2s;
}
.nav-btn i { font-size: 20px; }
.nav-btn.active { color: var(--accent); }

/* Forms */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; color: var(--text2); margin-bottom: 4px; font-weight: 500; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 12px 14px; border-radius: var(--radius);
  background: var(--bg3); border: 1px solid rgba(255,255,255,0.08);
  color: var(--text); font-size: 15px; font-family: inherit;
  transition: border-color 0.2s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--accent);
}
.form-group textarea { min-height: 80px; resize: vertical; }
.form-group select { appearance: none; cursor: pointer; }

/* Buttons */
.btn {
  padding: 12px 24px; border-radius: var(--radius); border: none;
  font-size: 15px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: all 0.2s; font-family: inherit;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:active { background: var(--accent2); transform: scale(0.98); }
.btn-secondary { background: var(--bg3); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-full { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn i { font-size: 14px; }

.btn-fab {
  position: fixed; bottom: calc(var(--nav-height) + 16px); right: 16px;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--accent); color: #fff; border: none;
  font-size: 24px; cursor: pointer; box-shadow: 0 4px 20px rgba(0,177,230,0.4);
  z-index: 50; display: flex; align-items: center; justify-content: center;
  transition: transform 0.2s;
}
.btn-fab:active { transform: scale(0.9); }

/* Cards */
.card {
  background: var(--bg2); border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.06);
  padding: 16px; margin-bottom: 12px;
}
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.card h3 { font-size: 16px; font-weight: 600; }
.card-meta { font-size: 13px; color: var(--text2); }

/* Status Badges */
.status-badge {
  padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 600;
  display: inline-block;
}
.status-unterschrieben { background: rgba(0,177,230,0.15); color: #00b1e6; }
.status-geplant { background: rgba(245,158,11,0.15); color: #f59e0b; }
.status-in-montage { background: rgba(168,85,247,0.15); color: #a855f7; }
.status-abnahme { background: rgba(34,197,94,0.15); color: #22c55e; }
.status-fertig { background: rgba(34,197,94,0.3); color: #22c55e; }

/* Dashboard Stats */
.stats-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--bg2); border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.06);
  padding: 16px; text-align: center;
}
.stat-card .stat-number { font-size: 28px; font-weight: 800; color: var(--accent); }
.stat-card .stat-label { font-size: 12px; color: var(--text2); margin-top: 4px; }
.stat-card.wide { grid-column: span 2; }

/* Search */
.search-bar {
  position: relative; margin-bottom: 16px;
}
.search-bar input {
  width: 100%; padding: 12px 14px 12px 42px; border-radius: var(--radius);
  background: var(--bg2); border: 1px solid rgba(255,255,255,0.08);
  color: var(--text); font-size: 15px;
}
.search-bar input:focus { outline: none; border-color: var(--accent); }
.search-bar i {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--text2); font-size: 16px;
}

/* List */
.customer-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; background: var(--bg2); border-radius: var(--radius);
  margin-bottom: 8px; cursor: pointer; border: 1px solid rgba(255,255,255,0.06);
  transition: border-color 0.2s;
}
.customer-item:active { border-color: var(--accent); }
.customer-item .info { flex: 1; min-width: 0; }
.customer-item .info h4 { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.customer-item .info p { font-size: 12px; color: var(--text2); margin-top: 2px; }
.customer-item .chevron { color: var(--text2); font-size: 14px; }

/* Calendar */
.calendar-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.calendar-header h2 { font-size: 18px; }
.calendar-nav { display: flex; gap: 8px; }
.calendar-nav button {
  background: var(--bg3); border: none; color: var(--text);
  width: 36px; height: 36px; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.calendar-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px;
  margin-bottom: 20px;
}
.calendar-grid .day-header {
  text-align: center; font-size: 11px; color: var(--text2);
  padding: 8px 0; font-weight: 600;
}
.calendar-grid .day-cell {
  text-align: center; padding: 8px 4px; border-radius: 8px;
  font-size: 14px; cursor: pointer; min-height: 40px;
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.calendar-grid .day-cell.other { color: var(--text2); opacity: 0.3; }
.calendar-grid .day-cell.today { background: var(--accent); color: #fff; font-weight: 700; }
.calendar-grid .day-cell.has-events::after {
  content: ''; position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%);
  width: 5px; height: 5px; border-radius: 50%; background: var(--accent);
}
.calendar-grid .day-cell.today.has-events::after { background: #fff; }
.calendar-grid .day-cell.selected { border: 2px solid var(--accent); }

/* Appointments */
.appointment-item {
  padding: 12px 16px; background: var(--bg2); border-radius: var(--radius);
  margin-bottom: 8px; border-left: 3px solid var(--accent);
  border: 1px solid rgba(255,255,255,0.06);
}
.appointment-item .time { font-size: 13px; color: var(--accent); font-weight: 600; }
.appointment-item .title { font-size: 14px; margin-top: 2px; }
.appointment-item .meta { font-size: 12px; color: var(--text2); margin-top: 4px; }

/* Photo Gallery */
.photo-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px;
}
.photo-grid .photo-item {
  aspect-ratio: 1; border-radius: 8px; overflow: hidden; cursor: pointer;
  position: relative;
}
.photo-grid .photo-item img { width: 100%; height: 100%; object-fit: cover; }
.photo-grid .photo-item .photo-cat {
  position: absolute; bottom: 4px; left: 4px;
  background: rgba(0,0,0,0.7); padding: 2px 6px; border-radius: 4px;
  font-size: 9px; color: var(--text);
}

/* Lightbox */
.lightbox {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.95); z-index: 1000;
  display: flex; align-items: center; justify-content: center;
}
.lightbox img { max-width: 95vw; max-height: 90vh; object-fit: contain; }
.lightbox .close-btn {
  position: absolute; top: 16px; right: 16px;
  background: rgba(255,255,255,0.1); border: none; color: #fff;
  width: 40px; height: 40px; border-radius: 50%; font-size: 20px; cursor: pointer;
}

/* Signature Canvas */
.signature-pad {
  background: #fff; border-radius: var(--radius);
  touch-action: none; width: 100%; height: 150px;
  cursor: crosshair;
}
.signature-label {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px;
}
.signature-label button { font-size: 12px; }

/* Checklist */
.checklist-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,0.05);
}
.checklist-item label { flex: 1; font-size: 14px; cursor: pointer; }
.checklist-item input[type="checkbox"] {
  width: 22px; height: 22px; accent-color: var(--accent); cursor: pointer;
}

/* Modal */
.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7); z-index: 200;
  display: flex; align-items: flex-end; justify-content: center;
}
.modal {
  background: var(--bg2); border-radius: 20px 20px 0 0;
  width: 100%; max-width: 500px; max-height: 90vh;
  overflow-y: auto; padding: 24px 20px;
  animation: slideUp 0.3s ease;
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal-header h2 { font-size: 18px; }
.modal-close { background: none; border: none; color: var(--text2); font-size: 24px; cursor: pointer; padding: 4px; }

/* Section Headers */
.section-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px; margin-top: 20px;
}
.section-header h2 { font-size: 18px; font-weight: 700; }
.section-header:first-child { margin-top: 0; }

/* Page Title */
.page-title {
  font-size: 22px; font-weight: 800; margin-bottom: 16px;
}

/* Tabs */
.tabs {
  display: flex; gap: 8px; margin-bottom: 16px; overflow-x: auto;
  -webkit-overflow-scrolling: touch; padding-bottom: 4px;
}
.tab {
  padding: 8px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
  white-space: nowrap; cursor: pointer; border: none;
  background: var(--bg3); color: var(--text2);
  transition: all 0.2s;
}
.tab.active { background: var(--accent); color: #fff; }

/* Back Button */
.back-btn {
  background: none; border: none; color: var(--accent); font-size: 14px;
  cursor: pointer; display: flex; align-items: center; gap: 6px;
  margin-bottom: 16px; padding: 4px 0; font-family: inherit; font-weight: 500;
}

/* Error */
.error-msg { color: var(--danger); font-size: 13px; margin-top: 8px; text-align: center; }
.success-msg { color: var(--success); font-size: 13px; margin-top: 8px; text-align: center; }

/* Empty State */
.empty-state {
  text-align: center; padding: 40px 20px; color: var(--text2);
}
.empty-state i { font-size: 48px; margin-bottom: 12px; opacity: 0.3; }
.empty-state p { font-size: 14px; }

/* Responsive tweaks */
@media (min-width: 600px) {
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
  .photo-grid { grid-template-columns: repeat(4, 1fr); }
}

/* Detail Tabs */
.detail-tabs {
  display: flex; gap: 0; margin-bottom: 16px;
  border-bottom: 2px solid var(--bg3);
}
.detail-tab {
  flex: 1; text-align: center; padding: 10px 8px; font-size: 12px; font-weight: 600;
  cursor: pointer; border: none; background: none; color: var(--text2);
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: all 0.2s;
}
.detail-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.detail-tab i { display: block; font-size: 18px; margin-bottom: 4px; }

/* Actions row */
.actions-row {
  display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap;
}

/* Filter row */
.filter-row {
  display: flex; gap: 8px; margin-bottom: 12px; overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Toast */
.toast {
  position: fixed; bottom: calc(var(--nav-height) + 16px); left: 50%; transform: translateX(-50%);
  background: var(--accent); color: #fff; padding: 12px 24px; border-radius: var(--radius);
  font-size: 14px; font-weight: 500; z-index: 300; opacity: 0;
  transition: opacity 0.3s; pointer-events: none;
}
.toast.show { opacity: 1; }

/* Upload */
.upload-area {
  border: 2px dashed rgba(0,177,230,0.3); border-radius: var(--radius);
  padding: 24px; text-align: center; cursor: pointer;
  transition: border-color 0.2s;
}
.upload-area:active { border-color: var(--accent); }
.upload-area i { font-size: 32px; color: var(--accent); margin-bottom: 8px; }
.upload-area p { font-size: 13px; color: var(--text2); }

/* Scrollbar */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg3); border-radius: 4px; }
