/* ============================================================
   StructFire – Design-System
   Anthrazit (#23272A) · Signal-Orange (#FF5500) · Weiß
   ============================================================ */

:root {
  --sf-dark: #23272A;
  --sf-gray: #2C2F33;
  --sf-gray-light: #36393F;
  --sf-orange: #FF5500;
  --sf-orange-dark: #E64A00;
  --sf-orange-light: #FF7A33;
  --sf-border: #E5E7EB;
}

.hidden { display: none !important; }

* { font-family: 'Inter', system-ui, -apple-system, sans-serif; }

html { scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; }

/* === Farb-Utilitys (Tailwind-Ergänzung) === */
.bg-sf-dark { background-color: var(--sf-dark); }
.bg-sf-gray { background-color: var(--sf-gray); }
.bg-sf-orange { background-color: var(--sf-orange); }
.text-sf-dark { color: var(--sf-dark); }
.text-sf-orange { color: var(--sf-orange); }
.border-sf-dark { border-color: var(--sf-dark); }
.border-sf-gray { border-color: var(--sf-gray); }
.border-sf-orange { border-color: var(--sf-orange); }
.bg-sf-orange\/10 { background-color: rgba(255, 85, 0, 0.1); }
.bg-sf-orange\/15 { background-color: rgba(255, 85, 0, 0.15); }
.bg-sf-orange\/20 { background-color: rgba(255, 85, 0, 0.2); }
/* Tailwind 2 (CDN-Version) kennt die Schrägstrich-Deckkraft-Schreibweise
   (z.B. "bg-blue-500/10") noch nicht - hier als Ergänzung nachgerüstet,
   damit die Statistik-Kacheln im Dashboard ihre vorgesehene Farbe zeigen. */
.bg-blue-500\/10 { background-color: rgba(59, 130, 246, 0.1); }
.bg-green-500\/10 { background-color: rgba(16, 185, 129, 0.1); }
.bg-yellow-500\/10 { background-color: rgba(245, 158, 11, 0.1); }
.bg-purple-500\/10 { background-color: rgba(168, 85, 247, 0.1); }
.bg-red-500\/10 { background-color: rgba(239, 68, 68, 0.1); }
.hover\:text-sf-orange:hover { color: var(--sf-orange); }
.hover\:border-sf-orange:hover { border-color: var(--sf-orange); }

/* ============================================================
   LANDING PAGE
   ============================================================ */
.landing-body { background: var(--sf-dark); }

.sf-nav {
  background: rgba(35, 39, 42, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.nav-link { color: #B0B3B8; font-weight: 500; font-size: 0.95rem; transition: color 0.2s; }
.nav-link:hover { color: var(--sf-orange); }

/* Desktop-Navigation der Startseite: ab Tablet-Breite sichtbar, auf dem Handy
   ausgeblendet (dort übernimmt das Hamburger-Menü). Bewusst eine eigene Klasse
   statt Tailwinds "hidden md:flex", weil ".hidden" in dieser Datei mit
   "!important" arbeitet (für die per Klick ein-/ausklappbaren Menüs/Modals)
   und damit die "ab Tablet zeigen"-Regel sonst überstimmen würde. */
.sf-nav-links { display: none; }
@media (min-width: 768px) {
  .sf-nav-links { display: flex; }
}

.sf-hero { background: linear-gradient(180deg, var(--sf-dark) 0%, var(--sf-gray) 100%); }
.sf-hero-bg {
  background:
    radial-gradient(circle at 80% 20%, rgba(255, 85, 0, 0.15) 0%, transparent 40%),
    radial-gradient(circle at 20% 80%, rgba(255, 85, 0, 0.08) 0%, transparent 40%);
}
.sf-card-glow {
  background: linear-gradient(145deg, var(--sf-gray) 0%, var(--sf-dark) 100%);
  box-shadow: 0 0 60px rgba(255, 85, 0, 0.15);
}
.floorplan-preview { background: #1A1D1F; }
.pin-preview {
  position: absolute;
  transform: translate(-50%, -100%);
  background: var(--sf-orange);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px 10px 10px 0;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.pin-preview::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0;
  border: 4px solid transparent;
  border-top-color: var(--sf-orange);
  border-right: 0;
}

.sf-feature-card {
  background: white;
  border: 1px solid var(--sf-border);
  border-radius: 1rem;
  padding: 2rem;
  transition: all 0.3s;
}
.sf-feature-card:hover { border-color: var(--sf-orange); box-shadow: 0 10px 40px rgba(255, 85, 0, 0.1); transform: translateY(-2px); }
.sf-feature-icon { width: 3rem; height: 3rem; border-radius: 0.75rem; display: flex; align-items: center; justify-content: center; margin-bottom: 1rem; }

.sf-step { position: relative; padding-left: 1rem; }
.sf-step-num {
  width: 3rem; height: 3rem; border-radius: 50%;
  background: var(--sf-orange); color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; font-weight: 800; margin-bottom: 1rem;
  box-shadow: 0 0 0 4px rgba(255, 85, 0, 0.2);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.sf-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  font-weight: 600; font-size: 0.95rem; padding: 0.6rem 1.25rem;
  border-radius: 0.625rem; transition: all 0.2s; cursor: pointer; border: 2px solid transparent;
  white-space: nowrap; user-select: none;
}
.sf-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.sf-btn-primary { background: var(--sf-orange); color: white; }
.sf-btn-primary:hover:not(:disabled) { background: var(--sf-orange-dark); box-shadow: 0 4px 12px rgba(255, 85, 0, 0.3); }
.sf-btn-outline { background: transparent; color: var(--sf-dark); border-color: var(--sf-border); }
.sf-btn-outline:hover:not(:disabled) { border-color: var(--sf-orange); color: var(--sf-orange); background: rgba(255, 85, 0, 0.05); }
/* Outline-Variante für hellen Hintergrund */
.auth-form-side .sf-btn-outline, .sf-topbar .sf-btn-outline, main .sf-btn-outline {
  color: var(--sf-dark); border-color: var(--sf-border);
}
.auth-form-side .sf-btn-outline:hover, main .sf-btn-outline:hover { border-color: var(--sf-orange); color: var(--sf-orange); }
.sf-btn-dark { background: var(--sf-dark); color: white; }
.sf-btn-dark:hover:not(:disabled) { background: var(--sf-gray); }
.sf-btn-danger { background: #DC2626; color: white; }
.sf-btn-danger:hover:not(:disabled) { background: #B91C1C; }

/* ============================================================
   AUTH PAGES
   ============================================================ */
.auth-body { background: var(--sf-dark); }
.auth-wrapper { display: flex; min-height: 100vh; }
.auth-brand { width: 45%; position: relative; overflow: hidden; border-right: 1px solid rgba(255,255,255,0.05); }
.auth-brand-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 70% 30%, rgba(255, 85, 0, 0.2) 0%, transparent 50%),
    linear-gradient(160deg, var(--sf-gray) 0%, var(--sf-dark) 100%);
}
.auth-form-side { width: 55%; background: white; min-height: 100vh; }
@media (max-width: 1023px) { .auth-form-side { width: 100%; } }

/* Auth-Brand nur auf Desktop anzeigen */
@media (max-width: 1023px) {
  .auth-brand-desktop { display: none !important; }
}
/* ============================================================
   FORM ELEMENTS
   ============================================================ */
.sf-label { display: block; font-size: 0.875rem; font-weight: 600; color: var(--sf-dark); margin-bottom: 0.375rem; }
.sf-input {
  width: 100%; padding: 0.625rem 0.875rem;
  border: 1.5px solid var(--sf-border); border-radius: 0.5rem;
  font-size: 0.95rem; color: var(--sf-dark);
  background: white; transition: all 0.2s; outline: none;
}
.sf-input:focus { border-color: var(--sf-orange); box-shadow: 0 0 0 3px rgba(255, 85, 0, 0.12); }
.sf-input::placeholder { color: #9CA3AF; }
textarea.sf-input { resize: vertical; }
/* Diese Regel kommt in der Ladereihenfolge nach Tailwind und würde daher
   sonst den zusätzlichen Platz für Icons (z.B. Such-Symbol, Passwort-Auge)
   aus "pl-12"/"pr-12" wieder überschreiben. Mit zwei Klassen zusammen ist
   diese Regel spezifischer und behält den Icon-Freiraum bei. */
.sf-input.pl-12 { padding-left: 3rem; }
.sf-input.pr-12 { padding-right: 3rem; }

/* Passwort-Stärke */
.pw-strength { background: #E5E7EB; }

/* ============================================================
   APP LAYOUT (Dashboard etc.)
   ============================================================ */
.app-body { overflow-x: hidden; }

.sf-sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: 16rem; z-index: 50;
  background: var(--sf-dark); display: flex; flex-direction: column;
  border-right: 1px solid rgba(255,255,255,0.05);
  transition: transform 0.3s ease;
}
.sf-sidebar-header { padding: 1rem 1.25rem; border-bottom: 1px solid rgba(255,255,255,0.05); }
.sf-sidebar-nav { flex: 1; padding: 1rem 0.75rem; overflow-y: auto; }
.sf-sidebar-link {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.75rem 0.875rem; border-radius: 0.5rem;
  color: #B0B3B8; font-weight: 500; font-size: 0.9rem; margin-bottom: 0.25rem;
  transition: all 0.2s;
}
.sf-sidebar-link:hover { background: rgba(255,255,255,0.05); color: white; }
.sf-sidebar-link.active { background: var(--sf-orange); color: white; }
/* Nicht-klickbare Gruppen-Überschriften in der Sidebar (z.B. "Pläne", "Pins",
   "Export"): optisch identisch zu .sf-sidebar-link, aber ohne Hover-Effekt
   und mit normalem Mauszeiger, damit nicht der Eindruck entsteht, man könnte
   darauf klicken. */
.sf-sidebar-heading {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.75rem 0.875rem 0.625rem; border-radius: 0.5rem;
  color: #B0B3B8; font-weight: 500; font-size: 0.9rem; margin-bottom: 0.375rem;
  cursor: default;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sf-sidebar-footer { padding: 1rem; border-top: 1px solid rgba(255,255,255,0.05); }
/* Abmelden-Button in der dunklen Sidebar */
.sf-sidebar-footer .sf-btn-outline {
  color: white;
  border-color: rgba(255, 255, 255, 0.3);
}
.sf-sidebar-footer .sf-btn-outline:hover {
  border-color: var(--sf-orange);
  color: var(--sf-orange);
  background: rgba(255, 255, 255, 0.05);
}

/* Outline-Buttons auf dunklem Hintergrund (Landing Page, Sidebar) */
.sf-nav .sf-btn-outline,
.sf-sidebar-footer .sf-btn-outline,
.landing-body .sf-btn-outline {
  color: white;
  border-color: rgba(255, 255, 255, 0.3);
}
.sf-nav .sf-btn-outline:hover,
.sf-sidebar-footer .sf-btn-outline:hover,
.landing-body .sf-btn-outline:hover {
  border-color: var(--sf-orange);
  color: var(--sf-orange);
  background: rgba(255, 255, 255, 0.05);
}

.sf-sidebar-overlay {
  position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,0.5);
  backdrop-filter: blur(2px);
}

.sf-main { margin-left: 16rem; min-height: 100vh; }
@media (max-width: 1023px) {
  .sf-sidebar { transform: translateX(-100%); }
  .sf-sidebar.open { transform: translateX(0); }
  .sf-main { margin-left: 0; }
}

.sf-topbar {
  display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap;
  padding: 1rem 1.5rem; background: white; border-bottom: 1px solid var(--sf-border);
  position: sticky; top: 0; z-index: 30;
}
@media (max-width: 640px) {
  .sf-topbar { padding: 0.75rem 1rem; }
}

.sf-sync-badge {
  display: inline-flex; align-items: center; gap: 0.375rem;
  padding: 0.3rem 0.625rem; border-radius: 9999px;
  background: #F3F4F6; font-size: 0.75rem; font-weight: 600; color: var(--sf-dark);
}
.sf-sync-badge.offline { background: #FEF3C7; color: #92400E; }
.sf-sync-badge.offline .bg-green-500 { background: #F59E0B !important; }

/* ============================================================
   SPRACHWAHL (schneller Sprachwechsel, siehe i18n.js)
   ============================================================ */
.sf-lang-switch { position: relative; }
.sf-lang-btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.4rem 0.6rem; border-radius: 0.5rem; border: 1.5px solid var(--sf-border);
  background: white; color: var(--sf-dark); font-size: 0.8rem; font-weight: 600;
  cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.sf-lang-btn:hover { border-color: var(--sf-orange); color: var(--sf-orange); }
.sf-lang-btn-label { max-width: 6rem; overflow: hidden; text-overflow: ellipsis; }
.sf-lang-menu {
  position: absolute; top: calc(100% + 0.4rem); right: 0; z-index: 60; min-width: 11rem;
  max-width: calc(100vw - 2rem);
  background: white; border: 1px solid var(--sf-border); border-radius: 0.75rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15); padding: 0.35rem; max-height: 20rem; overflow-y: auto;
}
.sf-lang-option {
  display: flex; align-items: center; gap: 0.6rem; width: 100%; text-align: left;
  padding: 0.5rem 0.6rem; border-radius: 0.5rem; font-size: 0.85rem; font-weight: 500;
  color: var(--sf-dark); background: none; border: none; cursor: pointer; transition: background 0.15s;
}
.sf-lang-option:hover { background: #F3F4F6; }
.sf-lang-option.active { background: rgba(255, 85, 0, 0.08); color: var(--sf-orange); font-weight: 700; }
/* Auf dunklem Grund (Landing-Nav, Sidebar-Fußzeile) */
.sf-nav .sf-lang-btn, .sf-sidebar-footer .sf-lang-btn {
  background: transparent; border-color: rgba(255,255,255,0.25); color: white;
}
.sf-nav .sf-lang-btn:hover, .sf-sidebar-footer .sf-lang-btn:hover { border-color: var(--sf-orange); color: var(--sf-orange); }

/* ============================================================
   STAT CARDS
   ============================================================ */
.sf-stat-card {
  background: white; border: 1px solid var(--sf-border); border-radius: 0.75rem;
  padding: 1.25rem; display: flex; align-items: center; gap: 1rem; transition: all 0.2s;
}
.sf-stat-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.05); }
.sf-stat-icon { width: 3rem; height: 3rem; border-radius: 0.625rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* ============================================================
   PROJECT CARDS
   ============================================================ */
.project-card {
  background: white; border: 1px solid var(--sf-border); border-radius: 0.75rem;
  padding: 1.25rem; cursor: pointer; transition: all 0.2s;
}
.project-card:hover { border-color: var(--sf-orange); box-shadow: 0 8px 24px rgba(255, 85, 0, 0.08); transform: translateY(-2px); }
.status-badge { font-size: 0.7rem; font-weight: 700; padding: 0.15rem 0.5rem; border-radius: 9999px; }
.status-geplant { background: #DBEAFE; color: #1E40AF; }
.status-in_bearbeitung { background: #FEF3C7; color: #92400E; }
.status-abgeschlossen { background: #D1FAE5; color: #065F46; }
.status-abgebrochen { background: #FEE2E2; color: #991B1B; }

/* Löschen-Button */
.sf-delete-btn {
  display: inline-flex; align-items: center; gap: 0.25rem;
  font-size: 0.75rem; font-weight: 600; color: #DC2626;
  padding: 0.3rem 0.6rem; border-radius: 0.375rem;
  border: 1px solid #FECACA; background: #FEF2F2;
  transition: all 0.2s; cursor: pointer;
}
.sf-delete-btn:hover { background: #DC2626; color: white; border-color: #DC2626; }

/* ============================================================
   MODALS
   ============================================================ */
.sf-modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 1rem; overflow-y: auto; }
.sf-modal-backdrop { position: fixed; inset: 0; background: rgba(35, 39, 42, 0.6); backdrop-filter: blur(4px); }
.sf-modal-content {
  position: relative; background: white; border-radius: 1rem; width: 100%;
  box-shadow: 0 25px 50px rgba(0,0,0,0.25); margin: auto; animation: modalIn 0.25s ease;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.sf-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 1.25rem; border-bottom: 1px solid var(--sf-border); border-radius: 1rem 1rem 0 0; background: white; }
.sf-modal-body { padding: 1.25rem; max-height: calc(100vh - 8rem); overflow-y: auto; }
.sf-modal-close { color: #9CA3AF; padding: 0.25rem; border-radius: 0.375rem; transition: all 0.2s; }
.sf-modal-close:hover { color: var(--sf-orange); background: #F3F4F6; }

/* ============================================================
   FLOORPLAN / PINS
   ============================================================ */
.floorplan-canvas { position: relative; cursor: crosshair; overflow: hidden; touch-action: none; }
.floorplan-canvas.panning { cursor: grabbing; }
.floorplan-canvas img { display: block; }
.floorplan-stage {
  position: absolute; top: 0; left: 0; transform-origin: 0 0;
  will-change: transform;
}
.floorplan-pin {
  position: absolute; transform: translate(-50%, -100%);
  z-index: 5; cursor: grab; transition: filter 0.2s, background 0.2s;
  touch-action: none;
}
.floorplan-pin.dragging { cursor: grabbing; z-index: 50; filter: drop-shadow(0 4px 8px rgba(0,0,0,0.35)); }
.floorplan-pin-dot {
  width: 28px; height: 28px; border-radius: 50% 50% 50% 0;
  background: var(--sf-orange); transform: rotate(-45deg);
  border: 2px solid white; box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
}
.floorplan-pin-dot span { transform: rotate(45deg); color: white; font-size: 0.6rem; font-weight: 800; }
.floorplan-pin:hover .floorplan-pin-dot { background: var(--sf-orange-dark); transform: rotate(-45deg) scale(1.15); }
.floorplan-pin.geprueft .floorplan-pin-dot { background: #10B981; }
.floorplan-pin.maengel .floorplan-pin-dot { background: #EF4444; }
/* Noch nicht mit dem Server synchronisiert (offline erfasst/geändert) */
.floorplan-pin.pending-sync .floorplan-pin-dot { border: 2px dashed white; box-shadow: 0 0 0 2px var(--sf-orange), 0 2px 8px rgba(0,0,0,0.4); }

/* Zoom-Werkzeugleiste */
.floorplan-toolbar {
  position: absolute; right: 0.75rem; bottom: 0.75rem; z-index: 20;
  display: flex; align-items: center; gap: 0.125rem;
  background: white; border-radius: 0.75rem; box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  padding: 0.3rem;
}
.floorplan-toolbar button {
  width: 2rem; height: 2rem; border-radius: 0.5rem; display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem; font-weight: 700; color: var(--sf-dark); transition: all 0.15s; flex-shrink: 0;
}
.floorplan-toolbar button:hover { background: #F3F4F6; color: var(--sf-orange); }
.floorplan-toolbar #zoomLabel { font-size: 0.7rem; font-weight: 700; color: #6B7280; padding: 0 0.3rem; min-width: 2.75rem; text-align: center; user-select: none; }

/* ============================================================
   PIN LIST ITEMS
   ============================================================ */
.pin-item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.75rem; border: 1px solid var(--sf-border); border-radius: 0.5rem;
  cursor: pointer; transition: all 0.2s; background: white;
}
.pin-item:hover { border-color: var(--sf-orange); background: #FFF9F5; }
.pin-item .pin-num { font-size: 0.75rem; font-weight: 800; color: white; background: var(--sf-orange); padding: 0.2rem 0.5rem; border-radius: 0.375rem; white-space: nowrap; }

/* ============================================================
   STOCKWERK-REITER (Grundriss)
   ============================================================ */
.storey-tab {
  display: inline-flex; align-items: center; gap: 0.5rem; white-space: nowrap;
  padding: 0.4rem 0.75rem; border-radius: 9999px; font-size: 0.8rem; font-weight: 600;
  background: #F3F4F6; color: var(--sf-dark); transition: all 0.15s; flex-shrink: 0;
}
.storey-tab:hover { background: #E5E7EB; }
.storey-tab.active { background: var(--sf-orange); color: white; }
.storey-tab-remove {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.1rem; height: 1.1rem; border-radius: 50%; font-size: 0.85rem; line-height: 1;
  opacity: 0.6; transition: all 0.15s;
}
.storey-tab-remove:hover { opacity: 1; background: rgba(0,0,0,0.15); }

/* ============================================================
   CAPTURE: Kategorien & Fotos
   ============================================================ */
.cat-option { cursor: pointer; }
.cat-option-box {
  border: 2px solid var(--sf-border); border-radius: 0.625rem; padding: 0.875rem 0.5rem;
  text-align: center; transition: all 0.2s; color: #6B7280;
}
.cat-option:hover .cat-option-box { border-color: var(--sf-orange); color: var(--sf-orange); }
.cat-option input:checked ~ .cat-option-box {
  border-color: var(--sf-orange); background: rgba(255, 85, 0, 0.06); color: var(--sf-orange);
}

.photo-slot {
  position: relative; border: 2px dashed var(--sf-border); border-radius: 0.625rem;
  aspect-ratio: 4/3; display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.2s; overflow: hidden; background: #F9FAFB;
}
.photo-slot:hover { border-color: var(--sf-orange); }
.photo-empty { text-align: center; pointer-events: none; }
.photo-preview { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo-remove {
  position: absolute; top: 0.375rem; right: 0.375rem; width: 1.5rem; height: 1.5rem;
  border-radius: 50%; background: rgba(0,0,0,0.6); color: white; font-size: 1rem; line-height: 1;
  display: flex; align-items: center; justify-content: center; z-index: 2;
}

/* ============================================================
   DYNAMIC FIELD GROUPS
   ============================================================ */
.field-group { border: 1px solid var(--sf-border); border-left: 3px solid var(--sf-orange); border-radius: 0.5rem; padding: 1rem; background: #FAFAFA; }
.field-group-title { font-size: 0.8rem; font-weight: 700; color: var(--sf-orange); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.75rem; }

/* ============================================================
   PROJEKT-WERKSTATT: Reiter-Navigation (Grundriss/Pins/Fotos/…)
   ============================================================ */
.project-tab {
  display: inline-flex; align-items: center; gap: 0.4rem; white-space: nowrap;
  padding: 0.7rem 0.9rem; font-size: 0.85rem; font-weight: 600; color: #6B7280;
  border-bottom: 2.5px solid transparent; transition: all 0.15s; flex-shrink: 0;
}
.project-tab:hover { color: var(--sf-orange); }
.project-tab.active { color: var(--sf-orange); border-bottom-color: var(--sf-orange); }
.project-tab .tab-count {
  font-size: 0.7rem; font-weight: 800; padding: 0.05rem 0.4rem; border-radius: 9999px;
  background: #F3F4F6; color: #6B7280;
}
.project-tab.active .tab-count { background: rgba(255, 85, 0, 0.12); color: var(--sf-orange); }
.tab-panel.hidden { display: none; }

/* ============================================================
   PIN-STATUS & KATEGORIE BADGES (Pins/Fotos/Mängel-Tab)
   ============================================================ */
.pin-status-badge { font-size: 0.7rem; font-weight: 700; padding: 0.2rem 0.6rem; border-radius: 9999px; white-space: nowrap; display: inline-block; }
.pin-status-offen { background: #F3F4F6; color: #4B5563; }
.pin-status-in_arbeit { background: #FEF3C7; color: #92400E; }
.pin-status-fertig { background: #DBEAFE; color: #1E40AF; }
.pin-status-geprueft { background: #D1FAE5; color: #065F46; }
.pin-status-maengel { background: #FEE2E2; color: #991B1B; }

.category-badge { font-size: 0.7rem; font-weight: 700; padding: 0.2rem 0.6rem; border-radius: 9999px; white-space: nowrap; display: inline-block; }
.category-badge.category-Schott { background: #FFF1E6; color: #C2410C; }
.category-badge.category-Fuge { background: #EDE9FE; color: #5B21B6; }
.category-badge.category-Platte { background: #E0F2FE; color: #075985; }
.category-badge.category-Durchbruch { background: #F3F4F6; color: #374151; }

/* ============================================================
   TEAM & ROLLEN (Benutzer & Rollen)
   ============================================================ */
.role-badge { font-size: 0.7rem; font-weight: 700; padding: 0.2rem 0.6rem; border-radius: 9999px; white-space: nowrap; display: inline-flex; align-items: center; gap: 0.3rem; }
.role-badge .badge-remove { background: none; border: none; padding: 0; margin: 0; color: inherit; opacity: 0.55; cursor: pointer; font-size: 0.75rem; line-height: 1; }
.role-badge .badge-remove:hover { opacity: 1; }
.role-badge.role-leiter { background: #FFF1E6; color: #C2410C; }
.role-badge.role-mitarbeiter { background: #DBEAFE; color: #1E40AF; }
.role-badge.role-pruefer { background: #D1FAE5; color: #065F46; }
.role-badge.role-extern { background: #F3F4F6; color: #374151; }

.team-member-row {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.75rem 1rem; border: 1px solid var(--sf-border); border-radius: 0.5rem;
  background: white;
}
.team-avatar {
  width: 2.25rem; height: 2.25rem; border-radius: 9999px; flex-shrink: 0;
  background: var(--sf-orange); color: white; font-weight: 700; font-size: 0.85rem;
  display: flex; align-items: center; justify-content: center; text-transform: uppercase;
}

/* Demo-Lizenz-Hinweisleiste (wird von app.js bei Bedarf oben eingefügt) */
.sf-demo-banner {
  display: flex; align-items: center; justify-content: center; gap: 0.75rem;
  background: #FFF7ED; color: #9A3412; border-bottom: 1px solid #FED7AA;
  padding: 0.5rem 1rem; font-size: 0.8rem; font-weight: 600; text-align: center; flex-wrap: wrap;
}
.sf-demo-banner a { color: #C2410C; text-decoration: underline; }

/* Rollen-Testmodus-Hinweisleiste (nur für Administrator-Konten, siehe app.js) */
.sf-role-preview-banner {
  display: flex; align-items: center; justify-content: center; gap: 0.75rem;
  background: #EEF2FF; color: #3730A3; border-bottom: 1px solid #C7D2FE;
  padding: 0.5rem 1rem; font-size: 0.8rem; font-weight: 600; text-align: center; flex-wrap: wrap;
}
.sf-role-preview-banner button {
  color: #3730A3; text-decoration: underline; font-weight: 700; background: none; border: none; cursor: pointer; padding: 0;
}

/* ============================================================
   FOTO-GALERIE (Fotos-Tab)
   ============================================================ */
.photo-card {
  position: relative; border-radius: 0.75rem; overflow: hidden; cursor: pointer;
  border: 1px solid var(--sf-border); background: white; transition: all 0.2s;
  border-left: 4px solid #D1D5DB;
}
.photo-card:hover { box-shadow: 0 8px 20px rgba(0,0,0,0.12); transform: translateY(-2px); }
.photo-card.pin-status-offen { border-left-color: #9CA3AF; }
.photo-card.pin-status-in_arbeit { border-left-color: #F59E0B; }
.photo-card.pin-status-fertig { border-left-color: #3B82F6; }
.photo-card.pin-status-geprueft { border-left-color: #10B981; }
.photo-card.pin-status-maengel { border-left-color: #EF4444; }
.photo-card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; background: #F3F4F6; }
.photo-card .photo-card-body { padding: 0.6rem 0.7rem; }
.photo-card .photo-card-phase {
  position: absolute; top: 0.5rem; left: 0.5rem; z-index: 2;
  font-size: 0.65rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.03em;
  padding: 0.15rem 0.5rem; border-radius: 9999px; background: rgba(35,39,42,0.75); color: white;
}

.sf-lightbox {
  position: fixed; inset: 0; z-index: 300; background: rgba(0,0,0,0.88);
  display: flex; align-items: center; justify-content: center; padding: 2rem;
}
.sf-lightbox.hidden { display: none; }
.sf-lightbox img { max-width: 100%; max-height: 85vh; border-radius: 0.5rem; box-shadow: 0 20px 60px rgba(0,0,0,0.5); }
.sf-lightbox-close {
  position: absolute; top: 1rem; right: 1.25rem; color: white; font-size: 2rem; line-height: 1;
  opacity: 0.8; cursor: pointer;
}
.sf-lightbox-close:hover { opacity: 1; }
.sf-lightbox-caption { position: absolute; bottom: 1.5rem; left: 50%; transform: translateX(-50%); color: white; font-size: 0.85rem; text-align: center; }

/* ============================================================
   AUFMASS-TABELLE (Aufmaß-Tab)
   ============================================================ */
.aufmass-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.aufmass-table th {
  text-align: left; font-size: 0.7rem; font-weight: 700; color: #6B7280; text-transform: uppercase;
  letter-spacing: 0.03em; padding: 0.6rem 0.75rem; border-bottom: 2px solid var(--sf-border);
  white-space: nowrap;
}
.aufmass-table td { padding: 0.65rem 0.75rem; border-bottom: 1px solid #F3F4F6; vertical-align: top; }
.aufmass-table tr:hover td { background: #FFF9F5; }
.aufmass-table input.sf-input, .aufmass-table select.sf-input { padding: 0.35rem 0.5rem; font-size: 0.8rem; height: auto; }

/* ============================================================
   ADMIN-BEREICH (admin.html)
   ============================================================ */
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.admin-table th {
  text-align: left; font-size: 0.7rem; font-weight: 700; color: #6B7280; text-transform: uppercase;
  letter-spacing: 0.03em; padding: 0.75rem 1rem; border-bottom: 2px solid var(--sf-border);
  white-space: nowrap; background: #FAFAFA;
}
.admin-table td { padding: 0.7rem 1rem; border-bottom: 1px solid #F3F4F6; vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: #FFF9F5; }
.admin-table select.sf-input { padding: 0.3rem 0.5rem; font-size: 0.75rem; height: auto; min-width: 8rem; }
.admin-row-link { color: var(--sf-dark); font-weight: 600; cursor: pointer; }
.admin-row-link:hover { color: var(--sf-orange); }
.admin-breakdown-row { display: flex; align-items: center; justify-content: space-between; padding: 0.35rem 0; border-bottom: 1px solid #F3F4F6; }
.admin-breakdown-row:last-child { border-bottom: none; }

/* ============================================================
   TABELLEN AUF DEM HANDY: gestapelte Karten statt Querscrollen
   Betrifft .admin-table (admin.html) und .aufmass-table (Aufmaß-Tab).
   Jede <td> braucht dafür ein data-label="Spaltenname" (siehe admin.js
   und aufmass.js) – das erscheint per ::before als Beschriftung links,
   der eigentliche Wert bleibt rechts. Ab Tablet-Breite (>640px) bleibt
   die normale Tabelle wie bisher unverändert.
   ============================================================ */
@media (max-width: 640px) {
  .admin-table, .aufmass-table { border: none; font-size: 0.85rem; }
  .admin-table thead, .aufmass-table thead { display: none; }
  .admin-table, .admin-table tbody, .admin-table tr,
  .aufmass-table, .aufmass-table tbody, .aufmass-table tr {
    display: block; width: 100%;
  }
  .admin-table tr, .aufmass-table tr {
    margin-bottom: 0.75rem; border: 1px solid var(--sf-border); border-radius: 0.75rem;
    padding: 0.25rem 0.875rem; background: white;
  }
  .admin-table tr:last-child, .aufmass-table tr:last-child { margin-bottom: 0; }
  .admin-table tr:hover td, .aufmass-table tr:hover td { background: transparent; }
  .admin-table td, .aufmass-table td {
    display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
    padding: 0.6rem 0; border-bottom: 1px solid #F3F4F6; white-space: normal; text-align: right;
  }
  .admin-table td:last-child, .aufmass-table td:last-child { border-bottom: none; }
  .admin-table td::before, .aufmass-table td::before {
    content: attr(data-label); flex-shrink: 0; text-align: left;
    font-size: 0.7rem; font-weight: 700; color: #6B7280; text-transform: uppercase; letter-spacing: 0.03em;
  }
  .admin-table select.sf-input, .aufmass-table select.sf-input,
  .admin-table input.sf-input, .aufmass-table input.sf-input { min-width: 0; }
}

/* ============================================================
   TOAST
   ============================================================ */
.sf-toast {
  position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%);
  z-index: 200; background: var(--sf-dark); color: white;
  padding: 0.75rem 1.5rem; border-radius: 0.625rem; font-size: 0.9rem; font-weight: 500;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3); animation: toastIn 0.3s ease;
}
.sf-toast.success { background: #065F46; }
.sf-toast.error { background: #991B1B; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 20px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ============================================================
   PDF PREVIEW
   ============================================================ */
.sf-pdf-preview {
  border: 1px solid var(--sf-border); border-radius: 0.5rem; padding: 2rem;
  background: white; color: var(--sf-dark); font-size: 0.85rem; line-height: 1.5;
}
.sf-pdf-preview h2 { font-size: 1.25rem; font-weight: 800; margin-bottom: 0.5rem; }
.sf-pdf-preview h3 { font-size: 1rem; font-weight: 700; margin: 1rem 0 0.5rem; }
.sf-pdf-preview table { width: 100%; border-collapse: collapse; margin: 0.5rem 0; }
.sf-pdf-preview th, .sf-pdf-preview td { border: 1px solid #D1D5DB; padding: 0.375rem 0.5rem; text-align: left; font-size: 0.75rem; }
.sf-pdf-preview th { background: #F3F4F6; }

/* ============================================================
   MISC
   ============================================================ */
.btn-spinner { display: inline-flex; align-items: center; gap: 0.5rem; }
.btn-spinner::before {
  content: ''; width: 1rem; height: 1rem; border: 2px solid currentColor;
  border-top-color: transparent; border-radius: 50%; animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #D1D5DB; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #9CA3AF; }
.sf-sidebar ::-webkit-scrollbar-thumb { background: #4B5054; }