/* Task App Design System
 * Font: Inter (locally bundled in wwwroot/fonts/Inter/)
 * Color scheme: dark sidebar + purple accent
 */

@font-face {
  font-family: 'Inter';
  src: url('/fonts/Inter/Inter-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('/fonts/Inter/Inter-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('/fonts/Inter/Inter-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('/fonts/Inter/Inter-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Sidebar */
  --sidebar-bg: #1e1e2e;
  --sidebar-text: #cdd6f4;
  /* Muted label text on the DARK sidebar. #6c7086 was too dim (~2.1:1); brightened for
     readability of the workspace name and section labels without competing with --sidebar-text. */
  --sidebar-text-muted: #9095b2;
  --sidebar-border: #313244;
  --sidebar-hover: #313244;
  --sidebar-active: #45475a;
  --sidebar-width: 240px;
  --sidebar-collapsed-width: 52px;

  /* Surfaces */
  --surface-0: #f8fafc;
  --surface-1: #ffffff;
  --surface-2: #f1f5f9;
  --border: #e2e8f0;
  --border-subtle: #f1f5f9;

  /* Dialog / input surface aliases. Defined explicitly so any component that
     references them resolves to the (light) design system instead of falling
     back to a hardcoded dark literal — the cause of dark-text-on-dark clashes. */
  --bg-card: var(--surface-1);
  --bg-input: var(--surface-1);
  --bg-hover: var(--surface-2);
  --bg-overlay: rgba(0, 0, 0, 0.4);

  /* Text (on LIGHT surfaces). Ordered dark→light; all meet WCAG AA (≥4.5:1) on white.
     --text-muted was #94a3b8 (slate-400, ~2.5:1) — the "light gray on white" that was hard to
     read in empty states, breadcrumbs, hints, due dates. Darkened to ~5:1 while staying clearly
     secondary to --text-primary/--text-secondary. */
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #5b6675;

  /* Accent */
  --accent: #7c3aed;
  --accent-light: #ede9fe;
  --accent-hover: #6d28d9;

  /* Status badges */
  --status-open-bg: #f1f5f9;
  --status-open-fg: #64748b;
  --status-progress-bg: #ede9fe;
  --status-progress-fg: #7c3aed;
  --status-review-bg: #fef3c7;
  --status-review-fg: #d97706;
  --status-done-bg: #dcfce7;
  --status-done-fg: #16a34a;

  /* Priority */
  --pri-urgent: #ef4444;
  --pri-high: #f97316;
  --pri-normal: #6366f1;
  --pri-low: #94a3b8;

  /* Semantic */
  --danger: #dc2626;
  --warning: #d97706;
  --success: #16a34a;
  --info: #0ea5e9;
  --reconnect-amber: #d97706;
}

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

/* SVGs inside flex/inline contexts align to the text midline, not the baseline. */
svg { vertical-align: middle; }

html, body {
  height: 100%;
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--surface-0);
  -webkit-font-smoothing: antialiased;
}

/* ── App Shell ─────────────────────────────────────────────────────────── */

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

/* ── Login page ────────────────────────────────────────────────────────── */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #15131f 0%, #1e1e2e 60%, #2a1f4e 100%);
  padding: 24px;
}

.login-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 36px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.35);
}

.login-card .app-name {
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 4px;
}

.login-card .company-name {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.btn-workspace {
  display: block;
  width: 100%;
  padding: 12px 16px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-1);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.btn-workspace:hover {
  background: var(--surface-2);
  border-color: var(--accent);
  color: var(--text-primary);
  text-decoration: none;
}

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 9px 16px;
  border: 1px solid #dadce0;
  border-radius: 6px;
  background: #fff;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
  margin-bottom: 16px;
  line-height: 1.4;
}
.btn-google svg { flex-shrink: 0; display: block; }
.btn-google:hover { background: #f8f9fa; border-color: #b0b8c4; }

.login-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0;
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.login-divider::before, .login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #dadce0;
}

/* ── ClickUp-style 3-pane shell (icon rail + submenu + main) ─────────────── */
:root {
  --rail-bg: #15131f;
  --rail-width: 54px;
  --submenu-width: 248px;
}
.tshell { display: flex; height: 100vh; width: 100%; overflow: hidden; background: var(--surface-0); }

/* Icon rail */
.rail {
  width: var(--rail-width); flex-shrink: 0; background: var(--rail-bg);
  display: flex; flex-direction: column; align-items: center;
  padding: 8px 0; gap: 2px; z-index: 30;
}
.rail-logo {
  width: 34px; height: 34px; border-radius: 8px; margin-bottom: 6px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 15px; cursor: pointer;
}
.rail-item {
  width: 40px; height: 40px; border-radius: 8px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  color: var(--sidebar-text-muted); transition: background .12s, color .12s; position: relative;
}
.rail-item:hover { background: rgba(255,255,255,.07); color: var(--sidebar-text); }
.rail-item.active { background: rgba(124,58,237,.22); color: #fff; }
.rail-item .rail-label { font-size: 8.5px; line-height: 1; font-weight: 500; }
.rail-spacer { flex: 1; }

/* Submenu panel */
.submenu {
  width: var(--submenu-width); flex-shrink: 0; background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex; flex-direction: column; overflow: hidden; z-index: 20;
}
.submenu-header {
  padding: 12px 14px; display: flex; align-items: center; gap: 8px;
  border-bottom: 1px solid var(--sidebar-border); min-height: 48px;
}
.submenu-title { font-size: 14px; font-weight: 600; color: var(--sidebar-text); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.submenu-scroll { flex: 1; overflow-y: auto; padding: 6px 0; }
.submenu-section {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  color: var(--sidebar-text-muted); padding: 10px 14px 4px; display: flex; align-items: center; gap: 6px;
}
.submenu-section .submenu-section-action { margin-left: auto; cursor: pointer; opacity: .7; }
.submenu-section .submenu-section-action:hover { opacity: 1; color: var(--sidebar-text); }
.submenu-stats {
  border-top: 1px solid var(--sidebar-border);
  padding: 8px 14px; display: flex; gap: 16px;
}
.submenu-stat { display: flex; flex-direction: column; align-items: center; }
.submenu-stat-val { font-size: 15px; font-weight: 700; color: var(--sidebar-text); line-height: 1.1; }
.submenu-stat-label { font-size: 10px; color: var(--sidebar-text-muted); text-transform: uppercase; letter-spacing: .04em; }

.submenu-footer {
  border-top: 1px solid var(--sidebar-border); padding: 8px 10px;
  display: flex; align-items: center; gap: 8px;
}

/* Main pane */
.tmain { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; background: var(--surface-0); }

/* Custom shell dropdowns — position:fixed escapes the overflow:hidden shell */
.shell-backdrop { position: fixed; inset: 0; z-index: 399; }
.shell-menu {
  position: fixed; z-index: 400;
  background: var(--sidebar-bg);
  border: 1px solid var(--sidebar-border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
  min-width: 200px;
  padding: 4px 0;
}
.shell-menu-label {
  padding: 8px 16px 4px; font-size: 11px; font-weight: 600;
  color: var(--sidebar-text-muted); text-transform: uppercase; letter-spacing: .04em;
}
.shell-menu-item {
  padding: 9px 16px; font-size: 13px; color: var(--sidebar-text);
  cursor: pointer; display: block; white-space: nowrap;
}
.shell-menu-item:hover { background: var(--sidebar-hover); }
.shell-menu-item.danger { color: var(--danger, #ef4444); }
.shell-menu-divider { border: none; border-top: 1px solid var(--sidebar-border); margin: 4px 0; }

/* MudNavMenu theming to fit the dark submenu (overrides MudBlazor light defaults) */
.submenu .mud-nav-link { color: var(--sidebar-text); font-size: 13px; padding: 6px 14px; min-height: 32px; }
.submenu .mud-nav-link:hover { background: var(--sidebar-hover); }
.submenu .mud-nav-link.active { background: var(--sidebar-active); color: #fff; }
.submenu .mud-nav-link .mud-nav-link-icon { color: var(--sidebar-text-muted); margin-right: 8px; }
.submenu .mud-nav-group .mud-nav-link-text,
.submenu .mud-nav-link .mud-nav-link-text { color: inherit; }
.submenu .mud-nav-group > .mud-nav-link { color: var(--sidebar-text); }
.submenu .mud-list-item-icon { min-width: 28px; }

/* ── Sidebar ───────────────────────────────────────────────────────────── */

.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--sidebar-border);
  overflow: hidden;
  transition: width 0.2s ease;
}

.sidebar-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-logo {
  font-weight: 700;
  font-size: 16px;
  color: var(--accent-light);
  letter-spacing: -0.3px;
}

.sidebar-workspace-name {
  font-size: 11px;
  color: var(--sidebar-text-muted);
  margin-top: 1px;
}

.sidebar-nav { flex: 1; overflow-y: auto; padding: 8px 0; }

.sidebar-section {
  padding: 4px 8px 2px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--sidebar-text-muted);
  margin-top: 8px;
}

.sidebar-item {
  padding: 5px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 4px;
  margin: 0 4px;
  font-size: 13px;
  color: var(--sidebar-text);
  text-decoration: none;
  transition: background 0.1s;
}

.sidebar-item:hover { background: var(--sidebar-hover); }
.sidebar-item.active { background: var(--sidebar-active); color: var(--accent-light); }

.sidebar-item .space-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 8px 12px;
  border-top: 1px solid var(--sidebar-border);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Main Content Area ─────────────────────────────────────────────────── */

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface-0);
  min-width: 0;
}

/* ── Topbar ────────────────────────────────────────────────────────────── */

.topbar {
  height: 44px;
  background: var(--surface-1);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  flex-shrink: 0;
}

.breadcrumb { font-size: 12px; color: var(--text-muted); }
.breadcrumb strong { color: var(--text-primary); font-weight: 600; }

.view-tabs {
  display: flex;
  gap: 1px;
  background: var(--surface-2);
  padding: 2px;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.view-tab {
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  color: var(--text-muted);
  border: none;
  background: transparent;
}

.view-tab.active {
  background: var(--surface-1);
  color: var(--text-primary);
  font-weight: 500;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

.topbar-actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }

/* ── Toolbar ───────────────────────────────────────────────────────────── */

.toolbar {
  height: 36px;
  background: var(--surface-1);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 6px;
  flex-shrink: 0;
}

.filter-chip {
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  font-size: 11px;
  color: var(--text-secondary);
  cursor: pointer;
  background: transparent;
}

.filter-chip:hover { border-color: var(--text-muted); }

/* ── Task List ─────────────────────────────────────────────────────────── */

.list-content { flex: 1; overflow-y: auto; }

.list-header-row {
  display: grid;
  grid-template-columns: 24px 110px 1fr 90px 90px 70px;
  padding: 6px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-0);
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1;
}

.task-row {
  display: grid;
  grid-template-columns: 24px 110px 1fr 90px 90px 70px;
  padding: 6px 12px;
  border-bottom: 1px solid var(--border-subtle);
  align-items: center;
  cursor: pointer;
  transition: background 0.05s;
}

.task-row:hover { background: var(--accent-light); }
.task-row:hover .task-name { color: var(--accent); }

.task-name {
  font-size: 13px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Status Badges ─────────────────────────────────────────────────────── */

.status-badge {
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
}

/* ── Priority Dots ─────────────────────────────────────────────────────── */

.priority-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.priority-urgent { background: var(--pri-urgent); }
.priority-high { background: var(--pri-high); }
.priority-normal { background: var(--pri-normal); }
.priority-low { background: var(--pri-low); }
.priority-none { background: var(--border); }

/* ── Assignee Avatars ──────────────────────────────────────────────────── */

.avatar-stack { display: flex; }
.avatar-sm {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--surface-1);
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  background: var(--surface-2);
}
.avatar-sm:not(:first-child) { margin-left: -5px; }

.avatar-md {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-light);
  color: var(--accent);
  flex-shrink: 0;
}

/* ── Section Group Headers ─────────────────────────────────────────────── */

.group-header {
  padding: 7px 12px 5px;
  background: var(--surface-0);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.group-count { font-size: 10px; font-weight: 400; color: var(--text-muted); }

/* ── Add Task Row ──────────────────────────────────────────────────────── */

.add-task-row {
  padding: 6px 12px;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.add-task-row:hover { color: var(--accent); background: var(--accent-light); }

/* ── Buttons ───────────────────────────────────────────────────────────── */

.btn {
  padding: 5px 12px;
  border-radius: 5px;
  border: none;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  transition: background 0.1s, opacity 0.1s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: transparent; color: var(--text-secondary); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--danger); color: #fff; }

/* ── Task Detail Panel ─────────────────────────────────────────────────── */

.task-panel-overlay {
  /* Overlay starts at the right edge of the submenu so the task panel fills the full main area.
     The rail (54px) + submenu (248px) = 302px combined left offset. */
  position: fixed;
  top: 0; bottom: 0; right: 0;
  left: calc(var(--rail-width, 54px) + var(--submenu-width, 248px));
  background: rgba(0,0,0,0.15);
  z-index: 100;
  display: flex;
  justify-content: flex-end;
}

.task-panel {
  width: 78%;
  height: 100%;
  background: var(--surface-1);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: -4px 0 16px rgba(0,0,0,0.08);
  animation: slide-in 0.15s ease-out;
}

@keyframes slide-in {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

.task-panel-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.task-panel-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
  border: none;
  outline: none;
  resize: none;
  background: transparent;
  font-family: inherit;
}

.task-panel-close {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 18px;
  padding: 2px;
  flex-shrink: 0;
}

.task-panel-close:hover { color: var(--text-primary); }

.task-panel-body { flex: 1; overflow-y: auto; padding: 14px 20px; }

/* Two-pane interior (ClickUp-style): wide main column on the left, properties
   sidebar on the right. The right pane comes first in the DOM but is ordered
   to the right via `order`. */
.task-panel-main {
  flex: 1;
  display: flex;
  min-height: 0;
  overflow: hidden;
}
.task-panel-left {
  order: 1;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.task-panel-right {
  order: 2;
  width: 340px;
  flex-shrink: 0;
  border-left: 1px solid var(--border);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
/* In the sidebar the properties section shouldn't add its own divider line. */
.task-panel-right .task-props { border-bottom: none; }

/* Narrow screens: stack the two panes and let the panel fill the width. */
@media (max-width: 900px) {
  .task-panel { width: 100vw; }
  .task-panel-main { flex-direction: column; overflow-y: auto; }
  .task-panel-left { order: 2; }
  .task-panel-right {
    order: 1;
    width: auto;
    border-left: none;
    border-bottom: 1px solid var(--border);
  }
}

/* ── Task detail: ClickUp-style labeled properties ─────────────────────── */
.task-props {
  display: flex;
  flex-direction: column;
  padding: 10px 20px 14px;
  border-bottom: 1px solid var(--border);
}

/* One property per row: icon+label on the left, control on the right, same line. */
.prop-row {
  display: grid;
  grid-template-columns: 112px 1fr;
  align-items: center;
  min-height: 34px;
  padding: 0 6px;
  margin: 0 -6px;
  border-radius: 6px;
}
.prop-row:hover { background: var(--surface-2); }

.prop-label {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.prop-label .prop-ico {
  width: 16px;
  text-align: center;
  font-size: 13px;
  opacity: 0.8;
  flex-shrink: 0;
}

.prop-value {
  font-size: 13px;
  color: var(--text-primary);
  min-width: 0;
  display: flex;
  align-items: center;
}

/* Controls read as plain text until hovered/focused (ClickUp-style inline edit).
   The -8px pull cancels the control's own left padding so its text aligns to the column. */
.prop-input {
  font-size: 13px;
  padding: 4px 8px;
  margin-left: -8px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--text-primary);
  font-family: inherit;
  cursor: pointer;
  max-width: 100%;
}

.prop-input:hover { border-color: var(--border); background: var(--surface-1); }
.prop-input:focus { outline: none; border-color: var(--accent); background: var(--surface-1); }

/* Description block (always visible) */
.task-desc-block { padding: 14px 20px; border-bottom: 1px solid var(--border); }

.prop-section-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 7px;
}

.task-desc-editor {
  min-height: 80px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-primary);
  outline: none;
}

.task-desc-editor:focus { border-color: var(--accent); }

/* Dropdown menu rows (account menu, workspace switcher) */
.menu-row {
  padding: 6px 8px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-primary);
  white-space: nowrap;
}
.menu-row:hover { background: var(--surface-2, rgba(0,0,0,0.05)); }

/* ── Kanban Board ──────────────────────────────────────────────────────── */

.board-content {
  flex: 1;
  overflow-x: auto;
  overflow-y: hidden;
  display: flex;
  gap: 12px;
  padding: 12px;
  align-items: flex-start;
}

.kanban-column {
  width: 220px;
  flex-shrink: 0;
  background: var(--surface-2);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 120px);
}

.kanban-column-header {
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.kanban-cards { flex: 1; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 6px; }

.kanban-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  transition: box-shadow 0.1s;
}

.kanban-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.1); }

.kanban-card-name {
  font-size: 13px;
  color: var(--text-primary);
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.kanban-card-desc {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kanban-card-tags { display: flex; flex-wrap: wrap; gap: 3px; margin-bottom: 6px; }
.tag-pill {
  padding: 1px 6px;
  border-radius: 8px;
  font-size: 10px;
  background: var(--surface-2);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.kanban-card-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
}

.kanban-card-footer .spacer { flex: 1; }

/* ── Due Date ──────────────────────────────────────────────────────────── */

.due-date { font-size: 11px; color: var(--text-muted); }
.due-overdue { color: var(--danger); font-weight: 500; }
.due-soon { color: var(--warning); }

/* ── Empty States ──────────────────────────────────────────────────────── */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 24px;
  text-align: center;
  color: var(--text-muted);
}

.empty-state-icon { font-size: 40px; margin-bottom: 16px; opacity: 0.6; }
.empty-state-title { font-size: 16px; font-weight: 600; color: var(--text-secondary); margin-bottom: 8px; }
.empty-state-body { font-size: 13px; margin-bottom: 20px; max-width: 320px; }

/* ── Login Pages ───────────────────────────────────────────────────────── */
/* (canonical definition is above; this section handles only the admin dark-theme overrides) */

/* Super-admin login — dark theme */
.login-page-admin {
  background: #0f0f17;
}

.login-page-admin .login-card {
  background: #1a1a2a;
  border-color: #313244;
}

.login-page-admin .login-card .app-name {
  color: #f59e0b;
}

.login-page-admin .admin-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #f59e0b;
  margin-bottom: 16px;
}

.login-page-admin input {
  background: #252535;
  border-color: #313244;
  color: #cdd6f4;
}

/* ── Form Elements ─────────────────────────────────────────────────────── */

.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; font-weight: 500; color: var(--text-secondary); margin-bottom: 4px; }
.form-control {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--surface-1);
  outline: none;
  transition: border-color 0.1s;
}
.form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-light); }

/* ── Reconnect Overlay ─────────────────────────────────────────────────── */

.reconnect-overlay,
#components-reconnect-modal {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  background: transparent !important;
}

.reconnect-bar {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--reconnect-amber);
  animation: pulse-bar 1.2s ease-in-out infinite;
}

@keyframes pulse-bar {
  0%,100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.reconnect-failed {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  align-items: center;
  justify-content: center;
  pointer-events: all;
}

.reconnect-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px 32px;
  text-align: center;
  max-width: 380px;
}

.reconnect-card p { margin-bottom: 16px; color: var(--text-secondary); }
.reconnect-card button {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 5px;
  padding: 8px 20px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
}

/* ── Super-Admin pages ─────────────────────────────────────────────────── */

.admin-shell {
  min-height: 100vh;
  background: #0f0f17;
  color: #cdd6f4;
  font-family: 'Inter', sans-serif;
}

.admin-topbar {
  height: 48px;
  background: #1a1a2a;
  border-bottom: 1px solid #313244;
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
}

.admin-topbar .logo { font-weight: 700; color: #f59e0b; font-size: 15px; }
.admin-topbar .label { font-size: 11px; color: #6c7086; text-transform: uppercase; letter-spacing: 0.08em; }

.admin-content { max-width: 960px; margin: 0 auto; padding: 24px 20px; }

/* ── Utility ───────────────────────────────────────────────────────────── */

.text-muted { color: var(--text-muted) !important; }
.text-danger { color: var(--danger) !important; }
.text-success { color: var(--success) !important; }
.flex { display: flex; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.gap-2 { gap: 8px; }
.ml-auto { margin-left: auto; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
