/* =============================================
   Susi's Alltagshilfe - PWA Stylesheet
   Mobile-First, Touch-optimiert, Pink/Magenta Theme
   ============================================= */

/* --- CSS Custom Properties --- */
:root {
  --primary: #E91E7B;
  --primary-dark: #C2185B;
  --primary-light: #F48FB1;
  --primary-bg: #FDE4EF;
  --white: #ffffff;
  --gray-50: #FAFAFA;
  --gray-100: #F5F5F5;
  --gray-200: #EEEEEE;
  --gray-300: #E0E0E0;
  --gray-400: #BDBDBD;
  --gray-500: #9E9E9E;
  --gray-600: #757575;
  --gray-700: #616161;
  --gray-800: #424242;
  --gray-900: #212121;
  --success: #4CAF50;
  --success-bg: #E8F5E9;
  --warning: #FF9800;
  --warning-bg: #FFF3E0;
  --danger: #F44336;
  --danger-bg: #FFEBEE;
  --info: #2196F3;
  --info-bg: #E3F2FD;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.12);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.15);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --transition: all 0.2s ease;
  --font-stack: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-stack);
  color: var(--gray-900);
  background-color: var(--gray-50);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  padding-bottom: 80px; /* Platz für Bottom-Nav */
  -webkit-tap-highlight-color: transparent;
}

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

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

/* --- Header / App Bar --- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--white);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-md);
  min-height: 56px;
}

.app-header .back-btn {
  background: none;
  border: none;
  color: var(--white);
  font-size: 24px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
}

.app-header .back-btn:active {
  background: rgba(255,255,255,0.2);
}

.app-header h1 {
  font-size: 1.2rem;
  font-weight: 600;
  flex: 1;
}

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

.app-header .header-actions button {
  background: rgba(255,255,255,0.2);
  border: none;
  color: var(--white);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: var(--transition);
}

.app-header .header-actions button:active {
  background: rgba(255,255,255,0.4);
}

/* --- Sync Status --- */
.sync-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(255,255,255,0.2);
}

.sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
}

.sync-dot.offline {
  background: var(--warning);
  animation: pulse 1.5s ease-in-out infinite;
}

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

/* --- Bottom Navigation --- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--white);
  display: flex;
  justify-content: space-around;
  padding: 4px 0;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
  border-top: 1px solid var(--gray-200);
}

.bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 12px;
  font-size: 0.68rem;
  color: var(--gray-500);
  text-decoration: none;
  transition: var(--transition);
  border-radius: var(--radius-sm);
  min-width: 56px;
}

.bottom-nav a.active {
  color: var(--primary);
}

.bottom-nav a .nav-icon {
  font-size: 22px;
  line-height: 1;
}

.bottom-nav a:active {
  background: var(--primary-bg);
}

/* --- Container / Layout --- */
.container {
  max-width: 1024px;
  margin: 0 auto;
  padding: 16px;
}

.page-content {
  padding: 16px;
  padding-bottom: 80px;
  max-width: 1024px;
  margin: 0 auto;
}

/* --- Cards --- */
.card {
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 16px;
  margin-bottom: 12px;
  transition: var(--transition);
}

.card:active {
  box-shadow: var(--shadow-md);
}

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

.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-800);
}

.card-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.card-icon.pink {
  background: var(--primary-bg);
  color: var(--primary);
}

.card-icon.green {
  background: var(--success-bg);
  color: var(--success);
}

.card-icon.blue {
  background: var(--info-bg);
  color: var(--info);
}

.card-icon.orange {
  background: var(--warning-bg);
  color: var(--warning);
}

/* --- Dashboard Grid --- */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.dash-card {
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 20px 16px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.dash-card:active {
  transform: scale(0.97);
  box-shadow: var(--shadow-md);
}

.dash-card .dash-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  background: var(--primary-bg);
  color: var(--primary);
}

.dash-card .dash-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-700);
}

.dash-card .dash-count {
  font-size: 0.75rem;
  color: var(--gray-500);
}

/* --- Sections --- */
.section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-800);
  margin: 20px 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title .icon {
  color: var(--primary);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  touch-action: manipulation;
  min-height: 48px;
}

.btn:active {
  transform: scale(0.97);
}

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

.btn-primary:active {
  background: var(--primary-dark);
}

.btn-secondary {
  background: var(--gray-200);
  color: var(--gray-800);
}

.btn-secondary:active {
  background: var(--gray-300);
}

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

.btn-outline:active {
  background: var(--primary-bg);
}

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

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

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

.btn-lg {
  padding: 16px 32px;
  font-size: 1.1rem;
  min-height: 56px;
}

.btn-block {
  display: flex;
  width: 100%;
}

.btn-fab {
  position: fixed;
  bottom: 88px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--white);
  border: none;
  box-shadow: var(--shadow-lg);
  font-size: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  transition: var(--transition);
}

.btn-fab:active {
  transform: scale(0.9);
  background: var(--primary-dark);
}

.btn-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

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

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 12px 14px;
  font-size: 1rem;
  font-family: inherit;
  border: 2px solid var(--gray-300);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--gray-900);
  transition: var(--transition);
  min-height: 48px;
  -webkit-appearance: none;
  appearance: none;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(233, 30, 123, 0.15);
}

.form-control::placeholder {
  color: var(--gray-400);
}

select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23757575' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

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

.form-check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  cursor: pointer;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
  width: 22px;
  height: 22px;
  accent-color: var(--primary);
  cursor: pointer;
}

.form-check label {
  font-size: 0.95rem;
  cursor: pointer;
  margin-bottom: 0;
}

.form-hint {
  font-size: 0.78rem;
  color: var(--gray-500);
  margin-top: 4px;
}

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

/* --- Search Bar --- */
.search-bar {
  position: relative;
  margin-bottom: 16px;
}

.search-bar input {
  width: 100%;
  padding: 12px 14px 12px 44px;
  font-size: 1rem;
  border: 2px solid var(--gray-200);
  border-radius: 25px;
  background: var(--white);
  transition: var(--transition);
  min-height: 48px;
}

.search-bar input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.search-bar .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  color: var(--gray-400);
}

/* --- Lists --- */
.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin-bottom: 8px;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  color: inherit;
}

.list-item:active {
  background: var(--gray-50);
  transform: scale(0.99);
}

.list-item .item-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary-bg);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}

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

.list-item .item-title {
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-item .item-subtitle {
  font-size: 0.8rem;
  color: var(--gray-500);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-item .item-action {
  color: var(--gray-400);
  font-size: 20px;
  flex-shrink: 0;
}

/* --- Badges / Tags --- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 20px;
}

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

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

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

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

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

/* --- Signature Pad --- */
.signature-wrapper {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius-md);
  background: var(--white);
  position: relative;
  margin: 12px 0;
}

.signature-wrapper canvas {
  width: 100%;
  height: 200px;
  display: block;
  border-radius: var(--radius-md);
  touch-action: none;
}

.signature-wrapper .sig-placeholder {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--gray-400);
  font-size: 0.9rem;
  pointer-events: none;
}

.signature-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

/* --- Modal --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.2s ease;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 500px;
  max-height: 85vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
}

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

.modal-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--gray-500);
  cursor: pointer;
  padding: 4px;
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 16px 20px;
  border-top: 1px solid var(--gray-200);
}

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

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

/* --- Tabs --- */
.tabs {
  display: flex;
  background: var(--white);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tab {
  flex: 1;
  padding: 12px 16px;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-500);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  transition: var(--transition);
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  min-height: 44px;
}

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

.tab:active {
  background: var(--primary-bg);
}

/* --- Calendar / Termine --- */
.week-header {
  display: grid;
  grid-template-columns: 60px repeat(5, 1fr);
  gap: 1px;
  background: var(--gray-200);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  overflow: hidden;
}

.week-header > div {
  background: var(--primary);
  color: var(--white);
  padding: 10px 4px;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 600;
}

.week-grid {
  display: grid;
  grid-template-columns: 60px repeat(5, 1fr);
  gap: 1px;
  background: var(--gray-200);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  overflow: hidden;
}

.time-slot {
  background: var(--white);
  padding: 8px 4px;
  font-size: 0.72rem;
  color: var(--gray-500);
  text-align: center;
  min-height: 50px;
}

.calendar-event {
  background: var(--primary-bg);
  border-left: 3px solid var(--primary);
  padding: 6px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  margin: 2px;
  cursor: pointer;
}

.calendar-event .event-title {
  font-weight: 600;
  color: var(--gray-800);
}

.calendar-event .event-time {
  color: var(--gray-600);
}

/* --- Map --- */
.map-container {
  height: 300px;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
  position: relative;
}

.map-container #map,
.map-container #routeMap {
  height: 100%;
  width: 100%;
}

.border-primary {
  border: 2px solid var(--primary) !important;
}

/* --- Tables --- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.data-table th {
  background: var(--primary);
  color: var(--white);
  padding: 10px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  text-align: left;
}

.data-table td {
  padding: 10px 12px;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--gray-200);
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:nth-child(even) {
  background: var(--gray-50);
}

.data-table .text-right {
  text-align: right;
}

.data-table .total-row {
  font-weight: 700;
  background: var(--primary-bg) !important;
}

/* --- Status Indicators --- */
.status-sent { color: var(--info); }
.status-received { color: var(--warning); }
.status-paid { color: var(--success); }
.status-open { color: var(--gray-500); }

/* --- Toast Notifications --- */
.toast-container {
  position: fixed;
  top: 70px;
  right: 16px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem;
  animation: slideInRight 0.3s ease;
  min-width: 250px;
  max-width: 350px;
}

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

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

.toast.info {
  background: var(--info);
  color: var(--white);
}

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

/* --- Empty State --- */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--gray-500);
}

.empty-state .empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.5;
}

.empty-state p {
  font-size: 0.95rem;
  margin-bottom: 16px;
}

/* --- Loading --- */
.loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

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

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

/* --- Utility Classes --- */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-primary { color: var(--primary); }
.text-muted { color: var(--gray-500); }
.text-sm { font-size: 0.85rem; }
.text-xs { font-size: 0.75rem; }
.fw-bold { font-weight: 700; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.hidden { display: none !important; }
.w-100 { width: 100%; }

/* --- Responsive (Tablet Landscape) --- */
@media (min-width: 768px) {
  .dashboard-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .form-row {
    grid-template-columns: 1fr 1fr;
  }

  .page-content {
    padding: 20px 24px;
  }

  .map-container {
    height: 400px;
  }

  .modal {
    max-width: 600px;
  }

  .bottom-nav a {
    font-size: 0.75rem;
    min-width: 72px;
  }
}

@media (min-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
  }

  .page-content {
    padding: 24px 32px;
  }
}

/* --- Print --- */
@media print {
  .app-header, .bottom-nav, .btn-fab, .toast-container {
    display: none !important;
  }
  body {
    padding-bottom: 0;
  }
}

/* --- Chip-Checkboxen (Leistungsarten) --- */
.chip-check {
  display: inline-flex;
  cursor: pointer;
}
.chip-check input[type="checkbox"] {
  display: none;
}
.chip-check span {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 500;
  border: 2px solid var(--gray-300);
  background: var(--white);
  color: var(--gray-700);
  transition: var(--transition);
}
.chip-check input:checked + span {
  border-color: var(--primary);
  background: var(--primary-bg);
  color: var(--primary);
  font-weight: 600;
}

/* --- PDF-Vorschau Modal (Fullscreen) --- */
.pdf-vorschau-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 500;
  display: none;
  flex-direction: column;
}

.pdf-vorschau-overlay.active {
  display: flex;
}

.pdf-vorschau-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: var(--primary);
  color: white;
  flex-shrink: 0;
}

.pdf-vorschau-header h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0;
}

.pdf-vorschau-body {
  flex: 1;
  overflow: hidden;
  display: flex;
  padding: 0;
  min-height: 0;
}

.pdf-vorschau-body iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: white;
}

/* --- Dark Mode Preparation (future) --- */
@media (prefers-color-scheme: dark) {
  /* Placeholder for future dark mode */
}

/* Fahrtenbuch spezifisch */
.route-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.summary-item {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.summary-item .summary-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}

.summary-item .summary-label {
  font-size: 0.75rem;
  color: var(--gray-500);
  margin-top: 4px;
}

/* Rechnung Status Liste */
.status-timeline {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
}

.status-step {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--gray-300);
}

.status-step.active {
  background: var(--primary);
}

.status-step.complete {
  background: var(--success);
}

/* Week Navigator */
.week-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  margin-bottom: 12px;
}

.week-nav button {
  background: none;
  border: 2px solid var(--primary);
  color: var(--primary);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.week-nav button:active {
  background: var(--primary);
  color: var(--white);
}

.week-nav .week-label {
  font-weight: 600;
  color: var(--gray-700);
}

/* Abtretung Document Preview */
.doc-preview {
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  padding: 24px;
  margin: 16px 0;
  font-size: 0.9rem;
  line-height: 1.7;
}

.doc-preview .doc-header {
  text-align: center;
  margin-bottom: 24px;
}

.doc-preview .doc-header h2 {
  color: var(--primary);
  font-size: 1.1rem;
}

.doc-preview .doc-field {
  display: inline;
  border-bottom: 1px solid var(--gray-400);
  padding: 0 4px;
  min-width: 100px;
  font-weight: 600;
}

/* --- Google Calendar Sync Bar --- */
.gcal-sync-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 14px;
  margin-top: 12px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 12px;
}

.gcal-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
}

.gcal-icon {
  font-size: 0.7rem;
}

.gcal-label {
  color: var(--gray-700);
}

.gcal-actions {
  display: flex;
  gap: 6px;
}

.gcal-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--gray-300);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: gcal-spin 0.8s linear infinite;
  vertical-align: middle;
  margin-right: 4px;
}

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