@import url('https://fonts.googleapis.com/css2?family=Anton&family=Bebas+Neue&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --brand-blue: #5271FF;
  --brand-blue-dark: #3a56e0;
  --brand-blue-light: #7b93ff;
  --brand-black: #000000;
  --brand-white: #FFFFFF;

  --sidebar-bg: #0a0a0a;
  --sidebar-text: #d4d4d4;
  --sidebar-hover: #1a1a2e;
  --sidebar-active: var(--brand-blue);
  --topbar-bg: var(--brand-white);
  --topbar-border: #e5e7eb;
  --content-bg: #f5f6fa;
  --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
}

* {
  box-sizing: border-box;
}

html {
  font-size: 14px;
  position: relative;
  min-height: 100%;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body {
  margin: 0;
  background: var(--content-bg);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #334155;
}

/* ----- Layout ----- */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ----- Sidebar ----- */
:root {
  --sidebar-width: 240px;
  --sidebar-collapsed-width: 64px;
  --sidebar-transition: 0.22s cubic-bezier(0.4,0,0.2,1);
}

.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  transition: width var(--sidebar-transition);
  position: relative;
  z-index: 200;
}

/* Desktop collapsed state */
.sidebar.collapsed {
  width: var(--sidebar-collapsed-width);
}

.sidebar-header {
  padding: 0 1rem;
  border-bottom: 1px solid rgba(255,255,255,.07);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  flex-shrink: 0;
  overflow: hidden;
}

.sidebar-brand-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  overflow: hidden;
  flex: 1;
  min-width: 0;
}

.sidebar-logo {
  height: 36px;
  width: auto;
  display: block;
  flex-shrink: 0;
  transition: opacity var(--sidebar-transition), width var(--sidebar-transition);
}

/* Small icon logo shown when collapsed */
.sidebar-logo-icon {
  height: 32px;
  width: 32px;
  display: none;
  flex-shrink: 0;
  border-radius: 6px;
}

.sidebar.collapsed .sidebar-logo { display: none; }
.sidebar.collapsed .sidebar-logo-icon { display: block; }

.sidebar-header-actions {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  margin-left: 0.25rem;
}

/* Collapse toggle button (desktop) */
.sidebar-collapse-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: none;
  border: none;
  color: rgba(255,255,255,.4);
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  transition: background .12s, color .12s, transform var(--sidebar-transition);
  flex-shrink: 0;
}

.sidebar-collapse-btn:hover { background: rgba(255,255,255,.1); color: #fff; }

.sidebar.collapsed .sidebar-collapse-btn {
  transform: rotate(180deg);
}

.sidebar-close {
  background: none;
  border: none;
  color: rgba(255,255,255,.5);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.sidebar-close:hover { color: #fff; }

/* ── Nav Groups ── */
.sidebar-nav {
  padding: 0.5rem 0 1rem;
  flex: 1;
  overflow-x: hidden;
}

.nav-group-label {
  padding: 1rem 1.25rem 0.3rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,.3);
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-group-label-text { transition: opacity var(--sidebar-transition), width var(--sidebar-transition); }
.nav-group-label-dot {
  display: none;
  width: 20px;
  height: 1px;
  background: rgba(255,255,255,.2);
  flex-shrink: 0;
}

.sidebar.collapsed .nav-group-label { padding: 1rem 0 0.3rem; justify-content: center; }
.sidebar.collapsed .nav-group-label-text { display: none; }
.sidebar.collapsed .nav-group-label-dot { display: block; }

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 1.25rem;
  color: rgba(255,255,255,.65);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0;
  transition: background .12s, color .12s, padding var(--sidebar-transition);
  border-left: 3px solid transparent;
  margin: 1px 0;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar-nav .nav-link:hover {
  background: rgba(255,255,255,.07);
  color: #fff;
}

.sidebar-nav .nav-link.active {
  background: rgba(82,113,255,.2);
  color: #fff;
  border-left-color: var(--brand-blue);
}

.sidebar-nav .nav-icon {
  font-size: 1.05rem;
  width: 1.25rem;
  text-align: center;
  flex-shrink: 0;
}

.nav-label {
  transition: opacity var(--sidebar-transition);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Collapsed: center icons, hide labels */
.sidebar.collapsed .sidebar-nav .nav-link {
  padding: 0.55rem 0;
  justify-content: center;
  gap: 0;
  border-left-color: transparent !important;
}

.sidebar.collapsed .sidebar-nav .nav-link.active {
  background: rgba(82,113,255,.25);
  border-left: none;
  border-radius: 0;
  position: relative;
}

.sidebar.collapsed .sidebar-nav .nav-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--brand-blue);
  border-radius: 0 2px 2px 0;
}

.sidebar.collapsed .nav-label { display: none; }

.sidebar-footer {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,.07);
  font-size: 0.72rem;
  color: rgba(255,255,255,.25);
  text-align: center;
  letter-spacing: .05em;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-footer-icon { display: none; font-size: 1rem; }
.sidebar.collapsed .sidebar-footer-text { display: none; }
.sidebar.collapsed .sidebar-footer-icon { display: block; }

/* Prevent transition on initial load */
.sidebar.no-transition,
.sidebar.no-transition * { transition: none !important; }

/* ----- Main content ----- */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ----- Topbar ----- */
.topbar {
  height: 60px;
  background: var(--topbar-bg);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1.5rem 0 1rem;
  flex-shrink: 0;
  border-bottom: 1px solid var(--topbar-border);
  box-shadow: 0 1px 0 rgba(0,0,0,.04);
}

/* Search bar */
.topbar-search {
  position: relative;
  flex: 0 1 360px;
}

.topbar-search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  font-size: 0.875rem;
  pointer-events: none;
}

.topbar-search-input {
  width: 100%;
  padding: 0.4rem 0.75rem 0.4rem 2.1rem;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f9fafb;
  font-size: 0.875rem;
  color: #374151;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.topbar-search-input::placeholder { color: #9ca3af; }

.topbar-search-input:focus {
  border-color: var(--brand-blue-light);
  box-shadow: 0 0 0 3px rgba(82,113,255,.12);
  background: #fff;
}

/* Topbar right side */
.topbar-spacer { flex: 1; }

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.topbar-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: none;
  color: #6b7280;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.1rem;
  transition: background .12s, color .12s;
}

.topbar-icon-btn:hover { background: #f3f4f6; color: #111827; }

/* User Avatar */
.user-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--brand-blue);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: .03em;
  flex-shrink: 0;
}

.user-avatar--md {
  width: 38px;
  height: 38px;
  font-size: 0.85rem;
}

.topbar-user-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: none;
  padding: 0.3rem 0.5rem;
  border-radius: 8px;
  cursor: pointer;
  color: #374151;
  font-size: 0.875rem;
  transition: background .12s;
}

.topbar-user-btn:hover { background: #f3f4f6; }
.topbar-user-btn::after { display: none; } /* remove BS caret */

.topbar-name { font-weight: 500; }

/* User Dropdown */
.topbar-dropdown {
  min-width: 220px;
  box-shadow: 0 8px 30px rgba(0,0,0,.12);
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  padding: 0.5rem 0;
}

.topbar-dropdown .dropdown-header {
  padding: 0.6rem 1rem 0.8rem;
  color: #374151;
}

.topbar-dropdown .dropdown-item {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  color: #374151;
  display: flex;
  align-items: center;
}

.topbar-dropdown .dropdown-item:hover { background: #f9fafb; }
.topbar-dropdown .dropdown-item.text-danger:hover { background: #fff5f5; }

.sidebar-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  background: transparent;
  color: #374151;
  cursor: pointer;
  border-radius: 8px;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.sidebar-toggle:hover {
  background: #f1f5f9;
}

.sidebar-toggle span {
  display: block;
  height: 2px;
  width: 20px;
  background: currentColor;
  border-radius: 1px;
}

.topbar-spacer {
  flex: 1;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.topbar-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: #374151;
}

.topbar-rolle {
  font-size: 0.75rem;
  background: var(--brand-blue);
  color: #fff;
  padding: 0.2em 0.6em;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.content-area {
  flex: 1;
  padding: 1.5rem 2rem;
  overflow: auto;
}

/* ----- Page header ----- */
.page-header {
  margin-bottom: 1.5rem;
}

.page-header h1 {
  font-family: 'Anton', sans-serif;
  font-size: 1.6rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  margin: 0 0 0.25rem 0;
  color: var(--brand-black);
  text-transform: uppercase;
}

.page-header p {
  color: #6b7280;
  margin: 0;
}

/* ----- KPI cards ----- */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.kpi-card {
  background: #fff;
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: var(--card-shadow);
  border: 1px solid #e5e7eb;
  border-top: 3px solid #e5e7eb;
  transition: box-shadow 0.15s, transform 0.15s;
  position: relative;
  overflow: hidden;
}

.kpi-card:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,.08);
  transform: translateY(-1px);
}

.kpi-card--blue  { border-top-color: var(--brand-blue); }
.kpi-card--red   { border-top-color: #dc2626; }
.kpi-card--green { border-top-color: #16a34a; }
.kpi-card--gray  { border-top-color: #6b7280; }

.kpi-icon {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  opacity: 0.8;
}

.kpi-value {
  font-family: 'Anton', sans-serif;
  font-size: 2.2rem;
  font-weight: 400;
  color: #111827;
  line-height: 1.1;
}

.kpi-label {
  font-size: 0.82rem;
  color: #6b7280;
  margin-top: 0.2rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.kpi-sub {
  margin-top: 0.5rem;
  font-size: 0.8rem;
}

.kpi-link {
  color: var(--brand-blue);
  text-decoration: none;
  font-weight: 500;
}

.kpi-link:hover { text-decoration: underline; }

/* ----- Cards ----- */
.card {
  background: #fff;
  border-radius: 10px;
  box-shadow: var(--card-shadow);
  border: 1px solid #e5e7eb;
}

.card-header {
  padding: 0.75rem 1rem;
  background: #fafbfc;
  border-bottom: 1px solid #e5e7eb;
  font-weight: 600;
  color: var(--brand-black);
}

.card-body {
  padding: 1rem;
}

/* ----- Utility ----- */
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }

/* ----- Filter Bar ----- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.filter-search {
  position: relative;
  flex: 1 1 220px;
  min-width: 180px;
}

.filter-search-icon {
  position: absolute;
  left: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  font-size: 0.85rem;
  pointer-events: none;
}

.filter-search-input {
  width: 100%;
  padding: 0.42rem 0.75rem 0.42rem 2rem;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  font-size: 0.875rem;
  color: #374151;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.filter-search-input::placeholder { color: #9ca3af; }

.filter-search-input:focus {
  border-color: var(--brand-blue-light);
  box-shadow: 0 0 0 3px rgba(82,113,255,.12);
}

.filter-select {
  flex: 0 1 160px;
  min-width: 130px;
  border-radius: 8px !important;
  border-color: #e5e7eb !important;
  background: #fff;
  font-size: 0.875rem;
}

/* ----- Tables ----- */
.table th {
  font-weight: 600;
  color: #374151;
  font-size: 0.85rem;
  border-bottom: 2px solid #e5e7eb;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.table td {
  vertical-align: middle;
}

/* IR Table — enhanced table */
.ir-table thead th {
  background: #fafbfc;
  white-space: nowrap;
  user-select: none;
}

.ir-table-row {
  cursor: default;
  transition: background 0.1s;
}

.ir-table-row:hover { background: #f8faff; }

.ir-table-footer {
  padding: 0.6rem 1rem;
  border-top: 1px solid #e5e7eb;
  min-height: 36px;
}

/* Row action buttons */
.ir-row-actions {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  justify-content: flex-end;
  opacity: 1;
  transition: opacity .15s;
}

.ir-table-row:hover .ir-row-actions { opacity: 1; }

/* Consistent 3-icon action buttons */
.ir-table td .d-flex.gap-1 .btn-sm,
.ir-table td .d-flex.gap-1 a.btn-sm {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  border-radius: 7px;
  flex-shrink: 0;
}

.ir-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: none;
  background: none;
  color: #6b7280;
  text-decoration: none;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background .12s, color .12s;
}

.ir-action-btn:hover {
  background: #f1f5f9;
  color: #111827;
}

.ir-action-btn--danger {
  color: #dc2626;
}

.ir-action-btn--danger:hover {
  background: #fee2e2;
  color: #b91c1c;
}

/* ----- Badges (Meldung Status / Priorität) ----- */
.badge {
  font-weight: 600;
  padding: 0.35em 0.65em;
  border-radius: 4px;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}

.badge.status-neu { background: #dbeafe; color: #1d4ed8; }
.badge.status-offen { background: #dbeafe; color: #1d4ed8; }
.badge.status-triagiert { background: #e0e7ff; color: #4338ca; }
.badge.status-freigegeben { background: #fef3c7; color: #b45309; }
.badge.status-zugewiesen { background: #e0e7ff; color: var(--brand-blue); }
.badge.status-terminiert { background: #fce7f3; color: #be185d; }
.badge.status-inbearbeitung { background: #fef3c7; color: #b45309; }
.badge.status-erledigt,
.badge.status-abgeschlossen { background: #d1fae5; color: #047857; }
.badge.status-abgelehnt { background: #fee2e2; color: #b91c1c; }

.badge.prioritaet-tief,
.badge.prioritaet-niedrig { background: #f1f5f9; color: #64748b; }
.badge.prioritaet-mittel { background: #fef3c7; color: #b45309; }
.badge.prioritaet-hoch { background: #fed7aa; color: #c2410c; }
.badge.prioritaet-kritisch,
.badge.prioritaet-dringend { background: #fecaca; color: #b91c1c; }

/* ----- Objekte hierarchy ----- */
.objekte-liegenschaft {
  font-size: 1rem;
}

.objekte-einheit {
  padding: 0.5rem 0;
  border-bottom: 1px solid #f1f5f9;
}

.objekte-einheit:last-child {
  border-bottom: none;
}

/* ----- Login page ----- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-black);
  padding: 1rem;
  position: relative;
  overflow: hidden;
}

.login-page::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -30%;
  width: 80%;
  height: 200%;
  background: var(--brand-blue);
  opacity: 0.06;
  border-radius: 50%;
  transform: rotate(-15deg);
}

.login-container {
  width: 100%;
  max-width: 420px;
  position: relative;
  z-index: 1;
}

.login-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.login-card-header {
  padding: 2rem 1.5rem;
  text-align: center;
  background: #fff;
}

.login-logo {
  height: 120px;
  width: auto;
  margin-bottom: 0.75rem;
}

.login-tagline {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 0.95rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #6b7280;
  margin: 0;
}

.login-card-body {
  padding: 1.5rem;
  border-top: 1px solid #f1f5f9;
}

/* ----- Buttons ----- */
.btn-primary {
  background: var(--brand-blue);
  border-color: var(--brand-blue);
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: 8px;
  padding: 0.6rem 1.25rem;
}

.btn-primary:hover {
  background: var(--brand-blue-dark);
  border-color: var(--brand-blue-dark);
}

.btn-outline-primary {
  border-color: var(--brand-blue);
  color: var(--brand-blue);
  font-weight: 500;
  border-radius: 8px;
}

.btn-outline-primary:hover {
  background: var(--brand-blue);
  border-color: var(--brand-blue);
  color: #fff;
}

.btn-outline-dark {
  border-color: #d1d5db;
  color: #374151;
  font-weight: 500;
  border-radius: 8px;
}

.btn-outline-dark:hover {
  background: var(--brand-black);
  border-color: var(--brand-black);
  color: #fff;
}

.btn:focus, .btn:active:focus, .form-control:focus, .form-check-input:focus, .form-select:focus {
  box-shadow: 0 0 0 0.2rem rgba(82, 113, 255, 0.25);
  border-color: var(--brand-blue-light);
}

/* ----- Form controls ----- */
.form-control, .form-select {
  border-radius: 8px;
  border-color: #d1d5db;
}

.form-label {
  font-weight: 500;
  color: #374151;
}

/* ----- Mobile Overlay ----- */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.25s;
}

.sidebar-overlay.visible {
  display: block;
  opacity: 1;
}

/* ----- Responsive: Mobile sidebar (overlay) ----- */
@media (max-width: 767px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 1000;
    transform: translateX(-100%);
    width: var(--sidebar-width) !important;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,.4);
  }

  .content-area {
    padding: 1rem;
  }
}

@media (min-width: 768px) {
  .sidebar-toggle {
    display: none;
  }
}

/* ----- Toast Notifications ----- */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  pointer-events: none;
}

.ir-toast {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 0.75rem 1rem;
  box-shadow: 0 4px 20px rgba(0,0,0,.12);
  min-width: 260px;
  max-width: 380px;
  pointer-events: all;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.25s, transform 0.25s;
}

.ir-toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.ir-toast.hiding {
  opacity: 0;
  transform: translateY(8px);
}

.ir-toast-success { border-left: 4px solid #16a34a; }
.ir-toast-danger  { border-left: 4px solid #dc2626; }
.ir-toast-warning { border-left: 4px solid #d97706; }
.ir-toast-info    { border-left: 4px solid #2563eb; }

.ir-toast-icon {
  font-size: 1.1rem;
  font-weight: 700;
  flex-shrink: 0;
  width: 1.4rem;
  text-align: center;
}

.ir-toast-msg {
  flex: 1;
  font-size: 0.875rem;
  color: #1f2937;
  line-height: 1.4;
}

.ir-toast-close {
  background: none;
  border: none;
  color: #9ca3af;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
}

.ir-toast-close:hover { color: #374151; }

/* ----- Loading Skeleton (für zukünftige Nutzung) ----- */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.4s infinite;
  border-radius: 4px;
}

@keyframes skeleton-loading {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ----- Permission Matrix ----- */
.permission-table th {
  position: sticky;
  top: 0;
  background: #fafbfc;
  z-index: 2;
}

.modul-col {
  min-width: 140px;
}

.aktion-col {
  min-width: 100px;
}

.rolle-col {
  min-width: 110px;
}

.rolle-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.rolle-label {
  font-weight: 700;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.modul-border-top td {
  border-top: 2px solid #e5e7eb !important;
}

.modul-cell {
  vertical-align: middle;
  font-weight: 600;
  background: #fafbfc;
}

.modul-icon {
  margin-right: 0.5rem;
  font-size: 1.1rem;
}

.modul-name {
  font-size: 0.9rem;
}

.aktion-cell {
  vertical-align: middle;
}

.aktion-name {
  font-size: 0.85rem;
  color: #6b7280;
  font-weight: 500;
}

.perm-cell {
  vertical-align: middle;
}

.perm-toggle {
  width: 2.5rem !important;
  height: 1.3rem;
  cursor: pointer;
}

.perm-toggle:checked {
  background-color: var(--brand-blue) !important;
  border-color: var(--brand-blue) !important;
}

.perm-toggle:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.rolle-summary-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 1rem;
}

.rolle-summary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.bg-primary {
  background-color: var(--brand-blue) !important;
}

.btn-pulse {
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(82, 113, 255, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(82, 113, 255, 0); }
}

/* ----- Public landing page ----- */
.landing-page {
  min-height: 100vh;
  margin: 0;
  color: #f8fafc;
  background: radial-gradient(circle at 15% 10%, #1e3a8a 0%, #0b1220 45%), #0b1220;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.landing-wrap {
  max-width: 1140px;
  margin: 0 auto;
  padding: 1.75rem 1rem 2.25rem;
}

.landing-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.landing-brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.landing-logo {
  height: 52px;
  width: auto;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.2rem;
}

.landing-brand h1 {
  margin: 0;
  font-family: 'Anton', sans-serif;
  font-size: 1.6rem;
  letter-spacing: 0.03em;
}

.landing-brand p {
  margin: 0;
  font-family: 'Bebas Neue', sans-serif;
  letter-spacing: 0.15em;
  color: #cbd5e1;
}

.landing-actions {
  display: flex;
  gap: 0.6rem;
}

.landing-hero {
  border: 1px solid #2d3d62;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(22, 33, 62, 0.95), rgba(13, 23, 43, 0.95));
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.landing-badge {
  display: inline-block;
  border: 1px solid #2d3d62;
  color: #cbd5e1;
  border-radius: 999px;
  padding: 0.3rem 0.6rem;
  font-size: 0.78rem;
  margin-bottom: 0.8rem;
}

.landing-hero h2 {
  margin: 0 0 0.25rem;
  font-family: 'Anton', sans-serif;
  font-size: clamp(2rem, 5vw, 3.5rem);
  letter-spacing: 0.03em;
}

.landing-hero h3 {
  margin: 0 0 0.7rem;
  color: #38bdf8;
  letter-spacing: 0.08em;
  font-size: 1.05rem;
}

.landing-hero p {
  margin: 0;
  color: #d1d5db;
  max-width: 70ch;
}

.landing-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.landing-card {
  border: 1px solid #2d3d62;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(24, 36, 63, 0.96), rgba(18, 29, 50, 0.96));
  padding: 1.2rem;
}

.landing-card h4 {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  color: #fff;
}

.landing-card p,
.landing-card li {
  color: #d1d5db;
}

.landing-steps {
  margin: 0.75rem 0 0;
  padding-left: 1.2rem;
}

.landing-steps li {
  margin-bottom: 0.55rem;
}

.landing-steps p {
  margin: 0.2rem 0 0;
  font-size: 0.95rem;
}

.launch-countdown {
  margin: 0.8rem 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
}

.launch-countdown > div {
  border: 1px solid #2d3d62;
  border-radius: 10px;
  text-align: center;
  background: #101c35;
  padding: 0.55rem 0.35rem;
}

.launch-countdown strong {
  display: block;
  font-size: 1.45rem;
  color: #fff;
  line-height: 1.1;
}

.launch-countdown span {
  color: #cbd5e1;
  font-size: 0.75rem;
}

.landing-footer {
  border: 1px solid #2d3d62;
  border-radius: 14px;
  background: rgba(13, 22, 39, 0.95);
  color: #cbd5e1;
  padding: 1rem;
  text-align: left;
}

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

  .landing-topbar {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 600px) {
  .launch-countdown {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ----- KPI card color variants ----- */
.kpi-card--orange { border-top-color: #f97316; }

/* ----- Kanban Board ----- */
.kanban-board {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 1rem;
  align-items: flex-start;
}

.kanban-col {
  flex: 0 0 280px;
  min-width: 260px;
  background: #f8faff;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 260px);
}

.kanban-col-header {
  padding: 0.75rem 1rem;
  border-top: 3px solid #e5e7eb;
  border-radius: 10px 10px 0 0;
  background: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-size: 0.875rem;
  color: #374151;
  flex-shrink: 0;
}

.kanban-col-count {
  background: #e5e7eb;
  color: #6b7280;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.1em 0.5em;
  min-width: 1.4em;
  text-align: center;
}

.kanban-cards {
  padding: 0.5rem;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.kanban-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 0.75rem;
  display: block;
  transition: box-shadow 0.15s, transform 0.1s;
  color: #374151;
}

.kanban-card:hover {
  box-shadow: 0 4px 14px rgba(0,0,0,.1);
  transform: translateY(-1px);
  border-color: var(--brand-blue-light);
}

.kanban-empty {
  font-size: 0.8rem;
  color: #9ca3af;
  text-align: center;
  padding: 1.5rem 0.5rem;
}

/* ----- Calendar ----- */
.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 4px;
}

.cal-weekdays > div {
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 0;
}

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

.cal-day {
  min-height: 72px;
  border-radius: 6px;
  padding: 4px 5px;
  background: #fafbfc;
  border: 1px solid transparent;
  transition: background .1s;
}

.cal-day--empty { background: transparent; border-color: transparent; }

.cal-day--today {
  background: #eff6ff;
  border-color: var(--brand-blue-light);
}

.cal-day--has-event { background: #fff; border-color: #e5e7eb; }

.cal-day-num {
  font-size: 0.8rem;
  font-weight: 600;
  color: #6b7280;
  margin-bottom: 3px;
  line-height: 1;
}

.cal-day--today .cal-day-num {
  color: var(--brand-blue);
}

.cal-event {
  display: block;
  font-size: 0.68rem;
  background: var(--brand-blue);
  color: #fff;
  border-radius: 3px;
  padding: 1px 4px;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
  line-height: 1.5;
}

.cal-event:hover { background: var(--brand-blue-dark); color: #fff; }

.cal-event-more {
  font-size: 0.65rem;
  color: #9ca3af;
  padding-left: 4px;
}

/* ── PORTFOLIO CARDS (Dashboard) ─────────────────────────── */
.portfolio-card {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  height: 100%;
  transition: box-shadow .15s;
}
.portfolio-card:hover { box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.portfolio-card--warn { border-color: #fde68a; background: #fffbeb; }

.portfolio-card-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 14px 16px;
  color: inherit;
  height: 100%;
}

.portfolio-icon {
  font-size: 1.5rem;
  margin-bottom: 6px;
}

.portfolio-num {
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1;
  color: #111827;
}

.portfolio-label {
  font-size: .78rem;
  color: #6b7280;
  margin-top: 2px;
}

.portfolio-sub {
  font-size: .75rem;
  margin-top: 4px;
}
.portfolio-sub span { font-weight: 600; }

/* ── OBJEKT-ICON (Einheitenliste) ───────────────────────── */
.obj-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #f1f5f9;
  flex-shrink: 0;
  font-size: 1rem;
}

/* ── LEERSTAND TABS ─────────────────────────────────────── */
.leerstand-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 6px 2px 8px;
  font-size: .82rem;
  color: #6b7280;
  cursor: pointer;
  white-space: nowrap;
  transition: color .15s, border-color .15s;
}
.leerstand-tab:hover { color: #111827; }
.leerstand-tab.active { color: var(--brand-blue); border-bottom-color: var(--brand-blue); font-weight: 600; }

.tab-badge {
  display: inline-block;
  background: #f3f4f6;
  color: #374151;
  font-size: .7rem;
  border-radius: 20px;
  padding: 0 6px;
  margin-left: 3px;
  font-weight: 600;
}

.leerstand-panel { min-height: 80px; }

.leerstand-row {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid #f3f4f6;
  gap: 6px;
}
.leerstand-row:last-child { border-bottom: none; }

/* ── AUFGABEN ───────────────────────────────────────────── */
.aufgabe-row {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid #f3f4f6;
  gap: 8px;
}
.aufgabe-row:last-child { border-bottom: none; }
.aufgabe-row--late { background: #fff7f7; }

.btn-aufgabe-check {
  background: none;
  border: 1.5px solid #d1d5db;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  color: #9ca3af;
  font-size: .75rem;
  transition: border-color .15s, color .15s;
}
.btn-aufgabe-check:hover { border-color: #10b981; color: #10b981; }

.aufgabe-prio {
  font-size: .65rem;
  padding: 2px 7px;
  border-radius: 20px;
  text-transform: capitalize;
  font-weight: 600;
  flex-shrink: 0;
}
.aufgabe-prio--tief    { background: #f1f5f9; color: #64748b; }
.aufgabe-prio--mittel  { background: #fef3c7; color: #b45309; }
.aufgabe-prio--hoch    { background: #fee2e2; color: #b91c1c; }
.aufgabe-prio--kritisch{ background: #fce7f3; color: #be185d; }

/* ── Lucide Icons ─────────────────────────────────────────── */
/* Größen-Helfer für Lucide SVG-Icons */
.lucide-sm  { width: 1rem;    height: 1rem;    vertical-align: -0.125em; flex-shrink: 0; }
.lucide-md  { width: 1.25rem; height: 1.25rem; vertical-align: -0.2em;   flex-shrink: 0; }
.lucide-lg  { width: 1.5rem;  height: 1.5rem;  vertical-align: -0.25em;  flex-shrink: 0; }
.lucide-xl  { width: 2rem;    height: 2rem;    vertical-align: -0.3em;   flex-shrink: 0; }
.lucide-2x  { width: 2.5rem;  height: 2.5rem;  flex-shrink: 0; }
/* inline Ausrichtung für Texte */
[data-lucide] { display: inline-block; }

