/* ══════════════════════════════════════════════
   PRODINGER ENTERPRISE — Startseite
   Optimiert für 1920×1080 / 2560×1440, Desktop-orientiert,
   mit einfacher Anpassung für kleinere Displays (siehe Media Query unten).
   Bewusst kein externes Web-Font-Loading (Performance, keine externe
   Abhängigkeit) -- Systemschriftstapel.
   ══════════════════════════════════════════════ */

:root {
  --color-bg: #f2f4f8;
  --color-surface: #ffffff;
  --color-border: #e2e6ee;
  --color-text: #1b2433;
  --color-muted: #5b6472;

  --color-primary: #1d4ed8;        /* PRODINGER-Blau */
  --color-primary-dark: #1638a6;
  --color-accent: #2f6fed;

  --sidebar-bg: #0f2545;           /* dunkles Marine-Blau */
  --sidebar-bg-hover: #17335e;
  --sidebar-bg-active: #1a3b6e;
  --sidebar-border: #1d3a63;
  --sidebar-text: #c3cee3;
  --sidebar-text-muted: #7d8db0;
  --sidebar-text-active: #ffffff;

  --sidebar-width: 224px;
  --header-height: 64px;
  --radius: 10px;
  --shadow-card: 0 1px 2px rgba(15, 37, 69, 0.06), 0 1px 1px rgba(15, 37, 69, 0.04);
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 15px;
  line-height: 1.45;
}

button, input { font-family: inherit; font-size: inherit; }

a { color: inherit; text-decoration: none; }

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

.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  padding: 0 0 16px;
}

.sidebar-brand {
  padding: 18px 20px 20px;
  border-bottom: 1px solid var(--sidebar-border);
  margin-bottom: 10px;
}

.sidebar-brand-logo {
  display: block;
  width: 100%;
  height: auto;
  max-width: 168px;
  background: #ffffff;
  border-radius: 8px;
  padding: 10px 12px;
}

.sidebar-section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--sidebar-text-muted);
  text-transform: uppercase;
  padding: 18px 20px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  margin: 0 8px;
  border-radius: 7px;
  color: var(--sidebar-text);
  font-size: 14px;
  cursor: pointer;
}

.nav-item:hover { background: var(--sidebar-bg-hover); color: var(--sidebar-text-active); }

.nav-item.active {
  background: var(--sidebar-bg-active);
  color: var(--sidebar-text-active);
  font-weight: 600;
}

.nav-item .nav-icon { width: 18px; text-align: center; flex-shrink: 0; }

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid var(--sidebar-border);
  padding-top: 8px;
}

.main-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ── Kopfzeile ── */
.topbar {
  height: var(--header-height);
  flex-shrink: 0;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 24px;
}

.global-search {
  flex: 1;
  max-width: 480px;
  position: relative;
}

.global-search input {
  width: 100%;
  padding: 9px 14px 9px 34px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-bg);
  color: var(--color-muted);
}

.global-search input::placeholder { color: var(--color-muted); }

.global-search .search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  opacity: 0.6;
}

.global-search .search-hint {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  color: var(--color-muted);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 5px;
  padding: 2px 6px;
}

.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 4px; }

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--color-muted);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  position: relative;
}

.icon-btn[data-prepared="true"] { opacity: 0.55; }

/* ── Inhalt ── */
.content {
  flex: 1;
  overflow-y: auto;
  padding: 28px 32px 48px;
}

.content-inner {
  max-width: 1180px;
  margin: 0 auto;
}

/* ── Begrüßung ── */
.welcome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: linear-gradient(135deg, var(--sidebar-bg) 0%, var(--color-primary-dark) 130%);
  border-radius: var(--radius);
  padding: 28px 32px;
  margin-bottom: 24px;
}

.welcome h1 { margin: 0 0 6px; font-size: 22px; font-weight: 700; color: #ffffff; }
.welcome p.subline { margin: 0 0 4px; color: #c3cee3; font-size: 14px; }
.welcome p.date { margin: 0; color: #8fa1c4; font-size: 12px; }

.welcome-illustration { flex-shrink: 0; width: 148px; height: 108px; opacity: 0.95; }

/* ── Schnellzugriff ── */
.section-heading {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin: 0 0 12px;
}

.quick-access {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 32px;
}

.quick-access-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 11px 16px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-card);
}

.quick-access-btn:hover { border-color: var(--color-primary); color: var(--color-primary-dark); }

/* ── Bereichskarten ── */
.area-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

.area-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 18px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

a.area-card:hover { border-color: var(--color-primary); }

.area-card.is-planned {
  background: var(--color-bg);
  box-shadow: none;
  opacity: 0.85;
}

.area-card-icon {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
}

/* Icon-Kachel-Farben -- rein optisch, keine Fachbedeutung (siehe config/applications.js) */
.area-card-icon[data-color="green"]   { background: #e4f5ec; color: #1f7a4d; }
.area-card-icon[data-color="indigo"]  { background: #e8e9fb; color: #4338ca; }
.area-card-icon[data-color="teal"]    { background: #e0f5f3; color: #0f766e; }
.area-card-icon[data-color="blue"]    { background: #e3eefd; color: #1d4ed8; }
.area-card-icon[data-color="orange"]  { background: #feeee0; color: #c2410c; }
.area-card-icon[data-color="amber"]   { background: #fef3d9; color: #b45309; }
.area-card-icon[data-color="red"]     { background: #fde8e8; color: #b91c1c; }
.area-card-icon[data-color="violet"]  { background: #f1e8fd; color: #7c3aed; }
.area-card-icon[data-color="slate"]   { background: #eceff3; color: #475569; }

.area-card.is-planned .area-card-icon { opacity: 0.7; filter: grayscale(35%); }

.area-card-body { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.area-card-body h3 { margin: 0 0 4px; font-size: 14.5px; }
.area-card-body p { margin: 0 0 12px; font-size: 12.5px; color: var(--color-muted); flex: 1; }

.area-card-link {
  align-self: flex-start;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--color-primary-dark);
}

a.area-card:hover .area-card-link { text-decoration: underline; }

.area-card-badge {
  align-self: flex-start;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-muted);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 5px;
  padding: 3px 8px;
}

.empty-hint {
  color: var(--color-muted);
  font-size: 13px;
  padding: 24px;
  text-align: center;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius);
}

/* ── Platzhalterseiten (Tools, Hilfe) ── */
.placeholder-page { max-width: 640px; margin: 64px auto; padding: 0 24px; text-align: left; }
.placeholder-page h1 { font-size: 20px; margin-bottom: 8px; }
.placeholder-page p { color: var(--color-muted); font-size: 14px; line-height: 1.6; }
.back-link { display: inline-block; margin-top: 20px; font-weight: 600; color: var(--color-primary-dark); }

/* ── Kleinere Displays ── */
@media (max-width: 900px) {
  .app-shell { flex-direction: column; }
  .sidebar {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    overflow-x: auto;
    padding: 0;
    border-bottom: 1px solid var(--sidebar-border);
  }
  .sidebar-brand { border-bottom: none; border-right: 1px solid var(--sidebar-border); padding: 12px 16px; margin-bottom: 0; }
  .sidebar-section-label { display: none; }
  .nav-item { white-space: nowrap; margin: 6px 4px; }
  .sidebar-footer { margin-top: 0; border-top: none; margin-left: auto; }
  .welcome { flex-direction: column; align-items: flex-start; }
  .welcome-illustration { width: 120px; height: 88px; }
  .content { padding: 20px; }
}
