/* ============================================================
   ECOCUT CRM — DESIGN SYSTEM
   Premium Dark UI | Glassmorphism | Micro-animations
   ============================================================ */

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

/* ─── CSS VARIABLES ──────────────────────────────────────── */
:root {
  /* ISO Material Group Colors */
  --iso-group-p: #5B9BD5;
  --iso-group-m: #F2E94E;
  --iso-group-k: #D9534F;
  --iso-group-n: #8FBC8F;
  --iso-group-s: #E8A33D;
  --iso-group-h: #A6A6A6;
  --iso-group-default: #475569;

  /* Background Layers */
  --bg-base:        #080c14;
  --bg-surface:     #0d1320;
  --bg-card:        #111927;
  --bg-card-hover:  #162032;
  --bg-glass:       rgba(17, 25, 39, 0.7);
  --bg-input:       #0a1018;

  /* Brand Accent */
  --accent-primary:   #00c6a2;
  --accent-secondary: #0086f0;
  --accent-gold:      #f5a623;
  --accent-purple:    #9b6dff;
  --accent-danger:    #f04060;
  --accent-warning:   #f5a623;
  --accent-success:   #00c6a2;

  /* Text */
  --text-primary:   #e8edf5;
  --text-secondary: #8896ae;
  --text-muted:     #4a5568;
  --text-inverse:   #080c14;

  /* Borders */
  --border-subtle:  rgba(255,255,255,0.06);
  --border-medium:  rgba(255,255,255,0.12);
  --border-accent:  rgba(0,198,162,0.3);

  /* Gradients */
  --grad-primary:   linear-gradient(135deg, #00c6a2 0%, #0086f0 100%);
  --grad-gold:      linear-gradient(135deg, #f5a623 0%, #f0803a 100%);
  --grad-purple:    linear-gradient(135deg, #9b6dff 0%, #6b4ddb 100%);
  --grad-danger:    linear-gradient(135deg, #f04060 0%, #c0203a 100%);
  --grad-card:      linear-gradient(135deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.01) 100%);
  --grad-bg:        radial-gradient(ellipse at 20% 0%, rgba(0,198,162,0.08) 0%, transparent 60%),
                    radial-gradient(ellipse at 80% 100%, rgba(0,134,240,0.06) 0%, transparent 60%);

  /* Shadows */
  --shadow-sm:      0 2px 8px rgba(0,0,0,0.3);
  --shadow-md:      0 4px 20px rgba(0,0,0,0.4);
  --shadow-lg:      0 8px 40px rgba(0,0,0,0.5);
  --shadow-accent:  0 0 30px rgba(0,198,162,0.15);
  --shadow-glow:    0 0 0 1px rgba(0,198,162,0.2), 0 0 20px rgba(0,198,162,0.1);

  /* Spacing */
  --space-xs:  4px;
  --space-sm:  8px;
  --space-md:  16px;
  --space-lg:  24px;
  --space-xl:  32px;
  --space-2xl: 48px;

  /* Radius */
  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  16px;
  --radius-xl:  24px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast:   all 0.15s ease;
  --transition-base:   all 0.25s ease;
  --transition-slow:   all 0.4s ease;

  /* Sidebar */
  --sidebar-w: 240px;
}

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

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

body {
  font-family: 'Inter', system-ui, sans-serif;
  background-color: var(--bg-base);
  background-image: var(--grad-bg);
  background-attachment: fixed;
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

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

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: var(--transition-base);
}

.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.top-bar {
  height: 64px;
  background: rgba(13,19,32,0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  padding: 0 var(--space-xl);
  gap: var(--space-md);
  position: sticky;
  top: 0;
  z-index: 50;
}

/* Logo + page title grouped on the left */
.top-bar-left {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex: 1;
  min-width: 0;
}

/* Small logo in top bar — shows on wider screens */
.topbar-logo {
  /* Height-constrained — width auto-scales correctly */
  height: 30px;
  width: auto;
  display: block;
  object-fit: contain;
  opacity: 0.95;
  flex-shrink: 0;
}

.page-content {
  padding: var(--space-xl);
  flex: 1;
}

/* ─── SIDEBAR ────────────────────────────────────────────────────────── */
.sidebar-logo {
  padding: var(--space-md) var(--space-lg) var(--space-sm);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
.sidebar-logo-img {
  /* Height-constrained: width auto-scales to natural logo proportions */
  height: 36px;
  width: auto;
  max-width: 160px;
  display: block;
  object-fit: contain;
}
.sidebar-logo-sub {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding-left: 2px;
}

.sidebar-user {
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border-subtle);
}

.user-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}

.user-card {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-fast);
  position: relative;
}
.user-card:hover { border-color: var(--border-accent); }

.user-avatar {
  width: 32px; height: 32px;
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  flex-shrink: 0;
  position: relative;
  cursor: pointer;
  overflow: hidden;
}
.user-avatar::after {
  content: "📷";
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.65);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  opacity: 0;
  transition: opacity 0.2s ease;
  border-radius: inherit;
  color: #fff;
}
.user-avatar:hover::after {
  opacity: 1;
}
.avatar-mgmt  { background: var(--grad-gold);    color: #080c14; }
.avatar-sales1 { background: var(--grad-primary); color: #080c14; }
.avatar-sales2 { background: var(--grad-purple);  color: #fff; }

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

.user-switcher-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0; right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  display: none;
}
.user-switcher-dropdown.open { display: block; animation: fadeInDown 0.2s ease; }

.switcher-option {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  cursor: pointer;
  transition: var(--transition-fast);
  font-size: 13px;
}
.switcher-option:hover { background: var(--bg-card-hover); }
.switcher-option.active { background: rgba(0,198,162,0.1); color: var(--accent-primary); }

.sidebar-nav {
  flex: 1;
  padding: var(--space-md) var(--space-sm);
  overflow-y: auto;
}

.nav-section-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: var(--space-sm) var(--space-md);
  margin-top: var(--space-sm);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 10px var(--space-md);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-fast);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 2px;
  position: relative;
}
.nav-item:hover { background: var(--bg-card); color: var(--text-primary); }
.nav-item.active {
  background: rgba(0,198,162,0.12);
  color: var(--accent-primary);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: -4px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px;
  background: var(--grad-primary);
  border-radius: 2px;
}

.nav-icon { font-size: 16px; width: 20px; text-align: center; }
.nav-badge {
  margin-left: auto;
  background: var(--accent-danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  min-width: 18px;
  text-align: center;
}

.sidebar-footer {
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--border-subtle);
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
}

/* ─── TOP BAR ─────────────────────────────────────────────── */
.top-bar-title { font-size: 18px; font-weight: 700; }
.top-bar-title span { color: var(--accent-primary); }

.role-badge {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 5px var(--space-md);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid;
}
.role-badge.mgmt    { background: rgba(245,166,35,0.1); color: var(--accent-gold); border-color: rgba(245,166,35,0.3); }
.role-badge.sales   { background: rgba(0,198,162,0.1); color: var(--accent-primary); border-color: rgba(0,198,162,0.3); }

.rls-indicator {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 11px;
  color: var(--text-muted);
  padding: 4px var(--space-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
}
.rls-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent-primary);
  animation: pulse-dot 2s ease infinite;
}
.rls-dot.restricted { background: var(--accent-warning); }

/* ─── CARDS & SURFACES ────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background-image: var(--grad-card);
  transition: var(--transition-base);
  position: relative;
  overflow: hidden;
}
.card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--grad-card);
  pointer-events: none;
}
.card:hover { border-color: var(--border-medium); box-shadow: var(--shadow-md); }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border-subtle);
}
.card-title { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: var(--space-sm); }
.card-body  { padding: var(--space-lg); }

/* ─── METRIC CARDS ────────────────────────────────────────── */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  position: relative;
  overflow: hidden;
  transition: var(--transition-base);
}
.metric-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.metric-card::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 80px; height: 80px;
  border-radius: 50%;
  opacity: 0.08;
  transform: translate(20px, -20px);
}
.metric-card.teal::after    { background: var(--accent-primary); }
.metric-card.blue::after    { background: var(--accent-secondary); }
.metric-card.gold::after    { background: var(--accent-gold); }
.metric-card.purple::after  { background: var(--accent-purple); }
.metric-card.danger::after  { background: var(--accent-danger); }

.metric-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  margin-bottom: var(--space-md);
}
.metric-card.teal   .metric-icon { background: rgba(0,198,162,0.15); }
.metric-card.blue   .metric-icon { background: rgba(0,134,240,0.15); }
.metric-card.gold   .metric-icon { background: rgba(245,166,35,0.15); }
.metric-card.purple .metric-icon { background: rgba(155,109,255,0.15); }
.metric-card.danger .metric-icon { background: rgba(240,64,96,0.15); }

.metric-label { font-size: 12px; color: var(--text-secondary); margin-bottom: 4px; font-weight: 500; }
.metric-value { font-size: 26px; font-weight: 800; letter-spacing: -0.5px; line-height: 1; }
.metric-card.teal   .metric-value { color: var(--accent-primary); }
.metric-card.blue   .metric-value { color: var(--accent-secondary); }
.metric-card.gold   .metric-value { color: var(--accent-gold); }
.metric-card.purple .metric-value { color: var(--accent-purple); }
.metric-card.danger .metric-value { color: var(--accent-danger); }

.metric-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.metric-trend-up   { color: var(--accent-success); }
.metric-trend-down { color: var(--accent-danger); }

/* ─── BUTTONS ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 8px var(--space-md);
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  transition: var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: var(--grad-primary);
  color: var(--text-inverse);
  box-shadow: 0 4px 15px rgba(0,198,162,0.3);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0,198,162,0.4); }
.btn-secondary {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border: 1px solid var(--border-medium);
}
.btn-secondary:hover { border-color: var(--border-accent); }
.btn-danger { background: var(--grad-danger); color: #fff; }
.btn-ghost  { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { color: var(--text-primary); background: var(--bg-card); }
.btn-sm { padding: 5px var(--space-sm); font-size: 12px; }
.btn-lg { padding: 11px var(--space-xl); font-size: 14px; }

/* ─── BADGES / TAGS ───────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px var(--space-sm);
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-gold    { background: rgba(245,166,35,0.15);  color: var(--accent-gold);    border: 1px solid rgba(245,166,35,0.3); }
.badge-silver  { background: rgba(148,163,184,0.15); color: #94a3b8; border: 1px solid rgba(148,163,184,0.3); }
.badge-bronze  { background: rgba(180,103,50,0.15);  color: #cd7f32; border: 1px solid rgba(180,103,50,0.3); }
.badge-success { background: rgba(0,198,162,0.12);   color: var(--accent-primary); border: 1px solid rgba(0,198,162,0.25); }
.badge-warning { background: rgba(245,166,35,0.12);  color: var(--accent-warning); border: 1px solid rgba(245,166,35,0.25); }
.badge-danger  { background: rgba(240,64,96,0.12);   color: var(--accent-danger);  border: 1px solid rgba(240,64,96,0.25); }
.badge-blue    { background: rgba(0,134,240,0.12);   color: var(--accent-secondary); border: 1px solid rgba(0,134,240,0.25); }
.badge-purple  { background: rgba(155,109,255,0.12); color: var(--accent-purple);  border: 1px solid rgba(155,109,255,0.25); }
.badge-muted   { background: rgba(255,255,255,0.05); color: var(--text-secondary); border: 1px solid var(--border-subtle); }

/* Stage badges */
.stage-leads       { background: rgba(255,255,255,0.06); color: var(--text-secondary); border: 1px solid var(--border-subtle); }
.stage-tech        { background: rgba(0,134,240,0.12); color: var(--accent-secondary); border: 1px solid rgba(0,134,240,0.25); }
.stage-trial       { background: rgba(245,166,35,0.12); color: var(--accent-gold); border: 1px solid rgba(245,166,35,0.25); }
.stage-quote       { background: rgba(155,109,255,0.12); color: var(--accent-purple); border: 1px solid rgba(155,109,255,0.25); }
.stage-won         { background: rgba(0,198,162,0.12); color: var(--accent-primary); border: 1px solid rgba(0,198,162,0.25); }

/* ─── TABLES ──────────────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
thead tr {
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--border-subtle);
}
thead th {
  padding: 12px var(--space-md);
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  white-space: nowrap;
}
tbody tr {
  border-bottom: 1px solid var(--border-subtle);
  transition: var(--transition-fast);
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: rgba(255,255,255,0.02); }
td {
  padding: 12px var(--space-md);
  vertical-align: middle;
}
td .text-mono {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-secondary);
}

/* ─── KANBAN BOARD ────────────────────────────────────────── */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(220px, 1fr));
  gap: var(--space-md);
  overflow-x: auto;
  padding-bottom: var(--space-md);
}

.kanban-column {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  min-height: 400px;
  transition: var(--transition-fast);
}
.kanban-column.drag-over {
  border-color: var(--accent-primary);
  background: rgba(0,198,162,0.04);
}

.kanban-col-header {
  padding: var(--space-md);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
}
.kanban-col-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.kanban-col-count {
  font-size: 11px;
  background: rgba(255,255,255,0.08);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  color: var(--text-secondary);
}
.kanban-col-value {
  font-size: 11px;
  color: var(--text-muted);
  padding: 4px var(--space-md);
  border-bottom: 1px solid var(--border-subtle);
}

.kanban-cards {
  flex: 1;
  padding: var(--space-sm);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.kanban-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  cursor: grab;
  transition: var(--transition-fast);
  position: relative;
  overflow: hidden;
}
.kanban-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
}
.kanban-card.leads::before   { background: var(--text-muted); }
.kanban-card.tech::before    { background: var(--accent-secondary); }
.kanban-card.trial::before   { background: var(--accent-gold); }
.kanban-card.quote::before   { background: var(--accent-purple); }
.kanban-card.won::before     { background: var(--accent-primary); }

.kanban-card:hover   { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--border-medium); }
.kanban-card.dragging { opacity: 0.5; transform: rotate(2deg); }

.kanban-card-id    { font-size: 10px; color: var(--text-muted); margin-bottom: 6px; font-family: 'JetBrains Mono', monospace; }
.kanban-card-title { font-size: 13px; font-weight: 600; margin-bottom: 8px; line-height: 1.3; }
.kanban-card-meta  { display: flex; align-items: center; justify-content: space-between; }
.kanban-card-value { font-size: 12px; font-weight: 700; color: var(--accent-primary); }
.kanban-card-rep   { font-size: 11px; color: var(--text-muted); }
.kanban-card-date  { font-size: 11px; color: var(--text-secondary); margin-top: 6px; display: flex; align-items: center; gap: 4px; }

/* ─── FORMS & INPUTS ──────────────────────────────────────── */
.form-group { margin-bottom: var(--space-md); }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.form-control {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px var(--space-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  transition: var(--transition-fast);
  outline: none;
}
.form-control:focus { border-color: var(--accent-primary); box-shadow: var(--shadow-glow); }
.form-control::placeholder { color: var(--text-muted); }
select.form-control { cursor: pointer; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-md); }

/* ─── MODALS ──────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xl);
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95) translateY(20px);
  transition: transform 0.25s ease;
}
.modal-overlay.open .modal { transform: scale(1) translateY(0); }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-xl);
  border-bottom: 1px solid var(--border-subtle);
}
.modal-title { font-size: 16px; font-weight: 700; }
.modal-close {
  width: 32px; height: 32px;
  border: none; background: var(--bg-surface);
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition-fast);
}
.modal-close:hover { background: var(--bg-card-hover); color: var(--text-primary); }

.modal-body   { padding: var(--space-xl); }
.modal-footer {
  padding: var(--space-lg) var(--space-xl);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-sm);
}

/* ─── PROGRESS BARS ───────────────────────────────────────── */
.progress-bar-wrap {
  background: rgba(255,255,255,0.06);
  border-radius: var(--radius-full);
  height: 8px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--grad-primary);
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.progress-bar-fill.gold   { background: var(--grad-gold); }
.progress-bar-fill.purple { background: var(--grad-purple); }
.progress-bar-fill.danger { background: var(--grad-danger); }

/* ─── TARGET RING ─────────────────────────────────────────── */
.target-ring-wrap { display: flex; align-items: center; gap: var(--space-xl); }
.target-ring svg { transform: rotate(-90deg); }
.target-ring-text { font-size: 24px; font-weight: 800; }
.target-ring-label { font-size: 12px; color: var(--text-secondary); }

/* ─── FORECASTING TABLE ───────────────────────────────────── */
.forecast-stage-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px var(--space-md);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-sm);
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-subtle);
}
.forecast-stage-name { font-size: 13px; font-weight: 500; }
.forecast-stage-prob {
  font-size: 12px;
  color: var(--text-muted);
  background: rgba(255,255,255,0.06);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}
.forecast-stage-value { font-size: 13px; font-weight: 700; color: var(--accent-primary); }

/* ─── DORMANT ALERTS ──────────────────────────────────────── */
.dormant-alert {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: rgba(240,64,96,0.06);
  border: 1px solid rgba(240,64,96,0.2);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-sm);
}
.dormant-icon { font-size: 20px; flex-shrink: 0; }
.dormant-info { flex: 1; }
.dormant-name { font-size: 13px; font-weight: 600; }
.dormant-detail { font-size: 12px; color: var(--text-secondary); }
.dormant-days { font-size: 13px; font-weight: 700; color: var(--accent-danger); }

/* ─── ACTIVITY TIMELINE ───────────────────────────────────── */
.timeline { position: relative; }
.timeline::before {
  content: '';
  position: absolute;
  left: 16px; top: 0; bottom: 0;
  width: 1px;
  background: var(--border-subtle);
}

.timeline-item {
  display: flex;
  gap: var(--space-md);
  padding-bottom: var(--space-lg);
  position: relative;
}
.timeline-dot {
  width: 33px; height: 33px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.timeline-body { flex: 1; padding-top: 6px; }
.timeline-title { font-size: 13px; font-weight: 600; }
.timeline-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.timeline-note {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
}

/* ─── SEARCH BAR ──────────────────────────────────────────── */
.search-wrap {
  position: relative;
  flex: 1;
  max-width: 320px;
}
.search-icon {
  position: absolute;
  left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
}
.search-input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  transition: var(--transition-fast);
  outline: none;
}
.search-input:focus { border-color: var(--accent-primary); box-shadow: var(--shadow-glow); }
.search-input::placeholder { color: var(--text-muted); }

/* ─── SECTION HEADERS ─────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
  gap: var(--space-md);
  flex-wrap: wrap;
}
.section-title {
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}
.section-title .icon { font-size: 22px; }

/* ─── PAGE TABS ───────────────────────────────────────────── */
.page-tabs {
  display: flex;
  gap: 2px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 4px;
  margin-bottom: var(--space-xl);
}
.page-tab {
  flex: 1;
  padding: 8px var(--space-md);
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
}
.page-tab:hover { color: var(--text-primary); }
.page-tab.active { background: var(--bg-card); color: var(--text-primary); box-shadow: var(--shadow-sm); }

/* ─── REP PERFORMANCE CHART ───────────────────────────────── */
.rep-perf-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}
.rep-perf-row {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}
.rep-perf-name { width: 110px; font-size: 13px; font-weight: 500; flex-shrink: 0; }
.rep-perf-bar-wrap { flex: 1; background: rgba(255,255,255,0.06); border-radius: var(--radius-full); height: 10px; overflow: hidden; }
.rep-perf-bar { height: 100%; border-radius: var(--radius-full); transition: width 1s cubic-bezier(0.4,0,0.2,1); }
.rep-perf-val { font-size: 12px; font-weight: 700; width: 80px; text-align: right; flex-shrink: 0; }

/* ─── EMPTY STATE ─────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl);
  color: var(--text-muted);
  text-align: center;
  gap: var(--space-md);
}
.empty-state .icon { font-size: 48px; opacity: 0.3; }
.empty-state p { font-size: 14px; max-width: 300px; }

/* ─── GRID LAYOUTS ────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-lg); }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--space-lg); }
.grid-responsive { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--space-lg); }

/* ─── UTILITY ─────────────────────────────────────────────── */
.mb-0 { margin-bottom: 0 !important; }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.flex   { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-accent { color: var(--accent-primary); }
.text-gold { color: var(--accent-gold); }
.text-danger { color: var(--accent-danger); }
.font-mono { font-family: 'JetBrains Mono', monospace; font-size: 12px; }
.text-right { text-align: right; }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.font-bold { font-weight: 700; }
.hidden { display: none !important; }
.page-section { display: none; }
.page-section.active { display: block; }

/* ─── DIVIDER ─────────────────────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: var(--space-lg) 0;
}

/* ─── DB VIEWER ───────────────────────────────────────────── */
.db-table-tabs {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
}
.db-tab-btn {
  padding: 6px var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  font-family: 'JetBrains Mono', monospace;
}
.db-tab-btn.active { background: rgba(0,198,162,0.12); border-color: rgba(0,198,162,0.3); color: var(--accent-primary); }

/* ─── NOTIFICATIONS ───────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: var(--space-xl);
  right: var(--space-xl);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}
.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: var(--space-md) var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  animation: slideInRight 0.3s ease;
  min-width: 280px;
  max-width: 380px;
}
.toast.success { border-left: 3px solid var(--accent-primary); }
.toast.warning { border-left: 3px solid var(--accent-warning); }
.toast.error   { border-left: 3px solid var(--accent-danger); }

/* ─── ANIMATIONS ──────────────────────────────────────────── */
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.85); }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.animate-in { animation: fadeIn 0.4s ease both; }

/* ─── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .sidebar { width: 60px; }
  .sidebar .logo-text,
  .sidebar .nav-item span,
  .sidebar .user-info,
  .sidebar .nav-section-label,
  .sidebar .user-label,
  .sidebar .sidebar-footer { display: none; }
  .sidebar .logo-icon { margin: 0 auto; }
  .sidebar .nav-item { justify-content: center; padding: 10px; }
  .sidebar .nav-item.active::before { left: 0; }
  .main-content { margin-left: 60px; }
  .kanban-board { grid-template-columns: repeat(3, minmax(200px, 1fr)); }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .page-content { padding: var(--space-md); }
  .metrics-grid { grid-template-columns: 1fr 1fr; }
  .kanban-board { grid-template-columns: minmax(220px, 1fr); }
  .form-row { grid-template-columns: 1fr; }
}

/* ─── GLASSMORPHISM ACCENTS ───────────────────────────────── */
.glass-card {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
}

/* Top accent lines on columns */
.kanban-column[data-stage="Leads"]                { border-top: 2px solid rgba(148,163,184,0.4); }
.kanban-column[data-stage="Technical Discussion"] { border-top: 2px solid var(--accent-secondary); }
.kanban-column[data-stage="Tool Trial"]           { border-top: 2px solid var(--accent-gold); }
.kanban-column[data-stage="Commercial Quotation"] { border-top: 2px solid var(--accent-purple); }
.kanban-column[data-stage="Closed Won"]           { border-top: 2px solid var(--accent-primary); }

/* ─── INLINE ACTIONS ──────────────────────────────────────── */
.action-btns { display: flex; gap: var(--space-xs); opacity: 0; transition: var(--transition-fast); }
tr:hover .action-btns { opacity: 1; }
.icon-btn {
  width: 28px; height: 28px;
  border: none; background: var(--bg-surface);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition-fast);
}
.icon-btn:hover { background: var(--bg-card-hover); color: var(--text-primary); }
.icon-btn.danger:hover { background: rgba(240,64,96,0.15); color: var(--accent-danger); }

/* ─── GLOBAL TOP BAR SEARCH ────────────────────────────────── */
.top-bar-search {
  position: relative;
  width: 280px;
  transition: var(--transition-base);
}
.top-bar-search:focus-within {
  width: 360px;
}
.top-bar-search .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
  pointer-events: none;
}
.top-bar-search .search-input {
  width: 100%;
  padding: 8px 36px 8px 36px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: var(--transition-base);
}
.top-bar-search .search-input:focus {
  border-color: var(--accent-primary);
  background: var(--bg-input);
  box-shadow: var(--shadow-glow);
}

/* ─── GLOBAL TOP BAR FY SELECTOR ───────────────────────────── */
.top-bar-fy {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}
.fy-select {
  padding: 6px 32px 6px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--accent-primary);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  outline: none;
  cursor: pointer;
  transition: var(--transition-base);
  appearance: none;
  -webkit-appearance: none;
}
.fy-select:hover, .fy-select:focus {
  border-color: var(--accent-primary);
  background: var(--bg-input);
  box-shadow: var(--shadow-glow);
}
.top-bar-fy::after {
  content: '▼';
  font-size: 8px;
  color: var(--accent-primary);
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

.clear-search-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: var(--radius-full);
  transition: var(--transition-fast);
}
.clear-search-btn:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.08);
}

/* ─── HIERARCHICAL PERFORMANCE TREE ───────────────────────── */
.hierarchy-tree {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tree-node {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  transition: var(--transition-fast);
  cursor: pointer;
  user-select: none;
}
.tree-node:hover {
  background: rgba(255, 255, 255, 0.04);
}
.tree-node.rep-node {
  cursor: default;
}
.tree-indent-line {
  width: 20px;
  height: 36px;
  border-left: 1px dashed rgba(255, 255, 255, 0.12);
  margin-right: 4px;
  flex-shrink: 0;
  align-self: stretch;
  margin-top: -8px;
  margin-bottom: -8px;
}
.tree-chevron {
  font-size: 10px;
  color: var(--text-muted);
  width: 16px;
  text-align: center;
  transition: transform 0.2s ease;
  margin-right: 8px;
  display: inline-block;
}
.tree-chevron.open {
  transform: rotate(90deg);
}
.tree-icon {
  font-size: 14px;
  margin-right: 8px;
}
.tree-avatar {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  margin-right: 8px;
  flex-shrink: 0;
  overflow: hidden;
}
.tree-label {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 120px;
}
.tree-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.tree-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}
.tree-bar-wrap {
  flex: 2;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-full);
  height: 8px;
  overflow: hidden;
  margin: 0 var(--space-lg);
  min-width: 100px;
}
.tree-bar {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.tree-value {
  font-size: 12px;
  font-weight: 700;
  width: 90px;
  text-align: right;
  flex-shrink: 0;
}
.tree-bullet {
  color: var(--text-muted);
  margin-right: 12px;
  font-size: 14px;
  width: 16px;
  text-align: center;
}
.tree-children {
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  overflow: hidden;
  max-height: 1000px;
  opacity: 1;
}
.tree-children.collapsed {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
}

.tree-target-ring {
  width: 36px;
  height: 36px;
  margin-right: 8px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ─── MONTHLY PERFORMANCE CHART ───────────────────────────── */
.monthly-chart-container {
  display: flex;
  height: 240px;
  padding: var(--space-md) var(--space-lg) var(--space-sm) var(--space-lg);
  position: relative;
  align-items: flex-end;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  margin-top: var(--space-lg);
}
.chart-y-axis {
  position: absolute;
  left: 0;
  top: var(--space-md);
  bottom: var(--space-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-muted);
  width: 50px;
  text-align: right;
  padding-right: var(--space-xs);
}
.chart-grid-lines {
  position: absolute;
  left: 60px;
  right: 0;
  top: var(--space-md);
  bottom: var(--space-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
}
.chart-grid-line {
  border-top: 1px dashed rgba(255, 255, 255, 0.04);
  width: 100%;
}
.chart-columns {
  display: flex;
  flex: 1;
  height: 100%;
  margin-left: 60px;
  justify-content: space-around;
  align-items: flex-end;
  z-index: 2;
}
.chart-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  width: 12%;
}
.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  width: 100%;
  height: 180px;
  justify-content: center;
}
.chart-bar {
  flex: 1;
  max-width: 24px;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  transition: height 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  cursor: pointer;
}
.chart-bar.target-bar {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
}
.chart-bar.target-bar:hover {
  background: rgba(255, 255, 255, 0.08);
}
.chart-bar.actual-bar {
  background: linear-gradient(180deg, var(--accent-primary) 0%, rgba(0, 198, 162, 0.2) 100%);
  box-shadow: 0 0 10px rgba(0, 198, 162, 0.15);
}
.chart-bar.actual-bar:hover {
  box-shadow: 0 0 16px rgba(0, 198, 162, 0.4);
  background: linear-gradient(180deg, var(--accent-primary) 0%, rgba(0, 198, 162, 0.4) 100%);
}
.chart-bar-tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  padding: 4px var(--space-xs);
  border-radius: var(--radius-sm);
  font-size: 9px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 10;
  box-shadow: var(--shadow-sm);
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
}
.chart-bar:hover .chart-bar-tooltip {
  opacity: 1;
}
.chart-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}

.tree-node.selected {
  background: rgba(0, 198, 162, 0.08) !important;
  border-left: 3px solid var(--accent-primary);
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  padding-left: 9px;
}
.tree-node.selected:hover {
  background: rgba(0, 198, 162, 0.12) !important;
}

/* ─── PRODUCT CATALOGS EXPLORER ───────────────────────────── */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-lg);
}
.catalog-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: var(--transition-base);
  cursor: pointer;
  position: relative;
  user-select: none;
}
.catalog-card:hover {
  border-color: var(--accent-primary);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.catalog-card.file-card {
  cursor: default;
}
.catalog-card.file-card:hover {
  border-color: var(--border-medium);
  background: var(--bg-card);
  transform: none;
  box-shadow: none;
}
.catalog-card-icon {
  font-size: 40px;
  margin-bottom: var(--space-md);
}
.catalog-card-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  word-break: break-word;
  margin-bottom: var(--space-xs);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
  height: 36px;
}
.catalog-card-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
}
.catalog-card-actions {
  display: flex;
  gap: var(--space-sm);
  width: 100%;
  justify-content: center;
  margin-top: auto;
}
.catalog-card-delete-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  padding: 4px;
  border-radius: var(--radius-sm);
  opacity: 0;
  transition: opacity 0.2s ease, color 0.2s ease;
}
.catalog-card:hover .catalog-card-delete-btn {
  opacity: 1;
}
.catalog-card-delete-btn:hover {
  color: var(--accent-danger);
  background: rgba(240, 64, 96, 0.1);
}
.catalog-breadcrumb-link {
  color: var(--text-secondary);
  text-decoration: none;
  cursor: pointer;
  font-weight: 500;
}
.catalog-breadcrumb-link:hover {
  color: var(--accent-primary);
}
.catalog-breadcrumb-separator {
  margin: 0 4px;
  color: var(--text-muted);
}

/* ─── TECHNICAL ENQUIRY FORM MODAL ───────────────────────── */
.modal.technical-modal {
  width: 95%;
  max-width: 960px;
  height: 90vh;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width 0.3s ease, max-width 0.3s ease, height 0.3s ease, max-height 0.3s ease, border-radius 0.3s ease;
}

/* Maximized state — full viewport */
.modal.technical-modal.modal-maximized {
  width: 100% !important;
  max-width: 100% !important;
  height: 100vh !important;
  max-height: 100vh !important;
  border-radius: 0 !important;
}
.modal-fixed-top {
  padding: var(--space-lg) var(--space-xl) 0 var(--space-xl);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-card);
}
.core-header-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}
.modal-scroll-area {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-lg) var(--space-xl);
}
.modal-tabs-nav {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border-subtle);
  margin-top: var(--space-sm);
}
.modal-tab-btn {
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.modal-tab-btn:hover {
  color: var(--text-primary);
}
.modal-tab-btn.active {
  color: var(--accent-primary);
  border-bottom-color: var(--accent-primary);
  background: rgba(0, 198, 162, 0.04);
}
.modal-tab-panel {
  display: none;
}
.modal-tab-panel.active {
  display: block;
  animation: fadeIn 0.2s ease both;
}
.modal-persistent-footer {
  padding: var(--space-md) var(--space-xl) var(--space-lg) var(--space-xl);
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  transition: max-height 0.35s ease, padding 0.35s ease, opacity 0.25s ease, border-width 0.35s ease;
  overflow: hidden;
}

/* ── Focus Mode: collapse header & footer for max tab workspace ── */
.technical-modal .core-header-grid {
  transition: max-height 0.35s ease, padding 0.35s ease, opacity 0.25s ease, margin 0.35s ease;
  overflow: hidden;
  max-height: 500px;  /* generous default to avoid clipping */
}

/* The small toggle bar that appears when in focus mode */
.focus-mode-toggle {
  display: none;
  text-align: center;
  padding: 3px 0;
  cursor: pointer;
  color: var(--accent-primary);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  transition: background 0.2s ease;
  user-select: none;
}
.focus-mode-toggle:hover { background: var(--bg-card-hover); }

/* When focus mode is active */
.technical-modal.tab-focus-mode .core-header-grid {
  max-height: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  margin-bottom: 0 !important;
  opacity: 0;
  pointer-events: none;
}
.technical-modal.tab-focus-mode .modal-persistent-footer {
  max-height: 0 !important;
  padding: 0 var(--space-xl) !important;
  opacity: 0;
  pointer-events: none;
  border-top-width: 0;
}
.technical-modal.tab-focus-mode .focus-mode-toggle {
  display: block;
}
.technical-modal.tab-focus-mode .modal-header {
  padding: var(--space-sm) var(--space-xl);
}
.technical-modal.tab-focus-mode .modal-fixed-top {
  padding-top: 0;
}
.modal-footer-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}
.benchmark-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: var(--space-sm);
  font-size: 13px;
}
.benchmark-table th {
  text-align: left;
  padding: var(--space-sm) var(--space-md);
  border-bottom: 2px solid var(--border-subtle);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.benchmark-table td {
  padding: 6px var(--space-md);
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}
.benchmark-table tr:hover {
  background: rgba(255, 255, 255, 0.01);
}
.benchmark-table td:first-child {
  font-weight: 600;
  color: var(--text-secondary);
  width: 36%;
}
.benchmark-table td:not(:first-child) {
  width: 32%;
}
.form-control.compact {
  padding: 6px 10px;
  font-size: 12.5px;
  height: 32px;
}
.segmented-control {
  display: flex;
  gap: 2px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  padding: 2px;
  border-radius: var(--radius-md);
  width: fit-content;
}
.segmented-btn {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.segmented-btn:hover {
  color: var(--text-primary);
}
.segmented-btn input[type="radio"] {
  display: none;
}
.segmented-btn:has(input:checked) {
  background: var(--accent-primary) !important;
  color: #05070a !important;
  box-shadow: var(--shadow-sm);
}
.form-row.grid-3-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}
.form-control-unit-wrap {
  display: flex;
  position: relative;
  align-items: center;
}
.form-control-unit-wrap .form-control {
  padding-right: 50px;
}
.form-control-unit-label {
  position: absolute;
  right: 12px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  pointer-events: none;
}
.hardness-unit-toggle {
  display: flex;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  height: 38px;
}
.hardness-unit-btn {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-fast);
  padding: 0 10px;
}
.hardness-unit-btn:has(input:checked) {
  background: rgba(0, 198, 162, 0.15) !important;
  color: var(--accent-primary) !important;
}
.hardness-unit-btn input[type="radio"] {
  display: none;
}
.coolant-checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin-top: 6px;
}
.coolant-checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}
.coolant-checkbox-label input[type="checkbox"] {
  accent-color: var(--accent-primary);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

/* --- Monthly Deal Value Breakdown Styles --- */
.monthly-inputs-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--space-sm);
  margin-top: 8px;
}
@media (max-width: 768px) {
  .monthly-inputs-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
.form-label-compact {
  display: block;
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 3px;
  font-weight: 600;
  text-align: center;
}
.month-val-input {
  text-align: right;
}
.monthly-breakdown-container {
  transition: all 0.3s ease;
}

/* --- Enquiry Media Gallery Styles --- */
.enq-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-md);
}
.enq-media-card {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color var(--transition-fast), transform var(--transition-fast);
}
.enq-media-card:hover {
  border-color: var(--border-medium);
  transform: translateY(-2px);
}
.enq-media-preview {
  position: relative;
  width: 100%;
  height: 110px;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.enq-media-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.enq-media-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.enq-media-name {
  padding: var(--space-sm);
  font-size: 11px;
  color: var(--text-secondary);
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: rgba(255,255,255,0.02);
  border-top: 1px solid var(--border-subtle);
}
.enq-media-actions {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity var(--transition-fast);
  z-index: 5;
}
.enq-media-card:hover .enq-media-actions {
  opacity: 1;
}
.enq-media-action-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  transition: background-color var(--transition-fast);
  font-size: 11px;
}
.enq-media-download-btn {
  background: rgba(0, 198, 162, 0.9);
}
.enq-media-download-btn:hover {
  background: rgb(0, 198, 162);
}
.enq-media-delete-btn {
  background: rgba(239, 83, 80, 0.9);
}
.enq-media-delete-btn:hover {
  background: rgb(239, 83, 80);
}
.enq-media-empty {
  text-align: center;
  padding: var(--space-xl);
  color: var(--text-muted);
  font-size: 12.5px;
  border: 1px dashed var(--border-subtle);
  border-radius: var(--border-radius-sm);
  margin-top: var(--space-md);
}

/* --- PDF Media Selector Styles --- */
.pdf-media-select-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}
.pdf-media-select-card {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
  cursor: pointer;
}
.pdf-media-select-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-medium);
}
.pdf-media-select-card.selected {
  border-color: var(--accent-primary);
  box-shadow: 0 0 10px rgba(0, 198, 162, 0.15);
  background: rgba(0, 198, 162, 0.02);
}
.pdf-media-select-preview {
  position: relative;
  width: 100%;
  height: 85px;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.pdf-media-select-preview img,
.pdf-media-select-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pdf-media-select-name {
  padding: 6px;
  font-size: 10.5px;
  color: var(--text-secondary);
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: rgba(255,255,255,0.01);
  border-top: 1px solid var(--border-subtle);
}
.pdf-media-select-card.selected .pdf-media-select-name {
  color: var(--text-primary);
}
.pdf-media-checkbox-container {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pdf-media-checkbox {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--accent-primary);
}
.pdf-media-select-empty {
  text-align: center;
  padding: var(--space-lg);
  color: var(--text-muted);
  font-size: 12px;
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-sm);
  margin-top: var(--space-sm);
}

/* 🧠 AI INSIGHTS DIAGNOSTICS SYSTEM */
.ai-empty-state {
  text-align: center;
  padding: var(--space-xl) var(--space-lg);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--border-radius-md);
  background: rgba(255, 255, 255, 0.01);
  margin: var(--space-md) 0;
}
.ai-empty-icon {
  font-size: 48px;
  margin-bottom: var(--space-md);
  display: inline-block;
  animation: ai-pulse 2s infinite ease-in-out;
}
@keyframes ai-pulse {
  0%, 100% { transform: scale(1); opacity: 0.8; filter: drop-shadow(0 0 5px rgba(0, 198, 162, 0.2)); }
  50% { transform: scale(1.1); opacity: 1; filter: drop-shadow(0 0 15px rgba(0, 198, 162, 0.6)); }
}

.ai-loader-container {
  max-width: 480px;
  margin: var(--space-xl) auto;
  padding: var(--space-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-md);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}
.ai-loader-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.ai-loader-steps {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}
.ai-loader-step {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text-secondary);
  transition: color 0.3s;
}
.ai-loader-step.active {
  color: var(--accent-primary);
  font-weight: 600;
}
.ai-loader-step.done {
  color: var(--text-muted);
}
.ai-loader-step-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: bold;
  flex-shrink: 0;
  transition: all 0.3s;
}
.ai-loader-step.active .ai-loader-step-dot {
  border-color: var(--accent-primary);
  background: rgba(0, 198, 162, 0.1);
  box-shadow: 0 0 8px rgba(0, 198, 162, 0.5);
}
.ai-loader-step.done .ai-loader-step-dot {
  border-color: var(--accent-primary);
  background: var(--accent-primary);
  color: #0f172a;
}
.ai-loader-spinner {
  width: 10px;
  height: 10px;
  border: 2px solid transparent;
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: ai-spin 0.8s infinite linear;
}
@keyframes ai-spin {
  to { transform: rotate(360deg); }
}

.ai-dashboard {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  margin-top: var(--space-sm);
}
.ai-verdict-card {
  border-radius: var(--border-radius-md);
  padding: var(--space-lg);
  border: 1px solid var(--border-subtle);
  background: linear-gradient(135deg, rgba(255,255,255,0.02) 0%, rgba(255,255,255,0.01) 100%);
  position: relative;
  overflow: hidden;
}
.ai-verdict-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
}
.ai-verdict-card.healthy::before { background: var(--accent-primary); }
.ai-verdict-card.warning::before { background: var(--accent-warning); }
.ai-verdict-card.danger::before { background: var(--accent-danger); }

.ai-verdict-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-md);
}
.ai-verdict-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.ai-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.ai-badge.healthy { background: rgba(0, 198, 162, 0.12); color: var(--accent-primary); border: 1px solid rgba(0, 198, 162, 0.2); }
.ai-badge.warning { background: rgba(255, 179, 0, 0.12); color: var(--accent-warning); border: 1px solid rgba(255, 179, 0, 0.2); }
.ai-badge.danger { background: rgba(239, 83, 80, 0.12); color: var(--accent-danger); border: 1px solid rgba(239, 83, 80, 0.2); }

.ai-verdict-desc {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.ai-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
}

.ai-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-md);
  padding: var(--space-lg);
}
.ai-card-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  gap: 6px;
}

.ai-mrr-bar {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ai-mrr-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ai-mrr-header {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}
.ai-mrr-label { color: var(--text-secondary); font-weight: 500; }
.ai-mrr-val { color: var(--text-primary); font-weight: 700; }
.ai-progress-track {
  height: 8px;
  background: rgba(255,255,255,0.05);
  border-radius: 4px;
  overflow: hidden;
}
.ai-progress-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.ai-progress-bar.competitor { background: #64748b; }
.ai-progress-bar.ecocut { background: var(--accent-primary); box-shadow: 0 0 8px rgba(0, 198, 162, 0.4); }

.ai-stability-meter {
  display: flex;
  align-items: center;
  gap: 15px;
}
.ai-stability-gauge {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: 4px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  transition: all 0.3s;
}
.ai-stability-gauge.safe { border-color: var(--accent-primary); background: rgba(0, 198, 162, 0.04); }
.ai-stability-gauge.warn { border-color: var(--accent-warning); background: rgba(255, 179, 0, 0.04); }
.ai-stability-gauge.danger { border-color: var(--accent-danger); background: rgba(239, 83, 80, 0.04); }
.ai-stability-gauge-val { font-size: 16px; font-weight: 800; color: var(--text-primary); margin-bottom: -2px; }
.ai-stability-gauge-label { font-size: 8px; text-transform: uppercase; font-weight: 700; color: var(--text-muted); }

.ai-stability-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ai-stability-title { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.ai-stability-desc { font-size: 11.5px; color: var(--text-secondary); line-height: 1.5; }

.ai-power-alert {
  margin-top: var(--space-md);
  padding: 10px 12px;
  border-radius: var(--border-radius-sm);
  font-size: 11.5px;
  line-height: 1.5;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.ai-power-alert.warning {
  background: rgba(255, 179, 0, 0.1);
  border: 1px solid rgba(255, 179, 0, 0.2);
  color: #ffcc66;
}
.ai-power-alert.danger {
  background: rgba(239, 83, 80, 0.1);
  border: 1px solid rgba(239, 83, 80, 0.2);
  color: #ff8888;
}

.ai-wear-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ai-wear-item {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-sm);
  background: rgba(255,255,255,0.01);
}
.ai-wear-thumb {
  width: 48px;
  height: 48px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border-subtle);
}
.ai-wear-thumb-video {
  width: 48px;
  height: 48px;
  border-radius: 4px;
  background: #1e293b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  border: 1px solid var(--border-subtle);
}
.ai-wear-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.ai-wear-filename {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ai-wear-diagnosis {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.ai-roadmap-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ai-roadmap-item {
  display: flex;
  gap: 10px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-secondary);
}
.ai-roadmap-num {
  font-weight: 800;
  color: var(--accent-primary);
}

/* ============================================================
   UPGRADED HIGH-DENSITY ROI ANALYTICS DASHBOARD
   ============================================================ */
.roi-metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.roi-metric-card {
  background: linear-gradient(135deg, #1e222b 0%, #12141a 100%);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  text-align: left;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: var(--transition-base);
}
.roi-metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.roi-metric-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 3px;
}
.roi-metric-card.green::before { background-color: #10b981; }
.roi-metric-card.blue::before { background-color: #0086f0; }
.roi-metric-card.amber::before { background-color: #f5a623; }
.roi-metric-card.teal::before { background-color: #00c6a2; }

.roi-metric-card.green { border: 1px solid rgba(16, 185, 129, 0.15); }
.roi-metric-card.blue { border: 1px solid rgba(0, 134, 240, 0.15); }
.roi-metric-card.amber { border: 1px solid rgba(245, 166, 35, 0.15); }
.roi-metric-card.teal { border: 1px solid rgba(0, 198, 162, 0.15); }

.roi-metric-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 25.3px; /* Upgraded by 15% from 22px */
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 4px;
}
.roi-metric-label {
  font-size: 9px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.roi-analytics-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: var(--transition-base);
}
.roi-analytics-card:hover {
  box-shadow: var(--shadow-lg);
  border-color: rgba(245, 166, 35, 0.2);
}
.roi-analytics-header {
  padding: 10px 14px;
  background: rgba(245, 166, 35, 0.06);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-gold);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
.roi-analytics-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 24px; /* Asymmetric grid gap: 24px */
}
.roi-chart-wrapper {
  background: rgba(8, 12, 20, 0.4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: var(--space-md);
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.2);
}
.roi-chart-title {
  font-size: 10px;
  color: var(--text-secondary);
  font-weight: 700;
  margin-bottom: var(--space-md);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.roi-chart-legend {
  display: flex;
  gap: var(--space-md);
  margin-top: 10px;
  font-size: 10px;
  color: var(--text-secondary);
  font-weight: 500;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
}
.legend-dot {
  display: inline-block;
  width: 10px;
  height: 6px;
  border-radius: 2px;
}
.legend-dot.tool {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}
.legend-dot.machine {
  background: linear-gradient(135deg, #94a3b8 0%, #475569 100%);
}

.chart-tooltip {
  position: fixed;
  background: rgba(18, 20, 26, 0.96);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 11px;
  color: #f8fafc;
  pointer-events: none;
  z-index: 1000;
  display: none;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(8px);
}
.tooltip-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}
.tooltip-row:last-child {
  margin-bottom: 0;
}
.tooltip-badge {
  background: rgba(255,255,255,0.08);
  border-radius: 4px;
  padding: 1px 4px;
  font-size: 9px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
}

.chart-bar-group {
  cursor: pointer;
}
.chart-bar-group rect {
  transition: opacity 0.2s ease;
}
.chart-bar-group:hover rect {
  opacity: 0.9;
}

/* ══════════════════════════════════════════════════════════════════════════════
   📱 MOBILE RESPONSIVENESS SYSTEM
   ══════════════════════════════════════════════════════════════════════════════ */

/* ── Mobile Bottom Navigation ── */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 64px;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-medium);
  z-index: 1000;
  justify-content: space-around;
  align-items: center;
  padding: 0 4px;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.4);
}

.mobile-nav-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  height: 100%;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.mobile-nav-item.active {
  color: var(--accent-primary);
  text-shadow: 0 0 10px rgba(0, 198, 162, 0.2);
}

.mobile-nav-icon {
  font-size: 20px;
  margin-bottom: 3px;
  transition: transform 0.2s ease;
}

.mobile-nav-item:active .mobile-nav-icon {
  transform: scale(0.9);
}

.mobile-nav-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.mobile-nav-badge {
  position: absolute;
  top: 6px;
  right: 22%;
  background: var(--accent-danger);
  color: white;
  font-size: 9px;
  font-weight: 700;
  border-radius: var(--radius-full);
  min-width: 15px;
  height: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  box-shadow: 0 2px 6px rgba(240,64,96,0.4);
}

/* ── Mobile Options Slide-up Drawer ── */
.mobile-more-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-more-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-more-drawer {
  background: var(--bg-surface);
  width: 100%;
  border-radius: 20px 20px 0 0;
  border-top: 1px solid var(--border-medium);
  padding: 20px 20px 36px 20px;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

.mobile-more-overlay.open .mobile-more-drawer {
  transform: translateY(0);
}

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

.mobile-more-close {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
}

.mobile-more-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  overflow-y: auto;
  padding-bottom: 12px;
}

.mobile-more-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 14px 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.mobile-more-item:active {
  background: rgba(255,255,255,0.08);
  transform: scale(0.95);
}

.mobile-more-item.active {
  background: rgba(0, 198, 162, 0.05);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.mobile-more-item-icon {
  font-size: 24px;
  margin-bottom: 8px;
}

.mobile-more-item-label {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
}

.mobile-more-item-badge {
  position: absolute;
  top: 6px;
  right: 12px;
  background: var(--accent-danger);
  color: white;
  font-size: 9px;
  font-weight: 700;
  border-radius: var(--radius-full);
  min-width: 15px;
  height: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* ── Mobile Kanban Stage Swapper ── */
.mobile-kanban-tabs {
  display: none;
  overflow-x: auto;
  white-space: nowrap;
  gap: 8px;
  padding: 4px 12px 14px 12px;
  margin: 0 -12px;
  -webkit-overflow-scrolling: touch;
}
.mobile-kanban-tabs::-webkit-scrollbar {
  display: none; /* Hide scrollbar for clean UI */
}

.mobile-kanban-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.mobile-kanban-tab.active {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--text-primary);
  color: var(--text-primary);
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.mobile-kanban-tab-count {
  font-size: 10px;
  background: rgba(255, 255, 255, 0.08);
  padding: 1px 6px;
  border-radius: var(--radius-full);
  color: var(--text-muted);
  font-weight: 700;
}
.mobile-kanban-tab.active .mobile-kanban-tab-count {
  background: var(--text-primary);
  color: var(--bg-surface);
}

/* Mobile Top Bar Toggles & Overlays */
.mobile-search-toggle-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 18px;
  cursor: pointer;
  padding: 8px;
}
.mobile-search-overlay {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-card);
  z-index: 1100;
  align-items: center;
  padding: 0 var(--space-md);
  gap: var(--space-sm);
}
.mobile-search-overlay .search-input {
  flex: 1;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 8px var(--space-md);
  font-size: 16px;
  outline: none;
}
.mobile-avatar-trigger {
  display: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--accent-primary);
  overflow: hidden;
  user-select: none;
}

/* Mobile Profile Overlay Drawer */
.mobile-profile-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: flex-end;
}
.mobile-profile-card {
  width: 100%;
  background: var(--bg-card);
  border-top: 1px solid var(--border-medium);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: var(--space-lg);
  box-shadow: 0 -8px 30px rgba(0,0,0,0.5);
  animation: slideUpMobile 0.3s ease-out;
}
.mobile-profile-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}
.mobile-profile-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}
.mobile-profile-role {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ── Mobile Media Queries Override (<= 768px) ── */
@media (max-width: 768px) {
  /* Hide sidebar and stretch content */
  .sidebar {
    display: none !important;
  }
  
  .main-content {
    margin-left: 0 !important;
    padding-bottom: 80px !important; /* Make room for bottom nav */
  }

  .mobile-bottom-nav {
    display: flex;
  }

  /* Compact Top Bar */
  .top-bar {
    padding: 12px var(--space-md) !important;
    flex-wrap: wrap !important;
    gap: var(--space-xs) !important;
    height: auto !important;
    min-height: 56px;
  }

  .topbar-logo {
    height: 28px !important;
  }

  .top-bar-title {
    font-size: 15px !important;
  }

  .top-bar-search {
    flex: 1 1 100% !important;
    order: 3 !important;
    margin-top: 4px !important;
    height: 36px !important;
  }

  .top-bar-fy {
    order: 2 !important;
    margin-left: auto !important;
  }

  .fy-select {
    height: 28px !important;
    padding: 2px 8px !important;
    font-size: 11px !important;
  }

  #roleBadge, .rls-indicator {
    display: none !important; /* Hide RLS indicators to save screen space */
  }

  /* Single Column Layouts */
  .grid-2, .grid-3, .form-row, .metrics-grid {
    grid-template-columns: 1fr !important;
    gap: var(--space-md) !important;
  }

  /* Metrics Stack adjustments */
  .metric-card {
    padding: var(--space-md) !important;
  }

  /* Section Header Stack */
  .section-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: var(--space-sm) !important;
    margin-bottom: var(--space-md) !important;
  }
  .section-header .btn {
    width: 100% !important;
    justify-content: center !important;
  }

  /* Target Achievement flex wrap */
  #targetRingsContainer {
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: var(--space-lg) !important;
  }

  /* Mobile Kanban Column Switching */
  .mobile-kanban-tabs {
    display: flex;
  }

  .kanban-board {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    padding: 0 !important;
  }

  .kanban-column {
    display: none !important; /* Hide all columns by default on mobile */
    width: 100% !important;
    border-top: none !important;
    border-left: 3px solid var(--border-subtle) !important;
    background: transparent !important;
    padding: 0 !important;
  }
  
  .kanban-column.active-mobile-stage {
    display: flex !important; /* Show active column only */
  }

  .kanban-col-header {
    padding: 10px 0 !important;
  }
  
  .kanban-col-value {
    padding: 0 0 10px 0 !important;
    border-bottom: 1px solid var(--border-subtle) !important;
    margin-bottom: var(--space-sm) !important;
  }

  /* Scrollable Modal Tab Headers */
  .modal-tab-headers {
    display: flex !important;
    overflow-x: auto !important;
    white-space: nowrap !important;
    gap: 6px !important;
    padding: 4px var(--space-md) 10px var(--space-md) !important;
    margin: 0 calc(-1 * var(--space-md)) !important;
    -webkit-overflow-scrolling: touch !important;
    border-bottom: 1px solid var(--border-subtle) !important;
  }
  .modal-tab-headers::-webkit-scrollbar {
    display: none;
  }

  .modal-tab-btn {
    flex: 0 0 auto !important;
    font-size: 11px !important;
    padding: 8px 12px !important;
    border-radius: var(--radius-full) !important;
    border-bottom: 1px solid transparent !important;
    background: rgba(255,255,255,0.02) !important;
    border: 1px solid var(--border-subtle) !important;
  }
  
  .modal-tab-btn.active {
    background: rgba(255,255,255,0.08) !important;
    border-color: var(--text-primary) !important;
    color: var(--text-primary) !important;
  }

  /* Make modal benchmark and process tables swipeable */
  .modal-tab-panel table {
    display: block !important;
    overflow-x: auto !important;
    width: 100% !important;
    white-space: nowrap !important;
    -webkit-overflow-scrolling: touch !important;
  }

  /* Compactor grid and other layouts */
  .monthly-inputs-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  
  .enq-media-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Modal responsive sizing */
  .modal-content {
    width: 96vw !important;
    height: 94vh !important;
    max-height: 94vh !important;
    border-radius: var(--radius-lg) !important;
    margin: auto !important;
  }
  .modal-body {
    padding: var(--space-sm) var(--space-md) !important;
  }
  .modal-footer {
    padding: var(--space-md) !important;
  }

  /* Mobile search & avatar headers display */
  .mobile-search-toggle-btn {
    display: inline-block !important;
  }
  .desktop-only-search {
    display: none !important;
  }
  .mobile-avatar-trigger {
    display: flex !important;
    margin-left: var(--space-sm);
  }

  /* Two column metrics layout (Dashboard stat cards) */
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: var(--space-sm) !important;
  }
  .metrics-grid .metric-card:last-child:nth-child(odd) {
    grid-column: span 2 !important;
  }

  /* Convert tables to cards on mobile */
  .table-to-cards table,
  .table-to-cards thead,
  .table-to-cards tbody,
  .table-to-cards th,
  .table-to-cards td,
  .table-to-cards tr {
    display: block !important;
  }
  .table-to-cards thead tr {
    position: absolute !important;
    top: -9999px !important;
    left: -9999px !important;
  }
  .table-to-cards tr {
    background: var(--bg-surface) !important;
    border: 1px solid var(--border-medium) !important;
    border-radius: var(--radius-lg) !important;
    margin-bottom: var(--space-md) !important;
    padding: var(--space-md) !important;
    box-shadow: var(--shadow-sm) !important;
  }
  .table-to-cards td {
    border: none !important;
    border-bottom: 1px solid rgba(255,255,255,0.03) !important;
    position: relative !important;
    padding: 10px 0 !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    text-align: right !important;
  }
  .table-to-cards td:last-child {
    border-bottom: none !important;
    padding-bottom: 0 !important;
  }
  .table-to-cards td::before {
    content: attr(data-label) !important;
    font-weight: 600 !important;
    color: var(--text-muted) !important;
    text-align: left !important;
    margin-right: var(--space-md) !important;
    font-size: 12px !important;
  }

  /* Freeze first column on tables horizontally scrolled (fallback) */
  .table-wrapper:not(.table-to-cards) {
    overflow-x: auto !important;
    position: relative;
  }
  .table-wrapper:not(.table-to-cards) table th:first-child,
  .table-wrapper:not(.table-to-cards) table td:first-child {
    position: sticky !important;
    left: 0;
    z-index: 10;
    background: var(--bg-card) !important;
    box-shadow: 2px 0 5px rgba(0,0,0,0.3);
  }
  .table-wrapper:not(.table-to-cards) table th:first-child {
    z-index: 11;
    background: rgba(15, 23, 42, 0.95) !important;
  }

  /* Body open modal settings */
  body.modal-open-mobile .mobile-bottom-nav,
  body.modal-open-mobile .top-bar {
    display: none !important;
  }
  body.modal-open-mobile .main-content {
    padding-bottom: 0 !important;
    margin-top: 0 !important;
  }

  /* Modals full screen form sheet */
  .modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: var(--bg-surface) !important;
    z-index: 2500 !important;
    padding: 0 !important;
    align-items: stretch !important;
    justify-content: stretch !important;
  }
  .modal, .modal-content, .technical-modal {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    margin: 0 !important;
    border-radius: 0 !important;
    border: none !important;
    display: flex !important;
    flex-direction: column !important;
    background: var(--bg-surface) !important;
    box-shadow: none !important;
    animation: slideUpMobile 0.3s ease-out;
  }
  .modal-body {
    flex: 1 !important;
    overflow-y: auto !important;
    padding: var(--space-md) !important;
    padding-bottom: 100px !important; /* Bottom padding equal to footer height + safety margin */
  }
  .modal-footer {
    position: sticky !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    background: var(--bg-card) !important;
    border-top: 1px solid var(--border-medium) !important;
    padding: var(--space-md) !important;
    z-index: 100 !important;
    display: flex !important;
    gap: var(--space-sm) !important;
    margin-top: auto !important;
  }

  /* Core Header single column collapse & deal value wrap fix */
  .core-header-grid {
    grid-template-columns: 1fr !important;
    gap: var(--space-sm) !important;
  }
  .core-header-grid .form-group {
    grid-column: span 1 !important;
  }
  .core-header-grid .form-label {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 4px !important;
  }

  /* Searchable select display ellipsis truncation */
  .searchable-select-display {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    overflow: hidden !important;
  }
  .searchable-select-display span:first-child {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    flex: 1 !important;
    text-align: left !important;
  }

  /* Mobile Accordion Sections */
  .modal-tabs-nav {
    display: none !important;
  }
  .modal-tab-panel {
    display: block !important;
    margin-bottom: var(--space-sm) !important;
  }
  .accordion-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 14px 16px !important;
    background: var(--bg-card) !important;
    border: 1px solid var(--border-medium) !important;
    border-radius: var(--radius-md) !important;
    font-weight: 700 !important;
    color: var(--text-primary) !important;
    cursor: pointer !important;
    user-select: none !important;
    margin-top: 4px !important;
  }
  .accordion-header .arrow {
    font-size: 10px !important;
    transition: transform 0.2s ease !important;
  }
  .modal-tab-panel.active .accordion-header .arrow {
    transform: rotate(180deg) !important;
  }
  .accordion-content {
    display: none !important;
  }
  .modal-tab-panel.active .accordion-content {
    display: block !important;
    padding: var(--space-md) 0 !important;
  }

  /* Touch targets & font size scaling to prevent auto zoom */
  input, select, textarea {
    font-size: 16px !important;
  }
  .btn, .nav-item, .mobile-nav-item, .mobile-more-item, .dropdown-item {
    min-height: 44px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .modal-tab-btn {
    min-height: 40px !important;
    padding: 10px 16px !important;
  }

  /* Mobile Section Primary Actions (Top-aligned instead of bottom FAB) */
  .page-section .section-header .btn-primary {
    position: static !important;
    width: 100% !important;
    height: auto !important;
    min-height: 48px !important;
    border-radius: var(--radius-md) !important;
    box-shadow: var(--shadow-sm) !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 12px var(--space-md) !important;
    margin-top: var(--space-xs) !important;
    background: var(--accent-primary) !important;
    color: var(--text-inverse) !important;
  }
  .page-section .section-header .btn-primary::before {
    display: none !important;
  }

  .mobile-only {
    display: inline-block !important;
  }
  .desktop-only {
    display: none !important;
  }

  .modal-scroll-area {
    padding-bottom: 150px !important;
  }
  .modal-persistent-footer {
    position: sticky !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    background: var(--bg-card) !important;
    border-top: 1px solid var(--border-medium) !important;
    padding: var(--space-md) !important;
    z-index: 100 !important;
  }

  .technical-modal {
    display: block !important;
    overflow-y: auto !important;
    height: 100vh !important;
    max-height: 100vh !important;
  }
  .technical-modal .modal-fixed-top {
    position: static !important;
    padding: var(--space-md) !important;
    border-bottom: none !important;
    background: transparent !important;
  }
  .technical-modal .modal-scroll-area {
    overflow: visible !important;
    padding: 0 var(--space-md) !important;
    flex: none !important;
  }
  .technical-modal .modal-persistent-footer {
    position: sticky !important;
    bottom: 0 !important;
    z-index: 1000 !important;
  }

  /* Segmented Control Wrap */
  .segmented-control {
    display: flex !important;
    flex-wrap: wrap !important;
    width: 100% !important;
    gap: 4px !important;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
  }
  .segmented-btn {
    flex: 1 1 calc(50% - 4px) !important;
    min-height: 44px !important;
    padding: 10px 12px !important;
    border: 1px solid var(--border-medium) !important;
    border-radius: var(--radius-md) !important;
    background: var(--bg-card) !important;
  }

  /* Grid 3 and 4 cols flattener */
  .grid-3-cols, .grid-4-cols {
    grid-template-columns: 1fr !important;
    gap: var(--space-md) !important;
  }

  /* comparison tables card view */
  .benchmark-table {
    display: block !important;
    width: 100% !important;
    border: none !important;
  }
  .benchmark-table thead {
    display: none !important;
  }
  .benchmark-table tbody,
  .benchmark-table tr,
  .benchmark-table td {
    display: block !important;
    width: 100% !important;
  }
  .benchmark-table tr {
    margin-bottom: var(--space-md) !important;
    background: var(--bg-surface-elevated) !important;
    border: 1px solid var(--border-medium) !important;
    border-radius: var(--radius-lg) !important;
    padding: var(--space-md) !important;
  }
  .benchmark-table td {
    padding: var(--space-xs) 0 !important;
    border: none !important;
  }
  .benchmark-table td:first-child {
    font-weight: 700 !important;
    font-size: 13.5px !important;
    color: var(--accent-secondary) !important;
    border-bottom: 1px dashed var(--border-subtle) !important;
    padding-bottom: var(--space-xs) !important;
    margin-bottom: var(--space-sm) !important;
  }
  .benchmark-table td:nth-child(2),
  .benchmark-table td:nth-child(3) {
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
  }
  .benchmark-table td:nth-child(2)::before {
    content: "Competitor:" !important;
    font-size: 11px !important;
    color: var(--text-muted) !important;
    font-weight: 600 !important;
    text-transform: uppercase;
  }
  .benchmark-table td:nth-child(3)::before {
    content: "EcoCut:" !important;
    font-size: 11px !important;
    color: var(--accent-primary) !important;
    font-weight: 600 !important;
    text-transform: uppercase;
  }

  /* Modal Footer Actions Grid */
  .modal-footer-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    margin-top: var(--space-sm) !important;
  }
  .modal-footer-actions button {
    width: 100% !important;
    margin: 0 !important;
    padding: 10px 8px !important;
    font-size: 11px !important;
    min-height: 44px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    white-space: nowrap !important;
  }
  .modal-footer-actions button:last-child {
    font-size: 11px !important;
  }

  .modal-tab-panel table {
    width: 100% !important;
    display: table !important;
  }
  .modal-tab-panel table input {
    width: 100% !important;
    box-sizing: border-box !important;
  }
}

/* ─── COMMERCIAL QUOTATIONS ────────────────────────────────── */
#qtn-view-ledger, #qtn-view-editor {
  display: none;
}
#qtn-view-ledger.active, #qtn-view-editor.active {
  display: block;
}

/* Autocomplete suggestion styles */
.autocomplete-wrapper {
  position: relative;
  width: 100%;
}
.autocomplete-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 380px;
  background: var(--bg-card) !important;
  border: 1px solid var(--border-medium) !important;
  border-radius: var(--radius-sm);
  z-index: 100;
  max-height: 250px;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.autocomplete-suggestion {
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--transition-fast);
}
.autocomplete-suggestion:last-child {
  border-bottom: none;
}
.autocomplete-suggestion:hover {
  background: rgba(255, 255, 255, 0.05);
}
.autocomplete-suggestion-title {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  font-size: 12px;
  color: var(--accent-primary);
}
.autocomplete-suggestion-title .price {
  color: var(--accent-secondary);
}
.autocomplete-suggestion-desc {
  font-size: 10.5px;
  color: var(--text-secondary);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Table Input Styles */
.form-input-table {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid transparent;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 12.5px;
  padding: 4px;
  outline: none;
  transition: border-color var(--transition-fast);
}
.form-input-table:focus {
  border-bottom: 1px solid var(--accent-primary);
}
.form-input-table::placeholder {
  color: var(--text-muted);
}
input.form-input-table.text-right {
  text-align: right;
}

/* AI Copilot recommendation alert panels */
.ai-rec-empty {
  padding: var(--space-md);
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--radius-md);
  color: #10b981;
  font-size: 12px;
  text-align: center;
  font-weight: 500;
}
.ai-rec-card {
  padding: var(--space-md);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  margin-bottom: var(--space-sm);
  line-height: 1.4;
}
.ai-rec-card.warning {
  background: rgba(245, 166, 35, 0.06);
  border-color: rgba(245, 166, 35, 0.2);
}
.ai-rec-card.danger {
  background: rgba(239, 68, 68, 0.06);
  border-color: rgba(239, 68, 68, 0.2);
}
.ai-rec-card.info {
  background: rgba(0, 134, 240, 0.06);
  border-color: rgba(0, 134, 240, 0.2);
}
.ai-rec-card-title {
  font-weight: 700;
  font-size: 12px;
    padding: 0 !important;
  }
  
  .kanban-column.active-mobile-stage {
    display: flex !important; /* Show active column only */
  }

  .kanban-col-header {
    padding: 10px 0 !important;
  }
  
  .kanban-col-value {
    padding: 0 0 10px 0 !important;
    border-bottom: 1px solid var(--border-subtle) !important;
    margin-bottom: var(--space-sm) !important;
  }

  /* Scrollable Modal Tab Headers */
  .modal-tab-headers {
    display: flex !important;
    overflow-x: auto !important;
    white-space: nowrap !important;
    gap: 6px !important;
    padding: 4px var(--space-md) 10px var(--space-md) !important;
    margin: 0 calc(-1 * var(--space-md)) !important;
    -webkit-overflow-scrolling: touch !important;
    border-bottom: 1px solid var(--border-subtle) !important;
  }
  .modal-tab-headers::-webkit-scrollbar {
    display: none;
  }

  .modal-tab-btn {
    flex: 0 0 auto !important;
    font-size: 11px !important;
    padding: 8px 12px !important;
    border-radius: var(--radius-full) !important;
    border-bottom: 1px solid transparent !important;
    background: rgba(255,255,255,0.02) !important;
    border: 1px solid var(--border-subtle) !important;
  }
  
  .modal-tab-btn.active {
    background: rgba(255,255,255,0.08) !important;
    border-color: var(--text-primary) !important;
    color: var(--text-primary) !important;
  }

  /* Make modal benchmark and process tables swipeable */
  .modal-tab-panel table {
    display: block !important;
    overflow-x: auto !important;
    width: 100% !important;
    white-space: nowrap !important;
    -webkit-overflow-scrolling: touch !important;
  }

  /* Compactor grid and other layouts */
  .monthly-inputs-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  
  .enq-media-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Modal responsive sizing */
  .modal-content {
    width: 96vw !important;
    height: 94vh !important;
    max-height: 94vh !important;
    border-radius: var(--radius-lg) !important;
    margin: auto !important;
  }
  .modal-body {
    padding: var(--space-sm) var(--space-md) !important;
  }
  .modal-footer {
    padding: var(--space-md) !important;
  }
}

/* ─── COMMERCIAL QUOTATIONS ────────────────────────────────── */
#qtn-view-ledger, #qtn-view-editor {
  display: none;
}
#qtn-view-ledger.active, #qtn-view-editor.active {
  display: block;
}

/* Autocomplete suggestion styles */
.autocomplete-wrapper {
  position: relative;
  width: 100%;
}
.autocomplete-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 380px;
  background: var(--bg-card) !important;
  border: 1px solid var(--border-medium) !important;
  border-radius: var(--radius-sm);
  z-index: 100;
  max-height: 250px;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.autocomplete-suggestion {
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--transition-fast);
}
.autocomplete-suggestion:last-child {
  border-bottom: none;
}
.autocomplete-suggestion:hover {
  background: rgba(255, 255, 255, 0.05);
}
.autocomplete-suggestion-title {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  font-size: 12px;
  color: var(--accent-primary);
}
.autocomplete-suggestion-title .price {
  color: var(--accent-secondary);
}
.autocomplete-suggestion-desc {
  font-size: 10.5px;
  color: var(--text-secondary);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Table Input Styles */
.form-input-table {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid transparent;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 12.5px;
  padding: 4px;
  outline: none;
  transition: border-color var(--transition-fast);
}
.form-input-table:focus {
  border-bottom: 1px solid var(--accent-primary);
}
.form-input-table::placeholder {
  color: var(--text-muted);
}
input.form-input-table.text-right {
  text-align: right;
}

/* AI Copilot recommendation alert panels */
.ai-rec-empty {
  padding: var(--space-md);
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--radius-md);
  color: #10b981;
  font-size: 12px;
  text-align: center;
  font-weight: 500;
}
.ai-rec-card {
  padding: var(--space-md);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  margin-bottom: var(--space-sm);
  line-height: 1.4;
}
.ai-rec-card.warning {
  background: rgba(245, 166, 35, 0.06);
  border-color: rgba(245, 166, 35, 0.2);
}
.ai-rec-card.danger {
  background: rgba(239, 68, 68, 0.06);
  border-color: rgba(239, 68, 68, 0.2);
}
.ai-rec-card.info {
  background: rgba(0, 134, 240, 0.06);
  border-color: rgba(0, 134, 240, 0.2);
}
.ai-rec-card-title {
  font-weight: 700;
  font-size: 12px;
  margin-bottom: 4px;
}
.ai-rec-card-title.warning { color: var(--accent-gold); }
.ai-rec-card-title.danger { color: var(--accent-danger); }
.ai-rec-card-title.info { color: var(--accent-secondary); }
.ai-rec-card-desc {
  font-size: 11px;
  color: var(--text-secondary);
}

/* ─── SEARCHABLE SELECT COMPONENT ───────────────────────────── */
.searchable-select-wrapper {
  position: relative;
  width: 100%;
}
.searchable-select-display {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px var(--space-md);
  color: var(--text-primary);
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition-fast);
  user-select: none;
}
.searchable-select-display:hover {
  border-color: rgba(255, 255, 255, 0.2);
}
.searchable-select-wrapper.open .searchable-select-display {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-glow);
}
.searchable-select-display .arrow {
  font-size: 9px;
  color: var(--text-muted);
  transition: transform var(--transition-fast);
}
.searchable-select-wrapper.open .searchable-select-display .arrow {
  transform: rotate(180deg);
}
.searchable-select-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 1050;
  display: none;
  flex-direction: column;
  overflow: hidden;
  max-height: 280px;
}
.searchable-select-wrapper.open .searchable-select-dropdown {
  display: flex;
}
.searchable-select-search {
  background: var(--bg-input);
  border: none;
  border-bottom: 1px solid var(--border-subtle);
  padding: 10px var(--space-md);
  color: var(--text-primary);
  font-size: 12.5px;
  outline: none;
  width: 100%;
}
.searchable-select-list {
  overflow-y: auto;
  flex: 1;
  max-height: 200px;
}
.searchable-select-item {
  padding: 9px var(--space-md);
  font-size: 12.5px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.searchable-select-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}
.searchable-select-item.selected {
  background: rgba(0, 198, 162, 0.12);
  color: var(--accent-primary);
  font-weight: 600;
}
.searchable-select-no-results {
  padding: 12px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}
.searchable-select-display.compact {
  padding: 6px 10px;
  font-size: 12.5px;
  height: 32px;
}

/* ─── FOLLOW-UP QUEUE STYLES ─── */
.followups-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.followup-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  position: relative;
  transition: var(--transition-base);
  animation: fadeIn 0.4s ease;
}

.followup-card:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 198, 162, 0.3);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.followup-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: var(--space-sm);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: var(--space-md);
}

.followup-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.followup-card-meta {
  display: flex;
  gap: var(--space-md);
  align-items: center;
  flex-wrap: wrap;
}

.followup-meta-item {
  font-size: 12.5px;
  color: var(--text-secondary);
}

.followup-meta-item strong {
  color: var(--text-primary);
}

.followup-reasoning {
  font-size: 12px;
  color: var(--accent-primary);
  background: rgba(0, 198, 162, 0.08);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent-primary);
  margin-bottom: var(--space-xs);
}

.followup-editor-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 4px;
  display: block;
}

.followup-textarea {
  width: 100%;
  min-height: 100px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  padding: var(--space-md);
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.6;
  outline: none;
  resize: vertical;
  transition: var(--transition-base);
}

.followup-textarea:focus {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-glow);
}

.followup-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
  flex-wrap: wrap;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: var(--space-md);
  margin-bottom: var(--space-sm);
}

.followup-model-badge {
  font-size: 10.5px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  align-self: center;
  margin-right: auto;
}

/* ─── ISO 513 MATERIAL SELECTOR STYLES ─────────────────────── */
.iso-tab-btn {
  padding: 8px 14px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}
.iso-tab-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-medium);
}
.iso-tab-btn.active.tab-p { background: var(--iso-group-p); color: #ffffff; border-color: var(--iso-group-p); }
.iso-tab-btn.active.tab-m { background: var(--iso-group-m); color: #1e293b; border-color: var(--iso-group-m); }
.iso-tab-btn.active.tab-k { background: var(--iso-group-k); color: #ffffff; border-color: var(--iso-group-k); }
.iso-tab-btn.active.tab-n { background: var(--iso-group-n); color: #1e293b; border-color: var(--iso-group-n); }
.iso-tab-btn.active.tab-s { background: var(--iso-group-s); color: #ffffff; border-color: var(--iso-group-s); }
.iso-tab-btn.active.tab-h { background: var(--iso-group-h); color: #ffffff; border-color: var(--iso-group-h); }

.iso-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
  margin-top: var(--space-md);
  max-height: 380px;
  overflow-y: auto;
  padding-right: var(--space-xs);
}
.iso-card {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  cursor: pointer;
  transition: var(--transition-fast);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  text-align: left;
}
.iso-card:hover {
  border-color: var(--border-medium);
  background: var(--bg-card-hover);
}
.iso-card.selected {
  border-color: var(--accent-primary) !important;
  background: rgba(0, 198, 162, 0.04) !important;
  box-shadow: var(--shadow-glow);
}
.iso-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}
.iso-card-code {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 13px;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}
.iso-card-name {
  font-size: 12.5px;
  color: var(--text-primary);
  font-weight: 600;
}
.iso-card-condition {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 700;
}
.iso-card-range {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: auto;
  border-top: 1px dashed var(--border-subtle);
  padding-top: 6px;
}

.iso-material-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 10.5px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase;
  margin-top: 4px;
}

/* Circular Cropper Masking */
.cropper-view-box,
.cropper-face {
  border-radius: 50%;
}

/* Helper visibility classes */
@media (min-width: 769px) {
  .mobile-only {
    display: none !important;
  }
  .desktop-only {
    display: inline-block !important;
  }
}
