/* Momentum Hub - Fresh Design */

:root {
  /* Colors - Lavender/Pastel theme */
  --primary: #967bb6;
  --primary-dark: #7d63a0;
  --primary-light: #b49bd4;
  --primary-bg: rgba(150, 123, 182, 0.1);

  --secondary: #ffb3a7;
  --tertiary: #98FFED;

  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;

  --bg-body: #fdfbff;
  --bg-app: #f3eef9;
  --bg-surface: #ffffff;
  --bg-surface-secondary: #f7f2fa;
  --header-gradient: linear-gradient(135deg, #ffffff 0%, #f5effc 100%);

  --surface-container: #f3edf7;
  --surface-container-high: #eee8f2;
  --surface-section-header: #e4dcea; /* slightly darker, for card/section title bars */

  --text-primary: #1c1b1f;
  --text-secondary: #49454f;
  --text-muted: #79747e;

  --border: rgba(202, 196, 207, 0.4);
  --border-light: rgba(202, 196, 207, 0.15);

  /* Typography */
  --font-heading: 'IBM Plex Sans', 'Inter', sans-serif;
  --font-body: 'IBM Plex Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;

  /* Border radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-full: 9999px;
}

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

body {
  font-family: var(--font-body);
  background: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: var(--space-md);
  letter-spacing: -0.01em;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

p {
  margin-bottom: var(--space-md);
  color: var(--text-secondary);
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Layout */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--space-xl);
}

/* Topbar */
.topbar {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-light);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  padding: var(--space-md) var(--space-xl);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--primary);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.topbar-brand:hover {
  text-decoration: none;
  color: var(--primary);
}

.topbar-brand-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 1rem;
}

.topbar-logo {
  height: calc(100% + var(--space-md) * 2);
  margin: calc(var(--space-md) * -1) 0;
  width: auto;
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.topbar-nav a {
  color: var(--text-secondary);
  font-family: var(--font-heading);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-md);
  transition: all 0.15s ease;
}

.topbar-nav a:hover {
  color: var(--primary);
  background: var(--primary-bg);
  text-decoration: none;
}

.topbar-nav a.active {
  color: var(--primary);
  border-bottom: 2px solid var(--primary);
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xs) var(--space-sm);
  background: var(--bg-surface-secondary);
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.topbar-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
}

.topbar-avatar-img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

/* Customer selector in topbar */
.customer-selector {
  display: flex;
  align-items: center;
}

.customer-select {
  padding: var(--space-xs) var(--space-sm);
  font-size: 0.875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--text-primary);
  cursor: pointer;
  min-width: 180px;
}

.customer-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-bg);
}

.customer-select:hover {
  border-color: var(--primary-light);
}

/* ── Notification bell ───────────────────────────────────────────────────── */
.notif-bell { position: relative; }

.notif-bell-btn {
  background: none; border: none; cursor: pointer;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  display: flex; align-items: center; position: relative;
  transition: background 0.15s, color 0.15s;
}
.notif-bell-btn:hover { background: var(--primary-bg); color: var(--primary); }

.notif-badge {
  position: absolute; top: 2px; right: 2px;
  background: #dc2626; color: white;
  border-radius: var(--radius-full);
  font-size: 0.6rem; font-weight: 700; font-family: var(--font-heading);
  min-width: 15px; height: 15px; line-height: 15px;
  text-align: center; padding: 0 3px;
}

.notif-dropdown {
  position: absolute; top: calc(100% + 6px); right: 0;
  width: 360px; max-height: 480px; overflow-y: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 24px rgba(0,0,0,0.13);
  z-index: 200;
}

.notif-dropdown-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--border-light);
  font-weight: 600; font-size: 0.8125rem;
  font-family: var(--font-heading);
  position: sticky; top: 0; background: var(--bg-surface); z-index: 1;
}

.notif-mark-all {
  background: none; border: none; cursor: pointer;
  font-size: 0.75rem; color: var(--primary); padding: 0;
  font-family: var(--font-body);
}
.notif-mark-all:hover { text-decoration: underline; }

.notif-item {
  display: flex; gap: var(--space-sm); align-items: flex-start;
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--border-light);
  cursor: pointer; transition: background 0.1s;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--bg-surface-secondary); }
.notif-item.unread { background: var(--primary-bg); }
.notif-item.unread:hover { background: rgba(150,123,182,0.12); }

.notif-item-icon { padding-top: 2px; flex-shrink: 0; }

.notif-actor-avatar {
  width: 26px; height: 26px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
}
.notif-actor-initials {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--primary); color: white;
  font-size: 0.65rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.notif-content { flex: 1; min-width: 0; }
.notif-title { font-size: 0.8rem; font-weight: 500; color: var(--text-primary); line-height: 1.35; }
.notif-body {
  font-size: 0.75rem; color: var(--text-muted); margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.notif-time { font-size: 0.6875rem; color: var(--text-muted); margin-top: 2px; font-family: var(--font-heading); }

.notif-empty { padding: var(--space-xl); text-align: center; color: var(--text-muted); font-size: 0.875rem; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 0.625rem 1.25rem;
  font-family: var(--font-heading);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
  border: none;
  text-decoration: none;
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-surface-secondary);
}

.btn-lg {
  padding: 0.875rem 1.75rem;
  font-size: 1rem;
}

/* Cards */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.card-header {
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--border-light);
}

/* Hero section */
.hero {
  text-align: center;
  padding: var(--space-2xl) 0;
}

.hero-logo {
  width: 120px;
  height: auto;
  margin-bottom: var(--space-lg);
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: var(--space-md);
}

.hero p {
  font-size: 1.125rem;
  max-width: 600px;
  margin: 0 auto var(--space-xl);
}

/* Auth logo */
.auth-logo {
  width: 80px;
  height: auto;
  margin-bottom: var(--space-lg);
}

/* Page header */
.page-header {
  margin-bottom: var(--space-xl);
}

.page-header h1 {
  margin-bottom: var(--space-xs);
}

.page-header p {
  margin-bottom: 0;
}

/* Page header — shared across all pages */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-xl);
}
.page-header-content { min-width: 0; }
.page-header-content h1 {
  font-size: 1.75rem;
  color: var(--primary);
  letter-spacing: -0.02em;
  margin-bottom: var(--space-xs);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}
.page-header-content p {
  margin-bottom: 0;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: var(--space-2xl);
  color: var(--text-secondary);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
}

/* Tables - alternating row tints */
table tbody tr:nth-child(even) {
  background: var(--surface-container, var(--bg-surface-secondary));
}

table tbody tr:nth-child(odd) {
  background: var(--bg-surface);
}

table tbody tr:hover {
  background: var(--primary-bg);
}

/* Grid */
.grid {
  display: grid;
  gap: var(--space-lg);
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 768px) {
  .grid-2, .grid-3 {
    grid-template-columns: 1fr;
  }

  .container {
    padding: var(--space-md);
  }

  .topbar {
    padding: var(--space-sm) var(--space-md);
  }
}

/* Auth pages */
.auth-container {
  min-height: calc(100vh - 60px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl);
}

.auth-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  width: 100%;
  max-width: 480px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.auth-card h1 {
  margin-bottom: var(--space-sm);
}

.auth-card p {
  margin-bottom: var(--space-xl);
}

/* Icons */
.icon {
  width: 16px;
  height: 16px;
  vertical-align: middle;
  display: inline-block;
}

.icon-sm {
  width: 12px;
  height: 12px;
}

.icon-lg {
  width: 24px;
  height: 24px;
}

.icon-xl {
  width: 32px;
  height: 32px;
}

/* Nav link with icon */
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
}

/* Button with icon */
.btn .icon {
  margin-right: 4px;
}

.btn-icon-only {
  padding: 0.375rem;
  min-width: auto;
}

.btn-icon-only .icon {
  margin-right: 0;
}

/* Loading spinner */
.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }

/* Theme toggle button */
.topbar-theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 4px;
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1;
  display: flex;
  align-items: center;
}
.topbar-theme-toggle:hover { color: var(--text-primary); }
.theme-icon-dark { display: none; }
html.dark .theme-icon-light { display: none; }
html.dark .theme-icon-dark { display: inline; }

/* Dark mode */
html.dark {
  --primary: #a98bd0;
  --primary-dark: #c4a8e8;
  --primary-light: #7d63a0;
  --primary-bg: rgba(169, 139, 208, 0.15);

  --success: #34d399;
  --warning: #fbbf24;
  --danger: #f87171;

  --bg-body: #0e0f14;
  --bg-app: #0a0b10;
  --bg-surface: #16181f;
  --bg-surface-secondary: #1e2130;
  --header-gradient: linear-gradient(135deg, #16181f 0%, #1c1630 100%);

  --surface-container: #252838;
  --surface-container-high: #2e3347;
  --surface-section-header: #252838;

  --text-primary: #e4e6f0;
  --text-secondary: #9aa3b8;
  --text-muted: #5a6480;

  --border: rgba(80, 90, 120, 0.45);
  --border-light: rgba(80, 90, 120, 0.2);
}

/* Code/mono elements */
code, pre, kbd, .code-block {
  font-family: var(--font-mono);
}

/* Density modes */
body.density-compact .card { padding: var(--space-sm); }
body.density-compact .ticket-body { padding: var(--space-sm); }
body.density-compact .activity-item { padding: var(--space-xs) 0; }

/* ── P5 Header ────────────────────────────────────────────────────────────── */
.p5-bar { background:#fff; border-bottom:1px solid var(--border-light,#efecf1); padding:10px 28px 0; display:flex; flex-direction:column; position:sticky; top:0; z-index:100; }
.p5-top { display:flex; align-items:center; gap:22px; padding-bottom:10px; }
.p5-brand { display:flex; align-items:center; flex-shrink:0; }
.p5-brand img { height:44px; width:auto; display:block; }

/* Group rail */
.p5-groups { display:flex; align-items:stretch; flex:1; margin-left:12px; overflow:visible; }
.p5-group  { display:flex; flex-direction:column; align-items:flex-start; padding:0 14px; }
.p5-group + .p5-group { border-left:1px solid var(--border-light,#efecf1); }
.p5-group .gtitle { font-family:var(--font-heading); font-size:9.5px; font-weight:700; text-transform:uppercase; letter-spacing:0.12em; color:#a6a2ad; margin-bottom:4px; white-space:nowrap; }
.p5-group .gitems { display:flex; align-items:center; gap:2px; }
.p5-group .gitems a { display:inline-flex; align-items:center; gap:5px; padding:4px 8px; font-family:var(--font-heading); font-size:12.5px; font-weight:500; color:#49454f; text-decoration:none; border-radius:6px; white-space:nowrap; transition:background 0.12s, color 0.12s; }
.p5-group .gitems a img { width:12px; height:12px; opacity:0.85; flex-shrink:0; }
.p5-group .gitems a:hover { color:#1c1b1f; background:#f6f4f8; }
.p5-group .gitems a.active { color:#7d63a0; font-weight:600; background:rgba(150,123,182,0.10); }

/* Sub-nav strip */
.p5-sub { display:flex; align-items:center; gap:4px; padding:6px 0 8px; border-top:1px dashed var(--border-light,#efecf1); flex-wrap:wrap; }
.p5-sub .label { font-family:var(--font-heading); font-size:11px; font-weight:600; text-transform:uppercase; letter-spacing:0.08em; color:#7b7783; padding-right:12px; margin-right:4px; border-right:1px solid #efecf1; white-space:nowrap; flex-shrink:0; }
.p5-sub a { display:inline-flex; align-items:center; gap:6px; padding:5px 10px; font-family:var(--font-heading); font-size:12px; font-weight:500; color:#49454f; text-decoration:none; border-radius:6px; white-space:nowrap; transition:background 0.12s, color 0.12s; }
.p5-sub a img { width:11px; height:11px; opacity:0.85; flex-shrink:0; }
.p5-sub a:hover { color:#1c1b1f; background:#f6f4f8; }
.p5-sub a.active { color:#7d63a0; font-weight:600; background:rgba(150,123,182,0.10); }

/* Right cluster */
.p5-right { display:flex; align-items:center; gap:12px; flex-shrink:0; margin-left:auto; }

/* Avatar + hover sign-out popover */
.p5-user { position:relative; }
.p5-avatar { width:28px; height:28px; border-radius:50%; background:#967bb6; color:#fff; font-family:var(--font-heading); font-size:11px; font-weight:700; display:flex; align-items:center; justify-content:center; cursor:default; flex-shrink:0; overflow:hidden; user-select:none; }
.p5-avatar img { width:100%; height:100%; object-fit:cover; border-radius:50%; }
.p5-user-popover { position:absolute; top:calc(100% + 8px); right:0; background:#fff; border:1px solid var(--border,#e7e3eb); border-radius:8px; box-shadow:0 4px 16px rgba(0,0,0,0.08); padding:6px; min-width:160px; opacity:0; pointer-events:none; transition:opacity 0.12s; z-index:300; }
.p5-user:hover .p5-user-popover { opacity:1; pointer-events:auto; }
.p5-user-name { padding:6px 10px 6px; font-size:12px; font-weight:600; color:#1c1b1f; border-bottom:1px solid #f0edf4; margin-bottom:4px; white-space:nowrap; }
.p5-signout { display:flex; align-items:center; gap:6px; padding:6px 10px; font-size:12.5px; color:#49454f; text-decoration:none; border-radius:6px; }
.p5-signout:hover { background:#f6f4f8; color:#1c1b1f; }

/* Dark mode toggle */
.p5-theme-toggle { background:none; border:none; cursor:pointer; width:30px; height:30px; display:flex; align-items:center; justify-content:center; border-radius:6px; color:#7b7783; font-size:1rem; padding:0; }
.p5-theme-toggle:hover { background:#f6f4f8; color:#1c1b1f; }
.theme-icon-dark { display:none; }
.dark .theme-icon-light { display:none; }
.dark .theme-icon-dark  { display:inline; }

/* Dark mode overrides for P5 header */
.dark .p5-bar { background:var(--bg-surface,#16181f); border-bottom-color:var(--border-light); }
.dark .p5-group .gitems a { color:var(--text-secondary,#9aa3b8); }
.dark .p5-group .gitems a:hover { color:var(--text-primary,#e4e6f0); background:rgba(255,255,255,0.06); }
.dark .p5-group .gitems a.active { color:#b49bd4; background:rgba(150,123,182,0.18); }
.dark .p5-group .gtitle { color:rgba(255,255,255,0.3); }
.dark .p5-sub a { color:var(--text-secondary,#9aa3b8); }
.dark .p5-sub a:hover { color:var(--text-primary,#e4e6f0); background:rgba(255,255,255,0.06); }
.dark .p5-sub a.active { color:#b49bd4; background:rgba(150,123,182,0.18); }
.dark .p5-sub .label { color:rgba(255,255,255,0.4); border-right-color:rgba(255,255,255,0.1); }
.dark .p5-user-popover { background:var(--bg-surface,#16181f); border-color:var(--border); }
.dark .p5-user-name { color:var(--text-primary,#e4e6f0); border-bottom-color:rgba(255,255,255,0.08); }
.dark .p5-signout { color:var(--text-secondary,#9aa3b8); }
.dark .p5-signout:hover { background:rgba(255,255,255,0.06); color:var(--text-primary,#e4e6f0); }
.dark .p5-theme-toggle { color:var(--text-muted,#5a6480); }
.dark .p5-theme-toggle:hover { background:rgba(255,255,255,0.06); color:var(--text-primary,#e4e6f0); }

/* Responsive: below 1100px hide group titles, allow rail to scroll */
@media (max-width: 1100px) {
  .p5-groups { overflow-x:auto; -webkit-overflow-scrolling:touch; }
  .p5-group .gtitle { display:none; }
  .p5-group { padding:0 8px; }
  .p5-bar { padding:8px 16px 0; }
}

/* ── Customer side label ─────────────────────────────────────────────────── */
.customer-side-label {
  position: absolute;
  left: -48px;
  top: 36px;
  bottom: 0;
  width: 44px;
  writing-mode: vertical-lr;
  transform: rotate(180deg);
  font-size: 30px;
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--customer-label-color, var(--text-primary));
  opacity: 0.12;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  user-select: none;
  pointer-events: none;
  overflow: hidden;
}
@media (max-width: 1300px) { .customer-side-label { display: none; } }

/* ── Today Board ─────────────────────────────────────────────────────────── */
.today-board { max-width: 1200px; margin: 0 auto; padding: var(--space-lg) var(--space-md); }
.today-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: var(--space-md); flex-wrap: wrap; gap: 8px; }
.today-title { font-family: var(--font-heading); font-size: 1.35rem; font-weight: 700; margin: 0 0 2px; }
.today-date { font-size: 0.8rem; color: var(--text-muted); }
.stats-strip { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: var(--space-lg); }
.stat-pill { background: var(--bg-surface-secondary); border: 1px solid var(--border-light); border-radius: 999px; padding: 3px 12px; font-size: 0.75rem; font-family: var(--font-heading); font-weight: 600; color: var(--text-secondary); }
.stat-pill.danger { color: #ef4444; border-color: rgba(239,68,68,0.25); background: #fef2f2; }

.board-section { margin-bottom: 28px; }
.board-section-header { display: flex; align-items: center; gap: 8px; padding: 8px 0 10px; border-bottom: 2px solid var(--border-light); margin-bottom: 14px; font-family: var(--font-heading); font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-secondary); }
.board-section-header.pm-header { background: var(--bg-surface-secondary); padding: 8px 12px; border-radius: var(--radius-md); border-bottom: none; margin-bottom: 10px; }
.board-count-chip { background: rgba(150,123,182,0.12); color: var(--primary,#967bb6); border-radius: 999px; padding: 1px 8px; font-size: 0.7rem; font-weight: 700; }
.board-subsection-label { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-secondary); margin: 10px 0 6px; display: flex; align-items: center; gap: 6px; }
.board-subsection-chip { border-radius: 999px; padding: 1px 8px; font-size: 0.65rem; font-weight: 700; border: 1px solid; }
.board-subsection-chip.overdue { background: #fef2f2; color: #991b1b; border-color: rgba(153,27,27,0.2); }
.board-subsection-chip.due-soon { background: #fffbeb; color: #92400e; border-color: rgba(146,64,14,0.2); }
.board-subsection-chip.stagnant { background: rgba(139,92,246,0.08); color: #6d28d9; border-color: rgba(109,40,217,0.2); }
.board-all-clear { color: var(--success,#27ae60); font-size: 0.8125rem; font-style: italic; padding: 6px 0 4px; }

.board-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px,1fr)); gap: 10px; margin-bottom: 10px; }
.board-card { background: var(--bg-surface); border: 1px solid var(--border-light); border-radius: var(--radius-md); padding: 11px 12px; border-left-width: 3px; text-decoration: none; color: inherit; display: block; transition: box-shadow 0.12s; }
.board-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); text-decoration: none; color: inherit; }
.board-card.urgency-overdue  { border-left-color: #ef4444; }
.board-card.urgency-soon     { border-left-color: #f59e0b; }
.board-card.urgency-stagnant { border-left-color: #8b5cf6; }
.board-card.urgency-waiting  { border-left-color: var(--primary,#967bb6); }
.board-card.urgency-customer { border-left-color: var(--border-light); opacity: 0.75; }
.board-card.urgency-pm       { border-left-color: #3b82f6; }
.board-card-key { font-family: var(--font-mono); font-size: 0.7rem; font-weight: 600; background: var(--bg-surface-secondary); border: 1px solid var(--border-light); padding: 1px 6px; border-radius: 4px; display: inline-block; margin-bottom: 5px; }
.board-card-title { font-family: var(--font-heading); font-size: 0.82rem; font-weight: 500; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; margin-bottom: 4px; }
.board-card-project { font-size: 0.68rem; color: var(--text-muted); margin-bottom: 5px; display: flex; align-items: center; gap: 4px; }
.board-card-project-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.board-card-footer { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 5px; }
.board-card-status { font-size: 0.65rem; font-weight: 600; padding: 1px 6px; border-radius: 3px; }
.board-card-date { font-size: 0.68rem; font-family: var(--font-heading); font-weight: 600; }
.board-card-date.overdue { color: #ef4444; }
.board-card-date.soon    { color: #f59e0b; }
.stagnant-badge { font-size: 0.62rem; font-weight: 700; background: rgba(245,158,11,0.1); color: #92400e; border: 1px solid rgba(245,158,11,0.25); border-radius: 999px; padding: 1px 6px; }

.pinned-shelf { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 20px; scrollbar-width: thin; }
.pinned-shelf .board-card { min-width: 200px; max-width: 240px; flex-shrink: 0; border-left-color: var(--primary,#967bb6); }

.pm-project-block { background: var(--bg-surface); border: 1px solid var(--border-light); border-radius: var(--radius-md); padding: 12px 14px; margin-bottom: 10px; }
.pm-project-name { font-family: var(--font-heading); font-size: 0.8rem; font-weight: 700; margin-bottom: 8px; }

.today-pref-select { font-size: 0.75rem; font-family: var(--font-heading); border: 1px solid var(--border-light); border-radius: 4px; background: var(--bg-surface); color: var(--text-primary); padding: 1px 4px; cursor: pointer; vertical-align: middle; }
.board-section-toggle { cursor: pointer; user-select: none; }
.board-section-toggle .toggle-arrow { font-size: 0.6rem; transition: transform 0.15s; display: inline-block; }
.board-section-toggle.open .toggle-arrow { transform: rotate(90deg); }

@media (max-width: 600px) {
  .board-cards { grid-template-columns: 1fr; }
  .pinned-shelf { flex-direction: column; overflow-x: visible; }
  .pinned-shelf .board-card { min-width: 0; max-width: none; }
}
.dark .board-card { background: var(--bg-surface); }
.dark .stat-pill.danger { background: rgba(239,68,68,0.12); }
.dark .board-subsection-chip.overdue { background: rgba(239,68,68,0.12); }
.dark .board-subsection-chip.due-soon { background: rgba(245,158,11,0.1); }
.dark .board-subsection-chip.stagnant { background: rgba(139,92,246,0.12); }

/* ── People Board ────────────────────────────────────────────────────────── */
.people-board { max-width: 1400px; margin: 0 auto; padding: var(--space-lg) var(--space-md); }
.people-board-header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: var(--space-lg); flex-wrap: wrap; gap: 8px; }
.people-board-title { font-family: var(--font-heading); font-size: 1.3rem; font-weight: 700; }
.people-board-meta { font-size: 0.8rem; color: var(--text-muted); }

.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-bottom: 32px; }

.person-card { background: var(--bg-surface); border: 1px solid var(--border-light); border-radius: var(--radius-lg); overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
.person-card-header { background: var(--bg-surface-secondary); border-bottom: 1px solid var(--border-light); padding: 10px 14px; display: flex; align-items: center; gap: 10px; }
.person-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: var(--primary-bg); display: flex; align-items: center; justify-content: center; font-family: var(--font-heading); font-size: 0.7rem; font-weight: 700; color: var(--primary); overflow: hidden; }
.person-avatar img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; display: block; }
.person-name { font-family: var(--font-heading); font-size: 0.8rem; font-weight: 700; flex: 1; }
.person-ticket-count { font-family: var(--font-heading); font-size: 0.68rem; font-weight: 600; color: var(--text-muted); background: var(--bg-page); border: 1px solid var(--border-light); border-radius: 999px; padding: 1px 8px; }
.person-avg-score { font-family: var(--font-heading); font-size: 0.65rem; font-weight: 600; color: var(--primary); opacity: 0.75; white-space: nowrap; }
.person-card-body { padding: 8px 0; }
.person-ticket-row { display: flex; align-items: flex-start; gap: 8px; padding: 6px 14px; text-decoration: none; color: inherit; border-bottom: 1px solid var(--border-light); transition: background 0.1s; }
.person-ticket-row:last-child { border-bottom: none; }
.person-ticket-row:hover { background: var(--bg-surface-secondary); }
.person-ticket-key { font-family: var(--font-mono); font-size: 0.67rem; font-weight: 600; white-space: nowrap; color: var(--text-muted); margin-top: 1px; min-width: 48px; }
.person-ticket-info { flex: 1; min-width: 0; }
.person-ticket-title { font-size: 0.78rem; line-height: 1.35; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.person-ticket-sub { display: flex; align-items: center; gap: 6px; margin-top: 3px; flex-wrap: wrap; }
.person-ticket-project { font-size: 0.67rem; color: var(--text-muted); }
.person-ticket-date { font-family: var(--font-heading); font-size: 0.67rem; font-weight: 600; }
.person-ticket-date.overdue { color: #ef4444; }
.person-ticket-date.due-soon { color: #f59e0b; }
.person-status-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; margin-top: 5px; }
.person-ticket-score { font-family: var(--font-heading); font-size: 0.65rem; font-weight: 700; color: var(--text-muted); white-space: nowrap; margin-top: 2px; min-width: 28px; text-align: right; flex-shrink: 0; }
.person-card-empty { padding: 12px 14px; font-size: 0.78rem; color: var(--text-muted); font-style: italic; }
.person-card-more { padding: 6px 14px; font-size: 0.72rem; color: var(--primary); font-family: var(--font-heading); font-weight: 600; border-top: 1px solid var(--border-light); cursor: default; }

.people-unassigned { background: var(--bg-surface); border: 1px solid var(--border-light); border-radius: var(--radius-lg); overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
.people-unassigned-header { background: var(--bg-surface-secondary); border-bottom: 1px solid var(--border-light); padding: 10px 14px; display: flex; align-items: center; gap: 8px; font-family: var(--font-heading); font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-secondary); }

@media (max-width: 600px) { .people-grid { grid-template-columns: 1fr; } }

/* ── Help pane ──────────────────────────────────────────────────────────────── */
.help-btn { background: none; border: none; cursor: pointer; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; border-radius: 6px; padding: 0; flex-shrink: 0; transition: background 0.15s, opacity 0.15s; }
.help-btn img { width: 14px; height: 14px; opacity: 0.6; display: block; }
.help-btn:hover { background: var(--primary-bg); }
.help-btn:hover img { opacity: 1; }

.help-pane { position: fixed; top: 0; right: 0; bottom: 0; width: 360px; background: var(--bg-surface); border-left: 1px solid var(--border); box-shadow: -4px 0 24px rgba(0,0,0,0.09); z-index: 500; display: flex; flex-direction: column; transform: translateX(100%); transition: transform 0.28s cubic-bezier(0.4,0,0.2,1); overflow: hidden; }
.help-pane.open { transform: translateX(0); }

.help-pane-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border-light); background: var(--bg-surface-secondary); flex-shrink: 0; }
.help-pane-title { font-family: var(--font-heading); font-size: 0.875rem; font-weight: 700; color: var(--text-primary); margin: 0; display: flex; align-items: center; gap: 8px; }
.help-pane-title img { width: 14px; height: 14px; opacity: 0.7; }
.help-pane-close { background: none; border: none; cursor: pointer; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: 6px; font-size: 1.2rem; color: var(--text-muted); line-height: 1; transition: background 0.12s, color 0.12s; }
.help-pane-close:hover { background: var(--primary-bg); color: var(--primary); }

.help-pane-body { flex: 1; overflow-y: auto; padding: 20px 18px; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }

.help-intro { font-size: 0.8125rem; color: var(--text-secondary); line-height: 1.65; margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--border-light); }
.help-intro p { margin: 0; }
.help-section { margin-bottom: 18px; }
.help-section h4 { font-family: var(--font-heading); font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--primary); margin: 0 0 6px; }
.help-section p { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.65; margin: 0; }
.help-pane-loading { padding: 32px 0; text-align: center; color: var(--text-muted); font-size: 0.8125rem; font-style: italic; }
.help-pane-empty { padding: 32px 0; text-align: center; color: var(--text-muted); font-size: 0.8125rem; font-style: italic; }

.dark .help-btn:hover { background: rgba(255,255,255,0.07); }
.dark .help-pane { box-shadow: -4px 0 24px rgba(0,0,0,0.35); }

@media (max-width: 600px) { .help-pane { width: 100%; } }
