/* === Grundlayout === */
body {
  font-family: "Segoe UI", Arial, sans-serif;
  margin: 0;
  background: #f3f5f7;
  color: #222;
}
h2 { color: #007c91; font-size: 1.8em; margin-bottom: 15px; }
h3 { color: #00acc1; font-size: 1.3em; margin: 12px 0; }
p { margin: 6px 0; }
.hidden { display:none; }

/* Karten */
.card {
  background: #fff;
  padding: 16px;
  margin: 10px 0;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.section { margin-top: 20px; }

/* Login */
.login { max-width: 400px; margin: 100px auto; text-align: center; }
.login input {
  width: 100%; padding: 14px; margin: 10px 0;
  border-radius: 8px; border: 1px solid #ccc; font-size: 1.1em;
}
.login button {
  width: 100%; padding: 14px; border: none; border-radius: 8px;
  background: #4caf50; color: #fff; font-size: 1.2em; cursor: pointer;
}
.login button:hover { background: #45a049; }

/* Buttons */
button {
  padding: 8px 14px; border: none; border-radius: 6px;
  cursor: pointer; background: #007c91; color: #fff;
}
button:hover { background: #006070; }
.btn-logout { background: #e74c3c; }
.btn-logout:hover { background: #c0392b; }

/* Kleine Buttons (z. B. Kundenliste) */
.btn-small {
  padding: 4px 8px;
  font-size: 0.8em;
  margin-left: 6px;
  background: #007c91;
  border-radius: 4px;
}
.btn-small:hover { background: #006070; }

/* Links (u.a. WhatsApp) */
a { color: #25D366; text-decoration: none; font-weight: bold; }
a:hover { text-decoration: underline; }

/* Terminfarben */
.termin { margin: 4px 0; padding: 8px; border-radius: 6px; }
.termin.soon  { background: rgba(255,200,0,0.15); }
.termin.later { background: rgba(0,200,255,0.15); }
.termin.past  { background: rgba(200,200,200,0.2); color:#777; }

/* kleine rote Lösch-Icons */
.delete-icon {
  display:inline-block; background:#e74c3c; color:#fff; border-radius:50%;
  width:20px; height:20px; font-size:12px; line-height:20px; text-align:center;
  cursor:pointer; margin-left:6px; user-select:none;
}
.delete-icon:hover { background:#c0392b; }

/* Admin-Layout */
.flex-columns { display:flex; gap:20px; margin-top:20px; align-items:stretch; }
.flex-col {
  background:#fff; border-radius:10px; box-shadow:0 2px 6px rgba(0,0,0,0.1);
  padding:16px; flex:1; display:flex; flex-direction:column;
}
/* Scrollbare linke Spalte in der Adminansicht */
.flex-col.scrollable {
  max-height: 75vh;
  overflow-y: auto;
}

/* Kunden-Tab Layout */
#kundenTab .flex-col:first-child { flex: 0 0 320px; }
#kundenTab .flex-col:last-child { flex: 1; }

/* Kundendaten Grid */
.customer-data-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr; /* drei Spalten */
  gap: 12px;
}
.customer-data-grid label {
  font-weight: bold;
  font-size: 0.9em;
  margin-top: 6px;
  display: block;
}
.customer-data-grid input,
.customer-data-grid select {
  width: 100%;
  padding: 6px;
  border-radius: 6px;
  border: 1px solid #ccc;
}

/* Responsive für kleinere Screens */
@media (max-width: 1200px) {
  .customer-data-grid {
    grid-template-columns: 1fr 1fr; /* zwei Spalten */
  }
}
@media (max-width: 700px) {
  .customer-data-grid {
    grid-template-columns: 1fr; /* eine Spalte */
  }
}

/* Hinweisfelder */
#editHinweise,
#editProdukteText {
  width: 100%;
  min-height: 30px;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 0.95em;
}
#editBehandlungen {
  width: 100%;
  min-height: 100px;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 0.95em;
}

/* Tabs + Buttons gemeinsam in Reihe */
.tabs { margin-bottom:15px; }
.tabs.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}
.tabs button {
  padding:10px 16px; border:none; background:#007c91; color:#fff;
  border-radius:6px; cursor:pointer;
}
.tabs button:hover { background:#006070; }
.admin-tab { display:block; }
.admin-tab.hidden { display:none; }

/* Kalender */
.kalender-flex { overflow-x: auto; }
.flex-col #calendar1,
.flex-col #calendar2,
.flex-col #calendar3,
.flex-col #calendar4,
.flex-col #calendar5 {
  height:70vh;
  border: 1px solid #e0e6ea;
  border-radius: 6px;
  background: #fafafa;
  min-width: 260px;
}
.fc { font-size: 0.75em; }
.fc .fc-col-header-cell { background:#f9f9f9; }
.fc .fc-daygrid-day-number { font-size:0.8em; padding:2px; }

/* Mini-Kalender */
#miniCalendar {
  max-width:100%;
  background:#fafafa;
  border-radius:6px;
  border: 1px solid #e0e6ea;
  padding:10px;
  min-height: 300px;
  box-shadow:0 1px 3px rgba(0,0,0,0.05);
}
#miniCalendar .fc-toolbar-title { font-size: 1.1em; font-weight: bold; }
#miniCalendar .fc-button {
  background: #007c91; color: #fff; border: none;
  padding: 2px 6px; font-size: 0.8em; border-radius: 4px; cursor: pointer;
}
#miniCalendar .fc-button:hover { background: #006070; }

/* Textarea im Popup */
textarea {
  font-family: inherit; font-size:1em; padding:8px;
  border-radius:6px; border:1px solid #ccc; margin:8px 0; resize:vertical;
}

/* Popup Overlay */
body::after {
  content:""; display:none; position:fixed; inset:0;
  background:rgba(0,0,0,0.5); z-index:9998;
}
body.popup-open::after { display:block; }

/* Popup Box */
.popup {
  position:fixed; top:25%; left:50%; transform:translate(-50%,-25%);
  z-index:9999; max-width:420px; width:90%;
}

:root{
  --h-list: 36vh;   /* Kundenliste links */
  --h-soon: 22vh;   /* 24h-Termine links */
  --h-past: 22vh;   /* Vergangene Termine links */
  --h-all:  40vh;   /* Alle kommenden Termine rechts */
}

/* Scroll-Container in Kunden-Ansicht (responsive, VH-basiert) */
#customerList     { max-height: var(--h-list); overflow: auto; }
#customerView #appointmentsSoon { max-height: 200px; overflow: auto; }
#customerView #appointmentsPast { max-height: 200px; overflow: auto; }
#customerView #appointmentsAll { max-height: 260px; overflow: auto; }

@media (max-width: 1200px){
  :root{
    --h-list: 34vh;
    --h-soon: 20vh;
    --h-past: 20vh;
    --h-all:  36vh;
  }
}
@media (max-width: 900px){
  :root{
    --h-list: 32vh;
    --h-soon: 18vh;
    --h-past: 18vh;
    --h-all:  34vh;
  }
}

/* Drei-Spalten-Layout für Produkte / Kommende / Vergangene (rechts) */
.triple-grid{
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  align-items: start;
}
@media (max-width: 1200px){
  .triple-grid{ grid-template-columns: 1fr 1fr; }
}
@media (max-width: 800px){
  .triple-grid{ grid-template-columns: 1fr; }
}
/* Karten im Triple-Grid etwas kompakter */
.triple-grid .card{ margin: 0; }

/* Mobile */
@media (max-width: 900px) {
  body { background:#1c2e1c; color:#fff; }
  .card { background:rgba(0,0,0,0.2); color:#fff; box-shadow:none; }
  .flex-columns { flex-direction:column; }
  h2 { color:#fff; } h3 { color:#b8e6b8; }
  button { width:100%; margin-top:10px; }
  #calendar1,#calendar2,#calendar3,#calendar4,#calendar5,
  #miniCalendar { background:rgba(0,0,0,0.2); }
}

/* Events: Ruhezeiten grau markieren */
.fc-event.break-time {
  background-color: #999 !important;
  border: none !important;
  color: #fff !important;
}

/* Buttons in einer Reihe (generisch) */
.button-row {
  display: flex;
  gap: 10px;
  margin: 10px 0;
  flex-wrap: wrap;
}

/* Scroll-Container in Kunden-Ansicht */
#customerList { max-height: 800px; overflow: auto; }
#customerView #appointmentsSoon { max-height: 200px; overflow: auto; }
#customerView #appointmentsPast { max-height: 200px; overflow: auto; }
#customerView #appointmentsAll { max-height: 260px; overflow: auto; }

/* === Fix: Inputs ragen nicht mehr aus dem Login-Container === */
*, *::before, *::after { box-sizing: border-box; }

.login.card { 
  width: min(92vw, 420px);
  margin: 80px auto;
}

.login input,
.login button {
  width: 100%;
  max-width: 100%;
  display: block;
  box-sizing: border-box;
}

.login input {
  background: #fff;
  border: 1px solid #dbe3e8;
  border-radius: 10px;
}


.login input:focus {
  outline: none;
  border-color: #00acc1;
  box-shadow: 0 0 0 3px rgba(0,172,193,0.15);
}

.login button {
  border-radius: 10px;
  font-weight: 600;
}

/* Überschriften über den 5 Kalender-Spalten */
.calendar-name{
  margin: 0 0 8px 0;
  padding: 4px 6px;
  text-align: center;
  font-weight: 700;
  color: #007c91;
  background: #e9f6f8;
  border: 1px solid #d2ecef;
  border-radius: 6px;
}

/* FullCalendar Titel kleiner machen */
.fc-toolbar-title {
  font-size: 0.5em;
  font-weight: 600;
}
.fc-toolbar-title {
  font-size: 0.5em;
  font-weight: normal;
}

/* ===== Desktop-Optimierung für Kalender-Spalten ===== */
@media (min-width: 901px) {
  .kalender-flex {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
  }
  .calendar-col {
    flex: 1 1 260px;
    min-width: 260px;
  }
}

/* Scrollbare Listen im Adminbereich */
.scroll-box {
  max-height: 250px;
  overflow-y: auto;
}

/* Farben für die Mitarbeiter */
.fc-event.MA1 {
  background-color: peru !important;
  border-color: peru !important;
  color: #000 !important;
}
.fc-event.Kristina {
  background-color: blue !important;
  border-color: blue !important;
  color: #fff !important;
}
.fc-event.Sabine {
  background-color: green !important;
  border-color: green !important;
  color: #fff !important;
}
.fc-event.Tina {
  background-color: lightcoral !important;
  border-color: lightcoral !important;
  color: #000 !important;
}
.fc-event.Claudia {
  background-color: orange !important;
  border-color: orange !important;
  color: #000 !important;
}
/* Grid für Hinweise + Produkte nebeneinander */
.hinweise-produkte-grid {
  display: grid;
  grid-template-columns: 30% 70%;  /* zwei gleich breite Spalten */
  gap: 12px;
  margin-bottom: 12px;
}
.hinweise-produkte-grid textarea {
  min-height: 60px; /* kompakter */
}

/* Behandlung darunter wieder volle Breite */
.behandlung-box textarea {
  min-height: 100px;
}
/* Termintext größer machen (überschreibt FullCalendar) */
.fc-event .fc-event-title,
.fc-event .fc-event-time,
.fc-event .fc-event-main {
  font-size: 1.1em !important;
  line-height: 1.2em !important;
}
.fc-event .fc-event-title {
  font-size: 1.1em !important;
  font-weight: 400;
}



/* Heading row for title + inline input/button */
.heading-row{display:flex;align-items:center;gap:8px;margin:8px 0 6px;}
.heading-row h3{margin:0;flex:0 0 auto;}
.heading-row input { flex:0 0 40%; max-width:180px; padding:6px; border:1px solid #ccc; border-radius:6px; }
.heading-row button{flex:0 0 auto;}


/* === Rechte Notizspalte neben den Kalendern === */
.notes-col{ flex:0 0 240px; }
.notes-area{
  width:100%;
  height:70vh;
  border:1px solid #e0e6ea;
  border-radius:6px;
  padding:10px;
  background:#fafafa;
  box-sizing:border-box;
  font-family: inherit;
  font-size: 0.95em;
  resize: vertical;
}
@media (max-width: 1100px){
  .notes-col{ flex:0 0 200px; }




}


/* === Admin: Termin-Tab Spalten länger === */
#adminView #termineTab #appointmentsSoon,
#adminView #termineTab #appointmentsPast,
#adminView #termineTab #appointmentsAll {
  height: 1000px;      /* Höhe der Spalten im Termin-Tab */
  max-height: none;   /* Deckelung aufheben */
  overflow-y: auto;
}
/* Uhrzeit im Kalender dezenter anzeigen */
.fc-event .fc-event-time {
  font-size: 0.9em !important;
  color: #fff !important;
  font-weight: normal !important;
  opacity: 1;
  

}
