/* RESET / BASE */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 13px;
  color: #1c1d24;
  background: #fff;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; outline: none; }

:root {
  --rail-bg: #1c1d24;
  --rail-text: #b3b3b8;
  --rail-text-active: #fff;
  --rail-active-bg: #2e2f38;

  --sidebar-bg: #f6f6f7;
  --sidebar-border: #e4e4e7;
  --sidebar-text: #44464f;
  --sidebar-text-muted: #75767d;
  --sidebar-hover: #ececee;
  --sidebar-active: #e9e6fb;
  --sidebar-active-text: #5f4fc8;

  --main-bg: #ffffff;
  --border: #ebebed;
  --border-strong: #d6d6d9;
  --hover: #f7f7f8;
  --text: #1c1d24;
  --text-muted: #6b6c75;
  --text-faint: #9ea0a8;

  --accent: #7B68EE;
  --accent-hover: #6b59d8;
  --accent-light: #f3f1fe;

  --status-todo: #87909e;
  --status-progress: #3b82f6;
  --status-review: #f59e0b;
  --status-complete: #2ecd6f;

  --prio-urgent: #f43f5e;
  --prio-high: #f59e0b;
  --prio-normal: #3b82f6;
  --prio-low: #87909e;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.16);
}

.app {
  display: grid;
  grid-template-columns: 52px 260px 1fr;
  height: 100vh;
  width: 100vw;
}

/* RAIL */
.rail {
  background: var(--rail-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 0;
  gap: 4px;
}
.rail-logo {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  margin-bottom: 6px;
  background: #fff;
  border-radius: 8px;
}
.rail-btn {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  color: var(--rail-text);
  border-radius: 8px;
  position: relative;
  transition: background .12s, color .12s;
}
.rail-btn:hover { background: var(--rail-active-bg); color: var(--rail-text-active); }
.rail-btn.active { background: var(--rail-active-bg); color: var(--rail-text-active); }
.rail-spacer { flex: 1; }
.rail-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff6b6b, #ee5a8b);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  display: grid; place-items: center;
}
.rail-badge {
  position: absolute;
  top: 4px; right: 4px;
  background: #f43f5e;
  color: #fff;
  font-size: 9px;
  min-width: 14px; height: 14px;
  border-radius: 7px;
  padding: 0 4px;
  display: grid; place-items: center;
  font-weight: 700;
  border: 2px solid var(--rail-bg);
}

/* SIDEBAR */
.sidebar {
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.ws-switcher {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--sidebar-border);
  cursor: pointer;
}
.ws-switcher:hover { background: var(--sidebar-hover); }
.ws-avatar {
  width: 30px; height: 30px;
  border-radius: 7px;
  background: linear-gradient(135deg, #7B68EE, #49CCF9);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.ws-meta { flex: 1; min-width: 0; }
.ws-name {
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ws-plan {
  font-size: 11px;
  color: var(--sidebar-text-muted);
}

.sidebar-search {
  margin: 10px 10px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--sidebar-border);
  border-radius: 6px;
  padding: 6px 10px;
  color: var(--sidebar-text-muted);
}
.sidebar-search input {
  border: none; background: transparent;
  flex: 1;
  font-size: 12px;
  color: var(--text);
}
.sidebar-search .kbd {
  font-size: 10px;
  background: #f1f1f3;
  color: var(--sidebar-text-muted);
  padding: 2px 5px;
  border-radius: 3px;
  font-weight: 500;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: 0 6px 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 6px;
  color: var(--sidebar-text);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  width: 100%;
}
.nav-item:hover { background: var(--sidebar-hover); }
.nav-item.active { background: var(--sidebar-active); color: var(--sidebar-active-text); }
.nav-item .pill {
  margin-left: auto;
  background: #d6d6d9;
  color: #44464f;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 8px;
}

.sidebar-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-top: 1px solid var(--sidebar-border);
  margin-top: 4px;
  padding-top: 6px;
}
.section-header {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 700;
  color: var(--sidebar-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
}
.section-header svg { color: var(--sidebar-text-muted); }
.section-icon, .section-add {
  width: 18px; height: 18px;
  display: grid; place-items: center;
  color: var(--sidebar-text-muted);
  border-radius: 4px;
  font-size: 14px;
  font-weight: 400;
  opacity: 0;
  transition: opacity .15s, background .12s;
}
.section-add { margin-left: auto; }
.section-icon:first-of-type { margin-left: auto; }
.section-header:hover .section-add,
.section-header:hover .section-icon { opacity: 1; }
.section-add:hover, .section-icon:hover { background: var(--sidebar-hover); color: var(--text); }

.tree {
  flex: 1;
  overflow-y: auto;
  padding: 4px 6px 8px;
}
.tree::-webkit-scrollbar { width: 6px; }
.tree::-webkit-scrollbar-thumb { background: #d6d6d9; border-radius: 3px; }

.tree-node {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--sidebar-text);
  cursor: pointer;
  position: relative;
  user-select: none;
}
.tree-node:hover { background: var(--sidebar-hover); }
.tree-node.active {
  background: var(--sidebar-active);
  color: var(--sidebar-active-text);
  font-weight: 600;
}
.tree-caret {
  width: 14px; height: 14px;
  display: grid; place-items: center;
  color: var(--text-faint);
  flex-shrink: 0;
  transition: transform .15s;
}
.tree-caret.expanded { transform: rotate(90deg); }
.tree-icon {
  width: 16px; height: 16px;
  display: grid; place-items: center;
  flex-shrink: 0;
  border-radius: 4px;
}
.tree-space-color {
  width: 14px; height: 14px;
  border-radius: 4px;
  flex-shrink: 0;
}
.tree-label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tree-count {
  font-size: 11px;
  color: var(--text-faint);
  font-weight: 500;
}
.tree-children { padding-left: 14px; }
.tree-children.collapsed { display: none; }

.sidebar-footer {
  border-top: 1px solid var(--sidebar-border);
  padding: 8px 10px;
  display: flex;
  gap: 6px;
}
.footer-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px;
  font-size: 12px;
  color: var(--sidebar-text);
  font-weight: 500;
  border-radius: 6px;
  background: #fff;
  border: 1px solid var(--sidebar-border);
}
.footer-btn:hover { background: var(--sidebar-hover); }

/* MAIN */
.main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--main-bg);
}

.topbar {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}
.crumb {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 6px;
  border-radius: 4px;
  cursor: pointer;
}
.crumb:hover { background: var(--hover); }
.crumb.current { color: var(--text); font-weight: 600; }
.crumb-sep { color: var(--text-faint); font-size: 11px; }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.icon-btn {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
}
.icon-btn:hover { background: var(--hover); color: var(--text); }

.avatars {
  display: flex;
  align-items: center;
  margin: 0 4px;
}
.avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  display: grid; place-items: center;
  border: 2px solid #fff;
  flex-shrink: 0;
}
.avatars .avatar { margin-left: -6px; }
.avatars .avatar:first-child { margin-left: 0; }

.btn-primary {
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background .12s;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary {
  font-size: 12px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 6px;
  color: var(--text);
  border: 1px solid var(--border-strong);
}
.btn-secondary:hover { background: var(--hover); }

/* VIEW HEADER */
.view-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 14px 24px 0;
  border-bottom: 1px solid var(--border);
}
.list-title {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 14px;
}
.list-icon { font-size: 18px; }
.list-title h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}
.task-count {
  font-size: 13px;
  color: var(--text-faint);
  font-weight: 500;
}

.view-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
}
.tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab:hover { color: var(--text); background: var(--hover); }
.tab.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.tab-add {
  padding: 7px 10px;
  font-size: 12px;
  color: var(--text-muted);
  border-radius: 6px;
}
.tab-add:hover { background: var(--hover); color: var(--text); }

/* TOOLBAR */
.view-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 24px;
  border-bottom: 1px solid var(--border);
  background: #fafafb;
}
.tb-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  border-radius: 4px;
}
.tb-btn:hover { background: var(--hover); color: var(--text); }
.tb-divider {
  width: 1px;
  height: 16px;
  background: var(--border);
  margin: 0 4px;
}
.tb-search {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  color: var(--text-muted);
  border-radius: 4px;
  width: 200px;
}
.tb-search:focus-within { background: #fff; box-shadow: 0 0 0 1px var(--border-strong); }
.tb-search input { border: none; background: transparent; flex: 1; font-size: 12px; }
.tb-spacer { flex: 1; }

/* VIEW AREA */
.view-area {
  flex: 1;
  overflow: auto;
  background: #fff;
}
.view-area::-webkit-scrollbar { width: 10px; height: 10px; }
.view-area::-webkit-scrollbar-thumb { background: #d6d6d9; border-radius: 5px; }
.view-area::-webkit-scrollbar-thumb:hover { background: #b3b3b8; }

/* LIST VIEW */
.list-view { padding-bottom: 100px; }
.status-group {
  margin-top: 4px;
}
.status-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 24px;
  cursor: pointer;
  user-select: none;
}
.status-header:hover { background: var(--hover); }
.status-caret {
  width: 12px;
  display: grid; place-items: center;
  color: var(--text-muted);
  transition: transform .15s;
}
.status-caret.expanded { transform: rotate(90deg); }
.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: #fff;
  text-transform: uppercase;
}
.status-header-count {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}
.add-task-inline {
  margin-left: 8px;
  font-size: 12px;
  color: var(--text-faint);
  font-weight: 500;
  opacity: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}
.status-header:hover .add-task-inline { opacity: 1; }

.list-view-scroll {
  overflow-x: auto;
  width: 100%;
}
.list-view-scroll::-webkit-scrollbar { height: 10px; }
.list-view-scroll::-webkit-scrollbar-thumb { background: #d6d6d9; border-radius: 5px; }

.list-header-row, .list-row {
  display: grid;
  grid-template-columns:
    32px           /* checkbox */
    minmax(280px, 2fr) /* name */
    90px           /* assignee */
    100px          /* due date */
    70px           /* priority */
    140px          /* status */
    160px          /* client name */
    110px          /* citizenship */
    130px          /* b2b name */
    140px          /* service type */
    80px           /* tax year */
    110px          /* project status */
    140px          /* risk flag */
    100px          /* payment status */
    130px          /* tags */
    40px;          /* more */
  align-items: center;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  min-height: 36px;
  min-width: 1900px;
}
.list-header-row {
  background: #fafafb;
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  min-height: 32px;
}
.list-row { cursor: pointer; transition: background .08s; }
.list-row:hover { background: var(--hover); }

.col-check { display: flex; align-items: center; }
.task-checkbox {
  width: 16px; height: 16px;
  border: 1.5px solid var(--border-strong);
  border-radius: 4px;
  display: grid; place-items: center;
  background: #fff;
  transition: all .12s;
}
.task-checkbox:hover { border-color: var(--accent); }
.task-checkbox.checked {
  background: var(--accent);
  border-color: var(--accent);
}
.task-checkbox.checked::after {
  content: '';
  width: 5px; height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-top: -2px;
}

.col-name {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-right: 12px;
  min-width: 0;
}
.task-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
  font-weight: 500;
}
.list-row.complete .task-name { text-decoration: line-through; color: var(--text-faint); }
.task-meta-mini {
  display: flex;
  gap: 4px;
  color: var(--text-faint);
  font-size: 11px;
  align-items: center;
}
.subtask-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 1px 5px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 10px;
}

.col-assignee, .col-due, .col-priority, .col-status, .col-tags, .col-more {
  font-size: 12px;
  color: var(--text-muted);
}
.col-status .status-pill { font-size: 10px; padding: 2px 6px; }
.col-priority .prio-flag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.prio-flag svg { width: 12px; height: 12px; }
.prio-icon { width: 14px; height: 14px; }
.priority-empty { color: var(--text-faint); }

.col-due { white-space: nowrap; }
.col-due.overdue { color: var(--prio-urgent); font-weight: 600; }
.col-due.today { color: var(--prio-high); font-weight: 600; }
.col-due.soon { color: var(--accent); }

.tags {
  display: flex;
  gap: 4px;
  flex-wrap: nowrap;
  overflow: hidden;
}
.tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}

.assignee-stack { display: flex; }
.assignee-stack .avatar { width: 22px; height: 22px; font-size: 9px; }
.assignee-stack .avatar + .avatar { margin-left: -5px; }
.assignee-empty {
  width: 22px; height: 22px;
  border: 1.5px dashed var(--border-strong);
  border-radius: 50%;
  display: grid; place-items: center;
  color: var(--text-faint);
  font-size: 11px;
}

.add-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 24px 6px 56px;
  color: var(--text-faint);
  font-size: 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  min-width: 1900px;
}
.status-header { min-width: 1900px; }
.list-header-row { position: sticky; top: 0; z-index: 2; }

.field-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  color: #fff;
}
.field-chip.muted {
  background: #f1f1f3;
  color: #6b6c75;
  font-weight: 500;
}
.cell-text {
  font-size: 12px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 8px;
}
.cell-text.muted { color: var(--text-faint); }
.add-row:hover { color: var(--text); background: var(--hover); }

/* BOARD VIEW */
.board-view {
  display: flex;
  gap: 12px;
  padding: 16px 16px 100px;
  overflow-x: auto;
  height: 100%;
  align-items: flex-start;
}
.board-col {
  flex: 0 0 280px;
  background: #f6f6f7;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 200px);
}
.board-col-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.board-col-header .status-pill { font-size: 10px; }
.board-col-count {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}
.board-col-actions {
  margin-left: auto;
  display: flex;
  gap: 4px;
}
.board-col-action {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  color: var(--text-muted);
  border-radius: 4px;
  font-size: 14px;
}
.board-col-action:hover { background: var(--hover); color: var(--text); }
.board-col-body {
  padding: 8px;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 60px;
}
.board-col-body::-webkit-scrollbar { width: 6px; }
.board-col-body::-webkit-scrollbar-thumb { background: #d6d6d9; border-radius: 3px; }
.board-col.drag-over .board-col-body { background: #ede8fb; border-radius: 6px; }

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px;
  cursor: pointer;
  transition: box-shadow .12s, transform .12s;
  font-size: 12px;
  user-select: none;
}
.card:hover { box-shadow: var(--shadow-md); }
.card.dragging { opacity: 0.4; }
.card-id {
  font-size: 10px;
  color: var(--text-faint);
  font-weight: 500;
  margin-bottom: 4px;
}
.card-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.35;
}
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}
.card-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
}
.card-footer-left {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
}
.card-footer-left .prio-flag { padding: 1px; }

.board-col-add {
  margin: 0 8px 8px;
  padding: 6px;
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.board-col-add:hover { background: var(--hover); color: var(--text); }

.board-add-col {
  flex: 0 0 200px;
  height: 44px;
  background: rgba(0,0,0,.02);
  border: 1px dashed var(--border-strong);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.board-add-col:hover { background: var(--hover); }

/* CALENDAR VIEW */
.calendar-view {
  padding: 16px 24px;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.cal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.cal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.cal-nav {
  display: flex;
  gap: 2px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  overflow: hidden;
}
.cal-nav button {
  padding: 4px 10px;
  font-size: 12px;
  color: var(--text-muted);
  background: #fff;
}
.cal-nav button:hover { background: var(--hover); color: var(--text); }
.cal-today {
  padding: 4px 12px;
  font-size: 12px;
  color: var(--text);
  font-weight: 500;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
}
.cal-today:hover { background: var(--hover); }

.cal-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-template-rows: 28px repeat(6, 1fr);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
.cal-dow {
  background: #fafafb;
  padding: 6px 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
}
.cal-dow:nth-child(7n) { border-right: none; }

.cal-cell {
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 80px;
  overflow: hidden;
}
.cal-cell:nth-child(7n) { border-right: none; }
.cal-cell.other-month { background: #fafafb; }
.cal-cell.today .cal-day-num {
  background: var(--accent);
  color: #fff;
}
.cal-day-num {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 50%;
  align-self: flex-end;
}
.cal-cell.other-month .cal-day-num { color: var(--text-faint); }

.cal-task {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 3px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  font-weight: 500;
}
.cal-task:hover { filter: brightness(1.1); }
.cal-more {
  font-size: 11px;
  color: var(--accent);
  font-weight: 500;
  cursor: pointer;
  padding: 0 6px;
}

/* GANTT VIEW */
.gantt-view {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.gantt-wrap {
  display: grid;
  grid-template-columns: 280px 1fr;
  flex: 1;
  overflow: hidden;
}
.gantt-left {
  border-right: 1px solid var(--border);
  overflow-y: auto;
  background: #fff;
}
.gantt-left-header {
  height: 56px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-bottom: 1px solid var(--border);
  background: #fafafb;
  position: sticky;
  top: 0;
}
.gantt-task-row {
  height: 32px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  cursor: pointer;
}
.gantt-task-row:hover { background: var(--hover); }
.gantt-task-row .task-name { font-size: 12px; }
.gantt-right {
  overflow: auto;
  position: relative;
}
.gantt-timeline-header {
  display: flex;
  height: 56px;
  border-bottom: 1px solid var(--border);
  background: #fafafb;
  position: sticky;
  top: 0;
  z-index: 5;
}
.gantt-month-header {
  flex-direction: column;
}
.gantt-month {
  height: 28px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.gantt-days-row {
  display: flex;
  height: 28px;
}
.gantt-day {
  width: 32px;
  flex-shrink: 0;
  text-align: center;
  font-size: 10px;
  color: var(--text-muted);
  padding-top: 6px;
  border-right: 1px solid var(--border);
}
.gantt-day.weekend { background: #fafafb; }
.gantt-day.today { background: var(--accent-light); color: var(--accent); font-weight: 700; }
.gantt-rows { position: relative; }
.gantt-row {
  height: 32px;
  display: flex;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.gantt-row-cell {
  width: 32px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
}
.gantt-row-cell.weekend { background: #fafafb; }
.gantt-row-cell.today { background: var(--accent-light); }
.gantt-bar {
  position: absolute;
  top: 6px;
  height: 20px;
  border-radius: 4px;
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  padding: 0 8px;
  display: flex;
  align-items: center;
  white-space: nowrap;
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: filter .12s;
}
.gantt-bar:hover { filter: brightness(1.05); box-shadow: var(--shadow-md); }
.gantt-bar.complete { opacity: 0.65; }

/* DRAWER */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
  z-index: 90;
}
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed;
  top: 0; right: 0;
  width: 680px;
  max-width: 100vw;
  height: 100vh;
  background: #fff;
  box-shadow: var(--shadow-lg);
  transform: translateX(100%);
  transition: transform .25s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 100;
  display: flex;
  flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer-header {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.drawer-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}
.drawer-actions { display: flex; gap: 4px; }
.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px;
}
.drawer-body::-webkit-scrollbar { width: 8px; }
.drawer-body::-webkit-scrollbar-thumb { background: #d6d6d9; border-radius: 4px; }

.task-detail-name {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  border: none;
  width: 100%;
  margin-bottom: 16px;
  padding: 4px 0;
}
.task-detail-name:focus { outline: none; }

.task-fields {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 8px 12px;
  margin-bottom: 24px;
  font-size: 12px;
}
.field-label {
  color: var(--text-muted);
  padding: 6px 0;
  font-weight: 500;
}
.field-value {
  padding: 6px 8px;
  border-radius: 4px;
  cursor: pointer;
  min-height: 28px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.field-value:hover { background: var(--hover); }

.section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin: 24px 0 8px;
}

.description-box {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  min-height: 80px;
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
  cursor: text;
}
.description-box:empty::before {
  content: 'Add a description...';
  color: var(--text-faint);
}

.subtask {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.subtask:last-child { border-bottom: none; }
.subtask.done { color: var(--text-faint); text-decoration: line-through; }

.comments {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.comment {
  display: flex;
  gap: 10px;
}
.comment-body {
  flex: 1;
  background: #fafafb;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
}
.comment-author {
  font-weight: 600;
  font-size: 12px;
  margin-bottom: 2px;
}
.comment-time {
  font-size: 10px;
  color: var(--text-faint);
  margin-left: 6px;
  font-weight: 400;
}
.comment-text { color: var(--text); line-height: 1.5; }

.comment-input {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
}
.comment-input textarea {
  width: 100%;
  border: none;
  resize: none;
  font-size: 13px;
  min-height: 36px;
}
.comment-input-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
}

/* MODAL */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
  z-index: 110;
}
.modal-backdrop.open { opacity: 1; pointer-events: auto; }
.modal {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -45%) scale(.96);
  width: 540px;
  max-width: calc(100vw - 32px);
  background: #fff;
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  z-index: 120;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s, transform .18s;
}
.modal.open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 15px; font-weight: 600; }
.modal-body { padding: 16px 18px; }
.modal-input {
  width: 100%;
  border: none;
  font-size: 18px;
  font-weight: 600;
  padding: 6px 0;
  margin-bottom: 12px;
}
.modal-input:focus { outline: none; }
.modal-textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13px;
  min-height: 60px;
  resize: vertical;
  margin-bottom: 14px;
}
.modal-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 12px;
}
.modal-row label {
  width: 90px;
  color: var(--text-muted);
  font-weight: 500;
}
.modal-row select, .modal-row input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 5px 8px;
  font-size: 12px;
  background: #fff;
}
.modal-footer {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
}

/* TOOLTIPS */
[data-tooltip] { position: relative; }
[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  margin-left: 8px;
  background: #1c1d24;
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  white-space: nowrap;
  z-index: 200;
}

/* PAGE — Home / Inbox / Dashboards / Goals / Docs */
.page {
  padding: 24px 32px 80px;
  max-width: 1400px;
  margin: 0 auto;
}
.page-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}
.page-title-count {
  font-size: 13px;
  color: var(--text-faint);
  font-weight: 500;
}
.empty {
  padding: 60px 0;
  text-align: center;
  color: var(--text-faint);
  font-size: 13px;
}

/* PAGE — Home hero */
.page-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 0 24px;
}
.page-hero-greet {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}
.page-hero-sub {
  font-size: 13px;
  color: var(--text-muted);
}

/* KPI grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.kpi-tile {
  background: #fff;
  border: 1px solid var(--border);
  border-left: 4px solid var(--border-strong);
  border-radius: 8px;
  padding: 14px 16px;
  position: relative;
  transition: box-shadow .12s, transform .12s;
}
.kpi-tile:hover { box-shadow: var(--shadow-md); }
.kpi-tile:hover .kpi-edit { opacity: 1; }
.kpi-edit {
  position: absolute;
  top: 6px; right: 6px;
  width: 20px; height: 20px;
  display: grid; place-items: center;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: var(--text-faint);
  cursor: pointer;
  font-size: 12px;
  opacity: 0;
  transition: opacity .12s, background .12s;
}
.kpi-edit:hover { background: var(--hover); color: var(--text); }
.kpi-custom-dot {
  color: var(--accent);
  font-size: 8px;
  vertical-align: middle;
}
.kpi-tile.band-green   { border-left-color: #2ecd6f; }
.kpi-tile.band-amber   { border-left-color: #f59e0b; }
.kpi-tile.band-red     { border-left-color: #f43f5e; }
.kpi-tile.band-neutral { border-left-color: #d6d6d9; }
.kpi-code {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: var(--text-faint);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.kpi-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
  margin-bottom: 2px;
}
.kpi-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 8px;
}
.kpi-bands {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.band {
  font-size: 9px;
  padding: 2px 5px;
  border-radius: 3px;
  font-weight: 600;
}
.band-green { background: #d1fae5; color: #047857; }
.band-amber { background: #fef3c7; color: #b45309; }
.band-red   { background: #fee2e2; color: #b91c1c; }

/* PULSE STATUS STRIP — 3-second glance at top of dashboard */
.pulse-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin: 16px 0 8px;
}
.pulse-tile {
  background: #fff;
  border: 1px solid var(--border);
  border-top: 4px solid var(--border-strong);
  border-radius: 10px;
  padding: 14px 16px;
  text-align: left;
  transition: transform .12s, box-shadow .12s;
}
.pulse-tile:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.pulse-tile.band-green { border-top-color: #2ecd6f; }
.pulse-tile.band-amber { border-top-color: #f59e0b; }
.pulse-tile.band-red   { border-top-color: #f43f5e; }
.pulse-tile.band-neutral { border-top-color: #d6d6d9; }
.pulse-code {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: var(--text-faint);
  text-transform: uppercase;
}
.pulse-value {
  font-size: 36px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  margin: 4px 0 6px;
  letter-spacing: -0.5px;
}
.pulse-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}
.pulse-narrative {
  background: #fafafb;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text);
  margin-bottom: 16px;
  line-height: 1.5;
}
.pulse-narrative strong { color: var(--text); font-weight: 700; }

/* TREND GRAPHS */
.trend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.trend-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
}
.trend-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.trend-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}
.trend-total {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}
.trend-xaxis {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-faint);
  margin-top: 4px;
}

/* KPI DRILL-DOWN MODAL */
#kpiDrill {
  position: fixed;
  inset: 0;
  background: rgba(20, 20, 28, 0.45);
  z-index: 280;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 60px 20px;
  backdrop-filter: blur(2px);
}
#kpiDrill.open { display: flex; }
.kpi-drill-card {
  background: #fff;
  border-radius: 12px;
  width: min(820px, 100%);
  max-height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25);
  animation: kpiDrillIn .18s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes kpiDrillIn {
  from { opacity: 0; transform: translateY(-8px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.kpi-drill-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.kpi-drill-code {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.kpi-drill-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-top: 2px;
}
.kpi-drill-body {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
}
.drill-list {
  display: flex;
  flex-direction: column;
}
.drill-row {
  display: grid;
  grid-template-columns: 130px 22px 1fr 140px 90px 28px;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background .08s;
}
.drill-row:hover { background: var(--hover); }
.drill-row:last-child { border-bottom: none; }
.drill-name-text {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.drill-client {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}
.drill-list-name {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.drill-due {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}
.drill-due.overdue { color: var(--prio-urgent); font-weight: 600; }
.drill-due.today   { color: var(--prio-high); font-weight: 600; }
.drill-due.soon    { color: var(--accent); }

/* Trend chart hover tooltip */
#trend-tooltip {
  position: fixed;
  background: #1c1d24;
  color: #fff;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  pointer-events: none;
  z-index: 350;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .08s, transform .08s;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  white-space: nowrap;
  min-width: 140px;
}
#trend-tooltip.show { opacity: 1; transform: translateY(0); }
.trend-tooltip-label {
  font-size: 10px;
  color: #9ea0a8;
  font-weight: 500;
  margin-bottom: 3px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.trend-tooltip-value {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}

/* Dashboard filter bar */
.dash-filters {
  display: flex;
  gap: 8px;
  margin: 12px 0 20px;
  flex-wrap: wrap;
}
.dash-filter {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 6px;
  background: #fafafb;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background .12s;
}
.dash-filter:hover { background: var(--hover); }
.dash-filter-clear {
  background: transparent;
  color: var(--prio-urgent);
  border-color: var(--prio-urgent);
}

/* Dashboard section title */
.dash-section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin: 24px 0 8px;
}
.dash-pending {
  background: #fafafb;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dash-pending code {
  background: #f1f1f3;
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 11px;
}

/* Bar chart */
.bar-chart {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 16px;
}
.bar-row {
  display: grid;
  grid-template-columns: 180px 1fr 40px;
  align-items: center;
  gap: 12px;
  padding: 4px 0;
  font-size: 12px;
}
.bar-label {
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bar-track {
  height: 12px;
  background: #f1f1f3;
  border-radius: 6px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 6px;
  transition: width .3s;
}
.bar-value {
  text-align: right;
  font-weight: 600;
  color: var(--text);
}

/* My Work — task rows */
.mw-section { margin-bottom: 20px; }
.mw-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.mw-count {
  font-size: 11px;
  color: var(--text-faint);
  font-weight: 500;
}
.mw-list {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.mw-row {
  display: grid;
  grid-template-columns: 140px 22px 1fr 160px 90px;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  font-size: 12.5px;
}
.mw-row:last-child { border-bottom: none; }
.mw-row:hover { background: var(--hover); }
.mw-name { color: var(--text); font-weight: 500; }
.mw-meta { color: var(--text-muted); font-size: 11px; }
.mw-meta.overdue { color: var(--prio-urgent); font-weight: 600; }
.mw-meta.today   { color: var(--prio-high); font-weight: 600; }
.mw-meta.soon    { color: var(--accent); }

/* Inbox */
.inbox-list {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.inbox-row {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  align-items: flex-start;
}
.inbox-row:last-child { border-bottom: none; }
.inbox-row:hover { background: var(--hover); }
.inbox-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.inbox-reason { font-weight: 600; color: var(--text-muted); }
.inbox-name { font-size: 13px; color: var(--text); font-weight: 500; }
.inbox-list  { font-size: 11px; color: var(--text-faint); font-weight: 400; }
.inbox-preview {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Nav item active state extension to dashboard */
.nav-item.active { background: var(--sidebar-active); color: var(--sidebar-active-text); font-weight: 600; }

/* PICKER */
.picker {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  z-index: 300;
  padding: 4px;
  max-height: 360px;
  overflow-y: auto;
}
.picker-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
}
.picker-item:hover { background: var(--hover); }

/* TOAST */
#toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1c1d24;
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 500;
  box-shadow: var(--shadow-lg);
}
#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
#toast.error { background: #dc2626; }
#toast.success { background: #16a34a; }

/* AUTH SCREEN */
#authOverlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #f8fafc 0%, #ede9fe 100%);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
#authOverlay.open { display: flex; }
.auth-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.12);
  width: min(420px, 100%);
  padding: 32px 28px;
}
.auth-logo { display: flex; justify-content: center; margin-bottom: 12px; }
.auth-title {
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}
.auth-sub {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
}
.auth-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.auth-tab {
  flex: 1;
  padding: 10px 0;
  background: transparent;
  border: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.auth-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.auth-form input, .auth-form select {
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  background: #fff;
  color: var(--text);
}
.auth-form input:focus, .auth-form select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
.auth-helper {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}
.auth-submit {
  margin-top: 8px;
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
}
.auth-error {
  color: var(--prio-urgent);
  font-size: 12px;
  min-height: 16px;
  margin-top: 4px;
}
.auth-footer {
  margin-top: 16px;
  text-align: center;
  font-size: 11px;
  color: var(--text-faint);
}

/* Active group header — static (no chevron, not collapsible) */
.status-header.static { cursor: default; }
.status-header.static:hover { background: transparent; }

/* UTIL */
.hidden { display: none !important; }

/* TREE ACTIONS (+ and ⋯ on sidebar rows) */
.tree-node { position: relative; }
.tree-actions {
  margin-left: auto;
  display: none;
  align-items: center;
  gap: 2px;
  padding-right: 4px;
}
.tree-node:hover .tree-actions { display: inline-flex; }
.tree-act {
  width: 20px; height: 20px;
  border: 0; background: transparent;
  color: #6b6c75; font-size: 14px; line-height: 1;
  border-radius: 4px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.tree-act:hover { background: rgba(123,104,238,.15); color: #1c1d24; }

.tree-inline-input {
  position: fixed; z-index: 9999;
  background: #fff; border: 1px solid #e7e7ec; border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  padding: 8px; display: flex; gap: 6px; min-width: 240px;
}
.tree-inline-input input {
  flex: 1; padding: 6px 8px; border: 1px solid #e0e0e6; border-radius: 6px;
  font-size: 13px; outline: none;
}
.tree-inline-input input:focus { border-color: #7B68EE; }
.tree-inline-input button {
  border: 0; background: #7B68EE; color: #fff;
  padding: 6px 12px; border-radius: 6px; font-size: 13px; font-weight: 600; cursor: pointer;
}

.tree-more-menu {
  position: fixed; z-index: 9999;
  background: #fff; border: 1px solid #e7e7ec; border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  padding: 4px; display: flex; flex-direction: column; min-width: 140px;
}
.tree-more-menu button {
  border: 0; background: transparent; text-align: left;
  padding: 8px 12px; border-radius: 4px; font-size: 13px; cursor: pointer;
}
.tree-more-menu button:hover { background: #f4f4f7; }
.tree-more-menu button.danger { color: #dc2626; }
.tree-more-menu button.danger:hover { background: #fee2e2; }

/* SETTINGS MODAL */
.settings-modal {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(20,20,30,.45);
  display: none; align-items: center; justify-content: center;
  padding: 24px;
}
.settings-modal.open { display: flex; }
.settings-card {
  background: #fff; border-radius: 12px;
  width: min(720px, 100%); max-height: 86vh; overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.settings-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; border-bottom: 1px solid #eef0f3;
}
.settings-head h2 { margin: 0; font-size: 18px; }
.settings-close {
  border: 0; background: transparent; cursor: pointer;
  width: 28px; height: 28px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #6b6c75; font-size: 16px;
}
.settings-close:hover { background: #f4f4f7; color: #1c1d24; }
.settings-body { padding: 22px; overflow: auto; }
.settings-body h3 { font-size: 14px; margin: 0 0 4px; }
.settings-hint  { font-size: 12px; color: #6b6c75; margin: 0 0 14px; }

.status-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.status-row {
  display: grid;
  grid-template-columns: 40px 1fr 160px auto auto;
  gap: 8px; align-items: center;
  padding: 6px; border: 1px solid #eef0f3; border-radius: 8px;
  background: #fafafb;
}
.status-row input[type="color"] {
  width: 40px; height: 32px; padding: 0; border: 1px solid #e0e0e6;
  border-radius: 6px; cursor: pointer; background: transparent;
}
.status-row input[type="text"],
.status-row select {
  padding: 6px 8px; border: 1px solid #e0e0e6; border-radius: 6px;
  font-size: 13px; outline: none; background: #fff;
}
.status-row input[type="text"]:focus,
.status-row select:focus { border-color: #7B68EE; }
.status-row .status-save {
  border: 0; background: #7B68EE; color: #fff;
  padding: 6px 12px; border-radius: 6px; font-size: 12px; font-weight: 600; cursor: pointer;
}
.status-row .status-del {
  border: 0; background: transparent; color: #dc2626; cursor: pointer;
  width: 28px; height: 28px; border-radius: 6px; font-size: 14px;
}
.status-row .status-del:hover { background: #fee2e2; }

.status-add {
  display: grid;
  grid-template-columns: 1fr 60px 160px auto;
  gap: 8px; padding: 8px;
  border: 1px dashed #d1d5db; border-radius: 8px;
}
.status-add input[type="text"],
.status-add select {
  padding: 6px 8px; border: 1px solid #e0e0e6; border-radius: 6px;
  font-size: 13px; outline: none;
}
.status-add input[type="color"] {
  width: 100%; height: 32px; padding: 0; border: 1px solid #e0e0e6;
  border-radius: 6px; cursor: pointer; background: transparent;
}
.status-add button {
  border: 0; background: #7B68EE; color: #fff;
  padding: 6px 14px; border-radius: 6px; font-size: 13px; font-weight: 600; cursor: pointer;
}
