/* ==========================================================================
   Kosany Tech – Kundenbereich (/konto/) Stylesheet
   Design: Deep Navy, Cobalt Blue, klare Karten, Sidebar-Layout, voll responsiv
   ========================================================================== */

:root {
  --sidebar-width: 260px;
  --header-height-mobile: 64px;
}

body.dashboard-body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-sans);
  min-height: 100vh;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   1. Initial Loading Screen
   ========================================================================== */
.auth-loading-screen {
  position: fixed;
  inset: 0;
  background-color: var(--bg-main);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loading-content {
  text-align: center;
}

.spinner-large {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

.loading-text {
  font-size: 14px;
  color: var(--text-muted);
}

/* ==========================================================================
   2. Main Dashboard Layout
   ========================================================================== */
.dashboard-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* Sidebar (Desktop) */
.dashboard-sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-surface);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-nav {
  flex: 1;
  padding: 20px 12px;
  overflow-y: auto;
}

.sidebar-menu {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-link {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: none;
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: var(--transition);
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
}

.sidebar-link.active {
  background: var(--accent-light);
  color: #93C5FD;
  font-weight: 600;
  border: 1px solid var(--accent-border);
}

.sidebar-link.active .nav-icon {
  stroke: #60A5FA;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar-user-card {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent);
  color: #FFFFFF;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.user-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-status {
  font-size: 11px;
  color: #60A5FA;
}

.sidebar-logout-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 12.5px;
  cursor: pointer;
  transition: var(--transition);
}

.sidebar-logout-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: #FCA5A5;
}

/* ==========================================================================
   3. Main Content Area
   ========================================================================= */
.dashboard-main {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 40px 32px;
  background-color: var(--bg-main);
  min-height: 100vh;
  box-sizing: border-box;
}

.dashboard-container {
  max-width: 900px;
  margin: 0 auto;
}

/* Mobile Header & Dropdown */
.dashboard-mobile-header {
  display: none;
}

.dashboard-mobile-menu {
  display: none;
}

/* Welcome Hero Card */
.welcome-card {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.12) 0%, rgba(11, 19, 37, 0.8) 100%);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  margin-bottom: 32px;
}

.welcome-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 6px;
  letter-spacing: -0.5px;
}

.welcome-subtitle {
  font-size: 15px;
  color: var(--text-secondary);
}

/* Overview Cards */
.overview-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.dash-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
}

.dash-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.card-header-icon {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.icon-bubble {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--accent-light);
  border: 1px solid var(--accent-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.card-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
}

.card-body {
  flex: 1;
  margin-bottom: 20px;
}

.card-text {
  font-size: 14.5px;
  color: var(--text-muted);
}

.status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10B981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

.status-text {
  font-size: 14.5px;
  font-weight: 600;
  color: #10B981;
}

.card-email {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-footer {
  border-top: 1px solid var(--border-color);
  padding-top: 14px;
}

.card-action-link {
  background: none;
  border: none;
  color: #60A5FA;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  transition: var(--transition);
}

.card-action-link:hover {
  color: #93C5FD;
}

/* Page Headers */
.section-page-header {
  margin-bottom: 28px;
}

.page-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 6px;
  letter-spacing: -0.5px;
}

.page-subtitle {
  font-size: 14.5px;
  color: var(--text-muted);
}

/* Empty State: Meine Apps */
.apps-empty-state {
  background: var(--bg-surface);
  border: 1px dashed var(--border-hover);
  border-radius: var(--radius-lg);
  padding: 64px 32px;
  text-align: center;
  margin-top: 8px;
}

.empty-state-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid var(--accent-border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.empty-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
}

.empty-description {
  font-size: 14.5px;
  color: var(--text-muted);
  max-width: 440px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Large Account Details Card */
.account-card-large {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px;
}

.account-card-header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 24px;
}

.account-avatar-large {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--accent);
  color: #FFFFFF;
  font-weight: 800;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4);
}

.account-header-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.account-name-large {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
}

.account-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 28px;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-item.full-width {
  grid-column: span 2;
}

.detail-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.detail-value {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-main);
}

.account-security-box {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-bottom: 28px;
}

.security-icon {
  margin-top: 2px;
}

.security-text strong {
  display: block;
  font-size: 14px;
  color: var(--text-main);
  margin-bottom: 3px;
}

.security-text p {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
}

.account-actions {
  display: flex;
  justify-content: flex-start;
}

/* ==========================================================================
   4. Responsive Breakpoints
   ========================================================================== */
@media (max-width: 900px) {
  body.dashboard-body {
    padding-top: var(--header-height-mobile);
  }

  .dashboard-sidebar {
    display: none;
  }

  .dashboard-mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height-mobile);
    background: rgba(11, 19, 37, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 0 20px;
    z-index: 200;
  }

  .dashboard-mobile-menu {
    display: none;
    position: fixed;
    top: var(--header-height-mobile);
    left: 0;
    right: 0;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 20px;
    flex-direction: column;
    gap: 8px;
    z-index: 199;
  }

  .dashboard-mobile-menu.active {
    display: flex;
  }

  .mobile-nav-link {
    width: 100%;
    text-align: left;
    padding: 12px 14px;
    background: none;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 14.5px;
    font-weight: 500;
    cursor: pointer;
  }

  .mobile-nav-link.active {
    background: var(--accent-light);
    color: #93C5FD;
    font-weight: 600;
    border: 1px solid var(--accent-border);
  }

  .mobile-menu-divider {
    height: 1px;
    background: var(--border-color);
    margin: 8px 0;
  }

  .mobile-nav-link.logout-link {
    color: #FCA5A5;
  }

  .dashboard-main {
    margin-left: 0;
    padding: 24px 16px;
  }

  .overview-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .account-details-grid {
    grid-template-columns: 1fr;
  }

  .detail-item.full-width {
    grid-column: span 1;
  }
}
