/* Schneider Industriemontage — Portal
   Dashboard-inspired surfaces with a focused black login experience. */

:root {
  --lang-globe-size: 44px;
  --lang-globe-gutter: 108px;
  --ink: #17324d;
  --ink-soft: #60748a;
  --muted: #8ea0b2;
  --line: #dce5ed;
  --line-strong: #c8d5e1;
  --paper: #f6f8fb;
  --panel: #ffffff;
  --navy: #102a43;
  --blue: #2b78c5;
  --teal: #159a91;
  --orange: #e78d35;
  --shadow: 0 12px 34px rgba(22, 51, 78, .08);
  --shadow-soft: 0 5px 18px rgba(22, 51, 78, .05);
  --surface: #fff;
  --surface-soft: #f8fbfd;
  --surface-muted: #fbfcfd;
  --surface-hover: #f1f6fa;
  --segment-bg: #e8eef4;
  --segment-active: #fff;
  --success: #2e8b61;
  --danger: #b42318;
  --warning: #a15c12;
  --radius: 18px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", Inter, ui-sans-serif, system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { min-height: 100%; background: var(--paper); color: var(--ink); font-family: var(--font); }
body { min-width: 320px; min-height: 100vh; margin: 0; background: var(--paper); color: var(--ink); -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
button { cursor: pointer; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, p { margin: 0; }

/* Login / setup */
.auth-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 32px 18px 20px;
  background: #000;
  color: #f4f7fa;
}
.auth-body::before {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  content: "";
  background:
    radial-gradient(ellipse 70% 45% at 30% 0%, rgba(43,120,197,.2), transparent 55%),
    radial-gradient(ellipse 50% 35% at 85% 20%, rgba(231,141,53,.12), transparent 50%);
}
.auth-body > * { position: relative; z-index: 1; }
.card {
  width: min(100%, 438px);
  padding: 34px 34px 32px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--radius);
  background: rgba(255,255,255,.07);
  backdrop-filter: blur(22px) saturate(1.4);
  -webkit-backdrop-filter: blur(22px) saturate(1.4);
  box-shadow: 0 20px 60px rgba(0,0,0,.48), inset 0 1px 0 rgba(255,255,255,.08);
}
.brand { margin-bottom: 27px; text-align: center; }
.brand h1 { margin-top: 18px; color: #fff; font-size: clamp(21px, 4vw, 26px); font-weight: 750; letter-spacing: -.035em; line-height: 1.1; }
.brand .sub { margin-top: 8px; color: #9caab5; font-size: 13px; }
.login-logo { display: block; width: min(100%, 276px); height: auto; max-height: 180px; margin: 0 auto; object-fit: contain; }
.auth-body label { display: block; margin: 18px 0 7px; color: #aab7c1; font-size: 12px; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; }
.auth-body input[type="email"], .auth-body input[type="password"], .auth-body input[type="text"] {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid #34414b;
  border-radius: 10px;
  outline: none;
  background: #080a0c;
  color: #f5f8fa;
  font-size: 15px;
  transition: border-color .16s, box-shadow .16s, background .16s;
}
.auth-body input::placeholder { color: #687681; }
.auth-body input:focus { border-color: var(--blue); background: #0b1116; box-shadow: 0 0 0 3px rgba(43,120,197,.2); }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  margin-top: 20px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #fff;
  background: var(--blue);
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  transition: transform .16s, background .16s, border-color .16s, box-shadow .16s;
}
.btn:hover { background: #2369ad; box-shadow: 0 7px 18px rgba(43,120,197,.23); text-decoration: none; transform: translateY(-1px); }
.btn:focus-visible, .theme-toggle:focus-visible, .theme-seg-btn:focus-visible { outline: 3px solid rgba(43,120,197,.35); outline-offset: 2px; }
.btn-block { width: 100%; }
.btn-ghost { min-height: 36px; margin-top: 0; padding: 8px 12px; border-color: var(--line-strong); color: var(--navy); background: var(--surface); }
.btn-ghost:hover { border-color: var(--blue); color: var(--navy); background: var(--surface-hover); box-shadow: none; }
.auth-body .btn { margin-top: 24px; color: #071522; background: #f7fafc; }
.auth-body .btn:hover { background: #fff; box-shadow: 0 8px 22px rgba(255,255,255,.13); }
.msg { margin: 0 0 18px; padding: 12px 14px; border: 1px solid; border-radius: 10px; font-size: 13px; line-height: 1.45; }
.msg.err { border-color: rgba(255,107,107,.35); color: #ffb3b3; background: rgba(180,35,24,.2); }
.msg.ok { border-color: rgba(65,184,131,.34); color: #9be0b9; background: rgba(46,139,97,.18); }
.msg.warn { border-color: rgba(231,141,53,.4); color: #f4c384; background: rgba(161,92,18,.2); }
.msg strong { color: inherit; }
.foot { padding: 18px 12px 0; color: #71808b; font-size: 11px; text-align: center; }
.auth-body code { border: 1px solid #29343d; border-radius: 5px; padding: 2px 5px; color: #d9e4ec; background: #080a0c; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; }
.setup-body .card { max-width: 560px; }
.setup-brand { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.setup-brand .login-logo { width: 116px; height: 78px; margin: 0; }
.setup-brand h1 { color: #fff; font-size: 24px; letter-spacing: -.03em; }
.setup-brand p { margin-top: 5px; color: #9caab5; font-size: 13px; }

/* Dashboard shell */
.topbar { border-bottom: 1px solid var(--line); background: var(--surface); }
.topbar-inner { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px 12px; max-width: 1180px; margin: 0 auto; padding: 18px calc(26px + var(--lang-globe-gutter)) 18px 26px; position: relative; }
.brand-inline { display: inline-flex; align-items: center; gap: 12px; min-width: 0; color: var(--navy); font-size: 14px; font-weight: 800; letter-spacing: -.015em; grid-column: 2; grid-row: 1; }
.topbar-logo { display: block; width: 78px; height: 38px; border-radius: 7px; object-fit: contain; object-position: center; background: #000; }
.topnav { display: none; grid-column: 1 / -1; grid-row: 2; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 10px; width: 100%; padding: 12px 0 4px; border-top: 1px solid var(--line); }
.topnav.is-open { display: flex; }
.user-chip { color: var(--ink-soft); font-size: 12px; font-weight: 650; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 42px 26px 52px; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.brand-block { min-width: 0; }
.eyebrow, .section-kicker { color: var(--blue); font-size: 11px; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
.eyebrow { display: flex; align-items: center; gap: 9px; margin-bottom: 11px; }
.eyebrow::before { width: 22px; height: 3px; border-radius: 99px; content: ""; background: linear-gradient(90deg, var(--blue), var(--teal)); }
.wrap h1 { color: var(--navy); font-size: clamp(28px, 4vw, 43px); font-weight: 850; letter-spacing: -.055em; line-height: 1; }
.lead, .subtitle { margin-top: 11px; color: var(--ink-soft); font-size: 14px; line-height: 1.5; }
.header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; flex-wrap: wrap; }
.theme-toggle { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: 10px; color: var(--navy); background: var(--surface); font-size: 12px; font-weight: 750; }
.theme-toggle:hover { border-color: var(--blue); background: var(--surface-hover); }
.theme-icon { color: var(--orange); font-size: 15px; line-height: 1; }
.summary-strip { display: flex; align-items: stretch; gap: 11px; margin: 0 0 27px; }
.summary-card { display: grid; gap: 3px; min-width: 150px; padding: 14px 17px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); box-shadow: var(--shadow-soft); }
.summary-label { color: var(--ink-soft); font-size: 11px; font-weight: 750; }
.summary-card strong { color: var(--navy); font-size: 22px; letter-spacing: -.04em; }
.data-status { display: flex; align-items: center; gap: 8px; margin-left: auto; align-self: center; color: var(--ink-soft); font-size: 12px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 4px rgba(21,154,145,.12); }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.tile { min-height: 178px; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-soft); transition: border-color .16s, box-shadow .16s, transform .16s; }
.tile:hover { border-color: #c4d7e6; box-shadow: var(--shadow); transform: translateY(-2px); }
.tile h2 { margin: 9px 0 8px; color: var(--navy); font-size: 18px; font-weight: 850; letter-spacing: -.025em; }
.tile p { min-height: 44px; margin: 0 0 18px; color: var(--ink-soft); font-size: 13px; line-height: 1.55; }
.tile-accent { width: 34px; height: 4px; border-radius: 99px; background: var(--blue); }
.tile:nth-child(2) .tile-accent { background: var(--teal); }
.tile:nth-child(3) .tile-accent { background: var(--orange); }
.badge { display: inline-flex; align-items: center; min-height: 25px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-soft); background: var(--surface-muted); font-size: 10px; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; }
.tile:nth-child(1) .badge { border-color: rgba(43,120,197,.24); color: var(--blue); background: rgba(43,120,197,.08); }
.tile:nth-child(2) .badge { border-color: rgba(21,154,145,.24); color: var(--teal); background: rgba(21,154,145,.08); }
.tile:nth-child(3) .badge { border-color: rgba(231,141,53,.28); color: var(--warning); background: rgba(231,141,53,.1); }

/* Glass (Liquid Glass) dashboard theme — frosted panels on black. */
html[data-theme="glass"] {
  color-scheme: dark;
  --ink: #f2f5f8;
  --ink-soft: #a8b4c0;
  --muted: #7a8794;
  --line: rgba(255,255,255,.12);
  --line-strong: rgba(255,255,255,.18);
  --paper: #000000;
  --panel: rgba(255,255,255,.08);
  --navy: #f5f7fa;
  --blue: #4da3ff;
  --teal: #37c2b1;
  --orange: #ff9f4a;
  --shadow: 0 18px 48px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.06);
  --shadow-soft: 0 8px 28px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.06);
  --surface: rgba(255,255,255,.07);
  --surface-soft: rgba(255,255,255,.09);
  --surface-muted: rgba(255,255,255,.04);
  --surface-hover: rgba(255,255,255,.12);
  --segment-bg: rgba(255,255,255,.06);
  --segment-active: rgba(255,255,255,.14);
  --success: #63d39b;
  --danger: #ff9a9a;
  --warning: #f0b36b;
}
html[data-theme="glass"] body {
  background:
    radial-gradient(ellipse 70% 45% at 18% -8%, rgba(43,120,197,.2), transparent 55%),
    radial-gradient(ellipse 55% 40% at 92% 8%, rgba(231,141,53,.12), transparent 50%),
    #000;
  background-attachment: fixed;
}
html[data-theme="glass"] .topbar,
html[data-theme="glass"] .tile,
html[data-theme="glass"] .panel,
html[data-theme="glass"] .summary-card,
html[data-theme="glass"] .table-wrap,
html[data-theme="glass"] .toolbar-form,
html[data-theme="glass"] .cal-month,
html[data-theme="glass"] .upcoming-panel {
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-color: rgba(255,255,255,.14);
}
html[data-theme="glass"] .topbar { background: rgba(255,255,255,.06); }
html[data-theme="glass"] .tile:hover { border-color: rgba(77,163,255,.4); box-shadow: 0 0 0 1px rgba(77,163,255,.15), var(--shadow); }
html[data-theme="glass"] .status-dot { box-shadow: 0 0 0 4px rgba(55,194,177,.22); }
html[data-theme="glass"] .btn-ghost, html[data-theme="glass"] .theme-toggle, html[data-theme="glass"] .theme-seg {
  color: var(--navy);
  background: rgba(255,255,255,.07);
  border-color: rgba(255,255,255,.16);
  backdrop-filter: blur(12px);
}
html[data-theme="glass"] .theme-seg { background: rgba(255,255,255,.06); }
html[data-theme="glass"] .nav-link.is-active {
  color: #fff;
  background: rgba(77,163,255,.22);
  box-shadow: 0 0 0 1px rgba(77,163,255,.35), 0 0 16px rgba(43,120,197,.22);
}
html[data-theme="glass"] .tile:nth-child(1) .badge { background: rgba(94,175,234,.14); }
html[data-theme="glass"] .tile:nth-child(2) .badge { background: rgba(55,194,177,.14); }
html[data-theme="glass"] .tile:nth-child(3) .badge { background: rgba(240,164,88,.14); }
html[data-theme="glass"] .auth-body .card {
  background: rgba(255,255,255,.07);
  border-color: rgba(255,255,255,.14);
  backdrop-filter: blur(22px) saturate(1.4);
  -webkit-backdrop-filter: blur(22px) saturate(1.4);
}

/* Solid dark — no frosted glass, no strong glows */
html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e8eef4;
  --ink-soft: #9aa8b6;
  --muted: #738290;
  --line: #1e2833;
  --line-strong: #2a3542;
  --paper: #0b0f14;
  --panel: #121820;
  --navy: #f0f4f8;
  --blue: #4da3ff;
  --teal: #37c2b1;
  --orange: #ff9f4a;
  --shadow: 0 12px 32px rgba(0,0,0,.45);
  --shadow-soft: 0 6px 18px rgba(0,0,0,.28);
  --surface: #121820;
  --surface-soft: #161d27;
  --surface-muted: #0e141b;
  --surface-hover: #1a2330;
  --segment-bg: #0e141b;
  --segment-active: #1a2330;
  --success: #63d39b;
  --danger: #ff9a9a;
  --warning: #f0b36b;
}
html[data-theme="dark"] body {
  background: #0b0f14;
  background-attachment: scroll;
}
html[data-theme="dark"] .topbar,
html[data-theme="dark"] .tile,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .summary-card,
html[data-theme="dark"] .table-wrap,
html[data-theme="dark"] .toolbar-form,
html[data-theme="dark"] .cal-month,
html[data-theme="dark"] .upcoming-panel {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-color: var(--line);
  background: var(--surface);
}
html[data-theme="dark"] .topbar { background: #121820; }
html[data-theme="dark"] .tile:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
}
html[data-theme="dark"] .status-dot { box-shadow: 0 0 0 4px rgba(55,194,177,.16); }
html[data-theme="dark"] .btn-ghost,
html[data-theme="dark"] .theme-toggle,
html[data-theme="dark"] .theme-seg {
  color: var(--navy);
  background: var(--surface-soft);
  border-color: var(--line-strong);
  backdrop-filter: none;
}
html[data-theme="dark"] .nav-link.is-active {
  color: #fff;
  background: rgba(77,163,255,.18);
  box-shadow: inset 0 0 0 1px rgba(77,163,255,.28);
}
html[data-theme="dark"] .tile:nth-child(1) .badge { background: rgba(94,175,234,.12); }
html[data-theme="dark"] .tile:nth-child(2) .badge { background: rgba(55,194,177,.12); }
html[data-theme="dark"] .tile:nth-child(3) .badge { background: rgba(240,164,88,.12); }
html[data-theme="dark"] .nav-link.is-active { background: var(--segment-active); }
html[data-theme="dark"] .wrap input[type="text"],
html[data-theme="dark"] .wrap input[type="email"],
html[data-theme="dark"] .wrap input[type="number"],
html[data-theme="dark"] .wrap input[type="date"],
html[data-theme="dark"] .wrap input[type="password"],
html[data-theme="dark"] .wrap select,
html[data-theme="dark"] .wrap textarea {
  background: var(--surface-muted); color: var(--ink); border-color: var(--line-strong);
}
html[data-theme="dark"] .tile-link .badge { background: rgba(94,175,234,.12); }
html[data-theme="dark"] .wb-card { background: var(--surface-soft); box-shadow: none; }
html[data-theme="dark"] .wb-kw-chip { background: rgba(94,175,234,.12); }

@media (max-width: 800px) {
  .topbar-inner { padding: 12px calc(16px + var(--lang-globe-gutter)) 12px 16px; }
  .page-header { align-items: flex-start; flex-direction: column; }
  .header-actions { justify-content: flex-start; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .card { padding: 24px 18px 22px; }
  .login-logo { width: min(100%, 220px); max-height: 140px; }
  .setup-brand { align-items: flex-start; flex-direction: column; gap: 10px; }
  .setup-brand .login-logo { width: 140px; height: auto; }
  .topbar-inner { gap: 10px; }
  .topbar-logo { width: 56px; height: 30px; }
  .brand-inline { font-size: 12px; }
  .brand-inline span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 42vw; }
  .wrap { padding: 22px 14px 36px; }
  .wrap h1 { font-size: 28px; }
  .summary-strip { flex-wrap: wrap; }
  .summary-card { flex: 1 1 120px; min-width: 0; }
  .data-status { flex-basis: 100%; margin: 3px 0 0; }
  .grid { grid-template-columns: 1fr; }
  .tile { min-height: 0; padding: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* ——— Portal v2: nav, forms, tables, badges ——— */
.nav-links { display: flex; flex-direction: column; align-items: stretch; flex-wrap: nowrap; gap: 4px; margin: 0; width: 100%; }
.nav-link {
  display: inline-flex; align-items: center; min-height: 34px; padding: 6px 11px;
  border-radius: 9px; color: var(--ink-soft); font-size: 12px; font-weight: 750;
  text-decoration: none; transition: background .14s, color .14s;
}
.nav-link:hover { color: var(--navy); background: var(--surface-hover); text-decoration: none; }
.nav-link.is-active { color: var(--navy); background: var(--segment-bg); box-shadow: inset 0 0 0 1px var(--line); }

/* Hamburger menu groups: compact accordion rows, separate from dashboard tile groups. */
.nav-group { width: 100%; }
.nav-group-toggle {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; min-height: 40px; padding: 9px 14px; border: 0; border-radius: 11px;
  color: var(--navy); background: transparent; font: inherit; font-size: 12px; font-weight: 800;
  text-align: left; cursor: pointer;
}
.nav-group-toggle:hover { background: var(--surface-hover); }
.nav-group-toggle:focus-visible { outline: 3px solid rgba(43,120,197,.35); outline-offset: 2px; }
.nav-group-chevron { transition: transform .16s ease; font-size: 16px; line-height: 1; }
.nav-group.is-open .nav-group-chevron { transform: rotate(180deg); }
.nav-group-menu { display: grid; gap: 3px; padding: 2px 0 6px 12px; }
.nav-group-menu[hidden] { display: none; }
.nav-sub-link { min-height: 36px; padding-left: 14px; font-weight: 700; }
.nav-sub-link .badge { margin-left: auto; }

.tile-link { display: block; color: inherit; text-decoration: none; }
.tile-link:hover { text-decoration: none; color: inherit; }
.tile-link .badge { border-color: rgba(43,120,197,.24); color: var(--blue); background: rgba(43,120,197,.08); }

.flash { margin-bottom: 18px; }
.wrap .msg { border-color: var(--line); color: var(--ink); background: var(--surface); }
.wrap .msg.err { border-color: rgba(180,35,24,.28); color: var(--danger); background: rgba(180,35,24,.08); }
.wrap .msg.ok { border-color: rgba(46,139,97,.28); color: var(--success); background: rgba(46,139,97,.08); }
.wrap .msg.warn { border-color: rgba(161,92,18,.3); color: var(--warning); background: rgba(231,141,53,.1); }

.panel {
  margin-bottom: 22px; padding: 22px 22px 20px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow-soft);
}
.section-title {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 0 0 16px; color: var(--navy); font-size: 17px; font-weight: 850; letter-spacing: -.02em;
}
.muted { color: var(--ink-soft); }
.small { font-size: 12px; line-height: 1.4; margin-top: 4px; }

.toolbar-form {
  display: flex; align-items: flex-end; flex-wrap: wrap; gap: 10px 14px;
  margin-bottom: 18px; padding: 14px 16px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft);
}
.toolbar-form label {
  margin: 0; color: var(--ink-soft); font-size: 11px; font-weight: 750;
  letter-spacing: .05em; text-transform: uppercase;
}
.toolbar-form .btn { margin-top: 0; }

.form-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px;
}
.form-row { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.form-row-full { grid-column: 1 / -1; }
.form-stack { display: grid; gap: 16px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.form-actions .btn { margin-top: 0; }

.wrap label {
  margin: 0; color: var(--ink-soft); font-size: 11px; font-weight: 750;
  letter-spacing: .05em; text-transform: uppercase;
}

.wrap input[type="text"],
.wrap input[type="email"],
.wrap input[type="number"],
.wrap input[type="date"],
.wrap input[type="password"],
.wrap select,
.wrap textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  outline: none;
  background: var(--surface-muted);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  transition: border-color .16s, box-shadow .16s, background .16s;
}
.wrap textarea { resize: vertical; min-height: 72px; }
.wrap input:focus,
.wrap select:focus,
.wrap textarea:focus {
  border-color: var(--blue);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(43,120,197,.16);
}
.wrap input[type="file"] {
  width: 100%; padding: 10px 0; color: var(--ink-soft); font-size: 13px;
  background: transparent; border: none;
}
.wrap .data-table input[type="text"],
.wrap .data-table input[type="number"],
.wrap .data-table input[type="date"] {
  margin: 0; padding: 8px 10px; font-size: 13px;
}

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.data-table {
  width: 100%; border-collapse: collapse; background: var(--surface); font-size: 13px;
}
.data-table th,
.data-table td {
  padding: 11px 13px; border-bottom: 1px solid var(--line);
  text-align: left; vertical-align: top;
}
.data-table th {
  color: var(--ink-soft); background: var(--surface-soft);
  font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  white-space: nowrap;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: var(--surface-hover); }
.col-date { white-space: nowrap; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.actions-cell { white-space: nowrap; }

.inline-form { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.cal-form input[type="text"] { min-width: 160px; max-width: 240px; }

.btn-sm { min-height: 32px; margin-top: 0; padding: 6px 10px; font-size: 11px; }
.btn-ok { background: var(--success); border-color: transparent; }
.btn-ok:hover { background: #247a54; box-shadow: 0 7px 18px rgba(46,139,97,.22); }
.btn-danger { background: var(--danger); border-color: transparent; }
.btn-danger:hover { background: #912018; box-shadow: 0 7px 18px rgba(180,35,24,.22); }

.badge-ok { border-color: rgba(46,139,97,.28); color: var(--success); background: rgba(46,139,97,.1); }
.badge-err { border-color: rgba(180,35,24,.28); color: var(--danger); background: rgba(180,35,24,.1); }
.badge-warn { border-color: rgba(161,92,18,.3); color: var(--warning); background: rgba(231,141,53,.12); }
.badge-cal { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

html[data-theme="glass"] .nav-link.is-active { background: var(--segment-active); }
html[data-theme="glass"] .wrap input[type="text"],
html[data-theme="glass"] .wrap input[type="email"],
html[data-theme="glass"] .wrap input[type="number"],
html[data-theme="glass"] .wrap input[type="date"],
html[data-theme="glass"] .wrap input[type="password"],
html[data-theme="glass"] .wrap select,
html[data-theme="glass"] .wrap textarea {
  background: var(--surface-muted); color: var(--ink); border-color: var(--line-strong);
}
html[data-theme="glass"] .tile-link .badge { background: rgba(94,175,234,.14); }

@media (max-width: 800px) {
  .form-grid { grid-template-columns: 1fr; }
  .toolbar-form { align-items: stretch; flex-direction: column; }
}

/* ——— Wochenbericht / Montagebericht form (papierähnlich) ——— */
.wb-panel { overflow: visible; }
.wb-form { display: grid; gap: 18px; }
.wb-paper {
  background: #fff;
  color: #111;
  border: 2px solid #222;
  border-radius: 2px;
  padding: 18px 16px 20px;
  box-shadow: 0 8px 28px rgba(16, 42, 67, .12);
}
html[data-theme="dark"] .wb-paper,
html[data-theme="glass"] .wb-paper {
  background: #fbfbfb;
  color: #111;
  border-color: rgba(255,255,255,.35);
  box-shadow: 0 10px 36px rgba(0,0,0,.28);
}
/* Higher specificity than .wrap label / .wrap input (theme ink is light in glass/dark) */
.wrap .wb-paper,
.wrap .wb-paper * {
  color: #111;
}
.wrap .wb-paper label,
.wrap .wb-paper .wb-lab,
.wrap .wb-paper .wb-lab-sm,
.wrap .wb-paper .wb-lab-note,
.wrap .wb-paper .wb-section-label,
.wrap .wb-paper .wb-check,
.wrap .wb-paper .wb-hint,
.wrap .wb-paper .muted,
.wrap .wb-paper .wb-brand,
.wrap .wb-paper .wb-brand span,
.wrap .wb-paper .wb-uid,
.wrap .wb-paper .wb-title,
.wrap .wb-paper .wb-bericht-datum,
.wrap .wb-paper th,
.wrap .wb-paper td {
  color: #222 !important;
}
.wrap .wb-paper .wb-title { color: #111 !important; }
.wrap .wb-paper .wb-kw-chip { color: #174a7a !important; background: #eef5fc; }
.wrap .wb-paper .wb-hint,
.wrap .wb-paper .muted,
.wrap .wb-paper .wb-lab-note,
.wrap .wb-paper .wb-lab-sm { color: #444 !important; }
.wrap .wb-paper input,
.wrap .wb-paper select,
.wrap .wb-paper textarea,
.wrap .wb-paper input[type="text"],
.wrap .wb-paper input[type="email"],
.wrap .wb-paper input[type="number"],
.wrap .wb-paper input[type="date"],
.wrap .wb-paper input[type="password"] {
  color: #111 !important;
  background: #fff !important;
  border: 1px solid #9aa3ad;
  border-radius: 3px;
  min-height: 34px;
  font-size: 13px;
  -webkit-text-fill-color: #111;
}
.wrap .wb-paper input:focus,
.wrap .wb-paper select:focus,
.wrap .wb-paper textarea:focus {
  outline: 2px solid rgba(43,120,197,.35);
  border-color: #2b78c5;
}
.wrap .wb-paper input[readonly],
.wrap .wb-paper textarea[readonly] {
  background: #f3f5f7 !important;
  color: #222 !important;
  -webkit-text-fill-color: #222;
}
.wrap .wb-paper .wb-az-table input {
  border: 0;
  background: transparent !important;
}
.wrap .wb-paper .wb-az-table thead th,
.wrap .wb-paper .wb-az-table .wb-row-label,
.wrap .wb-paper .wb-gesamt-row td,
.wrap .wb-paper .wb-gesamt-row th {
  color: #111 !important;
}
html[data-theme="dark"] .wrap .wb-paper input,
html[data-theme="dark"] .wrap .wb-paper select,
html[data-theme="dark"] .wrap .wb-paper textarea,
html[data-theme="glass"] .wrap .wb-paper input,
html[data-theme="glass"] .wrap .wb-paper select,
html[data-theme="glass"] .wrap .wb-paper textarea {
  background: #fff !important;
  color: #111 !important;
  -webkit-text-fill-color: #111;
  border-color: #9aa3ad;
}

/* Alt-Sektionen außerhalb Papierformular */
.wb-alt-card {
  margin-top: 18px; padding: 16px 18px;
  border: 1px solid var(--line-strong); border-radius: 12px;
  background: var(--surface-soft);
}
.wb-alt-card h3 {
  margin: 0 0 8px; font-size: 15px; font-weight: 800; color: var(--ink);
}
.wb-alt-card .lead-sm { margin: 0 0 12px; color: var(--ink-soft); font-size: 13px; line-height: 1.45; }
.wb-vorlagen-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.wb-vorlagen-list li {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
}
.wb-vorlagen-list a { font-weight: 700; }
.wb-vorlagen-meta { color: var(--ink-soft); font-size: 12px; }
.wb-paper-head {
  display: flex; justify-content: space-between; gap: 16px;
  margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid #222;
}
.wb-brand { display: grid; gap: 1px; font-size: 12px; line-height: 1.35; }
.wb-brand strong { font-size: 15px; letter-spacing: -.01em; }
.wb-uid { margin-top: 6px; font-size: 11px; }
.wb-title-block { text-align: right; }
.wb-title {
  font-size: 26px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1;
  margin-bottom: 8px;
}
.wb-kw-chip {
  display: inline-block; padding: 5px 10px; border: 1px solid #222;
  font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  background: #eef5fc; color: #174a7a;
}
.wb-top-grid {
  display: grid; grid-template-columns: 1.1fr 1.4fr .9fr; gap: 0;
  border: 1px solid #222; margin-bottom: 0;
}
.wb-meta-row {
  display: grid; grid-template-columns: 1.3fr 1fr 1fr .7fr; gap: 0;
  border: 1px solid #222; border-top: 0; margin-bottom: 12px;
}
.wb-box {
  padding: 8px 10px; border-right: 1px solid #222; min-width: 0;
}
.wb-box:last-child { border-right: 0; }
.wb-lab {
  display: block; font-size: 11px; font-weight: 800; letter-spacing: .04em;
  text-transform: uppercase; margin-bottom: 4px; color: #222;
}
.wb-lab-sm { display: block; font-size: 11px; font-weight: 650; color: #444; margin: 4px 0 2px; }
.wb-lab-note { font-size: 11px; font-weight: 600; text-transform: none; letter-spacing: 0; color: #444; }
.wb-inline-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 6px; }
.wb-firma-custom { margin-top: 6px; }
.wb-firma-preview {
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  background: #f6f8fa;
  color: #1f2328;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-line;
}
.wrap .wb-paper .wb-firma-preview {
  color: #1f2328 !important;
  background: #f6f8fa;
  border-color: #d0d7de;
}
html[data-theme="dark"] .wb-firma-preview,
html[data-theme="glass"] .wb-firma-preview {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.14);
  color: inherit;
}
html[data-theme="dark"] .wrap .wb-paper .wb-firma-preview,
html[data-theme="glass"] .wrap .wb-paper .wb-firma-preview {
  color: #1f2328 !important;
  background: #f6f8fa !important;
  border-color: #d0d7de !important;
}
.wb-zeitraum { margin-top: 8px; display: grid; gap: 2px; }
.wb-toolbar-inline {
  display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center;
  margin: 0 0 12px; padding: 8px 0;
}
.wb-section-label {
  margin: 14px 0 8px; color: #111; font-size: 13px; font-weight: 850;
  letter-spacing: .06em; text-transform: uppercase;
  border-bottom: 1px solid #222; padding-bottom: 4px;
}
.wb-table-wrap { margin-bottom: 6px; border: 1px solid #222; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.wb-az-table {
  width: 100%; border-collapse: collapse; background: #fff; color: #111;
  min-width: 720px; font-size: 12px;
}
.wb-az-table th, .wb-az-table td {
  border: 1px solid #222; padding: 4px; vertical-align: middle;
}
.wb-az-table thead th {
  background: #eef1f4; font-size: 11px; font-weight: 800; text-transform: uppercase;
}
.wb-az-table .wb-row-label {
  width: 4.6rem; background: #f4f6f8; font-weight: 800; white-space: nowrap; text-align: left;
}
.wb-az-table input {
  width: 100%; min-width: 0; border: 0; background: transparent; border-radius: 0;
  min-height: 32px; padding: 4px 6px; font-size: 13px;
}
.wb-az-table input:focus { outline: 2px solid rgba(43,120,197,.35); outline-offset: -2px; }
.wb-paper .wb-az-table input::placeholder { color: #b0b8c0; opacity: 1; }
.wb-az-table tr.is-travel { background: #faf7f0; }
.wb-az-table .wb-az, .wb-az-table .wb-rz, .wb-az-table .wb-summe { font-weight: 700; text-align: right; }
.wb-gesamt-row td, .wb-gesamt-row th { background: #eef1f4; font-weight: 800; }
.wb-gesamt { text-align: right; padding: 6px 8px !important; }
.wb-hint { margin: 4px 0 8px; color: #555; }
.wb-radio-row, .wb-radio-col { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.wb-radio-col { flex-direction: column; gap: 6px; }
.wb-check {
  display: inline-flex; align-items: center; gap: 7px;
  color: #111; font-size: 13px; font-weight: 650;
  letter-spacing: 0; text-transform: none; cursor: pointer;
}
.wb-check input { width: auto; margin: 0; accent-color: #2b78c5; min-height: 0; }
.wb-nae-grid, .wb-fahrt-grid {
  display: grid; gap: 10px 14px; margin-bottom: 8px;
  grid-template-columns: 2fr 1fr;
}
.wb-fahrt-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.wb-bericht-layout {
  display: grid; grid-template-columns: 1fr 180px; gap: 0;
  border: 1px solid #222; margin-bottom: 10px;
}
.wb-bericht-tage { padding: 6px; border-right: 1px solid #222; }
.wb-bericht-row {
  display: grid; grid-template-columns: 48px 1fr; gap: 6px;
  border-bottom: 1px solid #ddd; padding: 4px 0;
}
.wb-bericht-datum {
  font-weight: 800; font-size: 13px; padding-top: 6px;
}
.wb-bericht-text textarea {
  width: 100%; border: 1px solid #c5ccd3; min-height: 44px; resize: vertical;
}
.wb-bericht-side {
  padding: 8px; background: #f7f8fa; display: grid; gap: 8px; align-content: start;
}
.wb-bericht-gesamt { width: 100%; min-height: 90px; }
.wb-flags-row {
  display: flex; flex-wrap: wrap; gap: 14px; margin: 10px 0 14px;
  padding: 8px 0; border-top: 1px solid #ddd; border-bottom: 1px solid #ddd;
}
.wb-sign-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px;
}
.wb-sign-box {
  border: 1px solid #222; padding: 10px; background: #fff; display: grid; gap: 6px;
}
.wb-sign-kunde { background: #f9fafb; }
.wb-sig-pad {
  width: 100%; height: 140px; touch-action: none; cursor: crosshair;
  border: 1px dashed #888; background: #fff; border-radius: 2px;
}
.wb-sig-img {
  max-width: 100%; height: auto; max-height: 140px; border: 1px solid #ccc; background: #fff;
}
.wb-second-person {
  padding: 14px 16px; border: 1px dashed var(--line-strong);
  border-radius: 12px; background: var(--surface-soft);
}
.wb-upload {
  padding: 14px 16px; border: 1px dashed var(--line-strong);
  border-radius: 12px; background: var(--surface-soft);
}
.wb-form.is-readonly input[readonly],
.wb-form.is-readonly textarea[readonly] { opacity: .95; }

@media (max-width: 980px) {
  .wb-top-grid, .wb-meta-row { grid-template-columns: 1fr 1fr; }
  .wb-fahrt-grid { grid-template-columns: 1fr 1fr; }
  .wb-bericht-layout { grid-template-columns: 1fr; }
  .wb-bericht-tage { border-right: 0; border-bottom: 1px solid #222; }
}
@media (max-width: 640px) {
  .wb-paper { padding: 12px 10px 14px; }
  .wb-paper-head { flex-direction: column; }
  .wb-title { font-size: 22px; }
  .wb-top-grid, .wb-meta-row, .wb-fahrt-grid, .wb-nae-grid, .wb-sign-grid, .wb-inline-2 {
    grid-template-columns: 1fr;
  }
  .wb-box { border-right: 0; border-bottom: 1px solid #222; }
  .wb-box:last-child { border-bottom: 0; }
  .wb-sig-pad { height: 160px; }
  .wb-az-table { min-width: 640px; }
}

@media print {
  .topbar, .foot, .page-header, .toolbar-form, .wb-toolbar-inline,
  .wb-second-person, .wb-upload, .form-actions, .theme-seg, .panel:last-of-type {
    display: none !important;
  }
  .wb-panel, .wb-paper { box-shadow: none; border-color: #000; }
  body { background: #fff !important; }
}


/* Month calendar (Planung) */
.section-title {
  margin: 28px 0 12px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.cal-month {
  margin: 0 0 8px;
  padding: 14px 14px 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}
.cal-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.cal-title {
  margin: 0;
  flex: 1;
  text-align: center;
  font-size: 18px;
  font-weight: 800;
  color: var(--navy);
}
.cal-nav-btn {
  min-width: 40px;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
  padding-left: 10px;
  padding-right: 10px;
}
.cal-today-link { margin-left: auto; }
.cal-grid { display: flex; flex-direction: column; gap: 2px; }
.cal-head, .cal-week {
  display: grid;
  grid-template-columns: 36px repeat(7, minmax(0, 1fr));
  gap: 2px;
}
.cal-kw-head,
.cal-dow {
  padding: 6px 4px;
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.cal-kw {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 88px;
  padding: 4px 2px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  line-height: 1.2;
  user-select: none;
}
.cal-kw-head {
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cal-day {
  min-height: 88px;
  padding: 6px 5px 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.cal-day.is-outside {
  opacity: .45;
  background: transparent;
}
.cal-day.is-today {
  border-color: var(--blue);
  box-shadow: inset 0 0 0 1px rgba(43,120,197,.35);
  background: rgba(43,120,197,.08);
}
.cal-daynum {
  font-size: 12px;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.2;
}
.cal-day.is-today .cal-daynum { color: var(--blue); }
.cal-events {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 0;
  overflow: hidden;
}
.cal-ev {
  display: block;
  width: 100%;
  text-align: left;
  padding: 2px 5px;
  border-radius: 5px;
  background: rgba(43,120,197,.14);
  border: 1px solid rgba(43,120,197,.22);
  color: var(--navy);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
}
.cal-ev:hover, .cal-ev:focus-visible {
  outline: none;
  border-color: var(--blue);
  background: rgba(43,120,197,.22);
}
a.cal-daynum, a.cal-kw, a.cal-more {
  color: inherit;
  text-decoration: none;
}
a.cal-daynum:hover, a.cal-kw:hover, a.cal-more:hover {
  color: var(--blue);
  text-decoration: underline;
}
a.cal-kw { display: flex; align-items: center; justify-content: center; }
.cal-ev.is-span {
  background: rgba(21,154,145,.14);
  border-color: rgba(21,154,145,.28);
  border-radius: 0;
}
.cal-ev.is-span-start { border-radius: 5px 0 0 5px; }
.cal-ev.is-span-end { border-radius: 0 5px 5px 0; }
.cal-ev.is-span-start.is-span-end { border-radius: 5px; }
.cal-ev-title { display: block; overflow: hidden; text-overflow: ellipsis; }
.cal-more {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  padding: 0 2px;
}
.cal-meta { margin: 10px 2px 0; }

html[data-theme="glass"] .cal-day.is-today,
html[data-theme="dark"] .cal-day.is-today {
  background: rgba(77,163,255,.12);
  box-shadow: inset 0 0 0 1px rgba(77,163,255,.4);
}
html[data-theme="glass"] .cal-ev,
html[data-theme="dark"] .cal-ev {
  background: rgba(77,163,255,.18);
  border-color: rgba(77,163,255,.28);
  color: var(--ink);
}
html[data-theme="glass"] .cal-ev.is-span,
html[data-theme="dark"] .cal-ev.is-span {
  background: rgba(55,194,177,.18);
  border-color: rgba(55,194,177,.3);
}

/* Sub dashboard upcoming */
.upcoming-panel {
  margin: 0 0 22px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}
.upcoming-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.upcoming-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.upcoming-item {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px;
  align-items: start;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  color: inherit;
  text-decoration: none;
  transition: border-color .15s, background .15s;
}
.upcoming-item:hover {
  border-color: var(--blue);
  background: var(--surface-hover);
}
.upcoming-date {
  font-size: 12px;
  font-weight: 800;
  color: var(--blue);
  white-space: nowrap;
}
.upcoming-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.upcoming-body strong {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .cal-day { min-height: 64px; padding: 4px 3px; }
  .cal-ev { font-size: 9px; padding: 1px 3px; }
  .cal-title { font-size: 16px; }
  .upcoming-item { grid-template-columns: 1fr; gap: 4px; }
}

/* Icons in portal nav */
.nav-link { gap: 6px; }
.nav-icon {
  display: inline-block;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .88;
}
.nav-link.is-active .nav-icon { opacity: 1; }
/* Theme segmented control: Hell | Glas | Dunkel */
.theme-seg {
  display: inline-flex;
  align-items: stretch;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: var(--segment-bg);
}
.theme-seg-btn {
  appearance: none;
  margin: 0;
  min-height: 30px;
  padding: 5px 10px;
  border: 0;
  border-radius: 8px;
  color: var(--ink-soft);
  background: transparent;
  font: inherit;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .01em;
  cursor: pointer;
  transition: background .14s, color .14s, box-shadow .14s;
}
.theme-seg-btn:hover { color: var(--navy); background: var(--surface-hover); }
.theme-seg-btn.is-active {
  color: var(--navy);
  background: var(--segment-active);
  box-shadow: 0 1px 2px rgba(16,42,67,.08), inset 0 0 0 1px var(--line);
}
.theme-seg-btn:focus-visible { outline: 3px solid rgba(43,120,197,.35); outline-offset: 1px; }
a.theme-seg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: inherit;
  box-sizing: border-box;
}
a.theme-seg-btn.is-active { color: var(--navy); }

html[data-theme="glass"] .theme-seg,
html[data-theme="dark"] .theme-seg {
  background: var(--segment-bg);
  border-color: var(--line-strong);
}
html[data-theme="glass"] .theme-seg-btn.is-active,
html[data-theme="dark"] .theme-seg-btn.is-active {
  color: var(--navy);
  background: var(--segment-active);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

/* Language globe dropdown — fixed top-right, global (20260925langglobe2) */
.lang-globe {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 70; /* above content; below changelog/modals (1200+) */
  display: block;
  width: var(--lang-globe-size);
  height: var(--lang-globe-size);
  flex-shrink: 0;
  /* keep optical size stable under browser zoom of surrounding layout */
  transform: translateZ(0);
}
body > .lang-globe,
.auth-body > .lang-globe {
  position: fixed;
  z-index: 70;
}
.lang-globe-btn {
  appearance: none;
  box-sizing: border-box;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: var(--lang-globe-size);
  height: var(--lang-globe-size);
  min-width: var(--lang-globe-size);
  min-height: var(--lang-globe-size);
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  color: var(--ink-soft);
  background: var(--segment-bg);
  font-family: inherit;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .02em;
  line-height: 1;
  text-transform: lowercase;
  cursor: pointer;
  transition: background .14s, color .14s, border-color .14s, box-shadow .14s;
}
.lang-globe-btn:hover {
  color: var(--navy);
  background: var(--surface-hover);
}
.lang-globe-btn:focus-visible {
  outline: 3px solid rgba(43,120,197,.35);
  outline-offset: 1px;
}
.lang-globe.is-open .lang-globe-btn {
  color: var(--navy);
  background: var(--segment-active);
  box-shadow: inset 0 0 0 1px var(--line);
}
.lang-globe-icon {
  display: block;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  opacity: .92;
}
.lang-globe-code {
  line-height: 1;
  min-width: 1.35em;
  text-align: center;
  font-size: 11px;
}
.lang-globe-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 71;
  min-width: 168px;
  margin: 0;
  padding: 6px;
  list-style: none;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(16,42,67,.16), 0 2px 6px rgba(16,42,67,.08);
}
.lang-globe-menu[hidden] { display: none !important; }
.lang-globe-menu li { margin: 0; }
.lang-globe-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}
.lang-globe-option:hover {
  background: var(--surface-hover);
  color: var(--navy);
}
.lang-globe-option.is-active {
  background: var(--segment-active);
  color: var(--navy);
  box-shadow: inset 0 0 0 1px var(--line);
}
.lang-globe-option-code {
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .04em;
  color: var(--ink-soft);
}
.lang-globe-option.is-active .lang-globe-option-code { color: var(--navy); }
html[data-theme="glass"] .lang-globe-btn,
html[data-theme="dark"] .lang-globe-btn {
  background: var(--segment-bg);
  border-color: var(--line-strong);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
html[data-theme="glass"] .lang-globe.is-open .lang-globe-btn,
html[data-theme="dark"] .lang-globe.is-open .lang-globe-btn {
  background: var(--segment-active);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}
html[data-theme="glass"] .lang-globe-menu,
html[data-theme="dark"] .lang-globe-menu {
  background: var(--surface);
  border-color: var(--line-strong);
  box-shadow: 0 12px 32px rgba(0,0,0,.35), 0 2px 8px rgba(0,0,0,.2);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

/* Reserve right gutter so Hamburger / Theme / Logout stay clear of fixed globe */
.topbar-inner {
  padding-right: calc(26px + var(--lang-globe-gutter));
}

/* Legacy single-toggle (if present) */
.theme-toggle .theme-icon-svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .icon-sun { display: none; }
.brand-accent-line {
  display: block;
  width: 120px;
  height: 2px;
  margin: 10px auto 0;
  border-radius: 99px;
  background: linear-gradient(90deg, #2b78c5, #ff9f4a);
}
.auth-body .brand-accent-line { margin-top: 14px; }

/* Flash messages: ensure readable contrast in all themes */
.wrap .msg.flash { font-weight: 650; }
html[data-theme="dark"] .wrap .msg.ok,
html[data-theme="glass"] .wrap .msg.ok { color: #9be0b9; background: rgba(46,139,97,.22); }
html[data-theme="dark"] .wrap .msg.err,
html[data-theme="glass"] .wrap .msg.err { color: #ffb3b3; background: rgba(180,35,24,.22); }
html[data-theme="dark"] .wrap .msg.warn,
html[data-theme="glass"] .wrap .msg.warn { color: #f4c384; background: rgba(161,92,18,.22); }
html[data-theme="light"] .wrap .msg.ok { color: #1a6b45; }
html[data-theme="light"] .wrap .msg.err { color: #a11f16; }
html[data-theme="light"] .wrap .msg.warn { color: #8a4b10; }


/* Stundenzettel UX 2026-09 */
.page-header { display:flex; flex-wrap:wrap; gap:16px; align-items:flex-end; justify-content:space-between; }
.page-header-actions { display:flex; flex-wrap:wrap; gap:8px; }
.td-actions { display:flex; flex-wrap:wrap; gap:6px; align-items:center; }
.inline-form { display:inline; margin:0; }
.badge-warn { background: #f5e6c8; color:#6a4b00; border-color:#c9a227; }


/* ——— Mobile / touch (20260924mobile1) ——— */
.nav-toggle {
  display: inline-flex;
  grid-column: 1;
  grid-row: 1;
  appearance: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  color: var(--navy);
  background: var(--surface);
  cursor: pointer;
  flex-shrink: 0;
  z-index: 40;
}
.nav-toggle:hover { border-color: var(--blue); background: var(--surface-hover); }
.nav-toggle:focus-visible { outline: 3px solid rgba(43,120,197,.35); outline-offset: 2px; }
.nav-toggle-bars {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  box-shadow: 0 -6px 0 currentColor, 0 6px 0 currentColor;
  transition: transform .18s, box-shadow .18s, background .18s;
}
.nav-toggle.is-open .nav-toggle-bars {
  background: transparent;
  box-shadow: none;
  transform: rotate(45deg);
  position: relative;
}
.nav-toggle.is-open .nav-toggle-bars::before,
.nav-toggle.is-open .nav-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}
.nav-toggle.is-open .nav-toggle-bars::before { transform: rotate(90deg); }
.nav-toggle.is-open .nav-toggle-bars::after { transform: rotate(0deg); }

html[data-theme="glass"] .nav-toggle,
html[data-theme="dark"] .nav-toggle {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--navy);
}

/* Desktop: keep compact but comfortable targets */
.theme-seg-btn { min-height: 32px; }

/* Panel chrome (all viewports — hamburger collapse is default) */
.nav-link {
  min-height: 40px;
  padding: 9px 14px;
  font-size: 13px;
  border-radius: 11px;
}
.nav-icon { width: 16px; height: 16px; }
.user-chip {
  display: flex;
  padding: 4px 4px 2px;
  font-size: 12px;
}
.topnav .btn.nav-logout,
.topnav .btn-ghost {
  width: 100%;
  min-height: 40px;
  margin-top: 0;
  justify-content: center;
}

@media (max-width: 900px) {
  /* Touch fine-tuning only — collapse UX is default for all viewports */
  .topbar-inner {
    padding-right: calc(16px + var(--lang-globe-gutter));
  }
  .lang-globe {
    top: 8px;
    right: 10px;
  }
  .lang-globe-menu {
    right: 0;
    left: auto;
    min-width: min(220px, calc(100vw - 32px));
  }
  .theme-seg {
    width: 100%;
    justify-content: stretch;
  }
  .theme-seg-btn {
    flex: 1 1 0;
    min-height: 44px;
    padding: 10px 8px;
    font-size: 13px;
  }
  .nav-link {
    min-height: 44px;
    padding: 10px 14px;
    font-size: 14px;
  }
  .topnav .btn.nav-logout,
  .topnav .btn-ghost {
    min-height: 44px;
  }
  .btn, .btn-ghost, .btn-sm {
    min-height: 44px;
    padding: 10px 14px;
  }
  .btn-sm { font-size: 12px; }
  .wrap input[type="text"],
  .wrap input[type="email"],
  .wrap input[type="number"],
  .wrap input[type="date"],
  .wrap input[type="password"],
  .wrap select,
  .wrap textarea {
    min-height: 44px;
    font-size: 16px; /* iOS zoom avoid */
    padding: 11px 12px;
  }
  .wrap textarea { min-height: 88px; }
  .panel { padding: 16px 14px 14px; }
  .toolbar-form { padding: 12px; gap: 12px; }
  .toolbar-form .btn { width: 100%; }
  .page-header-actions .btn,
  .header-actions .btn,
  .form-actions .btn { min-height: 44px; }
  .cal-nav-btn { min-width: 44px; min-height: 44px; }
  .cal-today-link { margin-left: 0; width: 100%; text-align: center; }
  .cal-nav { justify-content: space-between; }
  .cal-title { flex-basis: 100%; order: -1; margin-bottom: 4px; }
  .upcoming-head { flex-wrap: wrap; }
  .upcoming-head .btn { width: 100%; }
}

@media (max-width: 720px) {
  .cal-month { padding: 10px 8px 8px; }
  .cal-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -2px;
    padding-bottom: 6px;
  }
  .cal-grid { min-width: 576px; }
  .cal-day { min-height: 72px; padding: 4px 3px; }
  .cal-ev { font-size: 9px; padding: 2px 3px; }
  .cal-dow, .cal-kw-head { font-size: 10px; padding: 4px 2px; }
  .cal-kw { min-height: 72px; font-size: 10px; }
  .cal-title { font-size: 15px; }
  .cal-ev:nth-child(n+3) { display: none; } /* simplify: max 2 chips on narrow */
  .upcoming-item {
    grid-template-columns: 1fr;
    gap: 4px;
    min-height: 44px;
    padding: 12px;
  }
  .upcoming-body strong { white-space: normal; }
}

@media (max-width: 640px) {
  .wb-toolbar-inline {
    flex-direction: column;
    align-items: stretch;
  }
  .wb-toolbar-inline .btn,
  .wb-toolbar-inline label,
  .wb-toolbar-inline select,
  .wb-toolbar-inline input {
    width: 100%;
  }
  .wb-toolbar-inline .btn { min-height: 44px; }
  .wb-table-wrap {
    margin-left: -2px;
    margin-right: -2px;
    border-radius: 0;
  }
  /* Sticky first column (day/row labels) while AZ table scrolls */
  .wrap .wb-az-table input {
    min-height: 40px;
    font-size: 16px;
    padding: 6px 4px;
  }
  .wb-az-table .wb-row-label,
  .wb-az-table thead th:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    background: #f4f6f8;
    box-shadow: 2px 0 0 #222;
  }
  .wb-az-table thead th:first-child {
    z-index: 3;
    background: #eef1f4;
  }
  .wb-az-table tr.is-travel .wb-row-label { background: #faf7f0; }
  .wb-az-table .wb-gesamt-row .wb-row-label,
  .wb-gesamt-row td:first-child,
  .wb-gesamt-row th:first-child {
    background: #eef1f4;
  }
  .wb-sign-grid { grid-template-columns: 1fr; }
  .wb-sig-pad { width: 100%; height: 180px; }
  .wb-vorlagen-list li {
    flex-direction: column;
    align-items: stretch;
  }
  .wb-vorlagen-list .btn { width: 100%; min-height: 44px; }
  .td-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .td-actions .btn,
  .td-actions .inline-form .btn { width: 100%; min-height: 44px; }
  .actions-cell { white-space: normal; }
  .data-table th, .data-table td { padding: 10px 10px; }
  .auth-body { padding: 24px 14px 16px; }
  .auth-body input[type="email"],
  .auth-body input[type="password"],
  .auth-body input[type="text"] {
    min-height: 48px;
    font-size: 16px;
    padding: 12px 14px;
  }
  .auth-body .btn {
    min-height: 48px;
    font-size: 15px;
  }
  .brand h1 { font-size: clamp(18px, 5.2vw, 22px); }
}


/* View switcher + week/day/year + event overlay (20260925i18n2) */
.cal-view-seg {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0 0 14px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}
.cal-view-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 6px 14px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-decoration: none;
  border: 0;
  background: transparent;
}
.cal-view-btn:hover { color: var(--navy); background: rgba(43,120,197,.08); }
.cal-view-btn.is-active {
  color: #fff;
  background: var(--blue);
  box-shadow: 0 1px 2px rgba(0,0,0,.12);
}
html[data-theme="glass"] .cal-view-btn.is-active,
html[data-theme="dark"] .cal-view-btn.is-active {
  background: rgba(77,163,255,.85);
  color: #061018;
}

.cal-day-tall { min-height: 160px; }
.cal-grid-week .cal-events { overflow: visible; }
.cal-grid-week .cal-ev {
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  margin-bottom: 2px;
}
.cal-empty { padding: 4px 2px; }

.cal-day-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cal-day-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  font-family: inherit;
  color: inherit;
  appearance: none;
  -webkit-appearance: none;
  min-height: 48px;
}
.cal-day-item:hover, .cal-day-item:focus-visible {
  border-color: var(--blue);
  outline: none;
  box-shadow: 0 0 0 2px rgba(43,120,197,.2);
}
.cal-day-item-when {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.cal-day-item-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
}
.cal-day-item-body strong { font-size: 15px; }

.cal-year-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.cal-year-month {
  display: block;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  text-decoration: none;
  color: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.cal-year-month:hover {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(43,120,197,.15);
}
.cal-year-month-title {
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--navy);
}
.cal-year-mini { display: block; }
.cal-year-mini-head,
.cal-year-mini-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
  text-align: center;
}
.cal-year-mini-head {
  font-size: 9px;
  font-weight: 800;
  color: var(--muted);
  margin-bottom: 2px;
  letter-spacing: .04em;
}
.cal-year-dot {
  font-size: 10px;
  line-height: 1.6;
  border-radius: 4px;
  color: var(--ink-soft);
}
.cal-year-dot.is-outside { visibility: hidden; }
.cal-year-dot.has-events {
  background: rgba(43,120,197,.18);
  font-weight: 800;
  color: var(--navy);
}
.cal-year-dot.is-today {
  outline: 1px solid var(--blue);
  color: var(--blue);
  font-weight: 800;
}

/* Event detail overlay */
.cal-overlay[hidden] { display: none !important; }
.cal-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.cal-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 12, 24, .55);
  border: 0;
  padding: 0;
  cursor: pointer;
}
.cal-overlay-panel {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  max-height: min(85vh, 640px);
  overflow: auto;
  margin: 0;
  padding: 18px 18px 22px;
  border-radius: 16px 16px 0 0;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 -8px 32px rgba(0,0,0,.25);
  -webkit-overflow-scrolling: touch;
}
@media (min-width: 720px) {
  .cal-overlay { align-items: center; }
  .cal-overlay-panel {
    border-radius: 16px;
    margin: 16px;
  }
}
.cal-overlay-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.cal-overlay-title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.3;
  color: var(--navy);
  word-break: break-word;
}
.cal-overlay-close {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--ink);
}
.cal-overlay-close:hover { border-color: var(--blue); color: var(--blue); }
.cal-overlay-dl {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cal-overlay-dl > div { margin: 0; }
.cal-overlay-dl dt {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 2px;
}
.cal-overlay-dl dd {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
}
body.cal-overlay-open { overflow: hidden; }

html[data-theme="glass"] .cal-overlay-panel,
html[data-theme="dark"] .cal-overlay-panel {
  background: rgba(12, 18, 28, .92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

@media (max-width: 900px) {
  .cal-year-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .cal-view-seg { width: 100%; }
  .cal-view-btn { flex: 1 1 0; min-width: 0; padding: 8px 6px; font-size: 12px; }
  .cal-day-tall { min-height: 120px; }
  .cal-year-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .cal-overlay-panel {
    width: 100%;
    border-radius: 16px 16px 0 0;
    max-height: 90vh;
  }
}
@media (max-width: 420px) {
  .cal-year-grid { grid-template-columns: 1fr; }
}

tr.js-ev-open { cursor: pointer; }
tr.js-ev-open:hover { background: rgba(43,120,197,.06); }


/* Signature fullscreen landscape overlay (Acrobat-ähnlich) */
.wb-sig-open {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 120px;
  padding: 8px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  background: #fff;
  color: var(--ink-soft);
  cursor: pointer;
  font: inherit;
  text-align: center;
}
html[data-theme="glass"] .wb-sig-open,
html[data-theme="dark"] .wb-sig-open {
  background: rgba(255,255,255,.92);
  color: #222;
}
.wb-sig-open:hover { border-color: var(--navy); }
.wb-sig-preview {
  max-width: 100%;
  max-height: 110px;
  object-fit: contain;
}
.wb-sig-placeholder { font-size: 13px; font-weight: 600; opacity: .75; }

.sig-fs-overlay {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  background: #0b0b0b;
  padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0);
}
.sig-fs-overlay[hidden] { display: none !important; }
.sig-fs-panel {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 100dvh;
  background: #111;
  color: #fff;
}
.sig-fs-head {
  flex: 0 0 auto;
  padding: 10px 16px 6px;
  text-align: center;
}
.sig-fs-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .02em;
}
.sig-fs-pad-wrap {
  flex: 1 1 auto;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  padding: 8px 12px;
  min-height: 0;
}
.sig-fs-pad {
  width: 100%;
  height: 100%;
  min-height: 220px;
  border-radius: 12px;
  background: #fff;
  touch-action: none;
  cursor: crosshair;
}
.sig-fs-actions {
  flex: 0 0 auto;
  display: flex;
  gap: 12px;
  justify-content: stretch;
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom, 0));
  background: #0b0b0b;
  border-top: 1px solid rgba(255,255,255,.12);
}
.sig-fs-btn {
  flex: 1 1 0;
  min-height: 48px;
  font-size: 16px;
  font-weight: 750;
}
body.sig-fs-open {
  overflow: hidden;
  touch-action: none;
}
/* Prefer landscape feel on tall phones: still fullscreen portrait OK,
   pad remains wide; lock attempted via Screen Orientation API. */
@media (orientation: portrait) and (max-width: 900px) {
  .sig-fs-title::after {
    content: " · Querformat empfohlen";
    font-weight: 500;
    opacity: .65;
    font-size: 12px;
  }
  html[lang="cs"] .sig-fs-title::after { content: " · doporučeno na šířku"; }
  html[lang="en"] .sig-fs-title::after { content: " · landscape recommended"; }
  .sig-fs-overlay.is-kunde-de .sig-fs-title::after { content: " · Querformat empfohlen"; }
}

.sig-fs-name-row {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 14px 8px;
}
.sig-fs-name-row label { font-size: 13px; font-weight: 650; color: #eee; }
.sig-fs-name-row input {
  min-height: 44px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.25);
  padding: 10px 12px;
  font: inherit;
  font-size: 16px;
  background: #fff;
  color: #111;
}
.wb-kunde-mail { margin-bottom: 12px; }
.wb-kunde-mail .wb-lab { display:block; margin-bottom: 6px; }

/* —— Hilfe + Changelog-Update (20260925help1) —— */
.help-layout {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}
@media (min-width: 900px) {
  .help-layout {
    grid-template-columns: minmax(200px, 260px) 1fr;
    align-items: start;
  }
  .help-toc { position: sticky; top: 1rem; }
}
.help-toc-title {
  margin: 0 0 .75rem;
  font-size: 0.95rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  opacity: .75;
}
.help-toc-list {
  margin: 0;
  padding-left: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: .4rem;
}
.help-toc-link {
  color: var(--ink);
  text-decoration: none;
  font-size: 0.95rem;
  line-height: 1.35;
}
.help-toc-link:hover,
.help-toc-link.is-active { color: var(--blue); text-decoration: underline; }
.help-articles { display: flex; flex-direction: column; gap: 1rem; }
.help-article-title { margin: 0 0 .65rem; font-size: 1.25rem; }
.help-article-body.prose p { margin: 0 0 .75rem; line-height: 1.55; }
.help-article-body.prose ul { margin: 0 0 .75rem; padding-left: 1.25rem; line-height: 1.5; }
.help-article-body.prose li { margin-bottom: .35rem; }
.help-article-body.prose code {
  font-size: .85em;
  padding: .1em .35em;
  border-radius: 4px;
  background: color-mix(in srgb, var(--ink) 8%, transparent);
}
.help-article.is-focus { outline: 2px solid var(--blue); outline-offset: 2px; }

.cl-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}
@media (min-width: 640px) {
  .cl-overlay { align-items: center; padding: 1.5rem; }
}
.cl-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(2px);
}
.cl-overlay-panel {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  max-height: min(85vh, 720px);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -8px 40px rgba(0,0,0,.25);
  overflow: hidden;
}
@media (min-width: 640px) {
  .cl-overlay-panel {
    border-radius: 16px;
    box-shadow: 0 16px 48px rgba(0,0,0,.3);
  }
}
html[data-theme="glass"] .cl-overlay-panel,
html[data-theme="dark"] .cl-overlay-panel {
  background: rgba(20, 22, 28, 0.92);
  border-color: rgba(255,255,255,.12);
}
.cl-overlay-head {
  padding: 1rem 1.15rem .5rem;
  border-bottom: 1px solid var(--line);
}
.cl-overlay-title {
  margin: 0;
  font-size: 1.15rem;
}
.cl-overlay-body {
  padding: .85rem 1.15rem;
  overflow: auto;
  flex: 1 1 auto;
}
.cl-entry { margin-bottom: 1rem; }
.cl-entry:last-child { margin-bottom: 0; }
.cl-entry-more {
  padding-top: .85rem;
  border-top: 1px dashed var(--line);
  opacity: .92;
}
.cl-date {
  font-size: .75rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  opacity: .65;
  margin-bottom: .2rem;
}
.cl-entry-title {
  margin: 0 0 .35rem;
  font-size: 1.02rem;
}
.cl-entry-body {
  margin: 0;
  font-size: .95rem;
  line-height: 1.5;
}
.cl-overlay-actions {
  padding: .85rem 1.15rem calc(.85rem + env(safe-area-inset-bottom, 0));
  border-top: 1px solid var(--line);
  display: flex;
  gap: .75rem;
}
.cl-dismiss-btn {
  width: 100%;
  min-height: 46px;
  font-weight: 700;
}
body.cl-overlay-open { overflow: hidden; }

/* —— HTML hidden must beat author display (UI QA 20260927) —— */
[hidden] { display: none !important; }

/* —— Language globe dropdown fixed (20260925langglobe2) —— */

/* —— Portal Alex chat (20260925chat1) —— */
.chat-page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.chat-toolbar { display: flex; gap: .5rem; align-items: center; }
.chat-shell {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  overflow: hidden;
  min-height: min(70vh, 640px);
  max-height: calc(100vh - 11rem);
}
.chat-thread {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 1rem 1rem .5rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  scroll-behavior: smooth;
}
.chat-msg {
  max-width: min(100%, 36rem);
  padding: .7rem .9rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--ink);
}
.chat-msg-user {
  align-self: flex-end;
  background: color-mix(in srgb, var(--blue) 14%, var(--surface));
  border-color: color-mix(in srgb, var(--blue) 35%, var(--line));
}
.chat-msg-assistant {
  align-self: flex-start;
}
.chat-msg-welcome {
  opacity: .95;
  border-style: dashed;
}
.chat-msg-meta {
  font-size: .72rem;
  font-weight: 750;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: .35rem;
}
.chat-msg-body {
  font-size: .98rem;
  line-height: 1.5;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}
.chat-mediation {
  margin-top: .65rem;
  padding: .55rem .7rem;
  border-radius: 10px;
  border: 1px dashed var(--line-strong);
  background: var(--surface-muted);
  font-size: .88rem;
  color: var(--ink-soft);
}
.chat-status {
  padding: .35rem 1rem;
  font-size: .85rem;
  color: var(--ink-soft);
}
.chat-status.is-error { color: var(--danger); }
.chat-composer {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: .6rem;
  align-items: flex-end;
  padding: .75rem 1rem calc(.75rem + env(safe-area-inset-bottom, 0));
  border-top: 1px solid var(--line);
  background: var(--surface);
  z-index: 2;
}
html[data-theme="glass"] .chat-composer {
  background: rgba(18, 20, 26, 0.72);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
}
html[data-theme="dark"] .chat-composer {
  background: var(--surface);
}
.chat-composer textarea {
  flex: 1 1 auto;
  min-height: 46px;
  max-height: 140px;
  resize: none;
  padding: .7rem .85rem;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--ink);
  line-height: 1.4;
}
.chat-composer textarea:focus {
  outline: 2px solid color-mix(in srgb, var(--blue) 55%, transparent);
  outline-offset: 1px;
  border-color: var(--blue);
}
.chat-send {
  flex: 0 0 auto;
  min-height: 46px;
  min-width: 5.5rem;
  font-weight: 700;
}
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}
@media (max-width: 640px) {
  .chat-shell {
    min-height: calc(100vh - 10.5rem);
    max-height: none;
    border-radius: 14px;
  }
  .chat-msg { max-width: 92%; }
  .chat-page-header .lead { font-size: 13px; }
}


/* MAIL EMBED */
body.mail-page .wrap,
.wrap:has(.mail-embed) {
  max-width: none;
  padding-top: 18px;
  padding-bottom: 18px;
}
.mail-embed-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 20px;
  margin-bottom: 14px;
}
.mail-embed-header .lead { margin-bottom: 0; }
.mail-embed-actions { margin: 0; }
.mail-embed {
  padding: 0;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  background: var(--panel);
  min-height: min(78vh, 920px);
}
.mail-embed-frame {
  display: block;
  width: 100%;
  height: min(78vh, 920px);
  border: 0;
  background: #f6f8fb;
}
@media (max-width: 720px) {
  .mail-embed,
  .mail-embed-frame {
    min-height: 70vh;
    height: 70vh;
    border-radius: 14px;
  }
}


/* Stundenzettel: zwei Wege (Online / Upload) */
.sz-path-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 10px;
}
.sz-path-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-soft);
  transition: border-color .16s, box-shadow .16s, transform .16s;
}
.sz-path-card:hover {
  border-color: var(--accent, #3b82f6);
  transform: translateY(-1px);
}
.sz-path-card strong { color: var(--navy); font-size: 15px; }
.sz-path-card span { color: var(--ink-soft); font-size: 13px; line-height: 1.45; }
.sz-path-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.sz-upload-top { border: 1px dashed var(--line); }
#sz-autosave-status { min-height: 1.2em; }
.rechnung-ts-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  margin: 8px 0 12px;
}
.rechnung-ts-card {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
}
.rechnung-ts-card.is-active {
  border-color: var(--accent, #3b82f6);
  box-shadow: var(--shadow-soft);
}
.rechnung-ts-card strong { display: block; margin-bottom: 4px; }

/* —— Radek-Fix 20260926: mobile Planung, mail iframe, file picker —— */

/* Compact Planung page header on narrow viewports */
@media (max-width: 720px) {
  .page-header--planung {
    margin-bottom: 12px;
    gap: 8px 12px;
    align-items: center;
  }
  .page-header--planung .eyebrow {
    font-size: 10px;
    letter-spacing: .08em;
  }
  .page-header--planung h1 {
    font-size: 1.25rem;
    line-height: 1.2;
    margin: 2px 0 0;
  }
  .page-header--planung .lead {
    display: none; /* long lead eats height on phones */
  }
  .page-header--planung .header-actions {
    margin-top: 0;
  }
  .page-header--planung .header-actions .btn {
    min-height: 36px;
    padding: 6px 12px;
    font-size: 13px;
  }
  .planung-page .cal-view-seg {
    margin-bottom: 8px;
  }
}

/* Calendar: fit 7 days + KW on narrow, or scroll with visible bar */
@media (max-width: 720px) {
  .cal-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--muted, #888) transparent;
    margin: 0 -4px;
    padding: 0 4px 8px;
  }
  .cal-scroll::-webkit-scrollbar { height: 6px; }
  .cal-scroll::-webkit-scrollbar-thumb {
    background: rgba(128,128,128,.55);
    border-radius: 4px;
  }
  /* Prefer fitting: shrink columns so KW+7 days visible (~320–400px) */
  .cal-grid {
    min-width: 0;
    width: 100%;
  }
  .cal-head,
  .cal-week {
    grid-template-columns: 28px repeat(7, minmax(0, 1fr));
    gap: 1px;
  }
  .cal-day {
    min-height: 56px;
    padding: 3px 2px;
    border-radius: 6px;
  }
  .cal-kw {
    min-height: 56px;
    font-size: 9px;
    padding: 2px 1px;
  }
  .cal-dow,
  .cal-kw-head {
    font-size: 9px;
    padding: 3px 1px;
    letter-spacing: .02em;
  }
  .cal-daynum { font-size: 11px; }
  .cal-ev {
    font-size: 8px;
    padding: 1px 2px;
    border-radius: 3px;
  }
  .cal-ev:nth-child(n+3) { display: none; }
}

@media (max-width: 380px) {
  /* Very narrow: allow horizontal scroll as fallback */
  .cal-scroll .cal-grid { min-width: 340px; }
}

/* Mail embed: fill viewport, less empty gap on mobile */
.mail-page .wrap:has(.mail-embed),
body.mail-page .wrap {
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - 64px);
}
.mail-page .mail-embed-header {
  flex: 0 0 auto;
  margin-bottom: 10px;
}
.mail-page .mail-embed {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.mail-embed-frame {
  flex: 1 1 auto;
  min-height: min(70vh, 920px);
  height: min(78vh, 920px);
  background: var(--panel, #f6f8fb);
}
@media (max-width: 720px) {
  .mail-embed-header .lead { display: none; }
  .mail-embed,
  .mail-embed-frame {
    min-height: calc(100dvh - 200px);
    height: calc(100dvh - 200px);
    border-radius: 12px;
  }
}

/* Localized custom file picker */
.portal-file {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-top: 4px;
}
.portal-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.portal-file-btn {
  min-height: 40px;
}
.portal-file-name {
  font-size: 13px;
  color: var(--ink-soft);
  word-break: break-all;
}


/* Admin-Nutzungslog / Auswertung */
.usage-tabs {
  display: flex;
  gap: 8px;
  margin: 0 0 16px;
}
.usage-tab {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  background: var(--surface);
}
.usage-tab.is-active {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}
.usage-filters .usage-filter-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.usage-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin: 0 0 16px;
}
.usage-kpi {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: var(--shadow-soft);
}
.usage-kpi span {
  display: block;
  font-size: 12px;
  color: var(--ink-soft);
  margin-bottom: 4px;
}
.usage-kpi strong {
  font-size: 1.25rem;
}
.usage-charts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.usage-chart-card h2 {
  font-size: 1rem;
  margin: 0 0 10px;
}
.usage-chart-wide {
  grid-column: 1 / -1;
}
.usage-heat th, .usage-heat td {
  text-align: center;
  padding: 3px 2px;
  font-size: 10px;
  min-width: 18px;
}
.usage-heat-cell {
  color: #102a43;
}
.usage-list-toolbar,
.usage-pager {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}
.usage-meta {
  max-width: 280px;
  word-break: break-word;
  font-size: 12px;
}
@media (max-width: 900px) {
  .usage-charts { grid-template-columns: 1fr; }
  .usage-chart-wide { grid-column: auto; }
}

/* === legal consent gate 20260926 === */
.legal-accept-card { max-width: 560px; }
.legal-accept-body .legal-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 1.1rem;
  font-size: 14px;
  line-height: 1.45;
  cursor: pointer;
}
.legal-accept-body .legal-check input {
  width: auto;
  min-width: 18px;
  min-height: 18px;
  margin: 3px 0 0;
  flex-shrink: 0;
  accent-color: #2b78c5;
}
.legal-check-text a { text-decoration: underline; }
.legal-link-list {
  margin: 0;
  padding-left: 1.2rem;
  line-height: 1.55;
}
.legal-link-list li { margin-bottom: .35rem; }
.legal-doc h1 { font-size: 1.35rem; margin: 0 0 .75rem; }
.legal-doc h2 { font-size: 1.15rem; margin: 1.25rem 0 .5rem; }
.legal-doc h3 { font-size: 1.05rem; margin: 1rem 0 .4rem; }
.legal-doc p { margin: 0 0 .75rem; line-height: 1.55; }
.legal-doc ul { margin: 0 0 .75rem; padding-left: 1.25rem; line-height: 1.5; }
.legal-doc code {
  font-size: .9em;
  padding: .1em .35em;
  border-radius: 4px;
  background: var(--surface-soft, rgba(127,127,127,.15));
}
.legal-locale-banner { margin-bottom: 1rem; border-left: 3px solid var(--blue, #2b78c5); }
@media (max-width: 560px) {
  .legal-accept-card { margin: 0 8px; }
  .legal-accept-body .legal-check { font-size: 13px; }
}

.foot a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.foot a:hover { color: var(--blue, #2b78c5); }
.impressum-dl { margin: 0; }
.impressum-dl dt {
  margin: .9rem 0 .2rem;
  color: #aab7c1;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.impressum-dl dd { margin: 0; line-height: 1.5; color: var(--text, #e8eef3); }
.impressum-dl a { color: var(--blue, #2b78c5); }
.impressum-body { margin-top: .25rem; }


/* ——— Invoice status workflow 20260926invstatus1 ——— */
.badge-inv-eingegangen { border-color: rgba(43,120,197,.28); color: var(--blue); background: rgba(43,120,197,.1); }
.badge-inv-geprueft { border-color: rgba(21,154,145,.28); color: var(--teal); background: rgba(21,154,145,.1); }
.badge-inv-ok { }
.badge-inv-buchhaltung { border-color: rgba(120,90,200,.28); color: #6b4fb8; background: rgba(120,90,200,.1); }
.badge-inv-ueberwiesen { }
.badge-inv-beanstandet { }
.rechnung-status-note {
  margin-top: .4rem;
  padding: .45rem .6rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-muted);
  font-size: 12px;
  line-height: 1.4;
  max-width: 28rem;
  white-space: pre-wrap;
}
.rechnung-status-note.is-dispute {
  border-color: rgba(180,35,24,.28);
  background: rgba(180,35,24,.08);
  color: var(--danger);
}
.admin-inv-form {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  min-width: 12rem;
  max-width: 18rem;
}
.admin-inv-form select,
.admin-inv-form textarea {
  width: 100%;
  font-size: 12px;
}
.admin-inv-form .btn-sm {
  align-self: flex-start;
  padding: .35rem .75rem;
  font-size: 12px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}


/* Sub Verfügbarkeit admin grid (20260927avail1) */
.avail-admin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
.planung-area-seg { margin-bottom: 1rem; }
@media (max-width: 900px) {
  .avail-admin-grid { grid-template-columns: 1fr; }
}

/* —— Profile avatars —— */
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  text-decoration: none;
  color: inherit;
}
.user-chip:hover { opacity: .9; }
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--surface-muted, #e8eef5);
  border: 1px solid var(--line, rgba(0,0,0,.08));
  vertical-align: middle;
}
.avatar-xs { width: 22px; height: 22px; font-size: 9px; }
.avatar-sm { width: 28px; height: 28px; font-size: 10px; }
.avatar-md { width: 64px; height: 64px; font-size: 18px; }
.avatar-lg { width: 128px; height: 128px; font-size: 36px; }
.avatar-fallback {
  font-weight: 800;
  letter-spacing: .02em;
  color: var(--ink-soft, #445);
  line-height: 1;
  user-select: none;
}
.avatar-name-cell {
  display: flex;
  align-items: center;
  gap: .55rem;
}
.avatar-editor {
  display: flex;
  flex-direction: column;
  gap: .85rem;
}
.avatar-editor-preview {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
html[data-theme="glass"] .avatar-fallback,
html[data-theme="dark"] .avatar-fallback {
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.85);
  border-color: rgba(255,255,255,.14);
}


/* —— Radek UI fixes 20260927 —— */

/* Mail embed: full-bleed width, fill remaining viewport (less empty side/bottom gap) */
body.mail-page .topbar-inner {
  max-width: none;
  width: 100%;
  box-sizing: border-box;
}
body.mail-page .wrap,
body.mail-page .wrap:has(.mail-embed) {
  max-width: none !important;
  width: 100%;
  box-sizing: border-box;
  padding: 12px 12px 12px;
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - 64px);
  gap: 0;
}
body.mail-page .mail-embed-header {
  flex: 0 0 auto;
  margin-bottom: 10px;
  width: 100%;
}
body.mail-page .mail-embed {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
}
body.mail-page .mail-embed-frame {
  display: block;
  width: 100% !important;
  max-width: none;
  flex: 1 1 auto;
  min-width: 0;
  min-height: calc(100dvh - 168px);
  height: calc(100dvh - 168px) !important;
  border: 0;
  background: var(--panel, #f6f8fb);
}
@media (max-width: 720px) {
  body.mail-page .wrap {
    padding: 8px 8px 10px;
    min-height: calc(100dvh - 56px);
  }
  body.mail-page .mail-embed-header .lead { display: none; }
  body.mail-page .mail-embed,
  body.mail-page .mail-embed-frame {
    min-height: calc(100dvh - 150px);
    height: calc(100dvh - 150px) !important;
    border-radius: 12px;
  }
}

/* Mobile dashboard: avoid clipping / horizontal overflow of tiles */
@media (max-width: 720px) {
  body.dashboard-page {
    overflow-x: clip;
  }
  body.dashboard-page .wrap {
    max-width: 100%;
    overflow-x: clip;
    padding-left: 12px;
    padding-right: 12px;
  }
  body.dashboard-page .grid {
    grid-template-columns: 1fr;
    gap: 12px;
    min-width: 0;
  }
  body.dashboard-page .tile,
  body.dashboard-page .tile-link {
    min-width: 0;
    max-width: 100%;
    min-height: 0;
    overflow: visible;
  }
  body.dashboard-page .tile:hover {
    transform: none; /* avoid paint overflow from translateY */
  }
  body.dashboard-page .tile p {
    min-height: 0;
  }
  body.dashboard-page .tile h2 {
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  body.dashboard-page .summary-strip {
    flex-wrap: wrap;
    min-width: 0;
  }
  body.dashboard-page .summary-card {
    min-width: 0;
    flex: 1 1 140px;
  }
  body.dashboard-page .upcoming-panel {
    min-width: 0;
    overflow: visible;
  }
  body.dashboard-page .upcoming-item {
    grid-template-columns: 1fr;
    min-width: 0;
  }
  body.dashboard-page .upcoming-date {
    white-space: normal;
  }
  body.dashboard-page .upcoming-body strong {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
  }
}

/* —— Upload image thumbs + lightbox —— */
.file-preview {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  vertical-align: middle;
  max-width: 100%;
  text-decoration: none;
  color: inherit;
}
.file-preview-icon {
  flex-shrink: 0;
  opacity: 0.75;
}
.file-preview-name {
  word-break: break-word;
}
a.file-preview:hover .file-preview-name,
.file-preview .file-preview-name:hover {
  text-decoration: underline;
}
.file-preview-thumb {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  padding: 0;
  margin: 0;
  border: 1px solid rgba(127, 127, 127, 0.35);
  border-radius: 6px;
  overflow: hidden;
  background: rgba(127, 127, 127, 0.08);
  cursor: zoom-in;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  position: relative;
  z-index: 1;
}
.file-preview-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.file-preview-thumb:hover,
.file-preview-thumb:focus-visible {
  transform: scale(1.35);
  z-index: 5;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
  outline: none;
}
html[data-theme="dark"] .file-preview-thumb,
html[data-theme="glass"] .file-preview-thumb {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.18);
}

.portal-lightbox {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-end;
  gap: 0;
  padding: 0;
  background: rgba(0, 0, 0, 0.88);
  cursor: zoom-out;
}
.portal-lightbox[hidden] {
  display: none !important;
}
.portal-lightbox-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.portal-lightbox-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.75rem;
  padding: 3.25rem 1.25rem 1rem;
  cursor: zoom-out;
}
.portal-lightbox-img {
  max-width: min(96vw, 1400px);
  max-height: min(70vh, 820px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.45);
  cursor: default;
}
.portal-lightbox-caption {
  color: #f2f2f2;
  font-size: 0.9rem;
  text-align: center;
  max-width: 90vw;
  word-break: break-word;
}
.portal-lightbox-scroll-hint {
  position: absolute;
  left: 50%;
  bottom: 0.65rem;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 650;
  pointer-events: none;
  letter-spacing: .01em;
}
.portal-lightbox-scroll-hint[hidden] { display: none !important; }
.portal-lightbox-scroll-arrow {
  display: inline-block;
  animation: portal-lb-bounce 1.2s ease-in-out infinite;
}
@keyframes portal-lb-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(3px); }
}
.portal-lightbox-bar {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  padding: 0.85rem 1rem calc(0.85rem + env(safe-area-inset-bottom, 0px));
  background: rgba(12, 14, 18, 0.92);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  cursor: default;
}
.portal-lightbox-open {
  background: #3b82f6;
  color: #fff;
  border: 0;
  text-decoration: none;
}
.portal-lightbox-open:hover,
.portal-lightbox-open:focus-visible {
  filter: brightness(1.08);
  outline: none;
}
.portal-lightbox-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 3;
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}
.portal-lightbox-close:hover,
.portal-lightbox-close:focus-visible {
  background: rgba(255, 255, 255, 0.3);
  outline: none;
}
body.lightbox-open {
  overflow: hidden;
}
@media (max-width: 600px) {
  .file-preview-thumb {
    width: 40px;
    height: 40px;
  }
  .file-preview-thumb:hover,
  .file-preview-thumb:focus-visible {
    transform: scale(1.25);
  }
}


.file-preview-thumb--pdf {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: inherit;
  cursor: zoom-in;
  background: linear-gradient(160deg, rgba(200, 60, 50, 0.12), rgba(127, 127, 127, 0.08));
}
.file-preview-thumb--pdf:hover,
.file-preview-thumb--pdf:focus-visible {
  transform: scale(2.15);
  z-index: 6;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.32);
  outline: none;
}
.file-preview-pdf-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  line-height: 1;
  color: #b33;
}
html[data-theme="dark"] .file-preview-pdf-inner,
html[data-theme="glass"] .file-preview-pdf-inner {
  color: #f08880;
}
.file-preview-pdf-svg {
  display: block;
}
.file-preview-pdf-badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  padding: 1px 4px;
  border-radius: 3px;
  background: #c0392b;
  color: #fff;
}
@media (max-width: 600px) {
  .file-preview-thumb--pdf:hover,
  .file-preview-thumb--pdf:focus-visible {
    transform: scale(1.6);
  }
}

/* Kunde calendar — status buckets */
.cal-kunde .cal-ev.is-angefragt,
.cal-bucket-badge.is-angefragt,
.cal-legend-item.is-angefragt .cal-legend-swatch {
  --cal-bucket: #c47a12;
  --cal-bucket-bg: rgba(231, 141, 53, 0.18);
  --cal-bucket-border: rgba(196, 122, 18, 0.35);
}
.cal-kunde .cal-ev.is-aktiv,
.cal-bucket-badge.is-aktiv,
.cal-legend-item.is-aktiv .cal-legend-swatch {
  --cal-bucket: #1f6f4a;
  --cal-bucket-bg: rgba(46, 139, 97, 0.16);
  --cal-bucket-border: rgba(46, 139, 97, 0.35);
}
.cal-kunde .cal-ev.is-beendet,
.cal-bucket-badge.is-beendet,
.cal-legend-item.is-beendet .cal-legend-swatch {
  --cal-bucket: #5c6570;
  --cal-bucket-bg: rgba(92, 101, 112, 0.14);
  --cal-bucket-border: rgba(92, 101, 112, 0.32);
}
.cal-kunde .cal-ev.is-angefragt,
.cal-kunde .cal-ev.is-aktiv,
.cal-kunde .cal-ev.is-beendet {
  background: var(--cal-bucket-bg);
  border-color: var(--cal-bucket-border);
  color: var(--cal-bucket);
}
.cal-bucket-badge.is-angefragt,
.cal-bucket-badge.is-aktiv,
.cal-bucket-badge.is-beendet {
  border-color: var(--cal-bucket-border);
  color: var(--cal-bucket);
  background: var(--cal-bucket-bg);
}
.cal-legend-panel { padding: 12px 14px; margin-bottom: 12px; }
.cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
}
.cal-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  font-size: 13px;
  font-weight: 600;
}
.cal-legend-item:hover,
.cal-legend-item:focus-visible {
  border-color: var(--cal-bucket-border, var(--blue));
  background: var(--cal-bucket-bg, rgba(37, 99, 235, 0.06));
  outline: none;
}
.cal-legend-item.is-active {
  border-color: var(--cal-bucket, var(--blue));
  box-shadow: 0 0 0 2px var(--cal-bucket-bg, rgba(37, 99, 235, 0.15));
}
.cal-legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  background: var(--cal-bucket, var(--muted));
  border: 1px solid var(--cal-bucket-border, transparent);
  flex: 0 0 auto;
}
.cal-view-tabs { margin: 0 0 12px; }
a.cal-ev { text-decoration: none; display: block; }


/* —— login kunde UX 20260927 —— */
.login-access-hint {
  margin-top: 1.1rem;
  padding-top: .9rem;
  border-top: 1px solid rgba(127, 127, 127, .35);
}
.login-access-hint > .muted.small {
  margin: 0 0 .45rem;
  line-height: 1.45;
}
.login-access-hint > .muted.small:last-child { margin-bottom: 0; }
.login-err-hint {
  margin: -6px 0 12px;
  line-height: 1.45;
}
.login-access-actions {
  margin: .65rem 0 .45rem;
}
.auth-body .btn-ghost {
  margin-top: 0;
  color: #e8eef3;
  background: transparent;
  border-color: rgba(255, 255, 255, .28);
}
.auth-body .btn-ghost:hover {
  color: #fff;
  background: rgba(255, 255, 255, .08);
  border-color: rgba(255, 255, 255, .45);
  box-shadow: none;
  transform: none;
}
.auth-body input[type="tel"],
.auth-body textarea {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid #34414b;
  border-radius: 10px;
  outline: none;
  background: #080a0c;
  color: #f5f8fa;
  font: inherit;
  font-size: 15px;
  transition: border-color .16s, box-shadow .16s, background .16s;
}
.auth-body textarea {
  resize: vertical;
  min-height: 88px;
  line-height: 1.45;
}
.auth-body input[type="tel"]:focus,
.auth-body textarea:focus {
  border-color: var(--blue);
  background: #0b1116;
  box-shadow: 0 0 0 3px rgba(43, 120, 197, .2);
}
.auth-zip-city {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: .6rem;
}
.auth-zip-city label { margin-top: 18px; }
@media (max-width: 560px) {
  .auth-zip-city { grid-template-columns: 1fr; gap: 0; }
  .auth-body .btn-ghost {
    min-height: 48px;
    font-size: 15px;
  }
  .login-access-hint { margin-top: 1rem; padding-top: .8rem; }
  .auth-body > .card { width: min(100%, 438px); }
}

/* Verfügbarkeit Kunde — Sub-Liste + Grain-Umschalter (2026-09-28) */
.avail-kunde-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
}
.avail-kunde-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
}
.avail-kunde-period-label {
  min-width: 7rem;
  text-align: center;
}
.avail-sub-row-head {
  display: grid;
  grid-template-columns: minmax(160px, 260px) 1fr;
  gap: 1rem;
  align-items: start;
}
.avail-sub-name-wrap {
  min-width: 0;
}
.avail-sub-name-wrap .avail-sub-name {
  margin: 0;
  line-height: 1.25;
}
.avail-sub-name {
  margin: 0;
}
.avail-sub-cells {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}
.avail-cell {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 6.5rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-muted);
}
.avail-own-events {
  margin: 0.15rem 0 0;
  padding-left: 1rem;
}
@media (max-width: 720px) {
  .avail-sub-row-head {
    grid-template-columns: 1fr;
  }
}

/* Admin KI-Dashboard */
.ki-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: 0 0 1rem;
}
.ki-tab {
  display: inline-flex;
  align-items: center;
  padding: .45rem .9rem;
  border-radius: 999px;
  border: 1px solid var(--border, rgba(255,255,255,.15));
  text-decoration: none;
  color: inherit;
  font-weight: 600;
  font-size: .92rem;
  background: transparent;
}
.ki-tab.is-active {
  background: var(--accent, #3b82f6);
  color: #fff;
  border-color: transparent;
}
.ki-panel { margin-top: .25rem; }
.ki-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: .75rem 1rem;
  margin-bottom: 1rem;
  align-items: end;
}
.ki-filters label {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  font-size: .85rem;
}
.ki-filters input,
.ki-filters select {
  padding: .45rem .55rem;
  border-radius: .5rem;
  border: 1px solid var(--border, rgba(0,0,0,.15));
  background: var(--input-bg, transparent);
  color: inherit;
}
.ki-filter-search { grid-column: span 2; }
.ki-meta { opacity: .8; font-size: .9rem; margin: .5rem 0 1rem; }
.ki-table-wrap { overflow-x: auto; }
.ki-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .92rem;
}
.ki-table th,
.ki-table td {
  text-align: left;
  padding: .55rem .6rem;
  border-bottom: 1px solid var(--border, rgba(0,0,0,.08));
  vertical-align: top;
}
.ki-table th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; opacity: .75; }
.ki-chip {
  display: inline-block;
  padding: .1rem .45rem;
  border-radius: 999px;
  font-size: .78rem;
  background: rgba(59,130,246,.15);
}
.ki-tok-detail { display: block; font-size: .78rem; opacity: .7; font-weight: 400; }
.ki-pager {
  display: flex;
  gap: .75rem;
  align-items: center;
  margin-top: 1rem;
}
.ki-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: .75rem;
  margin: 1rem 0 1.25rem;
}
.ki-stat {
  padding: .9rem 1rem;
  border-radius: .75rem;
  border: 1px solid var(--border, rgba(0,0,0,.1));
  background: rgba(255,255,255,.04);
}
.ki-stat-label { font-size: .8rem; opacity: .75; margin-bottom: .35rem; }
.ki-stat-value { font-size: 1.35rem; font-weight: 700; }
.ki-stat-span { font-size: .95rem; font-weight: 600; display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.ki-subhead { margin: 1.25rem 0 .5rem; font-size: 1.05rem; }
.ki-chat-select { margin-bottom: 1rem; }
.ki-chat-select select {
  width: min(100%, 420px);
  padding: .5rem .6rem;
  border-radius: .5rem;
  border: 1px solid var(--border, rgba(0,0,0,.15));
  background: var(--input-bg, transparent);
  color: inherit;
}
.ki-chat-persona { opacity: .8; font-size: .9rem; margin: .5rem 0 0; max-width: 60ch; }
.ki-chat-shell { min-height: 420px; }
.ki-chat-shell .chat-composer { flex-wrap: wrap; }
@media (max-width: 720px) {
  .ki-filter-search { grid-column: span 1; }
  .ki-table thead { display: none; }
  .ki-table tr { display: block; margin-bottom: .85rem; border: 1px solid var(--border, rgba(0,0,0,.1)); border-radius: .6rem; padding: .4rem .5rem; }
  .ki-table td { display: block; border: 0; padding: .25rem 0; }
  .ki-table td::before {
    content: attr(data-label);
    display: block;
    font-size: .72rem;
    text-transform: uppercase;
    opacity: .65;
    margin-bottom: .1rem;
  }
}

/* Kunden-Firmenlogos (20260928firmalogos1) */
.company-logo {
  display: block;
  max-height: 56px;
  max-width: min(220px, 42vw);
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: left center;
  background: #fff;
  border-radius: 8px;
  padding: 6px 10px;
  box-shadow: 0 1px 0 rgba(0,0,0,.06);
}
.company-logo--topbar {
  max-height: 34px;
  max-width: 140px;
  padding: 4px 8px;
  border-radius: 7px;
}
.company-logo--dash {
  max-height: 64px;
  max-width: min(260px, 55vw);
}
.topbar-company {
  display: flex;
  align-items: center;
  margin-left: 10px;
  min-width: 0;
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  margin-right: 0;
}
.page-header--kunde {
  align-items: center;
}
.page-header-company {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  margin-left: auto;
}
.page-header-company-text .eyebrow {
  margin-bottom: 0;
  letter-spacing: .08em;
}
.company-logo-block {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.company-logo-name {
  font-weight: 700;
  font-size: 0.95rem;
}
@media (max-width: 720px) {
  .topbar-company { display: none; }
  .page-header-company {
    margin-left: 0;
    width: 100%;
  }
  .company-logo--dash {
    max-height: 48px;
  }
}

/* Admin Impersonation — Anzeigen als */
.impersonate-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 16px;
  padding: 8px 14px;
  background: #7a1f1f;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 650;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 1200;
}
.impersonate-banner-text { min-width: 0; }
.impersonate-banner-form { margin: 0; display: inline-flex; }
.impersonate-banner-btn {
  background: #fff !important;
  color: #7a1f1f !important;
  border: none !important;
  font-weight: 700;
}
/* Anzeigen als — always in hamburger panel, stacked */
.view-as-form {
  display: flex;
  flex-wrap: wrap;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  gap: 8px;
  padding: 4px 0 10px;
  border-bottom: 1px solid var(--line);
  margin: 0 0 4px;
  min-width: 0;
}
.view-as-label {
  font-size: 0.8rem;
  font-weight: 650;
  letter-spacing: .04em;
  text-transform: uppercase;
  opacity: 0.85;
  white-space: normal;
}
.view-as-select {
  max-width: none;
  width: 100%;
  min-width: 0;
  min-height: 40px;
  font-size: 0.88rem;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--navy);
}
.view-as-go {
  width: 100%;
  white-space: nowrap;
  font-size: 0.88rem;
  padding: 8px 14px;
  min-height: 40px;
  justify-content: center;
}
@media (max-width: 900px) {
  .view-as-select {
    min-height: 44px;
    font-size: 16px; /* iOS zoom avoid */
    padding: 11px 12px;
  }
  .view-as-go {
    min-height: 44px;
    font-size: 14px;
    padding: 10px 14px;
  }
}
@media (max-width: 560px) {
  .impersonate-banner { font-size: 0.82rem; padding: 8px 10px; }
}



/* —— Dashboard tile groups (admin) 20260930hambdash1 —— */
.tile-group {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0;
  overflow: hidden;
}
.tile-group-toggle {
  appearance: none;
  display: block;
  width: 100%;
  margin: 0;
  padding: 22px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.tile-group-toggle:focus-visible {
  outline: 3px solid rgba(43,120,197,.35);
  outline-offset: -3px;
}
.tile-group-toggle h2 {
  margin: 9px 0 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.tile-group-toggle h2::after {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-left: auto;
  border-right: 2px solid var(--ink-soft);
  border-bottom: 2px solid var(--ink-soft);
  transform: rotate(45deg);
  transition: transform .16s;
  flex-shrink: 0;
}
.tile-group.is-open .tile-group-toggle h2::after {
  transform: rotate(-135deg);
  margin-top: 4px;
}
.tile-group-toggle p {
  min-height: 0;
  margin: 0 0 12px;
}
.tile-group-menu {
  list-style: none;
  margin: 0;
  padding: 0 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-top: 1px solid var(--line);
}
.tile-group-menu[hidden] { display: none !important; }
.tile-group-menu a {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--navy);
  text-decoration: none;
  font-size: 13px;
  font-weight: 650;
}
.tile-group-menu a:hover {
  background: var(--surface-hover);
  text-decoration: none;
}
html[data-theme="glass"] .tile-group-menu a:hover,
html[data-theme="dark"] .tile-group-menu a:hover {
  background: rgba(255,255,255,.08);
}

/* Theme orb — Sonne/Mond like lang-globe (20260928szwamoon1) */
.theme-orb {
  position: fixed;
  top: 12px;
  right: calc(12px + var(--lang-globe-size) + 8px);
  z-index: 70;
  display: block;
  width: var(--lang-globe-size);
  height: var(--lang-globe-size);
  flex-shrink: 0;
  transform: translateZ(0);
}
body > .theme-orb,
.auth-body > .theme-orb {
  position: fixed;
  z-index: 70;
}
.theme-orb-btn {
  appearance: none;
  box-sizing: border-box;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--lang-globe-size);
  height: var(--lang-globe-size);
  min-width: var(--lang-globe-size);
  min-height: var(--lang-globe-size);
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--ink-soft);
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(16,42,67,.06);
  transition: background .14s, color .14s, border-color .14s, box-shadow .14s;
}
.theme-orb-btn:hover {
  color: var(--navy);
  background: var(--surface-hover);
}
.theme-orb-btn:focus-visible {
  outline: 3px solid rgba(43,120,197,.35);
  outline-offset: 2px;
}
.theme-orb.is-open .theme-orb-btn {
  color: var(--navy);
  border-color: rgba(43,120,197,.35);
  box-shadow: 0 0 0 3px rgba(43,120,197,.12);
}
.theme-orb-icon {
  display: block;
  opacity: .9;
}
.theme-orb-icon.is-dim { opacity: .72; }
.theme-orb-sun, .theme-orb-moon { position: absolute; }
.theme-orb-btn { position: relative; }
.theme-orb-icon[hidden] { display: none !important; }
.theme-orb[data-theme-current="glass"] .theme-orb-sun { opacity: .55; transform: translate(-5px, 0) scale(.86); }
.theme-orb[data-theme-current="glass"] .theme-orb-moon { display: block !important; opacity: .7; transform: translate(5px, 0) scale(.86); }
.theme-orb[data-theme-current="glass"] .theme-orb-moon[hidden] { display: block !important; }
.theme-orb-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 148px;
  margin: 0;
  padding: 6px;
  list-style: none;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.theme-orb-menu[hidden] { display: none !important; }
.theme-orb-menu li { margin: 0; }
.theme-orb-option {
  appearance: none;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
}
.theme-orb-option:hover { background: var(--surface-hover); }
.theme-orb-option.is-active {
  background: var(--segment-active);
  color: var(--navy);
}
.theme-orb-option-ico {
  width: 1.1rem;
  text-align: center;
  opacity: .85;
}
html[data-theme="glass"] .theme-orb-btn,
html[data-theme="dark"] .theme-orb-btn {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.16);
  color: #e8eef7;
}
html[data-theme="glass"] .theme-orb-menu,
html[data-theme="dark"] .theme-orb-menu {
  background: rgba(18, 24, 32, 0.96);
  border-color: rgba(255,255,255,.14);
}



/* —— Avatar crop / rotate editor 20260928 —— */
body.avatar-crop-open { overflow: hidden; }
.avatar-crop-overlay[hidden] { display: none !important; }
.avatar-crop-overlay {
  position: fixed; inset: 0; z-index: 1300;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.avatar-crop-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.55);
}
.avatar-crop-panel {
  position: relative; z-index: 1;
  width: min(520px, 100%);
  max-height: min(92vh, 900px);
  overflow: auto;
  background: var(--panel, #fff);
  color: var(--text, #111);
  border-radius: 14px;
  border: 1px solid var(--border, rgba(0,0,0,.12));
  box-shadow: 0 18px 50px rgba(0,0,0,.28);
  padding: 1rem 1.1rem 1.15rem;
}
.avatar-crop-head {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  margin-bottom: .35rem;
}
.avatar-crop-title { margin: 0; font-size: 1.15rem; }
.avatar-crop-close {
  border: 1px solid var(--border, rgba(0,0,0,.15));
  background: transparent; color: inherit;
  width: 2rem; height: 2rem; border-radius: 999px; cursor: pointer; font-size: 1.2rem; line-height: 1;
}
.avatar-crop-stage {
  position: relative;
  width: 100%;
  height: min(360px, 55vh);
  margin: .75rem 0;
  overflow: hidden;
  border-radius: 12px;
  background: #111;
  touch-action: none;
  user-select: none;
}
.avatar-crop-stage img {
  position: absolute;
  max-width: none;
  transform-origin: center center;
  cursor: grab;
}
.avatar-crop-frame {
  position: absolute;
  box-sizing: border-box;
  border: 2px solid #fff;
  box-shadow: 0 0 0 9999px rgba(0,0,0,.45);
  border-radius: 4px;
  pointer-events: none;
}
.avatar-crop-toolbar {
  display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: .75rem;
}
.avatar-crop-zoom { display: flex; align-items: center; gap: .4rem; font-size: .85rem; flex: 1; min-width: 140px; }
.avatar-crop-zoom input { flex: 1; }
.avatar-crop-actions { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: flex-end; }
html[data-theme="glass"] .avatar-crop-panel,
html[data-theme="dark"] .avatar-crop-panel {
  background: rgba(20,22,28,.92);
  border-color: rgba(255,255,255,.12);
}

/* —— Glass contrast / Lesbarkeit 20260930glasscontrast1 ——
   Dark-chrome surfaces denser so light ink stays readable in menus & controls.
   No light text on washed/transparent-light glass panels. */
html[data-theme="glass"] .topbar {
  background: rgba(8, 12, 18, .88);
  color: #e8eef4;
}
html[data-theme="glass"] .topnav {
  color: #e8eef4;
  border-top-color: rgba(255,255,255,.14);
}
html[data-theme="glass"] .brand-inline,
html[data-theme="glass"] .nav-link,
html[data-theme="glass"] .user-chip,
html[data-theme="glass"] .view-as-label {
  color: #e8eef4;
}
html[data-theme="glass"] .nav-link:hover {
  color: #fff;
  background: rgba(255,255,255,.1);
}
html[data-theme="glass"] .nav-link.is-active {
  color: #fff;
  background: rgba(77,163,255,.28);
}

/* Ghost / sm controls + hamburger toggle */
html[data-theme="glass"] .btn-ghost,
html[data-theme="glass"] .btn.btn-ghost,
html[data-theme="glass"] .topnav .btn.nav-logout,
html[data-theme="glass"] .theme-toggle,
html[data-theme="glass"] .theme-seg,
html[data-theme="glass"] .nav-toggle {
  color: #e8eef4;
  background: rgba(14, 18, 26, .92);
  border-color: rgba(255,255,255,.2);
}
html[data-theme="glass"] .btn-ghost:hover,
html[data-theme="glass"] .btn.btn-ghost:hover,
html[data-theme="glass"] .theme-toggle:hover,
html[data-theme="glass"] .nav-toggle:hover {
  color: #fff;
  background: rgba(255,255,255,.12);
  border-color: rgba(77,163,255,.45);
}
/* Primary / sm (non-ghost): keep white on blue */
html[data-theme="glass"] .btn:not(.btn-ghost),
html[data-theme="glass"] .btn-sm:not(.btn-ghost),
html[data-theme="glass"] .view-as-go {
  color: #fff;
}

/* Badges — denser dark chrome; colored variants keep saturated ink */
html[data-theme="glass"] .badge {
  color: #c8d4e0;
  background: rgba(12, 16, 22, .82);
  border-color: rgba(255,255,255,.18);
}
html[data-theme="glass"] .tile:nth-child(1) .badge,
html[data-theme="glass"] .tile-link .badge {
  color: #8ec8ff;
  background: rgba(28, 58, 98, .62);
  border-color: rgba(77,163,255,.35);
}
html[data-theme="glass"] .tile:nth-child(2) .badge {
  color: #6fe0d2;
  background: rgba(18, 72, 66, .62);
  border-color: rgba(55,194,177,.35);
}
html[data-theme="glass"] .tile:nth-child(3) .badge {
  color: #ffc078;
  background: rgba(78, 48, 18, .62);
  border-color: rgba(240,164,88,.35);
}
html[data-theme="glass"] .badge-ok {
  color: #9be0b9;
  background: rgba(20, 60, 42, .7);
  border-color: rgba(46,139,97,.4);
}
html[data-theme="glass"] .badge-err {
  color: #ffb3b3;
  background: rgba(72, 24, 20, .7);
  border-color: rgba(180,35,24,.4);
}
html[data-theme="glass"] .badge-warn {
  color: #f4c384;
  background: rgba(58, 40, 14, .85);
  border-color: rgba(201,162,39,.45);
}

/* Selects + view-as */
html[data-theme="glass"] .wrap select,
html[data-theme="glass"] .wrap input[type="text"],
html[data-theme="glass"] .wrap input[type="email"],
html[data-theme="glass"] .wrap input[type="number"],
html[data-theme="glass"] .wrap input[type="date"],
html[data-theme="glass"] .wrap input[type="password"],
html[data-theme="glass"] .wrap textarea,
html[data-theme="glass"] .view-as-select,
html[data-theme="glass"] select {
  color: #e8eef4;
  background: rgba(10, 14, 20, .94);
  border-color: rgba(255,255,255,.22);
}
html[data-theme="glass"] .wrap select option,
html[data-theme="glass"] .view-as-select option,
html[data-theme="glass"] select option {
  color: #e8eef4;
  background: #121820;
}

/* Dropdowns: lang globe + theme orb */
html[data-theme="glass"] .lang-globe-menu,
html[data-theme="glass"] .theme-orb-menu {
  background: rgba(12, 16, 22, .97);
  color: #e8eef4;
  border-color: rgba(255,255,255,.18);
  box-shadow: 0 14px 36px rgba(0,0,0,.55), 0 2px 8px rgba(0,0,0,.35);
}
html[data-theme="glass"] .lang-globe-option,
html[data-theme="glass"] .theme-orb-option {
  color: #e8eef4;
}
html[data-theme="glass"] .lang-globe-option:hover,
html[data-theme="glass"] .theme-orb-option:hover {
  background: rgba(255,255,255,.1);
  color: #fff;
}
html[data-theme="glass"] .lang-globe-option.is-active,
html[data-theme="glass"] .theme-orb-option.is-active {
  color: #fff;
  background: rgba(255,255,255,.14);
}
html[data-theme="glass"] .lang-globe-btn,
html[data-theme="glass"] .theme-orb-btn {
  color: #e8eef4;
  background: rgba(14, 18, 26, .92);
  border-color: rgba(255,255,255,.2);
}

/* Tile groups — submenu links */
html[data-theme="glass"] .tile-group-menu a {
  color: #e8eef4;
  background: rgba(8, 12, 18, .55);
}
html[data-theme="glass"] .tile-group-menu a:hover {
  color: #fff;
  background: rgba(255,255,255,.12);
}
html[data-theme="glass"] .tile-group-toggle {
  color: #e8eef4;
}

/* Segment / view switcher chrome */
html[data-theme="glass"] .theme-seg,
html[data-theme="glass"] .cal-view-seg {
  background: rgba(12, 16, 22, .88);
  border-color: rgba(255,255,255,.16);
}
html[data-theme="glass"] .theme-seg-btn {
  color: #c5d0dc;
}
html[data-theme="glass"] .theme-seg-btn.is-active,
html[data-theme="glass"] a.theme-seg-btn.is-active {
  color: #fff;
  background: rgba(255,255,255,.14);
}

/* Light signature pad stays dark-ink (already set; reinforce) */
html[data-theme="glass"] .wb-sig-open {
  background: rgba(255,255,255,.94);
  color: #1a1a1a;
}


/* —— public privacy / login contact 20260930 —— */
.legal-public-card { max-width: 720px; }
.login-contact {
  margin: .75rem 0 .65rem;
  padding: .75rem .85rem;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 12px;
  background: rgba(255, 255, 255, .05);
}
.login-contact-title {
  margin: 0 0 .55rem;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: .01em;
  color: #e8eef3;
}
.login-contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin: 0 0 .45rem;
}
.login-contact-actions .btn {
  margin-top: 0;
  flex: 1 1 auto;
  text-align: center;
  text-decoration: none;
}
.login-contact-hint {
  margin: 0;
  line-height: 1.45;
}
html[data-theme="light"] .login-contact {
  border-color: rgba(0, 0, 0, .12);
  background: rgba(0, 0, 0, .03);
}
html[data-theme="light"] .login-contact-title {
  color: var(--navy, #0b1f33);
}

/* —— Glass contrast2 / Lesbarkeit 20261001glasscontrast2 ——
   Real frosted glass + readable ink. NEVER light-on-light.
   Auth primary had white text on #f7fafc (blanket glass .btn color:#fff).
   Controls: translucent dark frosted; auth primary: light frosted + dark ink.
   @supports fallback: solid dark OR light surfaces with matching ink. */

/* Tiles / panels / admin dashboard cards — frosted, light ink */
html[data-theme="glass"] .tile,
html[data-theme="glass"] .tile-link,
html[data-theme="glass"] .panel,
html[data-theme="glass"] .summary-card,
html[data-theme="glass"] .table-wrap,
html[data-theme="glass"] .toolbar-form,
html[data-theme="glass"] .upcoming-panel,
html[data-theme="glass"] .cal-month {
  background: rgba(14, 20, 30, .58);
  color: #e8eef4;
  border-color: rgba(255,255,255,.16);
  backdrop-filter: blur(20px) saturate(1.35);
  -webkit-backdrop-filter: blur(20px) saturate(1.35);
}
html[data-theme="glass"] .tile h2,
html[data-theme="glass"] .tile-link h2 {
  color: #f2f5f8;
}
html[data-theme="glass"] .tile p,
html[data-theme="glass"] .tile-link p {
  color: #a8b4c0;
}

/* Ghost / sm / hamburger / orb / globe — frosted dark chrome */
html[data-theme="glass"] .btn-ghost,
html[data-theme="glass"] .btn.btn-ghost,
html[data-theme="glass"] .topnav .btn.nav-logout,
html[data-theme="glass"] .theme-toggle,
html[data-theme="glass"] .theme-seg,
html[data-theme="glass"] .nav-toggle,
html[data-theme="glass"] .lang-globe-btn,
html[data-theme="glass"] .theme-orb-btn {
  color: #e8eef4;
  background: rgba(12, 18, 28, .62);
  border-color: rgba(255,255,255,.22);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
}
html[data-theme="glass"] .btn-ghost:hover,
html[data-theme="glass"] .btn.btn-ghost:hover,
html[data-theme="glass"] .theme-toggle:hover,
html[data-theme="glass"] .nav-toggle:hover,
html[data-theme="glass"] .lang-globe-btn:hover,
html[data-theme="glass"] .theme-orb-btn:hover {
  color: #fff;
  background: rgba(22, 32, 46, .78);
  border-color: rgba(77,163,255,.5);
}

/* Primary (non-ghost) on blue stays white — do NOT force white on light auth btn */
html[data-theme="glass"] .btn:not(.btn-ghost):not(.impersonate-banner-btn),
html[data-theme="glass"] .btn-sm:not(.btn-ghost):not(.impersonate-banner-btn),
html[data-theme="glass"] .view-as-go {
  color: #fff;
}

/* Auth / login primary — light frosted glass + dark ink (fixes Anmelden) */
html[data-theme="glass"] .auth-body .btn:not(.btn-ghost),
html[data-theme="glass"] .auth-body button.btn:not(.btn-ghost) {
  color: #0a1520 !important;
  background: rgba(247, 250, 252, .9);
  border-color: rgba(255,255,255,.5);
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  box-shadow: 0 8px 28px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.55);
}
html[data-theme="glass"] .auth-body .btn:not(.btn-ghost):hover,
html[data-theme="glass"] .auth-body button.btn:not(.btn-ghost):hover {
  color: #061018 !important;
  background: rgba(255,255,255,.96);
  border-color: rgba(255,255,255,.65);
}

/* Auth ghost / contact — frosted, light ink */
html[data-theme="glass"] .auth-body .btn-ghost,
html[data-theme="glass"] .auth-body .login-contact-actions .btn-ghost {
  color: #e8eef4;
  background: rgba(12, 18, 28, .55);
  border-color: rgba(255,255,255,.28);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
html[data-theme="glass"] .auth-body .login-contact {
  background: rgba(12, 18, 28, .45);
  border-color: rgba(255,255,255,.18);
  color: #e8eef4;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
html[data-theme="glass"] .auth-body .login-contact-title {
  color: #e8eef4;
}

/* Topbar + open hamburger panel */
html[data-theme="glass"] .topbar {
  background: rgba(8, 12, 18, .72);
  color: #e8eef4;
  backdrop-filter: blur(18px) saturate(1.35);
  -webkit-backdrop-filter: blur(18px) saturate(1.35);
}
html[data-theme="glass"] .topnav,
html[data-theme="glass"] .topnav.is-open {
  color: #e8eef4;
  background: rgba(8, 12, 18, .78);
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  border-top-color: rgba(255,255,255,.14);
}
html[data-theme="glass"] .nav-link,
html[data-theme="glass"] .brand-inline,
html[data-theme="glass"] .user-chip,
html[data-theme="glass"] .view-as-label {
  color: #e8eef4;
}
html[data-theme="glass"] .nav-link:hover {
  color: #fff;
  background: rgba(255,255,255,.1);
}
html[data-theme="glass"] .nav-link.is-active {
  color: #fff;
  background: rgba(77,163,255,.28);
}

/* Dropdowns / tile-group menus */
html[data-theme="glass"] .lang-globe-menu,
html[data-theme="glass"] .theme-orb-menu,
html[data-theme="glass"] .tile-group-menu {
  background: rgba(10, 14, 22, .82);
  color: #e8eef4;
  border-color: rgba(255,255,255,.18);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  box-shadow: 0 14px 36px rgba(0,0,0,.55), 0 2px 8px rgba(0,0,0,.35);
}
html[data-theme="glass"] .lang-globe-option,
html[data-theme="glass"] .theme-orb-option,
html[data-theme="glass"] .tile-group-menu a {
  color: #e8eef4;
  background: transparent;
}
html[data-theme="glass"] .tile-group-menu a {
  background: rgba(8, 12, 18, .4);
}
html[data-theme="glass"] .lang-globe-option:hover,
html[data-theme="glass"] .theme-orb-option:hover,
html[data-theme="glass"] .tile-group-menu a:hover {
  color: #fff;
  background: rgba(255,255,255,.12);
}
html[data-theme="glass"] .tile-group-toggle,
html[data-theme="glass"] .tile-group-toggle h2,
html[data-theme="glass"] .tile-group-toggle p {
  color: #e8eef4;
}
html[data-theme="glass"] .tile-group-toggle p {
  color: #a8b4c0;
}

/* Selects denser frosted */
html[data-theme="glass"] .wrap select,
html[data-theme="glass"] .wrap input[type="text"],
html[data-theme="glass"] .wrap input[type="email"],
html[data-theme="glass"] .wrap input[type="number"],
html[data-theme="glass"] .wrap input[type="date"],
html[data-theme="glass"] .wrap input[type="password"],
html[data-theme="glass"] .wrap textarea,
html[data-theme="glass"] .view-as-select,
html[data-theme="glass"] select {
  color: #e8eef4;
  background: rgba(10, 14, 20, .78);
  border-color: rgba(255,255,255,.22);
}

/* No backdrop-filter / no transparency: solid contrast fallbacks */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  html[data-theme="glass"] .tile,
  html[data-theme="glass"] .tile-link,
  html[data-theme="glass"] .panel,
  html[data-theme="glass"] .summary-card,
  html[data-theme="glass"] .table-wrap,
  html[data-theme="glass"] .toolbar-form,
  html[data-theme="glass"] .upcoming-panel,
  html[data-theme="glass"] .cal-month,
  html[data-theme="glass"] .topbar,
  html[data-theme="glass"] .topnav,
  html[data-theme="glass"] .lang-globe-menu,
  html[data-theme="glass"] .theme-orb-menu,
  html[data-theme="glass"] .tile-group-menu {
    background: #121820;
    color: #e8eef4;
  }
  html[data-theme="glass"] .btn-ghost,
  html[data-theme="glass"] .btn.btn-ghost,
  html[data-theme="glass"] .topnav .btn.nav-logout,
  html[data-theme="glass"] .theme-toggle,
  html[data-theme="glass"] .theme-seg,
  html[data-theme="glass"] .nav-toggle,
  html[data-theme="glass"] .lang-globe-btn,
  html[data-theme="glass"] .theme-orb-btn,
  html[data-theme="glass"] .auth-body .btn-ghost {
    background: #141a24;
    color: #e8eef4;
    border-color: rgba(255,255,255,.22);
  }
  html[data-theme="glass"] .auth-body .btn:not(.btn-ghost),
  html[data-theme="glass"] .auth-body button.btn:not(.btn-ghost) {
    background: #f7fafc;
    color: #0a1520 !important;
  }
  html[data-theme="glass"] .wrap select,
  html[data-theme="glass"] .wrap input[type="text"],
  html[data-theme="glass"] .wrap input[type="email"],
  html[data-theme="glass"] .wrap input[type="number"],
  html[data-theme="glass"] .wrap input[type="date"],
  html[data-theme="glass"] .wrap input[type="password"],
  html[data-theme="glass"] .wrap textarea,
  html[data-theme="glass"] .view-as-select,
  html[data-theme="glass"] select {
    background: #0e141c;
    color: #e8eef4;
  }
}


/* Personalakte Dokumente: Zeile lesbar auch im Hochkant (iPhone) */
.hr-doc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.hr-doc-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 0.75rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line, rgba(127,127,127,.35));
  border-radius: 10px;
  background: var(--surface, rgba(0,0,0,.04));
}
.hr-doc-main {
  flex: 1 1 12rem;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.85rem;
}
.hr-doc-name {
  flex: 1 1 8rem;
  min-width: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.hr-doc-name .upload-preview,
.hr-doc-name a {
  display: inline;
}
.hr-doc-note { display: block; font-weight: 400; margin-top: 0.15rem; }
.hr-doc-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.75rem;
  font-size: 0.92rem;
  white-space: nowrap;
}
.hr-doc-meta .hr-doc-type::after { content: ""; }
.hr-doc-date.is-expired { color: #b33; font-weight: 600; }
.hr-doc-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  flex: 0 0 auto;
}
.hr-doc-actions .btn-primary {
  color: #fff;
  background: var(--accent, #1a5fb4);
  border-color: var(--accent, #1a5fb4);
}
html[data-theme="glass"] .hr-doc-actions .btn-primary,
html[data-theme="light"] .hr-doc-actions .btn-primary {
  color: #fff;
  background: #1a5fb4;
  border-color: #155a9a;
}
.hr-doc-edit { position: relative; }
.hr-doc-edit > summary {
  list-style: none;
  cursor: pointer;
}
.hr-doc-edit > summary::-webkit-details-marker { display: none; }
.hr-doc-edit[open] > summary { margin-bottom: 0.35rem; }
.hr-doc-edit-form {
  position: absolute;
  right: 0;
  z-index: 5;
  min-width: min(100vw - 2rem, 22rem);
  max-width: 24rem;
  padding: 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--line, rgba(127,127,127,.4));
  background: var(--panel, #fff);
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
  color: var(--text, #111);
}
html[data-theme="dark"] .hr-doc-edit-form,
html[data-theme="glass"] .hr-doc-edit-form {
  background: var(--panel, #1c1c1e);
  color: var(--text, #f2f2f2);
}
.hr-doc-edit-actions { margin-top: 0.35rem; }
@media (max-width: 640px) {
  .hr-doc-row {
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 0.45rem;
  }
  .hr-doc-main {
    flex: 1 1 auto;
    min-width: 0;
  }
  .hr-doc-meta {
    white-space: normal;
    gap: 0.25rem 0.55rem;
  }
  .hr-doc-actions {
    flex-direction: column;
    align-items: stretch;
    flex: 0 0 auto;
  }
  .hr-doc-actions .btn { width: 100%; justify-content: center; }
  .hr-doc-edit-form {
    position: fixed;
    left: 0.75rem;
    right: 0.75rem;
    bottom: 0.75rem;
    top: auto;
    max-width: none;
    min-width: 0;
  }
}
