:root {
  --primary-blue: #2563eb;
  --primary-blue-hover: #1d4ed8;
  --primary-blue-light: #eff6ff;
  --primary-blue-border: #bfdbfe;
  
  --bg-app: #f8fafc;
  --card-bg: #ffffff;
  
  --text-dark: #0f172a;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  
  --border-color: #e2e8f0;
  --border-light: #f1f5f9;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);

  /* Status Colors */
  --green-main: #10b981;
  --green-bg: #ecfdf5;
  --green-text: #047857;

  --purple-main: #8b5cf6;
  --purple-bg: #f3e8ff;
  --purple-text: #6d28d9;

  --orange-main: #f59e0b;
  --orange-bg: #fffbe6;
  --orange-text: #b45309;

  --red-main: #ef4444;
  --red-bg: #fef2f2;
  --red-text: #b91c1c;

  --teal-main: #14b8a6;
  --teal-bg: #ccfbf1;
  --teal-text: #0f766e;
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

/* Glass Panel / Card Base */
.card-panel {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}

/* Buttons */
.btn-primary {
  background: var(--primary-blue);
  color: white;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.875rem;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
  background: var(--primary-blue-hover);
}

.btn-outline {
  background: white;
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.875rem;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

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

.btn-icon-only {
  padding: 0.6rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: white;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-icon-only:hover {
  background: var(--border-light);
  color: var(--text-main);
}

/* Input Fields & Selects */
.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-box input {
  width: 100%;
  padding: 0.6rem 1rem 0.6rem 2.4rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: white;
  font-size: 0.875rem;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.2s;
}

.search-box input:focus {
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-box svg {
  position: absolute;
  left: 0.8rem;
  width: 16px;
  height: 16px;
  stroke: var(--text-muted);
  pointer-events: none;
}

.select-filter {
  padding: 0.6rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: white;
  font-size: 0.875rem;
  color: var(--text-main);
  outline: none;
  cursor: pointer;
}
.select-filter:focus {
  border-color: var(--primary-blue);
}

/* Badges & Tags */
.badge-tag {
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}

.badge-blue { background: var(--primary-blue-light); color: var(--primary-blue); }
.badge-green { background: var(--green-bg); color: var(--green-text); }
.badge-orange { background: var(--orange-bg); color: var(--orange-text); }
.badge-purple { background: var(--purple-bg); color: var(--purple-text); }
.badge-red { background: var(--red-bg); color: var(--red-text); }
.badge-gray { background: var(--border-light); color: var(--text-muted); }

/* SVG Icon class */
.icon {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

/* APP DESKTOP LAYOUT */
.desktop-app {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  background: var(--bg-app);
}

/* SIDEBAR */
.sidebar {
  width: 250px;
  background: white;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-brand {
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border-light);
}

.sidebar-logo {
  width: 32px;
  height: 32px;
  background: var(--primary-blue);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.sidebar-brand-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-dark);
  letter-spacing: -0.02em;
}

.sidebar-menu {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.15s ease;
}

.sidebar-item:hover {
  background: var(--border-light);
  color: var(--text-main);
}

.sidebar-item.active {
  background: var(--primary-blue-light);
  color: var(--primary-blue);
  font-weight: 600;
}

.sidebar-item .icon {
  width: 18px;
  height: 18px;
}

.sidebar-upgrade-card {
  margin: 1rem 0.75rem;
  padding: 1rem;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border-radius: 12px;
  border: 1px solid var(--primary-blue-border);
  text-align: center;
}

.sidebar-upgrade-card img {
  width: 80px;
  height: auto;
  margin-bottom: 0.5rem;
}

.sidebar-upgrade-card p {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
  line-height: 1.4;
}

.sidebar-upgrade-card .btn-upgrade {
  width: 100%;
  padding: 0.5rem;
  background: var(--primary-blue);
  color: white;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  transition: background 0.2s;
}
.sidebar-upgrade-card .btn-upgrade:hover {
  background: var(--primary-blue-hover);
}

/* TOPBAR */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  height: 70px;
  background: white;
  border-bottom: 1px solid var(--border-color);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.topbar-title h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.2;
}

.topbar-title p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.topbar-search-header {
  width: 380px;
}
.topbar-search-header input {
  border-radius: 20px;
  background: var(--bg-app);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav-icon-btn {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  background: var(--border-light);
  transition: background 0.2s;
}
.nav-icon-btn:hover {
  background: var(--border-color);
  color: var(--text-main);
}
.nav-icon-btn .badge-counter {
  position: absolute;
  top: -2px;
  right: -2px;
  background: var(--red-main);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid white;
}

.user-profile-pill {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.25rem 0.5rem 0.25rem 0.25rem;
  border-radius: 20px;
  cursor: pointer;
}
.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #3b82f6;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
}

/* MAIN CONTENT VIEW CONTAINER */
.content-area, .content-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.75rem 2rem;
}


/* STAT CARDS GRID */
.stat-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stat-icon-wrapper {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-info label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.stat-info .stat-number {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.2;
  margin: 0.15rem 0;
}

.stat-info .stat-growth {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--green-main);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.stat-info .stat-growth span {
  color: var(--text-muted);
  font-weight: 400;
}

/* FILTERS BAR */
.filters-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.filters-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* TABLE STYLING */
.table-container {
  overflow-x: auto;
  border-radius: 12px;
  background: white;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

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

table.data-table th {
  background: #f8fafc;
  padding: 0.85rem 1rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-color);
}

table.data-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

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

table.data-table tr:hover {
  background: #fafafa;
}

.avatar-initial {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: white;
  flex-shrink: 0;
}

.customer-cell, .lead-cell {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.cell-title {
  font-weight: 600;
  color: var(--text-dark);
  font-size: 0.875rem;
}

.cell-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.score-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
}

/* PAGINATION */
.pagination-wrapper {
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-light);
  background: white;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.page-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
  background: white;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-main);
  transition: all 0.15s;
}

.page-btn.active {
  background: var(--primary-blue);
  color: white;
  border-color: var(--primary-blue);
  font-weight: 600;
}

.page-btn:hover:not(.active) {
  background: var(--border-light);
}

/* MOBILE VIEW SIMULATION & RESPONSIVE */
.mobile-simulation-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: #e2e8f0;
  padding: 2rem 1rem;
}

.mobile-frame {
  width: 390px;
  height: 844px;
  background: var(--bg-app);
  border-radius: 44px;
  border: 10px solid #1e293b;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Mobile top status notch header */
.mobile-notch-header {
  height: 44px;
  background: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}

.mobile-header-bar {
  height: 54px;
  background: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.mobile-header-bar h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-dark);
}

.mobile-scroll-content {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  position: relative;
}

.mobile-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.mobile-stat-card {
  padding: 0.85rem;
}
.mobile-stat-card .stat-icon-wrapper {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}
.mobile-stat-card .stat-number {
  font-size: 1.15rem;
}

.mobile-card-item {
  padding: 0.85rem 1rem;
  margin-bottom: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mobile-fab {
  position: absolute;
  bottom: 80px;
  right: 18px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--primary-blue);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 16px rgba(37, 99, 235, 0.4);
  z-index: 20;
}
.mobile-fab svg {
  width: 24px;
  height: 24px;
}

.mobile-bottom-nav {
  height: 64px;
  background: white;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-around;
  flex-shrink: 0;
  padding-bottom: 0.25rem;
}

.mobile-nav-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 500;
}

.mobile-nav-tab.active {
  color: var(--primary-blue);
  font-weight: 600;
}

.mobile-nav-tab .icon {
  width: 20px;
  height: 20px;
}

/* CALENDAR STYLES */
.calendar-container {
  background: white;
  border-radius: 14px;
  border: 1px solid var(--border-color);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}
.calendar-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border-color);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  overflow: hidden;
}
.calendar-day-header {
  background: #f8fafc;
  padding: 0.6rem;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}
.calendar-day-cell {
  background: white;
  min-height: 95px;
  padding: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  position: relative;
}
.calendar-day-cell.other-month {
  background: #f8fafc;
}
.calendar-day-cell.other-month .day-number {
  color: #cbd5e1;
}
.calendar-day-cell.today {
  background: #f0f9ff;
}
.calendar-day-cell.today .day-number-badge {
  background: var(--primary-blue);
  color: white;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.day-number {
  font-size: 0.8rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 0.15rem;
}
.event-pill {
  font-size: 0.68rem;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* TAB BAR */
.tab-pill-bar {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
  margin-bottom: 1.25rem;
  overflow-x: auto;
}
.tab-pill {
  padding: 0.45rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.tab-pill.active {
  background: var(--primary-blue-light);
  color: var(--primary-blue);
  font-weight: 600;
}
.tab-pill:hover:not(.active) {
  background: var(--border-light);
  color: var(--text-main);
}

/* 5 STAT CARDS GRID */
.stat-cards-grid-5 {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

/* KANBAN BOARD STYLES */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
  overflow-x: auto;
}
.kanban-column {
  background: #f8fafc;
  border-radius: 12px;
  padding: 0.85rem;
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 220px;
}
.kanban-column-header {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border-color);
}
.kanban-title-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
}
.kanban-subtitle-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-muted);
}
.kanban-card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.85rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: transform 0.15s, box-shadow 0.15s;
}
.kanban-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.06);
}
.kanban-card-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #0f172a;
}
.kanban-card-company {
  font-size: 0.72rem;
  color: #64748b;
}
.kanban-card-value {
  font-size: 0.82rem;
  font-weight: 700;
  color: #1e293b;
}
.kanban-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.25rem;
  font-size: 0.68rem;
  color: #94a3b8;
}


