:root {
  --purple: #7B68EE;
  --purple-dark: #6a58d6;
  --purple-light: #9b8cf5;
  --sidebar-bg: #fafafa;
  --rail-bg: #191424;
  --text-dark: #23262b;
  --text-muted: #6a6f76;
  --border: #e6e6e9;
  --status-todo: #87909E;
  --status-progress: #4A90D9;
  --status-done: #2FA36B;
  --danger: #E14D4D;
  --warn: #E9A23B;
  --blue-flag: #4A90D9;
  --gray-flag: #B0B6BD;
  --shadow-sm: 0 1px 2px rgba(20,20,43,0.05);
  --shadow-md: 0 4px 16px rgba(20,20,43,0.08);
  --shadow-lg: 0 16px 40px rgba(20,20,43,0.14);
  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text-dark);
  font-size: 13.5px;
  background: #fff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
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; transition: background-color .15s var(--ease), color .15s var(--ease), border-color .15s var(--ease), box-shadow .15s var(--ease), transform .1s var(--ease); }
button:active { transform: translateY(1px); }
a { transition: color .15s var(--ease); }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d7d7dc; border-radius: 5px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #bfbfc6; background-clip: content-box; }

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

@keyframes flowdesk-fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
.inbox-view.active, .planner-view.active, .generic-view.active, .project-view:not(.hidden) {
  animation: flowdesk-fade-in .22s var(--ease);
}

/* ---------- 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: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--purple), var(--purple-light));
  color: white; display: flex; align-items: center; justify-content: center;
  font-weight: 800; margin-bottom: 20px; font-size: 15px;
  box-shadow: 0 6px 16px rgba(123,104,238,0.4);
}
.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: 9px; font-size: 10px;
  transition: background-color .18s var(--ease), color .18s var(--ease), transform .15s var(--ease);
}
.rail-btn:hover { background: rgba(255,255,255,0.08); color: #fff; transform: translateY(-1px); }
.rail-btn.active { background: linear-gradient(135deg, rgba(123,104,238,0.35), rgba(155,140,245,0.22)); color: #fff; box-shadow: inset 0 0 0 1px rgba(155,140,245,0.3); }
.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; gap: 8px; }
.workspace-name { font-weight: 700; font-size: 14px; background: none; border: none; padding: 4px 6px; border-radius: 6px; color: var(--text-dark); text-align: left; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace-name:hover { background: #eee; }
.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; color: var(--text-dark); }

.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);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.sidebar-search:hover { border-color: #d5d5db; box-shadow: var(--shadow-sm); }
.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;
  box-shadow: var(--shadow-sm);
}
.create-btn svg { width: 15px; height: 15px; }
.create-btn:hover { background: #000; box-shadow: var(--shadow-md); transform: translateY(-1px); }

.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; transition: background-color .15s var(--ease); }
.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 .15s var(--ease); 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);
  transition: background-color .15s var(--ease), color .15s var(--ease);
}
.project-row:hover { background: #eee; cursor: pointer; }
.project-row.active { background: #ece9fc; color: var(--purple-dark); font-weight: 600; box-shadow: inset 2px 0 0 var(--purple); }
.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-light:hover { background: #f3f1ff; }
.banner-btn-ghost { background: rgba(255,255,255,0.18); color: #fff; }
.banner-btn-ghost:hover { background: rgba(255,255,255,0.28); }
.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; transition: color .15s var(--ease), border-color .15s var(--ease); }
.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; border-color: #d5d5db; }
.icon-only { background: none; border: none; padding: 6px; border-radius: 6px; color: var(--text-muted); }
.icon-only:hover { background: #f2f2f2; color: var(--text-dark); }
.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;
  box-shadow: 0 2px 6px rgba(123,104,238,0.35);
}
.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; box-shadow: var(--shadow-sm); }
.add-task-btn:hover { background: #000; box-shadow: var(--shadow-md); transform: translateY(-1px); }
.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; transition: background-color .12s var(--ease); }
.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(20,16,35,0.45); backdrop-filter: blur(2px); display: none; align-items: center; justify-content: center; z-index: 50; animation: flowdesk-fade-in .15s var(--ease); }
.modal-overlay.open { display: flex; }
.modal { background: #fff; border-radius: 14px; width: 520px; max-height: 82vh; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); }
.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); border-radius: 6px; padding: 2px 6px; }
.modal-close:hover { background: #f2f2f4; color: var(--text-dark); }
.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; transition: border-color .15s var(--ease); }
.integration-panel:hover { border-color: #d5d5db; }
.form-label { display: block; font-size: 11.5px; font-weight: 600; color: var(--text-muted); margin: 12px 0 4px; }
#hwModalOverlay input, #hwModalOverlay select { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; }
.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; }
.int-advanced-toggle { background: none; border: none; color: var(--text-muted); font-size: 11.5px; text-decoration: underline; margin-top: 10px; padding: 0; }
.int-advanced-toggle:hover { color: var(--purple-dark); }

/* ---------- 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; }

/* ---------- Microsoft 365 panel (Outlook / Teams / SharePoint) ---------- */
.m365-panel { max-width: 900px; margin-top: 28px; background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px; box-shadow: var(--shadow-sm); }
.m365-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.m365-title { font-weight: 700; font-size: 13.5px; display: flex; align-items: center; gap: 6px; }
.m365-title::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #0078D4; display: inline-block; }
.m365-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.m365-col-label { font-size: 11.5px; font-weight: 700; color: var(--text-muted); margin-bottom: 8px; }
.m365-list { display: flex; flex-direction: column; gap: 2px; max-height: 260px; overflow-y: auto; }
.m365-item { display: block; padding: 8px 9px; border-radius: 7px; text-decoration: none; color: inherit; border-bottom: 1px solid #f0f0f1; }
.m365-item:hover { background: #f7f7f8; }
.m365-item-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.m365-item-title { font-size: 12.5px; color: var(--text-dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m365-item-time { font-size: 10.5px; color: var(--text-muted); flex-shrink: 0; }
.m365-item-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ---------- More flyout ---------- */
.more-flyout {
  position: fixed; left: 68px; bottom: 20px; width: 300px; max-height: 82vh;
  background: #fff; border-radius: 14px; box-shadow: var(--shadow-lg);
  padding: 14px; display: none; z-index: 60; overflow-y: auto;
}
.more-flyout.open { display: block; animation: flowdesk-fade-in .15s var(--ease); }
.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: var(--shadow-sm); transition: transform .15s var(--ease), box-shadow .15s var(--ease), border-color .15s var(--ease); }
.gv-card:hover { border-color: var(--purple); box-shadow: 0 8px 20px rgba(123,104,238,0.14); transform: translateY(-2px); }
.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; box-shadow: var(--shadow-sm); }
.gv-new-btn:hover { background: #000; box-shadow: var(--shadow-md); transform: translateY(-1px); }
.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; box-shadow: var(--shadow-sm); transition: box-shadow .15s var(--ease); }
.goal-card:hover { box-shadow: var(--shadow-md); }
.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: linear-gradient(90deg, var(--purple), var(--purple-light)); border-radius: 5px; transition: width .3s var(--ease); }
.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; }
.gv-table tbody tr { transition: background-color .12s var(--ease); }
.gv-table tbody tr:hover { background: #fafafa; }
.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; box-shadow: var(--shadow-sm); }
.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; box-shadow: var(--shadow-sm); }
.wb-color { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--border); cursor: pointer; transition: transform .12s var(--ease); }
.wb-color:hover { transform: scale(1.12); }
.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; box-shadow: 0 4px 12px rgba(225,77,77,0.3); }
.record-btn:hover { box-shadow: 0 6px 16px rgba(225,77,77,0.4); transform: translateY(-1px); }
.record-btn.recording { background: #b52626; animation: flowdesk-pulse 1.4s ease-in-out infinite; }
.record-dot { width: 8px; height: 8px; border-radius: 50%; background: #fff; }
@keyframes flowdesk-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(225,77,77,0.5); } 50% { box-shadow: 0 0 0 8px rgba(225,77,77,0); } }

/* 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; box-shadow: var(--shadow-sm); transition: transform .15s var(--ease), box-shadow .15s var(--ease), border-color .15s var(--ease); }
.dash-template-card:hover { border-color: var(--purple); box-shadow: 0 8px 20px rgba(123,104,238,0.14); transform: translateY(-2px); }
.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: linear-gradient(135deg, #efe6ff, #f5f0ff); 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; box-shadow: var(--shadow-sm); }
.dash-stat-value { font-size: 26px; font-weight: 800; background: linear-gradient(135deg, var(--text-dark), #4a4560); -webkit-background-clip: text; background-clip: text; }
.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; }

/* Project pipeline overview cards */
.project-pipeline-card { cursor: pointer; }
.pp-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2px; }
.pp-pct { font-weight: 800; font-size: 15px; color: var(--purple-dark); }
.pp-stackbar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: #f1f3f5; margin-bottom: 10px; }
.pp-stackbar-seg { height: 100%; transition: width .3s var(--ease); }
.pp-legend { display: flex; flex-wrap: wrap; gap: 8px; }
.pp-legend-item { font-size: 10.5px; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }
.pp-legend-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }

/* Project dashboard pipeline funnel */
.pipeline-funnel { display: flex; align-items: stretch; gap: 4px; margin-bottom: 28px; }
.pipeline-stage { flex: 1; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; position: relative; overflow: hidden; }
.pipeline-stage-bar { position: absolute; left: 0; bottom: 0; width: 100%; opacity: .12; }
.pipeline-stage-count { font-size: 22px; font-weight: 800; position: relative; }
.pipeline-stage-label { font-size: 11.5px; color: var(--text-muted); font-weight: 600; margin-top: 2px; position: relative; }
.pipeline-arrow { display: flex; align-items: center; color: var(--text-muted); font-size: 18px; }

/* Workload Report */
.wl-table { border-collapse: collapse; min-width: 100%; }
.wl-table th, .wl-table td { border: 1px solid #f0f0f1; text-align: center; padding: 6px 4px; font-size: 11.5px; min-width: 34px; }
.wl-table thead th { background: #fafafa; color: var(--text-muted); font-weight: 600; padding: 8px 4px; }
.wl-name-col { text-align: left !important; min-width: 220px; position: sticky; left: 0; background: #fff; z-index: 1; padding: 8px 10px !important; }
.wl-table thead .wl-name-col { background: #fafafa; }
.wl-total-badge { float: right; font-weight: 400; color: var(--text-muted); font-size: 11px; }
.wl-user-total { font-size: 10.5px; color: var(--text-muted); margin-top: 2px; margin-left: 32px; }
.wl-weekend { background: #f0f4fb; }
.wl-cell-bar { background: var(--purple); color: #fff; border-radius: 4px; padding: 3px 0; font-weight: 700; font-size: 10.5px; }

/* 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; }

/* ---------- Timesheets module ---------- */
.ts-tabs { display: flex; align-items: center; gap: 22px; border-bottom: 1px solid var(--border); padding-bottom: 12px; margin-bottom: 4px; }
.ts-title { font-weight: 700; font-size: 14.5px; display: flex; align-items: center; gap: 6px; }
.ts-tab { background: none; border: none; padding: 2px 0; color: var(--text-muted); font-weight: 600; font-size: 13.5px; border-bottom: 2px solid transparent; }
.ts-tab.active { color: var(--text-dark); border-bottom-color: var(--text-dark); }
.ts-tab:hover { color: var(--text-dark); }

.ts-weeknav { display: flex; align-items: center; gap: 10px; margin: 16px 0 12px; }
.ts-weeknav-arrow { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--border); background: #fff; color: var(--text-muted); }
.ts-weeknav-arrow:hover { background: #f2f2f2; }
.ts-weeknav-label { font-weight: 700; font-size: 15px; }

.ts-filterbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.ts-chip { background: #fff; border: 1px solid var(--border); border-radius: 7px; padding: 6px 10px; font-size: 12.5px; color: var(--text-dark); }
.ts-chip-disabled { color: var(--text-muted); background: #f7f7f8; cursor: not-allowed; }
.ts-viewtoggle { display: flex; border: 1px solid var(--border); border-radius: 7px; overflow: hidden; margin-left: 6px; }
.ts-viewtoggle-btn { background: #fff; border: none; padding: 6px 12px; font-size: 12.5px; font-weight: 600; color: var(--text-muted); }
.ts-viewtoggle-btn.active { background: #f1f0fb; color: var(--purple-dark); }

.ts-empty { padding: 70px 20px; text-align: center; }
.ts-empty-icon { font-size: 34px; margin-bottom: 14px; opacity: .6; }
.ts-empty h3 { margin: 0 0 6px; font-size: 16px; }
.ts-empty p { color: var(--text-muted); font-size: 13px; margin: 0 0 18px; }

.ts-tag-pill { background: #eef1fb; color: #3b5bdb; border-radius: 5px; padding: 2px 8px; font-size: 11px; font-weight: 600; }
.ts-billable-yes { color: var(--status-done); font-weight: 600; font-size: 12px; }
.ts-billable-no { color: var(--text-muted); font-size: 12px; }

.ts-grid-table th, .ts-grid-table td { text-align: center; }
.ts-grid-table th:first-child, .ts-grid-table td:first-child { text-align: left; }
.ts-grid-totalrow td { background: #fafafa; font-weight: 700; }
.ts-person-cell { display: flex; align-items: center; gap: 10px; }
.ts-people-row td:first-child { min-width: 220px; }
.ts-open-btn { flex-shrink: 0; }
.ts-approvals-table th, .ts-approvals-table td { text-align: left; }

/* ---------- Login screen ---------- */
.login-overlay {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 20% 15%, #ece7fc 0%, #f7f7f9 45%, #eef0f4 100%);
}
.login-card {
  width: 360px; background: #fff; border-radius: 16px; padding: 36px 32px;
  box-shadow: 0 24px 60px rgba(30,20,70,0.14); text-align: center;
}
.login-logo {
  width: 48px; height: 48px; border-radius: 13px; margin: 0 auto 16px;
  background: linear-gradient(135deg, var(--purple), #9b8cf5);
  color: #fff; font-weight: 800; font-size: 20px; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 20px rgba(123,104,238,0.35);
}
.login-card h1 { font-size: 20px; margin: 0 0 4px; }
.login-sub { color: var(--text-muted); font-size: 13px; margin: 0 0 24px; }
.login-card form { text-align: left; }
.login-card label { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted); margin: 14px 0 5px; }
.login-card input { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 13.5px; }
.login-card input:focus { outline: none; border-color: var(--purple); box-shadow: 0 0 0 3px rgba(123,104,238,0.12); }
.login-error { background: #fdeceb; color: var(--danger); font-size: 12.5px; padding: 8px 10px; border-radius: 7px; margin-top: 14px; }
.login-submit {
  width: 100%; margin-top: 20px; background: var(--text-dark); color: #fff; border: none;
  border-radius: 9px; padding: 11px; font-weight: 700; font-size: 14px;
}
.login-submit:hover { background: #000; }
.login-submit:disabled { opacity: .6; }
.login-divider { display: flex; align-items: center; gap: 10px; margin: 18px 0 14px; color: var(--text-muted); font-size: 11.5px; }
.login-divider::before, .login-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.login-sso-btn {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  width: 100%; padding: 10px; border: 1px solid var(--border); border-radius: 9px;
  background: #fff; color: var(--text-dark); font-weight: 600; font-size: 13.5px;
  text-decoration: none; transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.login-sso-btn svg rect { stroke: none; }
.login-sso-btn:hover { border-color: #b8b8c0; box-shadow: var(--shadow-sm); }

/* ---------- User menu (sidebar) ---------- */
.user-menu-wrap { position: relative; }
.user-chip {
  width: 30px; height: 30px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--purple); color: #fff; font-weight: 700; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
}
.user-menu {
  display: none; position: absolute; top: 38px; right: 0; width: 200px;
  background: #fff; border-radius: 10px; box-shadow: 0 12px 32px rgba(0,0,0,0.16); padding: 8px; z-index: 70;
}
.user-menu.open { display: block; }
.user-menu-name { font-weight: 700; font-size: 12.5px; padding: 6px 8px 8px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.user-menu-item { display: block; width: 100%; text-align: left; background: none; border: none; padding: 8px; border-radius: 6px; font-size: 12.5px; color: var(--text-dark); }
.user-menu-item:hover { background: #f2f2f4; }
.user-menu-logout { color: var(--danger); }

/* ---------- Notifications ---------- */
.notif-wrap { position: relative; }
.notif-bell-btn { position: relative; }
.notif-badge {
  position: absolute; top: 2px; right: 2px; background: var(--danger); color: #fff;
  font-size: 9.5px; font-weight: 700; min-width: 15px; height: 15px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; padding: 0 3px; line-height: 1;
}
.notif-dropdown {
  display: none; position: absolute; top: 38px; right: 0; width: 340px; max-height: 420px;
  background: #fff; border-radius: 12px; box-shadow: var(--shadow-lg); z-index: 70; overflow: hidden;
  flex-direction: column;
}
.notif-dropdown.open { display: flex; animation: flowdesk-fade-in .15s var(--ease); }
.notif-dropdown-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--border); font-weight: 700; font-size: 13px; flex-shrink: 0; }
.notif-mark-all { background: none; border: none; color: var(--purple-dark); font-size: 11.5px; font-weight: 600; }
.notif-mark-all:hover { text-decoration: underline; }
.notif-list { overflow-y: auto; }
.notif-item { display: flex; gap: 10px; padding: 11px 14px; border-bottom: 1px solid #f3f3f4; cursor: default; }
.notif-item.unread { background: #f6f4ff; }
.notif-item-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--purple); flex-shrink: 0; margin-top: 5px; }
.notif-item.unread .notif-item-dot { background: var(--purple); }
.notif-item:not(.unread) .notif-item-dot { background: transparent; }
.notif-item-body { flex: 1; min-width: 0; }
.notif-item-title { font-size: 12.5px; font-weight: 600; color: var(--text-dark); }
.notif-item-desc { font-size: 11.5px; color: var(--text-muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-item-time { font-size: 10.5px; color: var(--text-muted); margin-top: 3px; }

/* ---- Inbox & home pages ---- */
.inbox-list { flex: 1; overflow-y: auto; padding: 0 22px 22px; }
.ib-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: #fff; margin-bottom: 8px; cursor: pointer; }
.ib-item:hover { border-color: var(--purple); }
.ib-item.unread { background: #f6f4ff; }
.ib-dot { width: 8px; height: 8px; border-radius: 50%; background: transparent; margin-top: 7px; flex-shrink: 0; }
.ib-item.unread .ib-dot { background: var(--purple); }
.ib-main { flex: 1; min-width: 0; }
.ib-title { font-weight: 600; font-size: 13.5px; }
.ib-desc { color: var(--text-muted); font-size: 12.5px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ib-time { color: var(--text-muted); font-size: 11.5px; margin-top: 3px; }
.ib-actions { display: flex; gap: 6px; opacity: 0; }
.ib-item:hover .ib-actions { opacity: 1; }
.ib-actions button { border: 1px solid var(--border); background: #fff; border-radius: 6px; padding: 3px 9px; font-size: 11.5px; font-weight: 600; }
.ib-actions button:hover { border-color: var(--purple); color: var(--purple); }
.ib-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; }
.ib-item.resolved .ib-title { text-decoration: line-through; color: var(--text-muted); }
.hp-pill { display: inline-block; border-radius: 999px; padding: 2px 9px; font-size: 11px; font-weight: 600; color: #fff; }
.hp-chip { display: inline-block; background: #f0eefc; color: #5b4fd1; border-radius: 999px; padding: 2px 10px; font-size: 12px; margin: 2px 4px 2px 0; }
.hp-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border: 1px solid var(--border); border-radius: 10px; background: #fff; margin-bottom: 8px; }
