/* Dashboard: helle Arbeitsfläche, dunkelblaue Seitenleiste. Farben aus theme.css (Instanz). */
* { margin: 0; padding: 0; box-sizing: border-box; }
body.dashboard {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  background: #f4f6f9; color: #1f2a37; line-height: 1.5; min-height: 100vh;
  display: grid; grid-template-columns: 230px 1fr;
}
body.dashboard.auth { display: block; }
a { color: var(--primary-blue); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.sidebar {
  background: linear-gradient(180deg, var(--primary-dark), var(--primary-deep)); color: #ffffff;
  padding: 20px 14px; display: flex; flex-direction: column; gap: 20px; min-height: 100vh; position: sticky; top: 0;
}
.sidebar .logo img { width: 150px; height: auto; display: block; margin: 0 auto; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a { color: rgba(255, 255, 255, 0.8); text-decoration: none; padding: 9px 12px; border-radius: 8px; }
.sidebar nav a:hover { background: rgba(255, 255, 255, 0.08); color: #ffffff; }
.sidebar nav a.active { background: var(--accent); color: #ffffff; font-weight: 600; }
.sidebar-user { margin-top: auto; font-size: 0.9rem; color: rgba(255, 255, 255, 0.75); display: flex; flex-direction: column; gap: 4px; padding: 0 12px; }
.sidebar-user .link { background: none; border: 0; color: var(--accent-light); cursor: pointer; padding: 0; font: inherit; text-align: left; }

.workspace { padding: 28px 32px 48px; max-width: 1200px; width: 100%; }
body.auth .workspace { max-width: 520px; margin: 0 auto; padding-top: 48px; }
.auth-logo { background: var(--primary-dark); border-radius: 12px; padding: 16px; margin-bottom: 20px; text-align: center; }
.auth-logo img { height: 80px; width: auto; }

h1 { font-size: 1.6rem; margin-bottom: 16px; }
h1 small { font-size: 0.9rem; color: #6b7280; font-weight: 400; margin-left: 8px; }
h2 { font-size: 1.15rem; margin-bottom: 12px; }
p { margin-bottom: 10px; }
ol, ul { margin: 0 0 12px 22px; }

.panel { background: #ffffff; border: 1px solid #e3e7ee; border-radius: 12px; padding: 20px 22px; margin-bottom: 20px; }
.panel.narrow { max-width: 520px; }
.panel.attention { border-left: 4px solid #d97706; }
.panel.danger-zone { border-left: 4px solid #b91c1c; }

.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: #ffffff; border: 1px solid #e3e7ee; border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; }
.stat .num { font-size: 1.6rem; font-weight: 700; color: var(--primary-dark); }
.stat .label { font-size: 0.85rem; color: #6b7280; }
.stat.warn .num { color: #b45309; }

.table-wrap { overflow-x: auto; background: #ffffff; border: 1px solid #e3e7ee; border-radius: 12px; margin-bottom: 16px; }
.panel .table-wrap { border: 0; }
.table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.table th { text-align: left; font-weight: 600; color: #4b5563; background: #f8fafc; }
.table th, .table td { padding: 9px 12px; border-bottom: 1px solid #eef1f5; vertical-align: middle; }
.table.small { font-size: 0.85rem; }
.table tr.blocked td { background: #fef2f2; color: #7f1d1d; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 600; background: #e5e7eb; color: #374151; }
.status-entwurf { background: #e5e7eb; color: #374151; }
.status-geplant { background: #fef3c7; color: #92400e; }
.status-laeuft { background: #dbeafe; color: #1e40af; }
.status-fertig { background: #dcfce7; color: #166534; }
.status-abgebrochen { background: #f3f4f6; color: #6b7280; text-decoration: line-through; }
.status-gesperrt { background: #fee2e2; color: #991b1b; }
.status-neu { background: #dbeafe; color: #1e40af; }
.status-in_bearbeitung { background: #fef3c7; color: #92400e; }
.status-erledigt { background: #dcfce7; color: #166534; }
.status-storniert { background: #f3f4f6; color: #6b7280; text-decoration: line-through; }

.form { display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 5px; font-weight: 500; }
.form fieldset { border: 1px solid #e3e7ee; border-radius: 8px; padding: 10px 14px; display: flex; flex-direction: column; gap: 6px; }
.form legend { font-weight: 600; padding: 0 4px; }
.form label.check, .form label.choice { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=date], input[type=search], select, textarea {
  padding: 9px 11px; border: 1px solid #cbd2dc; border-radius: 8px; font: inherit; background: #ffffff; color: inherit; width: 100%;
}
textarea { resize: vertical; }
.form .btn { align-self: flex-start; }
.inline { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; flex-direction: row; }
.inline input[type=text] { width: auto; flex: 1 1 180px; }
.filter { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.filter input, .filter select { width: auto; flex: 1 1 200px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }

.btn {
  display: inline-block; padding: 9px 18px; border-radius: 999px; border: 1px solid #cbd2dc; background: #ffffff;
  color: #1f2a37; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #ffffff; }
.btn.danger { background: #b91c1c; border-color: #b91c1c; color: #ffffff; }
.btn.small { padding: 5px 12px; font-size: 0.85rem; }

.alert { border-radius: 10px; padding: 11px 15px; margin-bottom: 16px; border: 1px solid; }
.alert.ok { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.alert.info { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.alert.error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert ul { margin-bottom: 0; }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; }
.facts dt { color: #6b7280; }
.secret code { font-size: 1.3rem; letter-spacing: 0.08em; background: #f1f5f9; padding: 8px 12px; border-radius: 8px; display: inline-block; }
.hint { color: #6b7280; font-size: 0.9rem; }
.steps { color: #6b7280; }
.thumb { max-width: 240px; height: auto; border: 1px solid #e3e7ee; border-radius: 8px; }
.pager { display: flex; gap: 16px; align-items: center; }

@media (max-width: 820px) {
  body.dashboard { grid-template-columns: 1fr; }
  .sidebar { min-height: 0; position: static; }
  .sidebar nav { flex-direction: row; flex-wrap: wrap; }
  .sidebar-user { flex-direction: row; justify-content: space-between; padding: 0; }
  .workspace { padding: 20px 16px 40px; }
}
