/* ============================================================
   ORBIT — Design System
   Hyper-Saturated Fluid · Dark/Light/System
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600&display=swap');

/* ── TOKENS ───────────────────────────────────────────────── */
:root {
  /* Brand */
  --orbit-purple:   #7B2FBE;
  --orbit-lilac:    #E040FB;
  --orbit-purple-2: #9B59D9;
  --orbit-glow:     rgba(224, 64, 251, 0.18);

  /* Dark Surface (default) */
  --bg-void:        #08080F;
  --bg-surface:     #0F0F1C;
  --bg-surface-2:   #161626;
  --bg-surface-3:   #1E1E34;
  --bg-glass:       rgba(255,255,255,0.05);
  --bg-glass-hover: rgba(255,255,255,0.08);
  --border-glass:   rgba(255,255,255,0.08);
  --border-strong:  rgba(255,255,255,0.14);

  /* Text */
  --text-primary:   #F0EEFF;
  --text-secondary: rgba(240,238,255,0.6);
  --text-muted:     rgba(240,238,255,0.35);
  --text-inverse:   #08080F;

  /* Status */
  --color-success:  #22D3A5;
  --color-warning:  #F59E0B;
  --color-danger:   #F43F5E;
  --color-info:     #60A5FA;

  /* Priority */
  --priority-high:   #F43F5E;
  --priority-medium: #F59E0B;
  --priority-low:    #22D3A5;

  /* Layout */
  --sidebar-w:     240px;
  --header-h:      64px;
  --radius-sm:     8px;
  --radius-md:     14px;
  --radius-lg:     22px;
  --radius-xl:     32px;
  --radius-pill:   999px;

  /* Shadows */
  --shadow-sm:  0 2px 8px rgba(0,0,0,0.4);
  --shadow-md:  0 8px 32px rgba(0,0,0,0.5);
  --shadow-lg:  0 20px 60px rgba(0,0,0,0.6);
  --shadow-glow: 0 0 40px rgba(123,47,190,0.25);

  /* Transitions */
  --ease-fluid: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast:   150ms;
  --dur-normal: 250ms;
  --dur-slow:   400ms;
}

/* Light Mode */
[data-theme="light"] {
  --bg-void:        #F0EEFF;
  --bg-surface:     #FFFFFF;
  --bg-surface-2:   #F5F3FF;
  --bg-surface-3:   #EDE9FE;
  --bg-glass:       rgba(123,47,190,0.05);
  --bg-glass-hover: rgba(123,47,190,0.09);
  --border-glass:   rgba(123,47,190,0.12);
  --border-strong:  rgba(123,47,190,0.22);
  --text-primary:   #1A0A2E;
  --text-secondary: rgba(26,10,46,0.65);
  --text-muted:     rgba(26,10,46,0.38);
  --shadow-sm:  0 2px 8px rgba(123,47,190,0.08);
  --shadow-md:  0 8px 32px rgba(123,47,190,0.12);
  --shadow-lg:  0 20px 60px rgba(123,47,190,0.16);
  --shadow-glow: 0 0 40px rgba(123,47,190,0.15);
}

/* ── RESET ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-void);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background var(--dur-slow) var(--ease-fluid),
              color var(--dur-slow) var(--ease-fluid);
}
a { color: var(--orbit-lilac); text-decoration: none; }
a:hover { color: var(--orbit-purple-2); }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* ── TYPOGRAPHY ───────────────────────────────────────────── */
.font-display { font-family: 'Space Grotesk', sans-serif; }

h1, h2, h3, h4, h5, h6 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
}
h1 { font-size: clamp(2rem, 5vw, 3.5rem); letter-spacing: -0.03em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); letter-spacing: -0.02em; }
h3 { font-size: 1.25rem; letter-spacing: -0.01em; }
h4 { font-size: 1rem; }
p  { color: var(--text-secondary); }

.text-xs    { font-size: 0.75rem; }
.text-sm    { font-size: 0.875rem; }
.text-base  { font-size: 1rem; }
.text-lg    { font-size: 1.125rem; }
.text-xl    { font-size: 1.25rem; }
.text-2xl   { font-size: 1.5rem; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.label-caps { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.12em; font-weight: 600; color: var(--text-muted); }

/* ── LAYOUT ───────────────────────────────────────────────── */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform var(--dur-normal) var(--ease-fluid),
              background var(--dur-slow) var(--ease-fluid);
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-logo {
  padding: 24px 20px 16px;
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo-mark {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--orbit-purple), var(--orbit-lilac));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: var(--shadow-glow);
}

.sidebar-logo-mark svg {
  width: 20px; height: 20px;
}

.sidebar-logo-text {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--orbit-lilac) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-section-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 700;
  color: var(--text-muted);
  padding: 16px 8px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  transition: background var(--dur-fast), color var(--dur-fast), transform var(--dur-fast);
  position: relative;
  white-space: nowrap;
}

.nav-item:hover {
  background: var(--bg-glass-hover);
  color: var(--text-primary);
  transform: translateX(2px);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(123,47,190,0.25), rgba(224,64,251,0.12));
  color: var(--orbit-lilac);
  border: 1px solid rgba(224,64,251,0.15);
}

.nav-item.active .nav-icon { color: var(--orbit-lilac); }

.nav-icon {
  width: 18px; height: 18px;
  flex-shrink: 0;
  opacity: 0.7;
}
.nav-item.active .nav-icon,
.nav-item:hover .nav-icon { opacity: 1; }

.nav-badge {
  margin-left: auto;
  background: var(--orbit-purple);
  color: white;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-pill);
  min-width: 18px;
  text-align: center;
}

.nav-badge.urgent { background: var(--color-danger); }

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border-glass);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-md);
  background: var(--bg-glass);
  transition: background var(--dur-fast);
  cursor: pointer;
}

.sidebar-user:hover { background: var(--bg-glass-hover); }

.avatar {
  width: 34px; height: 34px;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--orbit-purple), var(--orbit-lilac));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 0.8rem;
  color: white;
  flex-shrink: 0;
  object-fit: cover;
}

.avatar-sm { width: 28px; height: 28px; font-size: 0.7rem; }
.avatar-lg { width: 48px; height: 48px; font-size: 1rem; }
.avatar-xl { width: 64px; height: 64px; font-size: 1.2rem; }

.user-info { overflow: hidden; }
.user-info .name { font-size: 0.8rem; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-info .role { font-size: 0.65rem; color: var(--text-muted); text-transform: capitalize; }

/* MAIN CONTENT */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin var(--dur-normal) var(--ease-fluid);
}

/* TOPBAR */
.topbar {
  height: var(--header-h);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background var(--dur-slow);
}

.topbar-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-primary);
}

.topbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.topbar-breadcrumb span { color: var(--text-secondary); }
.topbar-breadcrumb .sep { opacity: 0.3; }

.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

/* Theme Toggle */
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-pill);
  padding: 3px;
}

.theme-btn {
  width: 30px; height: 30px;
  border-radius: var(--radius-pill);
  background: transparent;
  border: none;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--dur-fast), color var(--dur-fast);
  font-size: 0.8rem;
}

.theme-btn:hover { color: var(--text-primary); }
.theme-btn.active {
  background: linear-gradient(135deg, var(--orbit-purple), var(--orbit-lilac));
  color: white;
  box-shadow: 0 2px 8px rgba(123,47,190,0.4);
}

/* Notif Bell */
.notif-btn {
  position: relative;
  width: 36px; height: 36px;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--dur-fast), color var(--dur-fast);
}
.notif-btn:hover { background: var(--bg-glass-hover); color: var(--text-primary); }
.notif-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: var(--color-danger);
  border-radius: 50%;
  border: 2px solid var(--bg-surface);
}

/* PAGE CONTENT */
.page-content {
  flex: 1;
  padding: 28px 28px 40px;
}

/* ── CARDS ────────────────────────────────────────────────── */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast),
              background var(--dur-slow);
}

.card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }

.card-glass {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.card-gradient {
  background: linear-gradient(135deg, rgba(123,47,190,0.2), rgba(224,64,251,0.08));
  border: 1px solid rgba(224,64,251,0.15);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
}

.card-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* STAT CARDS */
.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  overflow: hidden;
  transition: transform var(--dur-fast) var(--ease-fluid),
              box-shadow var(--dur-fast),
              border-color var(--dur-fast),
              background var(--dur-slow);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  right: 0; height: 2px;
  background: linear-gradient(90deg, var(--orbit-purple), var(--orbit-lilac));
  opacity: 0;
  transition: opacity var(--dur-fast);
}

.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.stat-card:hover::before { opacity: 1; }

.stat-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(123,47,190,0.2), rgba(224,64,251,0.1));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--orbit-lilac);
}

.stat-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.stat-label { font-size: 0.75rem; color: var(--text-muted); font-weight: 500; }

.stat-change {
  font-size: 0.72rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 3px;
}
.stat-change.up   { color: var(--color-success); }
.stat-change.down { color: var(--color-danger); }

/* ── BUTTONS ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-pill);
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-fluid),
              box-shadow var(--dur-fast),
              background var(--dur-fast),
              opacity var(--dur-fast);
  white-space: nowrap;
  text-decoration: none;
}

.btn:hover  { transform: scale(1.03); }
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--orbit-purple), var(--orbit-lilac));
  color: white;
  box-shadow: 0 4px 16px rgba(123,47,190,0.35);
}
.btn-primary:hover { box-shadow: 0 6px 24px rgba(123,47,190,0.5); color: white; }

.btn-secondary {
  background: var(--bg-surface-2);
  color: var(--text-primary);
  border: 1px solid var(--border-glass);
}
.btn-secondary:hover { background: var(--bg-surface-3); color: var(--text-primary); border-color: var(--border-strong); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-glass);
}
.btn-ghost:hover { background: var(--bg-glass); color: var(--text-primary); }

.btn-danger {
  background: rgba(244,63,94,0.15);
  color: var(--color-danger);
  border: 1px solid rgba(244,63,94,0.25);
}
.btn-danger:hover { background: rgba(244,63,94,0.25); }

.btn-success {
  background: rgba(34,211,165,0.15);
  color: var(--color-success);
  border: 1px solid rgba(34,211,165,0.25);
}
.btn-success:hover { background: rgba(34,211,165,0.25); }

.btn-sm { padding: 6px 12px; font-size: 0.78rem; }
.btn-lg { padding: 12px 28px; font-size: 1rem; }
.btn-icon { padding: 9px; border-radius: var(--radius-md); }
.btn-icon.btn-sm { padding: 6px; }

.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn-sm svg { width: 14px; height: 14px; }

/* ── BADGES ───────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.badge-purple   { background: rgba(123,47,190,0.2);  color: var(--orbit-lilac); border: 1px solid rgba(224,64,251,0.2); }
.badge-success  { background: rgba(34,211,165,0.15); color: var(--color-success); border: 1px solid rgba(34,211,165,0.25); }
.badge-warning  { background: rgba(245,158,11,0.15); color: var(--color-warning); border: 1px solid rgba(245,158,11,0.25); }
.badge-danger   { background: rgba(244,63,94,0.15);  color: var(--color-danger); border: 1px solid rgba(244,63,94,0.25); }
.badge-info     { background: rgba(96,165,250,0.15); color: var(--color-info); border: 1px solid rgba(96,165,250,0.25); }
.badge-neutral  { background: var(--bg-surface-3); color: var(--text-secondary); border: 1px solid var(--border-glass); }

/* Priority badges */
.priority-high   { background: rgba(244,63,94,0.15);  color: var(--priority-high);   border: 1px solid rgba(244,63,94,0.2); }
.priority-medium { background: rgba(245,158,11,0.15); color: var(--priority-medium); border: 1px solid rgba(245,158,11,0.2); }
.priority-low    { background: rgba(34,211,165,0.15); color: var(--priority-low);    border: 1px solid rgba(34,211,165,0.2); }

/* ── FORMS ────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; }

.form-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.875rem;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast), background var(--dur-slow);
  outline: none;
}

.form-control::placeholder { color: var(--text-muted); }
.form-control:focus {
  border-color: var(--orbit-purple);
  box-shadow: 0 0 0 3px rgba(123,47,190,0.15);
  background: var(--bg-surface-3);
}

textarea.form-control { resize: vertical; min-height: 100px; }

.form-control-sm { padding: 7px 11px; font-size: 0.8rem; }

.form-select {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.875rem;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
  outline: none;
  transition: border-color var(--dur-fast), background var(--dur-slow);
}
.form-select:focus { border-color: var(--orbit-purple); box-shadow: 0 0 0 3px rgba(123,47,190,0.15); }
.form-select option { background: var(--bg-surface-2); }

.input-group { position: relative; }
.input-group .input-icon {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 16px; height: 16px;
  pointer-events: none;
}
.input-group .form-control { padding-left: 38px; }

/* ── TABLES ───────────────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-glass);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.table thead {
  background: var(--bg-surface-2);
  border-bottom: 1px solid var(--border-glass);
}

.table th {
  padding: 11px 16px;
  text-align: left;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  white-space: nowrap;
}

.table td {
  padding: 13px 16px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-glass);
  vertical-align: middle;
}

.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background var(--dur-fast); }
.table tbody tr:hover td { background: var(--bg-glass); color: var(--text-primary); }

/* ── KANBAN ───────────────────────────────────────────────── */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  min-height: 500px;
}

.kanban-col {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: background var(--dur-slow);
}

.kanban-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-glass);
}

.kanban-col-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.kanban-col-title span {
  width: 6px; height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.kanban-col[data-col="todo"]        .kanban-col-title span { background: var(--text-muted); }
.kanban-col[data-col="in_progress"] .kanban-col-title span { background: var(--color-warning); }
.kanban-col[data-col="review"]      .kanban-col-title span { background: var(--color-info); }
.kanban-col[data-col="done"]        .kanban-col-title span { background: var(--color-success); }

.kanban-cards { display: flex; flex-direction: column; gap: 8px; min-height: 80px; }

.kanban-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 14px;
  cursor: grab;
  transition: transform var(--dur-fast) var(--ease-fluid),
              box-shadow var(--dur-fast),
              border-color var(--dur-fast),
              background var(--dur-slow);
}
.kanban-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); border-color: var(--border-strong); }
.kanban-card:active { cursor: grabbing; }
.kanban-card.dragging { opacity: 0.5; transform: rotate(2deg) scale(1.02); }

.kanban-card-title { font-size: 0.85rem; font-weight: 600; color: var(--text-primary); margin-bottom: 8px; }
.kanban-card-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

/* ── PIPELINE ─────────────────────────────────────────────── */
.pipeline {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
}

.pipeline-step {
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--bg-surface-3);
  color: var(--text-muted);
  border: 1px solid var(--border-glass);
  cursor: pointer;
  transition: all var(--dur-fast);
  white-space: nowrap;
}

.pipeline-step.current {
  background: linear-gradient(135deg, var(--orbit-purple), var(--orbit-lilac));
  color: white;
  border-color: transparent;
  box-shadow: 0 2px 12px rgba(123,47,190,0.4);
}

.pipeline-step.done { background: rgba(34,211,165,0.15); color: var(--color-success); border-color: rgba(34,211,165,0.25); }

/* ── MODALS ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8,8,15,0.75);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur-normal), visibility var(--dur-normal);
}

.modal-overlay.open { opacity: 1; visibility: visible; }

.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(16px) scale(0.98);
  transition: transform var(--dur-normal) var(--ease-fluid);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.modal-overlay.open .modal { transform: translateY(0) scale(1); }

.modal-lg { max-width: 800px; }
.modal-xl { max-width: 1100px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--border-glass);
}

.modal-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close {
  width: 32px; height: 32px;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--dur-fast), color var(--dur-fast);
}
.modal-close:hover { background: var(--bg-glass-hover); color: var(--text-primary); }

.modal-body { padding: 24px; }
.modal-footer {
  padding: 18px 24px;
  border-top: 1px solid var(--border-glass);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ── NOTIFICATIONS PANEL ──────────────────────────────────── */
.notif-panel {
  position: fixed;
  top: var(--header-h);
  right: 0;
  width: 340px;
  height: calc(100vh - var(--header-h));
  background: var(--bg-surface);
  border-left: 1px solid var(--border-glass);
  z-index: 90;
  transform: translateX(100%);
  transition: transform var(--dur-normal) var(--ease-fluid);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.notif-panel.open { transform: translateX(0); }

.notif-panel-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.notif-list { flex: 1; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 6px; }

.notif-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  transition: background var(--dur-fast);
  cursor: pointer;
}
.notif-item:hover { background: var(--bg-glass-hover); }
.notif-item.unread { border-color: rgba(123,47,190,0.2); }

.notif-type-icon {
  width: 32px; height: 32px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.notif-type-icon.urgent  { background: rgba(244,63,94,0.15); color: var(--color-danger); }
.notif-type-icon.warning { background: rgba(245,158,11,0.15); color: var(--color-warning); }
.notif-type-icon.info    { background: rgba(96,165,250,0.15); color: var(--color-info); }
.notif-type-icon.success { background: rgba(34,211,165,0.15); color: var(--color-success); }

.notif-content .title { font-size: 0.82rem; font-weight: 600; color: var(--text-primary); margin-bottom: 2px; }
.notif-content .msg   { font-size: 0.75rem; color: var(--text-muted); }
.notif-content .time  { font-size: 0.68rem; color: var(--text-muted); margin-top: 4px; }

/* ── TABS ─────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 2px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-pill);
  padding: 3px;
  width: fit-content;
}

.tab-btn {
  padding: 7px 18px;
  border-radius: var(--radius-pill);
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--dur-fast), color var(--dur-fast);
  white-space: nowrap;
}

.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active {
  background: linear-gradient(135deg, var(--orbit-purple), var(--orbit-lilac));
  color: white;
  box-shadow: 0 2px 8px rgba(123,47,190,0.35);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── PROGRESS ─────────────────────────────────────────────── */
.progress {
  width: 100%;
  height: 6px;
  background: var(--bg-surface-3);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--orbit-purple), var(--orbit-lilac));
  border-radius: var(--radius-pill);
  transition: width var(--dur-slow) var(--ease-fluid);
}

/* ── ALERTS ───────────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
}

.alert-danger  { background: rgba(244,63,94,0.1);  border: 1px solid rgba(244,63,94,0.2);  color: var(--color-danger); }
.alert-warning { background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.2); color: var(--color-warning); }
.alert-success { background: rgba(34,211,165,0.1); border: 1px solid rgba(34,211,165,0.2); color: var(--color-success); }
.alert-info    { background: rgba(96,165,250,0.1); border: 1px solid rgba(96,165,250,0.2); color: var(--color-info); }

/* ── GRID UTILITIES ───────────────────────────────────────── */
.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start  { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-end     { justify-content: flex-end; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }

.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }

.w-full { width: 100%; }
.hidden { display: none !important; }
.text-right { text-align: right; }
.text-center { text-align: center; }

/* ── DIVIDER ──────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border-glass);
  margin: 16px 0;
}

/* ── EMPTY STATE ──────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  gap: 12px;
}

.empty-icon {
  width: 64px; height: 64px;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, rgba(123,47,190,0.15), rgba(224,64,251,0.08));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--orbit-lilac);
  margin-bottom: 4px;
}

.empty-title { font-family: 'Space Grotesk', sans-serif; font-size: 1rem; font-weight: 600; }
.empty-subtitle { font-size: 0.875rem; color: var(--text-muted); max-width: 300px; }

/* ── TOAST ────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  min-width: 280px;
  max-width: 360px;
  pointer-events: all;
  animation: toastIn var(--dur-normal) var(--ease-fluid) forwards;
}

.toast.out { animation: toastOut var(--dur-fast) ease forwards; }

.toast-icon { width: 20px; height: 20px; flex-shrink: 0; }
.toast-msg  { font-size: 0.875rem; color: var(--text-primary); flex: 1; }

.toast.success { border-left: 3px solid var(--color-success); }
.toast.error   { border-left: 3px solid var(--color-danger); }
.toast.warning { border-left: 3px solid var(--color-warning); }
.toast.info    { border-left: 3px solid var(--orbit-lilac); }

@keyframes toastIn  { from { transform: translateX(110%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes toastOut { from { transform: translateX(0); opacity: 1; } to { transform: translateX(110%); opacity: 0; } }

/* ── SCROLLBAR ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-surface-3); border-radius: var(--radius-pill); }
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

/* ── ANIMATIONS ───────────────────────────────────────────── */
@keyframes fadeIn    { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulseGlow { 0%,100% { box-shadow: 0 0 0 0 rgba(224,64,251,0); } 50% { box-shadow: 0 0 20px 4px rgba(224,64,251,0.2); } }
@keyframes float     { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes spin      { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.animate-fade-in { animation: fadeIn var(--dur-slow) var(--ease-fluid) both; }
.animate-pulse   { animation: pulseGlow 3s ease infinite; }
.animate-float   { animation: float 4s ease-in-out infinite; }
.animate-spin    { animation: spin 1s linear infinite; }

/* Stagger children */
.stagger > * { opacity: 0; animation: fadeIn var(--dur-slow) var(--ease-fluid) both; }
.stagger > *:nth-child(1) { animation-delay: 0ms; }
.stagger > *:nth-child(2) { animation-delay: 60ms; }
.stagger > *:nth-child(3) { animation-delay: 120ms; }
.stagger > *:nth-child(4) { animation-delay: 180ms; }
.stagger > *:nth-child(5) { animation-delay: 240ms; }
.stagger > *:nth-child(6) { animation-delay: 300ms; }

/* ── RESPONSIVE ───────────────────────────────────────────── */

/* Tablet */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .kanban-board { grid-template-columns: repeat(2, 1fr); }

  /* Projects/campaigns side panels */
  [style*="grid-template-columns:1fr 300px"],
  [style*="grid-template-columns:1fr 280px"],
  [style*="grid-template-columns:1fr 340px"] {
    grid-template-columns: 1fr !important;
  }
}

/* Mobile */
@media (max-width: 768px) {

  /* ── Layout ── */
  :root { --sidebar-w: 0px; --header-h: 56px; }

  .sidebar {
    transform: translateX(-240px);
    width: 240px;
    z-index: 300;
    box-shadow: none;
  }
  .sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

  /* Overlay when sidebar open */
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 299;
    backdrop-filter: blur(2px);
  }
  .sidebar-overlay.active { display: block; }

  .main-content { margin-left: 0; }

  .topbar {
    padding: 0 12px;
    gap: 10px;
    height: var(--header-h);
  }

  .topbar-title { font-size: 0.875rem; }
  .topbar-breadcrumb { display: none; }

  /* Hide theme toggle labels on mobile, keep buttons */
  .theme-toggle { display: none; }

  .page-content { padding: 12px 12px 32px; }

  /* ── Grids ── */
  .grid-2,
  .grid-3,
  .grid-4 { grid-template-columns: 1fr; }

  .grid-auto { grid-template-columns: 1fr; }

  /* Force all inline style grids to single column */
  [style*="grid-template-columns:1fr 300px"],
  [style*="grid-template-columns:1fr 280px"],
  [style*="grid-template-columns:1fr 340px"],
  [style*="grid-template-columns:1fr 1fr"],
  [style*="grid-template-columns: 1fr 300px"],
  [style*="grid-template-columns: 1fr 280px"],
  [style*="grid-template-columns: 1fr 340px"] {
    grid-template-columns: 1fr !important;
  }

  /* ── Cards & Stat Cards ── */
  .card { padding: 16px; }
  .stat-card { padding: 14px; }
  .stat-value { font-size: 1.4rem; }

  /* ── Hero liquid strip ── */
  .hero-liquid {
    margin: -12px -12px 20px !important;
    padding: 24px 20px !important;
    border-radius: 0 0 48px 20px !important;
  }
  .hero-liquid h1 { font-size: 1.4rem !important; }

  /* ── Modals ── */
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal,
  .modal-lg,
  .modal-xl {
    max-width: 100% !important;
    width: 100%;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    max-height: 92vh;
  }

  /* ── Tabs ── */
  .tabs {
    width: 100%;
    overflow-x: auto;
    border-radius: var(--radius-md);
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tab-btn { white-space: nowrap; font-size: 0.78rem; padding: 6px 12px; }

  /* ── Pipeline steps ── */
  .pipeline {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .pipeline::-webkit-scrollbar { display: none; }

  /* ── Kanban ── */
  .kanban-board {
    grid-template-columns: 1fr;
    overflow-x: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  /* ── Tables ── */
  .table-wrapper { border-radius: var(--radius-md); }
  .table th,
  .table td { padding: 10px 12px; font-size: 0.78rem; }

  /* Hide less important table columns on mobile */
  .table .hide-mobile { display: none; }

  /* ── Buttons ── */
  .btn-lg { padding: 10px 20px; font-size: 0.875rem; }

  /* ── Topbar actions ── */
  .topbar-actions { gap: 6px; }

  /* ── Notification panel ── */
  .notif-panel {
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--border-glass);
  }

  /* ── Filters bar: stack on mobile ── */
  .filters-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .filters-bar .input-group { max-width: 100% !important; }
  .filters-bar select { width: 100% !important; }

  /* ── Page headers: stack title + button ── */
  .page-header-row {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 12px !important;
  }

  /* ── Profile page ── */
  .profile-grid { grid-template-columns: 1fr !important; }

  /* ── Login ── */
  .login-card { padding: 32px 20px; }
  .login-bg-blob { display: none; }

  /* ── Canvas toolbar: scroll horizontally ── */
  .canvas-toolbar {
    left: 12px;
    right: 12px;
    transform: none;
    overflow-x: auto;
    scrollbar-width: none;
    border-radius: var(--radius-md);
    flex-wrap: nowrap;
    white-space: nowrap;
    justify-content: flex-start;
  }
  .canvas-toolbar::-webkit-scrollbar { display: none; }

  /* ── Stat cards row: 2 columns on mobile ── */
  .stats-row {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* ── Dev board task rows ── */
  .task-row-actions { flex-direction: column; align-items: flex-start !important; }

  /* ── Breadcrumb in topbar ── */
  .topbar > div { min-width: 0; overflow: hidden; }

  /* ── Swipe/project card meta ── */
  .card-header { flex-wrap: wrap; }

  /* ── Form grids collapse ── */
  .modal-body .grid-2,
  .modal-body .grid-3 { grid-template-columns: 1fr !important; }

  /* ── Bottom nav (mobile shortcut bar) ── */
  .mobile-nav {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-glass);
    z-index: 200;
    padding: 6px 0 max(6px, env(safe-area-inset-bottom));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }

  .mobile-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 6px 4px;
    color: var(--text-muted);
    font-size: 0.6rem;
    font-weight: 600;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    transition: color var(--dur-fast);
    -webkit-tap-highlight-color: transparent;
  }
  .mobile-nav-item svg { width: 20px; height: 20px; }
  .mobile-nav-item.active { color: var(--orbit-lilac); }
  .mobile-nav-item span { display: block; }

  /* Push page content above mobile nav */
  .page-content { padding-bottom: 72px; }
}

/* ── Desktop: hide mobile nav ── */
@media (min-width: 769px) {
  .mobile-nav { display: none !important; }
  #sidebar-toggle { display: none !important; }
  .sidebar-overlay { display: none !important; }
}

/* ── CANVAS VISUAL ────────────────────────────────────────── */
.canvas-container {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-void);
  background-image:
    radial-gradient(circle at 20px 20px, var(--border-glass) 1px, transparent 1px);
  background-size: 32px 32px;
  cursor: default;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-glass);
}

.canvas-toolbar {
  position: absolute;
  top: 14px; left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  padding: 5px 10px;
  z-index: 10;
  box-shadow: var(--shadow-md);
}

.canvas-node {
  position: absolute;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  min-width: 160px;
  cursor: move;
  user-select: none;
  transition: box-shadow var(--dur-fast), border-color var(--dur-fast);
  box-shadow: var(--shadow-sm);
}

.canvas-node:hover { box-shadow: var(--shadow-md); border-color: var(--orbit-purple); }
.canvas-node.selected { border-color: var(--orbit-lilac); box-shadow: 0 0 0 3px rgba(224,64,251,0.2), var(--shadow-md); }

.canvas-node-type {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.canvas-node-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.canvas-node-port {
  position: absolute;
  width: 12px; height: 12px;
  background: var(--bg-surface-3);
  border: 2px solid var(--border-strong);
  border-radius: 50%;
  cursor: crosshair;
  transition: background var(--dur-fast), border-color var(--dur-fast);
}
.canvas-node-port:hover { background: var(--orbit-lilac); border-color: var(--orbit-lilac); }
.canvas-node-port.right { right: -7px; top: 50%; transform: translateY(-50%); }
.canvas-node-port.left  { left: -7px; top: 50%; transform: translateY(-50%); }

.canvas-connection-svg {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* Login page */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-void);
  position: relative;
  overflow: hidden;
}

.login-bg-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.15;
  pointer-events: none;
}
.login-bg-blob.b1 { width: 500px; height: 500px; background: var(--orbit-purple); top: -100px; left: -150px; }
.login-bg-blob.b2 { width: 400px; height: 400px; background: var(--orbit-lilac); bottom: -80px; right: -100px; }

.login-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  padding: 44px 40px;
  width: 100%;
  max-width: 400px;
  position: relative;
  z-index: 1;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

/* Liquid hero section */
.hero-liquid {
  background: linear-gradient(135deg, var(--orbit-purple) 0%, var(--orbit-lilac) 100%);
  border-radius: 0 0 100px 40px;
  padding: 48px;
  position: relative;
  overflow: hidden;
  margin-bottom: 32px;
}

.hero-liquid::before {
  content: '';
  position: absolute;
  top: -60%;
  right: -20%;
  width: 400px; height: 400px;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
  pointer-events: none;
}
