/* ===== INTERIORFLOW CRM — SHARED STYLES ===== */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600;700&family=Playfair+Display:wght@600;700&display=swap');

:root {
  --red: #ea5540;
  --red-light: #f07060;
  --red-pale: #fde8e5;
  --teal: #425c61;
  --teal-dark: #2e4347;
  --teal-light: #5a7a80;
  --teal-pale: #e8f0f1;
  --cream: #faf8f5;
  --cream-dark: #f3f0eb;
  --sand: #e8e2d9;
  --text-dark: #1e2d30;
  --text-mid: #4a6266;
  --text-soft: #7a9399;
  --text-muted: #a8bfc2;
  --white-pure: #ffffff;
  --white-warm: #fdfcfa;
  --border: #dde8ea;
  --border-light: #eef3f4;
  --shadow-sm: 0 1px 4px rgba(66,92,97,0.08);
  --shadow-md: 0 4px 16px rgba(66,92,97,0.12);
  --shadow-lg: 0 8px 32px rgba(66,92,97,0.16);
  --sidebar-w: 240px;
  --topbar-h: 64px;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
}

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

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

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--cream);
  color: var(--text-dark);
  min-height: 100vh;
  display: flex;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-w);
  background: var(--teal-dark);
  min-height: 100vh;
  position: fixed;
  left: 0; top: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-logo {
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-logo .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.sidebar-logo .brand-icon {
  width: 36px; height: 36px;
  background: var(--red);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: var(--white-pure);
  font-size: 16px;
}
.sidebar-logo .brand-name {
  font-family: 'Playfair Display', serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--white-pure);
  line-height: 1.1;
}
.sidebar-logo .brand-tagline {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.sidebar-nav {
  flex: 1;
  padding: 14px 0;
  overflow-y: auto;
}
.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 12px 20px 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 20px;
  text-decoration: none;
  color: rgba(255,255,255,0.65);
  font-size: 13.5px;
  font-weight: 450;
  border-radius: 0;
  transition: all 0.2s;
  position: relative;
}
.nav-item:hover { color: var(--white-pure); background: rgba(255,255,255,0.06); }
.nav-item.active {
  color: var(--white-pure);
  background: rgba(234,85,64,0.18);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--red);
  border-radius: 0 2px 2px 0;
}
.nav-item i { width: 18px; text-align: center; font-size: 14px; }
.nav-badge {
  margin-left: auto;
  background: var(--red);
  color: var(--white-pure);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 14px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.sidebar-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--red), var(--red-light));
  display: flex; align-items: center; justify-content: center;
  color: var(--white-pure);
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}
.sidebar-user-info .user-name { font-size: 13px; font-weight: 500; color: var(--white-pure); }
.sidebar-user-info .user-role { font-size: 11px; color: var(--text-muted); }

/* ===== MAIN LAYOUT ===== */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  height: var(--topbar-h);
  background: var(--white-warm);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  color: var(--teal);
  padding: 4px;
}
.topbar-title { font-size: 18px; font-weight: 600; color: var(--text-dark); }
.topbar-subtitle { font-size: 12px; color: var(--text-soft); margin-top: 1px; }
.topbar-spacer { flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.topbar-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-mid);
  cursor: pointer;
  display: flex; align-items: center; gap: 7px;
  transition: all 0.2s;
  text-decoration: none;
}
.topbar-btn:hover { background: var(--cream-dark); border-color: var(--teal-light); color: var(--teal); }
.topbar-btn.primary {
  background: var(--red);
  border-color: var(--red);
  color: var(--white-pure);
}
.topbar-btn.primary:hover { background: var(--red-light); border-color: var(--red-light); }
.topbar-notif {
  width: 38px; height: 38px;
  background: var(--cream-dark);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-mid);
  font-size: 15px;
  position: relative;
  transition: all 0.2s;
}
.topbar-notif:hover { background: var(--teal-pale); color: var(--teal); }
.notif-dot {
  position: absolute;
  top: 7px; right: 7px;
  width: 7px; height: 7px;
  background: var(--red);
  border-radius: 50%;
  border: 1.5px solid var(--white-warm);
}

.page-content {
  flex: 1;
  padding: 28px;
  overflow-x: hidden;
}

/* ===== CARDS ===== */
.card {
  background: var(--white-warm);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dark);
}
.card-subtitle { font-size: 12px; color: var(--text-soft); margin-top: 2px; }
.card-link {
  font-size: 12px;
  color: var(--red);
  text-decoration: none;
  font-weight: 500;
}
.card-link:hover { text-decoration: underline; }

/* ===== STAT CARDS ===== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--white-warm);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  margin-bottom: 12px;
}
.stat-icon.red { background: var(--red-pale); color: var(--red); }
.stat-icon.teal { background: var(--teal-pale); color: var(--teal); }
.stat-icon.orange { background: #fff3e0; color: #e65c00; }
.stat-icon.green { background: #e8f5e9; color: #2e7d32; }
.stat-icon.blue { background: #e3f2fd; color: #1565c0; }
.stat-icon.purple { background: #f3e5f5; color: #6a1b9a; }
.stat-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1;
  margin-bottom: 4px;
}
.stat-label { font-size: 12px; color: var(--text-soft); }
.stat-change {
  font-size: 11px;
  font-weight: 500;
  margin-top: 6px;
}
.stat-change.up { color: #2e7d32; }
.stat-change.down { color: var(--red); }

/* ===== BADGES ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.badge-hot { background: #fde8e5; color: var(--red); }
.badge-warm { background: #fff3e0; color: #e65c00; }
.badge-cold { background: var(--teal-pale); color: var(--teal); }
.badge-new { background: #e3f2fd; color: #1565c0; }
.badge-won { background: #e8f5e9; color: #2e7d32; }
.badge-lost { background: #f5f5f5; color: #666; }
.badge-pending { background: #fff8e1; color: #f57f17; }

/* ===== LEAD SCORE ===== */
.score-ring {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 700;
  border: 3px solid;
}
.score-hot { border-color: var(--red); color: var(--red); background: var(--red-pale); }
.score-warm { border-color: #e65c00; color: #e65c00; background: #fff3e0; }
.score-cold { border-color: var(--teal-light); color: var(--teal); background: var(--teal-pale); }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary { background: var(--red); color: var(--white-pure); }
.btn-primary:hover { background: var(--red-light); }
.btn-secondary { background: var(--teal); color: var(--white-pure); }
.btn-secondary:hover { background: var(--teal-light); }
.btn-outline { background: transparent; color: var(--teal); border: 1px solid var(--border); }
.btn-outline:hover { background: var(--cream-dark); }
.btn-ghost { background: transparent; color: var(--text-mid); padding: 6px 10px; }
.btn-ghost:hover { background: var(--cream-dark); color: var(--teal); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-mid);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--text-dark);
  background: var(--white-warm);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
.form-control:focus {
  border-color: var(--teal-light);
  box-shadow: 0 0 0 3px rgba(66,92,97,0.1);
}
.form-control::placeholder { color: var(--text-muted); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 90px; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ===== TABLES ===== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-soft);
  padding: 10px 16px;
  text-align: left;
  background: var(--cream);
  border-bottom: 1px solid var(--border-light);
}
tbody td {
  padding: 13px 16px;
  font-size: 13.5px;
  color: var(--text-dark);
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--cream); }

/* ===== PROGRESS BAR ===== */
.progress-bar {
  height: 6px;
  background: var(--border-light);
  border-radius: 3px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--red);
  transition: width 0.6s ease;
}
.progress-fill.teal { background: var(--teal); }
.progress-fill.green { background: #4caf50; }

/* ===== LEAD CARD ===== */
.lead-card {
  background: var(--white-warm);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
  cursor: pointer;
}
.lead-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--teal-light); }
.lead-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.lead-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal), var(--teal-light));
  display: flex; align-items: center; justify-content: center;
  color: var(--white-pure);
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}
.lead-avatar.female { background: linear-gradient(135deg, var(--red), var(--red-light)); }
.lead-name { font-size: 13.5px; font-weight: 600; color: var(--text-dark); }
.lead-meta { font-size: 11.5px; color: var(--text-soft); margin-top: 2px; }
.lead-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.lead-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-mid);
  background: var(--cream);
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-light);
}

/* ===== TIMELINE ===== */
.timeline { position: relative; }
.timeline-item {
  display: flex;
  gap: 14px;
  padding-bottom: 20px;
  position: relative;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.timeline-dot.green { background: #e8f5e9; color: #2e7d32; border: 2px solid #4caf50; }
.timeline-dot.red { background: var(--red-pale); color: var(--red); border: 2px solid var(--red); }
.timeline-dot.teal { background: var(--teal-pale); color: var(--teal); border: 2px solid var(--teal); }
.timeline-dot.orange { background: #fff3e0; color: #e65c00; border: 2px solid #ff9800; }
.timeline-dot.blue { background: #e3f2fd; color: #1565c0; border: 2px solid #2196f3; }
.timeline-item:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 15px; top: 32px; bottom: 0;
  width: 2px;
  background: var(--border-light);
}
.timeline-content { flex: 1; padding-top: 4px; }
.timeline-title { font-size: 13px; font-weight: 600; color: var(--text-dark); }
.timeline-text { font-size: 12px; color: var(--text-soft); margin-top: 2px; }
.timeline-time { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ===== FUNNEL ===== */
.funnel-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}
.funnel-item:last-child { border-bottom: none; }
.funnel-label { font-size: 13px; color: var(--text-mid); width: 130px; flex-shrink: 0; }
.funnel-bar-wrap { flex: 1; }
.funnel-count { font-size: 13px; font-weight: 600; color: var(--text-dark); width: 35px; text-align: right; flex-shrink: 0; }

/* ===== SOURCE BADGE ===== */
.source-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 6px;
}
.source-instagram { background: #fce4ec; color: #c2185b; }
.source-facebook { background: #e3f2fd; color: #1565c0; }
.source-website { background: #e8f5e9; color: #2e7d32; }
.source-google { background: #fff3e0; color: #e65c00; }
.source-referral { background: #f3e5f5; color: #6a1b9a; }
.source-whatsapp { background: #e8f5e9; color: #1b5e20; }

/* ===== OVERLAY / SIDEBAR MOBILE ===== */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  :root { --sidebar-w: 220px; }
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: 260px;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.open { display: block; }
  .main { margin-left: 0; }
  .topbar { padding: 0 16px; }
  .topbar-hamburger { display: flex; }
  .page-content { padding: 16px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .form-row { grid-template-columns: 1fr; }
  .topbar-title { font-size: 16px; }
  .topbar-btn span { display: none; }
}

@media (max-width: 480px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-value { font-size: 22px; }
  .card { padding: 16px; }
  .page-content { padding: 12px; }
}

/* ===== UTILITY ===== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
@media (max-width: 900px) { .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }
.text-red { color: var(--red); }
.text-teal { color: var(--teal); }
.text-soft { color: var(--text-soft); }
.text-muted { color: var(--text-muted); }
.text-bold { font-weight: 600; }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.divider { height: 1px; background: var(--border-light); margin: 16px 0; }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 500;
  background: var(--cream-dark); color: var(--text-mid);
  border: 1px solid var(--border-light);
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}
.empty-state i { font-size: 40px; margin-bottom: 12px; opacity: 0.4; }
.empty-state p { font-size: 14px; }

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-in { animation: fadeIn 0.35s ease both; }
.animate-in-delay-1 { animation-delay: 0.05s; }
.animate-in-delay-2 { animation-delay: 0.10s; }
.animate-in-delay-3 { animation-delay: 0.15s; }
.animate-in-delay-4 { animation-delay: 0.20s; }
.animate-in-delay-5 { animation-delay: 0.25s; }

/* ===== PAGE HEADER ===== */
.page-header { margin-bottom: 24px; }
.page-header h1 { font-size: 22px; font-weight: 700; color: var(--text-dark); }
.page-header p { font-size: 13px; color: var(--text-soft); margin-top: 4px; }

/* ===== SECTION HEADER ===== */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.section-title { font-size: 14px; font-weight: 600; color: var(--text-dark); }
