:root {
  --bg-dark: #0a0c10;
  --card-bg: #121722;
  --tile-bg: #1a202c;
  --border-color: rgba(255, 255, 255, 0.12);
  --accent-cyan: #00f2fe;
  --accent-blue: #4facfe;
  --accent-green: #10b981;
  --accent-warn: #f59e0b;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --sidebar-width: 260px;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Plus Jakarta Sans', system-ui, sans-serif; -webkit-tap-highlight-color: transparent; }
body { background-color: var(--bg-dark); color: var(--text-main); min-height: 100vh; padding: 0; margin: 0; }
body.has-sidebar { padding-left: calc(var(--sidebar-width) + 1.5rem); }

#top-progress-bar { position: fixed; top: 0; left: 0; height: 3px; width: 0%; background: linear-gradient(90deg, var(--accent-cyan), var(--accent-blue)); z-index: 99999; transition: width 0.2s; }
#bg-canvas { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }

/* PUBLIC TOP NAVIGATION & BUTTON FIX */
.top-nav {
  width: 100%;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
  padding: 0.85rem 1.5rem;
  position: relative;
  z-index: 100;
}
.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-logo {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--accent-cyan);
  letter-spacing: 0.5px;
}
.brand-tag {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

.btn-login-nav {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: auto !important;
  min-height: 38px !important;
  padding: 8px 22px !important;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue)) !important;
  color: #0a0c10 !important;
  border: none !important;
  border-radius: 8px !important;
  text-decoration: none !important;
  font-weight: 700 !important;
  font-size: 0.85rem !important;
  box-shadow: 0 4px 12px rgba(0, 242, 254, 0.25) !important;
  transition: transform 0.15s ease, box-shadow 0.15s ease !important;
  flex: 0 0 auto;
}
.btn-login-nav:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 242, 254, 0.4) !important;
}

/* PUBLIC HERO & LOGIN */
.hero-wrapper { min-height: calc(100vh - 80px); display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; position: relative; z-index: 10; }
.login-wrapper { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; position: relative; z-index: 10; }
.home-card { width: 100%; max-width: 460px; margin: 0 auto; text-align: left; }
.login-card { width: 100%; max-width: 420px; margin: 0 auto; }

.badge { display: inline-flex; align-items: center; gap: 8px; background: rgba(0, 242, 254, 0.1); color: var(--accent-cyan); font-size: 0.78rem; font-weight: 700; padding: 5px 12px; border-radius: 99px; border: 1px solid rgba(0, 242, 254, 0.25); margin-bottom: 1rem; }
.pulse-dot { width: 8px; height: 8px; background: var(--accent-cyan); border-radius: 50%; animation: pulse 1.5s infinite; }
@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 242, 254, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(0, 242, 254, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 242, 254, 0); }
}

h1 { font-size: 1.75rem; font-weight: 800; color: #fff; margin-bottom: 0.5rem; line-height: 1.25; }
.subtitle { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 1.5rem; line-height: 1.5; }

/* DASHBOARD CONTAINER */
.dashboard-container { max-width: 1200px; margin: 0 auto; padding: 1.5rem 1rem; position: relative; z-index: 10; }

/* LEFT SIDEBAR & BURGER MENU */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: #111520;
  border-right: 1px solid var(--border-color);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.25rem 1rem;
  transition: transform 0.3s ease;
}

.sidebar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border-color); }
.sidebar-toggle-btn { display: none; background: none; border: none; color: var(--text-muted); font-size: 1.8rem; cursor: pointer; }

.sidebar-nav { display: flex; flex-direction: column; gap: 0.4rem; flex-grow: 1; overflow-y: auto; }
.nav-item {
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  transition: all 0.2s;
}
.nav-item:hover { color: #fff; background: rgba(255,255,255,0.03); }
.nav-item.active { background: rgba(0, 242, 254, 0.1); border-color: rgba(0, 242, 254, 0.25); color: var(--accent-cyan); }

.sidebar-footer { padding-top: 1rem; border-top: 1px solid var(--border-color); }

.admin-tab-content { display: none; }
.admin-tab-content.active { display: block; }

.burger-btn {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 24px;
  height: 18px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.burger-btn span { width: 100%; height: 2px; background-color: var(--accent-cyan); border-radius: 2px; transition: all 0.3s; }

.sidebar-overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0,0,0,0.7); z-index: 999; display: none; }
.sidebar-overlay.active { display: block; }

/* HEADER */
.dashboard-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; background: var(--card-bg); padding: 1rem 1.5rem; border-radius: 16px; border: 1px solid var(--border-color); box-shadow: 0 10px 25px rgba(0,0,0,0.4); }
.brand-title { font-size: 1.25rem; font-weight: 800; color: #fff; letter-spacing: 0.5px; }
.brand-title span { color: var(--accent-cyan); }
.user-info { font-size: 0.85rem; color: var(--text-muted); margin-top: 2px; }
.role-badge { background: rgba(0, 242, 254, 0.1); color: var(--accent-cyan); padding: 2px 8px; border-radius: 6px; font-size: 0.7rem; font-weight: 700; border: 1px solid rgba(0, 242, 254, 0.2); }

.alert { padding: 12px 16px; border-radius: 10px; font-size: 0.9rem; margin-bottom: 1.5rem; }
.alert-success { background: rgba(16, 185, 129, 0.15); border: 1px solid rgba(16, 185, 129, 0.3); color: #a7f3d0; }
.alert-danger { background: rgba(239, 68, 68, 0.15); border: 1px solid rgba(239, 68, 68, 0.3); color: #fca5a5; }

/* KPI GRID & BADGES */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.kpi-card { background: var(--card-bg); border: 1px solid var(--border-color); padding: 1.25rem; border-radius: 16px; box-shadow: 0 8px 20px rgba(0,0,0,0.3); position: relative; }
.kpi-card .val { font-size: 2rem; font-weight: 800; color: #fff; line-height: 1.2; margin-top: 4px; }
.kpi-card .lbl { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; font-weight: 600; letter-spacing: 0.5px; }
.kpi-card .sub-lbl { font-size: 0.75rem; color: #64748b; margin-top: 6px; }

.kpi-split-row { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.badge-organic { background: rgba(16, 185, 129, 0.15); color: #a7f3d0; border: 1px solid rgba(16, 185, 129, 0.3); font-size: 0.72rem; padding: 4px 8px; border-radius: 6px; }
.badge-assisted { background: rgba(0, 242, 254, 0.15); color: var(--accent-cyan); border: 1px solid rgba(0, 242, 254, 0.3); font-size: 0.72rem; padding: 4px 8px; border-radius: 6px; }

.radio-filter-group { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.radio-option { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; color: #cbd5e1; cursor: pointer; }
.radio-option input[type="radio"] { accent-color: var(--accent-cyan); width: 16px; height: 16px; }

/* CHARTS GRID */
.charts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(480px, 1fr)); gap: 1.25rem; margin-bottom: 1.5rem; }
.chart-card { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 16px; padding: 1.25rem; box-shadow: 0 10px 25px rgba(0,0,0,0.4); display: flex; flex-direction: column; }
.chart-title { font-size: 0.95rem; font-weight: 700; color: var(--accent-cyan); margin-bottom: 1rem; text-transform: uppercase; letter-spacing: 0.5px; }
.canvas-box { position: relative; height: 260px; width: 100%; }

.mini-progress-bar { width: 60px; height: 6px; background: rgba(255,255,255,0.1); border-radius: 4px; overflow: hidden; display: inline-block; }
.mini-progress-fill { height: 100%; background: linear-gradient(90deg, var(--accent-cyan), var(--accent-green)); }

.filter-bar-card { padding: 1.1rem 1.25rem; margin-bottom: 1.5rem; }
.filter-bar-wrapper { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.filter-group { display: flex; align-items: center; gap: 0.6rem; flex-grow: 1; min-width: 260px; }
.filter-group label { font-size: 0.85rem; color: var(--accent-cyan); font-weight: 700; margin-bottom: 0; white-space: nowrap; }
.filter-group select { width: 100%; min-height: 42px; background: rgba(0,0,0,0.3); }

.section-head h2 { font-size: 1.15rem; margin-bottom: 1rem; color: #fff; }
.lead-tiles-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 1.25rem; }
.lead-tile { background: var(--tile-bg); border: 1px solid var(--border-color); border-radius: 16px; padding: 1.25rem; display: flex; flex-direction: column; justify-content: space-between; box-shadow: 0 8px 20px rgba(0,0,0,0.4); transition: transform 0.2s, border-color 0.2s; }
.lead-tile:hover { transform: translateY(-3px); border-color: var(--accent-cyan); }

.tile-header { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 1px solid rgba(255,255,255,0.06); padding-bottom: 0.75rem; margin-bottom: 0.75rem; }
.lead-name { font-size: 1.05rem; font-weight: 700; color: #fff; }
.status-pill { font-size: 0.7rem; font-weight: 700; padding: 3px 9px; border-radius: 99px; text-transform: uppercase; letter-spacing: 0.5px; }
.status-pending { background: rgba(255,255,255,0.1); color: #fff; }
.status-interested { background: rgba(16, 185, 129, 0.2); color: var(--accent-green); }
.status-follow-up-needed { background: rgba(245, 158, 11, 0.2); color: var(--accent-warn); }
.status-did-not-receive-the-call { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }

.tile-body { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 1rem; }
.info-row { font-size: 0.88rem; color: #cbd5e1; display: flex; align-items: center; gap: 8px; }
.info-row .icon { font-size: 0.95rem; opacity: 0.8; }
.remark-box { background: rgba(0,0,0,0.3); border-left: 3px solid var(--accent-cyan); padding: 8px 12px; border-radius: 0 8px 8px 0; font-size: 0.82rem; color: #94a3b8; margin-top: 6px; font-style: italic; }

.glass-card { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 16px; padding: 1.5rem; margin-bottom: 1.5rem; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.card-title { font-size: 1.1rem; color: var(--accent-cyan); margin-bottom: 0.3rem; font-weight: 700; }
.card-subtitle { font-size: 0.82rem; color: var(--text-muted); }
.form-group { margin-bottom: 1.1rem; text-align: left; }
label { display: block; font-size: 0.82rem; color: var(--text-muted); margin-bottom: 0.4rem; font-weight: 600; }
input[type="text"], input[type="password"], input[type="number"], input[type="date"], input[type="datetime-local"], input[type="file"], select, textarea { width: 100%; padding: 12px; background: rgba(0,0,0,0.25); border: 1px solid var(--border-color); border-radius: 10px; color: #fff; font-size: 0.9rem; outline: none; transition: border-color 0.2s; }
input:focus, select:focus, textarea:focus { border-color: var(--accent-cyan); }
select option { background-color: #121722; color: #fff; }

.progress-container { width: 100%; background: rgba(255,255,255,0.05); border-radius: 8px; height: 10px; overflow: hidden; margin-top: 1rem; display: none; }
.progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--accent-cyan), var(--accent-green)); transition: width 0.1s; }
.progress-text { font-size: 0.82rem; color: var(--text-muted); margin-top: 6px; }

.terminal-box {
  background: #080a0f;
  color: #39d353;
  border: 1px solid var(--border-color);
  padding: 12px;
  border-radius: 8px;
  max-height: 220px;
  overflow-y: auto;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.78rem;
  line-height: 1.4;
  white-space: pre-wrap;
  margin-top: 6px;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.8);
}

.btn { width: 100%; min-height: 46px; padding: 10px 16px; border: none; border-radius: 10px; font-weight: 700; font-size: 0.9rem; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; transition: transform 0.15s, filter 0.15s; }
.btn:active { transform: scale(0.98); }
.btn-primary { background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue)); color: #000; }
.btn-call { background: linear-gradient(135deg, #10b981, #059669); color: #fff; box-shadow: 0 4px 15px rgba(16, 185, 129, 0.25); }
.btn-secondary { background: rgba(255,255,255,0.05); color: #fff; border: 1px solid var(--border-color); }
.btn-sm { width: auto; min-height: 36px; padding: 6px 16px; font-size: 0.82rem; }

.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0, 0, 0, 0.85); backdrop-filter: blur(8px); z-index: 99999; align-items: center; justify-content: center; padding: 1rem; }
.modal-overlay.active { display: flex !important; }
.modal-card { background: #121722; border: 1px solid var(--border-color); border-radius: 16px; width: 100%; max-width: 440px; padding: 1.5rem; box-shadow: 0 25px 50px rgba(0,0,0,0.8); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.25rem; }
.modal-title { font-size: 1.15rem; color: #fff; font-weight: 700; }
.close-modal { background: none; border: none; color: var(--text-muted); font-size: 1.6rem; cursor: pointer; }

.table-wrapper { overflow-x: auto; border: 1px solid var(--border-color); border-radius: 10px; background: rgba(0,0,0,0.2); }
table { width: 100%; border-collapse: collapse; text-align: left; white-space: nowrap; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--border-color); font-size: 0.85rem; }
th { background: rgba(255,255,255,0.03); color: var(--text-muted); text-transform: uppercase; font-size: 0.72rem; letter-spacing: 0.5px; }

.pagination { display: flex; justify-content: space-between; align-items: center; margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--border-color); }
.page-btn { padding: 8px 16px; background: rgba(255,255,255,0.05); border: 1px solid var(--border-color); color: #fff; border-radius: 8px; text-decoration: none; font-size: 0.85rem; font-weight: 600; }
.page-btn.disabled { opacity: 0.3; pointer-events: none; }

/* RESPONSIVE BREAKPOINTS */
@media (max-width: 900px) {
  body.has-sidebar { padding-left: 0; }
  .burger-btn { display: flex; }
  .sidebar { transform: translateX(-100%); }
  .sidebar.active { transform: translateX(0); }
  .sidebar-toggle-btn { display: block; }
  .charts-grid { grid-template-columns: 1fr; }
  .filter-group { flex-direction: column; align-items: flex-start; min-width: 100%; gap: 0.3rem; }
  .filter-group select { width: 100%; }
  .lead-tiles-grid { grid-template-columns: 1fr; }
}