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

:root {
  --primary: #E4007C; /* Gummy Magenta */
  --primary-hover: #C20068;
  --secondary: #F58220; /* Gummy Orange */
  --bg-dark: #1E1B29; /* Deep Plum Dark */
  --bg-card: rgba(45, 38, 62, 0.7);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --success: #19A24A; /* Gummy Green */
  --warning: #FBB03B; /* Gummy Yellow/Amber */
  --danger: #ef4444;
  --blue-gummy: #00ADEF;
  --purple-gummy: #8B2E8F;
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-bg: rgba(255, 255, 255, 0.03);
  --sidebar-width: 260px;
  --shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.5);
}

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

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

h1, h2, h3, .brand {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
}

#app {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* Glassmorphism Classes */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
}

.premium-card {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--shadow);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.premium-card:hover {
  transform: translateY(-5px);
  border-color: rgba(14, 165, 233, 0.3);
}

/* Login Page Styles */
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100vh;
  background: radial-gradient(circle at 10% 20%, rgba(14, 165, 233, 0.1) 0%, rgba(0, 0, 0, 0) 50.2%);
}

.login-form {
  width: 100%;
  max-width: 400px;
  text-align: center;
}

.login-form h1 {
  margin-bottom: 30px;
  background: linear-gradient(to right, #0ea5e9, #6366f1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: 2.5rem;
}

.input-group {
  margin-bottom: 20px;
  text-align: left;
}

.input-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.input-group input, .input-group select {
  width: 100%;
  padding: 12px 16px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  color: white;
  outline: none;
  transition: border-color 0.3s;
}

option {
  background-color: #1e1b29;
  color: white;
}

.input-group input:focus {
  border-color: var(--primary);
}

.btn-primary {
  width: 100%;
  padding: 14px;
  background: linear-gradient(to right, var(--primary), var(--secondary));
  border: none;
  border-radius: 12px;
  color: white;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(14, 165, 233, 0.3);
  transition: all 0.3s;
}

.btn-primary:hover {
  filter: brightness(1.1);
  box-shadow: 0 4px 20px rgba(14, 165, 233, 0.5);
}

/* Dashboard Styles */
.sidebar {
  width: 200px;
  height: 100vh;
  background: rgba(15, 23, 42, 0.95);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  padding: 40px 20px;
  position: fixed;
  z-index: 100;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  margin-bottom: 50px;
}

.brand img {
  filter: drop-shadow(0 0 10px rgba(228, 0, 124, 0.3));
}

.main-content {
  flex: 1;
  padding: 30px;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  margin-bottom: 10px;
  border-radius: 12px;
  color: var(--text-muted);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s;
}

.nav-item.active {
  background: rgba(14, 165, 233, 0.1);
  color: var(--primary);
  font-weight: 600;
}

.nav-item:hover:not(.active) {
  color: white;
  background: rgba(255, 255, 255, 0.05);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

.kpi-card h3 {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.kpi-card .value {
  font-size: 2rem;
  font-weight: 700;
  margin-top: 5px;
}

/* Pipeline Styles */
.pipeline {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding-bottom: 20px;
}

.column {
  min-width: 300px;
  flex: 1;
  background: rgba(15, 23, 42, 0.4);
  border-radius: 16px;
  padding: 16px;
}

.column h2 {
  font-size: 1.1rem;
  margin-bottom: 20px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}

.lead-card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid var(--glass-border);
  cursor: grab;
}

.lead-card .name {
  font-weight: 600;
  font-size: 0.95rem;
}

.lead-card .phone {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
}

.badge-campaign {
  background: rgba(99, 102, 241, 0.1);
  color: var(--secondary);
}

/* Chat Popup Styles */
.chat-window {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.messages {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.message {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.9rem;
}

.message.inbound {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.05);
  color: white;
}

.message.outbound {
  align-self: flex-end;
  background: var(--primary);
  color: white;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.5s ease forwards;
}

/* ===========================
   Sottcor CRM v2.0 Additions
   =========================== */

/* Sidebar width fix */
.sidebar {
  width: 220px;
  min-width: 220px;
  height: 100vh;
  background: rgba(15, 23, 42, 0.98);
  border-right: 1px solid var(--glass-border);
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  overflow-y: auto;
  scrollbar-width: none;
}

.main-content {
  flex: 1;
  padding: 30px;
  overflow-y: auto;
  min-height: 100vh;
}

/* Center all top-level component containers */
.main-content > div {
  width: 100%;
  max-width: 1500px;
  margin: 0 auto;
}

/* Message bubbles improved */
.message {
  max-width: 75%;
  animation: fadeIn 0.2s ease;
}

.message .text {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.88rem;
  line-height: 1.5;
  word-break: break-word;
}

.message.inbound .text {
  background: rgba(255,255,255,0.07);
  border-radius: 4px 14px 14px 14px;
}

.message.outbound .text {
  background: linear-gradient(135deg, var(--primary), #C20068);
  border-radius: 14px 4px 14px 14px;
}

/* Pipeline columns scroll */
.pipeline-col .lead-list {
  scrollbar-width: thin;
  scrollbar-color: rgba(228,0,124,0.3) transparent;
}

/* Table styles */
table { border-collapse: collapse; }
th { font-weight: 600; }

/* Form inputs global */
input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="date"], input[type="datetime-local"],
select, textarea {
  outline: none;
  transition: border-color 0.2s;
}

input[type="text"]:focus, input[type="email"]:focus,
input[type="number"]:focus, input[type="date"]:focus,
input[type="datetime-local"]:focus, select:focus, textarea:focus {
  border-color: var(--primary) !important;
}

/* Toast slide animation */
@keyframes slideIn {
  from { transform: translateX(120px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Scrollbar global */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(228,0,124,0.3); border-radius: 4px; }

/* Chat list items */
.lead-item { border-radius: 10px; cursor: pointer; transition: background 0.2s; }
.lead-item:hover { background: rgba(255,255,255,0.05); }
.lead-item.active { background: rgba(228,0,124,0.1); border: 1px solid rgba(228,0,124,0.3); }

/* Pipeline card hover */
.lead-card:hover { transform: none; box-shadow: 0 4px 20px rgba(0,0,0,0.4); }

/* Step items in sequences */
.step-item input, .step-item select, .step-item textarea {
  background: rgba(0,0,0,0.3) !important;
  border: 1px solid var(--glass-border) !important;
  color: white !important;
}

/* Reports table */
#rpt-sellers tr:hover { background: rgba(255,255,255,0.02); }
