/* efinia CRM — App Styles
   Alle CRM-spezifischen Styles. Keine Website-Styles hier.
----------------------------------------------------------------------------- */

@import url('https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,300;0,400;0,700;1,300;1,400&display=swap');

/* ── Root / Design Tokens ─────────────────────────────────────────────────── */
:root {
  --accent:          #97C99B;
  --accent-dark:     #7ab37e;
  --accent-light:    rgba(151,201,155,.12);
  --dark:            #314453;
  --dark-70:         rgba(49,68,83,.7);
  --dark-20:         rgba(49,68,83,.12);
  --dark-10:         rgba(49,68,83,.01);

  --bg:              #F2F3F4;
  --bg-card:         #ffffff;
  --border:          rgba(49,68,83,.12);
  --border-strong:   rgba(49,68,83,.25);

  --text:            #314453;
  --text-muted:      rgba(49,68,83,.8);
  --text-light:      rgba(49,68,83,.35);

  --status-open:     #e8a838;
  --status-warn:     #d9534f;
  --status-ok:       #97C99B;
  --status-grey:     rgba(49,68,83,.3);

  --appt-pending:    #314453;   /* ausstehend: dunkel */
  --appt-confirmed:  #97C99B;   /* bestätigt: grün */
  --appt-cancelled:  #d9534f;   /* abgesagt: rot */
  --appt-postponed:  #f0a500;   /* verschoben: orange */

  --header-h:        52px;
  --radius:          4px;
  --shadow:          0 1px 4px rgba(49,68,83,.1);
  --shadow-md:       0 4px 16px rgba(49,68,83,.12);

  --font:            'Lato', Arial, Helvetica, sans-serif;
  --font-size:       16px;
  --font-size-sm:    14px;
  --font-size-xs:    14px;
  --font-h3:         20px;

/* ── Typography ───────────────────────────────────────────────────────────── */
h1,h2,h3,h4,h5,h6 { font-family: var(--font); }
h3 { font-size: var(--font-h3); font-weight: 700; font-family: var(--font); }
.modal-header h3 { font-size: var(--font-h3); }

}

/* ── Reset / Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  font-family: var(--font);
  font-size: var(--font-size);
  color: var(--text);
  background: var(--bg);
  height: 100%;
  overflow: hidden;
}
.uk-link, a {
    color: var(--accenta);
}

/* ── Login ────────────────────────────────────────────────────────────────── */
.login-screen {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--dark);
  z-index: 9999;
}
.login-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 36px 32px 32px;
  width: 100%; max-width: 340px;
}
.login-logo {
  text-align: center;
  margin-bottom: 24px;
}
.login-logo img { height: 40px; }
.login-error {
  font-size: var(--font-size-sm);
  color: var(--status-warn);
  margin: 6px 0 0;
}

/* ── App Shell: vertikale Sidebar ─────────────────────────────────────────── */
.app-root {
  display: flex; flex-direction: row;
  height: 100vh; overflow: hidden;
}

/* ── Sidebar ──────────────────────────────────────────────────────────────── */
.app-sidebar {
  width: 220px;
  min-height: 100vh;
  background: var(--dark);
  display: flex; flex-direction: column;
  flex-shrink: 0;
  transition: width .2s ease;
  z-index: 100;
  overflow: hidden;
}
.app-sidebar.collapsed { width: 54px; }

/* Logo-Bereich oben */
.sidebar-logo {
  display: flex; align-items: center; justify-content: center;
  padding: 16px 12px 12px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
  min-height: 180px;
}
.sidebar-logo img { height: 130px; max-width: 130px; display: block; object-fit: contain; }
.app-sidebar.collapsed .sidebar-logo img { height: 28px; max-width: 38px; }
.app-sidebar.collapsed .sidebar-logo { min-height: 180px; padding: 35px 0; align-items: flex-start; }

/* Nav vertikal */
.header-nav {
  display: flex; flex-direction: column;
  gap: 2px; padding: 10px 8px;
  flex: 1;
}
.nav-btn {
  display: flex; align-items: center; gap: 10px;
  background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,.65);
  font: var(--font-size) var(--font);
  padding: 9px 10px;
  border-radius: var(--radius);
  transition: color .15s, background .15s;
  white-space: nowrap; width: 100%;
  text-align: left;
}
.nav-btn:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav-btn.active { color: #fff; background: rgba(151,201,155,.25); }
.nav-btn .nav-label { font-size: var(--font-size); }
.app-sidebar.collapsed .nav-btn { justify-content: center; padding: 9px; }
.app-sidebar.collapsed .nav-label { display: none; }

/* Profil unten in Sidebar */
.sidebar-bottom {
  padding: 8px;
  border-top: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}
.app-content {
  flex: 1; display: flex; flex-direction: column;
  overflow: hidden; min-width: 0;
}

/* Header-Buttons (Profil etc.) */
.hdr-btn {
  width: 34px; height: 34px;
  background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,.7);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  transition: color .15s, background .15s;
}
.hdr-btn:hover { color: #fff; background: rgba(255,255,255,.1); }

/* Profile dropdown */
.profile-wrap { position: relative; }
.profile-dropdown { min-width: 220px; padding: 8px 0; }
.profile-dropdown .profile-email {
  padding: 8px 14px 10px; font-size: var(--font-size-sm); color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.profile-dropdown .profile-name { font-weight: 700; color: var(--text); font-size: var(--font-size); }
.profile-action {
  display: block; width: 100%; padding: 8px 14px;
  background: none; border: none; cursor: pointer;
  text-align: left; font: var(--font-size) var(--font);
  color: var(--text); transition: background .12s;
}
.profile-action:hover { background: var(--dark-10); }
.profile-action.danger { color: var(--status-warn); }

/* Collapsed: Tooltip-Effekt auf Nav-Buttons */
.app-sidebar.collapsed .nav-btn { position: relative; }

/* ── View container ───────────────────────────────────────────────────────── */
.view-content {
  flex: 1; overflow-y: auto; display: none; min-width: 0;
}
.view-content.active { display: flex; flex-direction: column; }

/* ── Toolbar / Searchbar ──────────────────────────────────────────────────── */
.view-toolbar {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 20px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.search-wrap {
  position: relative; flex: 1; max-width: calc(100% - 130px);
}
.search-icon {
  position: absolute; left: 10px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}
.search-input {
  width: 100%; padding: 7px 10px 7px 34px;
  border: none;
  border-radius: var(--radius);
  font: var(--font-size) var(--font);
  color: var(--text); background: var(--bg);
  outline: none;
  transition: background .15s, border-color .15s;
}
.search-input:focus {
  background: #fff;
  border-bottom: 1.5px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
}

.view-count { font-size: var(--font-size-sm); color: var(--text-muted); margin-left: auto; }

/* ── Kunden-Liste ─────────────────────────────────────────────────────────── */
.list-wrap { flex: 1; overflow-y: auto; }

.list-item {
  display: flex; align-items: center;
  padding: 11px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
  gap: 12px;
  transition: background .1s;
}
.list-item:hover { background: var(--dark-10); }
.list-item:hover .item-actions { opacity: 1; }

/* ── Kunden-Accordion ─────────────────────────────────────────────────────── */
.cust-accordion {
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}
.cust-row-header {
  display: flex; align-items: center;
  padding: 11px 20px;
  gap: 12px;
  cursor: pointer;
  user-select: none;
  transition: background .1s;
}
.cust-row-header:hover { background: var(--dark-10); }
.cust-row-header:hover .item-actions { opacity: 1; }
.cust-accordion.open > .cust-row-header {
  background: var(--dark);
  color: var(--accent);
}
.cust-accordion.open > .cust-row-header:hover { background: var(--dark); }
.cust-accordion.open > .cust-row-header .item-name,
.cust-accordion.open > .cust-row-header .item-sub,
.cust-accordion.open > .cust-row-header .item-phone { color: rgba(255,255,255,.8); }
.cust-accordion.open > .cust-row-header .item-btn,
.cust-accordion.open > .cust-row-header .cust-chevron { color: rgba(255,255,255,.7); }
.cust-accordion.open > .cust-row-header .item-btn:hover { color: #fff; background: rgba(255,255,255,.12); }
.cust-chevron {
  color: var(--text-muted); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; margin-left: 4px;
}
.cust-accordion-body {
  border-top: 1px solid var(--border);
  background: var(--dark-20);
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height .3s ease, opacity .25s ease;
}
.cust-accordion-body.open {
  max-height: 2000px;
  opacity: 1;
}

.item-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 16px; }
.item-name { font-weight: 700; font-size: 14px; white-space: nowrap; min-width: 200px;}
.item-sub  { font-size: var(--font-size); color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-phone { font-size: var(--font-size-sm); color: var(--text-muted); width: 150px; flex-shrink: 0; }
.item-bday  {
  font-size: 11px; font-weight: 700;
  color: var(--accent-dark); background: var(--accent-light);
  padding: 2px 7px; border-radius: 20px;
  flex-shrink: 0;
}

.item-actions {
  display: flex; align-items: center; gap: 2px;
  opacity: 0; transition: opacity .15s;
  flex-shrink: 0;opacity: .5;
}
.item-btn {
  width: 30px; height: 30px;
  background: none; border: none; cursor: pointer;
  color: var(--text-muted);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  transition: color .12s, background .12s;
}
.item-btn:hover { color: var(--dark); background: var(--dark-10); }
.item-btn.danger:hover { color: var(--status-warn); }
.item-btn.wa:hover { color: #97C99B; }

/* ── Kalender ─────────────────────────────────────────────────────────────── */
.calendar-wrap {
  flex: 1; padding: 16px 20px;
  overflow: hidden; display: flex; flex-direction: column;
}
#calendar-container { flex: 1; min-height: 0; }

/* FullCalendar overrides */
.fc { font-family: var(--font) !important; font-size: var(--font-size); }
.fc .fc-toolbar-title { font-size: 16px; font-weight: 700; color: var(--dark); }
.fc .fc-button {
  background: var(--bg-card) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
  font-family: var(--font) !important;
  font-size: var(--font-size-sm) !important;
  box-shadow: none !important;
}
.fc .fc-button:hover, .fc .fc-button-active {
  background: var(--dark-10) !important;
}
.fc .fc-button-primary:not(:disabled).fc-button-active {
  background: var(--dark) !important;
  color: #fff !important;
  border-color: var(--dark) !important;
}
.fc .fc-today-button {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: #fff !important;
}
.fc-event {
  cursor: pointer;
  border-radius: 3px !important;
  font-size: var(--font-size-sm) !important;
}
.fc-event-pending    { background: var(--appt-pending)   !important; border-color: var(--appt-pending)   !important; color: #fff !important; }
.fc-event-confirmed  { background: var(--appt-confirmed) !important; border-color: var(--appt-confirmed) !important; color: #fff !important; }
.fc-event-cancelled  { background: var(--appt-cancelled) !important; border-color: var(--appt-cancelled) !important; color: #fff !important; }
.fc .fc-timegrid-slot { height: 2.2em; }
.fc .fc-scrollgrid { border-color: var(--border) !important; }
.fc .fc-col-header-cell { background: var(--bg); }
.fc .fc-day-today { background: var(--accent-light) !important; }

/* ── Rechnungen ───────────────────────────────────────────────────────────── */
.inv-status-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px;
  border: 1px solid currentColor;
  border-radius: 20px;
  font-size: 11px; font-weight: 700;
  cursor: pointer; background: none;
  transition: all .15s;
  white-space: nowrap;
}
.inv-status-btn.offen   { color: var(--status-open); }
.inv-status-btn.gemahnt { color: var(--status-warn); }
.inv-status-btn.bezahlt { color: var(--status-ok); border-style: solid; }
.inv-status-btn:hover { opacity: .75; }

.inv-number { font-weight: 400; font-size: var(--font-size-sm); min-width: 80px; color: var(--text-muted); }
.inv-date   { font-size: var(--font-size-sm); color: var(--text-muted); min-width: 80px; }
.inv-total  { font-weight: 700; min-width: 80px; text-align: right; }

/* ── Modal ────────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(49,68,83,.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(2px);
}
.modal-dialog {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  width: 100%; max-width: 520px;
  max-height: 90vh;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.modal-body { min-height: 0; }  /* wichtig: flex-child darf schrumpfen */
.modal-footer { flex-shrink: 0; }  /* Footer bleibt immer sichtbar */
.modal-dialog.wide { max-width: 680px; }
.modal-header {
  display: flex; align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-header h3 { margin: 0; font-size: 15px; flex: 1; }
.modal-close {
  background: none; border: none; cursor: pointer;
  font-size: 20px; line-height: 1;
  color: var(--text-muted); padding: 0 4px;
}
.modal-close:hover { color: var(--text); }
.modal-body {
  padding: 18px; overflow-y: auto; flex: 1;
  display: flex; flex-direction: column; gap: 14px;
}
.modal-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0;
}
.modal-footer .spacer { flex: 1; }

/* Form fields */
.field-label {
  display: block;
  font-size: 11px; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 4px;
}
.field-row { display: flex; flex-direction: column; gap: 3px; }
.field-row-inline { display: flex; gap: 12px; }
.field-row-inline .field-row { flex: 1; }

.uk-input, .uk-select, .uk-textarea {
  background: var(--bg) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  color: var(--text) !important;
  font: var(--font-size) var(--font) !important;
  transition: border-color .15s !important;
}
.uk-input:focus, .uk-select:focus, .uk-textarea:focus {
  border-color: var(--accent) !important;
  outline: none !important;
  background: #fff !important;
}
.uk-button {
  font: 700 var(--font-size) var(--font) !important;
  border-radius: var(--radius) !important;
  text-transform: none !important;
  transition: background .15s, color .15s !important;
  padding-top: 6px;
  padding-bottom: 6px;
}
.uk-button-primary {
  background: var(--accent) !important;
  color: #fff !important;
  border: none !important;
}
.uk-button-primary:hover { background: var(--accent-dark) !important; }
.uk-button-default {
  background: var(--bg) !important;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
}
.uk-button-default:hover { background: var(--dark-10) !important; }
.uk-button-danger {
  background: var(--status-warn) !important;
  color: #fff !important;
  border: none !important;
}

/* ── Rechnungs-Positionen ─────────────────────────────────────────────────── */
.positions-list { display: flex; flex-direction: column; gap: 6px; }
.position-row {
  display: flex; align-items: center; gap: 8px;
}
.position-row input { flex: 1; }
.position-row .pos-amount { width: 90px; }
.position-row .pos-del {
  width: 30px; height: 30px;
  background: var(--dark-10); border: none; cursor: pointer;
  color: var(--text-muted); border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s;
}
.position-row .pos-del:hover { color: var(--status-warn); background: var(--dark-20); }

.positions-total {
  display: flex; justify-content: flex-end;
  font-weight: 700; font-size: 15px;
  padding: 6px 0;
  border-top: 1px solid var(--border);
  color: var(--dark);
}

/* ── Termin-Checkboxen in Invoice-Modal ───────────────────────────────────── */
.appt-picker { display: flex; flex-direction: column; gap: 6px; }
.appt-pick-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background .12s, border-color .12s;
}
.appt-pick-row:hover { background: var(--dark-10); }
.appt-pick-row.selected { border-color: var(--accent); background: var(--accent-light); }
.appt-pick-row input[type=checkbox] { flex-shrink: 0; }
.appt-pick-info { flex: 1; }
.appt-pick-name { font-weight: 700; font-size: var(--font-size); }
.appt-pick-sub  { font-size: var(--font-size-sm); color: var(--text-muted); }
.appt-pick-price { font-weight: 700; font-size: var(--font-size); color: var(--dark); }

/* ── Empty states ─────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state [uk-icon] { margin-bottom: 12px; opacity: .4; }
.empty-state p { margin: 8px 0 0; font-size: var(--font-size); }

/* ── UiKit Dropdown overrides ─────────────────────────────────────────────── */
.uk-dropdown {
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow-md) !important;
  border: 1px solid var(--border) !important;
  padding: 6px !important;
}

/* ── Notification ─────────────────────────────────────────────────────────── */
.uk-notification-message {
  font-family: var(--font) !important;
  font-size: var(--font-size) !important;
  border-radius: var(--radius) !important;
}
.uk-notification-message-success { background: var(--accent) !important; color: #fff !important; }
.uk-notification-message-danger  { background: var(--status-warn) !important; color: #fff !important; }

/* ── Spinner ──────────────────────────────────────────────────────────────── */
.loading-row {
  padding: 40px; text-align: center;
  color: var(--text-muted);
}

/* ── Scrollbar ────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--dark-20); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--dark-70); }

/* ── Kunden-Detail ────────────────────────────────────────────────────────── */
/* Ablage two-column layout */
.detail-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-bottom: none;
}
.detail-col {
  min-width: 0;
}
.detail-col + .detail-col {
  border-left: 1px solid var(--border);
}
@media (max-width: 620px) {
  .detail-two-col { grid-template-columns: 1fr; }
  .detail-col + .detail-col { border-left: none; border-top: 1px solid var(--border); }
}
/* Ablage item */
.ablage-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: var(--font-size);
}
.ablage-item:last-child { border-bottom: none; }
.ablage-item-thumb {
  width: 120px; height: 120px; object-fit: cover;
  border-radius: 4px; flex-shrink: 0;
  border: 1px solid var(--border);
}
.ablage-pdf-link {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; color: var(--accent);
  width: 120px; flex-shrink: 0;
}
.ablage-item-body { flex: 1; min-width: 0; }
.ablage-edit-text {
  font-family: var(--font); font-size: var(--font-size);
  line-height: 1.4; color: var(--text);
  width: 100%; border: none; background: none;
  resize: none; padding: 0; outline: none;
}
.ablage-edit-text:disabled { cursor: default; color: var(--text); }
.ablage-edit-text:not(:disabled) { background: var(--bg); border-radius: var(--radius); padding: 4px; }
.ablage-date-input {
  font-family: var(--font); font-size: 13px; border: none; background: none;
  color: var(--text-muted); cursor: pointer;
  padding: 0; margin-bottom: 4px; display: block; outline: none;
}
.ablage-date-input:disabled { cursor: default; pointer-events: none; }
.ablage-date-input:not(:disabled) { background: var(--bg); border-radius: var(--radius); padding: 2px 4px; }
.ablage-date-input::-webkit-calendar-picker-indicator { opacity: 0.4; cursor: pointer; }
.ablage-title-input {
  font-family: var(--font); font-size: var(--font-size);
  font-weight: 600; color: var(--text);
  width: 100%; border: none; background: none;
  padding: 0; outline: none; display: block; margin-bottom: 2px;
}
.ablage-title-input:disabled { cursor: default; }
.ablage-title-input:not(:disabled) { background: var(--bg); border-radius: var(--radius); padding: 4px; }
.ablage-item-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.ablage-item-actions {
  display: flex; flex-direction: column; align-items: flex-end;
  gap: 4px; flex-shrink: 0;
}
.ablage-item-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); padding: 2px; flex-shrink: 0;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius); opacity: 0.5;
}
.ablage-item-btn:hover { opacity: 1; background: var(--dark-10); }
.ablage-item-btn.is-del:hover { color: var(--status-warn); background: rgba(217,83,79,.08); }
.ablage-item-btn.is-confirm { color: var(--accent); opacity: 1; }
.ablage-item-del {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); padding: 2px; flex-shrink: 0;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius); opacity: 0.5;
}
.ablage-item-del:hover { opacity: 1; color: var(--status-warn); background: rgba(217,83,79,.08); }
.detail-section { padding: 16px 20px; }
.detail-section-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--dark);
  margin-bottom: 10px;
  display: flex; align-items: center; gap: 2px;
}
.detail-section-title > button { flex-shrink: 0; }
.detail-add-btn {
  width: 30px; height: 30px;
  background: none; border: none; cursor: pointer;
  color: var(--dark); padding: 0;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  transition: color .12s, background .12s;
}
.detail-add-btn:hover { color: var(--dark); background: var(--dark-10); }
.detail-hr {
  margin: 0; border: none;
  border-top: 1px solid var(--border);
}
.detail-appt-row {
  display: flex; align-items: center; gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-size: var(--font-size);
}
.detail-appt-row:last-child { border-bottom: none; }
.detail-appt-date { min-width: 110px; font-weight: 700; }
.detail-appt-treat { flex: 1; color: var(--text-muted); }
.detail-appt-status {
  font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: 20px;
}
.status-confirmed { color: var(--status-ok); background: rgba(151,201,155,.12); }
.status-pending   { color: var(--status-open); background: rgba(232,168,56,.1); }
.status-cancelled { color: var(--text-muted); background: var(--dark-10); }
.detail-inv-row {
  display: flex; align-items: center; gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-size: var(--font-size);
}
.detail-inv-row:last-child { border-bottom: none; }
.detail-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 20px;
  font-size: var(--font-size);
}
.detail-info-item label {
  display: block; font-size: 11px; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase;
  letter-spacing: .04em; margin-bottom: 2px;
}
.detail-empty { color: var(--text-muted); font-size: var(--font-size); padding: 8px 0; }

/* ── Dashboard Cards ──────────────────────────────────────────────────────── */
.dashboard-cards {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  padding: 20px;
}
.dashboard-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 20px;
  min-width: 160px; flex: 1;
  cursor: default;
}
.dashboard-card h4 { color: var(--dark);
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--text-muted);
  margin: 0 0 12px;
}

.card-stat {
  display: flex; justify-content: space-between; align-items: center;
  font-size: var(--font-size);
}
.card-stat-label { color: var(--text-muted); }
.card-stat-value {
  font-weight: 700; font-size: 15px;
  min-width: 30px; text-align: right;
}
.card-stat-value.accent { color: var(--accent); }
.card-stat-value.warn   { color: var(--status-warn); }
.card-stat-value.amber  { color: var(--status-open); }
.card-stat-value.muted  { color: var(--text-muted); }

/* ── FAB Buttons ──────────────────────────────────────────────────────────── */
.fab-btn {
  position: absolute; bottom: 20px; right: 20px;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--dark);
  color: #fff; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-md);
  transition: background .15s, transform .15s;
  z-index: 10;
}
.fab-btn:hover { background: var(--accent); transform: scale(1.05); }
.calendar-wrap { position: relative; }

/* ── Filter-Button aktiv = primary ───────────────────────────────────────── */
.inv-filter-btn.active {
  background: var(--accent) !important;
  color: #fff !important;
  border-color: var(--accent) !important;
}

/* ── Behandlungs-Zeile im Termin-Modal ───────────────────────────────────── */
.treat-row {
  display: flex; align-items: center; gap: 6px;
}
.treat-row select { flex: 1; }
.treat-row .pos-del {
  width: 28px; height: 28px; flex-shrink: 0;
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
}
.treat-row .pos-del:hover { color: var(--status-warn); background: var(--dark-10); }

/* ── WhatsApp-Button in Rechnungsliste ───────────────────────────────────── */
.wa-inv-btn { color: var(--accent) !important; }
.wa-inv-btn:hover { background: var(--accent-light) !important; }

/* ── Invoice-Status Select ────────────────────────────────────────────────── */
.inv-status-select {
  appearance: none; -webkit-appearance: none;
  border: 1px solid currentColor !important;
  border-radius: 20px !important;
  padding: 2px 10px !important;
  font-size: 11px !important; font-weight: 700 !important;
  cursor: pointer !important;
  background: none !important;
  min-width: 80px;
  text-align: center;
}
.inv-status-select.offen   { color: var(--status-open); }
.inv-status-select.gemahnt { color: var(--status-warn); }
.inv-status-select.bezahlt { color: var(--status-ok); }

/* ── Kalender Listansicht: Hover-Fix ─────────────────────────────────────── */
.fc-list-event:hover td { background: var(--dark-10) !important; }
.fc-list-event td { color: var(--text) !important; }
.fc-list-event-title { color: var(--text) !important; }
.fc-list-day-cushion { background: var(--bg) !important; }
.fc-event-postponed { background: var(--appt-postponed) !important; border-color: var(--appt-postponed) !important; color:#fff !important; }

/* ── Geburtstag-Events ────────────────────────────────────────────────────── */
.fc-birthday-event { background: rgba(49,68,83,.08) !important; border: 1px solid var(--dark) !important; color: var(--dark) !important; font-size:11px !important; }
.fc-birthday-event .fc-event-main { color: var(--dark) !important; }

/* ── Dashboard Cards: Donut + Layout ─────────────────────────────────────── */

.dashboard-card-chart { flex-shrink:0; }

.card-treat-list { display:flex; flex-direction:column; gap:4px; margin-top:2px; }
.card-treat-row { display:flex; justify-content:space-between; align-items:center; font-size:var(--font-size-sm); gap:8px; }
.card-treat-label { color:var(--dark); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; flex:1; }
.card-treat-bar { height:4px; border-radius:2px; background:var(--accent); flex-shrink:0; }
.card-treat-count { font-weight:700; min-width:20px; text-align:right; }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 960px) {
  .nav-label { display:none !important; }
  .item-phone { display: none !important; }
  .item-sub   { display: none !important; }
  .dashboard-cards { display:grid; grid-template-columns:1fr 1fr; gap:12px; padding:14px; }
  .dashboard-card { flex: 0 0 49%; }
  .btn-new-text-long { display:none; }
  .item-actions { opacity:1 !important; }
  .item-sub { display:none; }
  .inv-date { display:none; }
  .btn-new-text-long { display:none !important; }
  .btn-new-text-short { display:inline !important; }
  .inv-number {display: none;}
  .view-count {display: none !important;}
  .view-toolbar .uk-button-primary {width: 130px;}
  .view-toolbar .inv-filter-btn {display: none;  }
}
@media (max-width: 640px) {
  .dashboard-cards { grid-template-columns:1fr; }
  .item-phone { display:none; }
}

/* ── Trash / Delete Buttons global ──────────────────────────────────────── */
.pos-del {
  width: 30px; height: 30px;
  background: var(--dark-10); border: none; cursor: pointer;
  color: var(--text-muted); border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s;
  flex-shrink: 0;
}
.pos-del:hover { color: var(--status-warn); background: var(--dark-20); }

/* ── Leistungen-Edit-Row ──────────────────────────────────────────────────── */
.treat-edit-row {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 0;
}
.treat-edit-row input { font-size: var(--font-size) !important; padding: 5px 8px !important; }

/* ── Sidebar Responsive ───────────────────────────────────────────────────── */
@media (max-width: 960px) {
  .nav-label { display: none !important; }
  .app-sidebar { width: 52px !important; }
  .sidebar-logo img { height: 22px; }
}
@media (max-width: 640px) {
  .app-sidebar { width: 44px !important; }
  .nav-btn { padding: 8px 6px !important; }
}

/* ── Firma-Settings Modal ─────────────────────────────────────────────────── */
.color-preview {
  width: 28px; height: 28px; border-radius: var(--radius);
  border: 1px solid var(--border); flex-shrink: 0;
}

/* ── Dashboard 2-Spalten, grössere Charts ─────────────────────────────────── */

.dashboard-card-chart svg { width: 80px !important; height: 80px !important; }

/* Sidebar Bottom: kein Dropdown-Wrapper nötig */
.sidebar-user {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 18px;
  border-top: 1px solid rgba(255,255,255,.08);
  gap: 6px;
}
.sidebar-user-name {
  font-size: var(--font-size-sm); color: rgba(255,255,255,.7);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  flex: 1; min-width: 0; padding: 6px 4px;
}
.app-sidebar.collapsed .sidebar-user-name { display: none; }

/* ── Borderless Inputs / Buttons ──────────────────────────────────────────── */
.uk-input,
.uk-select,
.uk-textarea {
  border: none !important;
  border-bottom: none !important;
  border-radius: var(--radius) !important;
  background: var(--bg) !important;
  box-shadow: none !important;
  transition: background .15s, border-color .15s !important;
}
.uk-input:focus,
.uk-select:focus,
.uk-textarea:focus {
  border-bottom: 1.5px solid var(--border) !important;
  border-radius: var(--radius) var(--radius) 0 0 !important;
  background: #fff !important;
  outline: none !important;
}
.uk-button {
  border: none !important;
  box-shadow: none !important;
}
.uk-button-default {
  background: var(--dark-20) !important;
  border: none !important;
}
.uk-button-default:hover {
  background: var(--dark-70) !important;
  color: #F2F3F4 !important;
}
/* Modal inputs: transparent border normal, visible on focus */
.modal-body .uk-input,
.modal-body .uk-select,
.modal-body .uk-textarea {
  border-bottom: 1px solid rgba(255,255,255,0) !important;
}
.modal-body .uk-input:focus,
.modal-body .uk-select:focus,
.modal-body .uk-textarea:focus {
  border-bottom: 1.5px solid var(--border) !important;
  background: #fff !important;
}

/* ── Kalender Listenansicht: weisse Zeilen, farbige Dots ──────────────────── */
.fc-list-event td { background: #fff !important; }
.fc-list-event:hover td { background: var(--dark-10) !important; }
/* Dot Farbe aus borderColor des Events (bereits gesetzt) */

/* ── Close / Modal-Close Buttons ──────────────────────────────────────────── */
.modal-close {
  background: var(--dark-10);
  border: none; cursor: pointer;
  width: 30px; height: 30px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  font-size: 20px; line-height: 1;
  transition: background .15s, color .15s;
  padding: 0;
}
.modal-close:hover { background: var(--dark-20); color: var(--text); }

/* ── Input vertical center ────────────────────────────────────────────────── */
.uk-input[type="date"],
.uk-input[type="time"],
.uk-input[type="number"] {
  display: flex;
  align-items: center;
  height: 40px;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

/* ── Einstellungen 2-Spalten-Grid ─────────────────────────────────────────── */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 700px) {
  .settings-grid { grid-template-columns: 1fr; }
}

/* ── Dashboard Card Inner Layout ─────────────────────────────────────────── */
.dashboard-card-inner {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  min-height: 140px;
  margin-top: 20px;
}
.card-stats {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 150px;
}
.card-stats-main {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
}
.card-stats-summary {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* ── Dashboard 2 Spalten unter 1200px ────────────────────────────────────── */
@media (max-width: 1200px) {
  .dashboard-cards { grid-template-columns: 1fr 1fr !important; }
}

/* ── Dashboard Responsive ─────────────────────────────────────────────────── */
@media (max-width: 1200px) { .dashboard-cards { grid-template-columns: 1fr 1fr !important; } }
@media (max-width: 640px)  { .dashboard-cards { grid-template-columns: 1fr !important; } }

/* ── Refresh FAB ──────────────────────────────────────────────────────────── */
.refresh-fab {
  position: fixed; bottom: 20px; right: 20px;
  width: 40px; height: 40px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; z-index: 200;
  box-shadow: var(--shadow-md);
  color: var(--text-muted);
  transition: background .15s, color .15s, transform .2s;
}
.refresh-fab:hover { background: var(--dark); color: #fff; transform: rotate(180deg); }

/* ── Filter Dropdown ──────────────────────────────────────────────────────── */
.filter-chip {
  display: inline-flex; align-items: center;
  padding: 4px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 700;
  cursor: pointer; border: 1px solid var(--border);
  background: var(--bg); color: var(--text-muted);
  transition: all .15s; white-space: nowrap;
  user-select: none;
}
.filter-chip.active { background: var(--dark); color: #fff; border-color: var(--dark); }
.filter-chip.active-accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.filter-dropdown-content { padding: 10px; min-width: 220px; display: flex; flex-wrap: wrap; gap: 6px; }

/* ── Aktiv/Inaktiv Toggle ─────────────────────────────────────────────────── */
.active-toggle {
  display: inline-flex; border-radius: 20px; overflow: hidden;
  border: 1px solid var(--border);
}
.active-toggle button {
  padding: 4px 12px; font-size: 12px; font-weight: 700;
  border: none; cursor: pointer; transition: all .15s;
  background: var(--bg); color: var(--text-muted);
}
.active-toggle button.on-active  { background: var(--accent);  color: #fff; }
.active-toggle button.on-inactive { background: var(--dark-20); color: var(--text-muted); }

/* ── Filter Bar (slide-down, inline) ─────────────────────────────────────── */
.filter-bar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 8px 20px;
  flex-shrink: 0;
  animation: slideDown .15s ease;
}
.filter-bar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.btn-filter-active { background: var(--dark) !important; color: #fff !important; }

/* ── Kunden Detail: Responsive ────────────────────────────────────────────── */
@media (max-width: 960px) {
  /* Termin-Zeilen: Datum+Status+Icon oben, Behandlung darunter */
  .detail-appt-row { flex-wrap: wrap; gap: 2px 6px; align-items: center; }
  .detail-appt-date { font-size: 13px; }
  .detail-appt-status { margin-left: 0; }
  .detail-appt-row > .item-btn { margin-left: 0; }
  .detail-appt-treat { flex-basis: 100%; order: 10; min-width: 0; }

  /* Kundeninfos: Labels ausblenden */
  .detail-info-item label { display: none; }

  /* Kunden-Dialog: Body scrollbar sicherstellen */
  .detail-two-col { overflow-y: auto; }
  .cust-accordion-body { overflow-y: auto; }
}

@media (max-width: 640px) {
  /* Kunden-Zeile kompakter */
  .cust-row-header { padding: 10px 10px; gap: 4px; }

  /* "Credits" Wort ausblenden — Badge zeigt nur Zahlen */
  .item-bday .credits-label { display: none; }

  /* Kundeninfos-Grid: einspaltiger Stack, Labels bleiben ausgeblendet (960px-Regel) */
  .detail-info-grid { display: block; }
}
