/* =====================================================
   Jonasarea Admin Dashboard
   Selbe Designsprache wie die Hauptseite
   ===================================================== */

:root {
  --bg: #f5f3ee;
  --bg-2: #ffffff;
  --fg: #0e0e0e;
  --muted: #797670;
  --line: #e3ddd2;
  --line-soft: #ede7dd;
  --accent: #0e0e0e;
  --danger: #c44;
  --success: #2a8;
  --shadow: 0 1px 3px rgba(14,14,14,0.04);
  --shadow-md: 0 6px 20px rgba(14,14,14,0.06);
  --shadow-lg: 0 16px 40px rgba(14,14,14,0.10);
  --radius: 10px;
  --radius-lg: 16px;
  --pad-x: 1.5rem;
  --ease: cubic-bezier(.22,.61,.36,1);
  --font-sans: 'Inter Tight', system-ui, -apple-system, sans-serif;
  --font-script: 'Caveat', cursive;
}

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

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

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--fg);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* =====================================================
   LOGIN SCREEN
   ===================================================== */
.login-screen {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 2rem;
  background: linear-gradient(135deg, var(--bg) 0%, var(--bg-2) 100%);
}
.login-screen[hidden] { display: none !important; }
.dashboard[hidden] { display: none !important; }
.login-card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 3rem 2.5rem;
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.login-logo {
  width: 60px; height: 60px;
  margin: 0 auto 1.5rem;
  color: var(--fg);
}
.login-card h1 {
  font-size: 1.6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  margin-bottom: 0.4rem;
}
.login-sub {
  color: var(--muted);
  margin-bottom: 2rem;
}
.login-card form {
  display: flex; flex-direction: column; gap: 1rem;
}
.login-card input {
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
  background: var(--bg);
  transition: border-color 0.2s;
}
.login-card input:focus {
  outline: none;
  border-color: var(--fg);
}
.login-card button {
  padding: 0.9rem 1.5rem;
  background: var(--fg);
  color: var(--bg);
  border: none;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s;
  font-family: inherit;
}
.login-card button:hover { opacity: 0.85; transform: translateY(-1px); }
.login-error {
  color: var(--danger);
  font-size: 0.85rem;
  padding: 0.6rem 1rem;
  background: rgba(204,68,68,0.08);
  border-radius: var(--radius);
}

/* =====================================================
   DASHBOARD
   ===================================================== */
.dashboard {
  min-height: 100vh;
  display: flex; flex-direction: column;
}

.topbar {
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
  padding: 0.9rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 100;
}
.topbar-logo {
  display: flex; align-items: center; gap: 0.6rem;
  font-weight: 800; text-transform: uppercase;
  letter-spacing: -0.01em;
}
.topbar-logo svg { width: 22px; height: 22px; }
.topbar-right {
  display: flex; align-items: center; gap: 0.8rem;
}
.save-status {
  font-size: 0.8rem;
  color: var(--muted);
  margin-right: 0.5rem;
}
.save-status.saving { color: var(--muted); }
.save-status.saved { color: var(--success); }
.save-status.error { color: var(--danger); }
.save-status.dirty { color: #c80; }

.btn-primary {
  padding: 0.6rem 1.2rem;
  background: var(--fg);
  color: var(--bg);
  border: none;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s;
  font-family: inherit;
}
.btn-primary:hover { opacity: 0.85; }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-ghost {
  padding: 0.6rem 1rem;
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  text-decoration: none;
  font-family: inherit;
}
.btn-ghost:hover { border-color: var(--fg); background: var(--bg); }

.btn-danger {
  padding: 0.5rem 0.9rem;
  background: transparent;
  color: var(--danger);
  border: 1px solid rgba(204,68,68,0.3);
  border-radius: var(--radius);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.btn-danger:hover { background: rgba(204,68,68,0.08); border-color: var(--danger); }

/* =====================================================
   LAYOUT: SIDEBAR + MAIN
   ===================================================== */
.dashboard-body {
  display: flex;
  flex: 1;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.sidebar {
  width: 240px;
  border-right: 1px solid var(--line);
  padding: 1.5rem 1rem;
  background: var(--bg);
  position: sticky; top: 64px;
  height: calc(100vh - 64px);
  overflow-y: auto;
}

.tabs {
  display: flex; flex-direction: column; gap: 0.2rem;
}
.tab {
  text-align: left;
  padding: 0.7rem 1rem;
  border: none;
  background: transparent;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
  transition: background 0.15s, color 0.15s;
  font-family: inherit;
}
.tab:hover { background: var(--bg-2); color: var(--fg); }
.tab.active {
  background: var(--fg);
  color: var(--bg);
}

.main-content {
  flex: 1;
  padding: 2rem 2.5rem 5rem;
  max-width: 800px;
}

/* Clients-Mode bekommt mehr Platz weil 2-Spalten-Layout */
.clients-mode {
  flex: 1;
  padding: 2rem 2.5rem 5rem;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn 0.3s var(--ease); }

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

.panel-head {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
}
.panel-head h2 {
  font-size: 1.6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  margin-bottom: 0.4rem;
}
.panel-desc {
  color: var(--muted);
  font-size: 0.92rem;
}

/* =====================================================
   FORMS
   ===================================================== */
.form-section {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.6rem;
  margin-bottom: 1.5rem;
}
.form-section h3 {
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1.2rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--line-soft);
}
.form-section .form-hint {
  font-size: 0.82rem;
  color: var(--muted);
  margin: -0.6rem 0 1rem;
}

label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin: 1rem 0 0.4rem;
}
label:first-child { margin-top: 0; }

input[type="text"], input[type="email"], input[type="password"], textarea, select {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--bg);
  color: var(--fg);
  transition: border-color 0.15s, background 0.15s;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--fg);
  background: var(--bg-2);
}
textarea { resize: vertical; min-height: 80px; line-height: 1.5; }

/* Card-Editor (für Trust-Cards, Werte, Testimonials) */
.card-editor {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem;
  margin-bottom: 1rem;
  background: var(--bg);
}
.card-editor h4 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0;
  color: var(--muted);
}
.card-editor-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--line);
}
.card-editor-actions {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}
.btn-icon {
  width: 28px; height: 28px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--muted);
  font-family: inherit;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.btn-icon:hover {
  border-color: var(--fg);
  color: var(--fg);
  background: var(--bg-2);
}
.btn-danger {
  padding: 0.4rem 0.8rem;
  background: transparent;
  color: var(--danger);
  border: 1px solid rgba(204,68,68,0.3);
  border-radius: var(--radius);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.btn-danger:hover {
  background: rgba(204,68,68,0.08);
  border-color: var(--danger);
}

/* Feature-Liste-Editor */
.feature-list { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 0.5rem; }
.feature-item {
  display: flex; gap: 0.5rem; align-items: center;
}
.feature-item input { flex: 1; }
.feature-item button { padding: 0.4rem 0.7rem; }

.add-btn {
  padding: 0.5rem 1rem;
  background: var(--bg-2);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--muted);
  transition: all 0.2s;
  font-family: inherit;
}
.add-btn:hover { border-color: var(--fg); color: var(--fg); }

/* Image-Grid (Hero-Karten) */
.img-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
}
.img-tile {
  position: relative;
  aspect-ratio: 4/5;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.img-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.img-tile img {
  width: 100%; height: 100%; object-fit: cover;
}
.img-tile-no-img {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
  padding: 1rem;
}
.img-tile-label {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.85), transparent);
  color: white;
  padding: 0.7rem 0.8rem 0.5rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  pointer-events: none;
}
.img-tile-replace {
  position: absolute; top: 0.5rem; right: 0.5rem;
  background: rgba(255,255,255,0.95);
  border: none;
  border-radius: var(--radius);
  padding: 0.3rem 0.6rem;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: inherit;
  opacity: 0;
  transition: opacity 0.2s;
}
.img-tile:hover .img-tile-replace { opacity: 1; }

/* Single Image Uploader */
.single-image-uploader {
  display: flex; gap: 1rem; align-items: flex-start;
}
.single-image-uploader .preview {
  width: 200px; height: 250px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  overflow: hidden;
  background: var(--bg);
  flex-shrink: 0;
}
.single-image-uploader .preview img {
  width: 100%; height: 100%; object-fit: cover;
}
.single-image-uploader .preview-empty {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 0.85rem;
}
.single-image-uploader .actions {
  display: flex; flex-direction: column; gap: 0.5rem;
}

/* Upload Zone */
.upload-zone {
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: var(--bg);
}
.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--fg);
  background: var(--bg-2);
}
.upload-zone-content p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}
.upload-zone-content p:first-child {
  color: var(--fg);
  font-weight: 600;
  margin-bottom: 0.3rem;
}
.upload-hint {
  font-size: 0.75rem;
  color: var(--muted);
}
.upload-zone.uploading {
  pointer-events: none;
  opacity: 0.6;
}

/* Image Gallery */
.img-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.8rem;
}
.gallery-tile {
  aspect-ratio: 1;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  cursor: pointer;
  position: relative;
  background: var(--bg);
  transition: transform 0.2s, border-color 0.2s;
}
.gallery-tile:hover {
  transform: translateY(-2px);
  border-color: var(--fg);
}
.gallery-tile img {
  width: 100%; height: 100%; object-fit: cover;
}
.gallery-tile-name {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: rgba(255,255,255,0.95);
  padding: 0.3rem 0.5rem;
  font-size: 0.7rem;
  text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* =====================================================
   TOAST
   ===================================================== */
.toast {
  position: fixed;
  bottom: 2rem; right: 2rem;
  background: var(--fg);
  color: var(--bg);
  padding: 0.9rem 1.4rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  animation: slideUp 0.3s var(--ease);
}
.toast.error { background: var(--danger); }
.toast.success { background: var(--success); }

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

/* =====================================================
   MODAL
   ===================================================== */
.modal {
  position: fixed; inset: 0;
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 2rem;
}
.modal[hidden] { display: none !important; }
.modal-overlay {
  position: absolute; inset: 0;
  background: rgba(14,14,14,0.5);
  backdrop-filter: blur(4px);
}
.modal-content {
  position: relative;
  background: var(--bg-2);
  border-radius: var(--radius-lg);
  max-width: 700px;
  width: 100%;
  max-height: 85vh;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
}
.modal-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid var(--line);
}
.modal-head h3 {
  font-size: 1.1rem;
  font-weight: 700;
}
.modal-close {
  background: transparent;
  border: none;
  font-size: 1.8rem;
  cursor: pointer;
  color: var(--muted);
  line-height: 1;
  padding: 0;
  width: 32px; height: 32px;
  font-family: inherit;
}
.modal-close:hover { color: var(--fg); }
.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
}
.modal-body h4 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 1.5rem 0 0.8rem;
  color: var(--muted);
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 900px) {
  .dashboard-body { flex-direction: column; }
  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding: 1rem;
  }
  .tabs {
    flex-direction: row;
    overflow-x: auto;
    gap: 0.4rem;
  }
  .tab { white-space: nowrap; padding: 0.5rem 0.8rem; font-size: 0.8rem; }
  .main-content { padding: 1.5rem 1rem 4rem; }
  .topbar { padding: 0.7rem 1rem; flex-wrap: wrap; gap: 0.5rem; }
  .btn-primary, .btn-ghost { font-size: 0.78rem; padding: 0.5rem 0.9rem; }
  .single-image-uploader { flex-direction: column; }
  .single-image-uploader .preview { width: 100%; height: auto; aspect-ratio: 4/5; }
}

/* =====================================================
   KUNDEN-VERWALTUNG (PORTAL)
   ===================================================== */

/* Sidebar Tab Section Labels */
.tab-section-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  padding: 1rem 1rem 0.4rem;
  margin-top: 0.5rem;
  border-top: 1px solid var(--line);
}
.tab-section-label:first-child {
  border-top: none;
  margin-top: 0;
  padding-top: 0;
}

/* Layout: Liste links, Detail rechts */
.clients-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1.2rem;
  margin-top: 1rem;
}
.clients-sidebar {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 200px);
}
.clients-sidebar-head {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  border-bottom: 1px solid var(--line);
}
.clients-sidebar-head input {
  width: 100%;
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.88rem;
  background: var(--bg);
}
.clients-sidebar-head input:focus { outline: none; border-color: var(--fg); }
.clients-sidebar-head .btn-primary { padding: 0.55rem 1rem; font-size: 0.78rem; }
.clients-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
}
.client-list-item {
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  transition: background 0.2s;
  border: 1px solid transparent;
}
.client-list-item:hover { background: var(--bg); }
.client-list-item.is-active {
  background: var(--fg);
  color: var(--bg);
}
.client-list-item.is-active .client-list-meta { color: rgba(255,255,255,0.6); }
.client-list-item.is-archived { opacity: 0.5; }
.client-list-name {
  font-weight: 600;
  font-size: 0.92rem;
}
.client-list-meta {
  font-size: 0.78rem;
  color: var(--muted);
}

.empty-state {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--muted);
  font-size: 0.88rem;
}
.empty-state-large {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
}
.empty-state-large h3 {
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
  color: var(--fg);
}

/* Detail-Bereich */
.clients-detail {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.client-detail-head {
  padding: 1.5rem;
  border-bottom: 1px solid var(--line);
}
.client-detail-head-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}
.client-detail-name {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.2rem;
}
.client-detail-meta {
  font-size: 0.85rem;
  color: var(--muted);
}
.client-detail-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.client-detail-actions .btn-ghost,
.client-detail-actions .btn-danger {
  font-size: 0.78rem;
  padding: 0.45rem 0.8rem;
}
.client-archived-banner {
  background: rgba(204,128,0,0.1);
  color: #a06000;
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  margin-top: 0.8rem;
}

/* Sub-Tabs für Stunden/Rechnungen/etc */
.sub-tabs {
  display: flex;
  gap: 0.3rem;
  padding: 0.6rem 1.2rem;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}
.sub-tabs::-webkit-scrollbar { display: none; }
.sub-tab {
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  background: transparent;
  border: none;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  font-family: inherit;
}
.sub-tab:hover { background: var(--bg-2); color: var(--fg); }
.sub-tab.active {
  background: var(--fg);
  color: var(--bg);
}

.sub-panel {
  display: none;
  padding: 1.5rem;
}
.sub-panel.active { display: block; }

.sub-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.sub-panel-head h4 {
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Mini-Form (Inline-Stundeneintrag etc.) */
.mini-form {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.6rem;
  align-items: end;
}
.mini-form-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.mini-form-field.full { grid-column: 1 / -1; }
.mini-form-field label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.mini-form-field input,
.mini-form-field select,
.mini-form-field textarea {
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.88rem;
  background: var(--bg-2);
  width: 100%;
}
.mini-form-field input:focus,
.mini-form-field select:focus,
.mini-form-field textarea:focus { outline: none; border-color: var(--fg); }
.mini-form-actions {
  display: flex;
  gap: 0.4rem;
  align-items: end;
}
.mini-form-actions button {
  white-space: nowrap;
}

/* Item-Liste (Stunden, Rechnungen etc.) */
.item-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.item-row {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  display: grid;
  grid-template-columns: 100px 1fr auto;
  gap: 1rem;
  align-items: center;
  font-size: 0.88rem;
}
.item-row.compact {
  grid-template-columns: 1fr auto;
}
.item-row strong { font-weight: 600; }
.item-row .item-meta {
  color: var(--muted);
  font-size: 0.82rem;
}
.item-row .item-date {
  font-weight: 600;
  font-feature-settings: "tnum" 1;
}
.item-actions {
  display: flex;
  gap: 0.3rem;
}
.item-actions .btn-icon-sm {
  width: 28px; height: 28px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--muted);
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.item-actions .btn-icon-sm:hover {
  border-color: var(--fg);
  color: var(--fg);
  background: var(--bg-2);
}
.item-actions .btn-icon-sm.danger:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: rgba(204,68,68,0.05);
}

/* Pills für Status */
.pill-sm {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.pill-sm.open    { background: rgba(200,128,0,0.12);  color: var(--warn); }
.pill-sm.paid    { background: rgba(34,170,136,0.12); color: var(--success); }
.pill-sm.overdue { background: rgba(204,68,68,0.12);  color: var(--danger); }
.pill-sm.planned     { background: var(--bg-2);             color: var(--muted); border: 1px solid var(--line); }
.pill-sm.in_progress { background: rgba(74,123,217,0.12);   color: var(--info); }
.pill-sm.done        { background: rgba(34,170,136,0.12);   color: var(--success); }
.pill-sm.on_hold     { background: rgba(204,68,68,0.08);    color: var(--muted); }
.pill-sm.hidden { background: var(--bg-2); color: var(--muted); border: 1px dashed var(--line); }

/* Stat row für Kunden-Detail */
.client-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.5rem;
  margin-top: 0.8rem;
}
.client-stat {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.7rem 0.9rem;
}
.client-stat-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
}
.client-stat-value {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  font-feature-settings: "tnum" 1;
  margin-top: 0.15rem;
}

/* Modal narrow für Client-Form */
.modal-narrow .modal-content { max-width: 480px; }
#client-form { display: flex; flex-direction: column; gap: 0.4rem; }
#client-form label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-top: 0.6rem;
}
#client-form input {
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.95rem;
  background: var(--bg);
}
#client-form input:focus { outline: none; border-color: var(--fg); background: var(--bg-2); }
.req { color: var(--danger); }
.form-hint-inline {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--muted);
  font-size: 0.78rem;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1.2rem;
}
.form-msg {
  padding: 0.7rem 1rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  margin-top: 0.6rem;
}
.form-msg.error { background: rgba(204,68,68,0.08); color: var(--danger); }
.form-msg.success { background: rgba(34,170,136,0.1); color: var(--success); }

/* Login-Daten zum Kopieren anzeigen */
.credentials-display {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  margin-top: 0.8rem;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.85rem;
}
.credentials-display strong {
  font-family: inherit;
  display: inline-block;
  min-width: 90px;
  color: var(--muted);
}

/* Mobile responsive */
@media (max-width: 900px) {
  .clients-layout {
    grid-template-columns: 1fr;
  }
  .clients-sidebar {
    max-height: 400px;
  }
  .item-row {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }
}

/* =====================================================
   MODE SELECTOR (Startseite nach Login)
   ===================================================== */
.mode-selector {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  background: var(--bg);
  animation: fadeIn 0.6s cubic-bezier(.22,.61,.36,1);
}
.mode-selector[hidden] { display: none !important; }
.mode-inner {
  max-width: 920px;
  width: 100%;
  text-align: center;
}
.mode-headline {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
  line-height: 1.1;
}
.mode-sub {
  font-size: 1rem;
  color: var(--muted);
  margin-bottom: 3rem;
}
.mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
@media (max-width: 700px) {
  .mode-grid { grid-template-columns: 1fr; }
  .mode-selector { padding: 3rem 1.2rem; }
}
.mode-card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 2.4rem 2rem 2rem;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  transition: transform 0.5s cubic-bezier(.22,.61,.36,1),
              box-shadow 0.5s cubic-bezier(.22,.61,.36,1),
              border-color 0.5s cubic-bezier(.22,.61,.36,1);
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  align-items: flex-start;
}
.mode-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 50px rgba(14,14,14,0.12);
  border-color: var(--fg);
}
.mode-card .mode-icon {
  width: 56px;
  height: 56px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fg);
  margin-bottom: 0.6rem;
  transition: background 0.5s cubic-bezier(.22,.61,.36,1),
              color 0.5s cubic-bezier(.22,.61,.36,1);
}
.mode-card:hover .mode-icon {
  background: var(--fg);
  color: var(--bg);
}
.mode-card .mode-icon svg { width: 26px; height: 26px; }
.mode-card h3 {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  margin: 0;
}
.mode-card p {
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}
.mode-cta {
  margin-top: auto;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--fg);
  padding-top: 0.6rem;
  transition: transform 0.4s cubic-bezier(.22,.61,.36,1);
  display: inline-block;
}
.mode-card:hover .mode-cta {
  transform: translateX(4px);
}

/* Back-Button im Topbar */
.btn-back {
  width: 36px; height: 36px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: border-color 0.4s cubic-bezier(.22,.61,.36,1),
              color 0.4s cubic-bezier(.22,.61,.36,1),
              background 0.4s cubic-bezier(.22,.61,.36,1);
  margin-right: 0.4rem;
}
.btn-back[hidden] { display: none !important; }
.btn-back:hover {
  border-color: var(--fg);
  color: var(--fg);
  background: var(--bg);
}
.btn-back svg { width: 18px; height: 18px; }

.mode-label {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.9rem;
  margin-left: 0.4rem;
}

/* Loading-Error-Anzeige */
.loading-error {
  padding: 4rem 2rem;
  text-align: center;
  max-width: 480px;
  margin: 4rem auto;
}
.loading-error h3 {
  font-size: 1.3rem;
  margin-bottom: 0.6rem;
}
.loading-error p {
  color: var(--muted);
  margin-bottom: 1.5rem;
}

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

/* Clients-Mode (eigener Container, kein Sidebar-System) */
.clients-mode {
  flex: 1;
  padding: 2rem;
  background: var(--bg);
  animation: fadeIn 0.5s cubic-bezier(.22,.61,.36,1);
}
.clients-mode[hidden] { display: none !important; }
@media (max-width: 700px) {
  .clients-mode { padding: 1.2rem; }
}


/* Global: hidden überschreibt display */
[hidden] { display: none !important; }
