:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-subtle: #f1f5f9;
  --ink: #0f172a;
  --ink-secondary: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --nav-bg: #09121d;
  --nav-surface: #132032;
  --nav-border: #1e2f47;
  --nav-text: #94a3b8;
  --nav-active: #10b981;
  --emerald: #10b981;
  --emerald-dark: #059669;
  --emerald-light: #ecfdf5;
  --emerald-border: #a7f3d0;
  --blue: #3b82f6;
  --blue-light: #eff6ff;
  --amber: #f59e0b;
  --amber-light: #fffbeb;
  --rose: #ef4444;
  --rose-light: #fef2f2;
  --purple: #8b5cf6;
  --purple-light: #f5f3ff;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.03);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.06), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 20px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.03);
  --shadow-glow: 0 0 20px rgba(16, 185, 129, 0.15);
}

* {
  box-sizing: border-box;
  font-variant-numeric: tabular-nums;
  -moz-font-feature-settings: "latn" 1, "numr" 0;
  -webkit-font-feature-settings: "latn" 1, "numr" 0;
  font-feature-settings: "latn" 1, "numr" 0;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, "Segoe UI Arabic", "Noto Sans Arabic", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

[hidden] { display: none !important; }

/* TYPOGRAPHY & BASE */
button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-weight: 600;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--emerald);
  outline-offset: 2px;
}

h1, h2, h3, h4, p { margin: 0; }
h1 { font-size: 26px; font-weight: 800; color: var(--ink); letter-spacing: -0.5px; }
h2 { font-size: 18px; font-weight: 700; color: var(--ink); }
h3 { font-size: 15px; font-weight: 700; color: var(--ink); }

/* BUTTONS */
button.primary {
  background: linear-gradient(135deg, var(--emerald), var(--emerald-dark));
  color: #ffffff;
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
button.primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}
button.primary:active:not(:disabled) {
  transform: translateY(0);
}

button.secondary {
  padding: 8px 16px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--ink-secondary);
  box-shadow: var(--shadow-sm);
}
button.secondary:hover:not(:disabled) {
  background: var(--surface-subtle);
  border-color: var(--muted);
  color: var(--ink);
}

/* LOGIN SHELL */
.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #ffffff;
}
.intro {
  background: linear-gradient(145deg, #09121d 0%, #112338 100%);
  color: #ffffff;
  padding: 64px 12%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.intro .brand {
  position: absolute;
  top: 50px;
}
.intro .eyebrow {
  color: var(--emerald);
  margin-bottom: 20px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 1px;
}
.intro h1 {
  font-size: 50px;
  line-height: 1.35;
  font-weight: 800;
  color: #ffffff;
}
.intro p {
  color: #94a3b8;
  max-width: 400px;
  margin: 22px 0;
  font-size: 16px;
  line-height: 1.8;
}
.intro-line {
  width: 50px;
  height: 4px;
  border-radius: 2px;
  background: var(--emerald);
  margin: 25px 0;
}
.intro small {
  color: #64748b;
  font-size: 13px;
  letter-spacing: 0.5px;
}

.login-card {
  align-self: center;
  margin: 60px auto;
  padding: 40px;
  width: min(450px, 92%);
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--line);
}
.mini-icon {
  display: grid;
  place-items: center;
  background: var(--emerald-light);
  color: var(--emerald);
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  font-size: 28px;
  margin-bottom: 22px;
  border: 1px solid var(--emerald-border);
}
.login-card h2 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.login-card > p {
  color: var(--muted);
  margin: 8px 0 28px;
  font-size: 14px;
}
.login-card .primary {
  width: 100%;
  display: flex;
  justify-content: space-between;
  margin-top: 24px;
  padding: 13px;
  font-size: 15px;
}
.login-note {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 30px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  line-height: 1.7;
}

/* SIDEBAR */
.sidebar {
  width: 285px;
  background: var(--nav-bg);
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  padding: 24px 14px;
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  z-index: 50;
  border-left: 1px solid var(--nav-border);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
}
.sidebar .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 20px;
  border-bottom: 1px solid var(--nav-border);
}
.logo {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #10b981, #0d9488);
  color: #ffffff;
  font-weight: 900;
  font-size: 24px;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
}
.brand span[dir="ltr"] {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #ffffff;
}
.brand b {
  color: var(--emerald);
  font-weight: 900;
}

.nav-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #475569;
  letter-spacing: 0.8px;
  margin: 18px 12px 10px;
}

nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  overflow-y: auto;
}
nav button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  width: 100%;
  padding: 10px 14px;
  color: var(--nav-text);
  border-radius: var(--radius-sm);
  text-align: right;
  font-size: 13.5px;
  font-weight: 600;
  position: relative;
  white-space: nowrap;
  border: 1px solid transparent;
  background: transparent;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}
nav button:hover {
  background: var(--nav-surface);
  color: #ffffff;
}
nav button.active {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.08);
  font-weight: 700;
}
nav button .nav-icon {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.85;
}
nav button.active .nav-icon {
  color: #10b981;
  opacity: 1;
}
nav button > span:not(.nav-icon):not(.badge-mini) {
  flex: 1 1 auto;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.badge-mini {
  flex: 0 0 auto;
  margin-inline-start: auto;
  background: var(--rose);
  color: #ffffff;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 800;
  padding: 1px 8px;
  min-width: 20px;
  text-align: center;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  direction: ltr;
}

.sidebar-foot {
  padding: 16px 8px 0;
  border-top: 1px solid var(--nav-border);
  font-size: 12px;
  color: #64748b;
}
.sidebar-foot .status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #94a3b8;
  font-weight: 600;
  margin-bottom: 12px;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 8px var(--emerald);
  display: inline-block;
}
.sidebar-foot button {
  padding: 8px 0;
  color: #94a3b8;
  font-size: 13px;
  width: 100%;
  text-align: right;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sidebar-foot button:hover {
  color: #ef4444;
}

/* MAIN WORKSPACE */
main {
  margin-right: 285px;
  padding: 32px 42px;
  max-width: 1680px;
  min-height: 100vh;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}
.eyebrow {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  display: block;
  margin-bottom: 4px;
}
header h1 {
  font-size: 28px;
  font-weight: 800;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}
.header-actions .secondary {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}
.avatar-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 6px 14px 6px 8px;
  border-radius: 30px;
  box-shadow: var(--shadow-sm);
}
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  font-weight: 700;
  font-size: 13px;
}
.avatar-info {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
}

/* NOTICES & LOADERS */
#notice {
  padding: 14px 20px;
  margin-bottom: 24px;
  background: var(--emerald-light);
  border: 1px solid var(--emerald-border);
  border-radius: var(--radius-md);
  color: #065f46;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideIn 0.25s ease-out;
}
#notice.error {
  background: var(--rose-light);
  border-color: #fecaca;
  color: #991b1b;
}
#loading {
  padding: 10px 16px;
  background: #f0fdfa;
  border: 1px solid #ccfbf1;
  color: #0f766e;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 20px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 1. EXECUTIVE HERO COMMAND BANNER */
.hero-command {
  background: linear-gradient(135deg, #09121d 0%, #11243a 60%, #064e44 100%);
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 34px 40px;
  margin-bottom: 28px;
  box-shadow: 0 10px 30px -5px rgba(9, 18, 29, 0.3);
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.hero-command::after {
  content: "";
  position: absolute;
  left: -50px;
  top: -50px;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.25) 0%, rgba(16, 185, 129, 0) 70%);
  pointer-events: none;
}
.hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.hero-pill {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.hero-command h2 {
  font-size: 26px;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 8px;
}
.hero-command p {
  color: #94a3b8;
  font-size: 14.5px;
  max-width: 600px;
  line-height: 1.7;
}
.hero-quick-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}
.hero-action-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  backdrop-filter: blur(8px);
}
.hero-action-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: #ffffff;
  transform: translateY(-2px);
}

/* 2. STATS KPI GRID */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--emerald-border);
}
.stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: transparent;
  transition: background 0.25s;
}
.stat-card.emerald::before { background: var(--emerald); }
.stat-card.blue::before { background: var(--blue); }
.stat-card.amber::before { background: var(--amber); }
.stat-card.purple::before { background: var(--purple); }

.stat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.stat-head small {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
}
.stat-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  font-size: 18px;
}
.stat-card.emerald .stat-icon-wrap { background: var(--emerald-light); color: var(--emerald); }
.stat-card.blue .stat-icon-wrap { background: var(--blue-light); color: var(--blue); }
.stat-card.amber .stat-icon-wrap { background: var(--amber-light); color: var(--amber); }
.stat-card.purple .stat-icon-wrap { background: var(--purple-light); color: var(--purple); }

.stat-card strong {
  display: block;
  font-size: 32px;
  font-weight: 900;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif !important;
  font-variant-numeric: tabular-nums;
  direction: ltr;
  text-align: right;
  color: var(--ink);
  letter-spacing: -0.5px;
  line-height: 1.1;
}
.kpi-val,
.card-deal,
.funnel-count,
.chart-item b,
.plan-pricing-badge,
.quote-pill span,
.kanban-col-head .col-count,
.task-badge,
.hero-stats-chip {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif !important;
  font-variant-numeric: tabular-nums;
  direction: ltr;
  display: inline-block;
}
.stat-foot {
  margin-top: 10px;
  font-size: 11.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* PANELS & GRIDS */
.columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 26px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.muted {
  color: var(--muted);
  font-size: 12.5px;
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.row:last-child {
  border-bottom: none;
}
.row span:first-child {
  font-weight: 600;
  color: var(--ink-secondary);
}

.tag {
  font-size: 11.5px;
  font-weight: 700;
  color: #475569;
  background: #f1f5f9;
  border-radius: 6px;
  padding: 4px 10px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.tag.ok {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}
.tag.warn {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}
.tag.danger {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.info-box {
  padding: 16px 22px;
  color: #334155;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-md);
  background: #f8fafc;
  font-size: 13px;
  margin-bottom: 24px;
  line-height: 1.8;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* KANBAN BOARD */
.panel-heading-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px 24px;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
  gap: 14px;
}
.pipeline-summary-badges {
  display: flex;
  gap: 22px;
  align-items: center;
}
.pipe-stat {
  font-size: 13.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.pipe-stat b {
  color: var(--emerald-dark);
  font-size: 18px;
  font-weight: 800;
}

.kanban-board {
  display: grid;
  grid-template-columns: repeat(7, minmax(240px, 1fr));
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 20px;
  min-height: 600px;
}
.kanban-col {
  background: #f1f5f9;
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
}
.col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid #e2e8f0;
}
.col-title {
  font-weight: 800;
  font-size: 13.5px;
  color: var(--ink);
}
.col-count {
  background: #ffffff;
  padding: 2px 9px;
  border-radius: 12px;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--ink-secondary);
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.col-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  max-height: 72vh;
  padding: 2px;
}

.kanban-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 15px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}
.kanban-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--emerald);
}
.card-name {
  font-weight: 800;
  font-size: 14px;
  color: var(--ink);
  margin-bottom: 4px;
}
.card-company {
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 12px;
}
.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  border-top: 1px solid #f1f5f9;
  padding-top: 10px;
  margin-top: auto;
}
.card-deal {
  font-weight: 800;
  color: var(--emerald-dark);
}
.card-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  background: #f8fafc;
  border: 1px solid var(--line);
  color: var(--muted);
}
.won-col {
  background: #f0fdf4;
  border-color: #bbf7d0;
}
.won-col .col-title { color: #166534; }
.lost-col {
  background: #fef2f2;
  border-color: #fecaca;
}
.lost-col .col-title { color: #991b1b; }

/* FILTERS & TABLES */
.filters {
  display: flex;
  gap: 12px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.filters input {
  flex: 2;
  min-width: 200px;
  width: auto;
}
.filters select {
  flex: 1;
  min-width: 170px;
  width: auto;
}
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--ink);
  background: #ffffff;
  font-size: 13.5px;
  transition: border-color 0.2s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--emerald);
}

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}
table {
  border-collapse: collapse;
  width: 100%;
  white-space: nowrap;
  text-align: right;
}
th {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  background: #f8fafc;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
  color: var(--ink);
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: #fbfcfd; }

.detail-link {
  background: var(--emerald-light);
  color: var(--emerald-dark);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 700;
  border: 1px solid var(--emerald-border);
}
.detail-link:hover {
  background: #d1fae5;
}

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 22px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

/* TASKS LIST */
.tasks-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.task-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
}
.task-card:hover {
  border-color: var(--emerald-border);
  box-shadow: var(--shadow-md);
}
.task-card.completed {
  opacity: 0.6;
  background: #f8fafc;
}
.task-info h3 {
  font-size: 14.5px;
  font-weight: 700;
  margin-bottom: 4px;
}
.task-info p {
  font-size: 13px;
  color: var(--muted);
}
.task-meta {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.task-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 4px;
}
.badge-high { background: var(--rose-light); color: var(--rose); border: 1px solid #fecaca; }
.badge-medium { background: var(--amber-light); color: #d97706; border: 1px solid #fde68a; }
.badge-low { background: #f1f5f9; color: var(--muted); }
.badge-ai { background: var(--blue-light); color: var(--blue); font-weight: 800; border: 1px solid #bfdbfe; }

/* ANALYTICS */
.analytics-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 26px;
}
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.kpi-label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 8px;
  display: block;
}
.kpi-val {
  font-size: 32px;
  font-weight: 900;
  color: var(--ink);
  line-height: 1.1;
}
.kpi-val small {
  font-size: 14px;
  font-weight: normal;
  color: var(--muted);
  margin-right: 4px;
}

.funnel-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.funnel-row {
  display: flex;
  align-items: center;
  gap: 14px;
}
.funnel-label {
  width: 140px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-secondary);
}
.funnel-track {
  flex: 1;
  background: #f1f5f9;
  height: 28px;
  border-radius: 8px;
  overflow: hidden;
}
.funnel-fill {
  background: linear-gradient(90deg, #10b981, #0d9488);
  height: 100%;
  border-radius: 8px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.funnel-count {
  width: 44px;
  font-size: 13.5px;
  font-weight: 800;
  text-align: left;
  color: var(--emerald-dark);
}

.chart-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.chart-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
}
.chart-item span { font-weight: 600; color: var(--ink-secondary); }
.chart-item b { color: var(--emerald-dark); font-weight: 800; }

/* RADAR & CHANNELS */
.radar-box {
  background: linear-gradient(145deg, #ffffff 0%, #f0fdf9 100%);
  border: 1px solid var(--emerald-border);
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 16px;
  align-items: flex-end;
  margin-top: 18px;
}
.channels-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.channel-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
}
.code-box {
  background: #09121d;
  color: #cbd5e1;
  padding: 18px;
  border-radius: var(--radius-md);
  margin-top: 14px;
}
.code-box pre {
  margin: 0;
  font-family: Consolas, Monaco, monospace;
  font-size: 12.5px;
  overflow-x: auto;
  white-space: pre-wrap;
}

/* RADAR RESULTS & OPPORTUNITY CARDS */
.radar-results {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.radar-summary-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: var(--radius-md);
  padding: 18px 22px;
  gap: 16px;
  flex-wrap: wrap;
}
.radar-summary-head {
  font-size: 15px;
  color: var(--emerald-dark);
  display: flex;
  align-items: center;
  gap: 6px;
}
.radar-summary-sub {
  margin-top: 5px;
  font-size: 13px;
  color: #065f46;
  line-height: 1.5;
}
.radar-summary-btn-wrap {
  flex-shrink: 0;
}
.pulse-indicator {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: radarPulse 1.8s infinite;
}
@keyframes radarPulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}
.radar-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}
.radar-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.radar-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--emerald);
}
.radar-card.is-new {
  border-right: 4px solid var(--emerald);
  background: linear-gradient(180deg, #ffffff 0%, #f0fdf4 100%);
}
.radar-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 12px;
}
.radar-item-title {
  margin: 0 0 4px 0;
  font-size: 15.5px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.3;
}
.radar-item-sub {
  font-size: 12.5px;
  color: var(--ink-secondary);
  font-weight: 600;
}
.radar-card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-secondary);
  margin-bottom: 16px;
}
.radar-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.45;
}
.radar-row .icon {
  flex-shrink: 0;
  font-size: 14px;
}
.radar-row .ltr-val {
  font-family: var(--font-sans);
  direction: ltr;
  text-align: left;
  font-weight: 600;
}
.radar-intent {
  background: #f8fafc;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  color: var(--ink);
}
.radar-card-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid #f1f5f9;
}
.radar-card-actions button {
  flex: 1;
  text-align: center;
  justify-content: center;
  padding: 8px 10px;
  font-size: 12px;
}


/* DIALOGS & MODALS */
dialog {
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: var(--radius-lg);
  padding: 30px 36px;
  width: min(1060px, 94vw);
  max-height: 90vh;
  overflow-y: auto;
  color: var(--ink);
  background: #ffffff;
  box-shadow: 0 25px 60px -12px rgba(9, 18, 29, 0.4);
  animation: modalPopIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}
@keyframes modalPopIn {
  from { opacity: 0; transform: scale(0.96) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
dialog::backdrop {
  background: rgba(9, 18, 29, 0.72);
  backdrop-filter: blur(8px);
}
.detail-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
}
.detail-heading h2 {
  font-size: 20px;
  font-weight: 800;
  color: var(--ink);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.btn-close-modal {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  background: #f1f5f9;
  color: #475569;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid var(--line);
  cursor: pointer;
  transition: all 0.18s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-close-modal:hover {
  background: #ef4444;
  border-color: #ef4444;
  color: #ffffff;
}

/* TWO-COLUMN DETAIL LAYOUT */
.detail-layout {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 22px;
  align-items: start;
}
@media (max-width: 960px) {
  .detail-layout { grid-template-columns: 1fr; }
}

.detail-col-info {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.detail-section-card {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px;
}
.detail-section-card h3 {
  margin: 0 0 14px;
  font-size: 14.5px;
  font-weight: 800;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.detail-field {
  background: #ffffff;
  border: 1px solid var(--line);
  padding: 11px 13px;
  border-radius: var(--radius-sm);
}
.detail-field small {
  color: var(--muted);
  font-weight: 700;
  font-size: 11px;
  display: block;
  margin-bottom: 3px;
}
.detail-field p {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  margin: 0;
  word-break: break-word;
}
.detail-field.wide { grid-column: 1 / -1; }

.stage-buttons-wrap {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.btn-stage-pill {
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 20px;
  background: #ffffff;
  border: 1px solid var(--line-strong);
  color: var(--ink-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-stage-pill:hover {
  border-color: var(--emerald);
  color: var(--emerald-dark);
}
.btn-stage-pill.active {
  background: var(--emerald-light);
  border-color: var(--emerald);
  color: var(--emerald-dark);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.negotiation-panel {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-md);
  padding: 20px;
}
.negotiation-panel .panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.negotiation-panel p.muted {
  font-size: 12.5px;
  color: #065f46;
  margin-bottom: 14px;
}
.neg-config-box {
  background: #ffffff;
  border: 1px solid #a7f3d0;
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 16px;
}

.strategy-box {
  background: #ffffff;
  border: 1.5px solid var(--emerald);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-top: 14px;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.12);
}
.strategy-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}
.strategy-header h4 {
  margin: 0;
  font-size: 15px;
  color: var(--emerald-dark);
  font-weight: 800;
}
.plan-pricing-badge {
  background: #ecfdf5;
  color: #065f46;
  font-weight: 800;
  font-size: 13px;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid #6ee7b7;
}
.pitch-box {
  background: #f8fafc;
  border-right: 4px solid var(--emerald);
  border-radius: 4px;
  padding: 12px 14px;
  margin: 10px 0;
  font-size: 13px;
  line-height: 1.6;
}
.quote-item-card {
  background: #ffffff;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* FOOTER */
footer {
  border-top: 1px solid var(--line);
  padding-top: 24px;
  margin-top: 36px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}

/* RESPONSIVE */
@media (max-width: 1200px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .analytics-kpi-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 800px) {
  main { margin-right: 0; padding: 20px 16px; }
  .sidebar {
    position: static;
    width: auto;
    border-left: none;
    box-shadow: none;
    padding: 16px;
  }
  .sidebar .brand { padding-bottom: 12px; }
  .nav-label, .sidebar-foot { display: none; }
  nav {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 8px;
  }
  nav button {
    white-space: nowrap;
    padding: 8px 14px;
  }
  .stats-grid, .analytics-kpi-grid { grid-template-columns: 1fr; }
  .columns { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .hero-command { padding: 24px; }
  .hero-command h2 { font-size: 22px; }
}
