:root {
  --bg: #F7F5FB;
  --text: #211B33;
  --muted: #8a8398;
  --muted-2: #a29bb0;
  --border: #F1EFF6;
  --border-2: #EEEAF6;
  --accent: #5B21B6;
  --accent-light: #6D28D9;
  --accent-dark: #4A1A94;
  --purple-bg: #EDE6FE;
  --pink: #D0416F;
  --pink-bg: #FCE1EA;
  --amber: #B5730B;
  --amber-bg: #FBEFD6;
  --green: #1F9D63;
  --green-bg: #E3F5EC;
  --blue: #2C5591;
  --blue-bg: #E3EDFB;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  font-family: 'Hanken Grotesk', system-ui, sans-serif;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
a { color: var(--accent-light); text-decoration: none; cursor: pointer; }
a:hover { color: var(--accent-dark); }
button { cursor: pointer; }
[hidden] { display: none !important; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #e3def0; border-radius: 6px; border: 3px solid var(--bg); }

@keyframes floatIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.scr { animation: floatIn .32s ease both; }

/* ---------- Login ---------- */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card {
  width: 300px; display: flex; flex-direction: column; align-items: center; gap: 10px;
  background: #fff; border: 1px solid var(--border); border-radius: 22px; padding: 32px 28px;
  box-shadow: 0 20px 50px -24px rgba(75, 26, 148, .3);
}
.brand-logo {
  width: 48px; height: 48px; border-radius: 14px; background: linear-gradient(140deg, #7C3AED, #5B21B6);
  color: #fff; display: flex; align-items: center; justify-content: center; font-size: 22px; margin-bottom: 4px;
}
.login-card h1 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.login-sub { margin: -6px 0 8px; font-size: 12.5px; color: var(--muted); }
.login-card input {
  width: 100%; background: var(--bg); border: 1px solid #EEECF4; border-radius: 12px;
  padding: 11px 14px; font-size: 14px; font-family: inherit;
}
.login-card button {
  width: 100%; background: var(--accent); color: #fff; border: none; border-radius: 12px;
  padding: 12px; font-weight: 700; font-size: 14px; font-family: inherit;
  box-shadow: 0 10px 22px -8px rgba(91, 33, 182, .55);
}
.login-card button:hover { background: var(--accent-dark); }
.login-card .error { color: var(--pink); font-size: 12.5px; margin: 0; }

/* ---------- App shell ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  display: flex; width: 240px; flex: none; flex-direction: column; gap: 5px;
  background: linear-gradient(180deg, #5B21B6, #43168C); padding: 22px 15px;
  position: sticky; top: 0; height: 100vh; color: #fff; z-index: 20;
}
.sidebar-brand { display: flex; align-items: center; gap: 11px; padding: 6px 8px 22px; }
.sidebar-brand-icon {
  width: 38px; height: 38px; border-radius: 12px; background: rgba(255,255,255,.16);
  display: flex; align-items: center; justify-content: center; font-size: 20px;
}
.sidebar-brand-name { font-weight: 700; font-size: 16px; letter-spacing: -.02em; }
.sidebar-brand-sub { font-size: 11px; color: rgba(255,255,255,.65); }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px;
  font-size: 14.5px; cursor: pointer; transition: background .15s; color: rgba(255,255,255,.8); font-weight: 500;
}
.nav-item i { font-size: 19px; }
.nav-item:hover { color: #fff; }
.nav-item.active { background: #fff; color: var(--accent); font-weight: 600; box-shadow: 0 8px 18px -8px rgba(0,0,0,.32); }
.sidebar-spacer { flex: 1; min-height: 14px; }
.sidebar-user {
  margin-top: 6px; display: flex; align-items: center; gap: 10px; padding: 9px 10px;
  border-radius: 14px; background: rgba(255,255,255,.12);
}
.sidebar-user-avatar {
  width: 32px; height: 32px; border-radius: 10px; background: rgba(255,255,255,.9); color: var(--accent-light);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12.5px; flex: none;
}
.sidebar-user-name { font-weight: 600; font-size: 13px; color: #fff; }
.sidebar-user-role { font-size: 11px; color: rgba(255,255,255,.6); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 15; min-height: 72px; background: rgba(255,255,255,.86);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--border-2);
  display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 28px;
}
.topbar-title { font-size: 20px; font-weight: 700; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-subtitle { font-size: 13px; color: var(--muted); margin-top: 1px; }
.topbar-search {
  display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid #EEECF4;
  border-radius: 999px; padding: 9px 15px; color: var(--muted-2); font-size: 13.5px; width: 180px;
}
.icon-btn {
  width: 40px; height: 40px; flex: none; border-radius: 12px; background: #fff; border: 1px solid #EEECF4;
  color: #5E5772; display: flex; align-items: center; justify-content: center; position: relative;
}

.btn {
  display: flex; align-items: center; gap: 7px; border: none; border-radius: 12px; height: 40px;
  padding: 0 16px; font-weight: 600; font-size: 14px; font-family: inherit;
}
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 10px 22px -8px rgba(91,33,182,.6); }
.btn-primary:hover { background: var(--accent-dark); }
.btn-ghost { background: var(--purple-bg); color: var(--accent); border: 1px solid #E6DAFB; }
.btn-ghost:hover { background: #E9DEFB; }
.btn-sm { height: 38px; border-radius: 11px; padding: 0 15px; font-size: 13.5px; }

.section-body { padding: 24px 28px 40px; display: flex; flex-direction: column; gap: 20px; }

/* ---------- Cards / grids ---------- */
.g4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.kpi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.g3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.split { display: flex; gap: 20px; align-items: flex-start; }
.twocol { display: flex; gap: 20px; align-items: flex-start; }
.card {
  background: #fff; border: 1px solid var(--border); border-radius: 22px; padding: 20px;
  box-shadow: 0 10px 28px -18px rgba(75,26,148,.22);
}
.kpi-card { border-radius: 20px; padding: 17px; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; }
.kpi-icon { width: 38px; height: 38px; border-radius: 12px; background: #fff; display: flex; align-items: center; justify-content: center; }
.kpi-badge { font-size: 11.5px; font-weight: 700; }
.kpi-value { font-size: 28px; font-weight: 700; margin-top: 12px; letter-spacing: -.02em; }
.kpi-label { font-size: 12.5px; font-weight: 500; }
.kpi-purple { background: var(--purple-bg); } .kpi-purple .kpi-icon { color: var(--accent-light); } .kpi-purple .kpi-badge, .kpi-purple .kpi-value { color: var(--accent-dark); } .kpi-purple .kpi-label { color: #7c66b0; }
.kpi-green { background: var(--green-bg); } .kpi-green .kpi-icon { color: var(--green); } .kpi-green .kpi-badge, .kpi-green .kpi-value { color: #177049; } .kpi-green .kpi-label { color: #5b9c7c; }
.kpi-amber { background: #FCE8DF; } .kpi-amber .kpi-icon { color: #D06A3C; } .kpi-amber .kpi-badge, .kpi-amber .kpi-value { color: #B15329; } .kpi-amber .kpi-label { color: #b07f66; }
.kpi-blue { background: var(--blue-bg); } .kpi-blue .kpi-icon { color: var(--blue); } .kpi-blue .kpi-badge, .kpi-blue .kpi-value { color: #2C5591; } .kpi-blue .kpi-label { color: #6d84a8; }

.appt-row {
  display: flex; align-items: center; gap: 14px; background: #fff; border: 1px solid var(--border);
  border-radius: 16px; padding: 11px 13px; cursor: default;
}
.appt-row:hover { box-shadow: 0 8px 20px -12px rgba(75,26,148,.3); border-color: #E4DBF6; }
.appt-time {
  width: 52px; height: 52px; border-radius: 14px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; flex: none;
}
.appt-time span:first-child { font-size: 13px; font-weight: 700; }
.appt-time span:last-child { font-size: 9.5px; opacity: .75; }
.appt-info { flex: 1; min-width: 0; }
.appt-info-name { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appt-info-service { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill { font-size: 11px; font-weight: 600; padding: 4px 11px; border-radius: 999px; white-space: nowrap; }

.mini-cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.mini-cal-title { font-size: 15px; font-weight: 700; }
.mini-cal-nav { display: flex; gap: 8px; color: #b8b1c4; }
.mini-cal-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 1px; }
.mini-cal-dow { text-align: center; font-size: 9.5px; color: #b8b1c4; font-weight: 700; margin-bottom: 5px; }
.mini-cal-day { height: 30px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 12.5px; color: #3f3852; }
.mini-cal-day.other { color: #cbc4d6; }
.mini-cal-day .dot { width: 4px; height: 4px; border-radius: 50%; }
.mini-cal-day .today-badge { width: 27px; height: 27px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; }

.util-card { display: flex; align-items: center; gap: 18px; }
.util-ring { width: 96px; height: 96px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: none; }
.util-ring-inner { width: 66px; height: 66px; border-radius: 50%; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.util-pct { font-size: 19px; font-weight: 700; color: var(--accent); line-height: 1; }
.util-caption { font-size: 9px; color: var(--muted-2); }
.util-title { font-size: 15px; font-weight: 700; }
.util-sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; line-height: 1.5; }

/* ---------- Kalender ---------- */
.cal-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cal-toolbar-left { display: flex; align-items: center; gap: 12px; }
.cal-toolbar-title { font-size: 19px; font-weight: 700; letter-spacing: -.02em; }
.cal-nav-btns { display: flex; gap: 4px; }
.cal-nav-btn {
  width: 34px; height: 34px; border-radius: 10px; background: #fff; border: 1px solid #EEECF4;
  color: #5E5772; display: flex; align-items: center; justify-content: center;
}
.cal-today-btn {
  height: 34px; padding: 0 13px; border-radius: 10px; background: #fff; border: 1px solid #EEECF4;
  color: var(--accent); font-weight: 600; font-size: 13px; font-family: inherit;
}
.cal-table {
  background: #fff; border: 1px solid var(--border); border-radius: 20px; overflow: hidden;
  box-shadow: 0 10px 28px -20px rgba(75,26,148,.2);
}
.cal-head-row { display: grid; grid-template-columns: repeat(7,1fr); background: #F4F1FB; border-bottom: 1px solid var(--border-2); }
.cal-head-cell { padding: 11px 12px; font-size: 11px; font-weight: 700; letter-spacing: .05em; color: var(--muted); text-transform: uppercase; }
.cal-body { display: grid; grid-template-columns: repeat(7,1fr); grid-auto-rows: 108px; }
.cal-cell { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 7px 8px; font-size: 12.5px; font-weight: 600; overflow: hidden; cursor: pointer; }
.cal-cell:hover { background: #FBFAFE; }
.cal-cell.today:hover { background: #F0E9FC; }
.cal-cell.weekend { background: #FBFAFD; color: #b8a0c0; }
.cal-cell.other { color: #cbc4d6; }
.cal-cell.today { background: #F6F1FE; }
.cal-day-num { display: inline-flex; }
.cal-day-num.today-badge { align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 11.5px; }
.cal-chips { margin-top: 5px; display: flex; flex-direction: column; gap: 3px; }
.cal-chip { font-size: 10px; font-weight: 600; border-radius: 5px; padding: 2px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.cal-more { font-size: 9.5px; font-weight: 700; color: var(--muted); padding: 0 6px; }

/* ---------- Kundinnen ---------- */
.customer-list { width: 340px; flex: none; }
.search-box {
  display: flex; align-items: center; gap: 8px; background: var(--bg); border: 1px solid #EEECF4;
  border-radius: 12px; padding: 9px 13px; color: var(--muted-2); font-size: 13.5px; margin-bottom: 12px;
}
.search-box input { border: none; background: transparent; outline: none; font-family: inherit; font-size: 13.5px; color: var(--text); width: 100%; }
.chip-filters { display: flex; gap: 7px; margin-bottom: 6px; flex-wrap: wrap; }
.chip-filter { font-size: 12px; font-weight: 600; color: var(--muted); background: #F3F1F9; padding: 5px 12px; border-radius: 999px; }
.chip-filter.active { color: #fff; background: var(--accent); }
.customer-row { display: flex; align-items: center; gap: 12px; padding: 11px 10px; border-radius: 14px; }
.customer-row:hover { background: #FAF8FD; }
.customer-row.active { background: #F4EFFE; }
.avatar { width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex: none; }
.customer-row-info { flex: 1; min-width: 0; }
.customer-row-name { font-weight: 600; font-size: 14px; }
.customer-row-meta { font-size: 12px; color: var(--muted); }
.dot-indicator { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-light); flex: none; }
.badge-neu { font-size: 9.5px; font-weight: 700; color: var(--green); background: var(--green-bg); padding: 2px 7px; border-radius: 999px; flex: none; }

.customer-detail-head { display: flex; align-items: flex-start; gap: 18px; flex-wrap: wrap; }
.avatar-lg {
  width: 64px; height: 64px; border-radius: 20px; background: linear-gradient(140deg,#7C3AED,#5B21B6);
  color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 22px; flex: none;
}
.tag-pill { font-size: 10.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.tag-stamm { color: var(--accent-light); background: var(--purple-bg); }
.tag-vip { color: var(--amber); background: var(--amber-bg); }
.contact-row { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 8px; font-size: 13px; color: var(--muted); }
.contact-row span { display: flex; align-items: center; gap: 6px; }
.contact-row i { font-size: 15px; color: #a99fb8; }
.stat-box { background: var(--bg); border-radius: 14px; padding: 13px 14px; }
.stat-box-value { font-size: 21px; font-weight: 700; letter-spacing: -.02em; }
.stat-box-label { font-size: 11.5px; color: var(--muted); }
.history-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid #F4F2F8; }
.history-row:last-child { border-bottom: none; }
.history-icon { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex: none; }
.history-name { font-size: 13.5px; font-weight: 600; }
.history-date { font-size: 11.5px; color: var(--muted-2); }
.history-price { font-size: 13.5px; font-weight: 700; }
.next-appt-card {
  background: linear-gradient(140deg,#6D28D9,#5B21B6); border-radius: 22px; padding: 18px; color: #fff;
  box-shadow: 0 14px 30px -14px rgba(91,33,182,.6);
}
.next-appt-label { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: rgba(255,255,255,.7); font-weight: 600; }
.next-appt-date { font-size: 17px; font-weight: 700; margin-top: 8px; }
.next-appt-service { font-size: 12.5px; color: rgba(255,255,255,.82); margin-top: 2px; }
.note-card-title { font-size: 14px; font-weight: 700; margin-bottom: 8px; display: flex; align-items: center; gap: 7px; }
.note-card-title i { color: var(--accent-light); }
.note-text { font-size: 12.5px; color: #6b6579; line-height: 1.55; }

/* ---------- Behandlungen ---------- */
.category-chips { display: flex; gap: 7px; flex-wrap: wrap; }
.category-chip { font-size: 12.5px; font-weight: 600; color: var(--muted); background: #fff; border: 1px solid #EEECF4; padding: 6px 14px; border-radius: 999px; }
.category-chip.active { color: #fff; background: var(--accent); border-color: var(--accent); }
.category-group-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.category-dot { width: 9px; height: 9px; border-radius: 50%; }
.category-group-title { font-size: 14px; font-weight: 700; }
.service-card { background: #fff; border: 1px solid var(--border); border-radius: 18px; padding: 16px; box-shadow: 0 8px 20px -16px rgba(75,26,148,.2); }
.service-icon { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.service-name { font-size: 15px; font-weight: 700; }
.service-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.service-duration { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.service-price { font-size: 17px; font-weight: 700; color: var(--accent); }

/* ---------- Material ---------- */
.table-wrap { background: #fff; border: 1px solid var(--border); border-radius: 20px; overflow: hidden; box-shadow: 0 10px 28px -20px rgba(75,26,148,.2); }
.table-scroll { overflow-x: auto; }
.table-min { min-width: 720px; }
.table-head-row {
  display: grid; padding: 12px 18px; background: var(--bg); border-bottom: 1px solid var(--border-2);
  font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted-2);
}
.table-row { display: grid; align-items: center; padding: 13px 18px; border-bottom: 1px solid #F4F3F8; }
.table-row:last-child { border-bottom: none; }
.table-row:hover { background: #FAFAFC; }
.inv-cols { grid-template-columns: minmax(190px,1.8fr) 120px 90px 120px 100px 130px; }
.inv-thumb { width: 34px; height: 34px; border-radius: 9px; object-fit: cover; flex: none; }
.inv-thumb-empty { display: flex; align-items: center; justify-content: center; background: var(--purple-bg); color: var(--accent-light); font-size: 16px; }
.photo-drop { width: 72px; height: 72px; border-radius: 14px; background: var(--bg); border: 1px solid #EEECF4; display: flex; align-items: center; justify-content: center; overflow: hidden; flex: none; color: var(--muted-2); font-size: 22px; }
.photo-drop img { width: 100%; height: 100%; object-fit: cover; }
.status-pill { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px; }
.status-ok { color: var(--green); background: var(--green-bg); }
.status-niedrig { color: var(--amber); background: var(--amber-bg); }
.status-leer { color: var(--pink); background: var(--pink-bg); }
.stat-strip-card { background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 15px 16px; }
.stat-strip-value { font-size: 23px; font-weight: 700; letter-spacing: -.02em; }
.stat-strip-label { font-size: 12px; color: var(--muted); }

/* ---------- Rechnungen ---------- */
.inv-cols-list { grid-template-columns: 80px 1.4fr 90px 90px 110px; }
.invoice-pdf-link { display: inline-flex; align-items: center; gap: 5px; color: var(--accent); }
.invoice-pdf-link:hover { color: var(--accent-dark); text-decoration: underline; }
.inv-tab { font-size: 12px; font-weight: 600; color: var(--muted); padding: 5px 11px; border-radius: 8px; }
.inv-tab.active { color: #fff; background: var(--accent); }
.status-offen { color: var(--amber); background: var(--amber-bg); }
.status-bezahlt { color: var(--green); background: var(--green-bg); }
.status-überfällig { color: var(--pink); background: var(--pink-bg); }
.invoice-panel { width: 400px; flex: none; background: #fff; border: 1px solid #E4DBF6; border-radius: 22px; padding: 20px; box-shadow: 0 16px 40px -20px rgba(75,26,148,.34); }
.invoice-customer { display: flex; align-items: center; gap: 11px; background: var(--bg); border-radius: 14px; padding: 10px 12px; margin-bottom: 14px; }
.palette-chip { display: flex; align-items: center; gap: 7px; border-radius: 999px; padding: 7px 12px; }
.palette-chip i { font-size: 14px; }
.palette-chip span { font-size: 12px; font-weight: 600; }
.invoice-line { display: flex; align-items: center; gap: 10px; background: #FBFAFD; border: 1px solid var(--border); border-radius: 12px; padding: 8px 10px; }
.qty-btn { width: 24px; height: 24px; border-radius: 7px; border: 1px solid #E6DAFB; background: #fff; color: var(--accent-light); font-family: inherit; cursor: pointer; font-size: 14px; line-height: 1; display: flex; align-items: center; justify-content: center; }
.invoice-totals-row { display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: var(--muted); }
.invoice-totals-row.grand { font-size: 16px; font-weight: 700; margin-top: 4px; color: var(--text); }
.invoice-totals-row.grand span:last-child { color: var(--accent); }

/* ---------- Einstellungen ---------- */
.field-label { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted-2); margin-bottom: 5px; }
.field-value, .field-input { background: var(--bg); border: 1px solid #EEECF4; border-radius: 11px; padding: 11px 13px; font-size: 14px; font-family: inherit; width: 100%; color: var(--text); }
.pref-row { display: flex; align-items: center; justify-content: space-between; padding: 11px 0; border-top: 1px solid #F4F2F8; }
.pref-title { font-size: 13.5px; font-weight: 600; }
.pref-sub { font-size: 11.5px; color: var(--muted-2); }
.toggle { width: 42px; height: 24px; border-radius: 999px; position: relative; cursor: pointer; background: #DCD6E8; }
.toggle.on { background: var(--accent); }
.toggle span { position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: left .15s; }
.toggle.on span { left: auto; right: 2px; }
.edit-row { display: flex; align-items: center; gap: 8px; }
.edit-row .field-input { flex: 1; min-width: 0; padding: 9px 11px; font-size: 13px; }
.hours-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #F4F2F8; font-size: 13.5px; }
.hours-row:last-child { border-bottom: none; }
.hours-row span:first-child { color: #6b6579; }
.hours-row span:last-child { font-weight: 600; }
.team-row { display: flex; align-items: center; gap: 11px; padding: 9px 0; border-bottom: 1px solid #F4F2F8; }
.team-row:last-child { border-bottom: none; }
.team-avatar { width: 38px; height: 38px; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex: none; }
.team-name { font-size: 13.5px; font-weight: 600; }
.team-role { font-size: 11.5px; color: var(--muted-2); }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(33,27,51,.4); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal {
  background: #fff; border-radius: 22px; padding: 24px; width: 420px; max-width: 100%;
  max-height: 90vh; overflow-y: auto; box-shadow: 0 30px 70px -30px rgba(33,27,51,.5);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal-head h3 { margin: 0; font-size: 17px; font-weight: 700; }
.modal-close { width: 30px; height: 30px; border-radius: 9px; border: none; background: #F3F1F9; color: var(--accent); display: flex; align-items: center; justify-content: center; }
.modal-field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.modal-field label { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted-2); }
.modal-field input, .modal-field select, .modal-field textarea {
  background: var(--bg); border: 1px solid #EEECF4; border-radius: 11px; padding: 10px 12px;
  font-size: 14px; font-family: inherit; color: var(--text);
}
.modal-actions { display: flex; gap: 8px; margin-top: 16px; }
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--text); color: #fff;
  padding: 12px 20px; border-radius: 12px; font-size: 13.5px; font-weight: 600; z-index: 200;
  box-shadow: 0 20px 40px -20px rgba(0,0,0,.4);
}

/* ---------- Bottom nav (iOS-Style Tab-Bar) ---------- */
.bottomnav {
  display: none; position: fixed; bottom: 0; left: 0; right: 0;
  background: rgba(255,255,255,.9); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-2);
  padding: 7px 6px calc(7px + env(safe-area-inset-bottom));
  justify-content: space-around; z-index: 60;
}
.bottomnav-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 10px; font-weight: 600; flex: 1; color: #a99fb8; min-height: 46px;
  border-radius: 12px; transition: color .15s;
}
.bottomnav-item i { font-size: 22px; }
.bottomnav-item.active { color: var(--accent); }
.bottomnav-item:active { background: var(--purple-bg); }

.rail { width: 344px; flex: none; display: flex; flex-direction: column; gap: 20px; }
.mobile-back { display: none; }
.day-appt { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 9px 11px; cursor: pointer; }
.day-appt:active { background: #FAF8FD; }
.more-row { display: flex; align-items: center; gap: 13px; background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 13px 14px; cursor: pointer; font-size: 15px; font-weight: 600; }
.more-row:active { background: #FAF8FD; }
.more-ic { width: 38px; height: 38px; border-radius: 11px; background: var(--purple-bg); color: var(--accent-light); display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 700; flex: none; }
.admin-row { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 12px 14px; box-shadow: 0 8px 20px -16px rgba(75,26,148,.2); }
.perm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
.perm-item { display: flex; align-items: center; gap: 7px; font-size: 13.5px; }
.lic { font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.lic-ok { color: var(--green); background: var(--green-bg); }
.lic-bad { color: var(--pink); background: var(--pink-bg); }

/* ---------- Tablet / kleiner Desktop ---------- */
@media (max-width: 1150px) { .hide-md { display: none !important; } }

/* ---------- Smartphone ---------- */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .bottomnav { display: flex; }
  .main { padding-bottom: calc(66px + env(safe-area-inset-bottom)) !important; }
  .g4, .kpi-grid { grid-template-columns: 1fr 1fr !important; }
  .g2 { grid-template-columns: 1fr !important; }
  .split, .twocol { flex-direction: column !important; gap: 14px !important; align-items: stretch !important; }
  .split > .rail, .twocol > .customer-list, .twocol > .invoice-panel, .rail { width: auto !important; }
  .hide-sm { display: none !important; }

  /* Kompakte, nicht umbrechende Topbar mit Safe-Area oben */
  .topbar { flex-wrap: nowrap; min-height: 54px; gap: 8px; padding: env(safe-area-inset-top) 14px 0; }
  .topbar-title { font-size: 17px; }
  .topbar-subtitle { font-size: 12px; }
  .topbar .btn-ghost, .topbar .topbar-bell { display: none; }
  .icon-btn { width: 38px; height: 38px; }
  .btn-primary { height: 38px; padding: 0 12px; }

  .section-body { padding: 16px 14px 32px; gap: 16px; }
  #scr-kundinnen, #scr-rechnungen { padding-top: 16px !important; }

  /* Kundinnen: Master-Detail — nur eine Ansicht gleichzeitig */
  #kundinnenTwocol #customerDetail { display: none; }
  #kundinnenTwocol.show-detail .customer-list { display: none; }
  #kundinnenTwocol.show-detail #customerDetail { display: flex; }
  .mobile-back {
    display: inline-flex; align-items: center; gap: 6px; align-self: flex-start;
    background: #fff; border: 1px solid var(--border-2); color: var(--accent);
    border-radius: 999px; padding: 8px 14px; font-weight: 600; font-size: 14px; margin-bottom: 2px;
  }

  /* Tabellen → Karten-Listen (kein horizontales Scrollen) */
  .table-scroll { overflow-x: visible; -webkit-overflow-scrolling: touch; }
  .table-min { min-width: 0 !important; }
  .table-head-row { display: none !important; }
  .table-row.inv-cols, .table-row.inv-cols-list { grid-template-columns: 1fr auto; grid-auto-rows: auto; gap: 3px 10px; padding: 13px 14px; align-items: center; }
  .table-row.inv-cols > :nth-child(1) { grid-row: 1; grid-column: 1; }
  .table-row.inv-cols > :nth-child(2) { grid-row: 2; grid-column: 1; }
  .table-row.inv-cols > :nth-child(3) { grid-row: 1; grid-column: 2; justify-self: end; }
  .table-row.inv-cols > :nth-child(4) { grid-row: 2; grid-column: 2; justify-self: end; }
  .table-row.inv-cols-list > :nth-child(1) { grid-row: 1; grid-column: 1; }
  .table-row.inv-cols-list > :nth-child(2) { grid-row: 2; grid-column: 1; }
  .table-row.inv-cols-list > :nth-child(4) { grid-row: 1; grid-column: 2; justify-self: end; }
  .table-row.inv-cols-list > :nth-child(5) { grid-row: 2; grid-column: 2; justify-self: end; }

  /* 16px verhindert iOS-Auto-Zoom beim Fokussieren von Feldern */
  input, select, textarea, .field-input { font-size: 16px !important; }
}

/* ---------- Bottom-Sheet-Modals ---------- */
@media (max-width: 640px) {
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal {
    width: 100%; max-width: 100%; border-radius: 22px 22px 0 0; max-height: 92vh;
    padding: 10px 18px calc(20px + env(safe-area-inset-bottom));
    -webkit-overflow-scrolling: touch;
    animation: sheetUp .3s cubic-bezier(.32,.72,0,1) both;
  }
  .modal::before { content: ""; display: block; width: 38px; height: 5px; border-radius: 3px; background: #E2DCEC; margin: 4px auto 14px; }
  @keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }
  .modal .btn { min-height: 46px; }
}

/* ---------- Kalender auf schmalen Screens: Punkte statt Text-Chips ---------- */
@media (max-width: 560px) {
  .g4 { grid-template-columns: 1fr 1fr !important; }
  .g3 { grid-template-columns: 1fr !important; }
  .cal-head-cell { padding: 8px 4px; font-size: 9.5px; text-align: center; }
  .cal-body { grid-auto-rows: 58px; }
  .cal-cell { padding: 5px 4px; font-size: 12px; }
  .cal-chips { flex-direction: row; flex-wrap: wrap; gap: 3px; margin-top: 4px; justify-content: center; }
  .cal-chip { width: 6px; height: 6px; min-width: 6px; padding: 0; border-radius: 50%; font-size: 0; overflow: hidden; }
  .cal-more { display: none; }
}
