/* ── Reset & Base ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:           #111827;
  --bg-panel:     #1f2937;
  --bg-card:      #1f2937;
  --bg-hover:     #374151;
  --bg-row:       #1a2332;
  --bg-row-alt:   #161e2d;
  --border:       #374151;
  --text:         #f3f4f6;
  --text-muted:   #6b7280;
  --text-sub:     #9ca3af;
  --accent:       #6366f1;
  --accent-h:     #4f46e5;
  --red:          #ef4444;
  --green:        #10b981;
  --orange:       #f59e0b;
  --nav-h:        52px;
  --sidebar-w:    248px;
  --sidebar-min-w: 180px;
  --sidebar-max-w: 420px;
  --row-h:        34px;
  --radius:       10px;
  --font:         'Segoe UI', system-ui, sans-serif;
}

html, body { height: 100%; font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14px; }
.hidden { display: none !important; }
button { cursor: pointer; border: none; background: none; font-family: inherit; font-size: inherit; color: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; color: var(--text); background: var(--bg-panel); border: 1px solid var(--border); border-radius: 6px; padding: 7px 10px; outline: none; width: 100%; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
label { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; color: var(--text-sub); font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .4px; }
label input, label select, label textarea { color: var(--text); font-size: 14px; text-transform: none; }
a { color: var(--accent); text-decoration: none; }

/* ── Login ─────────────────────────────────────────────────────── */
.login-overlay { position: fixed; inset: 0; background: var(--bg); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.login-card { background: var(--bg-panel); border: 1px solid var(--border); border-radius: 16px; padding: 52px 64px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.login-logo { display: flex; align-items: center; gap: 8px; }
.wordmark { display: inline-flex; align-items: baseline; letter-spacing: -.045em; font-weight: 800; line-height: .95; }
.wordmark-dark { color: #eef2ff; }
.wordmark-accent { color: #3b82f6; }
.wordmark-lg { font-size: 46px; }
.wordmark-sm { font-size: 24px; }
.login-sub { color: var(--text-muted); font-size: 13px; margin-top: -8px; }
.btn-login { background: #2563eb; color: #fff; border-radius: 8px; padding: 11px 28px; font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; transition: background .15s; }
.btn-login:hover { background: #1d4ed8; }

/* ── App shell ──────────────────────────────────────────────────── */
.app { display: flex; height: 100vh; overflow: hidden; }

/* ── Sidebar ────────────────────────────────────────────────────── */
.sidebar { width: var(--sidebar-w); background: var(--bg-panel); border-right: 1px solid var(--border); display: flex; flex-direction: column; flex-shrink: 0; overflow: hidden; min-width: 0; transition: width .16s ease, border-color .16s ease; }
.sidebar-top { display: flex; align-items: center; justify-content: flex-start; padding: 14px 16px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.sidebar-logo { display: flex; align-items: center; gap: 8px; }
.sidebar-logo .wordmark-sm { font-size: 22px; }
.sidebar-section-nav { padding: 10px 0; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.sidebar-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 16px; color: var(--text-muted); transition: background .1s, color .1s; font-size: 12px; border-radius: 10px; margin: 0 8px; }
.sidebar-item:hover { background: var(--bg-hover); color: var(--text); }
.sidebar-item.active { background: rgba(99,102,241,.15); color: var(--accent); }
.sidebar-item--sm { font-size: 11px; padding: 6px 16px; }

/* Workspaces list */
.sidebar-workspaces-list { flex: 1; overflow-y: auto; padding: 10px 8px; }
.sidebar-ws-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; cursor: pointer; user-select: none; border-radius: 10px; transition: background .1s; margin-bottom: 2px; }
.sidebar-ws-row:hover { background: var(--bg-hover); }
.sidebar-ws-icon { font-size: 15px; flex-shrink: 0; width: 22px; text-align: center; }
.sidebar-ws-name { font-size: 11px; font-weight: 700; color: var(--text-sub); text-transform: uppercase; letter-spacing: .6px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-ws-create-btn { width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; color: var(--text-muted); opacity: 0; flex-shrink: 0; }
.sidebar-ws-row:hover .sidebar-ws-create-btn { opacity: 1; }
.sidebar-ws-create-btn:hover { background: rgba(99,102,241,.16); color: var(--text); }
.sidebar-ws-toggle { font-size: 9px; color: var(--text-muted); transition: transform .15s; margin-left: auto; flex-shrink: 0; }
.sidebar-ws-row.collapsed .sidebar-ws-toggle { transform: rotate(-90deg); }
.sidebar-ws-boards { }
.sidebar-folder-row { display: flex; align-items: center; gap: 7px; padding: 7px 10px 6px calc(20px + (var(--folder-depth, 0) * 18px)); cursor: pointer; user-select: none; color: var(--text-muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; border: 1px solid transparent; border-radius: 10px; margin: 1px 0; }
.sidebar-folder-row:hover { color: var(--text); }
.sidebar-folder-row.dragging { opacity: .45; }
.sidebar-folder-row.drag-source,
.sidebar-board-btn.drag-source { opacity: .28; transform: scale(.985); }
.sidebar-folder-toggle { font-size: 9px; transition: transform .15s; }
.sidebar-folder-row.collapsed .sidebar-folder-toggle { transform: rotate(-90deg); }
.sidebar-folder-branch.hidden { display: none; }
.sidebar-board-btn { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 10px 7px calc(28px + (var(--board-depth, 0) * 18px)); color: #c7cfdd; font-size: 12px; transition: background .1s, color .1s; border-radius: 10px; margin: 1px 0; }
.sidebar-board-btn:hover { background: var(--bg-hover); color: var(--text); }
.sidebar-board-btn.active { background: rgba(99,102,241,.18); color: #eef2ff; box-shadow: inset 0 0 0 1px rgba(99,102,241,.22); }
.sidebar-board-btn.dragging { opacity: .45; }
.sidebar-board-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex-shrink: 0; opacity: .6; }
.sidebar-root-dropzone { margin: 4px 14px 8px 28px; padding: 8px 10px; border: 1px dashed var(--border); border-radius: 8px; color: var(--text-muted); font-size: 11px; }
.sidebar-drop-target { background: rgba(99,102,241,.12); border-color: var(--accent); color: var(--text); }
.sidebar-drop-before,
.sidebar-drop-after { position: relative; background: rgba(99,102,241,.08); color: var(--text); }
.sidebar-drop-before::before,
.sidebar-drop-after::after { content: ''; position: absolute; left: 10px; right: 10px; height: 3px; border-radius: 999px; background: var(--accent); box-shadow: 0 0 0 3px rgba(99,102,241,.18); }
.sidebar-drop-before::before { top: -2px; }
.sidebar-drop-after::after { bottom: -2px; }
.sidebar-workspace-actions { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.workspace-create-menu-title { padding: 6px 10px 4px; font-size: 10px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .6px; }

/* Add workspace + footer */
.sidebar-add-ws { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 14px; color: var(--text-muted); font-size: 12px; border-top: 1px solid var(--border); transition: background .1s, color .1s; flex-shrink: 0; }
.sidebar-add-ws:hover { background: var(--bg-hover); color: var(--text); }
.sidebar-add-board-btn { display: flex; align-items: center; gap: 6px; width: 100%; padding: 5px 14px 5px 28px; color: var(--text-muted); font-size: 12px; background: none; border: none; cursor: pointer; text-align: left; }
.sidebar-add-board-btn:hover { color: var(--primary); background: var(--bg-hover); }
.user-chip { display: flex; align-items: center; gap: 8px; padding: 6px 12px; transition: background .12s; border-radius: 10px; }
.user-chip:hover { background: var(--bg-hover); }
.signout-btn { margin-left: auto; background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 2px 4px; border-radius: 4px; display: flex; align-items: center; }
.signout-btn:hover { color: var(--text); background: var(--bg-hover); }
.user-avatar { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: #fff; flex-shrink: 0; }
#userName { font-size: 12px; color: var(--text-muted); }
.sidebar-resizer { width: 10px; flex-shrink: 0; position: relative; cursor: col-resize; background: transparent; border-right: 1px solid transparent; transition: background .12s ease, border-color .12s ease; }
.sidebar-resizer:hover,
.app.sidebar-resizing .sidebar-resizer { background: rgba(99,102,241,.08); border-color: var(--border); }
.sidebar-resizer::before { content: ''; position: absolute; top: 0; bottom: 0; left: 3px; width: 4px; border-radius: 999px; background: transparent; transition: background .12s ease; }
.sidebar-resizer:hover::before,
.app.sidebar-resizing .sidebar-resizer::before { background: rgba(99,102,241,.35); }
.sidebar-resizer-toggle { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); width: 22px; height: 22px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg-panel); color: var(--text-muted); display: inline-flex; align-items: center; justify-content: center; z-index: 2; box-shadow: 0 6px 16px rgba(0,0,0,.18); }
.sidebar-resizer-toggle:hover { color: var(--text); border-color: var(--accent); }
.app.sidebar-collapsed .sidebar { width: 0; border-right-color: transparent; }
.app.sidebar-collapsed .sidebar > * { opacity: 0; pointer-events: none; }
.app.sidebar-collapsed .sidebar-resizer-toggle i { transform: rotate(180deg); }

/* ── Main area ──────────────────────────────────────────────────── */
.main-area { flex: 1; display: flex; flex-direction: column; overflow: hidden; background: linear-gradient(180deg, rgba(255,255,255,.015), rgba(255,255,255,0)); }
.top-bar { height: 48px; flex-shrink: 0; display: flex; align-items: center; justify-content: flex-end; padding: 0 20px; border-bottom: 1px solid var(--border); }
.top-bar-right { display: flex; align-items: center; gap: 10px; }
.user-chip-top { min-width: 0; border: 1px solid rgba(148,163,184,.12); background: rgba(255,255,255,.02); }
.user-chip-top #userName { color: var(--text); white-space: nowrap; }
.user-chip-top .signout-btn { margin-left: 2px; }

/* Home view */
.home-view { flex: 1; overflow-y: auto; padding: 48px 56px; }
.home-header { margin-bottom: 36px; }
.home-header h1 { font-size: 26px; font-weight: 700; margin-bottom: 6px; }
.home-sub { color: var(--text-muted); font-size: 14px; }
.home-section-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .6px; color: var(--text-muted); margin-bottom: 12px; }
.recent-list { display: flex; flex-direction: column; gap: 4px; }
.recent-item { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 6px; cursor: pointer; transition: background .1s; }
.recent-item:hover { background: var(--bg-hover); }
.recent-item-icon { width: 26px; height: 26px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0; }
.recent-item-name { font-size: 13px; }
.recent-item-ws { font-size: 11px; color: var(--text-muted); }
.my-work-list { display: flex; flex-direction: column; gap: 6px; max-width: 680px; }
.my-work-item { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 6px; background: var(--bg-card); border: 1px solid var(--border); cursor: pointer; transition: border-color .12s; }
.my-work-item:hover { border-color: var(--accent); }
.my-work-name { flex: 1; font-size: 13px; }
.my-work-board { font-size: 11px; color: var(--text-muted); }
.home-dashboard { display: grid; gap: 18px; }
.home-hero { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding: 24px 28px; border: 1px solid var(--border); border-radius: 20px; background: linear-gradient(135deg, rgba(99,102,241,.14), rgba(31,41,55,.9)); }
.home-hero-date { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-sub); margin-bottom: 10px; }
.home-hero-title { font-size: 30px; line-height: 1.1; margin-bottom: 8px; }
.home-hero-sub { color: var(--text-sub); max-width: 560px; }
.home-hero-tools { min-width: 320px; display: grid; gap: 12px; }
.home-search { display: flex; align-items: center; gap: 10px; padding: 0 12px; border: 1px solid var(--border); border-radius: 12px; background: rgba(17,24,39,.55); }
.home-search i { color: var(--text-muted); }
.home-search input { border: none; background: transparent; padding: 12px 0; }
.home-search-shortcut { font-size: 11px; color: var(--text-muted); border: 1px solid var(--border); border-radius: 8px; padding: 3px 7px; }
.home-quick-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.home-summary-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.home-summary-card { text-align: left; padding: 16px 18px; border: 1px solid var(--border); border-radius: 16px; background: var(--bg-card); display: grid; gap: 8px; }
.home-summary-card span { font-size: 12px; color: var(--text-muted); }
.home-summary-card strong { font-size: 28px; }
.home-summary-card.active { border-color: var(--accent); box-shadow: inset 0 0 0 1px rgba(99,102,241,.3); }
.home-grid { display: grid; gap: 18px; }
.home-grid-main { grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr); align-items: start; }
.home-card { border: 1px solid var(--border); border-radius: 18px; background: var(--bg-card); padding: 18px; display: grid; gap: 14px; }
.home-card-span-2 { grid-column: 1 / span 1; }
.home-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.home-card-header h2 { font-size: 18px; margin-bottom: 4px; }
.home-card-header p { color: var(--text-muted); font-size: 12px; }
.home-card-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.home-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.home-tab { padding: 6px 10px; border-radius: 999px; border: 1px solid var(--border); color: var(--text-muted); font-size: 12px; }
.home-tab.active { background: rgba(99,102,241,.14); color: var(--text); border-color: rgba(99,102,241,.45); }
.home-table-wrap { overflow: auto; }
.home-table { width: 100%; border-collapse: collapse; }
.home-table th { text-align: left; font-size: 11px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; padding: 0 0 10px; white-space: nowrap; }
.home-table td { padding: 10px 10px 10px 0; border-top: 1px solid rgba(255,255,255,.05); vertical-align: middle; }
.home-item-link { color: var(--text); font-weight: 600; text-align: left; }
.home-item-link:hover { color: var(--accent); }
.home-priority-pill { display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px; border-radius: 999px; background: rgba(255,255,255,.05); color: var(--text-sub); font-size: 12px; }
.home-empty { color: var(--text-muted); font-size: 13px; padding: 8px 0; }
.home-list,
.home-activity-list,
.home-file-list,
.home-role-list { display: grid; gap: 10px; }
.home-list-item,
.home-activity-item { width: 100%; text-align: left; padding: 12px 14px; border-radius: 14px; border: 1px solid rgba(255,255,255,.05); background: rgba(255,255,255,.02); display: grid; gap: 4px; }
.home-list-item:hover,
.home-activity-item:hover { border-color: rgba(99,102,241,.45); background: rgba(99,102,241,.08); }
.home-list-item strong,
.home-activity-item strong,
.home-file-item strong,
.home-board-card strong { font-size: 13px; }
.home-list-item span,
.home-activity-item span,
.home-activity-item small,
.home-file-item span,
.home-board-card span,
.home-role-stat span,
.home-role-stat small { color: var(--text-muted); font-size: 12px; }
.home-board-cards { display: grid; gap: 10px; }
.home-board-card,
.home-file-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 14px; border: 1px solid rgba(255,255,255,.05); background: rgba(255,255,255,.02); }
.home-board-actions { display: flex; gap: 8px; }
.home-role-stat { padding: 14px; border-radius: 14px; background: rgba(255,255,255,.03); display: grid; gap: 4px; }
.home-role-stat strong { font-size: 22px; }

/* ── Board header ───────────────────────────────────────────────── */
.board-title-group { display: flex; align-items: center; gap: 6px; }
.board-settings-btn { color: var(--text-muted); font-size: 13px; padding: 4px 6px; border-radius: 4px; transition: background .1s, color .1s; }
.board-settings-btn:hover { background: var(--bg-hover); color: var(--text); }
.board-header-actions { display: flex; align-items: center; gap: 8px; }

/* ── Dropdown menu ──────────────────────────────────────────────── */
.dropdown-menu { position: fixed; z-index: 800; background: var(--bg-panel); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.4); min-width: 200px; padding: 6px; animation: pop-in .1s ease; }
.dropdown-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 5px; font-size: 13px; cursor: pointer; color: var(--text); transition: background .1s; }
.dropdown-item:hover { background: var(--bg-hover); }
.dropdown-item.active { color: var(--accent); font-weight: 700; }
.dropdown-item i { color: var(--text-muted); font-size: 14px; width: 16px; }
.dropdown-item.danger { color: var(--red); }
.dropdown-item.danger i { color: var(--red); }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* Label suggestions */
.label-suggestions { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.label-sug { padding: 4px 12px; border-radius: 20px; border: 1px solid var(--border); font-size: 12px; cursor: pointer; color: var(--text-muted); transition: all .1s; }
.label-sug:hover { border-color: var(--accent); color: var(--accent); background: rgba(99,102,241,.1); }

/* ── Board view ─────────────────────────────────────────────────── */
.board-view { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.board-header { padding: 24px 30px 0; border-bottom: 1px solid rgba(255,255,255,.08); flex-shrink: 0; }
.board-title-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.board-title { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.btn-primary { background: var(--accent); color: #fff; border-radius: 6px; padding: 7px 16px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; transition: background .15s; font-size: 13px; white-space: nowrap; }
.btn-primary:hover { background: var(--accent-h); }
.board-tabs-bar { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.board-tabs { display: flex; gap: 4px; align-items: flex-end; }
.board-tabs-list { display: flex; gap: 4px; align-items: flex-end; }
.board-tab { padding: 8px 12px 10px; border-radius: 8px 8px 0 0; font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; border-bottom: 2px solid transparent; }
.board-tab:hover { color: var(--text); background: var(--bg-hover); }
.board-tab.active { color: var(--text); border-bottom-color: var(--accent); }
.board-tab-add { padding: 8px 9px 10px; }
.board-toolbar { display: flex; align-items: center; gap: 6px; padding-bottom: 12px; flex-wrap: wrap; }
.toolbar-btn { padding: 6px 10px; border-radius: 8px; color: var(--text-muted); font-size: 11px; display: flex; align-items: center; gap: 5px; }
.toolbar-btn:hover { background: var(--bg-hover); color: var(--text); }
.toolbar-split-create { display: inline-flex; align-items: stretch; gap: 2px; margin-right: 4px; }
.toolbar-create-btn,
.toolbar-create-caret { height: 32px; padding-top: 0; padding-bottom: 0; }
.toolbar-create-btn { border-radius: 8px 0 0 8px; }
.toolbar-create-caret { border-radius: 0 8px 8px 0; min-width: 34px; padding-left: 10px; padding-right: 10px; justify-content: center; }
.toolbar-create-caret i { font-size: 11px; }
.toolbar-search input { height: 30px; font-size: 11px; padding: 0 10px; width: 220px; border-radius: 8px; }

/* ── Table view ─────────────────────────────────────────────────── */
.view-table,
.view-kanban,
.view-calendar,
.view-timeline,
.view-form {
  contain: layout paint style;
  content-visibility: auto;
}
.view-table { flex: 1; overflow: auto; padding: 10px 18px 48px; }
.board-loading-state { min-height: 280px; display: grid; place-items: center; gap: 14px; color: var(--text-muted); padding: 48px 24px; text-align: center; }
.board-loading-state--compact { min-height: 220px; }
.board-loading-spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid rgba(255,255,255,.12); border-top-color: var(--accent); animation: board-spin .8s linear infinite; }
.board-loading-copy { font-size: 13px; color: var(--text-sub); }
.board-group {
  margin-bottom: 22px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.09);
  background: linear-gradient(180deg, rgba(255,255,255,.028), rgba(255,255,255,.012));
  box-shadow: 0 10px 28px rgba(5,10,24,.18);
}
.group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  cursor: pointer;
  user-select: none;
  border-left: 3px solid transparent;
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.02));
}
.group-header:hover { background: rgba(255,255,255,.055); }
.group-header-actions { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; opacity: 0; }
.group-header:hover .group-header-actions { opacity: 1; }
.group-action-btn { width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; color: var(--text-muted); background: transparent; }
.group-action-btn:hover { background: var(--bg-hover); color: var(--text); }
.group-action-btn.danger:hover { color: var(--red); }
.group-name { font-weight: 700; font-size: 12px; letter-spacing: -.01em; }
.group-name-editable { cursor: text; padding: 2px 4px; border-radius: 6px; transition: background .1s ease; }
.group-name-editable:hover { background: rgba(255,255,255,.05); }
.group-name-inline-input { min-width: 180px; max-width: 320px; width: auto; background: rgba(255,255,255,.04); border: 1px solid rgba(99,102,241,.38); border-radius: 8px; color: var(--text); font-size: 12px; font-weight: 700; letter-spacing: -.01em; padding: 4px 8px; }
.group-name-inline-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99,102,241,.14); }
.group-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  min-height: 22px;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 700;
  color: #dfe7f6;
  background: rgba(148,163,184,.18);
  border: 1px solid rgba(148,163,184,.18);
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}
.group-toggle { font-size: 10px; color: var(--text-muted); transition: transform .15s; }
.group-header.collapsed .group-toggle { transform: rotate(-90deg); }
.group-table-wrap {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-gutter: stable both-edges;
}
.group-table-wrap::-webkit-scrollbar {
  height: 10px;
}
.group-table-wrap::-webkit-scrollbar-thumb {
  background: rgba(148,163,184,.28);
  border-radius: 999px;
}
.group-table-wrap::-webkit-scrollbar-track {
  background: rgba(255,255,255,.03);
}

.item-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
  border: none;
  border-radius: 0 0 16px 16px;
  overflow: hidden;
  background: rgba(255,255,255,.012);
}
.item-table th { background: #20293a; color: #aab3c5; font-size: 10px; font-weight: 600; padding: 0 10px; height: 34px; text-align: left; border-bottom: 1px solid rgba(255,255,255,.08); border-right: 1px solid rgba(255,255,255,.06); white-space: nowrap; position: sticky; top: 0; z-index: 1; letter-spacing: .02em; }
.item-table th:first-child { width: 30px; border-right: none; }
.item-table td { padding: 0; height: var(--row-h); border-bottom: 1px solid rgba(255,255,255,.07); border-right: 1px solid rgba(255,255,255,.06); vertical-align: middle; white-space: nowrap; overflow: hidden; background: rgba(255,255,255,.018); }
.item-table td:first-child { border-right: none; padding: 0 8px; }
.item-table tr:hover td { background: var(--bg-hover); }
.item-table tr.item-row { cursor: pointer; }
.item-table td.td-name { border-left: 3px solid var(--group-color, #6366f1); padding: 0 10px; min-width: 280px; }
.item-table th.th-name { padding-left: 18px; }
.board-group .hidden + .item-table,
.board-group .hidden { border-top: none; }
.board-group .add-item-row td,
.board-group .subitem-wrap-cell { background: rgba(255,255,255,.014); }
.board-group:last-of-type { margin-bottom: 26px; }
.column-header-cell { padding: 0; }
.column-header-inner { display: flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 10px; }
.column-header-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.column-header-cell.cell-wrap .column-header-label { white-space: normal; overflow: visible; text-overflow: initial; line-height: 1.3; padding: 5px 0; }
.column-header-menu-btn { width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; border-radius: 4px; color: var(--text-muted); opacity: 0; flex-shrink: 0; }
.column-header-cell:hover .column-header-menu-btn { opacity: 1; }
.column-header-menu-btn:hover { background: var(--bg-hover); color: var(--text); }
.column-header-cell { position: relative; }
.column-resize-handle {
  position: absolute;
  top: 2px;
  right: -7px;
  width: 14px;
  height: calc(100% - 4px);
  cursor: col-resize;
  border-radius: 999px;
  z-index: 3;
  background: transparent;
}
.column-resize-handle::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 3px;
  height: 20px;
  border-radius: 999px;
  background: rgba(170,179,197,.28);
  transition: background .12s ease, box-shadow .12s ease;
}
.column-header-cell:hover .column-resize-handle::before,
.column-resize-handle:hover::before,
body.column-resizing .column-resize-handle::before {
  background: rgba(99,102,241,.72);
  box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}
body.column-resizing {
  cursor: col-resize;
  user-select: none;
}
.item-table td.cell-wrap { white-space: normal; }
.item-table td.cell-wrap .cell-block,
.item-table td.cell-wrap .date-cell,
.item-table td.cell-wrap .item-name-text,
.item-table td.cell-wrap .timeline-pill { white-space: normal; height: auto; min-height: 100%; line-height: 1.3; text-overflow: initial; overflow: visible; }
.column-header-menu-title { padding: 6px 10px 4px; font-size: 10px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .6px; }

.cell-block { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; font-size: 11px; font-weight: 600; color: #fff; padding: 0 8px; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-block.muted { background: #374151 !important; color: var(--text-muted); font-weight: 400; }
.cell-timeline { display: flex; align-items: center; justify-content: center; height: 100%; }
.timeline-pill { background: #374151; color: var(--text-muted); border-radius: 12px; padding: 2px 10px; font-size: 11px; }

.people-stack { display: flex; align-items: center; padding: 0 8px; }
.people-stack .avatar { width: 26px; height: 26px; border-radius: 50%; color: #fff; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; border: 2px solid var(--bg-panel); margin-left: -8px; flex-shrink: 0; cursor: pointer; transition: transform .1s; }
.people-stack .avatar:first-child { margin-left: 0; }
.people-stack .avatar:hover { transform: scale(1.15); z-index: 2; }
.people-stack .avatar.overflow { background: #374151; color: var(--text-muted); font-size: 9px; }

.date-cell { padding: 0 10px; font-size: 11px; color: var(--text); display: flex; align-items: center; height: 100%; }
.date-cell.overdue { color: var(--red); }

.item-name-cell { display: flex; align-items: center; gap: 8px; padding: 0 6px; height: 100%; }
.item-expand-btn {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: #bac6dd;
  font-size: 10px;
  flex-shrink: 0;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
}
.item-expand-btn:hover { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.12); }
.item-subcount {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  font-size: 10px;
  font-weight: 700;
  color: #d8e1f0;
  background: rgba(148,163,184,.18);
  border: 1px solid rgba(148,163,184,.16);
  border-radius: 999px;
  flex-shrink: 0;
}
.item-name-text { flex: 1; overflow: hidden; text-overflow: ellipsis; font-size: 12px; color: #f3f6fd; }
.item-row-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0;
  margin-left: 6px;
  padding: 2px 4px;
  border-radius: 999px;
  background: rgba(17,24,39,.42);
  border: 1px solid rgba(255,255,255,.05);
  flex-shrink: 0;
  transition: opacity .12s ease, background .12s ease, border-color .12s ease;
}
tr:hover .item-row-actions {
  opacity: 1;
  background: rgba(17,24,39,.72);
  border-color: rgba(148,163,184,.18);
}
.row-action-btn {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #c6d0e0;
  font-size: 12px;
}
.row-action-btn:hover { background: rgba(255,255,255,.1); color: #fff; }

.subitem-rows { display: none; }
.subitem-rows.expanded { display: table-row-group; }
.subitem-wrap-row td { border-bottom: none; background: transparent; }
.subitem-wrap-cell {
  padding: 8px 0 10px !important;
  border-right: none !important;
  background: transparent !important;
  text-align: left;
}
.subitem-panel {
  display: inline-block;
  width: min(560px, calc(100% - 140px));
  margin: 0 0 0 34px;
  border-left: 3px solid rgba(99,102,241,.6);
  border: 1px solid rgba(255,255,255,.08);
  border-left-width: 3px;
  border-radius: 0 14px 14px 14px;
  background: linear-gradient(180deg, rgba(59,69,92,.96), rgba(37,47,67,.96));
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(4,10,24,.28), inset 0 1px 0 rgba(255,255,255,.04);
}
.subitem-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.subitem-table th {
  height: 30px;
  padding: 0 10px;
  font-size: 10px;
  font-weight: 600;
  color: #aab4c6;
  background: rgba(255,255,255,.035);
  border-bottom: 1px solid rgba(255,255,255,.08);
  border-right: 1px solid rgba(255,255,255,.06);
}
.subitem-table td {
  height: 34px;
  padding: 0 10px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  border-right: 1px solid rgba(255,255,255,.06);
  background: rgba(255,255,255,.02);
}
.subitem-table th:last-child,
.subitem-table td:last-child { border-right: none; }
.subitem-table th:nth-child(2) { width: auto; }
.subitem-inline-input,
.subitem-add-input { width: 100%; border: none; background: transparent; color: var(--text); font-size: 12px; padding: 0; }
.subitem-inline-input:focus,
.subitem-add-input:focus { outline: none; }
.subitem-add-branch {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0 4px 2px;
}
.subitem-add-branch-icon {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(174,187,208,.9);
  flex-shrink: 0;
  font-size: 14px;
}
.subitem-add-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  width: min(260px, calc(100% - 28px));
  color: var(--text-muted);
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}
.subitem-add-inline:focus-within {
  color: var(--text);
}
.subitem-add-inline i { color: rgba(174,187,208,.9); }
.subitem-add-input {
  color: var(--text-muted);
}
.subitem-add-input::placeholder {
  color: rgba(174,187,208,.88);
}
.subitem-add-inline:focus-within .subitem-add-input {
  color: var(--text);
}
.subitem-row td.td-name { border-left-color: transparent; padding-left: 32px; }
.subitem-row td { background: var(--bg-row-alt); }
.subitem-row:hover td { background: var(--bg-hover); }

.add-item-row td { color: var(--text-muted); font-size: 11px; padding: 7px 12px; }
.add-item-row td.td-name { padding-left: 14px; }
.add-item-row:hover td,
.add-item-row.active td { background: var(--bg-hover); color: var(--text); }
.add-item-inline { display: flex; align-items: center; gap: 10px; min-height: 34px; }
.add-item-inline i { color: var(--text-muted); }
.add-item-inline-input { flex: 1; border: none; background: transparent; color: var(--text); font-size: 12px; padding: 6px 0; min-width: 0; }
.add-item-inline-input:focus { outline: none; }
.add-item-inline-input::placeholder { color: var(--text-muted); }
.add-item-inline-btn { padding: 6px 10px; border-radius: 8px; border: 1px solid var(--border); color: var(--text-muted); font-size: 11px; }
.add-item-inline-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); background: rgba(99,102,241,.08); }
.add-item-inline-btn:disabled { opacity: .55; cursor: default; }
.group-drop-target { box-shadow: inset 0 0 0 2px rgba(99,102,241,.35); background: rgba(99,102,241,.08); }
.add-group-btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 14px; color: var(--text-muted); font-size: 12px; border: 1px solid rgba(255,255,255,.08); border-radius: 10px; margin-left: 2px; background: rgba(255,255,255,.02); }
.add-group-btn:hover { color: var(--text); background: var(--bg-hover); }

/* ── Kanban ──────────────────────────────────────────────────────── */
.view-kanban { flex: 1; overflow-x: auto; padding: 20px 24px; }
.view-calendar { flex: 1; overflow: auto; padding: 20px 24px 40px; }
.view-timeline { flex: 1; overflow: auto; padding: 20px 24px 40px; }
.view-form { flex: 1; overflow: auto; padding: 20px 24px 40px; }
.kanban-board { display: flex; gap: 14px; align-items: flex-start; }
.kanban-col { background: var(--bg-panel); border-radius: var(--radius); width: 260px; flex-shrink: 0; display: flex; flex-direction: column; max-height: calc(100vh - 200px); }

@keyframes board-spin {
  to { transform: rotate(360deg); }
}
.kanban-col-header { padding: 12px 14px; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--border); }
.kanban-col-count { background: var(--bg-hover); border-radius: 10px; padding: 1px 7px; font-size: 11px; color: var(--text-muted); }
.kanban-items { flex: 1; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.kanban-card { background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px; cursor: pointer; transition: border-color .12s; }
.kanban-card:hover { border-color: var(--accent); }
.kanban-card-name { font-size: 13px; margin-bottom: 8px; }
.kanban-card-meta { display: flex; align-items: center; justify-content: space-between; }
.kanban-card-date { font-size: 11px; color: var(--text-muted); }

/* ── Modals ──────────────────────────────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 500; display: flex; align-items: center; justify-content: center; }
.modal-panel { background: var(--bg-panel); border: 1px solid var(--border); border-radius: 12px; display: flex; flex-direction: column; max-height: 90vh; overflow: hidden; width: 860px; max-width: 95vw; }
.modal-panel--sm { width: 440px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); gap: 12px; font-weight: 600; font-size: 15px; }
.modal-title-input { flex: 1; background: transparent; border: none; font-size: 18px; font-weight: 700; color: var(--text); padding: 0; }
.modal-title-input:focus { outline: none; border-bottom: 2px solid var(--accent); }
.modal-close { color: var(--text-muted); font-size: 18px; padding: 4px 6px; border-radius: 4px; }
.modal-close:hover { background: var(--bg-hover); color: var(--text); }
.modal-body { display: flex; flex: 1; overflow: hidden; }
.modal-panel--sm .modal-body { display: block; padding: 20px; overflow-y: auto; }
.modal-fields { flex: 1; padding: 20px; overflow-y: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-content: start; }
.modal-field { display: flex; flex-direction: column; gap: 4px; }
.modal-field label { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); margin-bottom: 0; }
.modal-field select, .modal-field input[type=date], .modal-field input[type=text] { width: 100%; }
.modal-field textarea { width: 100%; resize: vertical; min-height: 70px; }
.field-full { grid-column: 1 / -1; }
.modal-activity { width: 280px; background: var(--bg); border-left: 1px solid var(--border); padding: 16px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; flex-shrink: 0; }
.modal-activity h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); }
.activity-item { font-size: 12px; color: var(--text-muted); padding: 8px 0; border-bottom: 1px solid var(--border); }
.activity-item .activity-author { font-weight: 600; color: var(--text); }
.activity-compose { display: flex; flex-direction: column; gap: 6px; margin-top: auto; padding-top: 10px; }
.activity-compose textarea { min-height: 60px; font-size: 13px; }

/* Icon picker */
.icon-picker { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.icon-opt { width: 36px; height: 36px; border-radius: 8px; border: 2px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 18px; cursor: pointer; transition: border-color .1s; }
.icon-opt:hover, .icon-opt.selected { border-color: var(--accent); background: rgba(99,102,241,.1); }

/* ── Person Popover ─────────────────────────────────────────────── */
.person-popover { position: fixed; z-index: 900; background: var(--bg-panel); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.5); width: 220px; overflow: hidden; animation: pop-in .1s ease; }
.people-picker   { position: fixed; z-index: 900; background: var(--bg-panel); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.5); width: 240px; padding: 8px; animation: pop-in .1s ease; }
@keyframes pop-in { from { opacity:0; transform:scale(.95) translateY(-4px); } to { opacity:1; transform:scale(1) translateY(0); } }
.person-popover-header { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.person-popover-avatar { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 700; color: #fff; flex-shrink: 0; }
.person-popover-name  { font-weight: 700; font-size: 13px; }
.person-popover-email { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.person-popover-actions { padding: 6px; }
.person-popover-btn { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 10px; border-radius: 6px; color: var(--text); font-size: 13px; transition: background .1s; }
.person-popover-btn:hover { background: var(--bg-hover); }
.person-popover-btn i { color: var(--text-muted); font-size: 14px; width: 16px; text-align: center; }
.person-popover-btn.danger { color: var(--red); }
.person-popover-btn.danger i { color: var(--red); }
.people-picker-search { width: 100%; margin-bottom: 6px; }
.people-picker-list { max-height: 200px; overflow-y: auto; }
.people-picker-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 5px; cursor: pointer; transition: background .1s; }
.people-picker-row:hover { background: var(--bg-hover); }
.people-picker-row .avatar { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: #fff; flex-shrink: 0; }
.people-picker-row .check { margin-left: auto; color: var(--accent); }
.people-picker-row .pname { font-size: 13px; }

/* ── Cell Pickers ───────────────────────────────────────────────── */
.cell-clickable { cursor: pointer; }
.cell-clickable:hover .cell-block { opacity: .85; }
.cell-clickable:hover .date-cell { background: var(--bg-hover); }
.cell-empty { color: var(--text-muted); opacity: .4; font-size: 12px; }

.cell-picker { position: fixed; z-index: 900; background: var(--bg-panel); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 28px rgba(0,0,0,.55); min-width: 180px; overflow: hidden; animation: pop-in .1s ease; }
.cell-picker--date { padding: 10px; min-width: 0; }
.cell-pick-opt { display: flex; align-items: center; padding: 9px 14px; cursor: pointer; font-size: 13px; color: #fff; font-weight: 600; transition: opacity .1s; gap: 6px; }
.cell-pick-opt:hover { opacity: .82; }
.cell-pick-check { margin-left: auto; font-size: 15px; }
.cell-pick-clear { padding: 7px 14px; font-size: 12px; color: var(--text-muted); cursor: pointer; border-top: 1px solid var(--border); text-align: center; }
.cell-pick-clear:hover { color: var(--text); background: var(--bg-hover); }
.cell-date-input { display: block; width: 100%; margin-bottom: 4px; }

/* ── Admin Center ───────────────────────────────────────────────── */
.admin-view { padding: 32px 40px; overflow-y: auto; height: 100%; }
.admin-header h1 { font-size: 22px; font-weight: 700; margin-bottom: 20px; }
.admin-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.admin-tab { background: none; border: none; color: var(--text-muted); padding: 8px 16px; cursor: pointer; font-size: 13px; font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; display: flex; align-items: center; gap: 6px; }
.admin-tab.active { color: var(--text); border-bottom-color: var(--primary); }
.admin-tab:hover { color: var(--text); }
.admin-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.admin-toolbar input { flex: 1; max-width: 280px; background: var(--bg-panel); border: 1px solid var(--border); color: var(--text); border-radius: 6px; padding: 7px 12px; font-size: 13px; }
.admin-toolbar input:focus { outline: none; border-color: var(--primary); }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th { text-align: left; padding: 8px 14px; color: var(--text-muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; border-bottom: 1px solid var(--border); }
.admin-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--bg-hover); }
.admin-row-inactive td { opacity: .5; }
.admin-user-cell { display: flex; align-items: center; gap: 10px; }
.admin-email { color: var(--text-muted); font-size: 12px; }
.admin-you-badge { background: var(--bg-hover); color: var(--text-muted); font-size: 10px; padding: 1px 6px; border-radius: 10px; font-weight: 600; }
.admin-role-select { background: var(--bg-hover); border: 1px solid var(--border); color: var(--text); border-radius: 5px; padding: 4px 8px; font-size: 12px; cursor: pointer; }
.admin-role-select:disabled { opacity: .5; cursor: not-allowed; }
.field-lock-note { color: var(--text-muted); font-size: 11px; font-weight: 600; }
.cell-locked { opacity: .72; }
.cell-locked .cell-block,
.cell-locked .date-cell,
.cell-locked .cell-checkbox,
.cell-locked .item-name-cell { box-shadow: inset 0 0 0 1px rgba(255,255,255,.05); }
.column-settings-lock-toggle { justify-content: center; }
.column-settings-role-select { display: grid; gap: 4px; font-size: 11px; color: var(--text-muted); }
.column-settings-role-select select:disabled { opacity: .55; cursor: not-allowed; }
.permissions-header { margin-bottom: 20px; }
.permissions-header strong { display: block; font-size: 18px; color: var(--text); margin-bottom: 4px; }
.permissions-header p { color: var(--text-muted); font-size: 12px; }
.permissions-section { display: grid; gap: 12px; margin-bottom: 20px; }
.permissions-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.permissions-section-head h3 { font-size: 14px; margin-bottom: 4px; }
.permissions-section-head p { color: var(--text-muted); font-size: 12px; }
.permissions-inline-add { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 340px; justify-content: flex-end; }
.permissions-inline-add select { min-width: 130px; }
.permissions-list { display: grid; gap: 10px; }
.permission-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 14px; border: 1px solid rgba(255,255,255,.07); border-radius: 14px; background: rgba(255,255,255,.02); }
.permission-user { display: flex; align-items: center; gap: 12px; min-width: 0; }
.permission-user-copy { min-width: 0; display: grid; gap: 2px; }
.permission-user-copy strong { font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.permission-user-copy span { font-size: 11px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.permission-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.permission-actions select { min-width: 120px; }
.permission-pill { display: inline-flex; align-items: center; min-height: 26px; padding: 0 10px; border-radius: 999px; background: rgba(99,102,241,.12); color: #dfe5ff; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.permission-remove-btn { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; color: var(--text-muted); border: 1px solid rgba(255,255,255,.08); }
.permission-remove-btn:hover { color: #fff; border-color: rgba(226,68,92,.35); background: rgba(226,68,92,.12); }
.admin-status-badge { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 10px; }
.admin-status-active { background: rgba(0,200,117,.15); color: #00c875; }
.admin-status-inactive { background: rgba(226,68,92,.15); color: #e2445c; }
.admin-action-btn { background: none; border: 1px solid var(--border); color: var(--text-muted); padding: 4px 10px; border-radius: 5px; font-size: 12px; cursor: pointer; }
.admin-action-btn:hover { border-color: var(--text-muted); color: var(--text); }

/* ── Context Menu ───────────────────────────────────────────────── */
.context-menu {
  position: fixed;
  z-index: 9999;
  background: linear-gradient(180deg, rgba(27,34,49,.98), rgba(18,24,37,.98));
  border: 1px solid rgba(148,163,184,.16);
  border-radius: 12px;
  box-shadow: 0 18px 42px rgba(0,0,0,.52);
  min-width: 236px;
  padding: 8px;
  animation: pop-in .1s ease;
  backdrop-filter: blur(10px);
}
.ctx-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text);
  justify-content: flex-start;
  border-radius: 8px;
}
.ctx-item i:first-child { width: 16px; color: #aebbd0; flex-shrink: 0; }
.ctx-item span { flex: 1; }
.ctx-item:hover { background: rgba(99,102,241,.14); }
.ctx-item.ctx-danger { color: #e2445c; }
.ctx-item.ctx-danger i { color: #e2445c; }
.ctx-item.ctx-disabled { opacity: .45; pointer-events: none; }
.ctx-arrow { margin-left: auto; color: var(--text-muted); font-size: 11px; }
.ctx-divider { border-top: 1px solid rgba(148,163,184,.12); margin: 6px 2px; }

/* ── Inline cell editing ─────────────────────────────────────────── */
.cell-edit-input { background: var(--bg-panel); border: 1px solid var(--primary); border-radius: 3px; color: var(--text); font-size: 13px; padding: 2px 6px; width: 100%; outline: none; }
.item-name-text { cursor: text; }
.item-row td:last-child div[ondblclick] { cursor: text; }

/* ── Row menu (three-dots) ──────────────────────────────────────── */
.row-menu-cell { width: 36px; text-align: center; }
.row-menu-btn { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 2px 6px; border-radius: 4px; opacity: .75; transition: opacity .1s; font-size: 14px; }
.item-row:hover .row-menu-btn { opacity: 1; }
.row-menu-btn:hover { background: var(--bg-hover); color: var(--text); }

/* ── Drag and drop ──────────────────────────────────────────────── */
.item-row { cursor: grab; }
.item-row.dragging { opacity: .08; }
.item-row.drag-source { opacity: .14; transform: scale(.992); }
.item-row.drag-target-before td { border-top: 3px solid var(--primary) !important; box-shadow: inset 0 8px 0 rgba(99,102,241,.08); }
.item-row.drag-target-after td { border-bottom: 3px solid var(--primary) !important; box-shadow: inset 0 -8px 0 rgba(99,102,241,.08); }
.item-row-placeholder td { padding: 0 !important; border-right: 1px solid var(--border); border-bottom: 1px solid transparent; background: transparent !important; }
.item-row-placeholder-inner { height: calc(var(--row-h) - 6px); margin: 3px 8px; border-radius: 10px; border: 2px dashed rgba(99,102,241,.55); background: rgba(99,102,241,.12); box-shadow: inset 0 0 0 1px rgba(99,102,241,.08); }
.item-row td { cursor: default; }
.item-row .td-name { cursor: grab; }
.item-name-text { cursor: text; }

/* ── Item Drawer (side panel) ────────────────────────────────────── */
.drawer-overlay { position: fixed; inset: 0; z-index: 500; display: flex; justify-content: flex-end; background: rgba(0,0,0,.45); }
.drawer-overlay.hidden { display: none; }
.item-drawer { width: 680px; max-width: 95vw; height: 100%; background: var(--bg-panel); border-left: 1px solid var(--border); display: flex; flex-direction: column; overflow: hidden; box-shadow: -4px 0 32px rgba(0,0,0,.45); animation: drawer-in .15s ease; }
@keyframes drawer-in { from { transform: translateX(40px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.drawer-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.drawer-header-actions { display: inline-flex; align-items: center; gap: 10px; }
.drawer-breadcrumb { font-size: 12px; color: var(--text-muted); }
.drawer-secondary-btn { display: inline-flex; align-items: center; gap: 6px; background: var(--bg-hover); border: 1px solid var(--border); color: var(--text); padding: 7px 12px; border-radius: 8px; font-size: 12px; cursor: pointer; }
.drawer-secondary-btn:hover { border-color: var(--primary); color: var(--primary); }
.drawer-title-input { width: 100%; background: transparent; border: none; font-size: 20px; font-weight: 700; color: var(--text); padding: 14px 20px 10px; flex-shrink: 0; }
.drawer-title-input:focus { outline: none; border-bottom: 2px solid var(--accent); }
.drawer-tabs { display: flex; align-items: center; gap: 4px; padding: 0 20px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.drawer-tab { padding: 10px 4px; margin-right: 14px; border-bottom: 2px solid transparent; color: var(--text-muted); font-size: 13px; }
.drawer-tab.active { color: var(--text); border-bottom-color: var(--accent); }
.drawer-tab:hover { color: var(--text); }
.drawer-body { flex: 1; overflow-y: auto; padding: 0 20px 24px; display: flex; flex-direction: column; gap: 20px; }
.drawer-tab-panel.active { display: flex; flex-direction: column; gap: 14px; }
.drawer-file-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: rgba(255,255,255,.02); }
.drawer-file-meta { display: flex; align-items: center; gap: 10px; min-width: 0; }
.drawer-file-icon { width: 32px; height: 32px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; background: rgba(99,102,241,.16); color: var(--text); flex-shrink: 0; }
.drawer-file-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.drawer-file-name { font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drawer-file-field { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; }
.drawer-file-link { font-size: 12px; color: var(--accent); }
.drawer-empty { padding: 18px 0; color: var(--text-muted); font-size: 12px; }
#drawerUpdatesPanel { display: flex; flex-direction: column; gap: 16px; }
#activityFeed { display: grid; gap: 12px; }
.activity-compose {
  order: -1;
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(148,163,184,.12);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.015));
}
.activity-compose-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.activity-compose-head strong { display: block; font-size: 14px; color: var(--text); margin-bottom: 4px; }
.activity-compose-head span { display: block; font-size: 12px; color: var(--text-muted); }
.activity-compose textarea {
  min-height: 92px;
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
  border-radius: 12px;
  padding: 12px 14px;
  background: rgba(10,15,25,.55);
  border: 1px solid rgba(148,163,184,.14);
}
.activity-compose textarea:focus {
  outline: none;
  border-color: rgba(99,102,241,.5);
  box-shadow: 0 0 0 3px rgba(99,102,241,.14);
}
.activity-compose-row { display: flex; justify-content: flex-end; }
.activity-item {
  font-size: 12px;
  color: var(--text-muted);
  border: 1px solid rgba(148,163,184,.1);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,.028), rgba(255,255,255,.012));
  overflow: hidden;
}
.activity-item-shell { display: flex; align-items: flex-start; gap: 12px; padding: 14px; }
.activity-avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #5b8cff, #7a5cff);
  border: 2px solid rgba(255,255,255,.08);
}
.activity-item-main { flex: 1; min-width: 0; display: grid; gap: 8px; }
.activity-item-head { display: flex; align-items: flex-start; gap: 10px; }
.activity-item-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.activity-item .activity-author { font-weight: 700; color: var(--text); }
.activity-time { font-size: 11px; color: var(--text-muted); }
.activity-item-tag {
  align-self: flex-start;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #d8e1f5;
  background: rgba(99,102,241,.14);
  border: 1px solid rgba(99,102,241,.22);
}
.activity-item .activity-copy {
  color: var(--text);
  line-height: 1.55;
  white-space: pre-wrap;
  background: rgba(255,255,255,.028);
  border: 1px solid rgba(148,163,184,.08);
  border-radius: 12px;
  padding: 12px 14px;
}
.activity-delete-btn { width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; color: var(--text-muted); flex-shrink: 0; }
.activity-delete-btn:hover { background: var(--bg-hover); color: #e2445c; }
.activity-log-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.activity-log-item:last-child { border-bottom: none; }
.activity-log-icon { width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: rgba(99,102,241,.14); color: var(--accent); flex-shrink: 0; }
.activity-log-text { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-muted); }
.activity-log-text strong { color: var(--text); }
.activity-log-row { display: flex; align-items: flex-start; gap: 10px; width: 100%; }
.drawer-section { display: flex; flex-direction: column; gap: 8px; }
.drawer-section-label { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--text-muted); font-weight: 600; padding: 4px 0 2px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.drawer-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.drawer-field { display: flex; flex-direction: column; gap: 4px; }
.drawer-field label { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); }
.drawer-field select, .drawer-field input[type=date], .drawer-field input[type=text] { width: 100%; }
.drawer-subitem { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; background: var(--bg); border: 1px solid var(--border); }
.drawer-subitem:hover { border-color: var(--border); background: var(--bg-hover); }
.subitem-check { width: 16px; height: 16px; border: 2px solid var(--border); border-radius: 4px; flex-shrink: 0; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 10px; }
.subitem-check.done { background: var(--green); border-color: var(--green); color: #fff; }
.subitem-name { flex: 1; background: transparent; border: none; color: var(--text); font-size: 13px; }
.subitem-name:focus { outline: none; }
.subitem-name.done { text-decoration: line-through; color: var(--text-muted); }
.subitem-delete { opacity: 0; color: var(--text-muted); font-size: 13px; padding: 2px 5px; border-radius: 4px; }
.drawer-subitem:hover .subitem-delete { opacity: 1; }
.subitem-delete:hover { background: var(--bg-hover); color: #e2445c; }
.drawer-add-btn { background: none; border: 1px dashed var(--border); color: var(--text-muted); padding: 7px 14px; border-radius: 6px; font-size: 13px; cursor: pointer; text-align: left; transition: border-color .1s, color .1s; }
.drawer-add-btn:hover { border-color: var(--primary); color: var(--text); }
.activity-feed { display: flex; flex-direction: column; gap: 8px; }
.activity-entry { font-size: 12px; color: var(--text-muted); }
.activity-entry strong { color: var(--text); font-weight: 600; }

/* ── Selection Toolbar ───────────────────────────────────────────── */
.selection-toolbar { display: flex; align-items: center; gap: 12px; background: #1a1d2e; color: #fff; padding: 10px 20px; border-bottom: 1px solid rgba(255,255,255,.1); flex-shrink: 0; animation: selToolbarIn .15s ease; }
.selection-toolbar.hidden { display: none; }
@keyframes selToolbarIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
.selection-toolbar-left { display: flex; align-items: center; gap: 10px; min-width: 160px; }
.selection-count-badge { background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; border-radius: 12px; padding: 2px 8px; min-width: 24px; text-align: center; }
.selection-label { font-size: 13px; font-weight: 500; color: rgba(255,255,255,.8); white-space: nowrap; }
.selection-toolbar-actions { display: flex; align-items: center; gap: 2px; flex: 1; flex-wrap: wrap; }
.sel-action-btn { display: flex; align-items: center; gap: 5px; padding: 6px 12px; border-radius: 6px; font-size: 12px; font-weight: 500; color: rgba(255,255,255,.85); background: transparent; transition: background .12s, color .12s; white-space: nowrap; }
.sel-action-btn:hover { background: rgba(255,255,255,.12); color: #fff; }
.sel-action-btn.sel-action-danger:hover { background: rgba(255,80,80,.25); color: #ff6b6b; }
.sel-dismiss-btn { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; color: rgba(255,255,255,.6); background: transparent; flex-shrink: 0; transition: background .12s, color .12s; margin-left: auto; }
.sel-dismiss-btn:hover { background: rgba(255,255,255,.15); color: #fff; }
.row-check-cell { width: 36px; text-align: center; }
.row-check-cell input[type="checkbox"], .group-select-all-check { cursor: pointer; accent-color: var(--accent); width: 15px; height: 15px; }
.item-select-check { opacity: 0; transition: opacity .1s; }
.item-select-check:checked { opacity: 1; }
.item-row:hover .item-select-check { opacity: 1; }
.item-row.row-selected { background: rgba(0, 115, 234, .08); }
.item-row.row-selected .item-select-check { opacity: 1; }

/* ── Filter Panel ────────────────────────────────────────────────── */
.filter-panel { background: var(--bg-panel); border-bottom: 1px solid var(--border); padding: 10px 20px 12px; display: flex; flex-direction: column; gap: 8px; }
.filter-panel.hidden { display: none; }
.filter-panel-header { display: flex; align-items: center; justify-content: space-between; font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; }
.filter-clear-btn { font-size: 11px; color: var(--primary); background: none; border: none; cursor: pointer; padding: 2px 6px; border-radius: 4px; }
.filter-clear-btn:hover { background: rgba(99,102,241,.12); }
.filter-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filter-label { font-size: 12px; color: var(--text-muted); min-width: 60px; }
.filter-pills { display: flex; gap: 4px; flex-wrap: wrap; }
.filter-pill { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 12px; border: 2px solid transparent; cursor: pointer; transition: opacity .1s, border-color .1s; opacity: .55; }
.filter-pill.active { opacity: 1; border-color: rgba(255,255,255,.35); }
.filter-pill:hover { opacity: .85; }
.column-settings-note { margin-bottom: 14px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: rgba(255,255,255,.03); color: var(--text-sub); font-size: 12px; line-height: 1.45; }
.column-settings-list { display: grid; gap: 10px; margin-bottom: 16px; }
.column-settings-row { display: grid; grid-template-columns: minmax(0, 1.4fr) auto auto auto; gap: 12px; align-items: start; padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: rgba(255,255,255,.02); }
.column-settings-row.focused { border-color: var(--accent); box-shadow: 0 0 0 1px rgba(99,102,241,.28); background: rgba(99,102,241,.08); }
.column-settings-type { font-size: 12px; color: var(--text-muted); text-transform: capitalize; }
.column-settings-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text); }
.column-settings-duplicate { display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; border-radius: 8px; border: 1px solid var(--border); color: var(--text); font-size: 12px; white-space: nowrap; }
.column-settings-duplicate:hover { border-color: var(--accent); color: var(--accent); background: rgba(99,102,241,.08); }
.column-settings-add { display: flex; justify-content: flex-start; }
.column-settings-options { grid-column: 1 / -1; min-height: 92px; resize: vertical; }
.column-settings-options-editor { grid-column: 1 / -1; display: grid; gap: 10px; }
.column-settings-options-list { display: grid; gap: 8px; }
.column-option-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) 50px 34px; gap: 10px; align-items: center; padding: 6px 8px; border: 1px solid transparent; border-radius: 10px; }
.column-option-row.dragging { opacity: .45; }
.column-option-row.drag-over { border-color: var(--accent); background: rgba(99,102,241,.08); }
.column-option-drag { width: 28px; height: 28px; border-radius: 8px; color: var(--text-muted); display: inline-flex; align-items: center; justify-content: center; cursor: grab; }
.column-option-drag:hover { color: var(--text); background: rgba(255,255,255,.05); }
.column-option-drag:active { cursor: grabbing; }
.column-option-label { width: 100%; }
.column-option-color-wrap { width: 50px; height: 36px; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: rgba(255,255,255,.03); }
.column-option-color { width: 100%; height: 100%; padding: 0; border: none; background: transparent; cursor: pointer; }
.column-option-remove { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--border); color: var(--text-muted); display: inline-flex; align-items: center; justify-content: center; }
.column-option-remove:hover { color: #ff8f8f; border-color: rgba(226,68,92,.45); background: rgba(226,68,92,.08); }
.column-option-add { justify-self: start; display: inline-flex; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 8px; border: 1px dashed var(--border); color: var(--text); font-size: 12px; }
.column-option-add:hover { border-color: var(--accent); background: rgba(99,102,241,.08); color: var(--accent); }
.column-template-picker { margin-top: 16px; border: 1px solid var(--border); border-radius: 14px; background: #252844; overflow: hidden; }
.column-template-picker.hidden { display: none; }
.column-template-search-wrap { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid rgba(255,255,255,.08); background: rgba(255,255,255,.02); }
.column-template-search-wrap i { color: var(--text-muted); }
.column-template-search-wrap input { border: none; background: transparent; color: var(--text); width: 100%; outline: none; font-size: 14px; }
.column-template-list { padding: 14px 16px 18px; display: grid; gap: 18px; }
.column-template-group-title { font-size: 12px; color: rgba(255,255,255,.58); text-transform: uppercase; letter-spacing: .05em; }
.column-template-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
.column-template-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid rgba(255,255,255,.08); background: rgba(255,255,255,.03); color: var(--text); cursor: pointer; text-align: left; }
.column-template-item:hover { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.16); }
.column-template-item.disabled { opacity: .55; cursor: not-allowed; }
.column-template-icon { width: 22px; height: 22px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; color: #fff; flex-shrink: 0; font-size: 12px; }
.column-template-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.column-template-label { font-size: 13px; font-weight: 700; color: #fff; }
.column-template-desc { font-size: 11px; color: rgba(255,255,255,.58); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.column-template-badge { margin-left: auto; font-size: 10px; font-weight: 700; color: rgba(255,255,255,.7); border: 1px solid rgba(255,255,255,.18); border-radius: 999px; padding: 2px 7px; }
.column-template-empty { padding: 8px 0 0; font-size: 13px; color: rgba(255,255,255,.58); }
.column-template-footer { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid rgba(255,255,255,.08); }
.column-template-footer-btn { border: none; background: transparent; color: rgba(255,255,255,.72); padding: 12px 14px; text-align: center; font-size: 12px; font-weight: 700; cursor: pointer; }
.column-template-footer-btn + .column-template-footer-btn { border-left: 1px solid rgba(255,255,255,.08); }
.column-template-footer-btn:hover { background: rgba(255,255,255,.05); color: #fff; }
.modal-subitem-row { display: grid; grid-template-columns: minmax(0, 1.6fr) 1fr auto; gap: 10px; margin-bottom: 10px; }
.modal-subitem-row input,
.modal-subitem-row select { width: 100%; }
.calendar-shell,
.timeline-shell { background: var(--bg-panel); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.form-builder-shell { background: linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,.01)); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; min-height: calc(100vh - 220px); display: flex; flex-direction: column; }
.form-builder-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 18px; border-bottom: 1px solid var(--border); background: rgba(255,255,255,.02); }
.form-builder-tabs { display: inline-flex; align-items: center; gap: 6px; }
.form-builder-tab { padding: 8px 12px; border-radius: 8px; border: 1px solid transparent; color: var(--text-muted); font-size: 12px; font-weight: 700; }
.form-builder-tab:hover { background: var(--bg-hover); color: var(--text); }
.form-builder-tab.active { background: rgba(99,102,241,.12); border-color: rgba(99,102,241,.25); color: var(--text); }
.form-builder-actions { display: inline-flex; align-items: center; gap: 10px; }
.form-builder-body { display: grid; grid-template-columns: 300px minmax(0, 1fr); flex: 1; min-height: 0; }
.form-builder-sidebar { border-right: 1px solid var(--border); padding: 18px 16px; background: rgba(255,255,255,.015); overflow-y: auto; }
.form-builder-main { padding: 26px; overflow-y: auto; }
.form-sidebar-title { font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 12px; }
.form-sidebar-stack { display: grid; gap: 10px; }
.form-sidebar-card { padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: rgba(255,255,255,.02); }
.form-sidebar-card strong { display: block; font-size: 13px; color: var(--text); margin-bottom: 4px; }
.form-sidebar-card span { display: block; font-size: 11px; color: var(--text-muted); }
.form-sidebar-add { margin-top: 16px; display: grid; gap: 8px; }
.form-sidebar-add-btn { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-radius: 10px; border: 1px dashed var(--border); color: var(--text); font-size: 12px; }
.form-sidebar-add-btn:hover { border-color: var(--accent); background: rgba(99,102,241,.08); }
.form-editor-header { margin-bottom: 18px; }
.form-editor-header h2 { font-size: 28px; line-height: 1.15; margin-bottom: 6px; }
.form-editor-header p { color: var(--text-muted); max-width: 680px; }
.form-welcome-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px; border: 1px solid var(--border); border-radius: 16px; background: rgba(255,255,255,.03); margin-bottom: 18px; }
.form-welcome-copy strong { display: block; font-size: 22px; margin-bottom: 6px; }
.form-card-list { display: grid; gap: 14px; }
.form-field-card { padding: 16px; border-radius: 14px; border: 1px solid var(--border); background: rgba(10,15,35,.35); display: grid; gap: 14px; }
.form-field-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.form-field-card-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.form-field-icon { width: 24px; height: 24px; border-radius: 8px; background: rgba(99,102,241,.15); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.form-field-title-copy { min-width: 0; }
.form-field-title-copy strong { display: block; font-size: 14px; color: var(--text); }
.form-field-title-copy span { display: block; font-size: 11px; color: var(--text-muted); }
.form-field-actions { display: inline-flex; align-items: center; gap: 6px; }
.form-field-actions button { width: 28px; height: 28px; border-radius: 8px; color: var(--text-muted); display: inline-flex; align-items: center; justify-content: center; }
.form-field-actions button:hover { background: var(--bg-hover); color: var(--text); }
.form-field-actions button.danger:hover { color: #e2445c; }
.form-field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-field-grid label,
.form-settings-grid label,
.form-design-grid label { display: grid; gap: 6px; font-size: 12px; color: var(--text); }
.form-field-grid label.full,
.form-settings-grid label.full,
.form-design-grid label.full { grid-column: 1 / -1; }
.form-field-toggles { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.form-field-toggles label,
.form-settings-grid .form-inline-toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text); }
.form-empty-state { padding: 28px; border-radius: 16px; border: 1px dashed var(--border); color: var(--text-muted); text-align: center; }
.form-design-grid,
.form-settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; max-width: 860px; }
.form-swatch-row { display: flex; align-items: center; gap: 10px; }
.form-swatch { width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(255,255,255,.14); }
.form-preview-shell { display: flex; justify-content: center; padding: 12px 0; }
.form-preview-panel { width: min(100%, 520px); border-radius: 20px; border: 1px solid var(--border); padding: 32px 38px; box-shadow: 0 20px 60px rgba(0,0,0,.28); }
.form-preview-logo { width: 48px; height: 48px; border-radius: 14px; object-fit: cover; margin-bottom: 18px; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.06); }
.form-preview-panel h2 { font-size: 22px; margin-bottom: 8px; }
.form-preview-panel p { color: var(--text-muted); margin-bottom: 22px; }
.form-preview-form { display: grid; gap: 18px; }
.form-preview-field { display: grid; gap: 8px; }
.form-preview-field label { font-size: 13px; font-weight: 700; color: var(--text); }
.form-preview-field small { color: var(--text-muted); font-size: 11px; }
.form-preview-required { color: #ff8a8a; margin-left: 4px; }
.form-preview-field textarea { min-height: 110px; resize: vertical; }
.form-preview-field input[type=checkbox] { width: 16px; height: 16px; }
.form-preview-submit { justify-self: end; min-width: 140px; }
.form-preview-success { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: rgba(0,200,117,.12); border: 1px solid rgba(0,200,117,.24); color: #9ef0c0; font-size: 12px; }
.form-preview-error { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: rgba(226,68,92,.12); border: 1px solid rgba(226,68,92,.24); color: #ffb8c3; font-size: 12px; }

@media (max-width: 1000px) {
  .sidebar { width: min(78vw, 320px); }
  .sidebar-resizer { width: 8px; }
  .home-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-grid-main { grid-template-columns: 1fr; }
  .home-hero { grid-template-columns: 1fr; display: grid; }
  .home-hero-tools { min-width: 0; }
  .form-builder-body { grid-template-columns: 1fr; }
  .form-builder-sidebar { border-right: none; border-bottom: 1px solid var(--border); }
}

@media (max-width: 720px) {
  .sidebar-resizer-toggle { top: 10px; }
  .home-view { padding: 24px 18px; }
  .home-summary-grid { grid-template-columns: 1fr; }
  .home-quick-actions { justify-content: flex-start; }
  .form-builder-toolbar { align-items: flex-start; flex-direction: column; }
  .form-builder-main { padding: 18px; }
  .form-design-grid,
  .form-settings-grid,
  .form-field-grid { grid-template-columns: 1fr; }
  .form-preview-panel { padding: 24px 20px; }
}
.calendar-header,
.timeline-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.calendar-nav { display: flex; align-items: center; gap: 8px; }
.calendar-title,
.timeline-range-title { font-size: 18px; font-weight: 700; color: var(--text); }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-weekday { padding: 12px; border-bottom: 1px solid var(--border); background: var(--bg-hover); font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.calendar-cell { min-height: 156px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 10px; display: flex; flex-direction: column; gap: 10px; }
.calendar-cell:nth-child(7n) { border-right: none; }
.calendar-cell.muted { background: rgba(255,255,255,.02); color: var(--text-muted); }
.calendar-cell.today { box-shadow: inset 0 0 0 2px rgba(0,115,234,.25); }
.calendar-cell-date { font-size: 12px; font-weight: 700; color: var(--text); }
.calendar-cell-items { display: flex; flex-direction: column; gap: 6px; }
.calendar-item-pill { display: flex; align-items: center; gap: 8px; width: 100%; border: 1px solid var(--border); background: var(--panel); color: var(--text); border-radius: 8px; padding: 7px 9px; font-size: 12px; text-align: left; cursor: pointer; }
.calendar-item-color { width: 8px; height: 8px; border-radius: 999px; flex-shrink: 0; }
.calendar-more { font-size: 12px; color: var(--text-muted); padding: 2px 2px 0; }
.timeline-controls { display: flex; align-items: center; gap: 10px; }
.timeline-control-btn,
.timeline-scale-select { height: 32px; border: 1px solid var(--border); border-radius: 8px; background: rgba(255,255,255,.02); color: var(--text); font-size: 12px; padding: 0 12px; }
.timeline-control-btn:hover,
.timeline-scale-select:hover { border-color: rgba(99,102,241,.45); background: rgba(99,102,241,.08); }
.timeline-board { overflow: hidden; width: 100%; }
.timeline-widget { width: 100%; }
.timeline-stage { position: relative; width: 100%; overflow: hidden; }
.timeline-today-line { position: absolute; top: 0; bottom: 0; width: 2px; background: rgba(0,115,234,.95); box-shadow: 0 0 0 1px rgba(0,115,234,.15); z-index: 4; pointer-events: none; }
.timeline-grid { display: grid; align-items: stretch; width: 100%; }
.timeline-grid-widget { background: linear-gradient(180deg, rgba(255,255,255,.018), rgba(255,255,255,.006)); }
.timeline-corner,
.timeline-quarter,
.timeline-unit { padding: 12px 12px; border-bottom: 1px solid var(--border); background: var(--bg-hover); font-size: 12px; font-weight: 700; color: var(--text-muted); }
.timeline-quarter,
.timeline-unit { border-left: 1px solid var(--border); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timeline-quarter { font-size: 12px; letter-spacing: .01em; background: rgba(255,255,255,.06); color: #d9e1ef; }
.timeline-month-segment { text-align: left; padding-left: 14px; }
.timeline-unit { font-size: 11px; color: #c0cad9; }
.timeline-unit.is-muted { color: rgba(192,202,217,.4); }
.timeline-unit.is-emphasis { color: #eef2ff; font-weight: 800; }
.timeline-corner-months,
.timeline-corner-units { background: rgba(255,255,255,.03); color: #9fb0c8; }
.timeline-lane-label { padding: 14px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; min-width: 0; background: rgba(255,255,255,.02); }
.timeline-lane-track { border-bottom: 1px solid var(--border); min-width: 0; background: rgba(255,255,255,.012); }
.timeline-owner { display: flex; align-items: center; gap: 12px; min-width: 0; }
.timeline-owner-avatar { width: 38px; height: 38px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; font-weight: 800; flex-shrink: 0; border: 2px solid rgba(255,255,255,.14); }
.timeline-owner-copy { min-width: 0; display: grid; gap: 2px; }
.timeline-owner-copy strong { font-size: 14px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timeline-owner-copy span { font-size: 11px; color: var(--text-muted); }
.timeline-row-cells {
  display: grid;
  position: relative;
  min-height: 56px;
  height: 100%;
  background-color: rgba(255,255,255,.02);
  background-image:
    repeating-linear-gradient(
      to right,
      rgba(255,255,255,.06) 0,
      rgba(255,255,255,.06) 1px,
      transparent 1px,
      transparent calc(100% / var(--timeline-cols, 1))
    ),
    linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,.008));
}
.timeline-bar { align-self: center; height: 32px; border: none; border-radius: 14px; color: #fff; font-size: 11px; font-weight: 700; padding: 0 12px; margin: 0 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; box-shadow: inset 0 -1px 0 rgba(255,255,255,.16), 0 8px 18px rgba(0,0,0,.14); }
.timeline-widget-bar { position: absolute; display: flex; align-items: center; gap: 9px; opacity: .96; padding-right: 12px; min-width: 0; border: 1px solid rgba(255,255,255,.12); }
.timeline-widget-bar:hover { opacity: 1; transform: translateY(-1px); }
.timeline-bar-accent { width: 5px; align-self: stretch; border-radius: 999px; background: rgba(255,255,255,.88); flex-shrink: 0; }
.timeline-bar-copy { min-width: 0; display: grid; gap: 1px; text-align: left; line-height: 1.1; }
.timeline-bar-copy strong,
.timeline-bar-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timeline-bar-copy strong { font-size: 11px; letter-spacing: .01em; }
.timeline-bar-copy small { font-size: 10px; color: rgba(255,255,255,.88); }
.timeline-row-link { background: none; border: none; color: var(--text); font-weight: 700; cursor: pointer; padding: 0; text-align: left; }
.timeline-empty { padding: 24px; color: var(--text-muted); font-size: 14px; }
.timeline-scale-day .timeline-unit { font-size: 10px; padding: 10px 4px; }
.timeline-scale-week .timeline-unit { font-size: 11px; padding: 10px 6px; }
.timeline-scale-month .timeline-unit { font-size: 11px; padding: 10px 8px; }
.cell-checkbox { width: 22px; height: 22px; margin: 0 auto; border-radius: 7px; border: 1px solid var(--border); display: inline-flex; align-items: center; justify-content: center; color: var(--text-muted); background: rgba(255,255,255,.03); }
.cell-checkbox.checked { background: rgba(0,200,117,.18); border-color: rgba(0,200,117,.45); color: #00c875; }
.toolbar-filter-badge { background: var(--primary); color: #fff; font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 8px; margin-left: 4px; }

/* ── Sort Menu ───────────────────────────────────────────────────── */
.dropdown-menu { position: fixed; z-index: 900; background: var(--bg-panel); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 28px rgba(0,0,0,.55); min-width: 180px; padding: 4px 0; animation: pop-in .1s ease; }
.dropdown-menu.hidden { display: none; }
.dropdown-item { display: flex; align-items: center; gap: 8px; padding: 8px 14px; font-size: 13px; cursor: pointer; color: var(--text); }
.dropdown-item:hover { background: var(--bg-hover); }
.dropdown-item-chevron { justify-content: space-between; }
.dropdown-item-chevron span { display: inline-flex; align-items: center; gap: 8px; }
.dropdown-item.sort-active { color: var(--primary); font-weight: 600; }
.sort-dir-icon { margin-left: auto; font-size: 11px; color: var(--text-muted); }
.dropdown-divider { border-top: 1px solid var(--border); margin: 3px 0; }
.column-options-flyout { width: 320px; padding: 12px; border-radius: 12px; }
.column-options-flyout .column-settings-options-editor { gap: 12px; }
.column-options-flyout-head { display: grid; gap: 2px; padding-bottom: 4px; }
.column-options-flyout-head strong { font-size: 14px; color: var(--text); }
.column-options-flyout-head span { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; }
.column-add-flyout-shell { gap: 10px; }
.column-add-flyout-list { display: grid; gap: 6px; }
.column-add-flyout-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); color: var(--text); text-align: left; background: rgba(255,255,255,.02); }
.column-add-flyout-item:hover { border-color: var(--accent); background: rgba(99,102,241,.08); }
.column-add-flyout-copy { display: grid; gap: 2px; min-width: 0; }
.column-add-flyout-copy strong { font-size: 13px; color: var(--text); }
.column-add-flyout-copy span { font-size: 11px; color: var(--text-muted); text-transform: capitalize; }

/* ── Group Color Picker ──────────────────────────────────────────── */
.color-picker-popup { position: fixed; z-index: 900; background: var(--bg-panel); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 28px rgba(0,0,0,.55); padding: 12px; display: flex; flex-wrap: wrap; gap: 7px; width: 188px; animation: pop-in .1s ease; }
.color-picker-popup.hidden { display: none; }
.color-swatch { width: 26px; height: 26px; border-radius: 6px; cursor: pointer; border: 2px solid transparent; transition: transform .1s, border-color .1s; }
.color-swatch:hover { transform: scale(1.15); }
.color-swatch.selected { border-color: #fff; }

/* ── Kanban board ────────────────────────────────────────────────── */
.kanban-view { display: flex; gap: 14px; padding: 20px; overflow-x: auto; height: 100%; align-items: flex-start; }
.kanban-col { background: var(--bg-panel); border: 1px solid var(--border); border-radius: 10px; width: 270px; flex-shrink: 0; display: flex; flex-direction: column; max-height: calc(100vh - 140px); }
.kanban-col-drag-over { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(99,102,241,.35); }
.kanban-col-header { padding: 12px 14px; font-weight: 700; font-size: 13px; border-radius: 10px 10px 0 0; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.kanban-col-count { font-size: 11px; font-weight: 600; opacity: .65; background: rgba(255,255,255,.1); padding: 1px 6px; border-radius: 8px; }
.kanban-cards { flex: 1; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 7px; }
.kanban-card { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; cursor: pointer; transition: box-shadow .1s, border-color .1s; }
.kanban-card:hover { border-color: var(--primary); box-shadow: 0 2px 12px rgba(0,0,0,.25); }
.kanban-card.dragging { opacity: .4; }
.kanban-card-title { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.kanban-card-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.kanban-add-btn { margin: 0 8px 8px; background: none; border: 1px dashed var(--border); color: var(--text-muted); border-radius: 6px; padding: 7px; font-size: 13px; cursor: pointer; }
.kanban-add-btn:hover { border-color: var(--primary); color: var(--text); }

/* ── Scrollbar ──────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #4b5563; }
