:root {
  --purple: #7B68EE;
  --purple-dark: #6a58d6;
  --sidebar-bg: #fafafa;
  --rail-bg: #1a1625;
  --text-dark: #2f3237;
  --text-muted: #6a6f76;
  --border: #e6e6e9;
  --status-todo: #87909E;
  --status-progress: #4A90D9;
  --status-done: #2FA36B;
  --danger: #E14D4D;
  --warn: #E9A23B;
  --blue-flag: #4A90D9;
  --gray-flag: #B0B6BD;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text-dark);
  font-size: 13.5px;
  background: #fff;
}
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
button { font-family: inherit; cursor: pointer; }

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

/* ---------- Icon rail ---------- */
.rail {
  width: 64px;
  background: var(--rail-bg);
  color: #b8b3c7;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 0;
  gap: 4px;
  flex-shrink: 0;
}
.rail-logo {
  width: 32px; height: 32px; border-radius: 9px;
  background: var(--purple);
  color: white; display: flex; align-items: center; justify-content: center;
  font-weight: 700; margin-bottom: 18px;
}
.rail-btn {
  width: 52px;
  background: none; border: none; color: inherit;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 9px 0; border-radius: 8px; font-size: 10px;
}
.rail-btn:hover { background: rgba(255,255,255,0.06); color: #fff; }
.rail-btn.active { background: rgba(123,104,238,0.25); color: #fff; }
.rail-spacer { flex: 1; }

/* ---------- Sidebar ---------- */
.sidebar {
  width: 260px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  flex-shrink: 0;
  padding: 12px 10px;
  overflow-y: auto;
}
.sidebar-top { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 10px; }
.workspace-name { font-weight: 700; font-size: 14px; }
.chev { color: var(--text-muted); margin-left: 3px; font-size: 11px; }
.icon-btn { background: none; border: none; color: var(--text-muted); padding: 4px; border-radius: 6px; }
.icon-btn:hover { background: #eee; }

.sidebar-search {
  display: flex; align-items: center; gap: 8px;
  background: #fff; border: 1px solid var(--border); border-radius: 8px;
  padding: 7px 10px; margin-bottom: 10px; color: var(--text-muted);
}
.search-icon { width: 15px; height: 15px; }
.kbd { margin-left: auto; font-size: 10px; border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; }

.create-btn {
  display: flex; align-items: center; gap: 6px;
  background: var(--text-dark); color: #fff; border: none;
  border-radius: 8px; padding: 8px 12px; font-weight: 600; margin-bottom: 16px;
}
.create-btn svg { width: 15px; height: 15px; }
.create-btn:hover { background: #000; }

.home-nav { display: flex; flex-direction: column; gap: 1px; margin-bottom: 10px; }
.home-nav-item {
  display: flex; align-items: center; gap: 10px;
  background: none; border: none; color: var(--text-dark);
  padding: 7px 8px; border-radius: 6px; font-weight: 500; font-size: 13px; text-align: left;
}
.home-nav-item svg { width: 16px; height: 16px; color: var(--text-muted); flex-shrink: 0; }
.home-nav-item:hover { background: #eee; }
.home-nav-item.active { background: #ece9fc; color: var(--purple-dark); font-weight: 700; }
.home-nav-item.active svg { color: var(--purple-dark); }

.sidebar-section-label { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .03em; padding: 4px 6px; margin-top: 6px; }

.spaces-tree { display: flex; flex-direction: column; gap: 1px; }
.space-row { display: flex; align-items: center; gap: 6px; padding: 6px 6px; border-radius: 6px; font-weight: 600; }
.space-row:hover { background: #eee; cursor: pointer; }
.space-dot { width: 8px; height: 8px; border-radius: 3px; background: var(--purple); flex-shrink: 0; }
.space-caret { width: 12px; height: 12px; color: var(--text-muted); transition: transform .12s; flex-shrink: 0; }
.space-caret.collapsed { transform: rotate(-90deg); }
.project-row {
  display: flex; align-items: center; gap: 7px;
  padding: 6px 6px 6px 26px; border-radius: 6px; color: var(--text-dark);
}
.project-row:hover { background: #eee; cursor: pointer; }
.project-row.active { background: #ece9fc; color: var(--purple-dark); font-weight: 600; }
.project-row .p-icon { width: 14px; height: 14px; color: var(--purple); flex-shrink: 0; }
.project-row .p-count { margin-left: auto; font-size: 11px; color: var(--text-muted); }

.new-space-btn {
  display: flex; align-items: center; gap: 6px;
  background: none; border: none; color: var(--text-muted);
  padding: 7px 6px; margin-top: 6px; border-radius: 6px; font-weight: 500;
}
.new-space-btn svg { width: 14px; height: 14px; }
.new-space-btn:hover { background: #eee; color: var(--text-dark); }

/* ---------- Main ---------- */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.banner {
  background: linear-gradient(90deg, #6a58d6, #8f7cf0);
  color: #fff; display: flex; align-items: center; justify-content: space-between;
  padding: 9px 18px; font-size: 13px; flex-shrink: 0;
}
.banner-actions { display: flex; align-items: center; gap: 8px; }
.banner-btn { border: none; border-radius: 6px; padding: 5px 12px; font-weight: 600; font-size: 12.5px; }
.banner-btn-light { background: #fff; color: var(--purple-dark); }
.banner-btn-ghost { background: rgba(255,255,255,0.18); color: #fff; }
.banner-close { background: none; border: none; color: #fff; font-size: 18px; line-height: 1; opacity: .85; }
.banner.hidden { display: none; }

.topbar { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px 6px; flex-shrink: 0; }
.crumbs { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 15px; }
.crumb-icon { font-size: 13px; }
.crumb-sep { color: var(--text-muted); font-weight: 400; }
.star { color: var(--text-muted); font-weight: 400; margin-left: 4px; }
.topbar-actions { display: flex; gap: 6px; }
.pill-btn { background: none; border: none; color: var(--text-muted); font-weight: 600; padding: 6px 10px; border-radius: 6px; font-size: 13px; }
.pill-btn:hover { background: #f2f2f2; color: var(--text-dark); }

.viewbar { display: flex; align-items: center; gap: 4px; padding: 4px 18px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.view-tab { background: none; border: none; border-bottom: 2px solid transparent; padding: 9px 10px; color: var(--text-muted); font-weight: 600; font-size: 13px; }
.view-tab:hover { color: var(--text-dark); }
.view-tab.active { color: var(--purple-dark); border-bottom-color: var(--purple); }
.view-tab.plus { color: var(--text-muted); margin-left: 4px; }

.toolbar { display: flex; align-items: center; justify-content: space-between; padding: 10px 18px; flex-shrink: 0; }
.toolbar-left, .toolbar-right { display: flex; align-items: center; gap: 6px; }
.tb-btn { background: #f5f5f6; border: 1px solid var(--border); border-radius: 7px; padding: 6px 10px; color: var(--text-dark); font-size: 12.5px; font-weight: 500; }
.tb-btn:hover { background: #ececee; }
.icon-only { background: none; border: none; padding: 6px; border-radius: 6px; color: var(--text-muted); }
.icon-only:hover { background: #f2f2f2; }
.avatar-chip {
  width: 26px; height: 26px; border-radius: 50%; background: var(--purple);
  color: #fff; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700;
}
.add-task-btn { background: var(--text-dark); color: #fff; border: none; border-radius: 7px; padding: 7px 14px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.add-task-btn:hover { background: #000; }
.chev-light { opacity: .7; font-size: 11px; }

.content { flex: 1; overflow-y: auto; padding: 4px 18px 40px; }

/* ---------- Table / groups ---------- */
.group { margin-bottom: 4px; }
.group-header { display: flex; align-items: center; gap: 8px; padding: 12px 4px 8px; font-weight: 700; font-size: 12.5px; }
.group-caret { width: 13px; height: 13px; color: var(--text-muted); }
.status-badge { display: flex; align-items: center; gap: 6px; border-radius: 5px; padding: 3px 9px; font-size: 11px; font-weight: 700; letter-spacing: .02em; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; }
.group-count { color: var(--text-muted); font-weight: 600; }

.task-table { width: 100%; border-collapse: collapse; }
.task-table thead th {
  text-align: left; font-weight: 600; color: var(--text-muted); font-size: 12px;
  padding: 6px 10px; border-bottom: 1px solid var(--border);
}
.task-row { border-bottom: 1px solid #f0f0f1; }
.task-row:hover { background: #fafafa; }
.task-row td { padding: 7px 10px; vertical-align: middle; }
.task-name-cell { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.task-radio { width: 15px; height: 15px; border: 1.6px solid #c9ccd1; border-radius: 50%; flex-shrink: 0; }
.task-radio.done { background: var(--status-done); border-color: var(--status-done); }
.task-name { font-weight: 500; }
.task-name:hover { text-decoration: underline; }

.cell-assignee, .cell-due, .cell-priority, .cell-status, .cell-comments { width: 100px; }
.assignee-avatar {
  width: 24px; height: 24px; border-radius: 50%; color: #fff; font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.assignee-empty { width: 22px; height: 22px; border-radius: 50%; border: 1.5px dashed #c9ccd1; color: #c9ccd1; display:flex; align-items:center; justify-content:center; }
.due-pill { border: none; background: none; color: var(--text-muted); font-size: 12.5px; padding: 3px 6px; border-radius: 5px; }
.due-pill.set { background: #f1f3f5; color: var(--text-dark); }
.due-pill.overdue { background: #fdeceb; color: var(--danger); }

.priority-flag { width: 16px; height: 16px; }
.priority-none { color: #cfd2d6; }
.priority-low { color: #8aa0b8; }
.priority-normal { color: var(--blue-flag); }
.priority-high { color: var(--warn); }
.priority-urgent { color: var(--danger); }

.status-select-wrap select, .cell-assignee select {
  border: none; background: none; font-size: 12px; font-weight: 700; padding: 4px 6px; border-radius: 5px; color: #fff;
}

.comment-icon { color: var(--text-muted); display: flex; align-items: center; gap: 4px; font-size: 12px; }

.add-task-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; color: var(--text-muted); cursor: pointer; }
.add-task-row:hover { color: var(--purple-dark); }
.add-task-row input {
  border: none; outline: none; font-size: 13.5px; flex: 1; background: transparent;
}
.add-task-row .plus-icon { width: 15px; height: 15px; }

.empty-state { padding: 60px 20px; text-align: center; color: var(--text-muted); }
.empty-state h3 { color: var(--text-dark); margin-bottom: 6px; }

/* ---------- Modal ---------- */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.4); display: none; align-items: center; justify-content: center; z-index: 50; }
.modal-overlay.open { display: flex; }
.modal { background: #fff; border-radius: 12px; width: 520px; max-height: 82vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,0.25); }
.modal-header { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.modal-task-name { flex: 1; border: none; outline: none; font-size: 16px; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 20px; color: var(--text-muted); }
.modal-body { padding: 16px 18px; overflow-y: auto; }
.modal-field { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.modal-field label { width: 90px; color: var(--text-muted); font-size: 12.5px; font-weight: 600; }
.modal-field select, .modal-field input { flex: 1; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; }
.modal-comments { margin-top: 18px; border-top: 1px solid var(--border); padding-top: 14px; }
.modal-comments-label { font-weight: 700; font-size: 12.5px; color: var(--text-muted); margin-bottom: 8px; }
.modal-comments-list { display: flex; flex-direction: column; gap: 10px; max-height: 180px; overflow-y: auto; margin-bottom: 10px; }
.comment-item { display: flex; gap: 8px; }
.comment-avatar { width: 24px; height: 24px; border-radius: 50%; color: #fff; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.comment-bubble { background: #f5f5f6; border-radius: 8px; padding: 7px 10px; font-size: 12.5px; }
.comment-author { font-weight: 700; margin-right: 6px; }
.modal-comment-input { display: flex; gap: 8px; }
.modal-comment-input input { flex: 1; padding: 7px 10px; border: 1px solid var(--border); border-radius: 7px; font-size: 13px; }
.modal-comment-input button { background: var(--purple); color: #fff; border: none; border-radius: 7px; padding: 7px 14px; font-weight: 600; }

.placeholder-view { padding: 60px 20px; text-align: center; color: var(--text-muted); }

/* ---------- Settings / Integrations modal ---------- */
.settings-modal { width: 560px; }
.settings-intro { font-size: 12.5px; color: var(--text-muted); line-height: 1.5; margin: 0 0 18px; }
.settings-intro a { color: var(--purple-dark); }
.integration-panel { border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; margin-bottom: 14px; }
.integration-panel-header { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; margin-bottom: 12px; }
.integration-panel-header svg { width: 18px; height: 18px; color: var(--purple); }
.integration-status { margin-left: auto; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 5px; background: #f1f3f5; color: var(--text-muted); }
.integration-status.connected { background: #d9f2e6; color: var(--status-done); }
.integration-status.configured { background: #eef1fb; color: #3b5bdb; }
.integration-panel label { display: block; font-size: 11.5px; font-weight: 600; color: var(--text-muted); margin: 10px 0 4px; }
.settings-hint { font-weight: 400; text-transform: none; letter-spacing: 0; }
.integration-panel input { width: 100%; padding: 7px 9px; border: 1px solid var(--border); border-radius: 6px; font-size: 12.5px; }
.integration-panel input[readonly] { background: #f7f7f8; color: var(--text-muted); }
.integration-actions { display: flex; gap: 8px; margin-top: 14px; }

/* ---------- Inbox / Home view ---------- */
.project-view { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.inbox-view { display: none; flex-direction: column; flex: 1; min-height: 0; }
.inbox-view.active { display: flex; }
.project-view.hidden { display: none; }

.inbox-tabs { display: flex; align-items: center; gap: 26px; padding: 14px 22px 0; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.inbox-tab {
  display: flex; align-items: center; gap: 7px;
  background: none; border: none; border-bottom: 2px solid transparent;
  padding: 0 2px 12px; color: var(--text-muted); font-weight: 700; font-size: 13.5px;
}
.inbox-tab svg { width: 16px; height: 16px; }
.inbox-tab:hover { color: var(--text-dark); }
.inbox-tab.active { color: var(--text-dark); border-bottom-color: var(--text-dark); }

.inbox-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 12px 22px; flex-shrink: 0; }
.inbox-toolbar-right { display: flex; align-items: center; gap: 6px; }

.inbox-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 20px; }
.inbox-empty-icon {
  width: 52px; height: 52px; border-radius: 14px; border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; margin-bottom: 18px; color: var(--purple);
  box-shadow: 0 4px 14px rgba(0,0,0,0.06);
}
.inbox-empty-icon svg { width: 26px; height: 26px; }
.inbox-empty h3 { font-size: 18px; margin: 0 0 6px; color: var(--text-dark); }
.inbox-empty p { color: var(--text-muted); margin: 0 0 18px; font-size: 13.5px; }
.invite-btn { background: var(--text-dark); color: #fff; border: none; border-radius: 8px; padding: 9px 18px; font-weight: 600; font-size: 13.5px; }
.invite-btn:hover { background: #000; }

/* ---------- Planner view ---------- */
.planner-view { display: none; flex-direction: column; flex: 1; min-height: 0; overflow-y: auto; padding: 56px 60px; background: radial-gradient(circle at 30% 20%, #f7f6fb 0%, #fff 55%); }
.planner-view.active { display: flex; }

.planner-hero { display: flex; align-items: flex-start; gap: 50px; flex-wrap: wrap; }
.planner-hero-text { flex: 1; min-width: 300px; max-width: 460px; }
.planner-hero-text h1 { font-size: 44px; line-height: 1.1; font-weight: 800; margin: 0 0 20px; letter-spacing: -0.01em; }
.planner-hero-text p { color: var(--text-muted); font-size: 15.5px; line-height: 1.55; margin: 0 0 30px; max-width: 400px; }
.planner-getstarted-label { color: var(--text-muted); font-size: 12.5px; font-weight: 600; margin-bottom: 10px; }
.planner-connect-row { display: flex; gap: 10px; flex-wrap: wrap; }
.planner-connect-btn {
  display: flex; align-items: center; gap: 8px;
  background: #fff; border: 1px solid var(--border); border-radius: 9px;
  padding: 11px 16px; font-weight: 600; font-size: 13.5px; color: var(--text-dark);
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.planner-connect-btn svg { width: 17px; height: 17px; color: var(--purple); }
.planner-connect-btn:hover { border-color: var(--purple); }

.planner-preview-cards { display: flex; gap: 22px; flex: 1; min-width: 300px; flex-wrap: wrap; }
.planner-card {
  background: #fff; border: 1px solid var(--border); border-radius: 14px; overflow: hidden;
  width: 300px; box-shadow: 0 8px 24px rgba(20,20,40,0.06);
}
.planner-card h3 { font-size: 15px; margin: 16px 18px 6px; }
.planner-card p { font-size: 12.5px; color: var(--text-muted); margin: 0 18px 18px; line-height: 1.5; }
.planner-card-mock { background: #f4f3f8; padding: 14px; height: 190px; display: flex; flex-direction: column; gap: 8px; }
.planner-mock-dark { background: #efe9fb; }
.planner-mock-toprow { display: flex; align-items: center; gap: 8px; background: #fff; border-radius: 7px; padding: 6px 8px; font-size: 10.5px; font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.planner-mock-join { background: #17a673; color: #fff; border-radius: 5px; padding: 2px 6px; font-size: 10px; }
.planner-mock-title { color: var(--text-dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.planner-mock-badge { margin-left: auto; color: var(--danger); font-size: 10px; }
.planner-mock-pill { background: #efe6ff; color: var(--purple-dark); border-radius: 5px; padding: 2px 6px; font-size: 10px; }
.planner-mock-event { background: #d9f2e6; border-left: 3px solid var(--status-done); border-radius: 6px; padding: 6px 8px; font-size: 10.5px; }
.planner-mock-event-purple { background: #efe6ff; border-left-color: var(--purple); }
.planner-mock-eventtitle { font-weight: 700; color: var(--text-dark); }
.planner-mock-eventtime { color: var(--text-muted); font-size: 10px; margin-top: 2px; }
.planner-mock-detail { background: #fff; border-radius: 8px; padding: 8px 9px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); margin-top: auto; }
.planner-mock-detail-title { font-weight: 700; font-size: 11px; }
.planner-mock-detail-time { font-size: 10px; color: var(--text-muted); margin: 3px 0 7px; }
.planner-mock-joinbtn { width: 100%; background: #eef1fb; color: #3b5bdb; border: none; border-radius: 6px; padding: 6px; font-size: 10.5px; font-weight: 700; }
.planner-mock-joinbtn.small { margin-top: 6px; }
.planner-mock-joinbtn.purple { background: #efe6ff; color: var(--purple-dark); }
.planner-mock-notetaker { background: #fff; border-radius: 8px; padding: 8px 9px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); margin-top: auto; }
.planner-mock-notetaker-label { font-weight: 700; font-size: 10.5px; color: var(--purple-dark); }
.planner-mock-notetaker-desc { font-size: 9.5px; color: var(--text-muted); margin: 3px 0 6px; line-height: 1.4; }

.planner-nav { display: flex; gap: 8px; justify-content: center; margin-top: 40px; }
.planner-nav-arrow { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border); background: #fff; color: var(--text-muted); font-size: 14px; }
.planner-nav-arrow:hover { background: #f2f2f2; color: var(--text-dark); }

.planner-events-list { max-width: 640px; margin-top: 36px; background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 6px 18px 14px; box-shadow: 0 4px 16px rgba(0,0,0,0.04); }
.planner-events-label { font-size: 12px; font-weight: 700; color: var(--text-muted); padding: 12px 0 8px; }
.planner-event-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid #f0f0f1; }
.planner-event-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.planner-event-dot.google { background: #4285F4; }
.planner-event-dot.microsoft { background: #0078D4; }
.planner-event-info { flex: 1; min-width: 0; }
.planner-event-title { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.planner-event-time { font-size: 11.5px; color: var(--text-muted); }
.planner-event-join { background: #eef1fb; color: #3b5bdb; border-radius: 6px; padding: 5px 12px; font-size: 12px; font-weight: 700; text-decoration: none; flex-shrink: 0; }

/* ---------- More flyout ---------- */
.more-flyout {
  position: fixed; left: 68px; bottom: 90px; width: 300px;
  background: #fff; border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,0.18);
  padding: 14px; display: none; z-index: 60;
}
.more-flyout.open { display: block; }
.more-flyout-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.more-flyout-item {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: none; border: none; padding: 12px 4px; border-radius: 10px;
  font-size: 12px; font-weight: 500; color: var(--text-dark);
}
.more-flyout-item:hover { background: #f2f2f4; }
.more-flyout-icon { width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; }
.more-flyout-icon svg { width: 18px; height: 18px; stroke-width: 1.8; }
.more-flyout-icon.purple { background: #efe6ff; color: var(--purple-dark); }
.more-flyout-icon.teal { background: #dbf5ef; color: #0f9d8c; }
.more-flyout-icon.blue { background: #e2edff; color: #3b5bdb; }
.more-flyout-icon.orange { background: #fdeadb; color: #d9772e; }
.more-flyout-icon.indigo { background: #e6e6fb; color: #4f4fd6; }
.more-flyout-icon.red { background: #fde3e3; color: var(--danger); }
.more-flyout-icon.amber { background: #fef3d6; color: #b8860b; }
.more-flyout-customize {
  display: flex; align-items: center; justify-content: center; gap: 7px; width: 100%;
  margin-top: 10px; padding: 9px; border: 1px solid var(--border); border-radius: 9px;
  background: #fff; color: var(--text-dark); font-weight: 600; font-size: 12.5px;
}
.more-flyout-customize:hover { background: #f7f7f8; }
.more-flyout-customize svg { width: 15px; height: 15px; }

/* ---------- Generic page view (Spaces/Chat/Docs/Dashboards/etc) ---------- */
.generic-view { display: none; flex: 1; min-height: 0; overflow-y: auto; padding: 26px 30px; }
.generic-view.active { display: block; }
.gv-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.gv-header h2 { font-size: 20px; margin: 0; }
.gv-header p { color: var(--text-muted); font-size: 13px; margin: 4px 0 0; }
.gv-back { background: none; border: none; color: var(--text-muted); font-size: 13px; font-weight: 600; margin-bottom: 14px; display: inline-flex; align-items: center; gap: 5px; }
.gv-back:hover { color: var(--text-dark); }

.gv-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.gv-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 16px; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
.gv-card:hover { border-color: var(--purple); box-shadow: 0 4px 14px rgba(123,104,238,0.12); }
.gv-card h3 { font-size: 14.5px; margin: 0 0 6px; }
.gv-card p { font-size: 12px; color: var(--text-muted); margin: 0; }
.gv-card-meta { font-size: 11px; color: var(--text-muted); margin-top: 8px; }
.gv-new-btn { background: var(--text-dark); color: #fff; border: none; border-radius: 8px; padding: 9px 16px; font-weight: 600; font-size: 13px; }
.gv-new-btn:hover { background: #000; }
.gv-empty { color: var(--text-muted); font-size: 13.5px; padding: 30px 0; text-align: center; }

/* Chat */
.gv-chat { display: flex; flex-direction: column; height: 100%; max-height: 70vh; }
.gv-chat-messages { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding: 6px 0 16px; }
.gv-chat-msg { display: flex; gap: 10px; }
.gv-chat-avatar { width: 28px; height: 28px; border-radius: 50%; color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.gv-chat-body { background: #f5f5f6; border-radius: 10px; padding: 8px 12px; max-width: 480px; }
.gv-chat-author { font-weight: 700; font-size: 12.5px; margin-right: 6px; }
.gv-chat-time { font-size: 10.5px; color: var(--text-muted); }
.gv-chat-input-row { display: flex; gap: 8px; border-top: 1px solid var(--border); padding-top: 12px; }
.gv-chat-input-row input { flex: 1; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; }
.gv-chat-input-row button { background: var(--purple); color: #fff; border: none; border-radius: 8px; padding: 9px 16px; font-weight: 600; }

/* Docs editor */
.gv-doc-editor { display: flex; flex-direction: column; gap: 10px; max-width: 780px; }
.gv-doc-title-input { font-size: 24px; font-weight: 800; border: none; outline: none; padding: 4px 0; }
.gv-doc-content { min-height: 400px; border: 1px solid var(--border); border-radius: 10px; padding: 16px; font-size: 14px; line-height: 1.6; font-family: inherit; outline: none; }
.gv-doc-content:focus { border-color: var(--purple); }
.gv-doc-content h1 { font-size: 26px; font-weight: 800; margin: 0.4em 0; }
.gv-doc-content h2 { font-size: 21px; font-weight: 700; margin: 0.4em 0; }
.gv-doc-content h3 { font-size: 17px; font-weight: 700; margin: 0.4em 0; }
.gv-doc-content p { margin: 0 0 0.7em; }
.gv-doc-content ul, .gv-doc-content ol { margin: 0 0 0.7em; padding-left: 1.4em; }
.gv-doc-content a { color: var(--purple-dark); }
.gv-doc-savebar { font-size: 11.5px; color: var(--text-muted); }

.doc-toolbar {
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
  background: #f7f7f8; border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px;
}
.doc-tb-select { border: 1px solid var(--border); border-radius: 6px; padding: 5px 6px; font-size: 12.5px; background: #fff; }
.doc-tb-btn { background: none; border: none; border-radius: 6px; padding: 6px 9px; font-size: 12.5px; color: var(--text-dark); min-width: 28px; }
.doc-tb-btn:hover { background: #e9e9ec; }
.doc-tb-sep { width: 1px; height: 20px; background: var(--border); margin: 0 4px; }
.doc-tb-export { margin-left: auto; font-weight: 700; color: var(--purple-dark); }

/* Goals */
.goal-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin-bottom: 12px; }
.goal-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.goal-card-top h3 { font-size: 14.5px; margin: 0; }
.goal-progress-bar { height: 8px; background: #f1f3f5; border-radius: 5px; overflow: hidden; margin-bottom: 8px; }
.goal-progress-fill { height: 100%; background: var(--purple); border-radius: 5px; }
.goal-card-numbers { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--text-muted); }
.goal-card-numbers input { width: 70px; border: 1px solid var(--border); border-radius: 6px; padding: 4px 6px; font-size: 12.5px; }

/* Timesheets */
.gv-table { width: 100%; border-collapse: collapse; margin-top: 14px; }
.gv-table th { text-align: left; font-size: 12px; color: var(--text-muted); padding: 6px 10px; border-bottom: 1px solid var(--border); }
.gv-table td { padding: 8px 10px; border-bottom: 1px solid #f0f0f1; font-size: 13px; }
.timesheet-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; background: #fafafa; border: 1px solid var(--border); border-radius: 10px; padding: 14px; margin-bottom: 6px; }
.timesheet-form .tf-field { display: flex; flex-direction: column; gap: 4px; }
.timesheet-form label { font-size: 11px; color: var(--text-muted); font-weight: 600; }
.timesheet-form input, .timesheet-form select { padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 12.5px; }
.timesheet-total { font-weight: 700; font-size: 13.5px; margin-top: 14px; }

/* Forms */
.form-builder { max-width: 560px; background: #fafafa; border: 1px solid var(--border); border-radius: 10px; padding: 16px; margin-bottom: 20px; }
.form-builder input, .form-builder select { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; margin-bottom: 10px; }
.form-field-row { display: flex; gap: 8px; margin-bottom: 8px; }
.form-field-row input { flex: 1; margin-bottom: 0; }
.form-field-row button { background: none; border: none; color: var(--danger); font-size: 16px; }
.form-public { max-width: 480px; background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 24px; }
.form-public label { display: block; font-size: 12.5px; font-weight: 600; margin: 12px 0 5px; }
.form-public input, .form-public textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; font-family: inherit; }

/* Whiteboard */
.wb-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.wb-canvas-wrap { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; display: inline-block; background: #fff; }
.wb-color { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--border); cursor: pointer; }
.wb-color.selected { box-shadow: 0 0 0 2px var(--text-dark); }

/* Clips */
.clip-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid #f0f0f1; }
.clip-icon { width: 36px; height: 36px; border-radius: 8px; background: #fde3e3; color: var(--danger); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.clip-icon svg { width: 18px; height: 18px; }
.record-btn { background: var(--danger); color: #fff; border: none; border-radius: 8px; padding: 9px 16px; font-weight: 600; font-size: 13px; display: flex; align-items: center; gap: 7px; }
.record-btn.recording { background: #b52626; }
.record-dot { width: 8px; height: 8px; border-radius: 50%; background: #fff; }

/* Dashboards */
.dash-template-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; max-width: 900px; margin: 0 auto; }
.dash-template-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 18px; cursor: pointer; position: relative; }
.dash-template-card:hover { border-color: var(--purple); }
.dash-template-badge { position: absolute; top: 14px; right: 14px; background: var(--text-dark); color: #fff; font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 5px; }
.dash-template-icon { width: 40px; height: 40px; border-radius: 10px; background: #efe6ff; color: var(--purple-dark); display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.dash-template-icon svg { width: 20px; height: 20px; }
.dash-template-card h3 { font-size: 14.5px; margin: 0 0 4px; }
.dash-template-card p { font-size: 12px; color: var(--text-muted); margin: 0; }
.dash-stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 24px; }
.dash-stat-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.dash-stat-value { font-size: 26px; font-weight: 800; }
.dash-stat-label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.dash-bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.dash-bar-label { width: 110px; font-size: 12.5px; flex-shrink: 0; }
.dash-bar-track { flex: 1; height: 14px; background: #f1f3f5; border-radius: 7px; overflow: hidden; }
.dash-bar-fill { height: 100%; border-radius: 7px; }
.dash-bar-count { width: 30px; text-align: right; font-size: 12px; color: var(--text-muted); }
.dash-panel { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 20px; margin-bottom: 20px; max-width: 640px; }
.dash-panel h3 { font-size: 15px; margin: 0 0 16px; }

/* Apps marketplace */
.apps-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.app-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 16px; text-align: center; opacity: .85; }
.app-card-icon { width: 44px; height: 44px; border-radius: 10px; margin: 0 auto 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 800; color: #fff; }
.app-card h4 { font-size: 13.5px; margin: 0 0 4px; }
.app-card p { font-size: 11px; color: var(--text-muted); margin: 0 0 10px; }
.app-card button { width: 100%; background: #f1f3f5; color: var(--text-muted); border: none; border-radius: 6px; padding: 6px; font-size: 12px; font-weight: 600; }
