/**
 * Premium UI 2.1.1 – finale Verfeinerung (Dashboard, Updater, globale Komponenten)
 */

/* ─── Dashboard Hero & Begrüßung ─── */
.dashboard-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  margin: 0 0 1.35rem;
  padding: 1.35rem 1.5rem;
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92) 0%, rgba(240, 250, 245, 0.88) 55%, rgba(230, 244, 236, 0.75) 100%);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border-light));
  box-shadow: 0 8px 32px rgba(21, 40, 30, 0.07), inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.dashboard-greeting {
  margin: 0;
  font-size: 1.12rem;
  line-height: 1.45;
  color: var(--text-secondary, #2a3d32);
}

.dashboard-greeting strong {
  color: var(--accent-hover, #156b3f);
  font-weight: 700;
}

.dashboard-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.dashboard-hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--border-light);
  color: var(--muted);
}

.dashboard-hero-pill--accent {
  background: linear-gradient(145deg, var(--accent-soft), #c8edd8);
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
  color: var(--accent-hover);
}

/* ─── Updater-Banner (Dashboard) ─── */
.update-dashboard-card {
  position: relative;
  overflow: hidden;
  margin: 0 0 1.35rem;
  padding: 1.25rem 1.5rem;
  border-radius: 16px;
  border: 1px solid #fbbf24;
  background:
    linear-gradient(125deg, #fffbeb 0%, #fff7ed 38%, #ffffff 100%);
  box-shadow:
    0 10px 36px rgba(217, 119, 6, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  animation: update-card-glow 3s ease-in-out infinite;
}

.update-dashboard-card::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -8%;
  width: 12rem;
  height: 12rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.35) 0%, transparent 70%);
  pointer-events: none;
}

@keyframes update-card-glow {
  0%, 100% { box-shadow: 0 10px 36px rgba(217, 119, 6, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.9); }
  50% { box-shadow: 0 14px 42px rgba(217, 119, 6, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.9); }
}

.update-dashboard-inner {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 1rem 1.5rem;
}

.update-dashboard-icon {
  flex-shrink: 0;
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  border-radius: 12px;
  background: linear-gradient(145deg, #f59e0b, #d97706);
  color: #fff;
  box-shadow: 0 6px 18px rgba(217, 119, 6, 0.35);
}

.update-dashboard-body {
  flex: 1;
  min-width: min(100%, 16rem);
}

.update-dashboard-body h2 {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: #92400e;
}

.update-dashboard-body p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: #78350f;
}

.update-version-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.5rem;
  padding: 0.25rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid #fcd34d;
  color: #b45309;
}

.update-changelog-snippet {
  margin: 0.65rem 0 0;
  padding: 0.65rem 0.85rem;
  font-size: 0.8rem;
  line-height: 1.5;
  color: #78350f;
  background: rgba(255, 255, 255, 0.65);
  border-radius: 10px;
  border: 1px dashed #fcd34d;
  white-space: pre-wrap;
  max-height: 5.5rem;
  overflow: hidden;
}

.update-dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  align-self: center;
}

.update-dashboard-actions .btn-primary {
  background: linear-gradient(145deg, #f59e0b 0%, #d97706 100%);
  border-color: #d97706;
  box-shadow: 0 6px 18px rgba(217, 119, 6, 0.3);
}

.update-dashboard-actions .btn-primary:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

/* ─── Sidebar Update-Badge ─── */
.nav-item .nav-update-badge {
  margin-left: auto;
  padding: 0.12rem 0.45rem;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1.3;
  border-radius: 999px;
  background: linear-gradient(145deg, #f59e0b, #d97706);
  color: #fff;
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.4);
  animation: nav-badge-pulse 2s ease-in-out infinite;
}

@keyframes nav-badge-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

/* ─── Quick Actions ─── */
.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 1.35rem;
}

.quick-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  font-size: 0.84rem;
  font-weight: 600;
  border-radius: 12px;
  text-decoration: none;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--border-light);
  box-shadow: 0 2px 10px rgba(21, 40, 30, 0.05);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.quick-action-btn:hover {
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(21, 40, 30, 0.1);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border-light));
  color: var(--accent-hover);
}

.quick-action-btn.primary {
  background: linear-gradient(145deg, #2d9a62 0%, #156b3f 100%);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 20px rgba(31, 122, 76, 0.3);
}

.quick-action-btn.primary:hover {
  color: #fff;
  filter: brightness(1.06);
}

/* ─── KPI & Cards ─── */
.kpi-row .kpi {
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.kpi-row .kpi:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 36px rgba(21, 40, 30, 0.12);
}

body.app .card {
  border-radius: 14px;
  transition: box-shadow 0.22s ease, border-color 0.22s ease;
}

body.app .card:hover {
  box-shadow: 0 12px 36px rgba(21, 40, 30, 0.09);
}

body.app .card-head {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.6) 0%, transparent 100%);
}

.shortcut-card {
  border-radius: 14px;
  background: linear-gradient(165deg, #ffffff 0%, #f8fcf9 100%);
  border: 1px solid var(--border-light);
  box-shadow: 0 4px 18px rgba(21, 40, 30, 0.05);
}

.shortcut-card h3 {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.shortcut-list a {
  transition: color 0.15s ease, padding-left 0.15s ease;
}

.shortcut-list a:hover {
  padding-left: 0.15rem;
  color: var(--accent-hover);
}

/* ─── Tabellen & Listen ─── */
.list-table tbody tr {
  transition: background 0.15s ease;
}

.list-table tbody tr:hover {
  background: color-mix(in srgb, var(--accent-soft) 45%, transparent);
}

.cell-doc .doc-icon {
  box-shadow: 0 2px 8px rgba(21, 40, 30, 0.08);
}

/* ─── Hints ─── */
.hint {
  border-radius: 12px;
  transition: box-shadow 0.2s ease;
}

.hint--spaced {
  margin-bottom: 0.85rem;
}

.hint-warn,
.hint.hint-warn {
  border-left-width: 4px;
}

/* ─── Buttons global ─── */
.btn {
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.btn-primary:not(:disabled):hover {
  transform: translateY(-1px);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
}

/* ─── Badges ─── */
.badge {
  font-weight: 600;
  letter-spacing: 0.01em;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

/* ─── Dashboard Layout ─── */
.dashboard-layout {
  gap: 1.5rem;
}

.dashboard-aside .card,
.dashboard-aside .shortcut-card {
  backdrop-filter: blur(6px);
}

.cron-status-card .card-head-title {
  font-weight: 700;
}

/* ─── Chart ─── */
.dashboard-chart-bar {
  box-shadow: 0 2px 8px rgba(31, 122, 76, 0.25);
}

.dashboard-chart-bar-wrap:hover .dashboard-chart-bar {
  filter: brightness(1.08);
  transform: scaleY(1.02);
  transform-origin: bottom;
}

/* ─── Forms & Inputs ─── */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="search"],
select,
textarea {
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus,
select:focus,
textarea:focus {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}

/* ─── Filter chips ─── */
.filter-chip,
.filter-tabs a {
  transition: all 0.18s ease;
}

/* ─── Empty states ─── */
.empty-state {
  padding: 2.5rem 1.5rem;
}

/* ─── Topbar ─── */
body.app .topbar {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* ─── Dark mode ─── */
html.theme-dark .dashboard-hero {
  background: linear-gradient(135deg, #1a2420 0%, #152820 55%, #121a16 100%);
  border-color: #2d5a40;
}

html.theme-dark .dashboard-greeting {
  color: #d1e7db;
}

html.theme-dark .dashboard-hero-pill {
  background: rgba(15, 22, 18, 0.6);
  border-color: #2a3d32;
  color: #94a89e;
}

html.theme-dark .update-dashboard-card {
  background: linear-gradient(125deg, #2a1f10 0%, #221a12 50%, #1a1510 100%);
  border-color: #92400e;
}

html.theme-dark .update-dashboard-body h2 {
  color: #fcd34d;
}

html.theme-dark .update-dashboard-body p,
html.theme-dark .update-changelog-snippet {
  color: #fde68a;
}

html.theme-dark .update-changelog-snippet {
  background: rgba(0, 0, 0, 0.25);
  border-color: #78350f;
}

html.theme-dark .shortcut-card {
  background: linear-gradient(165deg, #1a2420 0%, #151d18 100%);
}

html.theme-dark .list-table tbody tr:hover {
  background: rgba(45, 154, 98, 0.08);
}

html.theme-dark .quick-action-btn {
  background: #1a2420;
  border-color: #2a3d32;
  color: #d1e7db;
}

/* ─── Portal & öffentliche Seiten ─── */
.public-page--portal .public-card,
.public-page--auth .public-card {
  border-radius: 16px;
  box-shadow: 0 10px 36px rgba(21, 40, 30, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.public-page--portal .public-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 44px rgba(21, 40, 30, 0.11);
}

.public-page--portal .public-header,
.public-page--auth .public-header {
  backdrop-filter: blur(10px);
}

.public-page--portal .btn-primary,
.public-page--auth .btn-primary {
  box-shadow: 0 6px 20px rgba(31, 122, 76, 0.28);
}

html.theme-dark .public-page--portal .public-card {
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.25);
}

@media (max-width: 720px) {
  .dashboard-hero {
    padding: 1rem 1.15rem;
  }

  .update-dashboard-inner {
    flex-direction: column;
  }

  .update-dashboard-actions {
    width: 100%;
    align-self: stretch;
  }

  .update-dashboard-actions .btn {
    flex: 1;
    justify-content: center;
  }

  .quick-actions {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 0.35rem;
    -webkit-overflow-scrolling: touch;
  }

  .quick-action-btn {
    white-space: nowrap;
    flex-shrink: 0;
  }
}
