:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-alt: #fafbfc;
  --border: #e4e6ea;
  --text: #1e1f21;
  --text-soft: #6b6f76;
  --text-faint: #9ca0a8;
  --banana: #f5c518;
  --banana-dark: #d9a400;
  --accent: #4573d2;
  --accent-soft: #eaf0fb;
  --green: #14a44d;
  --red: #e8384f;
  --orange: #fd9a00;
  --purple: #7b5cf0;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,.12);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.18);
  --radius: 10px;
  --sidebar-w: 250px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }

.app { display: flex; height: 100vh; overflow: hidden; }

/* ---------- Sidebar ---------- */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: #1e1f21;
  color: #c7c9cd;
  display: flex;
  flex-direction: column;
  padding: 14px 0;
}
.brand {
  display: flex; align-items: center; gap: 9px;
  padding: 4px 18px 18px; font-size: 20px; font-weight: 800; color: #fff;
  letter-spacing: -.3px;
}
.brand .logo { font-size: 26px; }
.brand small { font-weight: 500; font-size: 11px; color: var(--banana); display: block; letter-spacing: .5px; }

.nav-section { padding: 6px 10px; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  width: 100%; padding: 9px 12px; border-radius: 8px;
  color: #c7c9cd; font-size: 14px; font-weight: 500; text-align: left;
  transition: background .12s;
}
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item.active { background: rgba(245,197,24,.16); color: var(--banana); }
.nav-item .ico { width: 18px; text-align: center; font-size: 15px; }

.nav-label {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 22px 6px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .6px; color: var(--text-faint);
}
.nav-label button { color: var(--text-faint); font-size: 18px; line-height: 1; padding: 0 4px; border-radius: 4px; }
.nav-label button:hover { background: rgba(255,255,255,.1); color: #fff; }

.project-item {
  display: flex; align-items: center; gap: 11px;
  width: 100%; padding: 8px 12px; border-radius: 8px;
  color: #c7c9cd; font-size: 14px; text-align: left; position: relative;
}
.project-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.project-item.active { background: rgba(255,255,255,.1); color: #fff; }
.dot { width: 11px; height: 11px; border-radius: 4px; flex-shrink: 0; }
.project-item .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-item .del { opacity: 0; color: var(--text-faint); font-size: 16px; padding: 0 4px; }
.project-item:hover .del { opacity: 1; }
.project-item .del:hover { color: var(--red); }

.sidebar-footer { margin-top: auto; padding: 12px 18px 4px; font-size: 11px; color: var(--text-faint); }

/* ---------- Main ---------- */
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 26px 0; flex-shrink: 0;
}
.topbar .title-block { display: flex; align-items: center; gap: 12px; }
.topbar h1 { font-size: 22px; font-weight: 800; letter-spacing: -.4px; display: flex; align-items: center; gap: 10px; }
.topbar .title-dot { width: 16px; height: 16px; border-radius: 5px; }
.search {
  margin-left: auto; display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 7px 12px; width: 260px; box-shadow: var(--shadow-sm);
}
.search input { border: none; outline: none; flex: 1; background: transparent; }
.search .ico { color: var(--text-faint); }

.tabs {
  display: flex; gap: 4px; padding: 12px 26px 0; flex-shrink: 0;
  border-bottom: 1px solid var(--border);
}
.tab {
  padding: 9px 14px; font-size: 14px; font-weight: 600; color: var(--text-soft);
  border-bottom: 2.5px solid transparent; margin-bottom: -1px; border-radius: 6px 6px 0 0;
}
.tab:hover { background: var(--surface-alt); color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--text); }

.content { flex: 1; overflow: auto; }

/* ---------- Toolbar ---------- */
.toolbar {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 26px; flex-wrap: wrap;
}
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: 8px; font-size: 13px; font-weight: 600;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--surface-alt); }
.btn.primary { background: var(--banana); border-color: var(--banana-dark); color: #1e1f21; }
.btn.primary:hover { background: var(--banana-dark); }
.btn .ico { font-size: 15px; }
.filter-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px;
  border-radius: 20px; font-size: 12px; font-weight: 600; color: var(--text-soft);
  background: var(--surface); border: 1px solid var(--border);
}
.filter-pill.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

/* ---------- List view ---------- */
.list-wrap { padding: 0 26px 80px; }
.list-head {
  display: grid; grid-template-columns: 1fr 150px 130px 120px 130px;
  gap: 12px; padding: 8px 12px; font-size: 12px; font-weight: 700;
  color: var(--text-faint); text-transform: uppercase; letter-spacing: .4px;
  border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--bg); z-index: 2;
}
.section { margin-top: 8px; }
.section-head {
  display: flex; align-items: center; gap: 8px; padding: 14px 12px 6px;
  font-weight: 700; font-size: 15px;
}
.section-head .count { color: var(--text-faint); font-weight: 600; font-size: 13px; }
.section-head .caret { color: var(--text-soft); font-size: 12px; width: 16px; transition: transform .15s; }
.section-head.collapsed .caret { transform: rotate(-90deg); }
.section-head .sec-add { margin-left: auto; opacity: 0; color: var(--text-soft); font-size: 18px; padding: 0 6px; border-radius: 5px; }
.section-head:hover .sec-add { opacity: 1; }
.section-head .sec-add:hover { background: var(--border); }

.task-row {
  display: grid; grid-template-columns: 1fr 150px 130px 120px 130px;
  gap: 12px; align-items: center; padding: 9px 12px;
  border-bottom: 1px solid var(--border); background: var(--surface);
  cursor: pointer; transition: background .1s;
}
.task-row:first-child { border-top: 1px solid var(--border); }
.task-row:hover { background: var(--accent-soft); }
.task-main { display: flex; align-items: center; gap: 11px; min-width: 0; }
.task-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-row.done .task-name { color: var(--text-faint); text-decoration: line-through; }

.check {
  width: 19px; height: 19px; border-radius: 50%; border: 1.6px solid var(--text-faint);
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  color: transparent; font-size: 11px; transition: all .12s;
}
.check:hover { border-color: var(--green); }
.check.done { background: var(--green); border-color: var(--green); color: #fff; }

.cell-soft { color: var(--text-soft); font-size: 13px; }

.avatar {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff;
}
.avatar.sm { width: 22px; height: 22px; font-size: 10px; }
.assignee-cell { display: flex; align-items: center; gap: 8px; }
.assignee-cell .empty {
  width: 26px; height: 26px; border-radius: 50%; border: 1.5px dashed var(--text-faint);
  display: flex; align-items: center; justify-content: center; color: var(--text-faint); font-size: 12px;
}

.tag {
  display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 20px;
  font-size: 11px; font-weight: 700;
}
.due { font-size: 12px; font-weight: 600; color: var(--text-soft); }
.due.overdue { color: var(--red); }
.due.today { color: var(--orange); }

.add-task-inline {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px;
  color: var(--text-faint); font-size: 13px; border-bottom: 1px solid var(--border);
}
.add-task-inline:hover { color: var(--accent); }
.add-task-inline input {
  border: none; outline: none; background: transparent; flex: 1; color: var(--text); font-size: 14px;
}

/* ---------- Board view ---------- */
.board { display: flex; gap: 16px; padding: 18px 26px 80px; align-items: flex-start; min-height: 100%; }
.column {
  width: 290px; flex-shrink: 0; background: var(--surface-alt);
  border-radius: 12px; padding: 10px; border: 1px solid var(--border);
}
.column.drag-over { background: var(--accent-soft); border-color: var(--accent); }
.column-head { display: flex; align-items: center; gap: 8px; padding: 6px 8px 12px; font-weight: 700; }
.column-head .count { color: var(--text-faint); font-weight: 600; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px; margin-bottom: 9px; box-shadow: var(--shadow-sm); cursor: pointer;
  transition: box-shadow .12s, transform .12s;
}
.card:hover { box-shadow: var(--shadow-md); }
.card.dragging { opacity: .4; }
.card.done .card-title { color: var(--text-faint); text-decoration: line-through; }
.card-title { font-weight: 600; margin-bottom: 9px; display: flex; gap: 9px; align-items: flex-start; }
.card-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card-add {
  width: 100%; text-align: left; padding: 9px 8px; color: var(--text-soft);
  font-size: 13px; border-radius: 8px; font-weight: 600;
}
.card-add:hover { background: var(--border); color: var(--text); }
.add-column {
  width: 270px; flex-shrink: 0; padding: 12px; border-radius: 12px;
  color: var(--text-soft); font-weight: 600; border: 1.5px dashed var(--border);
}
.add-column:hover { background: var(--surface-alt); color: var(--text); }

/* ---------- Detail panel ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.32);
  display: flex; justify-content: flex-end; z-index: 100;
  animation: fade .15s ease;
}
@keyframes fade { from { opacity: 0; } }
.panel {
  width: 560px; max-width: 92vw; background: var(--surface); height: 100%;
  display: flex; flex-direction: column; box-shadow: var(--shadow-lg);
  animation: slide .2s cubic-bezier(.2,.8,.2,1);
}
@keyframes slide { from { transform: translateX(40px); opacity: .6; } }
.panel-top {
  display: flex; align-items: center; gap: 10px; padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}
.panel-top .complete-btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px;
  border-radius: 8px; border: 1px solid var(--border); font-weight: 600; font-size: 13px;
}
.panel-top .complete-btn.done { background: #e6f6ec; border-color: var(--green); color: var(--green); }
.panel-top .icon-btn { padding: 6px; border-radius: 7px; color: var(--text-soft); font-size: 18px; }
.panel-top .icon-btn:hover { background: var(--surface-alt); }
.panel-body { flex: 1; overflow: auto; padding: 22px 26px 60px; }
.task-title-input {
  width: 100%; border: none; outline: none; font-size: 23px; font-weight: 800;
  letter-spacing: -.4px; padding: 4px 0; margin-bottom: 18px; background: transparent;
}

.field-grid { display: grid; grid-template-columns: 120px 1fr; gap: 14px 16px; align-items: center; margin-bottom: 8px; }
.field-label { color: var(--text-soft); font-weight: 600; font-size: 13px; }
.field-control { display: flex; align-items: center; gap: 8px; }
.select, .text-input {
  padding: 7px 11px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); outline: none; font-size: 13px;
}
.select:focus, .text-input:focus { border-color: var(--accent); }
.inline-pick {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 11px;
  border-radius: 8px; border: 1px solid transparent; font-size: 13px; font-weight: 600;
}
.inline-pick:hover { border-color: var(--border); background: var(--surface-alt); }

.divider { height: 1px; background: var(--border); margin: 22px 0; }
.block-label { font-size: 13px; font-weight: 700; color: var(--text-soft); margin-bottom: 8px; }
.desc-area {
  width: 100%; min-height: 70px; border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 12px; outline: none; resize: vertical; line-height: 1.5;
}
.desc-area:focus { border-color: var(--accent); }

.subtask {
  display: flex; align-items: center; gap: 10px; padding: 8px 6px;
  border-bottom: 1px solid var(--border);
}
.subtask input { flex: 1; border: none; outline: none; background: transparent; }
.subtask.done input { color: var(--text-faint); text-decoration: line-through; }
.subtask .del { opacity: 0; color: var(--text-faint); padding: 0 4px; }
.subtask:hover .del { opacity: 1; }
.subtask .del:hover { color: var(--red); }

.comment { display: flex; gap: 10px; margin-bottom: 14px; }
.comment .body { flex: 1; }
.comment .meta { font-size: 12px; color: var(--text-faint); margin-bottom: 2px; }
.comment .meta b { color: var(--text); font-size: 13px; }
.comment-box { display: flex; gap: 10px; margin-top: 16px; }
.comment-box textarea {
  flex: 1; border: 1px solid var(--border); border-radius: 8px; padding: 9px 12px;
  outline: none; resize: vertical; min-height: 40px;
}
.comment-box textarea:focus { border-color: var(--accent); }

/* ---------- Dropdown menu ---------- */
.menu {
  position: absolute; z-index: 200; background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-md);
  padding: 6px; min-width: 190px;
}
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px;
  border-radius: 7px; font-size: 13px; text-align: left;
}
.menu-item:hover { background: var(--surface-alt); }
.menu-item.danger:hover { background: #fdecee; color: var(--red); }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 300;
  display: flex; align-items: center; justify-content: center; animation: fade .15s;
}
.modal {
  background: var(--surface); border-radius: 14px; padding: 26px; width: 440px;
  max-width: 92vw; box-shadow: var(--shadow-lg);
}
.modal h2 { font-size: 19px; margin-bottom: 18px; }
.modal label { display: block; font-size: 13px; font-weight: 600; color: var(--text-soft); margin-bottom: 6px; margin-top: 14px; }
.modal input[type=text] {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; outline: none;
}
.modal input[type=text]:focus { border-color: var(--accent); }
.color-row { display: flex; gap: 10px; margin-top: 8px; }
.color-swatch { width: 30px; height: 30px; border-radius: 8px; border: 2.5px solid transparent; }
.color-swatch.sel { border-color: var(--text); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }

/* ---------- Misc ---------- */
.empty-state {
  text-align: center; padding: 80px 20px; color: var(--text-faint);
}
.empty-state .big { font-size: 52px; margin-bottom: 14px; }
.empty-state h3 { color: var(--text-soft); font-size: 17px; margin-bottom: 6px; }

.progress-mini { height: 6px; background: var(--border); border-radius: 4px; overflow: hidden; width: 100%; }
.progress-mini > div { height: 100%; background: var(--green); transition: width .3s; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; padding: 6px 26px 20px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 18px; box-shadow: var(--shadow-sm);
}
.stat-card .num { font-size: 30px; font-weight: 800; letter-spacing: -1px; }
.stat-card .lbl { color: var(--text-soft); font-size: 13px; font-weight: 600; margin-top: 2px; }

.hidden { display: none !important; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #d3d6db; border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #bcc0c7; }

/* ============ PRO FEATURES ============ */

/* Tag chips */
.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px;
  border-radius: 20px; font-size: 11px; font-weight: 700; line-height: 1.7;
}
.chip .x { cursor: pointer; opacity: .6; font-weight: 700; }
.chip .x:hover { opacity: 1; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* Filter/sort bar */
.ctrl {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px;
  border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--text-soft);
  background: var(--surface); border: 1px solid var(--border);
}
.ctrl:hover { background: var(--surface-alt); }
.ctrl.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.ctrl select { border: none; background: transparent; outline: none; font-weight: 600; color: inherit; cursor: pointer; }

/* Badges on tasks */
.mini-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: var(--text-soft); }
.blocked-badge { color: var(--red); }
.milestone-ico { color: var(--purple); }

/* ---------- Calendar ---------- */
.cal-wrap { padding: 16px 26px 60px; }
.cal-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.cal-head h2 { font-size: 18px; font-weight: 800; min-width: 190px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.cal-dow { background: var(--surface-alt); padding: 8px 10px; font-size: 12px; font-weight: 700; color: var(--text-soft); text-transform: uppercase; }
.cal-cell { background: var(--surface); min-height: 108px; padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.cal-cell.muted { background: var(--surface-alt); }
.cal-cell.today .cal-num { background: var(--accent); color: #fff; }
.cal-num { align-self: flex-start; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; border-radius: 50%; font-size: 12px; font-weight: 700; color: var(--text-soft); }
.cal-task { font-size: 11px; font-weight: 600; padding: 3px 7px; border-radius: 6px; color: #fff; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-task.done { opacity: .55; text-decoration: line-through; }

/* ---------- Timeline / Gantt ---------- */
.tl-wrap { padding: 16px 0 60px; overflow-x: auto; }
.tl-grid { position: relative; min-width: max-content; }
.tl-header { display: flex; position: sticky; top: 0; z-index: 3; background: var(--bg); }
.tl-corner { width: 220px; flex-shrink: 0; position: sticky; left: 0; background: var(--bg); z-index: 4; border-right: 1px solid var(--border); }
.tl-daycol { width: 34px; flex-shrink: 0; text-align: center; font-size: 10px; padding: 6px 0; color: var(--text-soft); border-left: 1px solid var(--border); }
.tl-daycol.weekend { background: var(--surface-alt); }
.tl-daycol.month { font-weight: 800; color: var(--text); }
.tl-row { display: flex; align-items: center; height: 40px; position: relative; }
.tl-row:hover { background: var(--accent-soft); }
.tl-label { width: 220px; flex-shrink: 0; position: sticky; left: 0; background: var(--surface); padding: 0 12px; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-right: 1px solid var(--border); z-index: 2; height: 100%; display: flex; align-items: center; gap: 8px; }
.tl-track { position: relative; flex: 1; height: 100%; }
.tl-bar { position: absolute; top: 9px; height: 22px; border-radius: 6px; display: flex; align-items: center; padding: 0 8px; font-size: 11px; font-weight: 700; color: #fff; cursor: pointer; box-shadow: var(--shadow-sm); overflow: hidden; white-space: nowrap; }
.tl-bar.done { opacity: .55; }
.tl-milestone { position: absolute; top: 8px; width: 22px; height: 22px; transform: rotate(45deg); border-radius: 4px; cursor: pointer; }
.tl-gridlines { position: absolute; inset: 0; display: flex; pointer-events: none; }
.tl-gridline { width: 34px; flex-shrink: 0; border-left: 1px solid var(--border); }
.tl-gridline.weekend { background: rgba(0,0,0,.02); }

/* ---------- Reporting / Dashboard ---------- */
.dash { padding: 18px 26px 60px; }
.dash-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.dash-grid.three { grid-template-columns: repeat(3, 1fr); }
.donut-wrap { display: flex; align-items: center; gap: 20px; }
.legend { display: flex; flex-direction: column; gap: 8px; }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.legend-dot { width: 11px; height: 11px; border-radius: 3px; }
.bar-chart { display: flex; align-items: flex-end; gap: 8px; height: 150px; padding-top: 10px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bar-col .bar { width: 70%; background: var(--accent); border-radius: 5px 5px 0 0; min-height: 2px; transition: height .3s; }
.bar-col .blbl { font-size: 10px; color: var(--text-faint); }
.bar-col .bval { font-size: 11px; font-weight: 700; }

/* ---------- Goals ---------- */
.goal-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px; margin-bottom: 14px; box-shadow: var(--shadow-sm); }
.goal-card .gt { display: flex; align-items: center; gap: 10px; }
.goal-card .gt h3 { font-size: 16px; font-weight: 700; flex: 1; }
.status-pill { padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.status-on { background: #e6f6ec; color: var(--green); }
.status-risk { background: #fff2dc; color: #c47b00; }
.status-off { background: #fdecee; color: var(--red); }
.status-none { background: #eef0f2; color: var(--text-soft); }

/* ---------- Portfolio ---------- */
.pf-table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow-sm); border: 1px solid var(--border); }
.pf-table th { text-align: left; padding: 12px 16px; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--text-faint); border-bottom: 1px solid var(--border); }
.pf-table td { padding: 13px 16px; border-bottom: 1px solid var(--border); }
.pf-table tr:last-child td { border-bottom: none; }
.pf-table tr:hover td { background: var(--surface-alt); cursor: pointer; }

/* Detail panel extras */
.dep-item { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 13px; }
.attach-item { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 6px; font-size: 13px; }
.attach-item a { color: var(--accent); text-decoration: none; margin-left: auto; font-weight: 600; }
.activity-item { display: flex; gap: 9px; font-size: 12px; color: var(--text-soft); padding: 4px 0; }
.type-tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.type-tab { padding: 5px 12px; border-radius: 7px; font-size: 12px; font-weight: 700; border: 1px solid var(--border); color: var(--text-soft); }
.type-tab.active { background: var(--text); color: #fff; border-color: var(--text); }

/* Rules / Automation */
.rule-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; margin-bottom: 10px; display: flex; align-items: center; gap: 12px; }
.rule-card .rule-text { flex: 1; font-size: 13px; }
.rule-card .rule-text b { color: var(--accent); }
.switch { width: 38px; height: 22px; border-radius: 20px; background: var(--border); position: relative; transition: background .15s; flex-shrink: 0; }
.switch.on { background: var(--green); }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: var(--shadow-sm); }
.switch.on::after { left: 18px; }

/* Forms */
.form-preview { max-width: 540px; margin: 0 auto; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 28px; box-shadow: var(--shadow-md); }
.form-field { margin-bottom: 18px; }
.form-field label { display: block; font-weight: 600; margin-bottom: 6px; }
.form-field input, .form-field textarea, .form-field select { width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; outline: none; }

.section-tabs-scroll { overflow-x: auto; }
.help-note { background: var(--accent-soft); border: 1px solid #cfe0fa; color: #2c5aa8; padding: 10px 14px; border-radius: 8px; font-size: 12px; margin: 0 26px 12px; }

/* Auth */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #1e1f21 0%, #3a2f00 100%); padding: 20px; }
.auth-card { background: var(--surface); border-radius: 16px; padding: 34px; width: 400px; max-width: 94vw; box-shadow: var(--shadow-lg); }
.auth-brand { display: flex; align-items: center; gap: 12px; }
.auth-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-soft); margin: 14px 0 6px; }
.auth-input { width: 100%; }
.link-btn { color: var(--accent); font-size: 13px; font-weight: 600; background: none; }
.link-btn:hover { text-decoration: underline; }

/* Save indicator + account */
.save-ind { font-size: 12px; font-weight: 600; color: var(--text-soft); margin-left: auto; white-space: nowrap; }
.save-ind + .search { margin-left: 14px; }
.acct { display: flex; align-items: center; gap: 9px; margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.08); }

/* ============ CHAT ============ */
.chat-wrap { display: flex; height: calc(100vh - 200px); min-height: 420px; }
.chat-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 18px 26px; display: flex; flex-direction: column; gap: 12px; }
.chat-row { display: flex; gap: 9px; align-items: flex-end; max-width: 72%; }
.chat-row.mine { margin-left: auto; flex-direction: row-reverse; }
.chat-bubble { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 9px 13px; box-shadow: var(--shadow-sm); }
.chat-row.mine .chat-bubble { background: var(--accent); color: #fff; border-color: var(--accent); }
.chat-author { font-size: 12px; font-weight: 700; color: var(--accent); margin-bottom: 3px; }
.chat-text { white-space: pre-wrap; word-break: break-word; line-height: 1.45; }
.chat-time { font-size: 10px; opacity: .6; margin-top: 4px; text-align: right; }
.chat-input { display: flex; gap: 10px; padding: 14px 26px; border-top: 1px solid var(--border); background: var(--surface); }
.chat-input textarea { flex: 1; border: 1px solid var(--border); border-radius: 10px; padding: 10px 13px; outline: none; resize: none; height: 44px; font-size: 14px; }
.chat-input textarea:focus { border-color: var(--accent); }
.chat-side { width: 240px; flex-shrink: 0; border-left: 1px solid var(--border); padding: 18px; overflow-y: auto; background: var(--surface-alt); }
.chat-member { display: flex; align-items: center; gap: 10px; padding: 8px 0; }

/* ============ BPMN ============ */
.bpmn-wrap { display: flex; flex-direction: column; height: calc(100vh - 150px); min-height: 460px; }
.bpmn-canvas { flex: 1; min-height: 400px; margin: 0 26px 20px; border: 1px solid var(--border); border-radius: 10px; background: #fff; position: relative; overflow: hidden; }
.bpmn-canvas .djs-palette { top: 14px; left: 14px; }

/* ============ INBOX / NOTIFICATIONS ============ */
.nav-badge { margin-left: auto; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; min-width: 18px; height: 18px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px; }
.notif { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--border); background: var(--surface); cursor: pointer; }
.notif:first-child { border-top: 1px solid var(--border); }
.notif:hover { background: var(--accent-soft); }
.notif.unread { background: #fffdf2; }
.notif.unread:hover { background: var(--accent-soft); }
.notif-ico { font-size: 20px; width: 28px; text-align: center; flex-shrink: 0; }
.notif-text { font-weight: 500; }
.notif-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }

/* ============ DARK MODE ============ */
:root[data-theme="dark"] {
  --bg: #1a1b1d; --surface: #242528; --surface-alt: #2b2c30; --border: #38393d;
  --text: #e8e9ea; --text-soft: #a9adb3; --text-faint: #7b7f86;
  --accent-soft: #2a3550;
}
:root[data-theme="dark"] .sidebar { background: #121315; }
:root[data-theme="dark"] .card, :root[data-theme="dark"] .bpmn-canvas { background: var(--surface); }
:root[data-theme="dark"] .notif.unread { background: #2a2b1f; }
:root[data-theme="dark"] .btn.primary { color: #1e1f21; }
:root[data-theme="dark"] .chat-row.mine .chat-bubble { color: #fff; }

.theme-toggle { display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 12px; border-radius: 8px; color: #c7c9cd; font-size: 14px; font-weight: 500; }
.theme-toggle:hover { background: rgba(255,255,255,.07); color: #fff; }

/* ============ MOBILE ============ */
.hamburger { display: none; font-size: 22px; padding: 4px 8px; border-radius: 7px; }
.mobile-overlay { display: none; }
@media (max-width: 820px) {
  .hamburger { display: inline-flex; }
  .sidebar { position: fixed; z-index: 60; height: 100vh; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .mobile-overlay.show { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 55; }
  .topbar { padding: 12px 16px 0; gap: 10px; }
  .topbar h1 { font-size: 18px; }
  .search { width: auto; flex: 1; min-width: 0; }
  .toolbar, .list-wrap, .dash, .cal-wrap, .chat-msgs, .chat-input { padding-left: 14px; padding-right: 14px; }
  .list-head { display: none; }
  .task-row { grid-template-columns: 1fr auto; gap: 8px; }
  .task-row > .cell-soft:nth-child(3), .task-row > div:nth-child(5) { display: none; }
  .dash-grid, .dash-grid.three, .stat-grid { grid-template-columns: 1fr !important; }
  .chat-side { display: none; }
  .board { padding: 14px; }
  .column { width: 80vw; }
  .panel { width: 100vw; }
  .field-grid { grid-template-columns: 1fr; gap: 6px 0; }
}

/* ============ BULK / SELECTION ============ */
.sel-box { width: 15px; height: 15px; cursor: pointer; accent-color: var(--accent); opacity: 0; transition: opacity .12s; flex-shrink: 0; }
.task-row:hover .sel-box, .sel-box:checked { opacity: 1; }
.task-row.selected { background: var(--accent-soft); }
.bulk-bar {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 40;
  display: flex; align-items: center; gap: 10px; padding: 10px 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg);
}
@media (max-width: 820px) { .bulk-bar { flex-wrap: wrap; width: 92vw; justify-content: center; } }

/* ============ KEYUSER ============ */
.keyuser-pick { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 20px; font-size: 13px; font-weight: 600; color: var(--text-soft); background: var(--surface); border: 1px solid var(--border); }
.keyuser-pick:hover { background: var(--surface-alt); color: var(--text); }
.keyuser-pick .empty { width: 22px; height: 22px; border-radius: 50%; border: 1.5px dashed var(--text-faint); display: inline-flex; align-items: center; justify-content: center; }
@media (max-width: 820px) { .keyuser-pick span:not(.empty) { display: none; } }

/* ============ TICKETS / HELPDESK ============ */
.tbadge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.ticket-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--border); background: var(--surface); cursor: pointer; }
.ticket-row:first-child { border-top: 1px solid var(--border); }
.ticket-row:hover { background: var(--accent-soft); }
.ticket-detail { max-width: 820px; }
.ticket-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.ticket-controls { display: flex; gap: 16px; flex-wrap: wrap; padding: 12px 14px; background: var(--surface-alt); border: 1px solid var(--border); border-radius: 10px; margin-bottom: 14px; }
.ticket-controls label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--text-soft); }
.ticket-msgs { display: flex; flex-direction: column; gap: 14px; padding: 4px 0 8px; max-height: 52vh; overflow-y: auto; }
.ticket-msg { display: flex; gap: 10px; align-items: flex-end; max-width: 82%; }
.ticket-msg.mine { margin-left: auto; flex-direction: row-reverse; }
.ticket-bubble { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 13px; box-shadow: var(--shadow-sm); }
.ticket-bubble.mine { background: var(--accent-soft); }
.ticket-bubble.internal { background: #fff7e0; border-color: #f0d98a; }
.t-author { font-size: 12px; font-weight: 700; margin-bottom: 4px; }
.t-internal-tag { background: #f5c518; color: #1e1f21; font-size: 10px; padding: 1px 6px; border-radius: 6px; margin-left: 6px; }
.ticket-reply { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 12px; }
.ticket-reply textarea { width: 100%; min-height: 70px; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; outline: none; resize: vertical; margin-bottom: 10px; }
.ticket-reply textarea:focus { border-color: var(--accent); }
.ticket-form { max-width: 600px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 24px; }

/* Kundenportal */
.portal { min-height: 100vh; background: var(--bg); display: flex; flex-direction: column; }
.portal-head { display: flex; align-items: center; gap: 12px; padding: 14px 28px; background: var(--banana); }
.portal-head .logo { font-size: 26px; }
.portal-body { flex: 1; max-width: 900px; width: 100%; margin: 0 auto; padding: 28px 22px 60px; }

/* ============ JIRA-ARTIGE ISSUE-ANSICHT ============ */
.t-key { font-weight: 800; color: var(--text-soft); font-size: 13px; background: var(--surface-alt); padding: 2px 8px; border-radius: 6px; }
.ticket-issue { display: flex; gap: 22px; align-items: flex-start; }
.ti-main { flex: 1; min-width: 0; }
.ti-title { width: 100%; border: none; outline: none; font-size: 22px; font-weight: 800; background: transparent; padding: 4px 0; }
.ti-title:hover, .ti-title:focus { background: var(--surface-alt); border-radius: 6px; padding: 4px 8px; }
.ti-side { width: 300px; flex-shrink: 0; background: var(--surface-alt); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
.t-field { display: grid; grid-template-columns: 96px 1fr; gap: 8px 10px; align-items: center; padding: 5px 0; }
.t-field-label { font-size: 12px; font-weight: 700; color: var(--text-soft); }
.t-field-val { min-width: 0; }
.t-field-val .select, .t-field-val .text-input { width: 100%; }
.t-child { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 6px; background: var(--surface); font-size: 13px; }
@media (max-width: 820px) { .ticket-issue { flex-direction: column; } .ti-side { width: 100%; } }
