/* ============================================================
   kats.team Portal – Anwendungs-Layout
   Sidebar, Topbar, Login, Responsive-Verhalten.
   ============================================================ */

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

/* ---------- Sidebar ---------- */
.kt-sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--kt-dark);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 200;
  transition: width .18s ease;
}
.kt-app.kt-collapsed .kt-sidebar { width: var(--sidebar-width-collapsed); }

.kt-sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  min-height: var(--topbar-height);
}
.kt-sidebar-brand img { height: 30px; width: auto; flex-shrink: 0; }
.kt-sidebar-brand-text { font-weight: 800; font-size: 1.02rem; line-height: 1.15; white-space: nowrap; overflow: hidden; }
.kt-sidebar-brand-text small { display: block; font-weight: 500; font-size: 0.68rem; color: rgba(255,255,255,0.55); text-transform: uppercase; letter-spacing: .05em; }
.kt-app.kt-collapsed .kt-sidebar-brand-text { display: none; }

.kt-sidebar-nav { flex: 1; overflow-y: auto; padding: 10px 10px; }
.kt-nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.78); font-weight: 500; font-size: 0.89rem;
  margin-bottom: 2px; white-space: nowrap; overflow: hidden;
}
.kt-nav-link i { font-size: 1.05rem; width: 20px; text-align: center; flex-shrink: 0; }
.kt-nav-link:hover { background: rgba(255,255,255,0.06); color: #fff; }
.kt-nav-link.active { background: var(--kt-accent); color: #fff; }
.kt-app.kt-collapsed .kt-nav-link span { display: none; }
.kt-app.kt-collapsed .kt-nav-link { justify-content: center; }

.kt-sidebar-footer {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 14px 16px;
}
.kt-sidebar-user { display: flex; align-items: center; gap: 10px; }
.kt-sidebar-user-info { overflow: hidden; white-space: nowrap; }
.kt-sidebar-user-info .name { font-weight: 700; font-size: 0.87rem; color: #fff; overflow: hidden; text-overflow: ellipsis; }
.kt-sidebar-user-info .role { font-size: 0.74rem; color: rgba(255,255,255,0.55); }
.kt-app.kt-collapsed .kt-sidebar-user-info { display: none; }
.kt-sidebar-footer-links { margin-top: 10px; display: flex; gap: 14px; }
.kt-sidebar-footer-links a { font-size: 0.78rem; color: rgba(255,255,255,0.65); font-weight: 600; }
.kt-sidebar-footer-links a:hover { color: #fff; }
.kt-app.kt-collapsed .kt-sidebar-footer-links { flex-direction: column; gap: 8px; align-items: center; }

.kt-sidebar-toggle {
  background: rgba(255,255,255,0.08); border: none; color: #fff; width: 28px; height: 28px;
  border-radius: 6px; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.kt-sidebar-toggle:hover { background: rgba(255,255,255,0.16); }

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

.kt-topbar {
  height: var(--topbar-height);
  background: var(--kt-surface);
  border-bottom: 1px solid var(--kt-border);
  display: flex; align-items: center; gap: 16px;
  padding: 0 20px;
  position: sticky; top: 0; z-index: 150;
}
.kt-topbar-title { font-weight: 700; font-size: 1.05rem; white-space: nowrap; }
.kt-topbar-search { flex: 1; max-width: 420px; position: relative; }
.kt-topbar-search input {
  width: 100%; border: 1px solid var(--kt-border); border-radius: 20px;
  padding: 8px 14px 8px 36px; font-size: 0.86rem; background: var(--kt-surface-alt);
}
.kt-topbar-search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--kt-muted); }
.kt-search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--kt-surface);
  border: 1px solid var(--kt-border); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  max-height: 420px; overflow-y: auto; z-index: 300; display: none;
}
.kt-search-results.show { display: block; }
.kt-search-result-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--kt-border); }
.kt-search-result-item:last-child { border-bottom: none; }
.kt-search-result-item:hover { background: var(--kt-accent-tint); }
.kt-search-result-type { font-size: 0.68rem; text-transform: uppercase; letter-spacing: .04em; color: var(--kt-muted); font-weight: 700; }

.kt-topbar-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.kt-icon-btn {
  width: 38px; height: 38px; border-radius: 50%; border: none; background: transparent;
  display: flex; align-items: center; justify-content: center; color: var(--kt-ink); position: relative;
  font-size: 1.1rem;
}
.kt-icon-btn:hover { background: var(--kt-surface-alt); }
.kt-icon-badge {
  position: absolute; top: 2px; right: 2px; background: var(--kt-accent); color: #fff;
  font-size: 0.62rem; font-weight: 700; min-width: 16px; height: 16px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; padding: 0 3px;
}

.kt-active-deployment-banner {
  background: linear-gradient(90deg, var(--kt-accent), var(--kt-accent-dark));
  color: #fff; padding: 8px 20px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  font-size: 0.85rem; font-weight: 600;
}
.kt-active-deployment-banner .kt-pulse {
  width: 9px; height: 9px; border-radius: 50%; background: #fff; flex-shrink: 0;
  animation: kt-pulse 1.4s infinite;
}
@keyframes kt-pulse { 0% { opacity: 1; } 50% { opacity: .35; } 100% { opacity: 1; } }
.kt-active-deployment-banner a { color: #fff; text-decoration: underline; text-underline-offset: 2px; }

.kt-content { padding: 24px 28px; flex: 1; }
.kt-page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.kt-page-header h1 { font-size: 1.4rem; margin: 0 0 4px; }
.kt-page-header .kt-subtitle { color: var(--kt-muted); font-size: 0.88rem; margin: 0; }
.kt-page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Readiness widget ---------- */
.kt-readiness {
  border-radius: var(--radius-lg); padding: 24px; color: #fff;
  background: linear-gradient(135deg, var(--kt-dark), var(--kt-dark-2));
  position: relative; overflow: hidden;
}
.kt-readiness.green { background: linear-gradient(135deg, #1e8e5a, #146641); }
.kt-readiness.yellow { background: linear-gradient(135deg, #b8790a, #8a5b08); }
.kt-readiness.red { background: linear-gradient(135deg, var(--kt-accent), var(--kt-accent-dark)); }
.kt-readiness-badge {
  display: inline-flex; align-items: center; gap: 8px; background: rgba(255,255,255,0.15);
  padding: 6px 14px; border-radius: 20px; font-weight: 700; font-size: 0.85rem; margin-bottom: 14px;
}
.kt-readiness-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 14px; }
.kt-readiness-grid .value { font-size: 1.5rem; font-weight: 800; }
.kt-readiness-grid .label { font-size: 0.78rem; opacity: .85; }

/* ---------- Mobile offcanvas sidebar ---------- */
@media (max-width: 991.98px) {
  .kt-sidebar { position: fixed; left: -100%; top: 0; height: 100%; transition: left .2s ease; box-shadow: var(--shadow-lg); width: 280px; }
  .kt-sidebar.kt-open { left: 0; }
  .kt-app.kt-collapsed .kt-sidebar { width: 280px; }
  .kt-app.kt-collapsed .kt-sidebar-brand-text,
  .kt-app.kt-collapsed .kt-nav-link span,
  .kt-app.kt-collapsed .kt-sidebar-user-info { display: block; }
  .kt-app.kt-collapsed .kt-nav-link { justify-content: flex-start; }
  .kt-sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 190; }
  .kt-sidebar-backdrop.show { display: block; }
  .kt-content { padding: 16px; }
  .kt-topbar { padding: 0 12px; gap: 8px; }
  .kt-topbar-title { display: none; }
  .kt-topbar-search { max-width: none; }
  .kt-mobile-toggle { display: inline-flex !important; }
}
.kt-mobile-toggle { display: none; }

@media (max-width: 575.98px) {
  .kt-readiness-grid { grid-template-columns: 1fr; }
}

/* ---------- Login page ---------- */
.kt-login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--kt-navy), var(--kt-dark-2));
  padding: 24px;
}
.kt-login-card {
  background: var(--kt-surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 420px; padding: 40px 36px;
}
.kt-login-logo { text-align: center; margin-bottom: 22px; }
.kt-login-logo img { height: 44px; }
.kt-login-card h1 { font-size: 1.3rem; text-align: center; margin-bottom: 4px; }
.kt-login-card .kt-subtitle { text-align: center; color: var(--kt-muted); font-size: 0.84rem; margin-bottom: 26px; }
.kt-login-footer { text-align: center; margin-top: 18px; font-size: 0.8rem; }

/* ---------- Ausklappbare Mitglieder-/Fahrzeugkarten ---------- */
.kt-collapse-toggle { cursor: pointer; }
.kt-collapse-toggle .bi-chevron-down { transition: transform .15s ease; }
.kt-collapse-toggle[aria-expanded="true"] .bi-chevron-down { transform: rotate(180deg); }

/* ---------- Utility ---------- */
.kt-scroll-x { overflow-x: auto; }
.kt-mobile-cards .card { margin-bottom: 10px; }
@media (min-width: 768px) { .kt-mobile-cards { display: none; } }
@media (max-width: 767.98px) { .kt-desktop-table { display: none; } }
