/* ════════════════════════════════════════════════════════════════
   ProductFlow v3.0 — Design System
   Design: dark theme premium, Inter font, indigo/emerald palette
   ════════════════════════════════════════════════════════════════ */

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

:root {
  /* Core Palette */
  --indigo:       #6366f1;
  --indigo-light: #818cf8;
  --indigo-dark:  #4f46e5;
  --emerald:      #10b981;
  --sky:          #0ea5e9;
  --amber:        #f59e0b;
  --rose:         #ef4444;
  --violet:       #a855f7;
  --pink:         #ec4899;
  --orange:       #f97316;
  --warning:      #f59e0b;
  --success:      #10b981;
  --danger:       #ef4444;
  --info:         #0ea5e9;

  /* Backgrounds */
  --bg-base:       #050b15;
  --bg-elevated:   #0c1626;
  --bg-card:       #101e33;
  --bg-raised:     #162338;
  --bg-hover:      #1e2d45;
  --bg-active:     #1a3052;
  --bg-input:      #0f1d30;
  --bg-overlay:    rgba(5, 11, 21, 0.85);

  /* Borders */
  --border:        rgba(255,255,255,0.07);
  --border-active: rgba(99,102,241,0.4);
  --border-focus:  rgba(99,102,241,0.7);

  /* Text */
  --text-primary:   #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted:     #475569;
  --text-accent:    #818cf8;

  /* Sidebar */
  --sidebar-w:      240px;
  --sidebar-w-sm:   60px;

  /* Radius */
  --r-xs:   4px;
  --r-sm:   8px;
  --r-md:   12px;
  --r-lg:   16px;
  --r-xl:   20px;
  --r-full: 9999px;

  /* Shadow */
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.5), 0 2px 6px rgba(0,0,0,0.4);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.6), 0 4px 12px rgba(0,0,0,0.4);
  --shadow-xl:  0 16px 48px rgba(0,0,0,0.7);
  --glow-indigo: 0 0 20px rgba(99,102,241,0.25);

  /* Transitions */
  --t-fast:   150ms ease;
  --t-mid:    250ms ease;
  --t-slow:   400ms ease;
  --t-spring: 300ms cubic-bezier(0.34,1.56,0.64,1);
}

html { font-size: 14px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

#app { min-height: 100vh; }

/* ─── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(99,102,241,0.3); border-radius: var(--r-full); }
::-webkit-scrollbar-thumb:hover { background: rgba(99,102,241,0.5); }

/* ─── Selection ─────────────────────────────────────────────── */
::selection { background: rgba(99,102,241,0.3); color: var(--text-primary); }

/* ─── Focus visible ─────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--indigo);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

/* ─── Utility ────────────────────────────────────────────────── */
.text-muted    { color: var(--text-muted) !important; }
.text-sm       { font-size: 12px !important; }
.text-accent   { color: var(--text-accent); }
.accent        { color: var(--indigo-light); }
.flex-1        { flex: 1; }
.hidden        { display: none !important; }

/* ══════════════════════════════════════════════════════════════
   LOGIN PAGE
══════════════════════════════════════════════════════════════ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: var(--bg-base);
}

.login-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.login-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  animation: float 8s ease-in-out infinite;
}
.orb1 { width: 500px; height: 500px; background: var(--indigo); top: -15%; left: -10%; animation-delay: 0s; }
.orb2 { width: 400px; height: 400px; background: var(--violet); bottom: -15%; right: -10%; animation-delay: 3s; }
.orb3 { width: 300px; height: 300px; background: var(--sky); top: 30%; left: 40%; animation-delay: 6s; }

.login-grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(99,102,241,0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(99,102,241,0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse at center, black 40%, transparent 80%);
}

@keyframes float {
  0%, 100% { transform: translateY(0) scale(1); }
  50%       { transform: translateY(-30px) scale(1.05); }
}

.login-card {
  position: relative; z-index: 1;
  width: 420px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 36px;
  box-shadow: var(--shadow-xl), 0 0 0 1px rgba(255,255,255,0.03);
}

.login-brand {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 20px;
}

.login-logo-wrap {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, var(--indigo), var(--violet));
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: white;
  box-shadow: 0 4px 12px rgba(99,102,241,0.4);
}

.login-brand-text { display: flex; flex-direction: column; }
.login-brand-name { font-size: 22px; font-weight: 800; color: var(--text-primary); }
.login-brand-version { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.login-security-badge {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 12px;
  background: rgba(16,185,129,0.1);
  border: 1px solid rgba(16,185,129,0.2);
  border-radius: var(--r-full);
  font-size: 11px; color: var(--emerald);
  margin-bottom: 24px;
  width: fit-content;
}

.login-form-header { margin-bottom: 20px; }
.login-form-header h1 { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.login-form-header p  { font-size: 13px; color: var(--text-secondary); }

.login-footer {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.8;
}

/* ══════════════════════════════════════════════════════════════
   APP LAYOUT
══════════════════════════════════════════════════════════════ */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.main-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  margin-left: var(--sidebar-w);
  transition: margin-left var(--t-mid);
}

.app-layout.sidebar-collapsed .main-area {
  margin-left: var(--sidebar-w-sm);
}

/* ══════════════════════════════════════════════════════════════
   SIDEBAR
══════════════════════════════════════════════════════════════ */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  z-index: 100;
  transition: width var(--t-mid);
  overflow: hidden;
}

.sidebar.collapsed { width: var(--sidebar-w-sm); }

/* Header */
.sidebar-header {
  display: flex; align-items: center; gap: 10px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  min-height: 60px;
  position: relative;
}

.sidebar-logo {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--indigo), var(--violet));
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: white;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(99,102,241,0.3);
}

.sidebar-brand {
  font-size: 16px; font-weight: 800;
  color: var(--text-primary);
  white-space: nowrap; overflow: hidden;
  transition: opacity var(--t-mid);
}

.sidebar-collapse-btn {
  position: absolute; right: 12px;
  width: 24px; height: 24px;
  background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: 50%; color: var(--text-muted);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 10px; transition: all var(--t-fast);
  opacity: 0;
}
.sidebar:hover .sidebar-collapse-btn { opacity: 1; }
.sidebar-collapse-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.sidebar.collapsed .sidebar-collapse-btn i { transform: rotate(180deg); }

.sidebar.collapsed .sidebar-brand,
.sidebar.collapsed .sidebar-collapse-btn { opacity: 0; pointer-events: none; }

/* Project Selector */
.sidebar-project-selector {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  margin: 8px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all var(--t-fast);
  min-height: 52px;
}
.sidebar-project-selector:hover { border-color: var(--border-active); background: var(--bg-hover); }

.project-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.project-info { min-width: 0; flex: 1; overflow: hidden; }
.project-name { font-size: 13px; font-weight: 600; color: var(--text-primary); truncate; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.project-sprint { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.project-arrow { font-size: 10px; color: var(--text-muted); flex-shrink: 0; }

.sidebar.collapsed .project-info,
.sidebar.collapsed .project-arrow { display: none; }

/* Nav */
.sidebar-nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 8px 8px 0; }

.nav-section { margin-bottom: 8px; }
.nav-section-label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-muted);
  padding: 6px 8px 4px;
  white-space: nowrap; overflow: hidden;
  transition: opacity var(--t-mid);
}
.sidebar.collapsed .nav-section-label { opacity: 0; }

.nav-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 9px 10px;
  border-radius: var(--r-sm); border: none;
  background: transparent; color: var(--text-secondary);
  cursor: pointer; text-align: left;
  font-size: 13px; font-weight: 500;
  transition: all var(--t-fast);
  white-space: nowrap; overflow: hidden;
  position: relative;
}
.nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-item.active {
  background: rgba(99,102,241,0.15);
  color: var(--indigo-light);
  font-weight: 600;
}
.nav-item.active::before {
  content: '';
  position: absolute; left: 0; top: 25%; bottom: 25%;
  width: 3px; background: var(--indigo);
  border-radius: 0 var(--r-xs) var(--r-xs) 0;
}

.nav-icon { font-size: 14px; width: 18px; text-align: center; flex-shrink: 0; }
.nav-label { transition: opacity var(--t-mid); }
.sidebar.collapsed .nav-label { opacity: 0; }

.nav-badge {
  margin-left: auto; font-size: 9px; font-weight: 700; letter-spacing: 0.05em;
  padding: 2px 6px; border-radius: var(--r-full);
  background: rgba(16,185,129,0.15); color: var(--emerald);
  border: 1px solid rgba(16,185,129,0.2);
}
.sidebar.collapsed .nav-badge { display: none; }

/* Sidebar Footer */
.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border);
}

.sidebar-user {
  display: flex; align-items: center; gap: 8px;
  padding: 8px;
  border-radius: var(--r-sm);
  background: var(--bg-raised);
  border: 1px solid var(--border);
}

.user-av {
  width: 30px; height: 30px;
  border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: white;
}

.user-details { flex: 1; min-width: 0; overflow: hidden; }
.user-name  { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role  { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.nav-item-icon-btn {
  width: 28px; height: 28px;
  background: transparent; border: none;
  color: var(--text-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-xs); font-size: 12px;
  transition: all var(--t-fast); flex-shrink: 0;
}
.nav-item-icon-btn:hover { color: var(--rose); background: rgba(239,68,68,0.1); }

.sidebar.collapsed .user-details,
.sidebar.collapsed .nav-item-icon-btn { display: none; }

/* ══════════════════════════════════════════════════════════════
   TOPBAR
══════════════════════════════════════════════════════════════ */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 12px;
  height: 60px; padding: 0 20px;
  background: rgba(12, 22, 38, 0.95);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.topbar-mobile-menu {
  display: none;
  background: none; border: none; color: var(--text-secondary);
  cursor: pointer; padding: 4px; font-size: 16px;
}

.breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; flex-shrink: 0;
}
.bc-proj { color: var(--text-muted); }
.bc-sep  { font-size: 9px; color: var(--text-muted); }
.bc-page { color: var(--text-primary); font-weight: 600; }

.topbar-center { flex: 1; display: flex; justify-content: center; max-width: 400px; margin: 0 auto; }

.topbar-search {
  position: relative; width: 100%;
}
.search-icon {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-size: 12px; pointer-events: none;
}
.search-input {
  width: 100%; height: 34px;
  background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: var(--r-full); color: var(--text-primary);
  padding: 0 30px 0 32px; font-size: 13px;
  transition: all var(--t-fast);
}
.search-input:focus { border-color: var(--border-focus); background: var(--bg-input); outline: none; box-shadow: 0 0 0 3px rgba(99,102,241,0.15); }
.search-input::placeholder { color: var(--text-muted); }
.search-clear {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  font-size: 16px; line-height: 1; padding: 2px;
}

.topbar-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.security-pill {
  display: flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: var(--r-full);
  background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.2);
  font-size: 11px; font-weight: 600; color: var(--emerald);
}

.topbar-icon-btn {
  width: 34px; height: 34px;
  background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: var(--r-sm); color: var(--text-secondary);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 13px; transition: all var(--t-fast);
}
.topbar-icon-btn:hover { border-color: var(--border-active); color: var(--text-primary); background: var(--bg-hover); }

/* User menu */
.topbar-user-menu {
  position: relative; cursor: pointer;
  display: flex; align-items: center; gap: 4px;
}

.topbar-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: white;
  border: 2px solid var(--border);
  transition: border-color var(--t-fast);
  flex-shrink: 0;
}
.topbar-user-menu:hover .topbar-avatar { border-color: var(--indigo); }

.admin-crown { font-size: 12px; }

.user-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  width: 220px; background: var(--bg-elevated);
  border: 1px solid var(--border); border-radius: var(--r-md);
  box-shadow: var(--shadow-lg); z-index: 200;
  overflow: hidden;
  opacity: 0; transform: translateY(-8px) scale(0.97);
  pointer-events: none;
  transition: all var(--t-fast);
}
.user-dropdown.open {
  opacity: 1; transform: translateY(0) scale(1);
  pointer-events: all;
}

.dropdown-header { padding: 14px; border-bottom: 1px solid var(--border); }
.dh-name  { font-size: 14px; font-weight: 600; }
.dh-email { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.dh-role  { margin-top: 6px; }

.dropdown-divider { height: 1px; background: var(--border); }

.dropdown-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 10px 14px;
  background: none; border: none;
  color: var(--text-secondary); font-size: 13px;
  cursor: pointer; text-align: left;
  transition: all var(--t-fast);
}
.dropdown-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.dropdown-item.danger:hover { background: rgba(239,68,68,0.1); color: var(--rose); }
.dropdown-item i { width: 16px; text-align: center; }

/* ══════════════════════════════════════════════════════════════
   PAGE CONTENT
══════════════════════════════════════════════════════════════ */
.page-content {
  flex: 1; padding: 24px;
  min-height: calc(100vh - 60px);
}

.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 24px; gap: 16px;
}
.page-header-left { min-width: 0; }
.page-title    { font-size: 22px; font-weight: 800; letter-spacing: -0.01em; }
.page-subtitle { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.page-header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; flex-wrap: wrap; }

/* Access denied */
.access-denied {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 400px; gap: 16px; text-align: center;
}
.ad-icon { font-size: 48px; color: var(--text-muted); }
.access-denied h2 { font-size: 20px; font-weight: 700; }
.access-denied p { color: var(--text-secondary); font-size: 14px; }

/* ══════════════════════════════════════════════════════════════
   KPI CARDS
══════════════════════════════════════════════════════════════ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px; margin-bottom: 24px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  position: relative; overflow: hidden;
  transition: transform var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast);
  cursor: default;
}
.kpi-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--kpi-accent, var(--indigo));
  opacity: 0.8;
}
.kpi-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255,255,255,0.1);
  box-shadow: var(--shadow-md);
}

.kpi-header { display: flex; justify-content: flex-end; margin-bottom: 12px; }
.kpi-icon {
  width: 36px; height: 36px; border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
}
.kpi-value { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; line-height: 1; margin-bottom: 4px; }
.kpi-label { font-size: 12px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; }
.kpi-sub   { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ══════════════════════════════════════════════════════════════
   DASHBOARD
══════════════════════════════════════════════════════════════ */
.sprint-progress-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px; margin-bottom: 24px;
}

.spc-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 16px; gap: 16px; flex-wrap: wrap;
}
.spc-info { display: flex; flex-direction: column; gap: 4px; }
.spc-info h3 { font-size: 16px; font-weight: 700; }
.spc-info p  { font-size: 12px; color: var(--text-muted); }
.sprint-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px; border-radius: var(--r-full);
  font-size: 11px; font-weight: 700;
  width: fit-content;
}
.sprint-badge.active { background: rgba(16,185,129,0.15); color: var(--emerald); border: 1px solid rgba(16,185,129,0.25); }
.sprint-badge.active i { font-size: 6px; animation: pulse-dot 1.5s ease-in-out infinite; }
@keyframes pulse-dot { 0%,100%{opacity:1;} 50%{opacity:0.3;} }

.spc-stats { display: flex; gap: 24px; }
.spc-stat { text-align: center; }
.stat-value { display: block; font-size: 20px; font-weight: 700; }
.stat-label { font-size: 11px; color: var(--text-muted); }

.sprint-progress-track {
  height: 8px; background: var(--bg-raised); border-radius: var(--r-full); overflow: hidden;
}
.sprint-progress-fill {
  height: 100%; border-radius: var(--r-full);
  background: linear-gradient(90deg, var(--indigo), var(--violet));
  transition: width var(--t-slow);
}

.dashboard-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 16px; margin-bottom: 16px;
}

.dash-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-lg);
  overflow: hidden;
}
.dash-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.dash-card-title { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.dash-card-title i { color: var(--text-muted); }
.dash-chart-wrap { padding: 12px 16px; }

/* Onboarding */
.onboarding-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px; margin-bottom: 24px;
}
.onboarding-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 24px; display: flex; flex-direction: column; gap: 12px;
  transition: transform var(--t-fast), border-color var(--t-fast);
}
.onboarding-card:hover { transform: translateY(-2px); border-color: rgba(255,255,255,0.1); }
.onboarding-step {
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(99,102,241,0.15); color: var(--indigo-light);
  font-size: 13px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.onboarding-icon { font-size: 28px; }
.onboarding-card h3 { font-size: 15px; font-weight: 700; }
.onboarding-card p  { font-size: 13px; color: var(--text-secondary); line-height: 1.5; flex: 1; }

/* Security status */
.security-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 8px; padding: 16px;
}
.sec-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--r-sm);
  font-size: 13px;
}
.sec-item.ok   { background: rgba(16,185,129,0.07); border: 1px solid rgba(16,185,129,0.12); color: var(--text-primary); }
.sec-item.warn { background: rgba(245,158,11,0.07); border: 1px solid rgba(245,158,11,0.12); color: var(--amber); }
.sec-item-icon { width: 14px; text-align: center; }
.sec-item.ok   .sec-item-icon { color: var(--emerald); }
.sec-item.warn .sec-item-icon { color: var(--amber); }
.sec-item-badge { margin-left: auto; font-size: 11px; font-weight: 800; }
.sec-item.ok   .sec-item-badge { color: var(--emerald); }
.sec-item.warn .sec-item-badge { color: var(--amber); }

/* ══════════════════════════════════════════════════════════════
   BACKLOG TABLE
══════════════════════════════════════════════════════════════ */
.backlog-table {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-lg);
  overflow: hidden;
}

.table-header {
  display: grid;
  grid-template-columns: 28px 80px 1fr 100px 90px 120px 130px 90px;
  padding: 10px 16px;
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border);
  font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--text-muted);
}

.backlog-row {
  display: grid;
  grid-template-columns: 28px 80px 1fr 100px 90px 120px 130px 90px;
  padding: 12px 16px; align-items: center;
  border-bottom: 1px solid var(--border);
  transition: background var(--t-fast);
  cursor: pointer;
}
.backlog-row:last-child { border-bottom: none; }
.backlog-row:hover { background: var(--bg-hover); }
.backlog-row.dragging { opacity: 0.5; background: var(--bg-active); }
.backlog-row.drag-over { border-top: 2px solid var(--indigo); }

.drag-handle { color: var(--text-muted); cursor: grab; font-size: 11px; opacity: 0; transition: opacity var(--t-fast); }
.backlog-row:hover .drag-handle { opacity: 1; }

.col-id { font-size: 11px; font-family: 'JetBrains Mono', 'Fira Code', monospace; color: var(--text-muted); font-weight: 600; }
.col-title { display: flex; align-items: center; gap: 6px; min-width: 0; }
.item-title-text { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.item-title-text:hover { color: var(--indigo-light); }
.item-has-desc { color: var(--text-muted); font-size: 11px; flex-shrink: 0; }
.col-pts { display: flex; align-items: center; gap: 6px; justify-content: space-between; }

.pts-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 20px; padding: 0 5px;
  background: rgba(99,102,241,0.15); color: var(--indigo-light);
  border-radius: var(--r-xs); font-size: 11px; font-weight: 700;
}

.row-actions { display: flex; gap: 2px; opacity: 0; transition: opacity var(--t-fast); }
.backlog-row:hover .row-actions { opacity: 1; }

.action-btn {
  width: 26px; height: 26px; background: none; border: none;
  border-radius: var(--r-xs); color: var(--text-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; transition: all var(--t-fast);
}
.action-btn:hover { background: var(--bg-raised); color: var(--text-primary); }
.action-btn.danger:hover { background: rgba(239,68,68,0.1); color: var(--rose); }

.assignee { display: flex; align-items: center; gap: 5px; font-size: 12px; }
.av-xs {
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 700; color: white; flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════════
   KANBAN BOARD
══════════════════════════════════════════════════════════════ */
.kanban-board {
  display: flex; gap: 12px;
  align-items: flex-start;
  min-height: calc(100vh - 200px);
  overflow-x: auto;
  padding-bottom: 16px;
}

.kanban-col {
  width: 268px; flex-shrink: 0;
  display: flex; flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.kanban-col-header {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px;
  border-bottom: 2px solid var(--col-color, var(--border));
  background: var(--bg-raised);
}
.col-icon { font-size: 12px; color: var(--col-color, var(--text-muted)); }
.col-name { font-size: 13px; font-weight: 700; flex: 1; }
.col-count {
  min-width: 22px; height: 20px; padding: 0 5px;
  background: rgba(255,255,255,0.06); border-radius: var(--r-full);
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
}

.kanban-cards {
  flex: 1; padding: 10px; display: flex; flex-direction: column; gap: 8px;
  min-height: 100px; transition: background var(--t-fast);
}
.kanban-cards.drag-over { background: rgba(99,102,241,0.07); }

.kanban-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px; padding-left: 14px;
  cursor: grab; position: relative;
  transition: transform var(--t-fast), box-shadow var(--t-fast), border-color var(--t-fast);
  user-select: none;
  overflow: hidden;
}
.kanban-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: rgba(255,255,255,0.1); }
.kanban-card.dragging { opacity: 0.5; transform: rotate(2deg); box-shadow: var(--shadow-lg); }

.card-priority-strip {
  position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
}

.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.card-id { font-size: 10px; color: var(--text-muted); font-family: monospace; }

.card-title {
  font-size: 13px; font-weight: 500; line-height: 1.4;
  margin-bottom: 10px; cursor: pointer;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-title:hover { color: var(--indigo-light); }

.card-footer { display: flex; align-items: center; justify-content: space-between; }
.card-assignee { display: flex; align-items: center; gap: 5px; }
.card-meta { display: flex; align-items: center; gap: 8px; }
.card-pts { font-size: 11px; color: var(--text-muted); display: flex; align-items: center; gap: 3px; }
.card-pts i { color: var(--amber); font-size: 9px; }
.card-age { font-size: 10px; color: var(--text-muted); display: flex; align-items: center; gap: 3px; }
.card-age.aged { color: var(--amber); }

.add-card-btn {
  width: 100%; padding: 8px;
  background: transparent; border: 1px dashed var(--border);
  border-radius: var(--r-sm); color: var(--text-muted);
  cursor: pointer; font-size: 12px;
  display: flex; align-items: center; justify-content: center; gap: 5px;
  transition: all var(--t-fast);
}
.add-card-btn:hover { background: var(--bg-hover); border-color: var(--border-active); color: var(--text-primary); }

/* ══════════════════════════════════════════════════════════════
   SPRINTS
══════════════════════════════════════════════════════════════ */
.sprints-list { display: flex; flex-direction: column; gap: 12px; }

.sprint-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-lg);
  overflow: hidden; transition: border-color var(--t-fast);
}
.sprint-card:hover { border-color: rgba(255,255,255,0.1); }

.sprint-card-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 16px; gap: 16px; cursor: pointer;
  background: var(--bg-card);
  transition: background var(--t-fast);
}
.sprint-card-header:hover { background: var(--bg-hover); }

.sprint-card-left { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }

.sprint-status-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px; border-radius: var(--r-full);
  font-size: 10px; font-weight: 700; width: fit-content;
}
.sprint-status-badge.active   { background: rgba(16,185,129,0.15); color: var(--emerald); border: 1px solid rgba(16,185,129,0.2); }
.sprint-status-badge.planning { background: rgba(99,102,241,0.15); color: var(--indigo-light); border: 1px solid rgba(99,102,241,0.2); }
.sprint-status-badge.closed   { background: rgba(100,116,139,0.15); color: var(--text-muted); border: 1px solid rgba(100,116,139,0.2); }
.sprint-status-badge i { font-size: 6px; }

.sprint-name { font-size: 15px; font-weight: 700; }
.sprint-goal { font-size: 12px; color: var(--text-muted); }

.sprint-card-right { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; flex-shrink: 0; }
.sprint-stats { display: flex; flex-wrap: wrap; gap: 12px; justify-content: flex-end; }
.sprint-stat { font-size: 12px; color: var(--text-secondary); display: flex; align-items: center; gap: 4px; }
.sprint-stat i { font-size: 10px; color: var(--text-muted); }
.sps-badge { color: var(--indigo-light) !important; font-weight: 700; }
.sprint-card-actions { display: flex; align-items: center; gap: 6px; }
.sprint-toggle-icon { font-size: 11px; color: var(--text-muted); transition: transform var(--t-mid); }

.sprint-progress-bar {
  height: 4px; background: var(--bg-raised);
}
.sprint-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--indigo), var(--violet));
  transition: width var(--t-slow);
}

.sprint-items-body {
  border-top: 1px solid var(--border);
  transition: all var(--t-mid);
}

.sprint-item-row {
  display: grid;
  grid-template-columns: 72px 1fr 90px 50px 42px 120px;
  align-items: center; gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background var(--t-fast);
  font-size: 13px;
}
.sprint-item-row:last-child { border-bottom: none; }
.sprint-item-row:hover { background: var(--bg-hover); }

.add-to-sprint-btn {
  width: 100%; padding: 10px 16px;
  background: transparent; border: none; border-top: 1px dashed var(--border);
  color: var(--text-muted); cursor: pointer; font-size: 12px;
  display: flex; align-items: center; gap: 6px;
  transition: all var(--t-fast);
}
.add-to-sprint-btn:hover { background: var(--bg-hover); color: var(--text-primary); }

/* ══════════════════════════════════════════════════════════════
   MÉTRICAS
══════════════════════════════════════════════════════════════ */
.sps-banner {
  background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(168,85,247,0.1));
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: var(--r-lg); padding: 20px;
  margin-bottom: 24px;
}
.sps-formula { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.sps-label { font-size: 13px; font-weight: 700; color: var(--text-secondary); }
.sps-value { font-size: 36px; font-weight: 900; letter-spacing: -0.02em; }
.sps-formula-text { font-size: 12px; color: var(--text-muted); font-family: monospace; }
.sps-legend { display: flex; gap: 16px; font-size: 11px; color: var(--text-muted); }

.metrics-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}
.metric-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-lg);
  overflow: hidden;
}
.metric-card-header { padding: 14px 16px; border-bottom: 1px solid var(--border); }
.metric-title { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.metric-title i { color: var(--text-muted); }

.priority-bar-row {
  display: grid; grid-template-columns: 90px 1fr 36px;
  align-items: center; gap: 10px; padding: 6px 16px;
}
.priority-track { height: 6px; background: var(--bg-raised); border-radius: var(--r-full); overflow: hidden; }
.priority-fill { height: 100%; border-radius: var(--r-full); transition: width var(--t-slow); }
.priority-count { font-size: 12px; font-weight: 700; text-align: right; }

/* ══════════════════════════════════════════════════════════════
   USUÁRIOS
══════════════════════════════════════════════════════════════ */
.users-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.user-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 20px; display: flex; flex-direction: column; gap: 12px;
  transition: transform var(--t-fast), border-color var(--t-fast);
}
.user-card:hover { transform: translateY(-2px); border-color: rgba(255,255,255,0.1); }
.user-card.inactive { opacity: 0.6; }

.user-card-header { display: flex; align-items: center; gap: 12px; }
.user-av-lg {
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 800; color: white; flex-shrink: 0;
}
.user-card-info { min-width: 0; }
.user-card-name {
  font-size: 15px; font-weight: 700;
  display: flex; align-items: center; gap: 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-card-email { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.you-badge {
  font-size: 10px; font-weight: 700; padding: 2px 6px;
  background: rgba(99,102,241,0.15); color: var(--indigo-light);
  border-radius: var(--r-full); border: 1px solid rgba(99,102,241,0.2);
}

.user-card-badges { display: flex; flex-wrap: wrap; gap: 5px; }
.status-pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: var(--r-full);
}
.status-pill.active { background: rgba(16,185,129,0.1); color: var(--emerald); border: 1px solid rgba(16,185,129,0.2); }
.status-pill.inactive { background: rgba(239,68,68,0.1); color: var(--rose); border: 1px solid rgba(239,68,68,0.2); }
.status-pill i { font-size: 6px; }

.user-last-login { font-size: 11px; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }
.user-card-actions { display: flex; gap: 8px; margin-top: 4px; }

/* ══════════════════════════════════════════════════════════════
   AUDIT LOG
══════════════════════════════════════════════════════════════ */
.audit-table {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden;
}
.audit-header {
  display: grid; grid-template-columns: 150px 100px 1fr 130px;
  padding: 10px 16px;
  background: var(--bg-raised); border-bottom: 1px solid var(--border);
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted);
}
.audit-row {
  display: grid; grid-template-columns: 150px 100px 1fr 130px;
  padding: 10px 16px; align-items: center;
  border-bottom: 1px solid var(--border);
  transition: background var(--t-fast);
}
.audit-row:last-child { border-bottom: none; }
.audit-row:hover { background: var(--bg-hover); }
.audit-cell { font-size: 13px; }
.audit-time { font-family: monospace; font-size: 11px; color: var(--text-muted); }
.audit-detail { color: var(--text-secondary); }
.audit-user { color: var(--text-secondary); }

.audit-action-badge {
  display: inline-block; padding: 2px 8px; border-radius: var(--r-full);
  font-size: 10px; font-weight: 800; letter-spacing: 0.05em;
}

.pagination {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  padding: 16px; border-top: 1px solid var(--border);
  background: var(--bg-card); border-radius: 0 0 var(--r-lg) var(--r-lg);
}
.page-info { font-size: 12px; color: var(--text-muted); }

/* ══════════════════════════════════════════════════════════════
   CONFIGURAÇÕES
══════════════════════════════════════════════════════════════ */
.settings-layout {
  display: grid; grid-template-columns: 200px 1fr;
  gap: 20px; align-items: start;
}

.settings-sidebar {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 8px; display: flex; flex-direction: column; gap: 2px;
  position: sticky; top: 80px;
}

.settings-nav-item {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 9px 10px; border-radius: var(--r-sm); border: none;
  background: transparent; color: var(--text-secondary);
  cursor: pointer; font-size: 13px; font-weight: 500; text-align: left;
  transition: all var(--t-fast);
}
.settings-nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.settings-nav-item.active { background: rgba(99,102,241,0.15); color: var(--indigo-light); font-weight: 600; }

.settings-content {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-lg);
  overflow: hidden;
}

.settings-section { padding: 24px; }
.settings-title { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.settings-desc  { font-size: 13px; color: var(--text-secondary); margin-bottom: 20px; line-height: 1.5; }

.color-picker-row { display: flex; gap: 8px; flex-wrap: wrap; }
.color-swatch {
  width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent;
  cursor: pointer; transition: transform var(--t-fast), border-color var(--t-fast);
}
.color-swatch:hover { transform: scale(1.15); }
.color-swatch.selected { border-color: white; box-shadow: 0 0 0 2px var(--bg-card); }

.security-toggles { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px;
  background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--r-sm);
}
.toggle-label { font-size: 14px; }

.toggle-switch { position: relative; display: inline-block; }
.toggle-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-track {
  display: block; width: 40px; height: 22px;
  background: var(--bg-hover); border-radius: var(--r-full); cursor: pointer;
  transition: background var(--t-mid); position: relative;
}
.toggle-thumb {
  position: absolute; top: 3px; left: 3px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--text-muted);
  transition: transform var(--t-mid), background var(--t-mid);
}
.toggle-switch input:checked + .toggle-track { background: rgba(99,102,241,0.3); }
.toggle-switch input:checked + .toggle-track .toggle-thumb {
  transform: translateX(18px); background: var(--indigo);
}

/* Password strength */
.password-strength-wrap { margin-top: 8px; }
.strength-bar { height: 4px; background: var(--bg-raised); border-radius: var(--r-full); overflow: hidden; margin-bottom: 4px; }
.strength-fill { height: 100%; border-radius: var(--r-full); transition: width var(--t-mid), background var(--t-mid); }
.strength-label { font-size: 11px; color: var(--text-muted); }

/* ══════════════════════════════════════════════════════════════
   DETAIL PANEL
══════════════════════════════════════════════════════════════ */
.detail-panel {
  position: fixed; top: 60px; right: -480px; bottom: 0;
  width: 460px; z-index: 80;
  background: var(--bg-elevated); border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  transition: right var(--t-slow);
  box-shadow: var(--shadow-xl);
}
.detail-panel.open { right: 0; }

.detail-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  background: var(--bg-raised); flex-shrink: 0;
}
.detail-header-left  { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.detail-header-right { display: flex; gap: 4px; flex-shrink: 0; }

.detail-body { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 20px; }
.detail-title { font-size: 16px; font-weight: 700; line-height: 1.4; }
.detail-desc  { font-size: 13px; color: var(--text-secondary); line-height: 1.6; }

.detail-fields {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--r-md); padding: 14px;
}
.detail-field { display: flex; flex-direction: column; gap: 4px; }
.df-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }

.detail-section { display: flex; flex-direction: column; gap: 10px; }
.ds-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }

.status-buttons { display: flex; flex-wrap: wrap; gap: 6px; }
.status-btn {
  padding: 5px 10px; border-radius: var(--r-full);
  background: var(--bg-raised); border: 1px solid var(--border);
  color: var(--text-secondary); font-size: 12px; font-weight: 500;
  cursor: pointer; transition: all var(--t-fast);
}
.status-btn:hover { border-color: var(--border-active); color: var(--text-primary); }
.status-btn.active { background: rgba(99,102,241,0.15); border-color: var(--indigo); color: var(--indigo-light); font-weight: 600; }

.count-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  background: rgba(99,102,241,0.15); color: var(--indigo-light);
  border-radius: var(--r-full); font-size: 10px; font-weight: 700; margin-left: 4px;
}

.activity-list { display: flex; flex-direction: column; gap: 10px; max-height: 240px; overflow-y: auto; }
.activity-item { display: flex; gap: 10px; align-items: flex-start; }
.activity-content { flex: 1; }
.activity-text { font-size: 13px; line-height: 1.4; color: var(--text-secondary); }
.activity-text strong { color: var(--text-primary); }
.activity-time { font-size: 11px; color: var(--text-muted); }

.comment-area { display: flex; gap: 8px; align-items: flex-start; padding-top: 12px; border-top: 1px solid var(--border); }
.comment-input-wrap { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.comment-textarea {
  width: 100%; min-height: 60px; padding: 8px 10px;
  background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--r-sm);
  color: var(--text-primary); font-size: 13px; line-height: 1.5; resize: vertical;
  font-family: inherit;
  transition: border-color var(--t-fast);
}
.comment-textarea:focus { border-color: var(--border-focus); outline: none; }
.comment-textarea::placeholder { color: var(--text-muted); }

/* ══════════════════════════════════════════════════════════════
   MODAIS
══════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: var(--bg-overlay);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fadeIn var(--t-fast) ease;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--r-xl);
  width: 100%; max-width: 560px; max-height: 90vh;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: var(--shadow-xl);
  animation: slideUp var(--t-mid) var(--t-spring);
}
.modal.modal-sm { max-width: 440px; }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-title { font-size: 16px; font-weight: 700; }

.modal-close {
  width: 30px; height: 30px; border-radius: var(--r-sm);
  background: var(--bg-raised); border: 1px solid var(--border);
  color: var(--text-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; transition: all var(--t-fast);
}
.modal-close:hover { background: var(--bg-hover); color: var(--text-primary); }

.modal-body { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.modal-footer {
  display: flex; align-items: center; gap: 8px;
  padding: 16px 20px; border-top: 1px solid var(--border);
  flex-shrink: 0; background: var(--bg-raised);
}

.confirm-text { font-size: 14px; color: var(--text-secondary); line-height: 1.6; }
.confirm-text strong { color: var(--text-primary); }

.picker-list { display: flex; flex-direction: column; gap: 6px; max-height: 380px; overflow-y: auto; }
.picker-row {
  display: grid; grid-template-columns: 72px 1fr 90px 40px 38px auto;
  align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: var(--r-sm);
  border: 1px solid var(--border);
  cursor: pointer; transition: all var(--t-fast); font-size: 12px;
}
.picker-row:hover { background: var(--bg-hover); border-color: var(--border-active); }

/* ══════════════════════════════════════════════════════════════
   FORMS
══════════════════════════════════════════════════════════════ */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-col   { display: flex; flex-direction: column; gap: 6px; }

.form-label { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.required   { color: var(--rose); }
.form-hint  { font-size: 11px; color: var(--text-muted); }

.form-input, .form-select, .form-textarea, .select-sm {
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--r-sm); color: var(--text-primary);
  padding: 9px 12px; font-size: 13px; font-family: inherit;
  transition: all var(--t-fast); width: 100%;
}
.form-input:focus, .form-select:focus, .form-textarea:focus, .select-sm:focus {
  border-color: var(--border-focus); outline: none;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-muted); }
.form-textarea { resize: vertical; min-height: 80px; line-height: 1.5; }
.select-sm { height: 34px; padding: 0 10px; }

.input-wrap { position: relative; }
.input-prefix-icon {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-size: 12px; pointer-events: none;
}
.form-input.has-prefix { padding-left: 34px; }
.form-input.has-suffix { padding-right: 40px; }

.input-suffix-btn {
  position: absolute; right: 0; top: 0; bottom: 0;
  width: 36px; background: none; border: none;
  color: var(--text-muted); cursor: pointer; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
  transition: color var(--t-fast);
}
.input-suffix-btn:hover { color: var(--text-primary); }

.form-error {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: var(--r-sm);
  background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.2);
  color: var(--rose); font-size: 13px;
}

/* ══════════════════════════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--r-sm); border: 1px solid transparent;
  font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: all var(--t-fast); font-family: inherit;
  text-decoration: none; outline: none;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary {
  background: var(--indigo); border-color: var(--indigo-dark); color: white;
  box-shadow: 0 1px 3px rgba(99,102,241,0.3);
}
.btn-primary:hover:not(:disabled) {
  background: var(--indigo-dark); box-shadow: 0 2px 8px rgba(99,102,241,0.4);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-raised); border-color: var(--border); color: var(--text-secondary);
}
.btn-secondary:hover:not(:disabled) { background: var(--bg-hover); color: var(--text-primary); border-color: rgba(255,255,255,0.15); }

.btn-ghost {
  background: transparent; border-color: transparent; color: var(--text-muted);
}
.btn-ghost:hover:not(:disabled) { background: var(--bg-hover); color: var(--text-primary); }

.btn-danger  { background: var(--rose);    border-color: #dc2626; color: white; }
.btn-danger:hover:not(:disabled)  { background: #dc2626; }
.btn-success { background: var(--emerald); border-color: #059669; color: white; }
.btn-success:hover:not(:disabled) { background: #059669; }
.btn-warning { background: var(--amber);   border-color: #d97706; color: white; }
.btn-warning:hover:not(:disabled) { background: #d97706; }

.btn-sm  { padding: 5px 10px; font-size: 12px; }
.btn-lg  { padding: 11px 22px; font-size: 14px; }
.btn-block { width: 100%; }
.btn-icon { width: 34px; height: 34px; padding: 0; }

/* ══════════════════════════════════════════════════════════════
   BADGES
══════════════════════════════════════════════════════════════ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 7px; border-radius: var(--r-full); font-size: 11px; font-weight: 600;
  white-space: nowrap;
}

/* Priority */
.badge-priority.critical { background: rgba(239,68,68,0.15);  color: #f87171;  border: 1px solid rgba(239,68,68,0.2);  }
.badge-priority.high     { background: rgba(249,115,22,0.15); color: #fb923c;  border: 1px solid rgba(249,115,22,0.2); }
.badge-priority.medium   { background: rgba(245,158,11,0.15); color: #fbbf24;  border: 1px solid rgba(245,158,11,0.2); }
.badge-priority.low      { background: rgba(34,197,94,0.15);  color: #4ade80;  border: 1px solid rgba(34,197,94,0.2);  }

/* Status */
.badge-status.backlog      { background: rgba(100,116,139,0.15); color: #94a3b8;  border: 1px solid rgba(100,116,139,0.2); }
.badge-status.todo         { background: rgba(99,102,241,0.15);  color: #a5b4fc;  border: 1px solid rgba(99,102,241,0.2);  }
.badge-status.in-progress  { background: rgba(14,165,233,0.15);  color: #7dd3fc;  border: 1px solid rgba(14,165,233,0.2);  }
.badge-status.in-review    { background: rgba(168,85,247,0.15);  color: #d8b4fe;  border: 1px solid rgba(168,85,247,0.2);  }
.badge-status.done         { background: rgba(16,185,129,0.15);  color: #6ee7b7;  border: 1px solid rgba(16,185,129,0.2);  }
.badge-status.cancelled    { background: rgba(239,68,68,0.1);    color: #fca5a5;  border: 1px solid rgba(239,68,68,0.15);  }

/* Type */
.badge-type.story   { background: rgba(99,102,241,0.12);  color: var(--indigo-light); }
.badge-type.task    { background: rgba(14,165,233,0.12);  color: #7dd3fc; }
.badge-type.bug     { background: rgba(239,68,68,0.12);   color: #fca5a5; }
.badge-type.epic    { background: rgba(245,158,11,0.12);  color: var(--amber); }
.badge-type.spike   { background: rgba(16,185,129,0.12);  color: var(--emerald); }

/* Role */
.role-badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: var(--r-full);
  font-size: 11px; font-weight: 700;
}
.role-badge.admin      { background: rgba(168,85,247,0.15); color: #d8b4fe; border: 1px solid rgba(168,85,247,0.2); }
.role-badge.pm         { background: rgba(99,102,241,0.15);  color: #a5b4fc; border: 1px solid rgba(99,102,241,0.2);  }
.role-badge.tech-lead  { background: rgba(14,165,233,0.15);  color: #7dd3fc; border: 1px solid rgba(14,165,233,0.2);  }
.role-badge.dev        { background: rgba(16,185,129,0.15);  color: #6ee7b7; border: 1px solid rgba(16,185,129,0.2);  }
.role-badge.qa         { background: rgba(245,158,11,0.15);  color: #fbbf24; border: 1px solid rgba(245,158,11,0.2);  }
.role-badge.designer   { background: rgba(236,72,153,0.15);  color: #f9a8d4; border: 1px solid rgba(236,72,153,0.2);  }

.badge-admin { background: rgba(168,85,247,0.1); color: #d8b4fe; padding: 2px 7px; border-radius: var(--r-full); font-size: 11px; }

/* ══════════════════════════════════════════════════════════════
   ALERTS
══════════════════════════════════════════════════════════════ */
.alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; border-radius: var(--r-sm);
  margin-bottom: 12px; font-size: 13px; line-height: 1.5;
}
.alert i { flex-shrink: 0; margin-top: 1px; }
.alert p  { margin-top: 4px; font-size: 12px; opacity: 0.85; }

.alert-error   { background: rgba(239,68,68,0.1);  border: 1px solid rgba(239,68,68,0.2);  color: #fca5a5; }
.alert-warning { background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.2); color: #fde68a; }
.alert-success { background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.2); color: #6ee7b7; }
.alert-info    { background: rgba(14,165,233,0.1);  border: 1px solid rgba(14,165,233,0.2);  color: #7dd3fc; }

/* ══════════════════════════════════════════════════════════════
   FILTER BAR
══════════════════════════════════════════════════════════════ */
.filter-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 14px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-lg);
  margin-bottom: 16px;
}
.filter-search {
  position: relative; flex: 1; min-width: 200px;
}
.filter-search i {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-size: 12px; pointer-events: none;
}
.filter-search input {
  width: 100%; height: 34px; padding: 0 10px 0 32px;
  background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--r-sm);
  color: var(--text-primary); font-size: 13px; transition: all var(--t-fast);
}
.filter-search input:focus { border-color: var(--border-focus); outline: none; }
.filter-group { display: flex; align-items: center; gap: 6px; }
.filter-label { font-size: 11px; font-weight: 600; color: var(--text-muted); white-space: nowrap; }

/* ══════════════════════════════════════════════════════════════
   TABS
══════════════════════════════════════════════════════════════ */
.tab-group { display: flex; background: var(--bg-raised); border-radius: var(--r-sm); padding: 3px; }
.tab-btn {
  padding: 5px 12px; border-radius: var(--r-xs); border: none;
  background: transparent; color: var(--text-muted); cursor: pointer;
  font-size: 12px; font-weight: 600; transition: all var(--t-fast);
}
.tab-btn:hover  { color: var(--text-primary); }
.tab-btn.active { background: var(--bg-hover); color: var(--text-primary); }

/* ══════════════════════════════════════════════════════════════
   EMPTY STATE
══════════════════════════════════════════════════════════════ */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 48px 24px; gap: 12px; text-align: center;
}
.es-icon { font-size: 40px; color: var(--text-muted); margin-bottom: 4px; }
.es-title { font-size: 16px; font-weight: 700; }
.es-desc  { font-size: 13px; color: var(--text-secondary); max-width: 320px; line-height: 1.5; }

/* ══════════════════════════════════════════════════════════════
   TOAST
══════════════════════════════════════════════════════════════ */
.toast-container {
  position: fixed; bottom: 20px; right: 20px; z-index: 2000;
  display: flex; flex-direction: column; gap: 8px;
  max-width: 360px;
}

.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-radius: var(--r-md);
  box-shadow: var(--shadow-lg); font-size: 13px;
  opacity: 0; transform: translateX(20px);
  transition: all var(--t-mid); pointer-events: all;
  border: 1px solid transparent;
}
.toast.show { opacity: 1; transform: translateX(0); }

.toast.success { background: rgba(16,185,129,0.15); border-color: rgba(16,185,129,0.3); color: #a7f3d0; }
.toast.error   { background: rgba(239,68,68,0.15);  border-color: rgba(239,68,68,0.3);  color: #fecaca; }
.toast.warning { background: rgba(245,158,11,0.15); border-color: rgba(245,158,11,0.3); color: #fde68a; }
.toast.info    { background: rgba(14,165,233,0.15);  border-color: rgba(14,165,233,0.3);  color: #bae6fd; }

.toast-icon { font-size: 15px; flex-shrink: 0; }
.toast-msg  { flex: 1; line-height: 1.4; }
.toast-close {
  background: none; border: none; color: inherit; cursor: pointer;
  font-size: 16px; opacity: 0.6; padding: 0; line-height: 1; flex-shrink: 0;
}
.toast-close:hover { opacity: 1; }

/* ══════════════════════════════════════════════════════════════
   SESSION BANNER
══════════════════════════════════════════════════════════════ */
.session-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 10px 20px;
  background: linear-gradient(135deg, rgba(245,158,11,0.2), rgba(239,68,68,0.2));
  border-bottom: 1px solid rgba(245,158,11,0.3);
  font-size: 13px; color: #fde68a;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.session-banner i { flex-shrink: 0; }

/* ══════════════════════════════════════════════════════════════
   SPINNER
══════════════════════════════════════════════════════════════ */
.spinner-sm {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: white;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-sidebar { position: static; flex-direction: row; flex-wrap: wrap; }
  .detail-panel { width: 380px; }
}

@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }

  .sidebar {
    transform: translateX(-100%);
    width: 260px !important;
    transition: transform var(--t-mid);
    z-index: 200;
  }
  .sidebar.mobile-open { transform: translateX(0); }

  .main-area { margin-left: 0 !important; }
  .topbar-mobile-menu { display: flex; }

  .breadcrumb { display: none; }
  .topbar-center { max-width: none; }
  .security-pill span { display: none; }

  .table-header,
  .backlog-row { grid-template-columns: 1fr auto auto auto; }
  .table-header div:nth-child(1),
  .table-header div:nth-child(2),
  .table-header div:nth-child(4),
  .table-header div:nth-child(7),
  .backlog-row > div:nth-child(1),
  .backlog-row > div:nth-child(2),
  .backlog-row > div:nth-child(4),
  .backlog-row > div:nth-child(7) { display: none; }

  .detail-panel { width: 100%; left: 0; right: 0; top: 60px; }
  .kanban-board { flex-direction: column; }
  .kanban-col { width: 100%; }

  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .page-header { flex-direction: column; align-items: stretch; }
  .page-header-actions { flex-wrap: wrap; }

  .modal { max-width: 100%; border-radius: var(--r-lg); }
  .toast-container { left: 12px; right: 12px; max-width: none; }
}

@media (max-width: 480px) {
  .page-content { padding: 16px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .login-card { padding: 24px; }
  .spc-stats { gap: 12px; }
}

/* ══════════════════════════════════════════════════════════════
   SCROLLBAR IN MODALS & PANELS
══════════════════════════════════════════════════════════════ */
.modal-body::-webkit-scrollbar,
.detail-body::-webkit-scrollbar,
.sidebar-nav::-webkit-scrollbar,
.picker-list::-webkit-scrollbar,
.activity-list::-webkit-scrollbar { width: 4px; }

/* ══════════════════════════════════════════════════════════════
   PRINT
══════════════════════════════════════════════════════════════ */
@media print {
  .sidebar, .topbar, .detail-panel, .toast-container, .session-banner { display: none; }
  .main-area { margin-left: 0; }
  body { background: white; color: black; }
}
