:root {
  --tz-magenta: #9c1d6e;
  --tz-magenta-dark: #4a1030;
  --tz-orange: #ff7a1a;
  --tz-orange-light: #ffb347;
  --tz-navy: #201a2c;
  --tz-bg: #f6f5f9;
  --tz-card: #ffffff;
  --tz-text: #2c2438;
  --tz-muted: #857f92;
  --tz-success: #1fa971;
  --tz-danger: #e5484d;
  --tz-radius: 12px;
}

body {
  background: var(--tz-bg);
  color: var(--tz-text);
  font-family: 'Segoe UI', Roboto, -apple-system, sans-serif;
}

/* ---------- Sidebar ---------- */
.tz-sidebar {
  width: 240px;
  min-height: 100vh;
  background: linear-gradient(180deg, var(--tz-navy) 0%, #2d1b3d 100%);
  color: #fff;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  padding: 20px 0;
  z-index: 100;
}
.tz-sidebar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  margin-bottom: 16px;
}
.tz-sidebar .brand-text {
  font-weight: 700;
  font-size: 1.05rem;
  background: linear-gradient(90deg, var(--tz-orange), var(--tz-magenta));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.tz-sidebar a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255,255,255,.75);
  padding: 11px 20px;
  text-decoration: none;
  font-size: .93rem;
  border-left: 3px solid transparent;
  transition: .15s;
}
.tz-sidebar a:hover, .tz-sidebar a.active {
  background: rgba(255,255,255,.06);
  color: #fff;
  border-left-color: var(--tz-orange);
}

/* ---------- Layout ---------- */
.tz-main { margin-left: 240px; padding: 26px 30px; }
.tz-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.tz-topbar h4 { margin: 0; font-weight: 700; }

/* ---------- Cards / stats ---------- */
.tz-card {
  background: var(--tz-card);
  border-radius: var(--tz-radius);
  border: 1px solid #ece9f2;
  box-shadow: 0 2px 10px rgba(40,20,60,.04);
}
.stat-card {
  padding: 20px;
  border-radius: var(--tz-radius);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.stat-card .stat-value { font-size: 1.9rem; font-weight: 700; }
.stat-card .stat-label { opacity: .9; font-size: .85rem; }
.stat-card.bg-1 { background: linear-gradient(135deg, var(--tz-magenta), var(--tz-magenta-dark)); }
.stat-card.bg-2 { background: linear-gradient(135deg, var(--tz-orange), #d9540c); }
.stat-card.bg-3 { background: linear-gradient(135deg, #2b2140, var(--tz-navy)); }
.stat-card.bg-4 { background: linear-gradient(135deg, var(--tz-success), #147a52); }

/* ---------- Buttons ---------- */
.btn-tz {
  background: linear-gradient(90deg, var(--tz-orange), var(--tz-magenta));
  border: none;
  color: #fff;
  font-weight: 600;
}
.btn-tz:hover { color: #fff; opacity: .92; }

/* ---------- Table ---------- */
.tz-table thead { background: var(--tz-navy); color: #fff; }
.tz-table td, .tz-table th { vertical-align: middle; font-size: .9rem; }

.badge-status-new { background: #6c757d; }
.badge-status-contacted { background: #0d6efd; }
.badge-status-qualified { background: #6f42c1; }
.badge-status-proposal_sent { background: var(--tz-orange); }
.badge-status-won { background: var(--tz-success); }
.badge-status-lost { background: var(--tz-danger); }

.source-badge {
  border-radius: 20px;
  padding: 3px 10px;
  font-size: .74rem;
  font-weight: 600;
}
.source-Meta.Ads, .source-meta_ads { background: #e7f0ff; color: #1877f2; }
.source-Google.Ads, .source-google_ads { background: #fef2e0; color: #e37400; }
.source-Website.Organic { background: #eafbf3; color: #1fa971; }
.source-Referral { background: #f5eafc; color: #8a2be2; }
.source-WhatsApp { background: #e6f9ee; color: #25d366; }

@media (max-width: 900px) {
  .tz-sidebar { transform: translateX(-100%); transition: .2s; }
  .tz-sidebar.show { transform: translateX(0); }
  .tz-main { margin-left: 0; padding: 18px; }
}

/* ---------- Login page ---------- */
.tz-login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--tz-navy), var(--tz-magenta-dark));
}
.tz-login-card {
  width: 100%;
  max-width: 380px;
  background: #fff;
  border-radius: 16px;
  padding: 36px 32px;
  box-shadow: 0 20px 50px rgba(0,0,0,.3);
}

/* ---------- Logo ---------- */
.tz-sidebar .brand {
  padding: 10px 18px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tz-sidebar .brand-logo {
  max-width: 100%;
  height: auto;
  max-height: 54px;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.25));
}

/* ---------- Nav badge (Leads sidebar link) ---------- */
.tz-nav-badge {
  margin-left: auto;
  background: var(--tz-danger);
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  border-radius: 20px;
  padding: 1px 7px;
  line-height: 1.4;
}

/* ---------- Notification bell ---------- */
.tz-notif-bell {
  position: fixed;
  top: 16px;
  right: 22px;
  z-index: 200;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 4px 16px rgba(40,20,60,.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--tz-magenta);
  cursor: pointer;
}
.tz-notif-count {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--tz-danger);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}
.tz-notif-dropdown {
  position: fixed;
  top: 64px;
  right: 22px;
  z-index: 200;
  width: 300px;
  max-height: 380px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(40,20,60,.22);
  overflow: hidden;
}
.tz-notif-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid #eee;
  font-weight: 700;
  font-size: .9rem;
}
.tz-notif-list { max-height: 320px; overflow-y: auto; }
.tz-notif-item {
  display: block;
  padding: 10px 14px;
  border-bottom: 1px solid #f2f2f2;
  text-decoration: none;
  color: var(--tz-text);
}
.tz-notif-item:hover { background: #faf8fc; }

/* ---------- Toasts (new lead popup) ---------- */
.tz-toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 340px;
}
.tz-toast {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(40,20,60,.28);
  padding: 14px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  cursor: pointer;
  border-left: 4px solid var(--tz-orange);
  animation: tzToastIn .3s ease;
  position: relative;
}
.tz-toast-hide { opacity: 0; transform: translateX(20px); transition: .4s; }
@keyframes tzToastIn {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}
.tz-toast-icon {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, var(--tz-orange), var(--tz-magenta));
  color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.tz-toast-title { font-weight: 700; font-size: .88rem; }
.tz-toast-text { font-size: .84rem; margin-top: 2px; }
.tz-toast-sub { font-size: .74rem; color: var(--tz-muted); margin-top: 2px; }
.tz-toast-close {
  position: absolute; top: 6px; right: 8px; background: none; border: none;
  font-size: 16px; color: #aaa; cursor: pointer;
}

/* ---------- Login/Register logo ---------- */
.tz-login-card img { max-height: 60px; object-fit: contain; }

@media (max-width: 900px) {
  .tz-notif-dropdown { right: 10px; width: calc(100% - 20px); max-width: 340px; }
  .tz-toast-container { right: 10px; left: 10px; max-width: none; }
}
