/* ============================================
   KFZ-Ziegler Büro-Dashboard — Styles
   ============================================ */

:root {
  --primary: #00ad68;
  --primary-dark: #008c54;
  --primary-light: #e6f9f0;
  --text: #333333;
  --text-dark: #000000;
  --text-secondary: #929aa3;
  --bg: #f6f6f6;
  --card: #ffffff;
  --accent: #e5f2fa;
  --danger: #dc2626;
  --danger-light: #fef2f2;
  --warning: #f59e0b;
  --warning-light: #fffbeb;
  --success: #00ad68;
  --border: #e2e8f0;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar-width: 250px;
  --header-height: 56px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }

/* ─── LOGIN ─── */
#screen-login {
  display: none;
  min-height: 100vh;
  background: linear-gradient(135deg, #00ad68 0%, #008c54 50%, #006b40 100%);
  align-items: center;
  justify-content: center;
}
#screen-login.active { display: flex; }

.login-container { width: 100%; max-width: 400px; padding: 20px; }

.login-card {
  background: var(--card);
  border-radius: 16px;
  padding: 40px 32px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.login-logo {
  height: 60px;
  margin-bottom: 16px;
  object-fit: contain;
}

.login-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 4px;
}

.login-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 28px;
}

.error-text {
  color: var(--danger);
  font-size: 13px;
  margin-top: 12px;
}

/* ─── APP SHELL ─── */
#app-shell {
  display: flex;
  min-height: 100vh;
}

/* ─── SIDEBAR ─── */
#sidebar {
  width: var(--sidebar-width);
  background: var(--card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-header {
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo { height: 36px; object-fit: contain; }
.sidebar-title { font-size: 14px; font-weight: 600; color: var(--text-dark); }

.sidebar-nav {
  list-style: none;
  padding: 12px 8px;
  flex: 1;
}

.sidebar-nav li { margin-bottom: 2px; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s;
}

.nav-link:hover { background: var(--bg); }
.nav-link.active { background: var(--primary-light); color: var(--primary-dark); }
.nav-link.active svg { stroke: var(--primary); }

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

#sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 99;
}

/* ─── MOBILE HEADER ─── */
#mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 0 16px;
  align-items: center;
  gap: 12px;
  z-index: 50;
}

.mobile-logo { height: 28px; }
.mobile-title { font-size: 15px; font-weight: 600; }

/* ─── CONTENT ─── */
#content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 24px;
  max-width: 1400px;
}

.screen { display: none; }
.screen.active { display: block; }

.page-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.page-header h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-dark);
  flex: 1;
}

/* ─── SAVE INDICATOR ─── */
.save-indicator {
  font-size: 12px;
  color: var(--success);
  opacity: 0;
  transition: opacity 0.3s;
  display: flex;
  align-items: center;
  gap: 4px;
}
.save-indicator::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
}
.save-indicator.visible { opacity: 1; }

/* ─── BUTTONS ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }

.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }

.btn-warning { background: var(--warning); color: #fff; }
.btn-warning:hover { background: #d97706; }

.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; }

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--text);
  display: flex;
  align-items: center;
}

/* ─── FORM ELEMENTS ─── */
.form-group { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.form-group.full-width { flex-basis: 100%; }

.form-group label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font);
  color: var(--text);
  background: var(--card);
  transition: border-color 0.15s;
  width: 100%;
}

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

.form-group input[readonly] {
  background: var(--bg);
  color: var(--text-secondary);
}

.input-suffix {
  position: relative;
  display: flex;
  align-items: center;
}
.input-suffix input { padding-right: 50px; }
.input-suffix span {
  position: absolute;
  right: 12px;
  color: var(--text-secondary);
  font-size: 13px;
  pointer-events: none;
}

.form-row {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.form-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.form-section legend {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-dark);
  padding: 0 8px;
}

.form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
}

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

.radio-group {
  display: flex;
  gap: 16px;
  padding: 10px 0;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  cursor: pointer;
}

.radio-label input[type="radio"] {
  width: auto;
  accent-color: var(--primary);
}

/* ─── STATUS TOGGLE ─── */
.status-toggle {
  display: flex;
  gap: 8px;
  align-items: center;
}

.toggle-btn {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--warning-light);
  color: var(--warning);
  font-family: var(--font);
  transition: all 0.15s;
}

.toggle-btn[data-status="paid"] {
  background: var(--primary-light);
  color: var(--primary-dark);
  border-color: var(--primary);
}

/* ─── PAYMENT PROOFS ─── */
.proof-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  font-size: 13px;
}
.proof-link { color: var(--primary); text-decoration: none; flex: 1; font-weight: 500; }
.proof-link:hover { text-decoration: underline; }
.proof-date { font-size: 12px; color: var(--text-secondary); white-space: nowrap; }
.btn-remove-proof {
  background: none; border: none; cursor: pointer;
  color: var(--text-secondary); font-size: 16px; padding: 0 4px; line-height: 1;
}
.btn-remove-proof:hover { color: var(--danger); }

/* ─── PUBLIC LINK BOX ─── */
.public-link-box {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.public-link-input {
  flex: 1;
  background: var(--bg) !important;
  color: var(--text-secondary) !important;
  font-size: 13px;
  font-family: monospace;
  cursor: text !important;
}

/* ─── ADDITIONAL COSTS ─── */
.cost-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.cost-row input:first-child { flex: 2; }
.cost-row input:nth-child(2) { flex: 1; }

.cost-row .btn-remove-cost {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--danger);
  font-size: 18px;
  padding: 4px 8px;
  border-radius: 4px;
}
.cost-row .btn-remove-cost:hover { background: var(--danger-light); }

.costs-total {
  margin-top: 8px;
  font-size: 14px;
  color: var(--text-secondary);
  text-align: right;
}

/* ─── KPI CARDS ─── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.kpi-label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 8px;
}

.kpi-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-dark);
}

.kpi-warning { color: var(--warning); }

/* ─── CHARTS ─── */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.chart-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.chart-card h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 16px;
}

.chart-card-small { grid-column: span 2; max-width: 400px; }
.chart-card-wide { grid-column: 1 / -1; }

/* ─── ALERT SECTION (OVERDUE) ─── */
.alert-section {
  background: var(--danger-light);
  border: 1px solid #fecaca;
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
}

.alert-section-info {
  background: var(--accent);
  border-color: #93c5fd;
}

.alert-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--danger);
  margin-bottom: 12px;
}

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

.employee-outstanding-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: #fff;
  border-radius: 6px;
  margin-bottom: 6px;
}

.employee-outstanding-item:last-child { margin-bottom: 0; }

.employee-outstanding-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.employee-outstanding-name { font-weight: 600; font-size: 14px; }

.employee-outstanding-detail { font-size: 12px; color: var(--text-secondary); }

.employee-outstanding-amount { font-weight: 700; color: var(--primary); font-size: 15px; }

.overdue-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--card);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  border: 1px solid #fecaca;
}

.overdue-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.overdue-item-title { font-size: 14px; font-weight: 500; }
.overdue-item-detail { font-size: 12px; color: var(--text-secondary); }
.overdue-item-amount { font-size: 16px; font-weight: 600; color: var(--danger); margin-right: 12px; }

/* ─── RECENT SECTION ─── */
/* ─── WERKSTATT RADAR ─── */
.radar-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}
.radar-section h3 {
  font-size: 15px; font-weight: 600; margin-bottom: 14px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.radar-legend {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; font-weight: 400; color: var(--text-secondary);
}
.radar-dot {
  display: inline-block; width: 10px; height: 10px;
  border-radius: 50%; flex-shrink: 0;
}
.radar-green  { background: #22c55e; }
.radar-yellow { background: #f59e0b; }
.radar-red    { background: #ef4444; }
.radar-none   { background: #cbd5e1; }

.radar-item {
  display: grid;
  grid-template-columns: 14px 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background .12s;
}
.radar-item:last-child { border-bottom: none; }
.radar-item:hover { background: var(--bg); }

.radar-name { font-size: 14px; font-weight: 500; }
.radar-last { font-size: 12px; color: var(--text-secondary); white-space: nowrap; }

.radar-stats { display: flex; gap: 20px; justify-content: flex-end; }
.radar-stat {
  display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 36px;
}
.radar-stat strong { font-size: 15px; font-weight: 700; color: var(--text-dark); line-height: 1; }
.radar-stat small  { font-size: 10px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .3px; }
.radar-stat-empty  { font-size: 12px; color: var(--text-secondary); font-style: italic; }

@media (max-width: 640px) {
  .radar-item { grid-template-columns: 14px 1fr; }
  .radar-last, .radar-stats { grid-column: 2; }
  .radar-stats { justify-content: flex-start; margin-top: 2px; }
}

.recent-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.recent-section h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 12px;
}

.recent-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.1s;
}

.recent-item:last-child { border-bottom: none; }
.recent-item:hover { background: var(--bg); margin: 0 -12px; padding: 10px 12px; border-radius: var(--radius-sm); }

.recent-item-left { display: flex; flex-direction: column; gap: 2px; }
.recent-item-title { font-size: 14px; font-weight: 500; }
.recent-item-sub { font-size: 12px; color: var(--text-secondary); }
.recent-item-amount { font-size: 15px; font-weight: 600; color: var(--text-dark); }

/* ─── DATA TABLE ─── */
.filter-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.filter-select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: var(--font);
  background: var(--card);
  color: var(--text);
  min-width: 140px;
}

.table-wrapper {
  overflow-x: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

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

.data-table th {
  background: var(--bg);
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid var(--border);
}

.data-table th:hover { color: var(--text-dark); }

.data-table td {
  padding: 12px 16px;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr { cursor: pointer; transition: background 0.1s; }
.data-table tbody tr:hover { background: var(--bg); }

/* Beschreibung abschneiden bei zu langer Schrift */
#appraisals-table td:first-child {
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Status Dots */
.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.status-dot::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot.paid::before { background: var(--success); }
.status-dot.open::before { background: var(--warning); }
.status-dot.overdue::before { background: var(--danger); animation: pulse 1.5s infinite; }

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

/* ─── WORKSHOP CARDS ─── */
.workshops-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.workshop-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all 0.15s;
}

.workshop-card:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.workshop-card-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 4px;
}

.workshop-card-address {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.workshop-card-details {
  display: flex;
  gap: 16px;
  font-size: 13px;
}

.workshop-card-detail {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.workshop-card-detail-label { color: var(--text-secondary); font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; }
.workshop-card-detail-value { font-weight: 600; color: var(--text-dark); }

/* ─── EMPTY STATE ─── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

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

/* ─── MODAL ─── */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.modal-content {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 420px;
  width: 90%;
  box-shadow: var(--shadow-lg);
}

.modal-content h3 { font-size: 18px; margin-bottom: 8px; }
.modal-content p { font-size: 14px; color: var(--text-secondary); margin-bottom: 20px; }

.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* ─── TOAST ─── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--text-dark);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  z-index: 300;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.3s ease;
}

.toast.toast-success { background: var(--primary-dark); }
.toast.toast-error { background: var(--danger); }

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

/* ─── REMINDERS LOG ─── */
.reminder-entry {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.reminder-entry:last-child { border-bottom: none; }

.reminder-date { color: var(--text-secondary); min-width: 120px; }
.reminder-type { font-weight: 500; }
.reminder-email { color: var(--text-secondary); }

/* ─── PROVISION INFO ─── */
.provision-info {
  font-weight: 400;
  font-size: 12px;
  color: var(--text-secondary);
}

/* ─── RESPONSIVE ─── */
@media (max-width: 1024px) {
  #sidebar {
    transform: translateX(-100%);
  }
  #sidebar.open {
    transform: translateX(0);
  }
  #sidebar-overlay.open {
    display: block;
  }
  #mobile-header {
    display: flex;
  }
  #content {
    margin-left: 0;
    padding-top: calc(var(--header-height) + 16px);
  }
}

@media (max-width: 768px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .charts-grid { grid-template-columns: 1fr; }
  .chart-card-small { grid-column: span 1; max-width: none; }
  .form-row { flex-direction: column; }
  .filter-bar { flex-direction: column; }
  .filter-select { min-width: 100%; }
  .workshops-grid { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; }

  .data-table th,
  .data-table td { padding: 10px 8px; font-size: 12px; }
}

@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr; }
  #content { padding: 12px; padding-top: calc(var(--header-height) + 8px); }
  .kpi-value { font-size: 22px; }
  .login-card { padding: 28px 20px; }
}

/* ─── DETAIL FORM ─── */
.detail-form {
  max-width: 900px;
}

/* ─── READONLY BASISDATEN SECTION ─── */
.form-section-readonly {
  background: #f1f5f9;
  border-color: #cbd5e1;
  position: relative;
}

.form-section-readonly legend {
  color: var(--text-secondary);
}

.form-section-readonly input,
.form-section-readonly select,
.form-section-readonly textarea {
  background: #e8edf2 !important;
  color: var(--text-secondary) !important;
  cursor: not-allowed !important;
  pointer-events: none;
}

/* Beschreibung bleibt immer editierbar */
.form-section-readonly #ap-description {
  background: #fff !important;
  color: var(--text-dark) !important;
  cursor: text !important;
  pointer-events: auto;
}

.readonly-hint {
  font-size: 12px;
  font-weight: 400;
  color: var(--warning);
}

/* ─── PASSWORT-VERGESSEN PANEL ─── */
#forgot-panel input {
  margin-bottom: 0;
}

/* ─── EMPLOYEE CARD ─── */
.employee-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all 0.15s;
}

.employee-card:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.employee-card-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 4px;
}

.employee-card-address {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.employee-card-details {
  display: flex;
  gap: 16px;
  font-size: 13px;
  flex-wrap: wrap;
}

.employee-card-detail {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.employee-card-detail-label {
  color: var(--text-secondary);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.employee-card-detail-value {
  font-weight: 600;
  color: var(--text-dark);
}


/* ─── WORKSHOP OVERRIDE LIST ─── */
.workshop-override-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  font-size: 13px;
}

.workshop-override-name { flex: 1; font-weight: 500; }
.workshop-override-rate { color: var(--primary-dark); font-weight: 600; }

/* ─── TYPE CHOOSER MODAL ─── */
.type-chooser-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.type-chooser-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 36px 32px 28px;
  box-shadow: 0 8px 40px rgba(0,0,0,.18);
  max-width: 480px;
  width: 90%;
  text-align: center;
}

.type-chooser-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--text-dark);
}

.type-chooser-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 8px;
}

.type-chooser-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 24px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  cursor: pointer;
  transition: all 0.15s;
  color: var(--text-dark);
}

.type-chooser-btn:hover {
  border-color: var(--primary);
  background: #f0fdf7;
  box-shadow: 0 0 0 3px rgba(0,173,104,.12);
}

.type-chooser-btn svg {
  color: var(--primary);
}

.type-chooser-label {
  font-size: 14px;
  font-weight: 700;
}

.type-chooser-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* ─── STAFF SECTION HEADERS ─── */
.staff-section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.staff-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  padding: 5px 14px;
  border-radius: 20px;
}

.badge-sales {
  background: #e0f2fe;
  color: #0369a1;
}

.badge-appraiser {
  background: #dcfce7;
  color: #15803d;
}

.staff-empty-note {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 8px 0;
}

/* ─── APPRAISAL IMAGE GALLERY ─── */
.images-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
  margin-top: 8px;
}

.image-item {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg);
  text-align: center;
  padding-bottom: 8px;
}

.image-thumb {
  width: 100%;
  height: 90px;
  object-fit: cover;
  display: block;
}

.image-name {
  font-size: 11px;
  color: var(--text-secondary);
  padding: 4px 6px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.image-item .btn-remove-proof {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(0,0,0,.45);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 14px;
  line-height: 18px;
  cursor: pointer;
  padding: 0;
}


/* ══════════════════════════════════════════
   MOBILE OPTIMIERUNGEN (max-width: 768px)
   Desktop-Layout bleibt unverändert
   ══════════════════════════════════════════ */

@media (max-width: 768px) {

  /* ─── Tabellen: Touch-Scroll + Mindestbreite ─── */
  .table-wrapper {
    -webkit-overflow-scrolling: touch;
    margin: 0 -4px;
    padding: 0 4px;
  }
  .data-table { min-width: 620px; }

  /* ─── Detail-Form: volle Breite ─── */
  .detail-form { max-width: 100%; }

  /* ─── Fieldsets: weniger Padding ─── */
  fieldset.form-section {
    padding: 16px 14px;
  }

  /* ─── Form-Actions: Stack + volle Breite ─── */
  .form-actions {
    flex-direction: column-reverse;
    gap: 10px;
    padding: 16px 0 8px;
  }
  .form-actions-right {
    flex-direction: column;
    width: 100%;
    gap: 8px;
  }
  .form-actions-right .btn,
  .form-actions > .btn {
    width: 100%;
    justify-content: center;
  }

  /* ─── Seiten-Header: Button volle Breite ─── */
  .page-header .btn { width: 100%; text-align: center; justify-content: center; }
  .page-header { gap: 12px; }

  /* ─── Status-Toggle: umbrechen ─── */
  .status-toggle { flex-wrap: wrap; gap: 6px; }

  /* ─── Zusatzkosten-Zeilen: Stack ─── */
  #additional-costs-list .form-row { flex-direction: column; gap: 6px; }

  /* ─── Employee Card Details: 2-spaltig ─── */
  .employee-card-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  /* ─── Analytics: Overdue-Tabelle scrollbar ─── */
  .overdue-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* ─── KPI-Karten: kompakteres Padding ─── */
  .kpi-card { padding: 16px; }
  .kpi-value { font-size: 22px; }

  /* ─── Charts: volle Höhe reduzieren ─── */
  .chart-card canvas { max-height: 220px; }

  /* ─── Provision-Link-Box: Stack ─── */
  .link-box { flex-direction: column; gap: 8px; }
  .link-box input { width: 100%; }
  .link-box .btn { width: 100%; justify-content: center; }

}


/* ══════════════════════════════════════════
   MOBILE OPTIMIERUNGEN (max-width: 480px)
   ══════════════════════════════════════════ */

@media (max-width: 480px) {

  /* ─── iOS: Zoom verhindern bei Focus ─── */
  input, select, textarea {
    font-size: 16px !important;
  }

  /* ─── Seitenüberschrift kleiner ─── */
  .page-header h2 { font-size: 18px; }

  /* ─── Fieldsets: noch weniger Padding ─── */
  fieldset.form-section { padding: 12px 10px; }
  fieldset.form-section legend { font-size: 13px; }

  /* ─── Type-Chooser: 1 Spalte ─── */
  .type-chooser-options { grid-template-columns: 1fr; }
  .type-chooser-card { padding: 24px 16px 20px; }

  /* ─── Employee-Karten: Details 1-spaltig auf sehr kleinen Screens ─── */
  .employee-card { padding: 14px; }
  .employee-card-details { grid-template-columns: 1fr 1fr; }

  /* ─── Workshop-Karten ─── */
  .workshops-grid { gap: 10px; }

  /* ─── Data Table: kleinere Schrift ─── */
  .data-table th,
  .data-table td { font-size: 11px; padding: 8px 6px; }

  /* ─── Filter-Bar: Inputs volle Breite ─── */
  .filter-bar input,
  .filter-bar select { width: 100%; }

  /* ─── Buttons in Formularen ─── */
  .btn-lg { width: 100%; justify-content: center; }

  /* ─── Sidebar-Footer Logout ─── */
  #sidebar-footer-btn { width: 100%; justify-content: center; }

  /* ─── Confirm/Toast: volle Breite ─── */
  .confirm-card { margin: 0 12px; width: calc(100% - 24px); }

  /* ─── Bilder-Grid: 2 Spalten ─── */
  .images-grid { grid-template-columns: repeat(2, 1fr); }

}
