/* ==========================================================================
   Gerätevermietung - Liquid Glass, Schwarz mit Orange als Akzent

   Aufbau: eine dunkle Grundfläche mit weichen Orange-Schleiern im
   Hintergrund, darüber Flächen aus milchigem Glas (backdrop-filter).
   Das Glas lebt davon, dass etwas dahinter liegt - deshalb ist der
   Hintergrund nie einfarbig.
   ========================================================================== */

:root {
  color-scheme: dark;

  --black: #08080a;
  --bg: #08080a;
  --bg-raised: #0e0e11;

  /* Glasflächen: Weiß mit sehr wenig Deckkraft, der Hintergrund scheint durch */
  --glass: rgba(255, 255, 255, 0.045);
  --glass-2: rgba(255, 255, 255, 0.07);
  --glass-3: rgba(255, 255, 255, 0.1);
  --glass-border: rgba(255, 255, 255, 0.09);
  --glass-border-strong: rgba(255, 255, 255, 0.16);
  --glass-blur: blur(22px) saturate(170%);

  --text: #f7f7f8;
  --text-muted: #a1a1aa;
  --text-subtle: #71717a;

  --accent: #ff7a1a;
  --accent-hot: #ff9d4d;
  --accent-deep: #e35d00;
  --accent-soft: rgba(255, 122, 26, 0.14);
  --accent-line: rgba(255, 122, 26, 0.32);
  --accent-glow: rgba(255, 122, 26, 0.4);
  --accent-text: #ffb27a;
  --on-accent: #1a0d02;

  --green: #34d399;
  --green-soft: rgba(52, 211, 153, 0.14);
  --green-line: rgba(52, 211, 153, 0.3);
  --red: #fb7185;
  --red-soft: rgba(251, 113, 133, 0.14);
  --red-line: rgba(251, 113, 133, 0.3);
  --amber: #fbbf24;
  --amber-soft: rgba(251, 191, 36, 0.14);
  --amber-line: rgba(251, 191, 36, 0.3);
  --blue: #60a5fa;
  --blue-soft: rgba(96, 165, 250, 0.14);
  --blue-line: rgba(96, 165, 250, 0.3);
  --purple: #c084fc;
  --purple-soft: rgba(192, 132, 252, 0.14);
  --teal: #2dd4bf;
  --teal-soft: rgba(45, 212, 191, 0.14);
  --orange-soft: var(--accent-soft);
  --gray-soft: rgba(255, 255, 255, 0.06);

  --radius: 18px;
  --radius-sm: 13px;
  --radius-xs: 10px;

  /* Der obere Lichtstreif macht aus einer Fläche erst Glas */
  --sheen: inset 0 1px 0 rgba(255, 255, 255, 0.09);
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.4), var(--sheen);
  --shadow-lg: 0 24px 70px rgba(0, 0, 0, 0.7), var(--sheen);
  --glow: 0 6px 26px var(--accent-glow);

  --sidebar-w: 258px;
  --sidebar-w-collapsed: 76px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
}

/* Helle Variante: dasselbe Glas, nur vor hellem Grund. Orange bleibt Akzent. */
:root[data-theme="light"] {
  color-scheme: light;

  --bg: #f2f0ee;
  --bg-raised: #ffffff;

  --glass: rgba(255, 255, 255, 0.62);
  --glass-2: rgba(255, 255, 255, 0.78);
  --glass-3: rgba(255, 255, 255, 0.9);
  --glass-border: rgba(9, 9, 11, 0.09);
  --glass-border-strong: rgba(9, 9, 11, 0.18);

  --text: #18181b;
  --text-muted: #52525b;
  --text-subtle: #8b8b93;

  --accent: #e35d00;
  --accent-hot: #ff7a1a;
  --accent-text: #b34700;
  --accent-soft: rgba(227, 93, 0, 0.1);
  --accent-line: rgba(227, 93, 0, 0.28);
  --accent-glow: rgba(227, 93, 0, 0.28);
  --on-accent: #ffffff;

  --green: #047857;
  --green-soft: rgba(4, 120, 87, 0.1);
  --red: #be123c;
  --red-soft: rgba(190, 18, 60, 0.1);
  --amber: #b45309;
  --amber-soft: rgba(180, 83, 9, 0.1);
  --blue: #1d4ed8;
  --blue-soft: rgba(29, 78, 216, 0.1);
  --purple: #7e22ce;
  --purple-soft: rgba(126, 34, 206, 0.1);
  --teal: #0f766e;
  --teal-soft: rgba(15, 118, 110, 0.1);
  --gray-soft: rgba(9, 9, 11, 0.05);

  --sheen: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  --shadow: 0 4px 20px rgba(9, 9, 11, 0.07), var(--sheen);
  --shadow-lg: 0 24px 70px rgba(9, 9, 11, 0.16), var(--sheen);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  min-height: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Die Lichtquellen hinter dem Glas. Fest im Blickfeld, damit beim Scrollen
   der Milchglas-Effekt sichtbar arbeitet. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(900px 620px at 78% -8%, rgba(255, 122, 26, 0.3), transparent 62%),
    radial-gradient(760px 520px at 4% 8%, rgba(255, 122, 26, 0.13), transparent 58%),
    radial-gradient(1000px 720px at 52% 108%, rgba(227, 93, 0, 0.16), transparent 62%),
    var(--bg);
}

:root[data-theme="light"] body::before {
  background:
    radial-gradient(900px 620px at 78% -8%, rgba(255, 122, 26, 0.28), transparent 62%),
    radial-gradient(760px 520px at 4% 8%, rgba(255, 176, 102, 0.22), transparent 58%),
    radial-gradient(1000px 720px at 52% 108%, rgba(255, 122, 26, 0.16), transparent 62%),
    var(--bg);
}

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

a {
  color: var(--accent-text);
  text-decoration: none;
}

::selection {
  background: var(--accent);
  color: var(--on-accent);
}

/* Scrollbalken passend zum Glas */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--glass-border-strong) transparent;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-thumb {
  background: var(--glass-border-strong);
  border-radius: 99px;
  border: 3px solid transparent;
  background-clip: content-box;
}

.icon {
  width: 18px;
  height: 18px;
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hidden {
  display: none !important;
}

/* Wiederverwendbare Glasfläche */
.glass {
  background: var(--glass);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
}

/* ==========================================================================
   Anmeldung
   ========================================================================== */

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 410px;
  background: var(--glass);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 38px 34px;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

/* Lichtkante oben - typisch für die Glasoptik */
.login-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 12%;
  right: 12%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-hot), transparent);
  opacity: 0.75;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 30px;
}

.login-logo-img {
  height: 52px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

.login-brand h1 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.login-brand p {
  font-size: 11px;
  color: var(--accent-text);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}

.login-hint {
  margin-top: 22px;
  padding: 13px;
  background: var(--glass-2);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xs);
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.65;
}

.login-hint code {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  color: var(--accent-text);
}

/* ==========================================================================
   Grundgerüst
   ========================================================================== */

.app {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  flex: none;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  transition: width 0.18s ease;

  background: rgba(8, 8, 10, 0.55);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-right: 1px solid var(--glass-border);
}

:root[data-theme="light"] .sidebar {
  background: rgba(255, 255, 255, 0.55);
}

.sidebar.collapsed {
  width: var(--sidebar-w-collapsed);
}

.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-section-label,
.sidebar.collapsed .brand-text,
.sidebar.collapsed .nav-badge {
  display: none;
}

.sidebar.collapsed .nav-item {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 20px;
  border-bottom: 1px solid var(--glass-border);
  overflow: hidden;
}

.sidebar.collapsed .brand {
  padding-left: 0;
  padding-right: 0;
  justify-content: center;
}

.sidebar.collapsed .brand-logo-img {
  height: 30px;
}

.brand-logo-img {
  height: 40px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

.brand-text h1 {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.brand-text p {
  font-size: 10px;
  color: var(--accent-text);
  text-transform: uppercase;
  letter-spacing: 0.11em;
  font-weight: 600;
}

.nav {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.11em;
  padding: 14px 10px 8px;
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  margin-bottom: 3px;
  position: relative;
  transition: background 0.14s, color 0.14s, border-color 0.14s;
}

.nav-item:hover {
  background: var(--glass-2);
  color: var(--text);
}

/* Aktiver Eintrag: orange Glasscheibe mit Schein */
.nav-item.active {
  background: linear-gradient(
    100deg,
    rgba(255, 122, 26, 0.28),
    rgba(255, 122, 26, 0.1)
  );
  border-color: var(--accent-line);
  color: var(--text);
  font-weight: 620;
  box-shadow: 0 4px 18px rgba(255, 122, 26, 0.22), var(--sheen);
}

.nav-item.active .icon {
  color: var(--accent-hot);
}

/* Leuchtstreifen links am aktiven Eintrag */
.nav-item.active::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 22%;
  bottom: 22%;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}

.nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 10px;
  font-weight: 700;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  box-shadow: 0 0 12px var(--accent-glow);
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--glass-border);
}

.main {
  flex: 1;
  min-width: 0;
  padding: 32px 36px 56px;
}

.page-head {
  margin-bottom: 26px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.page-head h2 {
  font-size: 31px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.page-head p {
  color: var(--text-muted);
  margin-top: 4px;
}

.page-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* ==========================================================================
   Karten
   ========================================================================== */

.card {
  background: var(--glass);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-head {
  padding: 18px 20px;
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-head h3 {
  font-size: 15px;
  font-weight: 650;
  display: flex;
  align-items: center;
  gap: 9px;
}

.card-head h3 .icon {
  color: var(--accent);
}

.card-body {
  padding: 20px;
}

/* Kennzahlen-Kacheln */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.stat {
  position: relative;
  background: var(--glass);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.stat::before {
  content: "";
  position: absolute;
  top: 0;
  left: 18%;
  right: 18%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--glass-border-strong), transparent);
}

.stat.clickable {
  cursor: pointer;
}

.stat.clickable:hover {
  transform: translateY(-3px);
  border-color: var(--accent-line);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.45), 0 0 0 1px var(--accent-line), var(--sheen);
}

.stat-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-xs);
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  border: 1px solid transparent;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.stat-label {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 3px;
}

.tone-indigo,
.tone-orange  { background: var(--accent-soft); color: var(--accent-hot); border-color: var(--accent-line); }
.tone-green   { background: var(--green-soft);  color: var(--green); border-color: var(--green-line); }
.tone-red     { background: var(--red-soft);    color: var(--red);   border-color: var(--red-line); }
.tone-amber   { background: var(--amber-soft);  color: var(--amber); border-color: var(--amber-line); }
.tone-blue    { background: var(--blue-soft);   color: var(--blue);  border-color: var(--blue-line); }
.tone-purple  { background: var(--purple-soft); color: var(--purple); }
.tone-teal    { background: var(--teal-soft);   color: var(--teal); }
.tone-gray    { background: var(--gray-soft);   color: var(--text-muted); }

/* ==========================================================================
   Verfügbarkeitsleiste
   ========================================================================== */

.avail-group + .avail-group {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--glass-border);
}

.avail-title {
  font-size: 15px;
  font-weight: 650;
  margin-bottom: 14px;
}

.avail-title b {
  color: var(--accent-text);
  font-weight: 650;
}

.avail-units {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.unit {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 650;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.unit:hover {
  transform: scale(1.14);
}

.unit.verfuegbar {
  background: var(--green-soft);
  color: var(--green);
  border-color: var(--green-line);
}

.unit.verfuegbar:hover {
  box-shadow: 0 0 14px var(--green-soft);
}

.unit.vermietet {
  background: var(--accent-soft);
  color: var(--accent-hot);
  border-color: var(--accent-line);
}

.unit.vermietet:hover {
  box-shadow: 0 0 14px var(--accent-glow);
}

.unit.reserviert {
  background: var(--amber-soft);
  color: var(--amber);
  border-color: var(--amber-line);
}

.unit.wartung {
  background: var(--blue-soft);
  color: var(--blue);
  border-color: var(--blue-line);
}

.unit.defekt,
.unit.ausgemustert {
  background: var(--gray-soft);
  color: var(--text-subtle);
  border-color: var(--glass-border);
}

.legend {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 15px;
  font-size: 12px;
  color: var(--text-muted);
}

.legend span {
  display: flex;
  align-items: center;
  gap: 7px;
}

.legend i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid transparent;
}

/* ==========================================================================
   Kalender
   ========================================================================== */

.cal-head {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cal-month {
  font-size: 14px;
  font-weight: 600;
  min-width: 118px;
  text-align: center;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-dow {
  text-align: center;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding-bottom: 8px;
}

.cal-day {
  aspect-ratio: 1;
  border-radius: var(--radius-xs);
  padding: 5px;
  font-size: 12.5px;
  border: 1px solid transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.cal-day.filler {
  visibility: hidden;
}

.cal-day.has-events {
  cursor: pointer;
}

.cal-day.has-events:hover {
  background: var(--glass-2);
  border-color: var(--glass-border);
}

.cal-day.today {
  background: var(--accent-soft);
  border-color: var(--accent-line);
  font-weight: 700;
  color: var(--accent-hot);
  box-shadow: 0 0 18px var(--accent-glow) inset;
}

.cal-dots {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
  justify-content: center;
}

.cal-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.cal-dot.aktiv { background: var(--accent); }
.cal-dot.reserviert { background: var(--amber); }
.cal-dot.zurueckgegeben { background: var(--text-subtle); }
.cal-dot.overdue { background: var(--red); box-shadow: 0 0 6px var(--red); }

/* ==========================================================================
   Schaltflächen
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 15px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--glass-border);
  background: var(--glass-2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 550;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: var(--sheen);
  transition: background 0.14s, border-color 0.14s, transform 0.1s, opacity 0.14s;
}

.btn:hover:not(:disabled) {
  background: var(--glass-3);
  border-color: var(--glass-border-strong);
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn .icon {
  width: 16px;
  height: 16px;
}

.btn-primary {
  background: linear-gradient(145deg, var(--accent-hot), var(--accent-deep));
  border-color: transparent;
  color: var(--on-accent);
  font-weight: 620;
  box-shadow: var(--glow), var(--sheen);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(145deg, var(--accent-hot), var(--accent));
  border-color: transparent;
  box-shadow: 0 8px 32px var(--accent-glow), var(--sheen);
}

.btn-danger {
  background: var(--red-soft);
  border-color: var(--red-line);
  color: var(--red);
}

.btn-danger:hover:not(:disabled) {
  background: var(--red);
  border-color: var(--red);
  color: var(--black);
}

.btn-ghost {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: var(--text-muted);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--glass-2);
  color: var(--text);
}

.btn-sm {
  padding: 6px 10px;
  font-size: 12.5px;
}

.btn-icon {
  padding: 7px;
  border-radius: var(--radius-xs);
}

.btn-block {
  width: 100%;
}

/* ==========================================================================
   Formulare
   ========================================================================== */

.field {
  margin-bottom: 15px;
}

.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 6px;
}

.field .hint {
  font-size: 11.5px;
  color: var(--text-subtle);
  margin-top: 5px;
  font-weight: 400;
}

.input,
.select,
.textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xs);
  background: var(--glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--text);
  transition: border-color 0.14s, box-shadow 0.14s, background 0.14s;
}

.input::placeholder,
.textarea::placeholder {
  color: var(--text-subtle);
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--glass-2);
  box-shadow: 0 0 0 3px var(--accent-soft), 0 0 22px var(--accent-glow);
}

/* Aufklappliste: der Browser rendert die Optionen ohne Glas, deshalb
   bekommen sie einen festen dunklen Grund. */
.select option {
  background: var(--bg-raised);
  color: var(--text);
}

.textarea {
  min-height: 78px;
  resize: vertical;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.checkline {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 0;
  cursor: pointer;
  font-size: 13.5px;
}

.checkline input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

.search-box {
  position: relative;
  min-width: 230px;
}

.search-box .icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-subtle);
  width: 16px;
  height: 16px;
  pointer-events: none;
}

.search-box .input {
  padding-left: 34px;
}

/* ==========================================================================
   Tabellen
   ========================================================================== */

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

thead th {
  text-align: left;
  padding: 11px 16px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  border-bottom: 1px solid var(--glass-border);
  white-space: nowrap;
  background: var(--glass-2);
}

tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--glass-border);
  vertical-align: middle;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr.clickable {
  cursor: pointer;
  transition: background 0.12s;
}

tbody tr.clickable:hover {
  background: var(--glass-2);
}

.cell-strong {
  font-weight: 600;
}

.cell-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.row-actions {
  display: flex;
  gap: 5px;
  justify-content: flex-end;
}

.num {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ==========================================================================
   Marken / Abzeichen
   ========================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 650;
  white-space: nowrap;
  border: 1px solid transparent;
}

.badge .icon {
  width: 12px;
  height: 12px;
  stroke-width: 2.5;
}

.badge-verfuegbar,
.badge-zurueckgegeben,
.badge-behoben,
.badge-erledigt,
.badge-neuwertig {
  background: var(--green-soft);
  color: var(--green);
  border-color: var(--green-line);
}

/* Zustandsstufen: "gut" ist der Normalfall und soll nicht als Erfolg
   herausstechen, "gebrauchsspuren" ist ein Hinweis, kein Problem. */
.badge-gut {
  background: var(--gray-soft);
  color: var(--text-muted);
  border-color: var(--glass-border);
}

.badge-gebrauchsspuren {
  background: var(--amber-soft);
  color: var(--amber);
  border-color: var(--amber-line);
}

.badge-beschaedigt {
  background: var(--red-soft);
  color: var(--red);
  border-color: var(--red-line);
}

.badge-vermietet,
.badge-aktiv,
.badge-versendet {
  background: var(--accent-soft);
  color: var(--accent-hot);
  border-color: var(--accent-line);
}

/* Rechnungsstatus */
.badge-bezahlt {
  background: var(--green-soft);
  color: var(--green);
  border-color: var(--green-line);
}

.badge-erstellt {
  background: var(--blue-soft);
  color: var(--blue);
  border-color: var(--blue-line);
}

.badge-entwurf {
  background: var(--gray-soft);
  color: var(--text-subtle);
  border-color: var(--glass-border);
}

.badge-reserviert,
.badge-geplant,
.badge-in_reparatur,
.badge-mittel {
  background: var(--amber-soft);
  color: var(--amber);
  border-color: var(--amber-line);
}

.badge-wartung {
  background: var(--blue-soft);
  color: var(--blue);
  border-color: var(--blue-line);
}

.badge-defekt,
.badge-storniert,
.badge-offen,
.badge-schwer,
.badge-overdue {
  background: var(--red-soft);
  color: var(--red);
  border-color: var(--red-line);
}

.badge-ausgemustert,
.badge-abgeschrieben,
.badge-gering {
  background: var(--gray-soft);
  color: var(--text-subtle);
  border-color: var(--glass-border);
}

/* ==========================================================================
   Leerzustände
   ========================================================================== */

.empty {
  text-align: center;
  padding: 52px 20px;
  color: var(--text-muted);
}

.empty .empty-icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: var(--glass-2);
  border: 1px solid var(--glass-border);
  display: grid;
  place-items: center;
  margin: 0 auto 16px;
  color: var(--accent);
  box-shadow: var(--sheen);
}

.empty .empty-icon .icon {
  width: 28px;
  height: 28px;
}

.empty h4 {
  font-size: 16px;
  font-weight: 650;
  color: var(--text);
  margin-bottom: 5px;
}

.empty p {
  font-size: 13.5px;
}

/* ==========================================================================
   Raster
   ========================================================================== */

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 1100px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Dialoge
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 4, 6, 0.62);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 100;
  animation: fade 0.15s ease;
}

@keyframes fade {
  from { opacity: 0; }
}

.modal {
  background: var(--glass-2);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border-strong);
  border-radius: 22px;
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: pop 0.17s ease;
  position: relative;
  overflow: hidden;
}

.modal::before {
  content: "";
  position: absolute;
  top: 0;
  left: 15%;
  right: 15%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-hot), transparent);
  opacity: 0.6;
}

@keyframes pop {
  from { transform: translateY(10px) scale(0.985); opacity: 0; }
}

.modal.wide { max-width: 820px; }

.modal-head {
  padding: 20px 22px;
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-head h3 {
  font-size: 17px;
  font-weight: 680;
  letter-spacing: -0.02em;
}

.modal-head p {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

.modal-body {
  padding: 22px;
  overflow-y: auto;
}

.modal-foot {
  padding: 16px 22px;
  border-top: 1px solid var(--glass-border);
  display: flex;
  justify-content: flex-end;
  gap: 9px;
}

.section {
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 16px;
  background: var(--glass);
  box-shadow: var(--sheen);
}

.section > h4 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--accent-text);
  margin-bottom: 13px;
}

/* ==========================================================================
   Unterschriftenfeld
   ========================================================================== */

.sig-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 700px) {
  .sig-grid,
  .form-row {
    grid-template-columns: 1fr;
  }
}

.sig-pad {
  border: 1.5px dashed var(--glass-border-strong);
  border-radius: var(--radius-xs);
  background: var(--glass-2);
  position: relative;
  overflow: hidden;
  transition: border-color 0.14s, box-shadow 0.14s;
}

.sig-pad:hover {
  border-color: var(--accent-line);
}

.sig-pad.signed {
  border-style: solid;
  border-color: var(--green-line);
  box-shadow: 0 0 20px var(--green-soft);
}

.sig-pad canvas {
  display: block;
  width: 100%;
  height: 130px;
  touch-action: none;
  cursor: crosshair;
}

.sig-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--text-subtle);
  font-size: 12.5px;
  pointer-events: none;
  gap: 6px;
}

.sig-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 7px;
  font-size: 11.5px;
  color: var(--text-muted);
}

/* Unterschriften kommen als schwarze Striche - auf Glas brauchen sie
   deshalb eine helle Unterlage. */
.sig-img {
  max-width: 100%;
  height: 100px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xs);
}

/* ==========================================================================
   Fotos
   ========================================================================== */

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 10px;
}

.photo {
  position: relative;
  aspect-ratio: 4/3;
  border-radius: var(--radius-xs);
  overflow: hidden;
  border: 1px solid var(--glass-border);
  background: var(--glass-2);
}

.photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo .photo-del {
  position: absolute;
  top: 5px;
  right: 5px;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  color: #fff;
  border: 0;
  border-radius: 7px;
  padding: 4px;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.dropzone {
  border: 1.5px dashed var(--glass-border-strong);
  border-radius: var(--radius-sm);
  padding: 22px;
  text-align: center;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  transition: border-color 0.14s, background 0.14s, color 0.14s;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-hot);
}

/* ==========================================================================
   Auswahlliste (Geräte in der Vermietung)
   ========================================================================== */

.picker {
  max-height: 250px;
  overflow-y: auto;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xs);
  background: var(--glass);
}

.picker-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 13px;
  border-bottom: 1px solid var(--glass-border);
  cursor: pointer;
}

.picker-item:last-child {
  border-bottom: 0;
}

.picker-item:hover {
  background: var(--glass-2);
}

.picker-item input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.picker-item .meta {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-muted);
  text-align: right;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--accent-hot);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
}

.chip button {
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}

.chip .icon {
  width: 13px;
  height: 13px;
}

/* ==========================================================================
   Assistent: Gerät -> Bestellformular -> Übergabe
   ========================================================================== */

.steps {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--glass-border);
  background: var(--glass);
}

.step {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12.5px;
  font-weight: 550;
  color: var(--text-subtle);
  white-space: nowrap;
}

.step-no {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11.5px;
  font-weight: 700;
  border: 1px solid var(--glass-border-strong);
  background: var(--glass-2);
  flex: none;
}

.step.active {
  color: var(--text);
}

.step.active .step-no {
  background: linear-gradient(145deg, var(--accent-hot), var(--accent-deep));
  border-color: transparent;
  color: var(--on-accent);
  box-shadow: 0 0 14px var(--accent-glow);
}

.step.done {
  color: var(--green);
}

.step.done .step-no {
  background: var(--green-soft);
  border-color: var(--green-line);
  color: var(--green);
}

.step-line {
  flex: 1;
  height: 1px;
  background: var(--glass-border-strong);
  min-width: 12px;
}

/* Auswahl-Pillen - die Ankreuzfelder des Papierformulars */

.pills {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pill {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  background: var(--glass);
  cursor: pointer;
  transition: border-color 0.14s, background 0.14s, transform 0.1s;
  text-align: left;
  width: 100%;
  font-size: 14px;
}

.pill:hover {
  border-color: var(--accent-line);
  background: var(--glass-2);
}

.pill:active {
  transform: scale(0.995);
}

.pill.selected {
  border-color: var(--accent);
  background: linear-gradient(100deg, rgba(255, 122, 26, 0.2), rgba(255, 122, 26, 0.06));
  box-shadow: 0 4px 20px var(--accent-glow), var(--sheen);
}

/* Der runde Marker links - ersetzt die Checkbox vom Papier */
.pill-mark {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--glass-border-strong);
  flex: none;
  display: grid;
  place-items: center;
  transition: border-color 0.14s, background 0.14s;
}

.pill-mark .icon {
  width: 12px;
  height: 12px;
  stroke-width: 3;
  opacity: 0;
  transition: opacity 0.12s;
}

.pill.selected .pill-mark {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.pill.selected .pill-mark .icon {
  opacity: 1;
}

.pill-label {
  flex: 1;
  font-weight: 550;
}

.pill-sub {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 1px;
}

.pill-price {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.pill.selected .pill-price {
  color: var(--accent-hot);
}

.pill-badge {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  border: 1px solid var(--green-line);
}

/* Der Summenblock rechts unten auf dem Formular */

.totals {
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  background: var(--glass-2);
  padding: 16px;
  box-shadow: var(--sheen);
}

.totals-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 5px 0;
  font-size: 13.5px;
}

.totals-row .label {
  color: var(--text-muted);
}

.totals-row .value {
  font-variant-numeric: tabular-nums;
  font-weight: 550;
  white-space: nowrap;
}

.totals-row.sum {
  border-top: 1px solid var(--glass-border);
  margin-top: 8px;
  padding-top: 10px;
}

.totals-row.grand {
  border-top: 1px solid var(--accent-line);
  margin-top: 6px;
  padding-top: 10px;
  font-size: 16px;
  font-weight: 700;
}

.totals-row.grand .label {
  color: var(--text);
}

.totals-row.grand .value {
  color: var(--accent-hot);
  font-weight: 700;
}

/* ==========================================================================
   Meldungen / Hinweise
   ========================================================================== */

.alert {
  display: flex;
  gap: 11px;
  padding: 12px 14px;
  border-radius: var(--radius-xs);
  font-size: 13px;
  margin-bottom: 16px;
  border: 1px solid transparent;
  line-height: 1.5;
}

.alert .icon {
  flex: none;
  margin-top: 1px;
}

.alert-error {
  background: var(--red-soft);
  color: var(--red);
  border-color: var(--red-line);
}

.alert-info {
  background: var(--blue-soft);
  color: var(--blue);
  border-color: var(--blue-line);
}

.alert-warn {
  background: var(--amber-soft);
  color: var(--amber);
  border-color: var(--amber-line);
}

.alert-success {
  background: var(--green-soft);
  color: var(--green);
  border-color: var(--green-line);
}

.toasts {
  position: fixed;
  bottom: 22px;
  right: 22px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  z-index: 200;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--glass-3);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border-strong);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-xs);
  padding: 12px 16px;
  box-shadow: var(--shadow-lg);
  font-size: 13.5px;
  min-width: 260px;
  max-width: 400px;
  animation: slide-in 0.2s ease;
}

@keyframes slide-in {
  from { transform: translateX(18px); opacity: 0; }
}

.toast.success { border-left-color: var(--green); }
.toast.success .icon { color: var(--green); }
.toast.error { border-left-color: var(--red); }
.toast.error .icon { color: var(--red); }
.toast.info .icon { color: var(--accent); }

/* ==========================================================================
   Benachrichtigungsliste
   ========================================================================== */

.note {
  display: flex;
  gap: 13px;
  padding: 15px 20px;
  border-bottom: 1px solid var(--glass-border);
  cursor: pointer;
  transition: background 0.12s;
}

.note:last-child {
  border-bottom: 0;
}

.note:hover {
  background: var(--glass-2);
}

.note.unread {
  background: var(--accent-soft);
  border-left: 2px solid var(--accent);
}

.note-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-xs);
  display: grid;
  place-items: center;
  flex: none;
  border: 1px solid transparent;
}

.note-body {
  flex: 1;
  min-width: 0;
}

.note-title {
  font-weight: 620;
  font-size: 13.5px;
}

.note-msg {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

.note-time {
  font-size: 11.5px;
  color: var(--text-subtle);
  white-space: nowrap;
}

/* ==========================================================================
   Detailansicht
   ========================================================================== */

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.detail dt {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 3px;
}

.detail dd {
  font-size: 13.5px;
  font-weight: 500;
}

.timeline {
  position: relative;
  padding-left: 22px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 5px;
  bottom: 5px;
  width: 2px;
  background: var(--glass-border-strong);
}

.timeline-item {
  position: relative;
  padding-bottom: 16px;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -21px;
  top: 5px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
}

/* ==========================================================================
   Schmale Bildschirme
   ========================================================================== */

@media (max-width: 860px) {
  .sidebar {
    width: var(--sidebar-w-collapsed);
  }

  .sidebar .nav-label,
  .sidebar .nav-section-label,
  .sidebar .brand-text,
  .sidebar .nav-badge {
    display: none;
  }

  .sidebar .nav-item {
    justify-content: center;
  }

  .main {
    padding: 22px 16px 44px;
  }

  .page-head h2 {
    font-size: 24px;
  }
}

/* Formular-Raster (z.B. Firmendaten) */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}

.form-grid .field-full {
  grid-column: 1 / -1;
}

@media (max-width: 640px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

/* Geräteakte: Verlauf als Zeitleiste */
.timeline-row {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--glass-border);
}

.timeline-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.timeline-mark {
  flex: none;
  width: 22px;
  display: flex;
  justify-content: center;
  padding-top: 1px;
}

.timeline-mark .icon {
  width: 18px;
  height: 18px;
}

.timeline-body {
  flex: 1;
  min-width: 0;
}

.timeline-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

/* Weniger Bewegung, wenn das System es so verlangt */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* ==========================================================================
   Druck (Protokoll) - auf Papier kein Glas, sondern Schwarz auf Weiß
   ========================================================================== */

@media print {
  body::before,
  .sidebar,
  .page-actions,
  .modal-foot,
  .no-print {
    display: none !important;
  }

  body,
  .main {
    background: #fff;
    color: #000;
    padding: 0;
  }

  .modal-backdrop {
    position: static;
    background: none;
    padding: 0;
    backdrop-filter: none;
  }

  .modal,
  .card,
  .section {
    max-width: 100%;
    max-height: none;
    background: #fff;
    border: 1px solid #ddd;
    box-shadow: none;
    backdrop-filter: none;
    break-inside: avoid;
  }
}
