/* ── beki-work – BEKI Design-System ──────────────────────────── */
:root {
  --navy:       #1e3d73;
  --teal:       #3a8c68;
  --bg:         #f0f4f8;
  --surface:    #ffffff;
  --surface-2:  #f4f7fb;
  --border:     #dde3ec;
  --border-dark:#d0daea;
  --text:       #1a2740;
  --text-muted: #6b7a8d;
  --text-light: #9ba8bb;
  --line:       #eef1f5;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }
body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}
button, input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--navy); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  border: none; border-radius: 10px; padding: 10px 18px;
  font-weight: 700; font-size: 14px;
  transition: background .15s, filter .15s, border-color .15s;
  display: inline-flex; align-items: center; gap: 7px;
}
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: #16306a; }
.btn-primary:disabled { background: #c8d0dc; cursor: not-allowed; }
.btn-teal { background: var(--teal); color: #fff; }
.btn-teal:hover { background: #2e7555; }
.btn-outline { background: #fff; border: 1.5px solid var(--border); color: #4b5a6e; }
.btn-outline:hover { border-color: var(--navy); color: var(--navy); background: #eef4ff; }
.btn-danger { background: #fee2e2; color: #dc2626; }
.btn-danger:hover { background: #fdcccc; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; border-radius: 8px; }
.btn-full { width: 100%; justify-content: center; }
.btn-icon { padding: 7px 9px; }

/* ── Auth-Seite ──────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #0d2347 0%, #1e3d73 58%, #1a5c4a 100%); padding: 24px;
}
.auth-container { width: min(420px, 100%); }
.auth-card { background: var(--surface); border-radius: 18px; padding: 36px 32px;
  box-shadow: 0 24px 60px rgba(8, 18, 50, .35); }
.auth-logo { text-align: center; margin-bottom: 24px; }
.auth-logo h1 { color: var(--navy); font-size: 28px; font-weight: 800; }
.auth-logo p { margin: 4px 0 0; color: var(--text-muted); font-size: 13px; }
.auth-form .form-group { margin-bottom: 16px; }
.auth-form label, .field label {
  display: block; font-size: 12px; font-weight: 700; color: #4b5a6e;
  text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 5px;
}
input[type=text], input[type=password], input[type=email], input[type=date],
input[type=number], textarea, select {
  width: 100%; padding: 9px 13px; border: 1.5px solid var(--border); border-radius: 9px;
  background: #f8fafc; color: var(--text);
}
textarea { min-height: 80px; resize: vertical; line-height: 1.6; }
input:focus, textarea:focus, select:focus {
  border-color: var(--teal); background: #fff; outline: none;
  box-shadow: 0 0 0 3px rgba(58, 140, 104, .14);
}
.error-message { background: #fee2e2; color: #dc2626; border-radius: 9px;
  padding: 10px 14px; font-size: 13px; margin-bottom: 16px; }
.auth-footer { text-align: center; color: rgba(255,255,255,.55); font-size: 11.5px; margin-top: 18px; }

/* ── App-Shell ───────────────────────────────────────────────── */
body.app { display: flex; overflow: hidden; }
.sidebar {
  width: 240px; flex-shrink: 0;
  background: linear-gradient(160deg, #0d2347 0%, #1e3d73 58%, #1a5c4a 100%);
  display: flex; flex-direction: column; box-shadow: 3px 0 20px rgba(13, 35, 71, .28); z-index: 200;
}
.sidebar .brand { color: #fff; font-weight: 800; font-size: 20px; padding: 18px 20px 14px; letter-spacing: .3px; }
.sidebar .brand span { color: #8fd3b6; }
.sidebar nav { display: flex; flex-direction: column; padding: 6px 10px; gap: 2px; }
.sidebar a {
  padding: 9px 14px; border-left: 3px solid transparent; font-size: 13.5px; font-weight: 600;
  color: rgba(255,255,255,.75); display: flex; align-items: center; gap: 11px;
  border-radius: 0 8px 8px 0; transition: all .15s;
}
.sidebar a:hover { background: rgba(255,255,255,.1); color: #fff; text-decoration: none; }
.sidebar a.active { background: rgba(255,255,255,.15); border-left-color: var(--teal); color: #fff; }
.sidebar a .ic { width: 18px; text-align: center; font-size: 15px; }
.sidebar .spacer { flex: 1; }
.sidebar .ver { color: rgba(255,255,255,.4); font-size: 11px; padding: 12px 20px; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 58px; background: var(--surface); border-bottom: 2px solid var(--navy);
  display: flex; align-items: center; padding: 0 20px; gap: 14px;
  box-shadow: 0 2px 10px rgba(30,61,115,.1); flex-shrink: 0; z-index: 100;
}
.topbar .page-title { font-weight: 800; font-size: 18px; color: var(--navy); }
.topbar .spacer { flex: 1; }
.topbar .user { font-size: 13px; color: var(--text-muted); }
.avatar { width: 30px; height: 30px; border-radius: 50%; color: #fff; font-size: 12px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.content { flex: 1; overflow: auto; padding: 24px; }
.content-wide { max-width: 1200px; margin: 0 auto; }

/* ── Timer-Widget ────────────────────────────────────────────── */
.timer-widget { display: flex; align-items: center; gap: 10px; background: var(--surface-2);
  border: 1.5px solid var(--border); border-radius: 999px; padding: 5px 6px 5px 14px; }
.timer-widget.running { border-color: var(--teal); background: #f0faf5; }
.timer-widget .t-label { font-size: 12.5px; color: var(--text-muted); max-width: 180px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timer-widget .t-clock { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--navy); font-size: 14px; }
.timer-widget .t-btn { border: none; border-radius: 50%; width: 30px; height: 30px; color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 13px; }
.t-btn.start { background: var(--teal); } .t-btn.start:hover { filter: brightness(1.08); }
.t-btn.stop  { background: #dc2626; }    .t-btn.stop:hover  { filter: brightness(1.08); }

/* ── Karten / Grid ───────────────────────────────────────────── */
.card { background: var(--surface); border: 1.5px solid var(--border); border-radius: 14px;
  padding: 18px 20px; box-shadow: 0 2px 12px rgba(30,61,115,.06); }
.grid { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.page-head { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.page-head h2 { font-size: 24px; font-weight: 800; color: var(--navy); }
.page-head .spacer { flex: 1; }
.muted { color: var(--text-muted); }
.empty { text-align: center; color: var(--text-muted); padding: 48px 20px; }

/* ── Projekt-Karte ───────────────────────────────────────────── */
.project-card { cursor: pointer; transition: transform .15s, box-shadow .15s, border-color .15s;
  border-top: 4px solid var(--teal); }
.project-card:hover { transform: translateY(-2px); border-color: var(--navy);
  box-shadow: 0 6px 24px rgba(30,61,115,.15); }
.project-card h3 { font-size: 17px; margin-bottom: 4px; }
.project-card .client { font-size: 12.5px; color: var(--text-muted); }
.project-card .meta { display: flex; gap: 14px; margin-top: 14px; font-size: 12.5px; color: var(--text-muted); flex-wrap: wrap; }
.progress { height: 7px; background: var(--line); border-radius: 999px; overflow: hidden; margin-top: 12px; }
.progress > span { display: block; height: 100%; background: var(--teal); }

/* ── Badges ──────────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: .03em; white-space: nowrap; }
.tag-chip { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 600; color: #fff; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.prio-low    { color: #6b7a8d; } .prio-normal { color: #3a6cb0; }
.prio-high   { color: #d97706; } .prio-urgent { color: #dc2626; }

/* ── Board (Kanban) ──────────────────────────────────────────── */
.board { display: grid; grid-template-columns: repeat(4, minmax(240px, 1fr)); gap: 14px; align-items: start; }
.board-col { background: var(--surface-2); border: 1.5px solid var(--border); border-radius: 14px;
  padding: 10px; display: flex; flex-direction: column; gap: 9px; min-height: 120px; }
.board-col.drag-over { border-color: var(--teal); background: #eef9f3; }
.board-col h4 { font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; color: #4b5a6e;
  display: flex; align-items: center; gap: 7px; padding: 4px 6px; }
.board-col h4 .count { background: #e3e9f2; color: #4b5a6e; border-radius: 999px; padding: 0 7px; font-size: 11px; }
.task-card { background: #fff; border: 1.5px solid var(--border); border-radius: 11px; padding: 11px 12px;
  cursor: pointer; transition: box-shadow .15s, border-color .15s; box-shadow: 0 1px 4px rgba(30,61,115,.05); }
.task-card:hover { border-color: var(--navy); box-shadow: 0 3px 12px rgba(30,61,115,.12); }
.task-card.dragging { opacity: .5; }
.task-card .tt { font-weight: 600; font-size: 13.5px; margin-bottom: 7px; }
.task-card .tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.task-card .row { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--text-muted); }
.task-card .row .spacer { flex: 1; }

/* ── Listen-Ansicht ──────────────────────────────────────────── */
.tbl { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden;
  border: 1.5px solid var(--border); }
.tbl th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em;
  color: #4b5a6e; padding: 11px 14px; background: var(--surface-2); border-bottom: 1.5px solid var(--border); }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr.clickable { cursor: pointer; }
.tbl tr.clickable:hover td { background: #f8fbff; }

/* ── Tabs ────────────────────────────────────────────────────── */
.tabs { display: inline-flex; background: var(--surface-2); border: 1.5px solid var(--border);
  border-radius: 10px; padding: 3px; gap: 3px; }
.tabs button { border: none; background: transparent; padding: 7px 16px; border-radius: 8px;
  font-weight: 700; font-size: 13px; color: var(--text-muted); }
.tabs button.active { background: #fff; color: var(--navy); box-shadow: 0 1px 4px rgba(30,61,115,.1); }

/* ── Modal ───────────────────────────────────────────────────── */
.overlay { position: fixed; inset: 0; background: rgba(10,20,50,.6); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 20px; }
.modal { background: #fff; border-radius: 18px; width: min(560px, 100%); max-height: 90vh; overflow: auto;
  box-shadow: 0 24px 60px rgba(8,18,50,.28); }
.modal.lg { width: min(720px, 100%); }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 20px 24px 0; }
.modal-head h3 { font-size: 19px; color: var(--navy); flex: 1; }
.modal-head .x { border: none; background: var(--surface-2); border-radius: 8px; width: 32px; height: 32px;
  font-size: 17px; color: var(--text-muted); }
.modal-head .x:hover { background: #e3e9f2; }
.modal-body { padding: 18px 24px; }
.modal-foot { padding: 16px 24px 22px; display: flex; gap: 10px; justify-content: flex-end; border-top: 1px solid var(--line); }
.field { margin-bottom: 14px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ── Timeline / Gantt ────────────────────────────────────────── */
.gantt-wrap { display: flex; border: 1.5px solid var(--border); border-radius: 12px; overflow: hidden; background: #fff; }
.gantt-labels { width: 190px; flex-shrink: 0; border-right: 1.5px solid var(--border); }
.gantt-labels .g-head { height: 44px; border-bottom: 1.5px solid var(--border); background: var(--surface-2); }
.g-rowlabel { height: 36px; display: flex; align-items: center; padding: 0 12px; font-size: 13px;
  border-bottom: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-rowlabel .dot { margin-right: 7px; flex-shrink: 0; }
.gantt-scroll { flex: 1; overflow-x: auto; }
.gantt-chart { position: relative; }
.g-daycol { position: absolute; top: 0; bottom: 0; border-right: 1px solid var(--line); }
.g-daycol.weekend { background: #f7f9fc; }
.g-daycol.today { background: #eef9f3; }
.g-headrule { position: absolute; left: 0; top: 44px; height: 0; border-bottom: 1.5px solid var(--border); }
.g-month { position: absolute; top: 5px; font-size: 11px; font-weight: 700; color: #4b5a6e; padding-left: 5px; z-index: 4; }
.g-dnum { position: absolute; top: 25px; font-size: 10px; color: var(--text-light); text-align: center; z-index: 4; }
.g-bar { position: absolute; height: 24px; border: 1.5px solid; border-radius: 7px; display: flex; align-items: center;
  padding: 0 8px; font-size: 11.5px; font-weight: 600; cursor: pointer; overflow: hidden; white-space: nowrap; z-index: 2; }
.g-bar:hover { filter: brightness(.97); box-shadow: 0 2px 8px rgba(30,61,115,.15); }
.g-ms { position: absolute; top: 0; bottom: 0; z-index: 3; cursor: pointer; }
.g-ms-line { position: absolute; top: 44px; bottom: 0; left: 0; border-left: 2px dashed #d97706; opacity: .5; }
.g-ms-flag { position: absolute; top: 26px; left: 0; transform: translateX(-50%); white-space: nowrap; font-size: 10px;
  font-weight: 700; color: #b45309; background: #fff3d7; border: 1px solid #f1d08a; border-radius: 6px; padding: 1px 6px; }
.g-svg { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.dep-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.dep-item { display: flex; align-items: center; gap: 8px; font-size: 13px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 8px; padding: 5px 10px; }
.dep-item .spacer { flex: 1; }

/* ── Planung / Kapazität ─────────────────────────────────────── */
.cap-table { width: 100%; border-collapse: collapse; background: #fff; border: 1.5px solid var(--border);
  border-radius: 12px; overflow: hidden; }
.cap-table th, .cap-table td { padding: 9px 10px; border-bottom: 1px solid var(--line); font-size: 12.5px; text-align: center; }
.cap-table th { background: var(--surface-2); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: #4b5a6e; }
.cap-table td.name, .cap-table th.name { text-align: left; font-weight: 600; white-space: nowrap; }
.cap-cell { border-radius: 7px; padding: 5px 4px; font-weight: 700; }
.cap-ok   { background: #d4ede2; color: #2c6b4f; }
.cap-mid  { background: #fff3d7; color: #b45309; }
.cap-over { background: #fde2e2; color: #c12c2c; }
.cap-free { background: #eef1f5; color: #9ba8bb; font-weight: 600; }
.cap-cell .sub { font-size: 10px; font-weight: 600; opacity: .8; }

/* ── Report-Balken ───────────────────────────────────────────── */
.bar-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.bar-row .bar-label { width: 170px; flex-shrink: 0; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { flex: 1; height: 22px; background: var(--line); border-radius: 6px; overflow: hidden; position: relative; }
.bar-fill { height: 100%; border-radius: 6px; min-width: 2px; }
.bar-fill.over { background: repeating-linear-gradient(45deg, #dc2626, #dc2626 6px, #b91c1c 6px, #b91c1c 12px) !important; }
.bar-row .bar-val { width: 130px; flex-shrink: 0; text-align: right; font-size: 12.5px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.budget-bar { height: 9px; background: var(--line); border-radius: 999px; overflow: hidden; margin-top: 8px; position: relative; }
.budget-bar > span { display: block; height: 100%; }

/* ── Stat-Karten ─────────────────────────────────────────────── */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat { background: #fff; border: 1.5px solid var(--border); border-radius: 14px; padding: 16px 18px; }
.stat .n { font-size: 26px; font-weight: 800; color: var(--navy); }
.stat .l { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }

@media (max-width: 900px) {
  .sidebar { width: 64px; }
  .sidebar .brand { font-size: 0; padding: 18px 0; text-align: center; }
  .sidebar a span:not(.ic) { display: none; }
  .sidebar .ver { display: none; }
  .board { grid-template-columns: 1fr; }
}
