/* EASY_CI_V1: Grundlage des neuen Erscheinungsbilds. Farben nur ueber diese Variablen,
   Schriften liegen lokal in fonts/ (nichts von fremden Servern laden). */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/inter-400.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/inter-500.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/inter-600.woff2") format("woff2");
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/space-grotesk-700.woff2") format("woff2");
}

:root {
  --bf-tiefsee:    #0F3D4A; /* Kopfzeile, Schaltflaechen, Ueberschriften, Text */
  --bf-papier:     #F3F1EC; /* Seitenhintergrund */
  --bf-weiss:      #FFFFFF; /* Karten, Tabellen, Eingabefelder */
  --bf-bernstein:  #F2B632; /* Auswahl, Fokus, wichtigster Knopf */
  --bf-nebel:      #C9D6D3; /* Linien, Rahmen */
  --bf-wochenende: #E6ECEA; /* freie Wochenendtage im Kalender */
  --bf-nebentext:  #4F6268; /* Nebentext, Beschriftungen */
  --bf-petrol-mittel: #3E7482; /* Hover, zweite Ueberschriftzeile (nur grosse Schrift) */
  --bf-klinker:    #A8472F; /* Fehler, Loeschen, Status "pruefen" */

  --bf-schrift: "Inter", system-ui, sans-serif;
  --bf-schrift-titel: "Space Grotesk", system-ui, sans-serif;
}

/* Elefant (eci_logo): Farben auf hellem Grund, auf Tiefsee umgeschaltet ueber .bf-auf-dunkel */
.bf-logo {
  --bf-logo-koerper: var(--bf-tiefsee);
  --bf-logo-ohr: var(--bf-petrol-mittel);
  --bf-logo-zahn: var(--bf-bernstein);
  --bf-logo-auge: var(--bf-papier);
  overflow: visible;
}
.bf-auf-dunkel .bf-logo {
  --bf-logo-koerper: var(--bf-papier);
  --bf-logo-ohr: #9FB8B9;
  --bf-logo-auge: var(--bf-tiefsee);
}
/* Farben der Teile per Klasse (eci_logo setzt keine style-Attribute) */
.bf-logo .bf-k { fill: var(--bf-logo-koerper); }
.bf-logo .bf-ks { stroke: var(--bf-logo-koerper); }
.bf-logo .bf-o { fill: var(--bf-logo-ohr); }
.bf-logo .bf-z { stroke: var(--bf-logo-zahn); }
.bf-logo .bf-a { fill: var(--bf-logo-auge); }

/* Animation nur in der Kopfzeile: alle 9 Sekunden Ruessel, Ohr, Blinzeln */
.easy-ci-home .bf-ruessel { transform-origin: 80px 46px; animation: bf-ruessel 9s ease-in-out infinite; }
.easy-ci-home .bf-ohr     { transform-origin: 68px 42px; animation: bf-ohr 9s ease-in-out infinite; }
.easy-ci-home .bf-auge    { transform-origin: 73px 35px; animation: bf-auge 9s ease-in-out infinite; }

@keyframes bf-ruessel {
  0% { transform: rotate(0deg) } 4% { transform: rotate(-10deg) } 8% { transform: rotate(6deg) }
  12% { transform: rotate(-7deg) } 16% { transform: rotate(3deg) } 20%, 100% { transform: rotate(0deg) }
}
@keyframes bf-ohr {
  0% { transform: scaleX(1) } 5% { transform: scaleX(0.8) } 10% { transform: scaleX(1) }
  15% { transform: scaleX(0.88) } 20%, 100% { transform: scaleX(1) }
}
@keyframes bf-auge {
  0%, 21%, 25%, 58%, 62%, 100% { transform: scaleY(1) } 23%, 60% { transform: scaleY(0.1) }
}
@media (prefers-reduced-motion: reduce) {
  .bf-ruessel, .bf-ohr, .bf-auge { animation: none !important; }
}

/* Statusfarben (Stufe 3). Die Flaechenfarbe je Platz 0-7 kommt aus konfiguration_kunde.php
   (ecc_status_css bzw. style-Attribut); hier stehen Schrift und Rand dazu, damit die Werte zusammenpassen.
   Gilt fuer Kalenderbalken, Legende, Statusspalte der Liste und das Schild in den Buchungsdetails. */
.bf-status {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  box-sizing: border-box;
  border-radius: 7px;
  font-weight: 600;
}
:is(.bf-status, .ecc-bar > span, .ecc-status-zelle, .ehk-belegt).ecc-s0 { color: #2B3A3E; }
:is(.bf-status, .ecc-bar > span, .ecc-status-zelle, .ehk-belegt).ecc-s1 { color: #4A3B00; border: 2px dashed #9C7A00; }
:is(.bf-status, .ecc-bar > span, .ecc-status-zelle, .ehk-belegt).ecc-s2 { color: #3A2000; }
:is(.bf-status, .ecc-bar > span, .ecc-status-zelle, .ehk-belegt).ecc-s3 { color: #FFFFFF; }
:is(.bf-status, .ecc-bar > span, .ecc-status-zelle, .ehk-belegt).ecc-s4 { color: #FFFFFF; }
:is(.bf-status, .ecc-bar > span, .ecc-status-zelle, .ehk-belegt).ecc-s5 { color: #5C1A14; }
:is(.bf-status, .ecc-bar > span, .ecc-status-zelle, .ehk-belegt).ecc-s6 { color: #A8472F; border: 2px solid #A8472F; }
:is(.bf-status, .ecc-bar > span, .ecc-status-zelle, .ehk-belegt).ecc-s7 { color: #4F6268; border: 1px solid #8A979A; background-color: #FFFFFF; }
.bf-storno { text-decoration: line-through; }
.bf-zeichen { font-weight: 700; }
.bf-haken { flex: none; width: 10px; height: 10px; }
/* Legende ueber dem Kalender. Die alten Regeln in easy_calendar.css (Rand, Schrift) und die Schriftfarbe
   aus easy_calendar_layout.js (data-ecc-ink) arbeiten mit !important; daher hier gezielt staerker.
   Rahmen aussen in Tiefsee = erscheint im oeffentlichen Kalender als belegt. */
html.ec-compact.ecc-calendar-page #spalte_2 .ecc-status-agenda span.bf-status { display: inline-flex !important; align-items: center; box-sizing: border-box; height: 18px; padding: 0 5px !important; border: 0 !important; border-radius: 5px; font-size: 11px !important; font-weight: 500; line-height: 1 !important; } /* so klein wie die alte Legende */
html.ec-compact.ecc-calendar-page #spalte_2 .ecc-status-agenda .ecc-legende-titel { align-self: center; color: var(--bf-nebentext); font-size: 11px; font-weight: 600; }
html.ec-compact.ecc-calendar-page #spalte_2 .ecc-status-agenda span.bf-status.ecc-s0 { color: #2B3A3E !important; }
html.ec-compact.ecc-calendar-page #spalte_2 .ecc-status-agenda span.bf-status.ecc-s1 { color: #4A3B00 !important; border: 2px dashed #9C7A00 !important; }
html.ec-compact.ecc-calendar-page #spalte_2 .ecc-status-agenda span.bf-status.ecc-s2 { color: #3A2000 !important; }
html.ec-compact.ecc-calendar-page #spalte_2 .ecc-status-agenda span.bf-status.ecc-s3 { color: #FFFFFF !important; }
html.ec-compact.ecc-calendar-page #spalte_2 .ecc-status-agenda span.bf-status.ecc-s4 { color: #FFFFFF !important; }
html.ec-compact.ecc-calendar-page #spalte_2 .ecc-status-agenda span.bf-status.ecc-s5 { color: #5C1A14 !important; }
html.ec-compact.ecc-calendar-page #spalte_2 .ecc-status-agenda span.bf-status.ecc-s6 { color: #A8472F !important; border: 2px solid #A8472F !important; }
html.ec-compact.ecc-calendar-page #spalte_2 .ecc-status-agenda span.bf-status.ecc-s7 { color: #4F6268 !important; border: 1px solid #8A979A !important; }
html.ec-compact.ecc-calendar-page #spalte_2 .ecc-status-agenda span.bf-status.ecc-legende-online { box-shadow: 0 0 0 1px var(--bf-tiefsee); }
/* Statusspalte der Buchungsliste: nur diese Zelle traegt die Statusfarbe */
.ecc-status-zelle select { color: inherit !important; background: transparent !important; font-weight: 600; }

/* Stufe 4a: einheitlicher Tastaturfokus, 3px Bernstein auf allem, was man mit Tab erreicht */
html.ec-compact :is(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--bf-bernstein);
  outline-offset: 2px;
}

/* Stufe 4b: Knoepfe. Hauptknopf (einer je Seite) Bernstein mit Tiefsee-Schrift, Loeschen Klinker,
   Ecken 10px, Schrift 600. Normale Knoepfe sind seit 4a Tiefsee. Die vorhandenen Klassen der Bereiche
   bleiben; hier nur Farbe, Ecken und Hoehe. */
html.ec-compact #rahmen :is(.es-primary, .es-btn, .primary, .button, .eg-knopf, .esu-knopf, .emg-knopf, a.edb-new, .ec-toolbar button, .ec-toolbar input[type="submit"], input[name="zufuegen"]) {
  border-radius: 10px !important; /* alte Kalenderregeln sind genauer */
  font-weight: 600;
}
html.ec-compact #rahmen :is(.es-primary, .primary, .eg-primaer, .esu-primaer, .emg-primaer, a.edb-new, input[name="zufuegen"]) {
  border-color: var(--bf-bernstein) !important;
  background: var(--bf-bernstein) !important;
  color: var(--bf-tiefsee) !important;
}
html.ec-compact #rahmen :is(.es-primary, .primary, .eg-primaer, .esu-primaer, .emg-primaer, a.edb-new, input[name="zufuegen"]):hover {
  background: color-mix(in srgb, var(--bf-bernstein) 85%, var(--bf-tiefsee)) !important;
}
html.ec-compact #rahmen a.edb-new small { color: var(--bf-tiefsee) !important; }
html.ec-compact #rahmen :is(button, input[type="submit"], input[type="button"], a):is(.es-danger, .es-mb-danger, .danger:not(.quiet)),
html.ec-compact #rahmen form.emg-loeschen button {
  border-color: var(--bf-klinker) !important;
  background: var(--bf-klinker) !important;
  color: #FFFFFF !important;
  border-radius: 10px;
  font-weight: 600;
}
/* Antippbar mindestens 44px: auf Handy und Tablet sowie bei Touch */
@media (max-width: 1024px), (pointer: coarse) {
  html.ec-compact #rahmen :is(button, input[type="submit"], input[type="button"], select, .es-btn, .button, .eg-knopf, .esu-knopf, .emg-knopf, a.edb-new):not(.ecc-pick-close) {
    min-height: 44px;
  }
}

/* Stufe 4c: Karten, Tabellen, Felder. Die Seite liegt auf Papier, Bereiche sind weisse Karten
   (Ecken 12px, Rahmen Nebel, kein Schatten). */
html.ec-compact.ecc-calendar-page :is(#spalte_1, #spalte_2, #spalte_3) { border-radius: 12px !important; box-shadow: none !important; }
html.ec-compact.es-settings :is(.es-panel, .es-box) { border-radius: 12px; }
html.ec-compact .edb .edb-card { border-radius: 12px; }
/* Tabellenkopf der Buchungsliste ruhig: Papier, Nebentext, halbfett */
html.ec-compact.ecc-calendar-page #spalte_3 .kalender_intern_liste tr:first-child > td {
  background: var(--bf-papier) !important;
  color: var(--bf-nebentext) !important;
  font-weight: 600 !important;
}
html.ec-compact.ecc-calendar-page #rahmen #spalte_3 .kalender_intern_liste tr:first-child > td:is(.ecc-col-edit, .ecc-col-object) { background: var(--bf-papier) !important; }
/* Preise rechtsbuendig, Statusspalte breit genug fuer "Portal-Buchung" */
html.ec-compact #rahmen .kalender_intern_liste input[name^="intern_zahlung_"] { text-align: right; }
html.ec-compact #rahmen .ecc-status-zelle select { min-width: 128px !important; } /* das Kalenderskript setzt sonst eine kleinere Mindestbreite */
/* Eingabefelder ausserhalb der dichten Buchungsliste: Rahmen Nebel, Ecken 8px */
html.ec-compact #rahmen :is(input[type="text"], input[type="email"], input[type="tel"], input[type="number"], input[type="date"], input[type="password"], input[type="search"], select, textarea):not(.kalender_intern_liste *):not(.ec-toolbar *):not(.ecc-create-booking *) {
  border-color: var(--bf-nebel);
  border-radius: 8px;
}

/* Stufe 5: Handy-Kalender (easy_handykalender.php). Nur bis 720 px; dort ersetzt die Monatskarte die
   breite Zeitleiste, ihre Werkzeugleiste und die grosse Legende. */
.ehk { display: none; }
@media (max-width: 720px) {
  html.ec-compact.ecc-calendar-page #spalte_2:has(.ehk:not(.ehk-leer)) :is(.ecc-calendar-scroll, form.ec-toolbar, .ecc-status-agenda, .ecc-scroll-hint) { display: none !important; }
  .ehk { display: block; margin: 10px 0 4px; font-family: var(--bf-schrift); color: var(--bf-tiefsee); }
  .ehk-leer p { margin: 8px 0; color: var(--bf-nebentext); font-size: 14px; }
  .ehk-kopf { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
  html.ec-compact .ehk .ehk-titel { margin: 0; padding: 0; color: var(--bf-tiefsee); font: 700 18px/1.2 var(--bf-schrift-titel); }
  html.ec-compact .ehk a.ehk-pfeil { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--bf-nebel); border-radius: 10px; background: var(--bf-weiss); color: var(--bf-tiefsee); font: 700 22px/1 var(--bf-schrift); text-decoration: none; }
  .ehk-woche, .ehk-tage { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
  .ehk-woche span { color: var(--bf-nebentext); font-size: 11px; font-weight: 600; text-align: center; }
  .ehk-tage { margin: 4px 0 0; padding: 0; list-style: none; }
  .ehk-tage li { margin: 0; padding: 0; list-style: none; }
  html.ec-compact .ehk a.ehk-tag { display: flex; flex-direction: column; align-items: center; justify-content: center; box-sizing: border-box; height: 40px; border: 1px solid var(--bf-nebel); border-radius: 8px; text-decoration: none; }
  html.ec-compact .ehk a.ehk-tag:not(.ehk-belegt) { background: var(--bf-weiss); color: var(--bf-tiefsee); }
  html.ec-compact .ehk a.ehk-tag.ehk-we:not(.ehk-belegt) { background: var(--bf-wochenende); }
  html.ec-compact .ehk a.ehk-tag.ecc-s1 { border: 2px dashed #9C7A00; }
  html.ec-compact .ehk a.ehk-tag.ecc-s6 { border: 2px solid #A8472F; }
  html.ec-compact .ehk a.ehk-tag.ecc-s7 { border: 1px solid #8A979A; }
  html.ec-compact .ehk a.ehk-tag.ehk-heute { box-shadow: inset 0 0 0 3px var(--bf-tiefsee); }
  html.ec-compact .ehk a.ehk-tag.ehk-gewaehlt { box-shadow: inset 0 0 0 3px var(--bf-bernstein); }
  .ehk-zahl { font-size: 14px; font-weight: 600; line-height: 1.1; }
  .ehk-zeichen { display: flex; align-items: center; height: 11px; font-size: 10px; font-weight: 700; line-height: 1; }
  .ehk-zeichen:empty { display: none; }
  .ehk-legende { display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 0 0; }
  .ehk-legende .bf-status { height: 18px; padding: 0 6px; font-size: 11px; }
  html.ec-compact .ehk .ehk-unter { margin: 16px 0 6px; padding: 0; color: var(--bf-tiefsee); font: 700 15px/1.2 var(--bf-schrift-titel); }
  .ehk-hinweis { margin: 4px 0; color: var(--bf-nebentext); font-size: 13px; }
  .ehk-liste { margin: 0; padding: 0; list-style: none; border: 1px solid var(--bf-nebel); border-radius: 12px; background: var(--bf-weiss); }
  .ehk-zeile { display: flex; align-items: center; gap: 8px; min-height: 56px; margin: 0; padding: 6px 10px; list-style: none; }
  .ehk-zeile + .ehk-zeile { border-top: 1px solid var(--bf-nebel); }
  html.ec-compact .ehk .ehk-zeile > a { display: flex; flex: 1 1 auto; flex-direction: column; min-width: 0; color: var(--bf-tiefsee); text-decoration: none; }
  .ehk-gast { overflow: hidden; font-size: 15px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
  .ehk-zeit { color: var(--bf-nebentext); font-size: 13px; }
  .ehk-zeile > .bf-status { flex: none; height: 24px; padding: 0 8px; font-size: 12px; }
}
/* Die Kalenderspalte setzt alle Schriften hart auf 11px und faerbt Links um; fuer die Monatskarte hier staerker */
@media (max-width: 720px) {
  html.ec-compact.ecc-calendar-page #rahmen #spalte_2 .ehk :is(.ehk-titel, .ehk-unter) { border: 0 !important; background: none !important; }
  html.ec-compact.ecc-calendar-page #rahmen #spalte_2 .ehk .ehk-titel { font-size: 18px !important; }
  html.ec-compact.ecc-calendar-page #rahmen #spalte_2 .ehk .ehk-unter { font-size: 15px !important; }
  html.ec-compact.ecc-calendar-page #rahmen #spalte_2 .ehk .ehk-zahl { font-size: 14px !important; }
  html.ec-compact.ecc-calendar-page #rahmen #spalte_2 .ehk .ehk-zeichen { font-size: 10px !important; }
  html.ec-compact.ecc-calendar-page #rahmen #spalte_2 .ehk .ehk-woche span { font-size: 11px !important; }
  html.ec-compact.ecc-calendar-page #rahmen #spalte_2 .ehk .ehk-gast { font-size: 15px !important; }
  html.ec-compact.ecc-calendar-page #rahmen #spalte_2 .ehk .ehk-zeit { font-size: 13px !important; }
  html.ec-compact.ecc-calendar-page #rahmen #spalte_2 .ehk .ehk-legende .bf-status { font-size: 11px !important; }
  html.ec-compact.ecc-calendar-page #rahmen #spalte_2 .ehk .ehk-zeile > .bf-status { font-size: 12px !important; }
  html.ec-compact.ecc-calendar-page #rahmen #spalte_2 .ehk .ehk-leer p { font-size: 14px !important; }
  html.ec-compact.ecc-calendar-page #rahmen #spalte_2 .ehk a.ehk-belegt.ecc-s0 { color: #2B3A3E !important; }
  html.ec-compact.ecc-calendar-page #rahmen #spalte_2 .ehk a.ehk-belegt.ecc-s1 { color: #4A3B00 !important; }
  html.ec-compact.ecc-calendar-page #rahmen #spalte_2 .ehk a.ehk-belegt.ecc-s2 { color: #3A2000 !important; }
  html.ec-compact.ecc-calendar-page #rahmen #spalte_2 .ehk a.ehk-belegt.ecc-s3 { color: #FFFFFF !important; }
  html.ec-compact.ecc-calendar-page #rahmen #spalte_2 .ehk a.ehk-belegt.ecc-s4 { color: #FFFFFF !important; }
  html.ec-compact.ecc-calendar-page #rahmen #spalte_2 .ehk a.ehk-belegt.ecc-s5 { color: #5C1A14 !important; }
  html.ec-compact.ecc-calendar-page #rahmen #spalte_2 .ehk a.ehk-belegt.ecc-s6 { color: #A8472F !important; }
  html.ec-compact.ecc-calendar-page #rahmen #spalte_2 .ehk a.ehk-belegt.ecc-s7 { color: #4F6268 !important; }
  html.ec-compact.ecc-calendar-page #rahmen #spalte_2 .ehk :is(a.ehk-frei, a.ehk-pfeil, .ehk-zeile > a) { color: var(--bf-tiefsee) !important; text-decoration: none !important; }
}

/* Stufe 5 Teil 2: gelber Knopf "Neu" in der Handy-Leiste (easy-hauptnavigation.js) */
html.ec-compact #content .easy-ci-tabbar > a.easy-ci-tab-neu .easy-ci-tab-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bf-bernstein);
  color: var(--bf-tiefsee);
}
html.ec-compact #content .easy-ci-tabbar > a.easy-ci-tab-neu .easy-ci-tab-icon svg { width: 20px; height: 20px; stroke-width: 2.6; }
