﻿@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;700&display=swap');

:root {
  --bg0: #f7fbff;
  --bg1: #e6efff;
  --card: rgba(255, 255, 255, 0.88);
  --line: #c9d7ef;
  --text: #0d1b2b;
  --muted: #4a5f7c;
  --primary: #145af2;
  --secondary: #0e2a52;
  --good: #0ea271;
  --warn: #c43b3b;
  --chip: #edf3ff;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: 'Space Grotesk', sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 10%, #d6e6ff 0%, transparent 42%),
    radial-gradient(circle at 90% 0%, #d1f3ec 0%, transparent 36%),
    linear-gradient(170deg, var(--bg0), var(--bg1));
}

.app-menu-btn {
  position: sticky;
  top: 10px;
  left: auto;
  z-index: 1001;
  width: auto;
  display: block;
  margin: 12px 0 0 12px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--secondary);
  border: 1px solid var(--line);
  box-shadow: 0 10px 24px rgba(30, 57, 95, 0.18);
}
.app-menu-drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: min(290px, 82vw);
  height: 100vh;
  z-index: 1002;
  background: rgba(255, 255, 255, 0.98);
  border-right: 1px solid var(--line);
  box-shadow: 0 16px 38px rgba(30, 57, 95, 0.2);
  transform: translateX(-105%);
  transition: transform 0.22s ease;
  padding: 72px 14px 14px;
}
.app-menu-drawer.open {
  transform: translateX(0);
}
.app-menu-links {
  display: grid;
  gap: 8px;
}
.app-menu-link {
  display: block;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--secondary);
  text-decoration: none;
  background: #fff;
}
.app-menu-link:hover {
  background: #f4f8ff;
}
.app-menu-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(9, 18, 30, 0.28);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}
.app-menu-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.container {
  width: min(1280px, 96vw);
  margin: 16px auto;
  display: grid;
  gap: 12px;
}
.customer-page .container {
  width: min(1560px, 98vw);
}
.dashboard-page .container {
  width: min(1800px, 98vw);
}
.dashboard-page .auth-row {
  grid-template-columns: minmax(280px, 440px) minmax(480px, 1fr);
  align-items: start;
}
.dashboard-page .login-panel-compact {
  width: 100%;
  max-width: 440px;
  justify-self: start;
}

.customer-page {
  min-height: 100vh;
  overflow: auto;
}
.customer-page .container {
  min-height: calc(100vh - 24px);
  height: auto;
  margin: 12px auto;
  grid-template-rows: auto minmax(0, 1fr);
}
.customer-page.no-topbar .container {
  grid-template-rows: minmax(0, 1fr);
  margin: 14px auto 12px;
  min-height: calc(100vh - 26px);
  height: calc(100vh - 26px);
}
.customer-page.no-topbar {
  overflow: hidden;
}
.customer-page.no-topbar .app-menu-btn {
  position: fixed;
  top: 10px;
  left: 10px;
  margin: 0;
}
.customer-page .grid.cols-2 {
  min-height: 0;
  overflow: hidden;
}
.customer-page .grid.cols-2 > .panel {
  min-height: 0;
}
.customer-page .grid.cols-2 > .panel:first-child {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  height: calc(100vh - 170px);
  max-height: calc(100vh - 170px);
  overflow: hidden;
}
.customer-page .company-side {
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr);
}
.customer-page .register-panel {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.customer-page .chat-wrap {
  min-height: 0;
  height: 100%;
  max-height: none;
  overflow: hidden;
}

.customer-page .panel {
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(30, 57, 95, 0.08);
  padding: 12px;
}
.customer-page input,
.customer-page select,
.customer-page textarea,
.customer-page button {
  border-radius: 8px;
  padding: 9px 10px;
}
.customer-page label {
  margin: 4px 0;
  font-size: 12px;
}
.customer-page .title {
  font-size: 24px;
}
.customer-page .subtitle {
  font-size: 13px;
}

.panel {
  background: var(--card);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(30, 57, 95, 0.08);
  padding: 14px;
}

.title { font-size: 28px; margin: 0; }
.subtitle { color: var(--muted); margin: 6px 0 0; }
.lang-bar {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 220px 180px auto;
  gap: 6px;
  align-items: center;
  max-width: 620px;
}
.lang-bar select,
.lang-bar input,
.lang-bar button {
  padding: 5px 8px;
  font-size: 12px;
  border-radius: 8px;
}

.grid { display: grid; gap: 14px; }
.cols-2 { grid-template-columns: 1.7fr 1fr; }
.cols-3 { grid-template-columns: repeat(3, 1fr); }

input, select, textarea, button {
  width: 100%;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  font: inherit;
}
textarea { min-height: 80px; resize: vertical; }

button {
  cursor: pointer;
  border: none;
  font-weight: 700;
  background: var(--primary);
  color: #fff;
}
button.secondary { background: var(--secondary); }
button.good { background: var(--good); }
button.warn { background: var(--warn); }
button.ghost {
  background: #fff;
  color: var(--secondary);
  border: 1px solid var(--line);
}

label { font-size: 13px; color: var(--muted); display: block; margin: 6px 0; }
.small { font-size: 12px; color: var(--muted); }

 .chat-wrap {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  height: 100%;
  min-height: 0;
  max-height: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(180deg, #e7f0ff 0%, #dce9ff 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}
.chat-main-title {
  margin: 0 0 6px;
  font-size: 20px;
  line-height: 1.2;
  text-align: center;
}
.chat-log {
  min-height: 0;
  padding: 12px 14px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  background: rgba(238, 246, 255, 0.8);
  scrollbar-width: thin;
  overscroll-behavior: contain;
}
.chat-log::-webkit-scrollbar {
  width: 10px;
}
.chat-log::-webkit-scrollbar-thumb {
  background: #b8cbed;
  border-radius: 999px;
  border: 2px solid rgba(238, 246, 255, 0.8);
}
.msg {
  max-width: min(76%, 760px);
  width: auto;
  display: inline-block;
  border-radius: 4px;
  padding: 6px 8px;
  line-height: 1.35;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}
.msg.user {
  align-self: flex-end;
  background: #dce7ff;
}
.msg.bot {
  align-self: flex-start;
  background: #eef5ff;
  border: 1px solid #d8e5ff;
}
.chat-input {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 8px;
  padding: 8px;
  background: #f3f8ff;
  border-top: 1px solid var(--line);
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.chip {
  background: var(--chip);
  border: 1px solid #d5e1f8;
  color: #173464;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
}

.list {
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.item {
  padding: 11px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.8);
}
.item:last-child { border-bottom: none; }

.appointments-db-panel {
  padding: 18px;
}
.appointments-db-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.appointments-db-actions {
  display: flex;
  gap: 8px;
}
.appointments-db-head button {
  width: auto;
  min-width: 140px;
}
.appointments-filters {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 8px;
  margin: 10px 0 8px;
}
.appointments-db-wrap {
  margin-top: 8px;
  max-height: 560px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.appointments-db {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
}
.appointments-db th,
.appointments-db td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid #e4ecfa;
  font-size: 13px;
}
.appointments-db th {
  position: sticky;
  top: 0;
  background: #f2f7ff;
  z-index: 1;
}
.appointments-db tr:hover td {
  background: #f9fbff;
}
.calendar-view {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 10px;
}
.calendar-day {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: #fff;
}
.calendar-day h4 {
  margin: 0 0 8px;
}
.calendar-item {
  border: 1px solid #e4ecfa;
  border-radius: 10px;
  padding: 8px;
  background: #f9fbff;
  margin-bottom: 8px;
}
.calendar-item:last-child {
  margin-bottom: 0;
}
.full-calendar-wrap {
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: auto;
  max-height: 760px;
  background: #fff;
}
.full-calendar-table {
  width: 100%;
  min-width: 1300px;
  border-collapse: collapse;
}
.full-calendar-table th,
.full-calendar-table td {
  border-bottom: 1px solid #e5edfb;
  border-right: 1px solid #edf2fd;
  padding: 8px;
  vertical-align: top;
}
.full-calendar-table thead th {
  position: sticky;
  top: 0;
  background: #eff5ff;
  z-index: 2;
}
.full-calendar-time-col {
  width: 84px;
  min-width: 84px;
  font-weight: 700;
  color: var(--secondary);
  background: #f7faff;
  position: sticky;
  left: 0;
  z-index: 1;
}
.full-calendar-slot {
  min-height: 54px;
  background: #fff;
}
.full-calendar-event {
  border: 1px solid #cddaf7;
  background: #f4f8ff;
  border-radius: 8px;
  padding: 6px 7px;
  font-size: 12px;
}

.badge { border-radius: 999px; padding: 2px 8px; font-size: 11px; font-weight: 700; }
.badge.routine { color: #1b7446; background: #dcf7e8; }
.badge.normal { color: #1f4d9a; background: #dde9ff; }
.badge.wichtig { color: #955500; background: #ffefcf; }
.badge.kritisch { color: #9f1f1f; background: #ffe0e0; }

.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 28px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  inset: 0;
  background: #c7d5ec;
  border-radius: 999px;
  transition: 0.2s;
}
.slider::before {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.2s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.switch input:checked + .slider {
  background: var(--good);
}
.switch input:checked + .slider::before {
  transform: translateX(20px);
}

.dev-page .container {
  width: min(980px, 94vw);
  gap: 10px;
  position: relative;
  z-index: 1;
}
.dev-page::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='120' viewBox='0 0 240 120'%3E%3Ctext x='120' y='38' text-anchor='middle' fill='rgba(20,90,242,0.08)' font-size='21' font-family='Space Grotesk, Arial, sans-serif' font-weight='700'%3EENTWICKLER%3C/text%3E%3Ctext x='120' y='92' text-anchor='middle' fill='rgba(20,90,242,0.06)' font-size='21' font-family='Space Grotesk, Arial, sans-serif' font-weight='700'%3EENTWICKLER%3C/text%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 240px 120px;
  background-position: center top;
  pointer-events: none;
  z-index: 0;
}
.dev-page .panel {
  padding: 12px;
  border-radius: 14px;
}
.dev-page .title {
  font-size: 22px;
}
.dev-page .subtitle {
  font-size: 13px;
}
.dev-page .grid {
  gap: 10px;
}
.dev-page input,
.dev-page select,
.dev-page textarea,
.dev-page button {
  padding: 9px 10px;
  font-size: 13px;
  border-radius: 10px;
}
.dev-page .list {
  max-height: 260px;
}


.start-container {
  margin-top: 10px;
}
.start-hero {
  display: grid;
  gap: 4px;
  background: linear-gradient(145deg, rgba(255,255,255,0.9), rgba(236,244,255,0.94));
}
.start-title {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
}
.start-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}
.start-role-hint {
  margin: 0;
  color: #23425f;
  font-size: 13px;
}
.start-layout {
  grid-template-columns: 1.6fr 1fr;
}
@media (max-width: 1000px) {
  .start-title {
    font-size: 22px;
  }
  .start-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1000px) {
  .app-menu-btn {
    top: 8px;
    margin: 10px 0 0 10px;
    padding: 7px 10px;
  }
  .cols-2, .cols-3 { grid-template-columns: 1fr; }
  .dashboard-page .auth-row {
    grid-template-columns: 1fr;
  }
  .lang-bar {
    grid-template-columns: 1fr;
  }
  .appointments-filters {
    grid-template-columns: 1fr;
  }
  .appointments-db-actions {
    width: 100%;
  }
  .appointments-db-head {
    flex-direction: column;
    align-items: stretch;
  }
  .customer-page {
    height: auto;
    overflow: auto;
  }
  .customer-page .container {
    height: auto;
    margin: 20px auto;
  }
  .customer-page .company-side {
    grid-template-rows: auto auto;
  }
  .customer-page .register-panel {
    overflow: visible;
  }
}

.chat-info-box {
  margin: 0 0 8px;
  padding: 8px 10px;
  border: 1px solid #d4e2fb;
  border-radius: 8px;
  background: rgba(239, 246, 255, 0.85);
}
.chat-info-box .small {
  margin: 4px 0;
}
