/* =========================================
   Blizznex CRM — Glassmorphic dark theme
   PHP-friendly static HTML/CSS/JS
   ========================================= */

:root {
  --accent-h: 232;
  --accent: oklch(0.63 0.22 var(--accent-h));
  --accent-soft: oklch(0.63 0.22 var(--accent-h) / 0.15);
  --accent-glow: oklch(0.63 0.22 var(--accent-h) / 0.55);
  --accent-2: oklch(0.58 0.24 258);

  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 22px;

  --bg-0: #0a0a0f;
  --bg-1: #111118;
  --bg-2: #181821;
  --bg-3: #22222e;

  --line: rgba(255, 255, 255, 0.06);
  --line-strong: rgba(255, 255, 255, 0.12);

  --fg: #f5f5fa;
  --fg-2: #c7c7d2;
  --fg-3: #8b8b99;
  --fg-4: #5c5c69;

  --ok: oklch(0.74 0.15 155);
  --warn: oklch(0.8 0.14 75);
  --err: oklch(0.7 0.18 25);
  --info: oklch(0.74 0.13 235);
  --pink: oklch(0.74 0.16 340);
  --violet: oklch(0.72 0.16 290);

  --sb-w: 248px;
  --sb-w-collapsed: 72px;
  --topbar-h: 68px;

  /* Glass tokens — used everywhere */
  --glass-bg: linear-gradient(160deg, rgba(255,255,255,0.05), rgba(255,255,255,0.015) 60%);
  --glass-border: 1px solid rgba(255, 255, 255, 0.08);
  --glass-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    inset 0 0 0 1px rgba(255, 255, 255, 0.02),
    0 14px 40px -20px rgba(0, 0, 0, 0.7),
    0 2px 6px -2px rgba(0, 0, 0, 0.4);
  --glass-blur: blur(18px) saturate(140%);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; padding: 0; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  color: var(--fg);
  background: #050507;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; }

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; padding: 0; }
input, textarea, select { font-family: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.05); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.12); }

/* ============ APP BACKDROP (the "world" behind glass) ============ */
.app {
  display: grid;
  grid-template-columns: var(--sb-w) 1fr;
  height: 100vh;
  position: relative;
  overflow: hidden;
}
.app[data-sidebar="collapsed"] { grid-template-columns: var(--sb-w-collapsed) 1fr; }
.app[data-sidebar="floating"] { grid-template-columns: 96px 1fr; }

/* Animated colored blobs behind frosted glass */
.app::before, .app::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.7;
}
.app::before {
  width: 700px; height: 700px;
  background: radial-gradient(circle, oklch(0.74 0.15 var(--accent-h)) 0%, transparent 65%);
  top: -180px; right: -120px;
  animation: floatA 18s ease-in-out infinite;
}
.app::after {
  width: 600px; height: 600px;
  background: radial-gradient(circle, var(--accent-2) 0%, transparent 65%);
  bottom: -180px; left: 100px;
  opacity: 0.5;
  animation: floatB 22s ease-in-out infinite;
}
@keyframes floatA {
  0%, 100% { transform: translate(0, 0); }
  50%      { transform: translate(-60px, 60px); }
}
@keyframes floatB {
  0%, 100% { transform: translate(0, 0); }
  50%      { transform: translate(80px, -40px); }
}

.app-bg-grid {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
}

/* ============ SIDEBAR (glass) ============ */
.sidebar {
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  padding: 18px 12px;
  margin: 14px 0 14px 14px;
  border-radius: var(--radius-lg);
  background: var(--glass-bg);
  background-color: rgba(15, 15, 22, 0.55);
  border: var(--glass-border);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shadow);
  overflow: hidden;
}
.sidebar::before {
  content: '';
  position: absolute;
  top: -1px; left: 10%; right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
}

.app[data-sidebar="collapsed"] .sidebar {
  margin: 14px 0 14px 14px;
}
.app[data-sidebar="floating"] .sidebar {
  margin: 18px 0 18px 18px;
  border-radius: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 10px 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}
.brand-mark {
  width: 38px; height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  position: relative;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.1), 0 8px 22px -10px var(--accent-glow);
}
.brand-mark::before {
  content: ''; position: absolute; inset: 6px;
  background: rgba(10, 10, 18, 0.6);
  backdrop-filter: blur(2px);
  clip-path: polygon(0 0, 70% 0, 100% 30%, 100% 100%, 30% 100%, 0 70%);
  border-radius: 4px;
}
.brand-mark::after {
  content: 'B'; position: absolute; inset: 0;
  display: grid; place-items: center;
  font-weight: 800; font-size: 16px; color: var(--fg);
  letter-spacing: -0.02em;
}
.brand-name {
  font-weight: 700; font-size: 16px;
  letter-spacing: -0.01em; white-space: nowrap;
}
.brand-name span { color: var(--accent); }

.app[data-sidebar="collapsed"] .brand-name,
.app[data-sidebar="collapsed"] .nav-label,
.app[data-sidebar="collapsed"] .sidebar-section-label,
.app[data-sidebar="collapsed"] .nav-badge,
.app[data-sidebar="collapsed"] .org-meta,
.app[data-sidebar="collapsed"] .upgrade { display: none; }
.app[data-sidebar="collapsed"] .nav-item { justify-content: center; padding: 10px; }
.app[data-sidebar="collapsed"] .org { justify-content: center; padding: 8px; }

.sidebar-section-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--fg-4);
  padding: 14px 12px 6px;
  font-weight: 600;
}
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--fg-2);
  font-size: 13.5px; font-weight: 500;
  position: relative;
  transition: background 0.18s, color 0.18s, transform 0.1s;
  text-align: left;
  width: 100%;
}
.nav-item:hover {
  background: rgba(255,255,255,0.04);
  color: var(--fg);
}
.nav-item.active {
  color: var(--fg);
  background: linear-gradient(90deg, var(--accent-soft), rgba(255,255,255,0.02));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 4px 14px -8px var(--accent-glow);
}
.nav-item.active::before {
  content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px;
  width: 3px; border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}
.app[data-sidebar="floating"] .nav-item.active::before { left: -2px; }
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-label { flex: 1; white-space: nowrap; }
.nav-badge {
  font-size: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 2px 7px;
  border-radius: 999px;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
}
.nav-badge.dot {
  background: var(--err);
  color: white;
  min-width: 18px;
  text-align: center;
}

.sidebar-spacer { flex: 1; }

.upgrade {
  margin: 8px 4px 12px;
  padding: 14px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, oklch(0.74 0.15 var(--accent-h) / 0.22), oklch(0.7 0.16 290 / 0.22));
  border: 1px solid rgba(255,255,255,0.08);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(6px);
}
.upgrade::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 80% 10%, rgba(255,255,255,0.18), transparent 60%);
  pointer-events: none;
}
.upgrade > * { position: relative; }
.upgrade-title { font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.upgrade-desc { font-size: 11.5px; color: var(--fg-2); margin-bottom: 10px; line-height: 1.4; opacity: 0.9; }
.upgrade-btn {
  width: 100%;
  padding: 8px;
  border-radius: 8px;
  background: var(--fg);
  color: var(--bg-0);
  font-weight: 600;
  font-size: 12px;
}

.org {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
  backdrop-filter: blur(6px);
}
.org-avatar {
  width: 32px; height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--violet));
  display: grid; place-items: center;
  font-weight: 700; font-size: 12px;
  flex-shrink: 0;
}
.org-meta { flex: 1; min-width: 0; }
.org-name { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.org-plan { font-size: 10.5px; color: var(--fg-3); }

/* ============ MAIN COL ============ */
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100vh;
  overflow: hidden;
  position: relative;
  z-index: 1;
}
.topbar {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 26px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  /* No background — blends with page naturally */
}
.topbar-inner {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 100%;
  padding: 0 16px;
  background: none;
  border: none;
}
.search {
  flex: 1;
  max-width: 480px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: border-color 0.15s;
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search svg { width: 16px; height: 16px; color: var(--fg-3); }
.search input {
  flex: 1; background: transparent; border: none; outline: none; font-size: 13.5px;
}
.search kbd {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; padding: 2px 6px;
  border: 1px solid var(--line-strong);
  border-radius: 4px; color: var(--fg-3);
}
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  color: var(--fg-2);
  position: relative;
  transition: background 0.15s, color 0.15s;
}
.icon-btn:hover { background: rgba(255,255,255,0.08); color: var(--fg); }
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn .pip {
  position: absolute; top: 8px; right: 8px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--err); border: 2px solid #1a1a25;
}
.user-pill {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 12px 4px 4px;
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
}
.user-pill img, .user-pill .avatar {
  width: 30px; height: 30px;
}
.user-pill .name { font-size: 12.5px; font-weight: 600; line-height: 1.1; }
.user-pill .handle { font-size: 10.5px; color: var(--fg-3); }

/* ============ PAGE ============ */
.page {
  flex: 1;
  overflow-y: auto;
  padding: 8px 26px 36px;
}
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin: 8px 0 24px;
}
.page-title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 4px;
}
.page-sub { color: var(--fg-3); font-size: 13.5px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.04);
  color: var(--fg);
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  white-space: nowrap;
}
.btn:hover { background: rgba(255,255,255,0.08); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 14px; height: 14px; }
.btn.primary {
  background: linear-gradient(135deg, oklch(0.60 0.24 228), oklch(0.52 0.26 258));
  color: #e8eeff;
  border-color: transparent;
  box-shadow: 0 6px 22px -8px var(--accent-glow), inset 0 1px 0 rgba(255,255,255,0.22);
}
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--fg-2); }
.btn.ghost:hover { background: rgba(255,255,255,0.05); color: var(--fg); }
.btn.danger {
  background: oklch(0.7 0.18 25 / 0.18);
  border-color: oklch(0.7 0.18 25 / 0.35);
  color: oklch(0.82 0.15 25);
}

/* ============ GLASS CARD (the core block) ============ */
.card {
  position: relative;
  background: var(--glass-bg);
  background-color: rgba(20, 20, 30, 0.45);
  border: var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--glass-shadow);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  padding: 20px;
  overflow: hidden;
}
.card::before {
  /* top sheen */
  content: '';
  position: absolute;
  top: 0; left: 14%; right: 14%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
  pointer-events: none;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  position: relative;
}
.card-title { font-size: 14.5px; font-weight: 600; letter-spacing: -0.005em; }
.card-sub { color: var(--fg-3); font-size: 12px; }

/* ============ KPI ============ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
.kpi {
  position: relative;
  padding: 20px;
  border-radius: var(--radius);
  background: var(--glass-bg);
  background-color: rgba(20, 20, 30, 0.45);
  border: var(--glass-border);
  box-shadow: var(--glass-shadow);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  overflow: hidden;
}
.kpi::before {
  content: '';
  position: absolute;
  top: 0; left: 14%; right: 14%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
}
.kpi-label { color: var(--fg-3); font-size: 12px; font-weight: 500; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.kpi-label svg { width: 14px; height: 14px; }
.kpi-value {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-family: 'JetBrains Mono', monospace;
}
.kpi-delta {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; font-weight: 600;
  margin-top: 6px;
  padding: 2px 8px;
  border-radius: 6px;
}
.kpi-delta.up { background: oklch(0.74 0.15 155 / 0.16); color: oklch(0.85 0.15 155); }
.kpi-delta.down { background: oklch(0.7 0.18 25 / 0.16); color: oklch(0.82 0.16 25); }
.kpi-spark {
  position: absolute; right: 0; bottom: 0;
  width: 60%; height: 50%;
  opacity: 0.7;
  pointer-events: none;
}

/* ============ DASH GRID ============ */
.dash-grid {
  display: grid;
  grid-template-columns: 2fr 1.2fr 1fr;
  gap: 16px;
}
.dash-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 16px;
}

/* ============ TABLE ============ */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table th {
  text-align: left;
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fg-3);
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.table td {
  padding: 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: rgba(255,255,255,0.025); }

/* ============ AVATAR ============ */
.avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: inline-grid; place-items: center;
  font-weight: 600; font-size: 11px;
  color: #0a0a14;
  flex-shrink: 0;
  background: var(--accent);
}
.avatar.sm { width: 22px; height: 22px; font-size: 9.5px; }
.avatar.lg { width: 42px; height: 42px; font-size: 14px; }
.avatar.xl { width: 60px; height: 60px; font-size: 19px; }
.avatar-stack { display: flex; }
.avatar-stack .avatar { border: 2px solid #1a1a23; margin-left: -8px; }
.avatar-stack .avatar:first-child { margin-left: 0; }
.avatar-c1 { background: #10b981; }
.avatar-c2 { background: #06b6d4; }
.avatar-c3 { background: #a78bfa; }
.avatar-c4 { background: #f472b6; }
.avatar-c5 { background: #fb923c; }
.avatar-c6 { background: #facc15; }
.avatar-c7 { background: #60a5fa; }
.avatar-c8 { background: #34d399; }

/* ============ CHIP ============ */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--line);
  color: var(--fg-2);
  white-space: nowrap;
}
.chip.clickable { cursor: pointer; }
.chip.clickable:hover { background: rgba(255,255,255,0.08); }
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.ok { background: oklch(0.74 0.15 155 / 0.16); color: oklch(0.85 0.15 155); border-color: oklch(0.74 0.15 155 / 0.25); }
.chip.warn { background: oklch(0.8 0.14 75 / 0.16); color: oklch(0.88 0.14 75); border-color: oklch(0.8 0.14 75 / 0.25); }
.chip.err { background: oklch(0.7 0.18 25 / 0.16); color: oklch(0.82 0.16 25); border-color: oklch(0.7 0.18 25 / 0.25); }
.chip.info { background: oklch(0.74 0.13 235 / 0.16); color: oklch(0.85 0.13 235); border-color: oklch(0.74 0.13 235 / 0.25); }
.chip.pink { background: oklch(0.74 0.16 340 / 0.16); color: oklch(0.85 0.14 340); border-color: oklch(0.74 0.16 340 / 0.25); }
.chip.violet { background: oklch(0.72 0.16 290 / 0.16); color: oklch(0.85 0.14 290); border-color: oklch(0.72 0.16 290 / 0.25); }
.chip.accent { background: var(--accent-soft); color: var(--accent); border-color: oklch(0.74 0.15 var(--accent-h) / 0.3); }

/* ============ KANBAN ============ */
.kanban {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  align-items: start;
  overflow-x: auto;
  /* Board height = full viewport minus topbar and page-head */
  height: calc(100vh - var(--topbar-h) - 160px);
  padding-bottom: 8px;
}
.kanban-col {
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  min-height: 200px;
  backdrop-filter: blur(8px);
  /* Each column scrolls independently */
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.kanban-col-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 2px;
  /* Custom scrollbar */
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.kanban-col-list::-webkit-scrollbar { width: 4px; }
.kanban-col-list::-webkit-scrollbar-track { background: transparent; }
.kanban-col-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }
.kanban-col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding: 0 4px;
  background: none;
}
/* kanban-col-list — see main definition above */
.task-card {
  background: var(--glass-bg);
  background-color: rgba(30, 30, 42, 0.5);
  border: var(--glass-border);
  border-radius: 12px;
  padding: 14px;
  cursor: grab;
  transition: border-color 0.15s, transform 0.1s;
  user-select: none;
  backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
.task-card:hover { border-color: var(--line-strong); }
.task-card.dragging { opacity: 0.4; }
.task-card-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.task-card-title { font-weight: 600; font-size: 13px; line-height: 1.4; margin-bottom: 6px; }
.task-card-meta { color: var(--fg-3); font-size: 11.5px; margin-bottom: 10px; }
.task-card-foot { display: flex; align-items: center; justify-content: space-between; }
.kanban-drop-target { border: 2px dashed var(--accent) !important; background: var(--accent-soft) !important; }

/* ============ MODAL ============ */
/* .modal-overlay base — see CRITICAL MOBILE FIXES section for full definition */
.modal-overlay { z-index: 9998; }
.modal-overlay.open { display: flex; }
.modal {
  width: min(560px, 100%);
  background: rgba(20, 20, 30, 0.85);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(28px) saturate(160%);
  box-shadow: 0 30px 80px -20px rgba(0,0,0,0.7), inset 0 1px 0 rgba(255,255,255,0.08);
  overflow: hidden;
}
.modal-head { padding: 20px 24px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.modal-title { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.modal-body { padding: 22px 24px; }
.modal-foot { padding: 16px 24px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; background: rgba(0,0,0,0.2); }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 11.5px; font-weight: 600; color: var(--fg-3); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.06em; }
.input, .select, .textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--line);
  color: var(--fg);
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.textarea { resize: vertical; min-height: 80px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ============ MEMBERS / GRID ============ */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 16px;
}
.member-card { padding: 22px; text-align: center; }
.member-card .avatar { margin: 0 auto 12px; }
.member-name { font-weight: 600; font-size: 14px; margin-bottom: 2px; }
.member-role { font-size: 12px; color: var(--fg-3); margin-bottom: 12px; }
.member-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding-top: 14px; border-top: 1px solid var(--line); margin-top: 6px; }
.member-stat-val { font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: 13.5px; }
.member-stat-lbl { font-size: 10px; text-transform: uppercase; color: var(--fg-4); letter-spacing: 0.06em; }

/* ============ PORTFOLIO ============ */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 16px;
}
.portfolio-card {
  background: var(--glass-bg);
  background-color: rgba(20, 20, 30, 0.45);
  border: var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--glass-shadow);
  backdrop-filter: var(--glass-blur);
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s;
  position: relative;
}
.portfolio-card::before {
  content: '';
  position: absolute;
  top: 0; left: 14%; right: 14%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  pointer-events: none;
  z-index: 2;
}
.portfolio-card:hover { transform: translateY(-3px); border-color: var(--line-strong); }
.portfolio-img {
  aspect-ratio: 16/10;
  background: rgba(20,20,30,0.5);
  background-image: repeating-linear-gradient(135deg, rgba(255,255,255,0.025) 0 12px, transparent 12px 24px);
  display: grid; place-items: center;
  position: relative;
  overflow: hidden;
}
.portfolio-img::after {
  content: attr(data-label);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: rgba(255,255,255,0.5);
}
.portfolio-img.gradient1 { background: linear-gradient(135deg, oklch(0.38 0.18 232), oklch(0.30 0.20 258)); }
.portfolio-img.gradient2 { background: linear-gradient(135deg, oklch(0.36 0.14 290), oklch(0.42 0.16 340)); }
.portfolio-img.gradient3 { background: linear-gradient(135deg, oklch(0.42 0.14 75), oklch(0.36 0.12 25)); }
.portfolio-info { padding: 14px 18px; }
.portfolio-title { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.portfolio-meta { font-size: 11.5px; color: var(--fg-3); display: flex; justify-content: space-between; align-items: center; }

/* ============ MONITORING ============ */
.monitor-row {
  display: grid;
  grid-template-columns: 1fr 1fr 90px 90px 90px 36px;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.monitor-row:last-child { border-bottom: none; }
.monitor-row:hover { background: rgba(255,255,255,0.025); }
.monitor-name { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.uptime-bar { display: flex; gap: 2px; height: 24px; align-items: stretch; }
.uptime-bar .seg { flex: 1; border-radius: 1.5px; min-width: 2px; }
.uptime-bar .seg.up { background: var(--ok); }
.uptime-bar .seg.down { background: var(--err); }
.uptime-bar .seg.warn { background: var(--warn); }
.mono-num { font-family: 'JetBrains Mono', monospace; font-size: 12.5px; }

/* ============ NOTIFICATIONS ============ */
.notif {
  display: flex;
  gap: 14px;
  padding: 16px 22px 16px 26px;
  border-bottom: 1px solid var(--line);
  position: relative;
  cursor: pointer;
  transition: background 0.15s;
}
.notif:hover { background: rgba(255,255,255,0.025); }
.notif:last-child { border-bottom: none; }
.notif.unread::before {
  content: ''; position: absolute; left: 10px; top: 24px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
}
.notif-icon {
  width: 38px; height: 38px;
  border-radius: 11px;
  display: grid; place-items: center;
  flex-shrink: 0;
  border: 1px solid var(--line);
}
.notif-icon svg { width: 16px; height: 16px; }
.notif-body { flex: 1; min-width: 0; }
.notif-title { font-size: 13.5px; margin-bottom: 2px; }
.notif-title b { font-weight: 600; }
.notif-time { font-size: 11.5px; color: var(--fg-4); font-family: 'JetBrains Mono', monospace; }
.notif-meta { font-size: 12px; color: var(--fg-3); margin-top: 4px; }

/* ============ SETTINGS ============ */
.settings-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 20px;
}
.settings-nav { display: flex; flex-direction: column; gap: 2px; padding: 10px; }
.settings-nav button {
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--fg-2);
  font-size: 13px;
  font-weight: 500;
}
.settings-nav button:hover { background: rgba(255,255,255,0.04); color: var(--fg); }
.settings-nav button.active { background: var(--accent-soft); color: var(--accent); }
.settings-section { padding: 26px; }
.settings-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.settings-row:last-child { border-bottom: none; }
.settings-label { font-weight: 600; font-size: 13.5px; margin-bottom: 2px; }
.settings-desc { font-size: 12px; color: var(--fg-3); }
.toggle {
  width: 38px; height: 22px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  position: relative;
  transition: background 0.15s;
  flex-shrink: 0;
  border: 1px solid var(--line);
}
.toggle::after {
  content: ''; position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--fg);
  transition: transform 0.18s;
}
.toggle.on { background: var(--accent); border-color: transparent; }
.toggle.on::after { transform: translateX(16px); background: #020818; }

/* ============ RESPONSIVE ============ */
@media (max-width: 1280px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-grid { grid-template-columns: 1fr; }
  .dash-grid-3 { grid-template-columns: 1fr 1fr; }
  /* kanban mobile — see 480px block */
}
@media (max-width: 860px) {
  .app { grid-template-columns: 72px 1fr !important; }
  .sidebar { padding: 14px 8px; margin: 10px 0 10px 10px; }
  .nav-label, .brand-name, .upgrade, .org-meta, .nav-badge, .sidebar-section-label { display: none; }
  .nav-item { justify-content: center; padding: 10px; }
  .org { justify-content: center; padding: 6px; }
  .page { padding: 6px 14px 24px; }
  .topbar { padding: 10px 14px; gap: 8px; }
  .topbar-inner { padding: 0 10px; }
  .search { max-width: none; }
  .user-pill .name, .user-pill .handle, .user-pill svg { display: none; }
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .dash-grid-3 { grid-template-columns: 1fr; }
  /* kanban mobile — see 480px block */
  .settings-layout { grid-template-columns: 1fr; }
  .monitor-row { grid-template-columns: 1fr 80px; gap: 8px; font-size: 12px; }
  .monitor-row > :nth-child(2),
  .monitor-row > :nth-child(4),
  .monitor-row > :nth-child(5) { display: none; }
  .field-row { grid-template-columns: 1fr; }
}

/* ============================================================
   BLIZZNEX CRM — EXTENDED COMPONENT STYLES
   Completes all page-specific components missing from base
   ============================================================ */

/* ===== UTILITY / TYPOGRAPHY ===== */
.strong { font-weight: 600; }
.muted  { color: var(--fg-3); font-size: 12px; }
.link   { color: var(--accent); cursor: pointer; }
.link:hover { text-decoration: underline; }

/* ===== MODAL SUB-TITLE ===== */
.modal-sub { font-size: 12px; color: var(--fg-3); margin-top: 2px; }

/* ===== SEGMENTED CONTROL ===== */
.seg {
  display: inline-flex;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}
.seg-item {
  padding: 6px 14px;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--fg-2);
  transition: background 0.15s, color 0.15s;
}
.seg-item:hover { color: var(--fg); }
.seg-item.active {
  background: rgba(255,255,255,0.10);
  color: var(--fg);
  font-weight: 600;
}

/* ===== FORM GRID & FIELD LABEL ===== */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.form-grid .field.full { grid-column: 1 / -1; }
.field-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--fg-3);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

/* ===== KPI GRID VARIANT ===== */
.kpi-grid.kpi-4 { grid-template-columns: repeat(4, 1fr); }

/* ============ CLIENTS PAGE ============ */
/* Logo tiles (company initials squares) */
.logo-tile {
  width: 34px; height: 34px;
  border-radius: 9px;
  display: inline-grid; place-items: center;
  font-weight: 700; font-size: 11px;
  flex-shrink: 0;
  color: rgba(10,10,14,0.85);
  letter-spacing: -0.01em;
}
.lt-1 { background: linear-gradient(135deg, oklch(0.63 0.22 232), oklch(0.55 0.22 252)); }
.lt-2 { background: linear-gradient(135deg, oklch(0.74 0.13 235), oklch(0.64 0.14 260)); }
.lt-3 { background: linear-gradient(135deg, oklch(0.72 0.16 290), oklch(0.64 0.15 315)); }
.lt-4 { background: linear-gradient(135deg, oklch(0.74 0.16 340), oklch(0.64 0.15 10)); }
.lt-5 { background: linear-gradient(135deg, oklch(0.8 0.14 75), oklch(0.72 0.14 50)); }
.lt-6 { background: linear-gradient(135deg, oklch(0.7 0.18 25), oklch(0.62 0.15 5)); }
.lt-7 { background: linear-gradient(135deg, oklch(0.74 0.15 130), oklch(0.64 0.13 155)); }
.lt-8 { background: linear-gradient(135deg, oklch(0.74 0.14 200), oklch(0.64 0.13 225)); }

/* Health bar */
.health {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  color: var(--fg-2);
}
.health-bar {
  width: 72px; height: 5px;
  background: rgba(255,255,255,0.07);
  border-radius: 999px;
  overflow: hidden;
  flex-shrink: 0;
}
.health-bar > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s ease;
}

/* ============ PROJECTS PAGE ============ */
.proj-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 16px;
}
.proj-cover {
  aspect-ratio: 16/9;
  border-radius: var(--radius) var(--radius) 0 0;
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: var(--bg-3);
}
.proj-cover-glyph {
  font-size: 40px;
  font-weight: 800;
  color: rgba(255,255,255,0.12);
  letter-spacing: -0.04em;
  user-select: none;
}
.card-body { padding: 14px 16px 16px; }

/* Progress bar */
.progress {
  height: 5px;
  background: rgba(255,255,255,0.07);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 10px;
}
.progress > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), oklch(0.68 0.16 var(--accent-h)));
  transition: width 0.5s ease;
}

/* "Add" ghost card */
.project-add {
  border: 2px dashed rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.02) !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 220px;
  color: var(--fg-3);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.project-add:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft) !important;
}

/* Project template chooser */
.template-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.tmpl {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 8px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.025);
  transition: border-color 0.15s, background 0.15s;
  cursor: pointer;
  text-align: center;
}
.tmpl:hover { border-color: var(--accent); background: var(--accent-soft); }
.tmpl.active { border-color: var(--accent); background: var(--accent-soft); }
.tmpl-icon {
  width: 42px; height: 42px;
  border-radius: 11px;
  display: grid; place-items: center;
  margin-bottom: 2px;
}

/* ============ TASKS PAGE (KANBAN) ============ */
.task-title {
  font-weight: 600;
  font-size: 13px;
  line-height: 1.4;
  margin-bottom: 4px;
  color: var(--fg);
}
.task-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

/* Column header pieces */
.col-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.col-title {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--fg-3);
  flex: 1;
}
.col-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--fg-4);
  background: rgba(255,255,255,0.06);
  padding: 1px 7px;
  border-radius: 999px;
  font-weight: 600;
}
.kanban-col-head {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
}
.kanban-add {
  width: 100%;
  padding: 8px;
  border-radius: 8px;
  border: 1px dashed rgba(255,255,255,0.08);
  color: var(--fg-4);
  font-size: 12px;
  font-weight: 500;
  text-align: left;
  transition: border-color 0.15s, color 0.15s;
  margin-top: 4px;
}
.kanban-add:hover { border-color: var(--accent); color: var(--accent); }

.task-done .task-title { opacity: 0.45; text-decoration: line-through; }
.task-done { opacity: 0.6; }

/* ============ MEMBERS PAGE ============ */
.member-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.card.member-card { padding: 0; overflow: hidden; }
.member-cover {
  height: 56px;
  flex-shrink: 0;
}
.member-body {
  padding: 0 18px 18px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.member-body .avatar.lg {
  margin-top: -20px;
  border: 3px solid rgba(20,20,30,0.8);
  width: 44px; height: 44px;
  font-size: 15px;
}
.member-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 100%;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  margin-top: 10px;
  text-align: center;
}
.member-stats > div .mono { font-size: 13px; font-weight: 700; }
.member-stats > div .muted { font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; }

/* ============ PORTFOLIO PAGE ============ */
.pf-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  align-items: start;
}
.pf-tile {
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.22s, border-color 0.2s;
}
.pf-tile:hover { transform: translateY(-4px); }
.pf-tile.pf-large { /* unused */ }
.pf-cover {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 14px;
}
.pf-cover-stripes {
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    135deg,
    rgba(255,255,255,0.04) 0 1px,
    transparent 1px 18px
  );
  pointer-events: none;
}
.pf-cover-label {
  position: relative;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: rgba(255,255,255,0.55);
  text-transform: uppercase;
}
.pf-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: rgba(20,20,30,0.55);
  border-top: 1px solid var(--line);
  flex-shrink: 0;
}
.pf-meta .strong { font-size: 13.5px; }

/* ============ WEBSITE MONITOR PAGE ============ */
.monitor-list { padding: 0; }
.mon-row {
  display: grid;
  grid-template-columns: 28px 200px 1fr 88px 88px 88px 38px;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  transition: background 0.15s;
}
.mon-row:last-child { border-bottom: none; }
.mon-row:hover { background: rgba(255,255,255,0.025); }
.mon-status {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
}
.mon-status.up  { background: var(--ok); box-shadow: 0 0 10px oklch(0.74 0.15 155 / 0.6); }
.mon-status.warn{ background: var(--warn); box-shadow: 0 0 10px oklch(0.8 0.14 75 / 0.6); }
.mon-status.down{ background: var(--err); box-shadow: 0 0 10px oklch(0.7 0.18 25 / 0.6); }
.mon-domain .strong { font-size: 13px; }
.mon-bars { min-width: 0; }
.mon-stat { text-align: right; }
.mon-stat .muted { font-size: 10px; margin-bottom: 2px; }
.mon-stat .strong { font-size: 13px; }

/* Incident list (monitor page) */
.incident {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.incident:last-child { border-bottom: none; }
.inc-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  margin-top: 3px;
  flex-shrink: 0;
}
.inc-dot.ok   { background: var(--ok); box-shadow: 0 0 8px oklch(0.74 0.15 155 / 0.5); }
.inc-dot.warn { background: var(--warn); box-shadow: 0 0 8px oklch(0.8 0.14 75 / 0.5); }
.inc-dot.err  { background: var(--err); box-shadow: 0 0 8px oklch(0.7 0.18 25 / 0.5); }

/* ============ NOTIFICATIONS PAGE ============ */
.notif-day {
  padding: 10px 22px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-4);
  border-bottom: 1px solid var(--line);
  background: rgba(0,0,0,0.12);
}
.notif-quote {
  font-size: 12px;
  color: var(--fg-3);
  margin-top: 5px;
  padding-left: 10px;
  border-left: 2px solid var(--line-strong);
  line-height: 1.5;
}
.notif-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
  padding-top: 2px;
}
.notif-meta .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}

/* ============ SETTINGS PAGE ============ */
.settings-shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 20px;
  align-items: start;
}
.settings-nav {
  background: var(--glass-bg);
  background-color: rgba(20, 20, 30, 0.45);
  border: var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--glass-shadow);
  backdrop-filter: var(--glass-blur);
  padding: 10px;
  position: sticky;
  top: 0;
}
.settings-nav-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--fg-4);
  padding: 12px 12px 6px;
  font-weight: 600;
}
.settings-nav button {
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-2);
  transition: background 0.15s, color 0.15s;
  display: block;
}
.settings-nav button:hover { background: rgba(255,255,255,0.04); color: var(--fg); }
.settings-nav button.active { background: var(--accent-soft); color: var(--accent); }
.settings-body { display: flex; flex-direction: column; gap: 0; }
.settings-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 16px;
}
.settings-title { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.setting-row:last-child { border-bottom: none; }

/* Accent swatches */
.swatch {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
  box-shadow: 0 3px 8px rgba(0,0,0,0.4);
}
.swatch:hover { transform: scale(1.15); }
.swatch.active { border-color: var(--fg); transform: scale(1.1); }

/* Integrations grid */
.integ-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}
.integ {
  background: var(--glass-bg);
  background-color: rgba(20, 20, 30, 0.45);
  border: var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--glass-shadow);
  backdrop-filter: var(--glass-blur);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 160px;
}
.integ .strong { font-size: 13.5px; }
.integ .muted { font-size: 12px; }
.integ-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--line);
  display: grid; place-items: center;
  margin-bottom: 8px;
  color: var(--fg-2);
}

/* Checkbox label */
.check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--fg-2);
  cursor: pointer;
}
.check input[type="checkbox"] {
  accent-color: var(--accent);
  width: 14px; height: 14px;
  cursor: pointer;
}

/* ============ RESPONSIVE ADDITIONS ============ */
@media (max-width: 1280px) {
  .pf-grid { grid-template-columns: repeat(2, 1fr); }
  .pf-tile.pf-large { /* unused */ }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .field.full { grid-column: 1; }
  .settings-shell { grid-template-columns: 180px 1fr; }
  .mon-row { grid-template-columns: 28px 160px 1fr 70px 70px 38px; }
}
@media (max-width: 860px) {
  .proj-grid { grid-template-columns: 1fr 1fr; }
  .member-grid { grid-template-columns: 1fr 1fr; }
  .pf-grid { grid-template-columns: 1fr; grid-auto-rows: 200px; }
  .pf-tile.pf-large { /* unused */ }
  .kpi-grid.kpi-4 { grid-template-columns: 1fr 1fr; }
  .settings-shell { grid-template-columns: 1fr; }
  .integ-grid { grid-template-columns: 1fr 1fr; }
  .template-grid { grid-template-columns: 1fr 1fr; }
  .mon-row {
    grid-template-columns: 28px 1fr 80px 38px;
  }
  .mon-row .mon-bars { display: none; }
  .mon-row .mon-stat:nth-child(5),
  .mon-row .mon-stat:nth-child(6) { display: none; }
}
@media (max-width: 600px) {
  .proj-grid { grid-template-columns: 1fr; }
  .member-grid { grid-template-columns: 1fr; }
}

/* ============ PROFILE DROPDOWN ============ */
.profile-wrap {
  position: relative;
}
.user-pill {
  cursor: pointer;
  user-select: none;
}
.profile-dropdown {
  position: fixed;
  top: 0; right: 0; /* overridden by JS */
  width: 252px;
  background: rgba(10, 10, 18, 0.96);
  border: 1px solid rgba(255,255,255,0.11);
  border-radius: 18px;
  backdrop-filter: blur(32px) saturate(180%);
  -webkit-backdrop-filter: blur(32px) saturate(180%);
  box-shadow:
    0 28px 70px -12px rgba(0,0,0,0.9),
    0 6px 20px -4px rgba(0,0,0,0.6),
    inset 0 1px 0 rgba(255,255,255,0.12),
    inset 0 0 0 1px rgba(255,255,255,0.04);
  z-index: 9999;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-6px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.2s cubic-bezier(0.16,1,0.3,1), transform 0.2s cubic-bezier(0.16,1,0.3,1);
  transform-origin: top right;
}
.profile-dropdown.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* Top user header */
.pd-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: linear-gradient(135deg, oklch(0.60 0.24 228 / 0.18), oklch(0.52 0.26 258 / 0.10));
}
.pd-avatar {
  width: 38px; height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, oklch(0.60 0.24 228), oklch(0.52 0.26 258));
  display: grid; place-items: center;
  font-weight: 700; font-size: 13px;
  color: #e8eeff;
  flex-shrink: 0;
  box-shadow: 0 4px 12px oklch(0.60 0.24 228 / 0.4);
}
.pd-info { flex: 1; min-width: 0; }
.pd-name { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pd-handle { font-size: 11.5px; color: var(--fg-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pd-badge {
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: linear-gradient(135deg, oklch(0.60 0.24 228 / 0.3), oklch(0.52 0.26 258 / 0.3));
  color: oklch(0.80 0.18 232);
  border: 1px solid oklch(0.60 0.24 228 / 0.3);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Menu items */
.pd-section {
  padding: 6px;
}
.pd-divider {
  height: 1px;
  background: rgba(255,255,255,0.06);
  margin: 2px 0;
}
.pd-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-2);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  width: 100%;
  text-align: left;
  text-decoration: none;
}
.pd-item:hover {
  background: rgba(255,255,255,0.06);
  color: var(--fg);
}
.pd-item svg {
  width: 15px; height: 15px;
  flex-shrink: 0;
  color: var(--fg-3);
}
.pd-item:hover svg { color: var(--fg-2); }
.pd-item .pd-item-right {
  margin-left: auto;
  font-size: 10.5px;
  color: var(--fg-4);
  font-family: 'JetBrains Mono', monospace;
}
.pd-item.danger { color: oklch(0.78 0.16 25); }
.pd-item.danger svg { color: oklch(0.78 0.16 25); }
.pd-item.danger:hover { background: oklch(0.7 0.18 25 / 0.12); color: oklch(0.85 0.16 25); }

/* Accent dots row in dropdown */
.pd-accents {
  display: flex;
  gap: 7px;
  padding: 10px 12px;
  align-items: center;
}
.pd-accents span { font-size: 11.5px; color: var(--fg-3); flex: 1; }
.pd-dot {
  width: 20px; height: 20px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.15s, border-color 0.15s;
  flex-shrink: 0;
}
.pd-dot:hover { transform: scale(1.2); }
.pd-dot.active { border-color: rgba(255,255,255,0.7); }

/* ============================================================
   ANIMATIONS & INTERACTIONS
   ============================================================ */

/* Ripple keyframe */
@keyframes rippleAnim {
  to { transform: scale(1); opacity: 0; }
}

/* Smooth accent transitions across the whole UI */
:root { transition: --accent-h 0.3s; }
*, *::before, *::after {
  transition-property: background-color, border-color, box-shadow, color, opacity, transform;
  transition-duration: 0.15s;
  transition-timing-function: ease;
}
/* Don't add transition to elements that manage their own */
.profile-dropdown, .kpi-card, .progress > span, .health-bar > span,
.uptime-bar span, .modal-overlay, .modal-box, .sidebar, .nav-item { transition: unset; }

/* Re-apply explicit transitions */

.nav-item {
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease !important;
}
.btn { transition: background 0.15s, border-color 0.15s, transform 0.12s, box-shadow 0.15s, filter 0.15s !important; }
.icon-btn { transition: background 0.15s, color 0.15s, transform 0.12s !important; }

/* Button press feedback */
.btn:active    { transform: translateY(1px) scale(0.985) !important; }
.icon-btn:active { transform: scale(0.88) !important; }

/* Card hover lift */
.card:not(.kpi-card) {
  transition: transform 0.25s cubic-bezier(0.16,1,0.3,1), box-shadow 0.25s ease, border-color 0.2s !important;
}
.card:not(.kpi-card):hover {
  transform: translateY(-2px);
  border-color: rgba(255,255,255,0.12);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    0 20px 50px -16px rgba(0,0,0,0.7),
    0 4px 12px -4px rgba(0,0,0,0.4);
}

/* Proj card hover */
.proj-card {
  transition: transform 0.25s cubic-bezier(0.16,1,0.3,1), border-color 0.2s, box-shadow 0.25s !important;
}
.proj-card:hover { transform: translateY(-4px) !important; border-color: rgba(255,255,255,0.14) !important; }

/* Member card */
.member-card { transition: transform 0.25s cubic-bezier(0.16,1,0.3,1), border-color 0.2s !important; }
.member-card:hover { transform: translateY(-3px) !important; border-color: rgba(255,255,255,0.14) !important; }

/* Task card drag */
.task-card { transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s !important; }
.task-card:hover { transform: translateY(-1px); box-shadow: 0 8px 24px -8px rgba(0,0,0,0.6) !important; }
.task-card.dragging { opacity: 0.4; transform: scale(0.96) rotate(1.5deg) !important; }

/* Kanban drop target */
.kanban-col.kanban-drop-target {
  background: rgba(var(--accent-rgb, 80,130,255), 0.06) !important;
  border-color: var(--accent) !important;
  transition: background 0.15s, border-color 0.15s !important;
}

/* Table row hover */
.table-row {
  transition: background 0.14s ease !important;
}

/* Notification hover */
.notif {
  transition: background 0.14s !important;
}

/* Uptime bars */
.uptime-bar span {
  transition: transform 0.3s cubic-bezier(0.16,1,0.3,1) !important;
  transform-origin: bottom;
}

/* Monitor row pulse on up status */
@keyframes pulseUp {
  0%, 100% { box-shadow: 0 0 8px oklch(0.74 0.15 155 / 0.5); }
  50%       { box-shadow: 0 0 18px oklch(0.74 0.15 155 / 0.9), 0 0 32px oklch(0.74 0.15 155 / 0.3); }
}
.mon-status.up { animation: pulseUp 2.4s ease-in-out infinite; }

/* Sidebar nav active glow */
.nav-item.active {
  position: relative;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--accent-soft);
  animation: fadeIn 0.3s ease;
}

/* Notification unread pulse */
@keyframes unreadPing {
  0%   { box-shadow: 0 0 0 0 var(--accent-glow); }
  70%  { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.notif.unread .notif-icon {
  animation: unreadPing 2s ease infinite;
}

/* Modal animate in */
.modal-overlay { transition: opacity 0.2s ease !important; }
.modal-overlay.open { animation: modalIn 0.25s cubic-bezier(0.16,1,0.3,1) both; }
@keyframes modalIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.modal-overlay .modal-box {
  transition: transform 0.28s cubic-bezier(0.16,1,0.3,1), opacity 0.2s ease !important;
}
.modal-overlay:not(.open) .modal-box { transform: scale(0.95) translateY(10px); opacity: 0; }
.modal-overlay.open .modal-box       { transform: scale(1) translateY(0); opacity: 1; }

/* Badge bounce on mount */
@keyframes badgePop {
  0%   { transform: scale(0); }
  70%  { transform: scale(1.2); }
  100% { transform: scale(1); }
}
.nav-badge { animation: badgePop 0.4s cubic-bezier(0.16,1,0.3,1) both; animation-delay: 0.6s; }

/* Chevron rotate in user pill */
#profile-trigger svg:last-child {
  transition: transform 0.22s cubic-bezier(0.16,1,0.3,1) !important;
}

/* Sidebar brand mark glow pulse */
@keyframes brandPulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--accent-glow); }
  50%       { box-shadow: 0 0 24px 6px var(--accent-glow); }
}
.brand-mark {
  animation: brandPulse 4s ease-in-out infinite;
}

/* Page content fade on load */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.main { animation: fadeIn 0.3s ease; }

/* Toggle smooth */
.toggle { transition: background 0.2s ease, border-color 0.2s ease !important; }
.toggle::after { transition: transform 0.22s cubic-bezier(0.16,1,0.3,1), background 0.2s !important; }

/* Search bar focus */
.search input { transition: background 0.15s, box-shadow 0.15s !important; }
.search input:focus {
  background: rgba(255,255,255,0.07);
  box-shadow: 0 0 0 2px var(--accent-soft), 0 0 16px -4px var(--accent-glow);
}

/* PF tile hover */
.pf-tile {
  transition: transform 0.25s cubic-bezier(0.16,1,0.3,1), border-color 0.2s !important;
}
.pf-tile:hover { transform: translateY(-5px) !important; }

/* pd-item hover */
.pd-item {
  transition: background 0.12s ease, color 0.12s ease !important;
}

/* Integ card hover */
.integ {
  transition: transform 0.22s cubic-bezier(0.16,1,0.3,1), border-color 0.2s !important;
}
.integ:hover { transform: translateY(-2px); border-color: rgba(255,255,255,0.14) !important; }

/* Swatch hover */
.swatch, .pd-dot {
  transition: transform 0.15s ease, border-color 0.15s !important;
}

/* ============ ADMIN ANNOUNCEMENT BAR ============ */
.announce-bar {
  display: flex;
  align-items: center;
  gap: 0;
  height: 38px;
  margin-bottom: 16px;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(90deg,
    oklch(0.18 0.06 232) 0%,
    oklch(0.14 0.04 240) 50%,
    oklch(0.18 0.06 232) 100%
  );
  border: 1px solid oklch(0.60 0.24 228 / 0.28);
  box-shadow:
    0 0 0 1px oklch(0.60 0.24 228 / 0.08),
    0 4px 24px -8px oklch(0.60 0.24 228 / 0.25),
    inset 0 1px 0 rgba(255,255,255,0.07);
  animation: announceSlideIn 0.45s cubic-bezier(0.16,1,0.3,1) both;
  animation-delay: 0.15s;
  flex-shrink: 0;
}
@keyframes announceSlideIn {
  from { opacity: 0; transform: translateY(-8px); max-height: 0; margin-bottom: 0; }
  to   { opacity: 1; transform: translateY(0);    max-height: 38px; margin-bottom: 16px; }
}
.announce-bar.dismissed {
  animation: announceDismiss 0.3s cubic-bezier(0.4,0,1,1) both;
}
@keyframes announceDismiss {
  from { opacity: 1; max-height: 38px; margin-bottom: 16px; }
  to   { opacity: 0; max-height: 0;    margin-bottom: 0; padding: 0; }
}

/* Left accent stripe */
.announce-bar::before {
  content: '';
  display: block;
  width: 3px;
  height: 100%;
  flex-shrink: 0;
  background: linear-gradient(180deg, oklch(0.70 0.22 228), oklch(0.55 0.26 252));
  border-radius: 0 2px 2px 0;
}

/* Scrolling ticker */
.announce-ticker {
  flex: 1;
  overflow: hidden;
  position: relative;
  height: 100%;
  mask-image: linear-gradient(90deg, transparent 0%, #000 60px, #000 calc(100% - 60px), transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 60px, #000 calc(100% - 60px), transparent 100%);
}
.announce-track {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 100%;
  white-space: nowrap;
  /* animation handled by JS for stutter-free scroll */
  will-change: transform;
}
.announce-ticker:hover .announce-track {
  /* pause handled by JS */
}

.announce-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: oklch(0.88 0.04 232);
  flex-shrink: 0;
}
.announce-sep {
  color: oklch(0.50 0.08 232);
  font-size: 14px;
  flex-shrink: 0;
  user-select: none;
}

/* Tags */
.announce-tag {
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  flex-shrink: 0;
}
.tag-info {
  background: oklch(0.60 0.24 228 / 0.25);
  color: oklch(0.78 0.18 228);
  border: 1px solid oklch(0.60 0.24 228 / 0.35);
}
.tag-warn {
  background: oklch(0.8 0.14 75 / 0.18);
  color: oklch(0.88 0.14 75);
  border: 1px solid oklch(0.8 0.14 75 / 0.32);
}
.tag-ok {
  background: oklch(0.74 0.15 155 / 0.18);
  color: oklch(0.80 0.15 155);
  border: 1px solid oklch(0.74 0.15 155 / 0.32);
}
.tag-err {
  background: oklch(0.7 0.18 25 / 0.18);
  color: oklch(0.82 0.16 25);
  border: 1px solid oklch(0.7 0.18 25 / 0.32);
}
/* Announce tag aliases — DB stores 'warning','success','error' not 'warn','ok','err' */
.tag-warning {
  background: oklch(0.8 0.14 75 / 0.22);
  color: oklch(0.92 0.16 75);
  border: 1px solid oklch(0.8 0.14 75 / 0.4);
}
.tag-success {
  background: oklch(0.74 0.15 155 / 0.22);
  color: oklch(0.88 0.17 155);
  border: 1px solid oklch(0.74 0.15 155 / 0.4);
}
.tag-error {
  background: oklch(0.7 0.18 25 / 0.22);
  color: oklch(0.90 0.18 25);
  border: 1px solid oklch(0.7 0.18 25 / 0.4);
}


/* Dismiss button */
.announce-close {
  flex-shrink: 0;
  width: 32px; height: 100%;
  display: grid; place-items: center;
  color: oklch(0.60 0.10 232);
  transition: color 0.15s, background 0.15s;
  border-radius: 0 10px 10px 0;
}
.announce-close:hover {
  color: oklch(0.85 0.04 232);
  background: rgba(255,255,255,0.06);
}

/* ============ 4-COL BOTTOM GRID ============ */
.dash-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 16px;
}

/* ============ SPRINT VELOCITY COMPACT CARD ============ */
.sv-card { display: flex; flex-direction: column; gap: 4px; }

.sv-number {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #e8f0ff 0%, oklch(0.80 0.18 232) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Gauge wrapper */
.sv-gauge-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  margin: 4px 0 0;
}
.sv-gauge { width: 100%; max-width: 200px; }

/* Arc draw-on animation */
.sv-arc {
  stroke-dasharray: 257.6;
  stroke-dashoffset: 257.6;
  animation: svArcDraw 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.4s forwards;
}
@keyframes svArcDraw {
  to { stroke-dashoffset: 32; }
}

/* Needle dot pop */
.sv-dot {
  transform-origin: 100px 100px;
  opacity: 0;
  animation: svDotPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 1.4s forwards;
}
@keyframes svDotPop {
  from { opacity: 0; transform: scale(0); }
  to   { opacity: 1; transform: scale(1); }
}

/* Centre label inside the gauge arc opening */
.sv-gauge-label {
  position: absolute;
  bottom: 4px;
  text-align: center;
  pointer-events: none;
}

/* Spark bars */
.sv-sparks {
  display: flex;
  gap: 6px;
  align-items: flex-end;
  height: 42px;
  padding: 0 2px;
  margin-top: 8px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}
.sv-spark-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
  justify-content: flex-end;
}
.sv-spark-bar {
  width: 100%;
  border-radius: 4px 4px 2px 2px;
  background: rgba(255,255,255,0.1);
  height: var(--h, 50%);
  transform: scaleY(0);
  transform-origin: bottom;
  animation: svSparkGrow 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.sv-spark-item:nth-child(1) .sv-spark-bar { animation-delay: 1.5s; }
.sv-spark-item:nth-child(2) .sv-spark-bar { animation-delay: 1.62s; }
.sv-spark-item:nth-child(3) .sv-spark-bar { animation-delay: 1.74s; }
.sv-spark-item:nth-child(4) .sv-spark-bar { animation-delay: 1.86s; }
@keyframes svSparkGrow {
  from { transform: scaleY(0); }
  to   { transform: scaleY(1); }
}

/* Active (current) spark bar — accent gradient */
.sv-spark-active .sv-spark-bar {
  background: linear-gradient(180deg, oklch(0.63 0.22 232), oklch(0.52 0.26 258));
  box-shadow: 0 0 12px oklch(0.63 0.22 232 / 0.5);
}
.sv-spark-lbl {
  font-size: 9.5px;
  color: var(--fg-4);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.sv-spark-active .sv-spark-lbl { color: var(--accent); }

/* Responsive */
@media (max-width: 1280px) {
  .dash-grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .dash-grid-4 { grid-template-columns: 1fr; }
}

/* ============ CHART SKELETON + LOAD ANIMATION ============ */
.chart-card { position: relative; }

/* Skeleton shimmer */
@keyframes shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position:  600px 0; }
}
.chart-skeleton {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 200px;
  padding: 0 4px;
  margin-bottom: 0;
}
.skel-bar {
  flex: 1;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(90deg,
    rgba(255,255,255,0.04) 25%,
    rgba(255,255,255,0.10) 50%,
    rgba(255,255,255,0.04) 75%
  );
  background-size: 600px 100%;
  animation: shimmer 1.5s infinite linear;
}
.skel-bar:nth-child(2) { animation-delay: 0.1s; }
.skel-bar:nth-child(3) { animation-delay: 0.2s; }
.skel-bar:nth-child(4) { animation-delay: 0.3s; }
.skel-bar:nth-child(5) { animation-delay: 0.4s; }
.skel-bar:nth-child(6) { animation-delay: 0.5s; }
.skel-bar:nth-child(7) { animation-delay: 0.6s; }
.skel-bar:nth-child(8) { animation-delay: 0.7s; }

/* Chart SVG hidden then revealed */
.chart-svg { display: block; }
.chart-skeleton.hidden { display: none; }

/* Line draw-on */
.rev-line {
  stroke-dasharray: 900;
  stroke-dashoffset: 900;
  transition: stroke-dashoffset 1.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.rev-line.drawn { stroke-dashoffset: 0; }

/* Clip rect expand (fills area under line) */
.rev-clip-rect {
  transition: width 1.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* End dot pop */
.rev-dot {
  transition: opacity 0.3s ease 1.3s;
}
.rev-dot.shown { opacity: 1; }

/* ============ DASHBOARD TASK LIST ============ */
.dash-task-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 4px 0 12px;
}
.dash-task {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 8px;
  border-radius: 10px;
  transition: background 0.14s ease;
  cursor: pointer;
}
.dash-task:hover { background: rgba(255,255,255,0.04); }
.dash-task[data-done="true"] { opacity: 0.45; }
.dash-task[data-done="true"] .dash-task-title { text-decoration: line-through; color: var(--fg-3); }

/* Checkbox */
.dash-task-check {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.2);
  flex-shrink: 0;
  display: grid; place-items: center;
  transition: border-color 0.15s, background 0.15s, transform 0.2s cubic-bezier(0.34,1.56,0.64,1);
  position: relative;
}
.dash-task-check::after {
  content: '';
  width: 5px; height: 9px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(45deg) translate(-1px, -1px) scale(0);
  transition: transform 0.18s cubic-bezier(0.34,1.56,0.64,1);
  margin-top: -2px;
}
.dash-task-check.is-done {
  background: linear-gradient(135deg, oklch(0.60 0.24 228), oklch(0.52 0.26 258));
  border-color: transparent;
  box-shadow: 0 0 10px oklch(0.60 0.24 228 / 0.4);
  transform: scale(1.1);
}
.dash-task-check.is-done::after { transform: rotate(45deg) translate(-1px, -1px) scale(1); }
.dash-task-check:hover { border-color: var(--accent); transform: scale(1.15); }

.dash-task-body { flex: 1; min-width: 0; }
.dash-task-title {
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}
.dash-task-meta {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Add task button */
.dash-add-task {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--fg-4);
  border: 1px dashed rgba(255,255,255,0.08);
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  margin-top: 4px;
}
.dash-add-task:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

/* Responsive */
@media (max-width: 1300px) {
  .dash-grid { grid-template-columns: 2fr 1fr; }
  .dash-grid .sv-card { display: none; } /* hide velocity at medium, still in bottom grid */
}
@media (max-width: 1100px) {
  .dash-grid { grid-template-columns: 1fr; }
}

/* ============ DASH RIGHT COLUMN (tasks + velocity stacked) ============ */
.dash-right-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
}
.dash-right-col .card:first-child {
  flex: 1;          /* task list grows to fill space */
  overflow-y: auto;
}
.dash-right-col .sv-card {
  flex-shrink: 0;   /* velocity card stays its natural height */
}

/* Also remove the responsive hide rule we added earlier */
@media (max-width: 1300px) {
  .dash-grid .sv-card { display: flex; } /* undo the earlier hide */
  .dash-grid { grid-template-columns: 2fr 1fr; }
}

/* ============ PHP CRM SPECIFIC ============ */
.login-body { display:grid; place-items:center; min-height:100vh; background:var(--bg-0); }
.login-wrap { width:100%; max-width:420px; padding:20px; }
.login-card { background:rgba(20,20,30,0.8); border:1px solid var(--line); border-radius:20px; padding:32px; backdrop-filter:blur(20px); }
.login-hint { display:flex; align-items:center; gap:8px; padding:8px 12px; border-radius:8px; border:1px solid var(--line); cursor:pointer; transition:background .15s; }
.login-hint:hover { background:rgba(255,255,255,.05); }
.input { width:100%; padding:9px 12px; background:rgba(255,255,255,.05); border:1px solid var(--line); border-radius:9px; color:var(--fg); font-size:13.5px; font-family:inherit; outline:none; transition:border-color .15s,box-shadow .15s; }
.input:focus { border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-soft); }
textarea.input { min-height:80px; }
select.input option { background:#1a1a28; }
.flash-msg { padding:10px 16px; border-radius:10px; font-size:13px; font-weight:500; margin-bottom:12px; display:flex; align-items:center; justify-content:space-between; gap:10px; }
.flash-success { background:oklch(.74 .15 155/.2); border:1px solid oklch(.74 .15 155/.4); color:oklch(.85 .12 155); }
.flash-error   { background:oklch(.7 .18 25/.2);  border:1px solid oklch(.7 .18 25/.4);  color:oklch(.85 .14 25); }
.flash-info    { background:oklch(.63 .22 232/.2); border:1px solid oklch(.63 .22 232/.4); color:oklch(.82 .16 232); }
.flash-msg button { background:none; border:none; color:inherit; cursor:pointer; font-size:18px; opacity:.6; padding:0; line-height:1; }
.table-row:hover { background:rgba(255,255,255,.025); cursor:pointer; }
/* modal-overlay consolidated */
/* modal-overlay.open consolidated */
/* modal-box consolidated */
.modal-head { display:flex; align-items:center; justify-content:space-between; padding:18px 22px; border-bottom:1px solid var(--line); }
.modal-title { font-size:16px; font-weight:700; }
.modal-foot { display:flex; align-items:center; justify-content:flex-end; gap:8px; padding:16px 22px; border-top:1px solid var(--line); }
[data-modal-close] { cursor:pointer; }
.sidebar-role-badge { padding:6px 12px 10px; }
.role-pill { display:inline-block; padding:3px 10px; border-radius:999px; font-size:10.5px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; }
.role-admin   { background:oklch(.63 .22 232/.2); color:oklch(.80 .18 232); border:1px solid oklch(.63 .22 232/.35); }
.role-manager { background:oklch(.72 .16 290/.2); color:oklch(.82 .14 290); border:1px solid oklch(.72 .16 290/.35); }
.role-member  { background:oklch(.74 .16 340/.2); color:oklch(.85 .14 340); border:1px solid oklch(.74 .16 340/.35); }
.role-client  { background:oklch(.74 .15 165/.2); color:oklch(.82 .13 165); border:1px solid oklch(.74 .15 165/.35); }
[data-role="admin"]   { --accent-h: 232; }
[data-role="manager"] { --accent-h: 290; }
[data-role="member"]  { --accent-h: 340; }
[data-role="client"]  { --accent-h: 165; }

/* ============ SETTINGS PAGE ============ */
.settings-nav a {
  display: block;
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-2);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.settings-nav a:hover { background: rgba(255,255,255,0.04); color: var(--fg); }
.settings-nav a.active,
.settings-nav a[style*="var(--accent)"] { background: var(--accent-soft); color: var(--accent) !important; }

/* ============ LOGO IMAGE IN SIDEBAR ============ */
.brand-logo-img {
  height: 36px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
  display: block;
}
.brand { min-height: 44px; align-items: center; }

/* ============ FLASH MESSAGE FIX — proper padding inside .page ============ */
.flash-msg {
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  animation: flashIn 0.3s cubic-bezier(0.16,1,0.3,1) both;
}
@keyframes flashIn {
  from { opacity:0; transform:translateY(-8px) scale(.98); }
  to   { opacity:1; transform:translateY(0) scale(1); }
}
.flash-success { background:oklch(.74 .15 155/.15); border:1px solid oklch(.74 .15 155/.35); color:oklch(.85 .12 155); }
.flash-error   { background:oklch(.7 .18 25/.15);   border:1px solid oklch(.7 .18 25/.35);   color:oklch(.88 .14 25); }
.flash-info    { background:oklch(.63 .22 232/.15); border:1px solid oklch(.63 .22 232/.35); color:oklch(.82 .16 232); }
.flash-warning { background:oklch(.8 .14 75/.15);   border:1px solid oklch(.8 .14 75/.35);   color:oklch(.88 .14 75); }

/* ============ LOADING OVERLAY ============ */
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 8, 14, 0.7);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.loading-overlay.active {
  opacity: 1;
  pointer-events: all;
}
.loading-box {
  background: rgba(20, 20, 30, 0.95);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  padding: 28px 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.8), inset 0 1px 0 rgba(255,255,255,0.1);
  animation: loadBoxIn 0.25s cubic-bezier(0.16,1,0.3,1);
}
@keyframes loadBoxIn {
  from { transform: scale(0.92) translateY(12px); opacity: 0; }
  to   { transform: scale(1) translateY(0); opacity: 1; }
}
.loading-spinner {
  width: 40px;
  height: 40px;
  position: relative;
}
.loading-spinner::before,
.loading-spinner::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid transparent;
}
.loading-spinner::before {
  border-top-color: var(--accent);
  animation: spinA 0.8s linear infinite;
}
.loading-spinner::after {
  border-bottom-color: oklch(from var(--accent) l c calc(h + 30));
  animation: spinA 0.8s linear infinite reverse;
  opacity: 0.4;
  inset: 6px;
}
@keyframes spinA {
  to { transform: rotate(360deg); }
}
.loading-label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--fg-2);
  letter-spacing: 0.01em;
}

/* ============ SAVE BUTTON LOADING STATE ============ */
.btn.loading {
  pointer-events: none;
  opacity: 0.7;
  position: relative;
  color: transparent !important;
}
.btn.loading::after {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spinA 0.7s linear infinite;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
}

/* ============ SETTINGS NAV LINK FIX ============ */
.settings-nav a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-2);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.settings-nav a:hover { background: rgba(255,255,255,0.04); color: var(--fg); }
.settings-nav a.active { background: var(--accent-soft); color: var(--accent); }

/* ============================================================
   MOBILE RESPONSIVE — FULL REWRITE
   ============================================================ */

/* ── Sidebar collapsed state vars ── */
:root {
  --sb-collapsed: 68px;
  --mob-topbar: 56px;
}

/* ── 860px tablet/mobile sidebar collapse ── */
@media (max-width: 860px) {
  .app {
    grid-template-columns: var(--sb-collapsed) 1fr !important;
  }

  /* Sidebar icon-only mode */
  .sidebar {
    padding: 12px 8px;
    margin: 8px 0 8px 8px;
    overflow: hidden;
    border-radius: 16px;
  }
  .brand {
    justify-content: center;
    padding: 0 0 10px;
  }
  .brand-logo-img {
    height: 32px;
    width: 32px;
    object-fit: contain;
    border-radius: 8px;
  }
  /* Mobile logo (square icon) overrides full logo */
  .brand-logo-mobile {
    display: block !important;
  }
  .brand-logo-desktop {
    display: none !important;
  }
  .brand-name { display: none !important; }
  .brand-mark {
    width: 36px !important;
    height: 36px !important;
    border-radius: 10px !important;
  }

  /* Role pill */
  .sidebar-role-badge { display: none; }

  /* Nav items — icon only, centered */
  .nav-label    { display: none !important; }
  .nav-badge    { display: none !important; }
  .nav-item {
    justify-content: center;
    padding: 10px;
    min-width: 0;
    border-radius: 10px;
  }
  .nav-item svg { flex-shrink: 0; }

  /* Section labels */
  .sidebar-section-label { display: none !important; }

  /* Upgrade card hidden */
  .upgrade { display: none; }

  /* Org section — avatar only */
  .org { justify-content: center; padding: 6px 4px; }
  .org-meta { display: none; }
  .org-avatar {
    width: 32px !important;
    height: 32px !important;
    font-size: 11px !important;
    border-radius: 8px;
    flex-shrink: 0;
  }
  .sidebar-spacer { flex: 1; min-height: 8px; }

  /* Page padding */
  .page { padding: 8px 12px 32px; }

  /* Topbar */
  .topbar { padding: 8px 10px; gap: 6px; }
  .topbar-inner { padding: 0 8px; gap: 8px; }
  .search { max-width: none; flex: 1; }
  .search kbd { display: none; }
  .user-pill .name, .user-pill .handle { display: none; }
  .user-pill svg:last-child { display: none; }
  .user-pill { gap: 0; padding: 4px; }

  /* Page head */
  .page-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .page-head h1.page-title {
    font-size: 22px !important;
    line-height: 1.2;
  }
  .page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
  }
  .page-actions .btn { flex: 1; justify-content: center; }

  /* KPI grid — 2 col */
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi-card { padding: 14px 16px; }
  .kpi-val, .kpi-value { font-size: 24px !important; }
  .kpi-label { font-size: 11px; }
  .kpi-delta { font-size: 11px; }

  /* Dash grid — stack vertically */
  .dash-grid { grid-template-columns: 1fr !important; }
  .dash-grid-3 { grid-template-columns: 1fr; }

  /* Announce bar */
  .announce-bar { height: auto; min-height: 38px; }

  /* Tasks — card list, not squeezed */
  .dash-task { padding: 10px 6px; }
  .dash-task-title { font-size: 12.5px; }

  /* Kanban */
  /* kanban mobile — see 480px block */

  /* Projects grid */
  .proj-grid { grid-template-columns: 1fr; }

  /* Members grid */
  .member-grid { grid-template-columns: 1fr 1fr; }

  /* Portfolio */
  .pf-grid { grid-template-columns: 1fr; grid-auto-rows: 180px; }
  .pf-tile.pf-large { /* unused */ }

  /* Settings */
  .settings-shell { grid-template-columns: 1fr; }
  .settings-nav { position: static; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .field.full { grid-column: 1; }

  /* Tables — hide non-essential columns */
  .table-hide-mobile { display: none !important; }

  /* Modal */
  /* modal-box 96% consolidated */

  /* Monitor */
  .mon-row {
    grid-template-columns: 24px 1fr 60px 32px !important;
    gap: 8px;
    padding: 10px 12px;
  }
  .mon-stat:nth-child(4),
  .mon-stat:nth-child(5),
  .mon-bars { display: none; }

  /* Performance member grid */
  .dash-grid-3 > .card { min-width: 0; }

  /* Sprint velocity */
  .sv-card .sv-gauge { max-width: 160px; }
  .sv-number { font-size: 26px !important; }
}

/* ── 480px phones ── */
@media (max-width: 480px) {
  :root { --sb-collapsed: 56px; }

  .sidebar { padding: 10px 6px; margin: 6px 0 6px 6px; }
  .nav-item { padding: 8px; border-radius: 8px; }
  .brand-mark { width: 30px !important; height: 30px !important; }
  .brand-logo-img { height: 28px; width: 28px; }

  .page { padding: 6px 10px 28px; }
  .topbar { padding: 6px 8px; }
  .search input { font-size: 13px; }

  .kpi-grid { gap: 8px; }
  .kpi-card { padding: 12px 12px; }
  .kpi-val, .kpi-value { font-size: 22px !important; }

  .member-grid { grid-template-columns: 1fr; }

  .page-head h1.page-title { font-size: 20px !important; }
  .page-sub { font-size: 12px; }

  /* Dash grid tasks — full width */
  .dash-task-meta { flex-wrap: wrap; gap: 4px; }

  /* Announce bar smaller text */
  .announce-item { font-size: 11.5px; }

  /* Modals fullscreen on tiny phones */
  /* modal-box 100% consolidated */
  /* modal responsive consolidated */
}

/* ── Desktop show/hide helpers ── */
.brand-logo-mobile { display: none; }
.brand-logo-desktop { display: block; }

/* ── Sidebar tooltip on hover (mobile icon mode) ── */
@media (max-width: 860px) {
  .nav-item {
    position: relative;
  }
  .nav-item::after {
    content: attr(data-label);
    position: absolute;
    left: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%);
    background: rgba(14,14,22,0.98);
    border: 1px solid rgba(255,255,255,0.12);
    color: var(--fg);
    font-size: 12px;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 8px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s;
    z-index: 100;
  }
  .nav-item:hover::after { opacity: 1; }
}

/* ── Topbar role pill — only visible on mobile ── */
.topbar-role-pill { display: none; }
@media (max-width: 860px) {
  .topbar-role-pill { display: inline-flex; }
  .sidebar-role-badge { display: none !important; }
}

/* ── Dashboard greeting responsive ── */
@media (max-width: 860px) {
  .page-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
  }
  .welcome-head h1 { font-size: 24px; }
  .page-sub { font-size: 12.5px; }

  /* Dash grid: revenue full width, tasks below, velocity below */
  .dash-grid {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }

  /* Task list on mobile — full card */
  .dash-task-list { gap: 0; }
  .dash-task { border-bottom: 1px solid var(--line); border-radius: 0; padding: 10px 4px; }
  .dash-task:last-child { border-bottom: none; }

  /* Sprint velocity compact */
  .sv-gauge-wrap { margin: 0; }
  .sv-gauge { max-width: 180px; margin: 0 auto; display: block; }

  /* KPI delta badge wrapping */
  .kpi-delta { white-space: normal; font-size: 10.5px; line-height: 1.3; }
  .chip { white-space: normal; }

  /* Bottom grid */
  .dash-grid-3 { grid-template-columns: 1fr !important; gap: 12px; }

  /* Announce bar on mobile */
  .announce-bar { margin-bottom: 12px; }
  .announce-item { font-size: 12px; }
}

/* ── Sidebar org user avatar shows on mobile ── */
@media (max-width: 860px) {
  .org { padding: 8px 0 4px; justify-content: center; }
  .org-avatar {
    width: 34px !important; height: 34px !important;
    font-size: 12px !important; border-radius: 9px;
  }
}

/* ── Member grid mobile ── */
@media (max-width: 480px) {
  .member-grid { grid-template-columns: 1fr !important; }
}

/* ── Form grid always 1 col on small ── */
@media (max-width: 600px) {
  .form-grid { grid-template-columns: 1fr !important; }
  .field.full { grid-column: 1 !important; }
}

/* ── Logo responsive in brand area ── */
@media (min-width: 861px) {
  .brand-logo-mobile { display: none !important; }
  .brand-logo-desktop { display: block !important; }
}

/* ============================================================
   TOPBAR — AVATAR ALWAYS VISIBLE + MOBILE FIXES
   ============================================================ */

/* Avatar wrapper with role dot */
.topbar-avatar {
  position: relative;
  flex-shrink: 0;
}
.topbar-avatar-dot {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--bg-1);
  display: none; /* shown only on mobile */
}
.role-dot-admin   { background: oklch(0.63 0.22 232); }
.role-dot-manager { background: oklch(0.72 0.16 290); }
.role-dot-member  { background: oklch(0.74 0.16 340); }
.role-dot-client  { background: oklch(0.74 0.15 165); }

/* Divider */
.topbar-divider {
  width: 1px;
  height: 24px;
  background: var(--line);
  margin: 0 4px;
  flex-shrink: 0;
}

/* Desktop: normal pill */
.topbar-user-text { display: flex; flex-direction: column; }
.topbar-chev { flex-shrink: 0; }

/* ── Mobile topbar overrides ── */
@media (max-width: 860px) {
  .topbar-divider    { display: none; }
  .topbar-user-text  { display: none !important; }
  .topbar-chev       { display: none !important; }
  .topbar-avatar-dot { display: block; } /* show role color dot */
  .topbar-role-pill  { display: none !important; } /* remove old pill */

  /* Make user-pill just the avatar, no padding overflow */
  .user-pill {
    padding: 3px !important;
    gap: 0 !important;
    background: rgba(255,255,255,0.06) !important;
    border: 1px solid rgba(255,255,255,0.1) !important;
    border-radius: 12px;
  }
  .topbar-actions {
    gap: 6px;
    align-items: center;
  }
}

/* ============================================================
   GREETING — ROLE PILL + DATE ON OWN LINE MOBILE
   ============================================================ */

.greeting-wrap { flex: 1; min-width: 0; }

.greeting-name-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.greeting-title {
  margin: 0 !important;
  line-height: 1.2 !important;
}

.greeting-role-pill {
  font-size: 11px !important;
  padding: 3px 10px !important;
  flex-shrink: 0;
}

/* Desktop: date inline */
.greeting-date { display: inline; }

/* Mobile: date on new line */
@media (max-width: 860px) {
  .greeting-title { font-size: 26px !important; }

  .greeting-name-row { gap: 8px; margin-bottom: 6px; }

  .page-sub.greeting-sub {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 12.5px;
    line-height: 1.5;
  }

  .greeting-date {
    display: block;
    color: var(--fg-4);
    font-size: 11.5px;
  }

  .page-head {
    flex-direction: column;
    gap: 14px;
  }

  .page-actions {
    width: 100%;
    display: flex;
    gap: 8px;
  }
  .page-actions .btn { flex: 1; justify-content: center; font-size: 12.5px; }
}

@media (max-width: 480px) {
  .greeting-title { font-size: 22px !important; }
  .greeting-role-pill { font-size: 10px !important; }
}


/* ── Greeting name row: name + role pill always in one line ── */
.greeting-name-row {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
  gap: 10px;
  margin-bottom: 6px;
}
.greeting-title {
  white-space: nowrap;
  font-size: clamp(20px, 3vw, 32px) !important;
  line-height: 1.15 !important;
  margin: 0 !important;
}
.greeting-role-pill {
  font-size: 11px !important;
  padding: 3px 10px !important;
  flex-shrink: 0;
  white-space: nowrap;
}
/* Remove sidebar-role-badge leftover space */
.sidebar-role-badge { display: none !important; }

/* ============================================================
   INLINE FILTER BAR
   ============================================================ */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.filter-bar-inner {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 4px;
  height: 40px;
  flex-wrap: wrap;
  overflow: hidden;
  flex: 1;
  max-width: 680px;
}
.filter-group {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  height: 100%;
  color: var(--fg-3);
  flex-shrink: 0;
}
.filter-group svg { flex-shrink: 0; }
.filter-group select {
  background: none;
  border: none;
  color: var(--fg);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  outline: none;
  cursor: pointer;
  padding: 0;
  /* Remove default arrow */
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  min-width: 80px;
}
.filter-group select option {
  background: #13131e;
  color: var(--fg);
}
.filter-sep {
  width: 1px;
  height: 20px;
  background: var(--line);
  flex-shrink: 0;
}
.filter-clear {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 12px;
  height: 100%;
  font-size: 12px;
  font-weight: 500;
  color: var(--fg-3);
  text-decoration: none;
  transition: color 0.15s;
  white-space: nowrap;
}
.filter-clear:hover { color: var(--err); }
.filter-count {
  font-size: 12.5px;
  color: var(--fg-4);
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

@media (max-width: 600px) {
  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-bar-inner { flex-wrap: nowrap; overflow-x: auto; max-width: none; }
  .filter-count { text-align: right; }
}

/* ============================================================
   CURRENCY BADGE
   ============================================================ */
.currency-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}
.currency-inr { background: oklch(.74 .15 75/.15); color: oklch(.85 .14 75); border: 1px solid oklch(.74 .15 75/.3); }
.currency-usd { background: oklch(.74 .15 155/.15); color: oklch(.82 .13 155); border: 1px solid oklch(.74 .15 155/.3); }
.currency-eur { background: oklch(.63 .22 232/.15); color: oklch(.80 .18 232); border: 1px solid oklch(.63 .22 232/.3); }
.currency-gbp { background: oklch(.72 .16 290/.15); color: oklch(.82 .14 290); border: 1px solid oklch(.72 .16 290/.3); }

/* ============================================================
   CRITICAL MOBILE FIXES
   ============================================================ */

/* FIX 1: Modal overlay must be above EVERYTHING including sidebar.
   Modals live inside .app which has overflow:hidden + backdrop-filter
   on pseudo-elements — this traps fixed children on iOS/Android.
   Solution: blast z-index to 9998 and force full viewport coverage */
.modal-overlay {
  position: fixed !important;
  inset: 0 !important;
  z-index: 9998 !important;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.75) !important;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.modal-overlay.open { display: flex !important; }

/* FIX 2: Modal box — responsive across all screens */
.modal-box {
  position: relative;
  background: #13131e;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  width: min(90vw, 600px);
  max-height: 90dvh;   /* dvh = dynamic viewport height, handles mobile browser chrome */
  max-height: 90vh;    /* fallback */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 32px 80px rgba(0,0,0,0.8);
  margin: auto;
}

/* FIX 3: Mobile modal — slides up from bottom, full width */
@media (max-width: 600px) {
  .modal-overlay {
    align-items: flex-end !important;
    padding: 0 !important;
  }
  .modal-box {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 20px 20px 0 0 !important;
    max-height: 92dvh !important;
    max-height: 92vh !important;
    margin: 0 !important;
  }
  .modal-head {
    position: sticky;
    top: 0;
    background: #13131e;
    z-index: 1;
    border-radius: 20px 20px 0 0;
  }
  .modal-foot {
    position: sticky;
    bottom: 0;
    background: #13131e;
    z-index: 1;
  }
}

/* FIX 4: Sidebar overflow — allow scroll, show org section */
.sidebar {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch;
}
.sidebar::-webkit-scrollbar { display: none; }

/* FIX 5: Page scroll — keep overflow:hidden on .main for layout,
   but ensure .page scrolls properly and modals use position:fixed to escape */
.page {
  -webkit-overflow-scrolling: touch;
  overflow-y: auto;
}

/* FIX 6: Topbar profile always visible on mobile */
@media (max-width: 860px) {
  .topbar {
    padding: 6px 10px !important;
    gap: 6px !important;
  }
  .topbar-inner {
    padding: 0 8px !important;
    gap: 6px !important;
  }
  .search {
    min-width: 0;
    flex: 1;
  }
  .search input {
    min-width: 0;
    width: 100%;
  }
  .topbar-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0; /* NEVER let this compress */
  }
  /* Avatar always visible */
  .topbar-avatar {
    display: flex !important;
    flex-shrink: 0;
  }
  .topbar-avatar img,
  .topbar-avatar .avatar {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px;
    flex-shrink: 0;
  }
  .user-pill {
    padding: 4px !important;
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center;
  }
  /* Bell icon */
  .icon-btn {
    width: 36px !important;
    height: 36px !important;
    flex-shrink: 0;
  }
}

/* FIX 7: Sidebar org section always visible */
@media (max-width: 860px) {
  .org {
    display: flex !important;
    flex-shrink: 0;
    padding: 6px 4px !important;
  }
  .sidebar {
    display: flex !important;
    flex-direction: column;
  }
  .sidebar-spacer {
    flex: 1;
    min-height: 4px;
  }
}

/* FIX 8: Form grid inside modals — always single column on mobile */
@media (max-width: 600px) {
  .modal-box .form-grid {
    grid-template-columns: 1fr !important;
    padding: 14px !important;
    gap: 12px !important;
  }
  .modal-box .field.full {
    grid-column: 1 !important;
  }
  .modal-head {
    padding: 14px 16px !important;
  }
  .modal-foot {
    padding: 12px 16px !important;
    gap: 8px;
  }
  .modal-foot .btn {
    flex: 1;
    justify-content: center;
  }
}

/* ── Topbar: search stretches, actions right-aligned ── */
.topbar-inner {
  display: flex;
  align-items: center;
  gap: 12px;
}
.search {
  flex: 1; /* stretch to fill all available space */
}
.topbar-actions {
  flex-shrink: 0; /* never shrink the actions */
  margin-left: auto;
}

/* Mobile: remove max-width so search fills full available width */
@media (max-width: 860px) {
  .search {
    max-width: none !important;
    flex: 1 !important;
    min-width: 0;
  }
  .search kbd { display: none; }
  .topbar-inner { gap: 8px; }
}

/* ── Member task card button fix ── */
.task-card .task-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  align-items: center;
}
.task-card .task-actions form,
.task-card .task-actions a,
.task-card .task-actions button { flex: 1; }
.task-card .task-actions .btn {
  width: 100%;
  justify-content: center;
  font-size: 11.5px;
  padding: 5px 8px;
}

/* ── Member task kanban card ── */
.task-card { min-height: auto; }

/* ── Deactivate button fix in member cards ── */
.member-card .member-body > div:last-child form button {
  border: 1px solid var(--err);
  color: var(--err);
  background: transparent;
}
.member-card .member-body > div:last-child form button:hover {
  background: oklch(.7 .18 25/.1);
}

/* ── Login page eye button ── */
.login-card [type=password] + button,
.login-card [type=text] + button {
  color: var(--fg-2) !important;
}

/* ── Responsive table scroll wrapper ── */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 860px) {
  .table-scroll table { min-width: 600px; }
  .filter-bar-inner { gap: 0; }
  .filter-group { padding: 0 8px; }
}


/* ── Sidebar info card ── */
.sidebar-info {
  margin: 8px;
  padding: 14px;
  background: linear-gradient(135deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 14px;
  flex-shrink: 0;
}
.sidebar-info-badge {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}
.sidebar-info-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--fg);
  line-height: 1.3;
  margin-bottom: 4px;
  word-break: break-word;
}
.sidebar-info-body {
  font-size: 11.5px;
  color: var(--fg-3);
  line-height: 1.5;
  word-break: break-word;
}

/* Collapsed sidebar hides text info */
@media (max-width: 860px) {
  .sidebar-info { display: none !important; }
}


/* ── Portfolio 4-col grid ── */
.pf-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 14px;
  align-items: start;
}
.pf-tile { border-radius: 14px; overflow: hidden; }
@media (max-width: 1280px) { .pf-grid { grid-template-columns: repeat(3, 1fr) !important; } }
@media (max-width: 860px)  { .pf-grid { grid-template-columns: repeat(2, 1fr) !important; } }
@media (max-width: 480px)  { .pf-grid { grid-template-columns: 1fr !important; } }

/* ── Portfolio cover image ── */
.pf-cover {
  position: relative;
  min-height: 160px;
  overflow: hidden;
}
.pf-cover > img.pf-cover-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  display: block;
}
.pf-cover-glyph {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
  font-weight: 800;
  color: rgba(255,255,255,0.1);
  letter-spacing: -.04em;
  z-index: 0;
  user-select: none;
}
.pf-cover-stripes { display: none; }

/* ── Login eye button ── */
.login-eye-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255,255,255,0.6) !important;
  padding: 0;
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-eye-btn:hover { color: rgba(255,255,255,0.9) !important; }
.login-eye-btn svg { display: block; }



/* ============================================================
   TODAY CARD — replaces sidebar upgrade card, same base style
   ============================================================ */
.today-card {
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  /* Inherits .upgrade gradient background */
}
.today-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
}
.today-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-3);
  opacity: 0.8;
}
.today-type-badge {
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  color: var(--fg-2);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid rgba(255,255,255,0.1);
}
.today-occasion-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--fg);
  line-height: 1.3;
  margin-bottom: 6px;
  /* Match old .upgrade-title style */
}
.today-date-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.today-date {
  font-size: 11px;
  color: var(--fg-3);
  opacity: 0.8;
  /* Match old .upgrade-desc style */
}
.today-card:hover .today-occasion-name { color: var(--accent-light, var(--fg)); }

/* Mobile — show calendar icon instead of card text */
@media (max-width: 860px) {
  .upgrade.today-card {
    display: none !important; /* hide full card in collapsed sidebar */
  }
  /* Show as tiny icon in org section on mobile instead */
  .sidebar-today-icon {
    display: flex !important;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: linear-gradient(135deg, oklch(0.74 0.15 var(--accent-h) / 0.3), oklch(0.7 0.16 290 / 0.3));
    border: 1px solid rgba(255,255,255,0.1);
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
  }
}
@media (min-width: 861px) {
  .sidebar-today-icon { display: none !important; }
}

/* ── Today card description line ── */
.today-desc {
  font-size: 11px;
  color: var(--fg-3);
  line-height: 1.4;
  margin-bottom: 6px;
  opacity: 0.85;
}
.today-date-row {
  display: flex;
  align-items: center;
  gap: 5px;
}


/* ============================================================
   TASK PAGE MOBILE — full fix, no overlapping
   ============================================================ */

/* Desktop: fixed height board, each column scrolls independently */
@media (min-width: 861px) {
  .kanban {
    height: calc(100vh - var(--topbar-h) - 180px);
    overflow-x: hidden;
  }
  .kanban-col {
    height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  .kanban-col-list {
    flex: 1;
    overflow-y: auto;
    min-height: 0; /* critical for flex children to scroll */
  }
}

/* Mobile (<=860px): stacked single columns, no fixed height — page scrolls naturally */
@media (max-width: 860px) {
  .kanban {
    grid-template-columns: 1fr !important;
    height: auto !important;
    overflow: visible !important;
    gap: 12px;
    padding-bottom: 24px;
  }
  .kanban-col {
    height: auto !important;
    overflow: visible !important;
    min-height: 80px;
    display: block !important;
  }
  .kanban-col-list {
    overflow: visible !important;
    height: auto !important;
    flex: none !important;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  /* Task cards full width, not squished */
  .task-card {
    width: 100%;
    box-sizing: border-box;
    cursor: default; /* no drag on mobile */
  }
  /* Task card action buttons — full width, stacked */
  .task-card > div:last-child {
    flex-direction: column;
    gap: 6px;
  }
  .task-card > div:last-child .btn,
  .task-card > div:last-child form,
  .task-card > div:last-child button {
    width: 100%;
    justify-content: center;
  }
  /* Task meta — wrap cleanly */
  .task-meta {
    flex-wrap: wrap;
    gap: 6px;
  }
  /* Filter bar on mobile */
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .filter-bar-inner {
    width: 100%;
    max-width: none;
    overflow-x: auto;
  }
  .filter-count {
    text-align: right;
    font-size: 12px;
  }
  /* Seg buttons full width */
  .seg {
    display: flex;
    width: 100%;
  }
  .seg-item { flex: 1; text-align: center; }
  /* Page actions in task page */
  .page-actions { flex-wrap: wrap; gap: 8px; }
  .page-actions .btn { min-width: 120px; }
}

/* Tablet: 2 columns side by side */
@media (min-width: 600px) and (max-width: 860px) {
  .kanban {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* Task card action button row */
.task-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
@media (max-width: 860px) {
  .task-card-actions {
    display: flex;
    flex-direction: row;
    gap: 6px;
    justify-content: flex-end;
  }
  .task-card-actions .btn { font-size: 11px !important; padding: 5px 10px !important; }
  .task-card-actions form { flex-shrink: 0; }
  .task-card-actions form .btn { font-size: 11px !important; padding: 5px 10px !important; }
}

/* ============================================================
   TASK PAGE — sticky header, kanban scrolls naturally
   ============================================================ */

/* On the task page specifically, pin the page-head + filter bar
   so only the kanban area scrolls on mobile */
body[data-page="tasks"] .page-head,
body[data-page="tasks"] .filter-bar {
  position: sticky;
  z-index: 50;
  /* No forced background — blends with page */
}
body[data-page="tasks"] .page-head {
  top: 0;
  padding-top: 8px;
  margin-bottom: 0;
}
body[data-page="tasks"] .filter-bar {
  top: 80px; /* approx height of page-head */
  padding-bottom: 10px;
  margin-bottom: 0;
}

/* Desktop: keep existing column-level scroll */
@media (min-width: 861px) {
  body[data-page="tasks"] .page-head { top: 0; }
  body[data-page="tasks"] .filter-bar { top: 72px; }
  body[data-page="tasks"] .kanban {
    /* Remove fixed height — let columns handle their own scroll */
    height: calc(100vh - var(--topbar-h) - 200px);
    margin-top: 0;
  }
}

/* Mobile: all natural flow, page scrolls through everything */
@media (max-width: 860px) {
  /* Un-sticky page-head and filter on mobile — causes "hidden behind topbar" bug */
  body[data-page="tasks"] .page-head,
  body[data-page="tasks"] .filter-bar {
    position: static !important;
    background: transparent !important;
  }
  body[data-page="tasks"] .page-head {
    padding-top: 0;
    margin-bottom: 12px;
  }
  body[data-page="tasks"] .filter-bar {
    margin-bottom: 12px;
  }
  body[data-page="tasks"] .kanban {
    height: auto !important;
    overflow: visible !important;
    margin-top: 0;
    padding-bottom: 60px;
  }
  body[data-page="tasks"] .kanban-col {
    height: auto !important;
    overflow: visible !important;
  }
  body[data-page="tasks"] .kanban-col-list {
    overflow: visible !important;
    height: auto !important;
    min-height: 40px;
  }
}

/* ============================================================
   TODAY CARD + POPUP
   ============================================================ */
.today-card {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}
.today-more-badge {
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.14);
  color: var(--fg-2);
  margin-left: auto;
}

/* Popup */
.today-popup {
  position: fixed;
  bottom: 80px;
  left: 12px;
  width: 260px;
  background: rgba(13,13,22,0.98);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.9);
  z-index: 9991;
  overflow: hidden;
  display: none;
  max-height: 70vh;
  overflow-y: auto;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}
/* Mobile popup adjustments */
@media (max-width: 860px) {
  .today-popup {
    border-radius: 20px;
    box-shadow: 0 32px 80px rgba(0,0,0,0.95);
  }
}
.today-popup.open { display: block; animation: popupIn .18s cubic-bezier(.16,1,.3,1); }
@keyframes popupIn {
  from { opacity:0; transform:translateY(8px) scale(.97); }
  to   { opacity:1; transform:translateY(0) scale(1); }
}
.today-popup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 8px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.today-popup-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--fg-2);
  letter-spacing: 0.04em;
}
.today-popup-close {
  background: none;
  border: none;
  color: var(--fg-3);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 0 2px;
  font-family: inherit;
}
.today-popup-list { padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.today-popup-item {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255,255,255,0.03);
}
.today-popup-item-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 3px;
  line-height: 1.3;
}
.today-popup-item-desc {
  font-size: 11.5px;
  color: var(--fg-3);
  line-height: 1.4;
  margin-bottom: 4px;
}
.today-popup-item-type {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Mobile: popup appears differently (inside sidebar area) */


/* ── Today card visibility ── */
.upgrade.today-card {
  display: block;
  width: 100%;
  text-align: left;
  cursor: pointer;
}
/* Mobile: hide full card (sidebar is collapsed to icons), show icon trigger instead */
@media (max-width: 860px) {
  .upgrade.today-card { display: none !important; }
  .sidebar-today-icon { display: flex !important; }
}
@media (min-width: 861px) {
  .sidebar-today-icon { display: none !important; }
}
