/* ============================================
   Der Fototyp CRM – Stylesheet
   Modern Fresh Design
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,300;1,9..40,400&family=Syne:wght@400;500;600;700;800&display=swap');

:root {
  /* Primärfarben */
  --bg:         #F7F6F3;
  --bg-card:    #FFFFFF;
  --bg-sidebar: #0F0F0F;
  --bg-input:   #F0EFE9;

  --text-primary:   #111110;
  --text-secondary: #6B6B6B;
  --text-muted:     #9B9B9B;
  --text-inverse:   #FFFFFF;

  --accent:         #D4A853;
  --accent-light:   #F5E6C3;
  --accent-dark:    #B8892E;

  --success:  #2ECC71;
  --warning:  #F39C12;
  --danger:   #E74C3C;
  --info:     #3498DB;

  --border:        rgba(0,0,0,0.08);
  --border-strong: rgba(0,0,0,0.15);
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.12);

  --radius:    10px;
  --radius-sm: 6px;
  --radius-lg: 16px;

  --sidebar-w: 248px;
  --font-sans: 'DM Sans', sans-serif;
  --font-display: 'Syne', sans-serif;

  --transition: 0.18s ease;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; }

/* ── Layout ── */
.layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  color: var(--text-inverse);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
  transition: transform var(--transition);
}

.sidebar-logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.sidebar-logo .logo-text {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.02em;
}
.sidebar-logo .logo-sub {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.35);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 2px;
}

.sidebar-nav {
  padding: 16px 12px;
  flex: 1;
}
.nav-section-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.28);
  padding: 14px 8px 6px;
  font-weight: 600;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 400;
  color: rgba(255,255,255,0.65);
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: 2px;
}
.nav-item:hover {
  background: rgba(255,255,255,0.07);
  color: #fff;
}
.nav-item.active {
  background: var(--accent);
  color: #fff;
  font-weight: 500;
}
.nav-item svg { flex-shrink: 0; opacity: 0.8; }
.nav-item.active svg { opacity: 1; }

.sidebar-bottom {
  padding: 12px;
  border-top: 1px solid rgba(255,255,255,0.07);
}

/* ── Main Content ── */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.content {
  padding: 28px;
  flex: 1;
}

/* ── Page Header ── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}
.page-header h1 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
}
.page-header .subtitle {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-top: 3px;
}

/* ── Karten ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-header {
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
}
.card-body { padding: 20px 22px; }
.card-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

/* ── Stats Grid ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform var(--transition), box-shadow var(--transition);
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  font-weight: 600;
}
.stat-value {
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
}
.stat-sub {
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.stat-icon {
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* ── Tabellen ── */
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
thead th {
  text-align: left;
  padding: 10px 14px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--bg); }
td {
  padding: 12px 14px;
  vertical-align: middle;
}

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.badge-green  { background: #DCFCE7; color: #15803D; }
.badge-yellow { background: #FEF9C3; color: #854D0E; }
.badge-red    { background: #FEE2E2; color: #991B1B; }
.badge-blue   { background: #DBEAFE; color: #1D4ED8; }
.badge-gray   { background: #F3F4F6; color: #374151; }
.badge-purple { background: #EDE9FE; color: #5B21B6; }
.badge-orange { background: #FFEDD5; color: #9A3412; }
.badge-gold   { background: var(--accent-light); color: var(--accent-dark); }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  white-space: nowrap;
  text-align: center;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--text-primary);
  color: #fff;
}
.btn-primary:hover { background: #2a2a2a; }
.btn-accent {
  background: var(--accent);
  color: #fff;
}
.btn-accent:hover { background: var(--accent-dark); }
.btn-secondary {
  background: var(--bg);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
}
.btn-secondary:hover { background: #EEEDE8; }
.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover { background: #c0392b; }
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 7px 12px;
}
.btn-ghost:hover {
  background: var(--bg);
  color: var(--text-primary);
}
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-lg { padding: 12px 24px; font-size: 1rem; }
.btn-icon {
  width: 34px; height: 34px; padding: 0;
  justify-content: center;
}

/* ── Formulare ── */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.form-control {
  width: 100%;
  padding: 9px 13px;
  background: var(--bg-input);
  border: 1.5px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--text-primary);
  transition: border-color var(--transition), background var(--transition);
  outline: none;
  appearance: none;
}
.form-control:focus {
  border-color: var(--accent);
  background: #fff;
}
.form-control::placeholder { color: var(--text-muted); }
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 24 24' fill='none' stroke='%236B6B6B' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
textarea.form-control {
  min-height: 90px;
  resize: vertical;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 20px;
}
.form-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0 20px;
}
.form-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── Flash Messages ── */
.flash {
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 10px;
}
.flash-success { background: #DCFCE7; color: #15803D; border: 1px solid #BBF7D0; }
.flash-error   { background: #FEE2E2; color: #991B1B; border: 1px solid #FECACA; }
.flash-info    { background: #DBEAFE; color: #1D4ED8; border: 1px solid #BFDBFE; }

/* ── Avatar ── */
.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent-dark);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.82rem;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}
.avatar-sm { width: 28px; height: 28px; font-size: 0.72rem; }
.avatar-lg { width: 48px; height: 48px; font-size: 1rem; }

/* ── Kunde Info Row ── */
.customer-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.customer-name { font-weight: 500; font-size: 0.9rem; }
.customer-email { font-size: 0.78rem; color: var(--text-muted); }

/* ── Filter / Search Bar ── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.search-input {
  flex: 1;
  min-width: 200px;
  max-width: 340px;
  padding: 8px 13px 8px 36px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  outline: none;
  transition: border-color var(--transition);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239B9B9B' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 12px center;
}
.search-input:focus { border-color: var(--accent); }

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 500;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
  backdrop-filter: blur(4px);
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}
.modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(10px);
  transition: transform var(--transition);
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
}
.modal-body { padding: 22px 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex; gap: 10px; justify-content: flex-end;
}

/* ── Timeline / Aktivitäten ── */
.timeline { display: flex; flex-direction: column; gap: 0; }
.timeline-item {
  display: flex;
  gap: 14px;
  padding-bottom: 18px;
  position: relative;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: 15px; top: 32px; bottom: 0;
  width: 1.5px;
  background: var(--border);
}
.timeline-item:last-child::before { display: none; }
.timeline-dot {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--bg-input);
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
  position: relative;
  z-index: 1;
}
.timeline-content { flex: 1; }
.timeline-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── Kalender / Mini-Kalender ── */
.mini-cal { width: 100%; }
.mini-cal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
  font-weight: 600; font-size: 0.9rem;
}
.mini-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.mini-cal-day {
  aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.78rem;
  border-radius: 50%;
  cursor: pointer;
  transition: background var(--transition);
}
.mini-cal-day:hover { background: var(--bg); }
.mini-cal-day.today {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}
.mini-cal-day.has-event { position: relative; }
.mini-cal-day.has-event::after {
  content: '';
  position: absolute; bottom: 3px;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--accent);
}
.mini-cal-day.other-month { color: var(--text-muted); }
.mini-cal-weekday {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  text-align: center;
  padding-bottom: 4px;
  font-weight: 600;
}

/* ── Shooting Status Farben ── */
.status-anfrage   { color: #6366F1; }
.status-bestaetigt { color: #0EA5E9; }
.status-abgeschlossen { color: #22C55E; }
.status-bezahlt   { color: #16A34A; }
.status-storniert { color: #EF4444; }

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}
.empty-state svg { margin: 0 auto 16px; opacity: 0.3; }
.empty-state h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.empty-state p { font-size: 0.85rem; }

/* ── Progress Bar ── */
.progress {
  height: 6px;
  background: var(--bg-input);
  border-radius: 3px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  border-radius: 3px;
  background: var(--accent);
  transition: width 0.4s ease;
}

/* ── Tooltip ── */
[data-tooltip] {
  position: relative;
  cursor: default;
}
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--text-primary);
  color: #fff;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition);
  z-index: 100;
}
[data-tooltip]:hover::after { opacity: 1; }

/* ── Divider ── */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .content { padding: 18px; }
  .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .stats-grid { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; }
  .filter-bar { flex-direction: column; align-items: stretch; }
}

/* ── Scroll ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Animationen ── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 0.25s ease forwards; }

/* ── Login ── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-sidebar);
  padding: 20px;
}
.login-box {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
}
.login-logo {
  text-align: center;
  margin-bottom: 28px;
}
.login-logo .brand {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.04em;
}
.login-logo .brand-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
