/* ==========================================================================
   GALVIN SANJAY - CRM ADMIN DASHBOARD DESIGN SYSTEM
   Luxury Soft-Cream Aesthetic Replicating Reference Design ("Crextio")
   ========================================================================== */

:root {
  /* Cream / Champagne Luxury Palette */
  --bg-crm-body: #fbf7f0;
  --bg-crm-card: #ffffff;
  --bg-crm-card-soft: #fbf8f2;
  --bg-crm-dark: #1c1c1e;
  --bg-crm-dark-elevated: #28282b;
  --bg-crm-accent-yellow: #f5c242;
  --bg-crm-accent-yellow-light: #fef4d6;
  --bg-crm-accent-yellow-dark: #e5b02e;
  --bg-crm-pill: rgba(255, 255, 255, 0.85);

  /* Borders & Shadows */
  --border-crm-subtle: rgba(0, 0, 0, 0.06);
  --border-crm-medium: rgba(0, 0, 0, 0.1);
  --border-crm-yellow: rgba(245, 194, 66, 0.4);
  --shadow-crm-card: 0 4px 20px rgba(0, 0, 0, 0.03), 0 1px 3px rgba(0, 0, 0, 0.02);
  --shadow-crm-float: 0 20px 40px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
  --shadow-crm-dark: 0 16px 36px rgba(0, 0, 0, 0.16);

  /* Typography Colors */
  --text-crm-primary: #1c1c1e;
  --text-crm-secondary: #6e6e73;
  --text-crm-muted: #8e8e93;
  --text-crm-light: #f5f5f7;

  /* Typography Font */
  --font-crm-sans: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-crm-mono: 'JetBrains Mono', monospace;

  /* Sizing & Radiuses */
  --radius-crm-card: 26px;
  --radius-crm-inner: 18px;
  --radius-crm-pill: 9999px;
}

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

body.crm-body {
  font-family: var(--font-crm-sans);
  background-color: var(--bg-crm-body);
  background-image: 
    radial-gradient(circle at 95% 5%, rgba(254, 235, 179, 0.6) 0%, transparent 45%),
    radial-gradient(circle at 5% 95%, rgba(255, 240, 205, 0.4) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.5) 0%, transparent 60%);
  background-attachment: fixed;
  color: var(--text-crm-primary);
  min-height: 100vh;
  padding: 1.25rem 2rem 2.5rem;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* --------------------------------------------------------------------------
   1. Header & Navigation Pills
   -------------------------------------------------------------------------- */
.crm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2rem;
  position: relative;
  z-index: 50;
}

.crm-brand-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 1.25rem;
  background: #ffffff;
  border: 1px solid var(--border-crm-subtle);
  border-radius: var(--radius-crm-pill);
  box-shadow: var(--shadow-crm-card);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-crm-primary);
  text-decoration: none;
}

.crm-brand-pill:hover {
  transform: translateY(-1px);
}

.crm-nav-pill-container {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-crm-subtle);
  border-radius: var(--radius-crm-pill);
  padding: 5px 6px;
  box-shadow: var(--shadow-crm-card);
}

.crm-nav-item {
  padding: 7px 16px;
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--text-crm-secondary);
  border-radius: var(--radius-crm-pill);
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  white-space: nowrap;
  border: none;
  background: transparent;
}

.crm-nav-item:hover {
  color: var(--text-crm-primary);
  background: rgba(0, 0, 0, 0.04);
}

.crm-nav-item.active {
  background: var(--bg-crm-dark);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.crm-header-tools {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.crm-tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.55rem 1.1rem;
  background: #ffffff;
  border: 1px solid var(--border-crm-subtle);
  border-radius: var(--radius-crm-pill);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-crm-primary);
  box-shadow: var(--shadow-crm-card);
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.crm-tool-btn:hover {
  background: #fdfdfd;
  border-color: var(--border-crm-medium);
  transform: translateY(-1px);
}

.crm-icon-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  position: relative;
}

.crm-badge-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  border: 2px solid #ffffff;
}

.crm-avatar-pill {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* --------------------------------------------------------------------------
   2. Welcome & Top Metric Segmented Progress Bar
   -------------------------------------------------------------------------- */
.crm-welcome-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.crm-welcome-title {
  font-size: clamp(2rem, 1.8rem + 1vw, 2.75rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  color: var(--text-crm-primary);
  margin-bottom: 1.25rem;
}

/* Segmented progress bar */
.crm-progress-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 0.5rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-crm-secondary);
}

.crm-segmented-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  max-width: 580px;
}

.crm-seg-pill {
  height: 38px;
  border-radius: var(--radius-crm-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0 1.2rem;
  transition: all 0.3s ease;
}

.crm-seg-dark {
  background: var(--bg-crm-dark);
  color: #ffffff;
  flex: 0.15;
}

.crm-seg-yellow {
  background: var(--bg-crm-accent-yellow);
  color: var(--text-crm-primary);
  flex: 0.15;
}

.crm-seg-striped {
  background: repeating-linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.7),
    rgba(255, 255, 255, 0.7) 6px,
    rgba(225, 220, 205, 0.8) 6px,
    rgba(225, 220, 205, 0.8) 12px
  );
  border: 1px dashed rgba(0, 0, 0, 0.15);
  color: var(--text-crm-secondary);
  flex: 0.6;
}

.crm-seg-outline {
  border: 1px solid var(--border-crm-medium);
  background: rgba(255, 255, 255, 0.5);
  color: var(--text-crm-muted);
  flex: 0.1;
}

/* Top Right Big Counters */
.crm-top-counters {
  display: flex;
  align-items: center;
  gap: 2.25rem;
}

.crm-counter-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.crm-counter-num {
  font-size: 3rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--text-crm-primary);
}

.crm-counter-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.crm-counter-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-crm-secondary);
}

.crm-counter-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-crm-secondary);
}

/* --------------------------------------------------------------------------
   3. Main Dashboard Grid (Replicating Reference Cards)
   -------------------------------------------------------------------------- */
.crm-grid-main {
  display: grid;
  grid-template-columns: 280px 300px 300px 1fr;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.crm-card {
  background: var(--bg-crm-card);
  border-radius: var(--radius-crm-card);
  padding: 1.5rem;
  box-shadow: var(--shadow-crm-card);
  border: 1px solid var(--border-crm-subtle);
  position: relative;
  display: flex;
  flex-direction: column;
}

.crm-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.crm-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-crm-primary);
  letter-spacing: -0.01em;
}

.crm-card-arrow {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.03);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-crm-secondary);
  font-size: 0.85rem;
  text-decoration: none;
  transition: all 0.2s ease;
}

.crm-card-arrow:hover {
  background: var(--bg-crm-dark);
  color: #ffffff;
}

/* 3.1 Spotlight Card */
.crm-spotlight-card {
  padding: 0;
  overflow: hidden;
  height: 260px;
  position: relative;
}

.crm-spotlight-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.crm-spotlight-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, 0.85) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.25rem;
  color: #ffffff;
}

.crm-spotlight-name {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.15rem;
}

.crm-spotlight-role {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.75);
}

.crm-spotlight-badge {
  position: absolute;
  bottom: 1.25rem;
  right: 1.25rem;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-crm-pill);
  font-size: 0.9rem;
  font-weight: 700;
  color: #ffffff;
}

/* 3.2 Progress Weekly Volume Card */
.crm-progress-val {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}

.crm-progress-sub {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-crm-muted);
}

.crm-bar-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.5rem;
  height: 110px;
  margin-top: auto;
  padding-bottom: 0.5rem;
}

.crm-bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  flex: 1;
  position: relative;
}

.crm-bar-pill {
  width: 10px;
  border-radius: var(--radius-crm-pill);
  background: var(--bg-crm-dark);
  transition: height 0.4s ease;
}

.crm-bar-pill.active {
  background: var(--bg-crm-accent-yellow);
  width: 12px;
}

.crm-bar-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-crm-muted);
}

.crm-bar-tooltip {
  position: absolute;
  top: -24px;
  background: var(--bg-crm-accent-yellow-light);
  border: 1px solid var(--bg-crm-accent-yellow);
  color: #946800;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-crm-pill);
  white-space: nowrap;
}

/* 3.3 Time Tracker / SLA Circular Gauge */
.crm-gauge-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: auto 0;
  position: relative;
}

.crm-circular-gauge {
  position: relative;
  width: 130px;
  height: 130px;
}

.crm-gauge-svg {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}

.crm-gauge-bg {
  fill: none;
  stroke: #ece8df;
  stroke-width: 8;
  stroke-dasharray: 2 4;
}

.crm-gauge-progress {
  fill: none;
  stroke: var(--bg-crm-accent-yellow);
  stroke-width: 9;
  stroke-linecap: round;
  stroke-dasharray: 330;
  stroke-dashoffset: 90;
  transition: stroke-dashoffset 0.5s ease;
}

.crm-gauge-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.crm-gauge-time {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.crm-gauge-lbl {
  font-size: 0.7rem;
  color: var(--text-crm-muted);
  font-weight: 500;
}

.crm-gauge-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

.crm-gauge-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #f4efe6;
  border: 1px solid var(--border-crm-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-crm-primary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.crm-gauge-btn:hover {
  background: var(--bg-crm-dark);
  color: #ffffff;
}

/* 3.4 Pipeline / Onboarding Progress & Dark Task Checklist Card */
.crm-pipeline-stat {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.crm-pipeline-percent {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.crm-pipeline-pillbar {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
}

.crm-pipe-pill {
  height: 28px;
  border-radius: var(--radius-crm-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0 0.85rem;
}

.crm-pipe-yellow {
  background: var(--bg-crm-accent-yellow);
  color: var(--text-crm-primary);
  flex: 0.45;
}

.crm-pipe-dark {
  background: var(--bg-crm-dark);
  color: #ffffff;
  flex: 0.35;
}

.crm-pipe-gray {
  background: #d8d3c5;
  color: var(--text-crm-secondary);
  flex: 0.2;
}

/* Floating Dark Task Card */
.crm-dark-task-card {
  background: var(--bg-crm-dark);
  color: #ffffff;
  border-radius: 22px;
  padding: 1.25rem;
  box-shadow: var(--shadow-crm-dark);
}

.crm-task-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  font-size: 0.95rem;
  font-weight: 700;
}

.crm-task-count {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--bg-crm-accent-yellow);
}

.crm-task-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.crm-task-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.65rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-crm-inner);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.crm-task-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.crm-task-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.crm-task-icon-circle {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}

.crm-task-meta {
  display: flex;
  flex-direction: column;
}

.crm-task-name {
  font-weight: 600;
  color: #ffffff;
}

.crm-task-time {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.5);
}

.crm-task-check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}

.crm-task-check.checked {
  background: var(--bg-crm-accent-yellow);
  border-color: var(--bg-crm-accent-yellow);
  color: var(--bg-crm-dark);
}

/* --------------------------------------------------------------------------
   4. Bottom Section: Left Accordion + Right Calendar Schedule
   -------------------------------------------------------------------------- */
.crm-grid-bottom {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1.25rem;
}

/* 4.1 Accordions */
.crm-accordion-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.crm-accordion-item {
  background: var(--bg-crm-card);
  border-radius: var(--radius-crm-inner);
  border: 1px solid var(--border-crm-subtle);
  overflow: hidden;
}

.crm-accordion-btn {
  width: 100%;
  padding: 1.1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent;
  border: none;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-crm-primary);
  cursor: pointer;
  text-align: left;
}

.crm-accordion-content {
  padding: 0 1.25rem 1.1rem;
  font-size: 0.85rem;
  color: var(--text-crm-secondary);
  border-top: 1px dashed var(--border-crm-subtle);
  margin-top: 0.25rem;
  padding-top: 0.85rem;
}

.crm-device-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.85rem;
  background: #fbf7f0;
  border-radius: 12px;
}

/* 4.2 Interactive Calendar Timeline */
.crm-calendar-card {
  padding: 1.5rem 2rem;
}

.crm-cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.crm-cal-month-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-crm-primary);
}

.crm-cal-month-pill {
  padding: 0.35rem 0.9rem;
  background: #ffffff;
  border: 1px solid var(--border-crm-subtle);
  border-radius: var(--radius-crm-pill);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-crm-secondary);
}

.crm-cal-timeline-grid {
  display: grid;
  grid-template-columns: 80px repeat(6, 1fr);
  gap: 0.5rem;
  position: relative;
}

.crm-cal-day-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: 0.5rem;
  border-bottom: 1px dashed rgba(0, 0, 0, 0.1);
}

.crm-cal-day-name {
  font-size: 0.72rem;
  color: var(--text-crm-muted);
  font-weight: 600;
}

.crm-cal-day-num {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-crm-primary);
}

.crm-cal-time-slot {
  font-size: 0.75rem;
  color: var(--text-crm-muted);
  font-weight: 500;
  padding: 0.75rem 0;
  border-bottom: 1px dashed rgba(0, 0, 0, 0.06);
}

.crm-cal-event-dark {
  position: absolute;
  top: 75px;
  left: 240px;
  background: var(--bg-crm-dark);
  color: #ffffff;
  padding: 0.75rem 1rem;
  border-radius: 16px;
  box-shadow: var(--shadow-crm-float);
  width: 220px;
  z-index: 10;
}

.crm-cal-event-white {
  position: absolute;
  top: 155px;
  left: 420px;
  background: #ffffff;
  border: 1px solid var(--border-crm-subtle);
  color: var(--text-crm-primary);
  padding: 0.75rem 1rem;
  border-radius: 16px;
  box-shadow: var(--shadow-crm-float);
  width: 200px;
  z-index: 10;
}

.crm-avatar-group {
  display: flex;
  align-items: center;
  margin-top: 0.5rem;
}

.crm-avatar-bubble {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  margin-left: -6px;
  object-fit: cover;
}

.crm-avatar-bubble:first-child {
  margin-left: 0;
}

/* --------------------------------------------------------------------------
   5. Zoho CRM Leads Table & Kanban Views
   -------------------------------------------------------------------------- */
.crm-view-section {
  display: none;
}

.crm-view-section.active {
  display: block;
}

/* Controls Bar */
.crm-table-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.crm-search-input {
  padding: 0.65rem 1.25rem 0.65rem 2.5rem;
  border-radius: var(--radius-crm-pill);
  border: 1px solid var(--border-crm-medium);
  background: #ffffff;
  font-size: 0.88rem;
  min-width: 280px;
  outline: none;
}

.crm-search-input:focus {
  border-color: var(--bg-crm-accent-yellow-dark);
  box-shadow: 0 0 0 3px rgba(245, 194, 66, 0.2);
}

/* Data Table */
.crm-table-container {
  background: #ffffff;
  border-radius: var(--radius-crm-card);
  box-shadow: var(--shadow-crm-card);
  border: 1px solid var(--border-crm-subtle);
  overflow: hidden;
}

.crm-data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.crm-data-table th {
  background: #faf7f2;
  padding: 1rem 1.25rem;
  font-weight: 700;
  color: var(--text-crm-secondary);
  border-bottom: 1px solid var(--border-crm-subtle);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.crm-data-table td {
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--border-crm-subtle);
  color: var(--text-crm-primary);
  vertical-align: middle;
}

.crm-data-table tr:hover td {
  background: #fdfbf7;
}

/* Status Badges */
.crm-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-crm-pill);
  font-size: 0.75rem;
  font-weight: 700;
}

.status-new { background: #fee2e2; color: #dc2626; }
.status-contacted { background: #e0f2fe; color: #0284c7; }
.status-discussion { background: #fef3c7; color: #d97706; }
.status-proposal { background: #f3e8ff; color: #9333ea; }
.status-won { background: #dcfce7; color: #16a34a; }
.status-lost { background: #f3f4f6; color: #6b7280; }

/* Kanban Board */
.crm-kanban-board {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.25rem;
  align-items: flex-start;
  overflow-x: auto;
  padding-bottom: 1.5rem;
}

.crm-kanban-col {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  border-radius: 20px;
  border: 1px solid var(--border-crm-subtle);
  padding: 1rem;
  min-height: 500px;
}

.crm-kanban-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  font-weight: 700;
}

.crm-kanban-cards {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.crm-kanban-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 1.1rem;
  box-shadow: var(--shadow-crm-card);
  border: 1px solid var(--border-crm-subtle);
  cursor: pointer;
  transition: all 0.2s ease;
}

.crm-kanban-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-crm-float);
}

/* --------------------------------------------------------------------------
   6. Modal Dialogs & Toast Notifications
   -------------------------------------------------------------------------- */
.crm-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.crm-modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.crm-modal-card {
  background: #ffffff;
  border-radius: var(--radius-crm-card);
  padding: 2.25rem;
  width: 100%;
  max-width: 580px;
  box-shadow: var(--shadow-crm-float);
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.crm-form-group {
  margin-bottom: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.crm-form-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-crm-secondary);
}

.crm-form-input,
.crm-form-select,
.crm-form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border-crm-medium);
  font-size: 0.88rem;
  outline: none;
  background: #fbf8f2;
}

.crm-form-input:focus,
.crm-form-select:focus,
.crm-form-textarea:focus {
  border-color: var(--bg-crm-accent-yellow-dark);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(245, 194, 66, 0.25);
}

/* Toast */
.crm-toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--bg-crm-dark);
  color: #ffffff;
  padding: 1rem 1.5rem;
  border-radius: var(--radius-crm-inner);
  box-shadow: var(--shadow-crm-dark);
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 0.88rem;
  font-weight: 600;
  opacity: 0;
  transform: translateY(15px);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.crm-toast.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
  .crm-grid-main {
    grid-template-columns: repeat(2, 1fr);
  }
  .crm-grid-bottom {
    grid-template-columns: 1fr;
  }
  .crm-kanban-board {
    grid-template-columns: repeat(3, 300px);
  }
}

@media (max-width: 768px) {
  body.crm-body {
    padding: 1rem;
  }
  .crm-grid-main {
    grid-template-columns: 1fr;
  }
  .crm-header {
    flex-direction: column;
    align-items: stretch;
  }
  .crm-nav-pill-container {
    overflow-x: auto;
  }
  .crm-top-counters {
    gap: 1rem;
  }
  .crm-counter-num {
    font-size: 2.25rem;
  }
}

/* ==========================================================================
   LOGIN OVERLAY STYLES
   ========================================================================== */

.crm-login-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 16, 10, 0.65);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: loginFadeIn 0.35s ease forwards;
}

.crm-login-overlay--exit {
  animation: loginFadeOut 0.4s ease forwards;
}

@keyframes loginFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes loginFadeOut {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(1.03); }
}

.crm-login-card {
  background: #fffef9;
  border: 1px solid rgba(220, 200, 160, 0.6);
  border-radius: 20px;
  padding: 40px 44px 36px;
  width: 100%;
  max-width: 420px;
  box-shadow:
    0 40px 80px rgba(0,0,0,0.18),
    0 8px 24px rgba(0,0,0,0.10),
    0 0 0 1px rgba(255,255,255,0.5) inset;
  animation: loginCardIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes loginCardIn {
  from { opacity: 0; transform: translateY(28px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Brand header */
.crm-login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 8px;
}

.crm-login-logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(245, 197, 24, 0.35);
  flex-shrink: 0;
}

.crm-login-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: #1a1410;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.crm-login-subtitle {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  color: #8a7f70;
  margin-top: 2px;
  font-weight: 500;
}

.crm-login-desc {
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  color: #9e917e;
  margin: 0 0 24px;
  line-height: 1.5;
}

/* Form */
.crm-login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.crm-login-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.crm-login-field label {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  color: #5a4f40;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.crm-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.crm-input-wrap input {
  width: 100%;
  padding: 11px 40px 11px 38px;
  background: #faf6ee;
  border: 1.5px solid #e6dcc8;
  border-radius: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  color: #1a1410;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  box-sizing: border-box;
}

.crm-input-wrap input::placeholder {
  color: #bfb09a;
}

.crm-input-wrap input:focus {
  border-color: #c8a84b;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(200, 168, 75, 0.15);
}

.crm-input-wrap.input-error input {
  border-color: #e05050;
  box-shadow: 0 0 0 3px rgba(224, 80, 80, 0.12);
  animation: inputShake 0.4s ease;
}

@keyframes inputShake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-5px); }
  60%       { transform: translateX(5px); }
}

.crm-input-icon {
  position: absolute;
  left: 11px;
  color: #b0a08a;
  pointer-events: none;
  flex-shrink: 0;
}

.crm-pw-toggle {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  cursor: pointer;
  color: #b0a08a;
  padding: 4px;
  display: flex;
  align-items: center;
  border-radius: 4px;
  transition: color 0.2s;
}

.crm-pw-toggle:hover {
  color: #7a6a50;
}

/* Error box */
.crm-login-error {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff2f2;
  border: 1px solid #f5c5c5;
  border-radius: 8px;
  padding: 9px 12px;
  color: #c03030;
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
}

.crm-login-error--shake {
  animation: inputShake 0.4s ease;
}

/* Submit button */
.crm-login-btn {
  margin-top: 4px;
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, #c8a84b 0%, #e8c860 100%);
  border: none;
  border-radius: 11px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: #1a1410;
  letter-spacing: 0.01em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(200, 168, 75, 0.4);
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
}

.crm-login-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(200, 168, 75, 0.5);
  filter: brightness(1.05);
}

.crm-login-btn:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(200, 168, 75, 0.3);
}

.crm-login-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Spinner animation */
.crm-spinner {
  animation: spinIcon 0.8s linear infinite;
}

@keyframes spinIcon {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* Footer note */
.crm-login-footer {
  margin: 18px 0 0;
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  color: #b8aa96;
  text-align: center;
}

/* Responsive */
@media (max-width: 480px) {
  .crm-login-card {
    padding: 30px 24px 28px;
    margin: 16px;
    border-radius: 16px;
  }
}

