/* PlusPlan — Design-System. Plus-CI: Dunkel #1c2028, Akzent #e94e1b. */
:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --ink: #1c2028;
  --ink-2: #4a515e;
  --ink-3: #8a909c;
  --line: #e4e7ec;
  --accent: #e94e1b;
  --accent-ink: #ffffff;
  --accent-soft: #fdece6;
  --ok: #1c9e6b;
  --ok-soft: #e3f5ee;
  --warn: #c9851a;
  --warn-soft: #fbf1dc;
  --danger: #d23b3b;
  --prio1: #d23b3b;
  --prio2: #c9851a;
  --prio3: #6b7280;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.10);
  --shadow-lg: 0 8px 24px rgba(16,24,40,.12);
  --sidebar: #1c2028;
  --sidebar-ink: #c7ccd6;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1,h2,h3,h4 { margin: 0 0 .4em; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 22px; } h2 { font-size: 17px; } h3 { font-size: 15px; }
.muted { color: var(--ink-3); }
.small { font-size: 12.5px; }

/* Layout */
.app { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--sidebar); color: var(--sidebar-ink);
  display: flex; flex-direction: column; padding: 18px 14px; gap: 6px;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 18px; color: #fff; font-weight: 700; font-size: 18px; letter-spacing: -.02em; }
.brand .logo { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); display: grid; place-items: center; color: #fff; font-weight: 800; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: var(--radius-sm); color: var(--sidebar-ink); cursor: pointer; font-weight: 500; }
.nav-item:hover { background: rgba(255,255,255,.06); text-decoration: none; }
.nav-item.active { background: var(--accent); color: #fff; }
.sidebar .spacer { flex: 1; }
.sidebar .me { font-size: 12.5px; color: var(--ink-3); padding: 8px; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar .me strong { color: #e7e9ee; display: block; }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  display: flex; align-items: center; gap: 16px; padding: 14px 26px;
  background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20;
}
.topbar .grow { flex: 1; }
.content { padding: 26px; max-width: 1200px; width: 100%; margin: 0 auto; }

/* Timer widget (topbar) */
.timer-widget { display: flex; align-items: center; gap: 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 6px 8px 6px 16px; }
.timer-widget.running { border-color: var(--accent); background: var(--accent-soft); }
.timer-clock { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 15px; min-width: 74px; }
.timer-meta { font-size: 12px; color: var(--ink-2); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Icons (einfarbige Kontur-SVGs, PP.icon) */
.icon { flex-shrink: 0; display: inline-block; vertical-align: -2px; }
.nav-item .icon { opacity: .85; }
.task-meta span, .task-meta a { display: inline-flex; align-items: center; gap: 5px; }
.empty .icon svg { width: 40px; height: 40px; opacity: .45; }
.pc-cust { display: inline-flex; align-items: center; gap: 6px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 8px 14px; border-radius: var(--radius-sm); font-weight: 600; font-size: 13.5px; cursor: pointer; font-family: inherit; transition: .12s; }
.btn:hover { background: var(--surface-2); border-color: #d2d6dd; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #d6440f; border-color: #d6440f; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: rgba(0,0,0,.04); }
.btn-danger { color: var(--danger); border-color: var(--line); }
.btn-danger:hover { background: #fdeded; border-color: #f3c9c9; }
.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-icon { width: 34px; height: 34px; padding: 0; justify-content: center; }

/* Cards & grid */
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px; }
.project-card { padding: 18px; cursor: pointer; transition: .12s; display: flex; flex-direction: column; gap: 12px; }
.project-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); border-color: #d8dce3; }
.project-card .pc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.project-card .pc-name { font-weight: 650; font-size: 16px; }
.project-card .pc-cust { color: var(--ink-3); font-size: 13px; }

/* Progress */
.progress { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .3s; }
.progress.done > i { background: var(--ok); }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 650; }
.badge-prio1 { background: #fdeaea; color: var(--prio1); }
.badge-prio2 { background: var(--warn-soft); color: var(--warn); }
.badge-prio3 { background: #eef0f3; color: var(--prio3); }
.badge-status { background: #eef0f3; color: var(--ink-2); }
.badge-active { background: var(--ok-soft); color: var(--ok); }
.badge-paused { background: var(--warn-soft); color: var(--warn); }
.badge-done { background: #e9eefb; color: #3157c4; }
.badge-milestone { background: var(--accent-soft); color: var(--accent); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; flex-wrap: wrap; }
.tab { padding: 10px 14px; cursor: pointer; font-weight: 600; color: var(--ink-2); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* Tasks */
.task-list { display: flex; flex-direction: column; gap: 8px; }
.task { display: flex; align-items: flex-start; gap: 12px; padding: 13px 15px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.task.milestone { border-left: 3px solid var(--accent); }
.task.done .task-title { text-decoration: line-through; color: var(--ink-3); }
.checkbox { width: 20px; height: 20px; border: 2px solid #cbd0d8; border-radius: 6px; cursor: pointer; flex-shrink: 0; margin-top: 1px; display: grid; place-items: center; transition: .12s; background: #fff; }
.checkbox:hover { border-color: var(--accent); }
.checkbox.checked { background: var(--ok); border-color: var(--ok); color: #fff; }
.task-main { flex: 1; min-width: 0; }
.task-title { font-weight: 600; }
.task-meta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 5px; font-size: 12.5px; color: var(--ink-3); }
.task-actions { display: flex; gap: 4px; opacity: 0; transition: .12s; }
.task:hover .task-actions { opacity: 1; }

/* Lists / rows */
.row { display: flex; align-items: center; gap: 12px; padding: 12px 15px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.row + .row { margin-top: 8px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; flex-shrink: 0; font-size: 13px; }
.avatar.cust { background: #e9eefb; color: #3157c4; }

/* Comments */
.comment { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.comment .body { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 13px; white-space: pre-wrap; }
.comment.is-customer .body { background: #f0f5ff; border-color: #dbe7ff; }

/* Timeline (Verlauf) */
.timeline { display: flex; flex-direction: column; gap: 0; }
.tl-item { display: flex; gap: 12px; padding: 9px 0; }
.tl-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); margin-top: 5px; flex-shrink: 0; }
.tl-line { position: relative; }

/* Forms */
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 5px; }
input, select, textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-family: inherit; font-size: 14px; background: var(--surface); color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { resize: vertical; min-height: 80px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Toggle-Switch */
.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; font-weight: 500; font-size: 13.5px; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track { width: 38px; height: 22px; border-radius: 999px; background: #cbd0d8; position: relative; transition: background .15s; flex-shrink: 0; }
.switch-thumb { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(16px); }
.switch input:focus-visible + .switch-track { box-shadow: 0 0 0 3px var(--accent-soft); }
.switch .switch-hint { display: block; font-weight: 400; font-size: 12px; color: var(--ink-3); }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(16,24,40,.45); display: grid; place-items: center; z-index: 100; padding: 20px; }
.modal { background: var(--surface); border-radius: var(--radius); width: 100%; max-width: 560px; max-height: 90vh; overflow: auto; box-shadow: var(--shadow-lg); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); }
.modal-body { padding: 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: var(--surface); }

/* Typeahead */
.typeahead { position: relative; }
.typeahead-list { position: absolute; top: 100%; left: 0; right: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); z-index: 30; max-height: 240px; overflow: auto; margin-top: 4px; }
.typeahead-list .opt { padding: 9px 12px; cursor: pointer; }
.typeahead-list .opt:hover, .typeahead-list .opt.active { background: var(--accent-soft); }

/* Auth pages */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: linear-gradient(135deg, #1c2028, #2a3340); }
.auth-card { background: #fff; border-radius: 16px; box-shadow: var(--shadow-lg); width: 100%; max-width: 400px; padding: 34px; }
.auth-card .brand { color: var(--ink); justify-content: center; padding-top: 0; }

/* Misc */
.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.toolbar .grow { flex: 1; }
.empty { text-align: center; padding: 48px 20px; color: var(--ink-3); }
.empty .icon { font-size: 40px; opacity: .5; }
.toast-wrap { position: fixed; bottom: 22px; right: 22px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast { background: var(--ink); color: #fff; padding: 11px 16px; border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); font-size: 13.5px; animation: slidein .2s; max-width: 340px; }
.toast.ok { background: var(--ok); } .toast.err { background: var(--danger); }
@keyframes slidein { from { transform: translateY(8px); opacity: 0; } }
.kv { display: flex; gap: 8px; font-size: 13px; } .kv b { color: var(--ink-2); min-width: 90px; }
.banner { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 18px; font-size: 13.5px; display: flex; gap: 10px; align-items: center; }
.banner-warn { background: var(--warn-soft); color: #7a5a12; border: 1px solid #ecd9a6; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.flex { display: flex; align-items: center; gap: 10px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 14px; margin-bottom: 24px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.stat .n { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.stat .l { color: var(--ink-3); font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }

@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .sidebar .spacer, .sidebar .me { display: none; }
  .field-row { grid-template-columns: 1fr; }
  .timer-meta { display: none; }
}
