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

@import "tailwindcss";

/* ============================================
   JABNET Sales CRM v2.0 — Design System
   Reference: Linear.app / Notion / Vercel
   ============================================ */

:root {
  /* Primary (JABNET Navy) */
  --color-primary-900: #1A2744;
  --color-primary-800: #2A3F6A;
  --color-primary-700: #3A5590;
  --color-primary-600: #4A6BB6;

  /* Accent (JABNET Orange) */
  --color-accent-500: #E8712B;
  --color-accent-400: #F08C4F;
  --color-accent-300: #F4A876;
  --color-accent-100: #FFF3E0;

  /* Semantic */
  --color-success: #10B981;
  --color-warning: #F59E0B;
  --color-danger: #EF4444;
  --color-info: #3B82F6;

  /* Neutral */
  --color-bg: #F8FAFC;
  --color-card: #FFFFFF;
  --color-border: #E2E8F0;
  --color-text: #1E293B;
  --color-muted: #64748B;
  --color-subtle: #F1F5F9;

  /* Stage colors */
  --stage-new: #3B82F6;
  --stage-contacted: #6366F1;
  --stage-visited: #8B5CF6;
  --stage-surveyed: #F59E0B;
  --stage-negotiation: #E8712B;
  --stage-won: #10B981;
  --stage-lost: #64748B;

  /* Priority */
  --priority-cold: #64748B;
  --priority-warm: #F59E0B;
  --priority-hot: #EF4444;

  /* Layout */
  --sidebar-width: 240px;
  --sidebar-collapsed: 64px;
  --topbar-height: 0px;

  /* Typography */
  --font-family: 'Inter', system-ui, -apple-system, sans-serif;
  --text-xs: 0.6875rem;
  /* 11px */
  --text-sm: 0.8125rem;
  /* 13px */
  --text-base: 0.875rem;
  /* 14px */
  --text-lg: 1rem;
  /* 16px */
  --text-xl: 1.25rem;
  /* 20px */
  --text-2xl: 1.5rem;
  /* 24px */
  --text-3xl: 1.75rem;
  /* 28px */

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-family);
  font-size: var(--text-base);
  background: var(--color-bg);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  min-height: 100dvh;
  overscroll-behavior-y: contain;
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

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

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ============================================
   CARD — Clean, modern SaaS style
   ============================================ */
.card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.card-interactive:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

/* Legacy glass-card alias */
.glass-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.glass-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

/* ============================================
   KPI CARD — v2.0 Modern Metric Card
   White bg, icon circle, progress bar,
   traffic-light indicator
   ============================================ */
.kpi-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  position: relative;
  overflow: hidden;
}

.kpi-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  transform: translateY(-1px);
}

.kpi-icon-circle {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kpi-value {
  font-size: var(--text-3xl);
  font-weight: 700;
  line-height: 1;
  color: var(--color-text);
}

.kpi-label {
  font-size: var(--text-sm);
  color: var(--color-muted);
  font-weight: 500;
}

.kpi-progress {
  width: 100%;
  height: 4px;
  background: var(--color-subtle);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.kpi-progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.kpi-trend-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
}

.kpi-trend-up {
  background: #ECFDF5;
  color: #059669;
}

.kpi-trend-down {
  background: #FEF2F2;
  color: #DC2626;
}

/* Traffic Light Status */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.status-on-track {
  background: var(--color-success);
}

.status-warning {
  background: var(--color-warning);
}

.status-critical {
  background: var(--color-danger);
}

.status-label {
  font-size: var(--text-xs);
  font-weight: 600;
}

/* ============================================
   SIDEBAR — Collapsible (240px ↔ 64px)
   ============================================ */
.sidebar {
  width: var(--sidebar-width);
  background: var(--color-primary-900);
  color: white;
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  transition: width 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  overflow: hidden;
}

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

.sidebar-logo {
  padding: 1.25rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  min-height: 64px;
}

.sidebar-logo-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--color-accent-500), var(--color-accent-400));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-logo-text {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  white-space: nowrap;
  transition: opacity 0.2s ease;
}

.sidebar.collapsed .sidebar-logo-text {
  opacity: 0;
  width: 0;
}

.sidebar-nav {
  flex: 1;
  padding: 0.75rem 0.5rem;
  overflow-y: auto;
}

.sidebar-section-label {
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.35);
  padding: 0.75rem 0.75rem 0.375rem;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar.collapsed .sidebar-section-label {
  opacity: 0;
  height: 0;
  padding: 0;
}

.sidebar-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-md);
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: 500;
  transition: all 0.15s ease;
  margin: 1px 0;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: white;
}

.sidebar-link.active {
  background: rgba(232, 113, 43, 0.15);
  color: var(--color-accent-500);
}

.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: -0.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  border-radius: 0 3px 3px 0;
  background: var(--color-accent-500);
}

.sidebar-link-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-link-text {
  transition: opacity 0.15s ease;
}

.sidebar.collapsed .sidebar-link-text,
.sidebar.collapsed .sidebar-link .sidebar-badge {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

.sidebar.collapsed .sidebar-link {
  justify-content: center;
  padding: 0.625rem;
}

.sidebar-badge {
  margin-left: auto;
  background: var(--color-accent-500);
  color: white;
  font-size: 0.625rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  min-width: 18px;
  text-align: center;
  flex-shrink: 0;
}

/* Sidebar user section */
.sidebar-user {
  padding: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  overflow: hidden;
}

.sidebar-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--color-primary-800);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-accent-400);
  flex-shrink: 0;
  position: relative;
}

.sidebar-avatar .online-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-success);
  border: 2px solid var(--color-primary-900);
}

.sidebar-user-info {
  overflow: hidden;
  transition: opacity 0.15s ease;
}

.sidebar.collapsed .sidebar-user-info {
  opacity: 0;
  width: 0;
}

.sidebar-collapse-btn {
  padding: 0.5rem;
  margin: 0.25rem 0.5rem 0.5rem;
  border: none;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.sidebar-collapse-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: white;
}

/* Tooltip for collapsed mode */
.sidebar-tooltip {
  position: absolute;
  left: calc(var(--sidebar-collapsed) + 8px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--color-primary-900);
  color: white;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 50;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.sidebar.collapsed .sidebar-link:hover .sidebar-tooltip {
  opacity: 1;
}

/* ============================================
   MOBILE BOTTOM NAV
   ============================================ */
.mobile-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-top: 1px solid var(--color-border);
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
  z-index: 50;
  display: none;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  height: auto;
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px 4px 6px;
  color: var(--color-muted);
  font-size: 0.6rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  flex: 1;
  position: relative;
  min-height: 52px;
  border-radius: var(--radius-md);
}

.mobile-nav-item:active {
  transform: scale(0.92);
  background: var(--color-subtle);
}

.mobile-nav-item.active {
  color: var(--color-accent-500);
}

.mobile-nav-item.active::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 3px;
  border-radius: var(--radius-full);
  background: var(--color-accent-500);
}

/* ============================================
   TOP BAR
   ============================================ */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  margin-bottom: 1.5rem;
}

.top-bar-left {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.top-bar-greeting {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text);
}

.top-bar-summary {
  font-size: var(--text-sm);
  color: var(--color-muted);
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* ============================================
   NOTIFICATION PANEL
   ============================================ */
.notification-bell {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-card);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  color: var(--color-muted);
}

.notification-bell:hover {
  border-color: #cbd5e1;
  color: var(--color-text);
}

.notification-bell .badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  border-radius: var(--radius-full);
  background: var(--color-danger);
  color: white;
  font-size: 0.625rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--color-bg);
}

.notification-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 380px;
  max-height: 480px;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  z-index: 60;
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.15s ease;
}

.notification-panel-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.notification-list {
  flex: 1;
  overflow-y: auto;
  max-height: 360px;
}

.notification-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--color-subtle);
  transition: background 0.15s ease;
  cursor: pointer;
}

.notification-item:hover {
  background: var(--color-subtle);
}

.notification-item.unread {
  background: #EFF6FF;
}

.notification-item.unread:hover {
  background: #DBEAFE;
}

.notification-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: var(--text-sm);
}

.notification-panel-footer {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ============================================
   PIPELINE KANBAN
   ============================================ */
.pipeline-board {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding-bottom: 1rem;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

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

.pipeline-column {
  min-width: 260px;
  max-width: 280px;
  flex-shrink: 0;
  background: var(--color-subtle);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 280px);
}

.pipeline-column.won-column {
  background: #F0FDF4;
  border-color: #BBF7D0;
}

.pipeline-column.lost-column {
  background: var(--color-subtle);
  border-color: var(--color-border);
  min-width: auto;
}

.pipeline-column.lost-column.collapsed {
  min-width: 48px;
  max-width: 48px;
  cursor: pointer;
}

.pipeline-column-header {
  padding: 0.875rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  position: sticky;
  top: 0;
  z-index: 1;
}

.pipeline-column-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text);
}

.pipeline-column-count {
  font-size: var(--text-xs);
  font-weight: 700;
  background: rgba(0, 0, 0, 0.08);
  color: var(--color-muted);
  padding: 1px 6px;
  border-radius: var(--radius-full);
}

.pipeline-column-value {
  font-size: var(--text-xs);
  color: var(--color-muted);
  margin-top: 0.25rem;
}

.pipeline-column-body {
  padding: 0.5rem;
  flex: 1;
  overflow-y: auto;
}

.pipeline-card {
  background: var(--color-card);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  border: 1px solid var(--color-border);
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.pipeline-card:hover {
  border-color: var(--color-accent-500);
  box-shadow: 0 2px 8px rgba(232, 113, 43, 0.12);
  transform: translateY(-1px);
}

.pipeline-card:hover {
  border-left: 3px solid var(--color-accent-500);
  padding-left: calc(0.75rem - 2px);
}

.pipeline-card-name {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pipeline-card-area {
  font-size: var(--text-xs);
  color: var(--color-muted);
  margin-top: 2px;
}

.pipeline-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.5rem;
}

.pipeline-card-value {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text);
}

.pipeline-empty {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-md);
  padding: 2rem 1rem;
  text-align: center;
  color: var(--color-muted);
}

/* Scroll hints for pipeline */
.pipeline-scroll-hint {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--color-card);
  border: 1px solid var(--color-border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  color: var(--color-muted);
  transition: all 0.15s ease;
}

.pipeline-scroll-hint:hover {
  background: var(--color-subtle);
  color: var(--color-text);
}

.pipeline-scroll-hint.left {
  left: -16px;
}

.pipeline-scroll-hint.right {
  right: -16px;
}

/* ============================================
   SLIDE-IN DETAIL PANEL
   ============================================ */
.slide-panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 50;
  animation: fadeIn 0.15s ease;
}

.slide-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 420px;
  height: 100vh;
  background: var(--color-card);
  border-left: 1px solid var(--color-border);
  box-shadow: -8px 0 30px rgba(0, 0, 0, 0.1);
  z-index: 51;
  overflow-y: auto;
  animation: slideInFromRight 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ============================================
   STAGE BADGE
   ============================================ */
.stage-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ============================================
   PRIORITY BADGES
   ============================================ */
.priority-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
}

.priority-cold {
  background: #F1F5F9;
  color: #475569;
}

.priority-warm {
  background: #FFFBEB;
  color: #D97706;
}

.priority-hot {
  background: #FEF2F2;
  color: #DC2626;
  animation: pulse-subtle 2s infinite;
}

/* ============================================
   ACTIVITY TIMELINE
   ============================================ */
.timeline-item {
  position: relative;
  padding-left: 2rem;
  padding-bottom: 1.25rem;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: 0.5625rem;
  top: 1.5rem;
  bottom: 0;
  width: 2px;
  background: var(--color-border);
}

.timeline-item:last-child::before {
  display: none;
}

.timeline-dot {
  position: absolute;
  left: 0;
  top: 0.25rem;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: white;
  border: 2px solid var(--color-accent-500);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============================================
   FAB (Floating Action Button) — Expandable
   ============================================ */
.fab-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 40;
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-end;
  gap: 0.5rem;
}

.fab-button {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--color-accent-500), var(--color-accent-400));
  color: white;
  border: none;
  box-shadow: 0 4px 14px rgba(232, 113, 43, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 2;
}

.fab-button:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(232, 113, 43, 0.45);
}

.fab-button:active {
  transform: scale(0.95);
}

.fab-button.open {
  transform: rotate(45deg);
}

.fab-button.open:hover {
  transform: rotate(45deg) scale(1.05);
}

.fab-mini {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem 0.5rem 0.625rem;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
  text-decoration: none;
  color: var(--color-text);
  font-size: var(--text-sm);
  font-weight: 600;
  white-space: nowrap;
  animation: fabSlideIn 0.2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  opacity: 0;
}

.fab-mini:nth-child(2) {
  animation-delay: 0.05s;
}

.fab-mini:nth-child(3) {
  animation-delay: 0.1s;
}

.fab-mini:hover {
  background: var(--color-subtle);
  transform: translateX(-4px);
}

.fab-mini-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ============================================
   FORM STYLES
   ============================================ */
.form-input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  font-family: inherit;
  background: var(--color-card);
  color: var(--color-text);
  height: 44px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  outline: none;
}

.form-input:focus {
  border-color: var(--color-accent-500);
  box-shadow: 0 0 0 3px rgba(232, 113, 43, 0.12);
}

.form-input::placeholder {
  color: #94a3b8;
}

.form-input.error {
  border-color: var(--color-danger);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

textarea.form-input {
  height: auto;
  resize: vertical;
}

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.375rem;
}

.form-error {
  font-size: var(--text-xs);
  color: var(--color-danger);
  margin-top: 0.25rem;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1.5rem 1.5rem;
  padding-right: 2.5rem;
}

/* Chip selector */
.chip-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  background: var(--color-card);
  color: var(--color-muted);
}

.chip:hover {
  border-color: #cbd5e1;
}

.chip.selected {
  border-color: var(--color-accent-500);
  background: var(--color-accent-100);
  color: var(--color-accent-500);
}

/* ============================================
   BUTTON STYLES
   ============================================ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  background: var(--color-primary-900);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-primary:hover {
  background: var(--color-primary-800);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(26, 39, 68, 0.2);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-accent {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  background: var(--color-accent-500);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-accent:hover {
  background: var(--color-accent-400);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(232, 113, 43, 0.3);
}

.btn-accent:active {
  transform: scale(0.98);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5625rem 1.125rem;
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-outline:hover {
  background: var(--color-subtle);
  border-color: #cbd5e1;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: transparent;
  color: var(--color-muted);
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-ghost:hover {
  background: var(--color-subtle);
  color: var(--color-text);
}

/* ============================================
   TAB STYLES
   ============================================ */
.tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--color-border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tab-bar::-webkit-scrollbar {
  display: none;
}

.tab-item {
  padding: 0.75rem 1rem;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: inherit;
}

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

.tab-item.active {
  color: var(--color-accent-500);
  border-bottom-color: var(--color-accent-500);
}

/* ============================================
   TABLE STYLES — Clean, no visible borders
   ============================================ */
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.data-table thead th {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-muted);
  padding: 0.75rem;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
}

.data-table tbody tr {
  transition: background 0.1s ease;
}

.data-table tbody tr:hover {
  background: var(--color-subtle);
}

.data-table tbody td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--color-subtle);
  font-size: var(--text-sm);
}

.data-table tbody tr:nth-child(even) {
  background: rgba(241, 245, 249, 0.5);
}

/* ============================================
   SEARCH INPUT
   ============================================ */
.search-input {
  position: relative;
}

.search-input input {
  padding-left: 2.5rem;
}

.search-input svg {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
}

/* ============================================
   FILTER CHIPS
   ============================================ */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  background: var(--color-card);
  color: var(--color-muted);
  font-size: var(--text-xs);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.filter-chip:hover {
  border-color: #cbd5e1;
}

.filter-chip.active {
  border-color: var(--color-accent-500);
  background: var(--color-accent-100);
  color: var(--color-accent-500);
}

/* ============================================
   PROGRESS BAR — generic
   ============================================ */
.progress-bar {
  width: 100%;
  height: 4px;
  background: var(--color-subtle);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ============================================
   MODAL / OVERLAY
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.15s ease;
}

.modal-content {
  background: var(--color-card);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  animation: scaleIn 0.2s ease;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

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

@keyframes slideInFromRight {
  from {
    opacity: 0;
    transform: translateX(100%);
  }

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

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes pulse-subtle {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.7;
  }
}

@keyframes pulse-glow {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(232, 113, 43, 0.4);
  }

  50% {
    box-shadow: 0 0 0 8px rgba(232, 113, 43, 0);
  }
}

@keyframes pulse-live {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.4);
  }

  50% {
    box-shadow: 0 0 0 6px rgba(139, 92, 246, 0);
  }
}

@keyframes fabSlideIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.9);
  }

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

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

@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-20px);
  }
}

@keyframes slideUpFade {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

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

@keyframes pulse-slow {

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

  50% {
    opacity: 0.8;
    transform: scale(1.05);
  }
}

@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }

  100% {
    background-position: 1000px 0;
  }
}

.bg-grid-white {
  background-size: 40px 40px;
  background-image: linear-gradient(to right, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
}

.animate-fadeIn {
  animation: fadeIn 0.3s ease forwards;
}

.animate-slideInRight {
  animation: slideInFromRight 0.3s ease forwards;
}

.animate-scaleIn {
  animation: scaleIn 0.2s ease forwards;
}

.animate-pulse-glow {
  animation: pulse-glow 2s infinite;
}

.animate-pulse-live {
  animation: pulse-live 2s infinite;
}

/* ============================================
   GRADIENT BACKGROUNDS
   ============================================ */
.gradient-navy {
  background: linear-gradient(135deg, var(--color-primary-900), var(--color-primary-800));
}

.gradient-orange {
  background: linear-gradient(135deg, var(--color-accent-500), var(--color-accent-400));
}

.gradient-hero {
  background: linear-gradient(135deg, #0f1a2e 0%, var(--color-primary-900) 40%, var(--color-primary-800) 100%);
}

/* ============================================
   TRAFFIC LIGHT STATUS
   ============================================ */
.traffic-green {
  color: var(--color-success);
}

.traffic-yellow {
  color: var(--color-warning);
}

.traffic-red {
  color: var(--color-danger);
}

/* ============================================
   LOADER
   ============================================ */
.loader {
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.6s linear infinite;
}

/* ============================================
   TOAST
   ============================================ */
.toast {
  position: fixed;
  bottom: 6rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-primary-900);
  color: white;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-lg);
  font-size: var(--text-base);
  font-weight: 500;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
  z-index: 100;
  animation: fadeIn 0.2s ease;
}

/* ============================================
   USER AVATAR — general
   ============================================ */
.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--color-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-primary-900);
  border: 1px solid var(--color-border);
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.user-avatar:hover {
  border-color: var(--color-accent-500);
}

/* ============================================
   TOP BAR — Dashboard header
   ============================================ */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.top-bar-left {
  min-width: 0;
  flex: 1;
}

.top-bar-greeting {
  font-size: var(--text-2xl);
  font-weight: 700;
  line-height: 1.3;
}

.top-bar-summary {
  font-size: var(--text-sm);
  color: var(--color-muted);
  margin-top: 2px;
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* ============================================
   RESPONSIVE
   ============================================ */

/* ---- Desktop (>= 769px) ---- */
@media (min-width: 769px) {
  .main-content {
    margin-left: var(--sidebar-width);
    transition: margin-left 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  }

  .main-content.sidebar-collapsed {
    margin-left: var(--sidebar-collapsed);
  }
}

/* ---- Tablet + Mobile (<= 768px) ---- */
@media (max-width: 768px) {

  /* Sidebar: slide-out drawer */
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  }

  .sidebar.open {
    transform: translateX(0);
    width: var(--sidebar-width) !important;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.25);
  }

  /* Sidebar backdrop overlay */
  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 39;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }

  .sidebar-overlay.visible {
    opacity: 1;
    pointer-events: auto;
  }

  /* Bottom nav visible */
  .mobile-nav {
    display: flex;
  }

  /* Main content no sidebar margin */
  .main-content {
    margin-left: 0 !important;
    padding-bottom: 5rem;
    padding-bottom: calc(5rem + env(safe-area-inset-bottom, 0px));
  }

  /* FAB above bottom nav */
  .fab-container {
    bottom: 5.5rem;
    bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
    right: 1rem;
  }

  /* Notification panel full-width on mobile */
  .notification-panel {
    position: fixed !important;
    top: auto !important;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100% !important;
    max-width: 100% !important;
    max-height: 70vh;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0 !important;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.15) !important;
    animation: slideUpPanel 0.3s cubic-bezier(0.22, 1, 0.36, 1) !important;
  }

  /* Slide panel fullscreen on mobile */
  .slide-panel {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Collapse btn hidden on mobile */
  .sidebar-collapse-btn {
    display: none;
  }

  /* Top bar — wrap on tablet */
  .top-bar {
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .top-bar-greeting {
    font-size: var(--text-xl);
  }

  /* Slide panel — add safe-area + scroll */
  .slide-panel {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  /* Filter bar — scroll horizontally on tablet */
  .filter-bar {
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .filter-bar::-webkit-scrollbar {
    display: none;
  }

  /* Pipeline/kanban scroll wrapper — gradient hint */
  .pipeline-scroll-wrapper {
    position: relative;
  }

  .pipeline-scroll-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 40px;
    background: linear-gradient(to left, var(--color-bg), transparent);
    pointer-events: none;
    z-index: 2;
  }

  /* grid-cols-5 → 3 columns on tablet */
  .grid.grid-cols-5 {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}

/* ---- Small Screens (max-width: 640px, phones) ---- */
@media (max-width: 640px) {

  /* Safe-area for iOS & modern Android */
  body {
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  /* Bigger touch targets — Android Material 48px guideline */
  .btn-accent,
  .btn-primary,
  .btn-outline,
  .btn-ghost,
  .filter-chip {
    min-height: 44px;
  }

  /* Active press feedback for all buttons */
  .btn-accent:active,
  .btn-primary:active,
  .btn-outline:active,
  .btn-ghost:active,
  .filter-chip:active {
    transform: scale(0.97);
    transition: transform 0.1s ease;
  }

  /* Form inputs — 48px for Android */
  .form-input,
  .form-select,
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="date"],
  input[type="tel"],
  select,
  textarea {
    min-height: 48px;
    font-size: 16px !important;
    /* Prevents zoom on focus in iOS/Android */
  }

  /* Full-width cards with smaller radius */
  .card,
  .kpi-card {
    border-radius: var(--radius-md);
  }

  /* ---- MODAL — fullscreen-like on mobile ---- */
  .modal-overlay {
    align-items: flex-end !important;
    padding: 0 !important;
  }

  .modal-content {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    max-height: 92vh;
    max-height: 92dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0 !important;
    animation: slideUpPanel 0.3s cubic-bezier(0.22, 1, 0.36, 1) !important;
  }

  /* Slide panel fullscreen on mobile */
  .slide-panel {
    width: 100vw !important;
    max-width: 100vw !important;
    border-radius: 0 !important;
  }

  /* ---- KANBAN — horizontal scroll with snap ---- */
  .kanban-board,
  .pipeline-board {
    margin-left: -1rem;
    margin-right: -1rem;
    padding: 0 1rem 1rem;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .kanban-board::-webkit-scrollbar,
  .pipeline-board::-webkit-scrollbar {
    display: none;
  }

  .kanban-column,
  .pipeline-column {
    min-width: 280px !important;
    max-width: 300px !important;
    max-height: calc(100vh - 280px);
    max-height: calc(100dvh - 280px);
    scroll-snap-align: center;
  }

  /* ---- Mobile FAB ---- */
  .fab-button {
    display: flex !important;
    bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .fab-container {
    bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    right: 0.75rem;
  }

  /* Mobile bottom nav safe area */
  .mobile-nav {
    padding-bottom: env(safe-area-inset-bottom, 6px);
  }

  /* ---- GRID FIXES — stack on phones ---- */

  /* 4-column grids → 2 columns */
  .grid.grid-cols-4 {
    grid-template-columns: 1fr 1fr !important;
  }

  /* 3-column grids → 3 columns (compact) */
  .grid.grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem !important;
  }

  /* 2-column grids stay 2 col unless very small */
  .grid.grid-cols-2 {
    gap: 0.5rem !important;
  }

  /* ---- TYPOGRAPHY — scale down ---- */
  h1 {
    font-size: var(--text-xl) !important;
  }

  h2 {
    font-size: var(--text-lg) !important;
  }

  /* ---- TABLES — scrollable wrapper ---- */
  .data-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }

  /* ---- TAB BAR — horizontal scroll ---- */
  .tab-bar {
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap !important;
    gap: 0.25rem !important;
    padding-bottom: 2px;
  }

  .tab-bar::-webkit-scrollbar {
    display: none;
  }

  .tab-item {
    white-space: nowrap;
    flex-shrink: 0;
    font-size: var(--text-xs) !important;
    padding: 8px 12px !important;
  }

  /* ---- PAGE PADDING ---- */
  .main-content {
    padding-left: 0.875rem !important;
    padding-right: 0.875rem !important;
  }

  /* ---- TEXT OVERFLOW for cards ---- */
  .kpi-value {
    font-size: var(--text-2xl);
  }

  .kpi-label {
    font-size: var(--text-xs);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* ---- SEARCH INPUT full width ---- */
  .search-input {
    max-width: 100% !important;
  }

  /* ---- TOP BAR — stack on phones ---- */
  .top-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .top-bar-right {
    width: 100%;
    justify-content: flex-end;
  }

  .top-bar-greeting {
    font-size: var(--text-lg);
  }

  .top-bar-summary {
    font-size: var(--text-xs);
  }

  /* ---- TIMELINE — compact on phones ---- */
  .timeline-item {
    padding-left: 1.75rem;
    padding-bottom: 1rem;
  }

  .timeline-dot {
    width: 1.125rem;
    height: 1.125rem;
  }

  .timeline-item::before {
    left: 0.5rem;
  }

  /* ---- SLIDE PANEL — safe area bottom ---- */
  .slide-panel {
    padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* ---- FILTER BAR — horizontal scroll with hidden bar ---- */
  .filter-bar {
    flex-wrap: nowrap !important;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
    margin-left: -0.25rem;
    padding-left: 0.25rem;
  }

  .filter-bar::-webkit-scrollbar {
    display: none;
  }

  /* ---- ACTIVITY FEED — capped height on phones ---- */
  .activity-feed-scroll {
    max-height: 40dvh !important;
  }

  /* ---- PIPELINE scroll wrapper gradient ---- */
  .pipeline-scroll-wrapper::after {
    width: 32px;
  }

  /* ---- 5-column grids → 2 columns on phones ---- */
  .grid.grid-cols-5 {
    grid-template-columns: 1fr 1fr !important;
  }
}

/* ---- Extra Small (< 400px, compact phones) ---- */
@media (max-width: 400px) {

  /* 3-column grids → 2 columns on very small */
  .grid.grid-cols-3 {
    grid-template-columns: 1fr 1fr !important;
  }

  /* 2-column grids → 1 column on very small */
  .grid.grid-cols-2 {
    grid-template-columns: 1fr !important;
  }

  /* 5-column grids → 1 column on very small */
  .grid.grid-cols-5 {
    grid-template-columns: 1fr !important;
  }

  .kanban-column,
  .pipeline-column {
    min-width: 260px !important;
    max-width: 280px !important;
  }

  /* Even smaller page padding */
  .main-content {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }
}

/* ---- Tablet (641px–768px) ---- */
@media (min-width: 641px) and (max-width: 768px) {

  .kanban-column,
  .pipeline-column {
    min-width: 240px;
    max-width: 280px;
  }

  .modal-content {
    max-width: 480px;
  }

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

/* ============================================
   ANIMATIONS — Slide up panel (for modals)
   ============================================ */
@keyframes slideUpPanel {
  from {
    opacity: 0;
    transform: translateY(100%);
  }

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

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--color-muted);
}

.empty-state-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: var(--color-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}

/* ============================================
   BTN-GHOST — Transparent subtle hover
   ============================================ */
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 10px;
  border: none;
  background: transparent;
  color: var(--color-muted);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: 500;
  transition: all 0.15s ease;
}

.btn-ghost:hover {
  background: var(--color-subtle);
  color: var(--color-text);
}

/* ============================================
   KANBAN BOARD — Full horizontal scroll
   ============================================ */
.kanban-board {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding-bottom: 1rem;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}

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

.kanban-board::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

.kanban-column {
  flex-shrink: 0;
  background: var(--color-subtle);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 220px);
  scroll-snap-align: start;
}

.kanban-column-header {
  padding: 0.75rem 0.875rem;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-card);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  position: sticky;
  top: 0;
  z-index: 1;
}

/* Legacy v1 compat */
:root {
  --jabnet-navy: var(--color-primary-900);
  --jabnet-orange: var(--color-accent-500);
}

/* ============================================
   MICRO-INTERACTIONS — Animations & Polish
   ============================================ */

/* Sidebar link hover slide */
.sidebar-link:hover .sidebar-link-icon {
  transform: translateX(2px);
  transition: transform 0.2s ease;
}

.sidebar-link .sidebar-link-icon {
  transition: transform 0.2s ease;
}

/* Button press effect  */
.btn-accent,
.btn-outline,
.btn-ghost,
button[type="submit"] {
  transition: all 0.15s ease;
}

.btn-accent:active,
.btn-outline:active,
button[type="submit"]:active {
  transform: scale(0.97);
}

/* Skeleton loading shimmer */
.skeleton {
  background: linear-gradient(90deg,
      var(--color-subtle) 25%,
      #e2e8f0 37%,
      var(--color-subtle) 63%);
  background-size: 400% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
  border-radius: var(--radius-md);
}

@keyframes skeleton-shimmer {
  0% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0 50%;
  }
}

/* Stagger entrance utility classes */
.stagger-1 {
  animation-delay: 0.05s;
}

.stagger-2 {
  animation-delay: 0.1s;
}

.stagger-3 {
  animation-delay: 0.15s;
}

.stagger-4 {
  animation-delay: 0.2s;
}

.stagger-5 {
  animation-delay: 0.25s;
}

.stagger-6 {
  animation-delay: 0.3s;
}

/* Card entrance animation */
.card-enter {
  animation: cardSlideUp 0.4s ease-out both;
}

@keyframes cardSlideUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

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

/* Empty state breathing animation */
.empty-icon-pulse {
  animation: emptyPulse 2s ease-in-out infinite;
}

@keyframes emptyPulse {

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

  50% {
    transform: scale(1.05);
    opacity: 0.8;
  }
}

/* Notification badge bounce */
.badge-bounce {
  animation: badgeBounce 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes badgeBounce {
  0% {
    transform: scale(0);
  }

  50% {
    transform: scale(1.2);
  }

  100% {
    transform: scale(1);
  }
}

/* KPI value count-up glow */
.kpi-value-animated {
  transition: color 0.3s ease;
}

/* Hover lift for interactive cards */
.card-hover-lift {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-hover-lift:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}