:root {
  --bg: #F3F6FA; --surface: #fff; --border: #D7E0EA;
  --text: #1A1F2B; --text-2: #5F6C7B; --text-3: #8491A0;
  --primary: #2E6CB8; --primary-h: #245D9E; --primary-strong: #0D2B45;
  --green: #16a34a; --yellow: #d97706; --red: #dc2626;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(13,43,69,.08);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 16px; margin: 0 0 10px; }
h3 { font-size: 14px; margin: 0 0 8px; }

/* Layout */
#app { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: var(--primary-strong); color: #C5D4E4; padding: 18px 12px; flex-shrink: 0; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh; }
.sidebar .logo { font-size: 17px; font-weight: 700; color: #fff; padding: 6px 10px 18px; }
.sidebar .logo span { color: #8CB8E8; }
.sidebar a.nav { display: flex; align-items: center; justify-content: space-between; padding: 9px 10px; border-radius: 8px; color: #C5D4E4; font-weight: 500; }
.sidebar a.nav:hover { background: #173A59; text-decoration: none; }
.sidebar a.nav.active { background: var(--primary); color: #fff; }
.sidebar .spacer { flex: 1; }
.sidebar .userbox { padding: 10px; font-size: 12px; color: #9FB4C9; border-top: 1px solid #173A59; }
.sidebar .userbox b { color: #E7EEF6; display: block; }
.legal-links { margin-top: 8px; font-size: 11px; }
.legal-links a { color: #7691A8; }
.legal-links a:hover { color: #C5D4E4; }
.main { flex: 1; padding: 26px 32px; max-width: 1180px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 20px; gap: 12px; flex-wrap: wrap; }
.page-head .sub { color: var(--text-2); margin-top: 2px; }

/* Cards & grids */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.grid { display: grid; gap: 14px; }
.grid.cols-3 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid.cols-kpi { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.kpi .num { font-size: 26px; font-weight: 700; }
.kpi .lbl { color: var(--text-2); font-size: 12px; margin-top: 2px; }
.stack > * + * { margin-top: 14px; }

/* Tables */
table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); padding: 10px 12px; border-bottom: 1px solid var(--border); background: #fafbfc; }
td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr.click { cursor: pointer; }
tr.click:hover { background: #f7f9fc; }

/* Chips, pills, badges */
.chip { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; color: #fff; margin: 1px 3px 1px 0; white-space: nowrap; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.pill.HIGH { background: #fee2e2; color: #b91c1c; }
.pill.MEDIUM { background: #fef3c7; color: #92400e; }
.pill.LOW { background: #e5e7eb; color: #4b5563; }
.badge { background: #ef4444; color: #fff; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 7px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
.dot.green { background: var(--green); } .dot.yellow { background: var(--yellow); } .dot.red { background: var(--red); }
.type-badge { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 600; background: #e0e7ff; color: #3730a3; }
.muted { color: var(--text-3); }
.small { font-size: 12px; }

/* Buttons & forms */
.btn { display: inline-block; border: 1px solid var(--border); background: var(--surface); color: var(--text); padding: 7px 14px; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; }
.btn:hover { background: #f3f4f6; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-h); }
.btn.sm { padding: 4px 10px; font-size: 12px; }
.btn.danger { color: var(--red); }
input, select, textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font: inherit; background: #fff; color: var(--text); }
textarea { min-height: 90px; resize: vertical; }
label { display: block; font-size: 12px; font-weight: 600; color: var(--text-2); margin: 12px 0 4px; }
select.inline { width: auto; padding: 4px 8px; font-size: 12px; }

/* Modal */
.modal-bg { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; z-index: 50; overflow-y: auto; }
.modal { background: #fff; border-radius: 14px; padding: 22px; width: 100%; max-width: 520px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.modal.wide { max-width: 760px; }
.modal h2 { margin-bottom: 6px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.checklist { max-height: 200px; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; padding: 8px; margin-top: 4px; }
.checklist label { display: flex; align-items: center; gap: 8px; font-weight: 400; margin: 4px 0; cursor: pointer; }
.checklist input { width: auto; }

/* Board */
.board { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; }
.board .col { background: #eef0f4; border-radius: var(--radius); padding: 10px; min-width: 250px; width: 250px; flex-shrink: 0; }
.board .col h3 { padding: 2px 4px; display: flex; justify-content: space-between; align-items: center; }
.task-card { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 10px; margin-bottom: 8px; box-shadow: var(--shadow); cursor: pointer; }
.task-card .t { font-weight: 600; margin-bottom: 6px; }
.task-card.done .t { text-decoration: line-through; color: var(--text-3); }
.task-card.reminder-due { border-color: var(--yellow); box-shadow: 0 0 0 2px rgba(217,119,6,.25); }
.due-overdue { color: var(--red); font-weight: 600; }

/* Recommendations */
.rec-card { display: flex; gap: 14px; align-items: flex-start; }
.rec-score { background: #E4EFFB; color: var(--primary); font-weight: 800; font-size: 16px; border-radius: 10px; padding: 10px 12px; min-width: 52px; text-align: center; flex-shrink: 0; }
.rec-why { background: #f3f4f6; border-radius: 8px; padding: 8px 10px; font-size: 12px; color: var(--text-2); margin-top: 8px; }
.rec-actions { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }

/* Meeting-Vorbereitung */
.prep-card { border-left: 3px solid var(--primary); }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tabs button { background: none; border: none; padding: 9px 14px; font: inherit; font-weight: 600; color: var(--text-2); cursor: pointer; border-bottom: 2px solid transparent; }
.tabs button.active { color: var(--primary); border-bottom-color: var(--primary); }

/* Items grouped */
.item-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.item-row:last-child { border-bottom: none; }
.item-row .desc { color: var(--text-2); font-size: 12px; margin-top: 2px; }

/* Login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); width: 100%; }
.login-box { width: 380px; }

/* Toast */
#toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--primary-strong); color: #fff; padding: 10px 18px; border-radius: 10px; font-size: 13px; opacity: 0; transition: opacity .25s; pointer-events: none; z-index: 99; }
#toast.show { opacity: 1; }

.empty { text-align: center; padding: 36px 16px; color: var(--text-2); }
.empty .big { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 6px; }

/* AI Leadership */
.ai-privacy-note { font-size: 12px; color: var(--text-2); line-height: 1.6; }
.ai-disclaimer { background: #fff7ed; border: 1px solid #fed7aa; border-radius: 8px; padding: 8px 10px; font-size: 12px; color: #9a3412; }
.ai-warning { background: #fef2f2; border: 1px solid #fecaca; border-radius: 8px; padding: 8px 10px; font-size: 12px; color: #991b1b; }
.ai-result h2 { margin-top: 18px; }
.ai-result h2:first-of-type { margin-top: 6px; }
.ai-score-card h2 { margin-bottom: 2px; }
.ai-stars { position: relative; display: inline-block; font-size: 17px; line-height: 1; letter-spacing: 2px; color: #e2e5ea; }
.ai-stars-bg { color: #e2e5ea; }
.ai-stars-fg { position: absolute; left: 0; top: 0; overflow: hidden; white-space: nowrap; color: #f59e0b; }
.ai-score { font-weight: 700; font-size: 13px; color: var(--text-2); }
.ai-evidence-badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; background: #eef2f7; color: var(--text-2); }
.ai-preview { background: #0D2B45; color: #C5D4E4; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; line-height: 1.5; padding: 12px; border-radius: 8px; max-height: 50vh; overflow: auto; white-space: pre-wrap; word-break: break-word; }
.ai-loading { color: var(--text-2); font-size: 13px; }

@media (max-width: 860px) {
  #app { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; flex-direction: row; flex-wrap: wrap; }
  .sidebar .logo { padding-bottom: 6px; width: 100%; }
  .sidebar .spacer, .sidebar .userbox { display: none; }
  .main { padding: 16px; }
}
