/* ============================================================
   NexusERP 2026 — Renaissance UI Design System v2
   Inspired by: Linear, Vercel, Raycast
   Font: Inter + JetBrains Mono
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;600&display=swap');

/* ── Design Tokens ────────────────────────────────────────── */
:root {
  /* Surfaces */
  --bg-base: #070710;
  --bg-subtle: #0c0c1a;
  --bg-elevated: #111127;
  --bg-overlay: #16162e;
  --bg-input: #1a1a32;

  /* Borders */
  --border-subtle: rgba(255, 255, 255, .06);
  --border-default: rgba(255, 255, 255, .10);
  --border-strong: rgba(255, 255, 255, .18);

  /* Brand Accents */
  --accent: #6366f1;
  /* indigo */
  --accent-hover: #818cf8;
  --accent-dim: rgba(99, 102, 241, .15);

  --blue: #38bdf8;
  --green: #34d399;
  --amber: #fbbf24;
  --red: #f87171;
  --purple: #c084fc;
  --pink: #f472b6;
  --cyan: #22d3ee;
  --teal: #2dd4bf;

  /* Text */
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #475569;
  --text-disabled: #334155;

  /* Semantic */
  --success-bg: rgba(52, 211, 153, .1);
  --success-border: rgba(52, 211, 153, .25);
  --warning-bg: rgba(251, 191, 36, .1);
  --warning-border: rgba(251, 191, 36, .25);
  --error-bg: rgba(248, 113, 113, .1);
  --error-border: rgba(248, 113, 113, .25);
  --info-bg: rgba(56, 189, 248, .1);
  --info-border: rgba(56, 189, 248, .2);

  /* Layout */
  --sidebar-w: 232px;
  --topbar-h: 52px;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Radii */
  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-2xl: 20px;

  /* Shadows */
  --shadow-xs: 0 1px 3px rgba(0, 0, 0, .4);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, .5);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, .55);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, .65);
  --shadow-xl: 0 20px 60px rgba(0, 0, 0, .75);

  --transition-fast: .12s cubic-bezier(.4, 0, .2, 1);
  --transition: .2s cubic-bezier(.4, 0, .2, 1);
  --transition-slow: .35s cubic-bezier(.4, 0, .2, 1);
}

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

html {
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
}

/* ── Ambient lighting ─────────────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(99, 102, 241, .08) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 100%, rgba(192, 132, 252, .06) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* ── App shell ─────────────────────────────────────────────── */
#app {
  display: flex;
  height: 100vh;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

/* ══════════════════════════════════════════════════════════════
   SIDEBAR
══════════════════════════════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--bg-subtle);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform var(--transition-slow);
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar::-webkit-scrollbar {
  width: 4px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: 2px;
}

/* Brand */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.brand-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .88rem;
  font-weight: 800;
  color: #fff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, .4);
  flex-shrink: 0;
}

.brand-name {
  font-size: .92rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -.02em;
}

.brand-sub {
  font-size: .66rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: .03em;
  text-transform: uppercase;
}

/* Nav */
.sidebar-nav {
  flex: 1;
  padding: 10px 8px;
}

.nav-section-label {
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 16px 8px 5px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  border-radius: var(--r-md);
  cursor: pointer;
  font-size: .825rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  position: relative;
  user-select: none;
}

.nav-item:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, .05);
}

.nav-item.active {
  color: var(--text-primary);
  background: rgba(99, 102, 241, .14);
  font-weight: 600;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 18px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}

.nav-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  stroke-width: 1.75;
}

.nav-badge {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: rgba(248, 113, 113, .18);
  color: var(--red);
  font-size: .62rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(248, 113, 113, .25);
}

/* Footer */
.sidebar-footer {
  padding: 12px 8px;
  border-top: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.user-card:hover {
  background: rgba(255, 255, 255, .04);
}

.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.user-name {
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-primary);
}

.user-role {
  font-size: .66rem;
  color: var(--text-muted);
}

/* ══════════════════════════════════════════════════════════════
   MAIN + TOPBAR
══════════════════════════════════════════════════════════════ */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.topbar {
  height: var(--topbar-h);
  background: rgba(7, 7, 16, .8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 50;
  flex-shrink: 0;
}

.topbar-title {
  font-size: .9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.topbar-subtitle {
  display: none;
}

.topbar-spacer {
  flex: 1;
}

/* Topbar Search */
.topbar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--r-lg);
  padding: 6px 12px;
  width: 280px;
  transition: all var(--transition);
}

.topbar-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .12);
}

.topbar-search input {
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: .8rem;
  font-family: var(--font-sans);
  width: 100%;
}

.topbar-search input::placeholder {
  color: var(--text-muted);
}

/* Topbar buttons */
.topbar-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  position: relative;
  border: 1px solid transparent;
}

.topbar-btn:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

.topbar-btn .dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  border: 2px solid var(--bg-base);
}

/* ── Content area ───────────────────────────────────────────── */
.content {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
  position: relative;
}

.content::-webkit-scrollbar {
  width: 5px;
}

.content::-webkit-scrollbar-track {
  background: transparent;
}

.content::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: 3px;
}

.module-view {
  max-width: 1400px;
  margin: 0 auto;
}

/* ── Page structure ─────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}

.page-title {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -.03em;
}

.page-subtitle {
  font-size: .78rem;
  color: var(--text-muted);
  margin-top: 3px;
}

/* ══════════════════════════════════════════════════════════════
   COMPONENTS
══════════════════════════════════════════════════════════════ */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--r-md);
  font-size: .8rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
  font-family: var(--font-sans);
  white-space: nowrap;
  line-height: 1;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  box-shadow: 0 4px 14px rgba(99, 102, 241, .35);
  transform: translateY(-1px);
}

.btn-glass {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border-color: var(--border-default);
}

.btn-glass:hover {
  background: var(--bg-overlay);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.btn-danger {
  background: rgba(248, 113, 113, .15);
  color: var(--red);
  border-color: rgba(248, 113, 113, .3);
}

.btn-danger:hover {
  background: rgba(248, 113, 113, .25);
}

.btn:active {
  transform: scale(.97);
}

/* Cards */
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-xl);
  transition: all var(--transition);
}

.card:hover {
  border-color: var(--border-default);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.card-body {
  padding: 16px 20px;
}

/* Stats row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.stat-box {
  padding: 18px 20px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.stat-box::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity var(--transition-fast);
  background: rgba(255, 255, 255, .025);
}

.stat-box:hover::after {
  opacity: 1;
}

.stat-value {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: .72rem;
  color: var(--text-muted);
  margin-top: 6px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.stat-delta {
  font-size: .7rem;
  font-weight: 600;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 3px;
}

/* Charts */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

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

.chart-container {
  position: relative;
  height: 220px;
  width: 100%;
}

/* Tables */
.table-wrap {
  overflow-x: auto;
}

.table-wrap::-webkit-scrollbar {
  height: 4px;
}

.table-wrap::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: 2px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .8rem;
}

.data-table thead th {
  text-align: left;
  padding: 9px 14px;
  font-size: .67rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.data-table tbody tr {
  border-bottom: 1px solid rgba(255, 255, 255, .03);
  transition: background var(--transition-fast);
}

.data-table tbody tr:last-child {
  border-bottom: none;
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, .03);
}

.data-table td {
  padding: 11px 14px;
  color: var(--text-secondary);
  vertical-align: middle;
}

.data-table td.bold {
  color: var(--text-primary);
  font-weight: 500;
}

.data-table tr.clickable {
  cursor: pointer;
}

.data-table tr.clickable:hover td {
  color: var(--text-primary);
}

.data-table tr.clickable:hover {
  background: rgba(99, 102, 241, .05);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: .65rem;
  font-weight: 600;
  letter-spacing: .02em;
  white-space: nowrap;
  border: 1px solid transparent;
}

.badge.ok {
  background: var(--success-bg);
  color: var(--green);
  border-color: var(--success-border);
}

.badge.low {
  background: var(--warning-bg);
  color: var(--amber);
  border-color: var(--warning-border);
}

.badge.critical {
  background: var(--error-bg);
  color: var(--red);
  border-color: var(--error-border);
}

.badge.pending {
  background: rgba(192, 132, 252, .1);
  color: var(--purple);
  border-color: rgba(192, 132, 252, .25);
}

.badge.transit {
  background: var(--info-bg);
  color: var(--blue);
  border-color: var(--info-border);
}

.badge.draft {
  background: rgba(255, 255, 255, .05);
  color: var(--text-muted);
  border-color: var(--border-default);
}

.badge.active {
  background: var(--success-bg);
  color: var(--green);
  border-color: var(--success-border);
}

.badge.inactive {
  background: var(--error-bg);
  color: var(--red);
  border-color: var(--error-border);
}

/* Filter bar */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.filter-input {
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--r-md);
  padding: 7px 12px;
  color: var(--text-primary);
  font-size: .8rem;
  font-family: var(--font-sans);
  min-width: 200px;
  outline: none;
  transition: all var(--transition-fast);
}

.filter-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .12);
}

.filter-input::placeholder {
  color: var(--text-muted);
}

select.filter-input option {
  background: var(--bg-overlay);
  color: var(--text-primary);
}

/* Alerts/info boxes */
.info-box {
  background: var(--info-bg);
  border: 1px solid var(--info-border);
  border-radius: var(--r-md);
  padding: 10px 14px;
  font-size: .8rem;
  color: var(--text-secondary);
  margin-bottom: 14px;
  line-height: 1.6;
}

/* Alert items (notifications style) */
.alert-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
  transition: opacity var(--transition-fast);
}

.alert-item:last-child {
  border-bottom: none;
}

.alert-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.alert-dot.high {
  background: var(--red);
  box-shadow: 0 0 6px rgba(248, 113, 113, .5);
}

.alert-dot.med {
  background: var(--amber);
  box-shadow: 0 0 6px rgba(251, 191, 36, .4);
}

.alert-dot.low {
  background: var(--blue);
}

.alert-dot.ok {
  background: var(--green);
}

/* ══════════════════════════════════════════════════════════════
   DETAIL PANEL (SLIDE-IN)
══════════════════════════════════════════════════════════════ */
.panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-slow);
}

.panel-overlay.visible {
  opacity: 1;
  pointer-events: all;
}

.detail-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 400px;
  max-width: 100vw;
  height: 100vh;
  background: var(--bg-elevated);
  border-left: 1px solid var(--border-default);
  box-shadow: var(--shadow-xl);
  z-index: 201;
  transform: translateX(100%);
  transition: transform var(--transition-slow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.detail-panel.open {
  transform: translateX(0);
}

.panel-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.panel-header-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.panel-title {
  font-size: .92rem;
  font-weight: 700;
  color: var(--text-primary);
}

.panel-subtitle {
  font-size: .72rem;
  color: var(--text-muted);
  margin-top: 1px;
}

.panel-close {
  margin-left: auto;
  width: 28px;
  height: 28px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  transition: all var(--transition-fast);
}

.panel-close:hover {
  background: var(--bg-overlay);
  color: var(--text-primary);
}

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

.panel-body::-webkit-scrollbar {
  width: 4px;
}

.panel-body::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: 2px;
}

.panel-section {
  margin-bottom: 20px;
}

.panel-section-title {
  font-size: .66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.panel-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .04);
}

.panel-row:last-child {
  border-bottom: none;
}

.panel-row-label {
  font-size: .78rem;
  color: var(--text-muted);
}

.panel-row-value {
  font-size: .78rem;
  color: var(--text-primary);
  font-weight: 500;
  text-align: right;
}

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

/* Stock bar */
.stock-bar-wrap {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, .06);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 4px;
}

.stock-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width .6s cubic-bezier(.4, 0, .2, 1);
}

/* Ring chart */
.ring-wrap {
  position: relative;
  width: 100px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
}

.ring-track {
  fill: none;
  stroke: rgba(255, 255, 255, .06);
}

.ring-fill {
  fill: none;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  stroke-linecap: round;
  transition: stroke-dashoffset .8s cubic-bezier(.4, 0, .2, 1);
}

/* ══════════════════════════════════════════════════════════════
   TOAST
══════════════════════════════════════════════════════════════ */
.toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-overlay);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: all .3s cubic-bezier(.4, 0, .2, 1);
  z-index: 500;
  max-width: 380px;
  backdrop-filter: blur(20px);
}

.toast.show {
  opacity: 1;
  pointer-events: all;
  transform: translateX(-50%) translateY(0);
}

.toast-icon {
  flex-shrink: 0;
}

.toast-msg {
  font-size: .8rem;
  color: var(--text-primary);
  font-weight: 500;
}

/* ══════════════════════════════════════════════════════════════
   KANBAN (CRM)
══════════════════════════════════════════════════════════════ */
.kanban-board {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 10px;
  margin-bottom: 18px;
}

.kanban-board::-webkit-scrollbar {
  height: 4px;
}

.kanban-board::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: 2px;
}

.kanban-col {
  min-width: 220px;
  flex-shrink: 0;
  background: var(--bg-overlay);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-xl);
  overflow: hidden;
}

.kanban-col-header {
  padding: 12px 14px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
}

.kanban-col-title {
  font-size: .78rem;
  font-weight: 600;
}

.kanban-col-count {
  font-size: .68rem;
  font-weight: 700;
  background: rgba(255, 255, 255, .08);
  padding: 1px 7px;
  border-radius: 10px;
  color: var(--text-muted);
}

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

.kanban-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  padding: 11px 12px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.kanban-card:hover {
  border-color: rgba(99, 102, 241, .4);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .3);
  transform: translateY(-1px);
}

.kanban-card-name {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.kanban-card-meta {
  font-size: .7rem;
  color: var(--text-muted);
}

/* ══════════════════════════════════════════════════════════════
   GANTT / PROGRESS BARS (Production)
══════════════════════════════════════════════════════════════ */
.progress-bar-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.progress-bar-track {
  flex: 1;
  height: 5px;
  background: rgba(255, 255, 255, .06);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width .6s cubic-bezier(.4, 0, .2, 1);
}

/* ══════════════════════════════════════════════════════════════
   SCHEMA (code blocks)
══════════════════════════════════════════════════════════════ */
.sql-block {
  background: var(--bg-base);
  border: 1px solid var(--border-default);
  border-radius: var(--r-lg);
  padding: 16px;
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--cyan);
  overflow-x: auto;
  line-height: 1.7;
}

.schema-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

/* ══════════════════════════════════════════════════════════════
   ANIMATIONS
══════════════════════════════════════════════════════════════ */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(16px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse-dot {

  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.4);
    opacity: .7;
  }
}

@keyframes ripple {
  0% {
    width: 0;
    height: 0;
    opacity: .4;
  }

  100% {
    width: 300px;
    height: 300px;
    opacity: 0;
  }
}

.animate-in {
  animation: fadeUp .28s cubic-bezier(.4, 0, .2, 1) both;
}

.animate-in-right {
  animation: slideInRight .25s cubic-bezier(.4, 0, .2, 1) both;
}

/* Staggered children */
.animate-in:nth-child(1) {
  animation-delay: 0s;
}

.animate-in:nth-child(2) {
  animation-delay: .04s;
}

.animate-in:nth-child(3) {
  animation-delay: .08s;
}

.animate-in:nth-child(4) {
  animation-delay: .12s;
}

/* Ripple effect */
.ripple-container {
  position: relative;
  overflow: hidden;
}

.ripple-effect {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, .1);
  transform: translate(-50%, -50%);
  animation: ripple .5s ease-out forwards;
  pointer-events: none;
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    transform: translateX(-100%);
    z-index: 300;
    box-shadow: var(--shadow-xl);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .content {
    padding: 16px;
  }

  .topbar {
    padding: 0 14px;
  }

  .charts-grid {
    grid-template-columns: 1fr !important;
  }

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

  .detail-panel {
    width: 100vw;
  }
}

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

  .page-header {
    flex-direction: column;
  }

  .topbar-search {
    display: none;
  }
}

/* ══════════════════════════════════════════════════════════════
   FLOW / ROADMAP steps
══════════════════════════════════════════════════════════════ */
.flow-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.flow-step {
  display: flex;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.flow-step:last-child {
  border-bottom: none;
}

.flow-step-num {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 1px solid rgba(99, 102, 241, .3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .72rem;
  font-weight: 700;
  color: var(--accent);
}

.flow-step-icon {
  color: var(--accent);
  width: 16px;
  height: 16px;
}

.flow-step-title {
  font-size: .84rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 3px;
}

.flow-step-desc {
  font-size: .77rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ══════════════════════════════════════════════════════════════
   MISC UTILITIES
══════════════════════════════════════════════════════════════ */
code {
  font-family: var(--font-mono);
  font-size: .8em;
  background: rgba(255, 255, 255, .06);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
}

hr {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: 16px 0;
}

/* Search dropdown */
#search-results {
  scrollbar-width: thin;
  scrollbar-color: var(--border-subtle) transparent;
}

#search-results::-webkit-scrollbar {
  width: 4px;
}

#search-results::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: 2px;
}

/* Segment tabs */
.tab-group {
  display: flex;
  gap: 2px;
  background: var(--bg-overlay);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  padding: 3px;
  margin-bottom: 16px;
  width: fit-content;
}

.tab-item {
  padding: 5px 14px;
  border-radius: var(--r-md);
  font-size: .78rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
}

.tab-item.active {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border-default);
}

.tab-item:hover:not(.active) {
  color: var(--text-secondary);
}

/* Metric chip */
.metric-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .7rem;
  font-weight: 600;
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

.metric-chip.up {
  background: var(--success-bg);
  color: var(--green);
  border-color: var(--success-border);
}

.metric-chip.down {
  background: var(--error-bg);
  color: var(--red);
  border-color: var(--error-border);
}

/* Empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--text-muted);
  text-align: center;
}

.empty-state svg {
  opacity: .3;
  margin-bottom: 12px;
}