/* ============================================
   ATLAS SkillTech CRM — Design System
   Slate (#1e293b) + Emerald (#10b981) + Clean White
   ============================================ */

:root {
  --navy: #1e293b;
  --navy-light: #334155;
  --navy-lighter: #475569;
  --lime: #10b981;
  --lime-light: #34d399;
  --lime-dark: #059669;
  --bg: #f8fafc;
  --card: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  --success: #22c55e;
  --success-bg: #f0fdf4;
  --info: #3b82f6;
  --info-bg: #eff6ff;
  --radius: 8px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
  --shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1);
  --transition: 150ms ease;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

/* ---- Layout ---- */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 240px;
  background: var(--navy);
  color: #fff;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 40;
  transition: width var(--transition);
}

.sidebar-logo {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-logo .logo-icon {
  width: 32px; height: 32px;
  background: var(--lime);
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; color: var(--navy);
}
.sidebar-logo h1 { font-size: 14px; font-weight: 700; letter-spacing: -.3px; }
.sidebar-logo small { font-size: 10px; color: rgba(255,255,255,.5); display: block; }

.sidebar-nav { flex: 1; padding: 12px; overflow-y: auto; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 12px; border-radius: var(--radius);
  font-size: 13px; font-weight: 500;
  color: rgba(255,255,255,.65);
  transition: all var(--transition);
  margin-bottom: 1px;
}
.sidebar-nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar-nav a.active { background: var(--lime); color: var(--navy); font-weight: 600; }
.sidebar-nav a svg, .sidebar-nav a .nav-icon {
  width: 18px; height: 18px; flex-shrink: 0; opacity: .8;
}
.sidebar-nav a.active svg, .sidebar-nav a.active .nav-icon { opacity: 1; }

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,.1);
  display: flex; align-items: center; gap: 8px;
}
.sidebar-footer .avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--lime); color: var(--navy);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}
.sidebar-footer .user-info { flex: 1; min-width: 0; }
.sidebar-footer .user-info p { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-footer .user-info span { font-size: 11px; color: rgba(255,255,255,.5); text-transform: capitalize; }

.main-content { margin-left: 0; flex: 1; min-width: 0; }

/* ---- Header ---- */
.header {
  height: 52px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
  position: sticky; top: 0; z-index: 30;
}

.header-search {
  position: relative; max-width: 400px; flex: 1;
}
.header-search input {
  width: 100%; height: 38px;
  padding: 0 12px 0 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px; background: var(--bg);
  transition: border-color var(--transition);
}
.header-search input:focus { outline: none; border-color: var(--lime); }
.header-search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-muted); }

.header-actions { display: flex; align-items: center; gap: 8px; }
.header-btn {
  width: 38px; height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all var(--transition); position: relative;
}
.header-btn:hover { background: var(--bg); }
.header-btn svg { width: 18px; height: 18px; color: var(--text-muted); }
.header-btn .badge-dot {
  position: absolute; top: 6px; right: 6px;
  width: 8px; height: 8px; background: var(--danger);
  border-radius: 50%; border: 2px solid var(--card);
}

/* ---- Header Left (hamburger + search) ---- */
.header-left {
  display: flex; align-items: center; gap: 12px; flex: 1;
}

/* ---- Hamburger Button ---- */
.hamburger-btn {
  display: none;
  width: 40px; height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  align-items: center; justify-content: center;
  cursor: pointer; transition: all var(--transition);
  flex-shrink: 0;
  padding: 0;
}
.hamburger-btn:hover { background: var(--bg); }
.hamburger-btn svg { color: var(--text); }
.hamburger-btn .close-icon { display: none; }
.hamburger-btn.active .hamburger-icon { display: none; }
.hamburger-btn.active .close-icon { display: block; }

/* ---- Sidebar Overlay ---- */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 39;
  opacity: 0;
  transition: opacity .3s ease;
}
.sidebar-overlay.active {
  display: block;
  opacity: 1;
}

.page-content { padding: 18px 20px; }

/* ---- Page Header ---- */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
}
.page-header h2 { font-size: 18px; font-weight: 700; }
.page-header p { color: var(--text-muted); font-size: 12px; margin-top: 2px; }

/* ---- Cards ---- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-header h3 { font-size: 14px; font-weight: 600; }
.card-body { padding: 20px; }
.card-footer { padding: 12px 20px; border-top: 1px solid var(--border); }

/* ---- Stat Cards ---- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { padding: 20px; }
.stat-card .stat-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
}
.stat-card .stat-icon.blue { background: var(--info-bg); color: var(--info); }
.stat-card .stat-icon.green { background: var(--success-bg); color: var(--success); }
.stat-card .stat-icon.orange { background: var(--warning-bg); color: var(--warning); }
.stat-card .stat-icon.red { background: var(--danger-bg); color: var(--danger); }
.stat-card .stat-value { font-size: 22px; font-weight: 700; line-height: 1.2; }
.stat-card .stat-label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  padding: 8px 12px; text-align: left;
  font-size: 11px; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase;
  letter-spacing: .5px;
  background: var(--bg); border-bottom: 1px solid var(--border);
}
tbody td {
  padding: 8px 12px; font-size: 13px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
tbody tr { transition: background var(--transition); }
tbody tr:hover { background: #f1f5f9; }
tbody tr:last-child td { border-bottom: none; }

/* ---- Badges ---- */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 600; line-height: 1.5;
  white-space: nowrap;
}
.badge-primary { background: var(--navy); color: #fff; }
.badge-lime { background: var(--lime); color: #fff; }
.badge-success { background: var(--success-bg); color: #15803d; }
.badge-warning { background: var(--warning-bg); color: #92400e; }
.badge-danger { background: var(--danger-bg); color: #b91c1c; }
.badge-info { background: var(--info-bg); color: #1d4ed8; }
.badge-secondary { background: #f1f5f9; color: var(--text-muted); }
.badge-hot { background: #fef2f2; color: #dc2626; }
.badge-warm { background: #fff7ed; color: #ea580c; }
.badge-cold { background: #eff6ff; color: #2563eb; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 14px; border-radius: var(--radius);
  font-size: 13px; font-weight: 500;
  border: none; cursor: pointer;
  transition: all var(--transition);
  text-decoration: none; line-height: 1.4;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-light); }
.btn-lime { background: var(--lime); color: #fff; }
.btn-lime:hover { background: var(--lime-dark); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { background: var(--bg); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--bg); color: var(--text); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-icon { width: 32px; height: 32px; padding: 0; justify-content: center; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---- Forms ---- */
.form-group { margin-bottom: 12px; }
.form-group label {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--text); margin-bottom: 4px;
}
.form-control {
  width: 100%; height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px; background: var(--card);
  transition: border-color var(--transition);
}
.form-control:focus { outline: none; border-color: var(--lime); box-shadow: 0 0 0 3px rgba(16,185,129,.15); }
textarea.form-control { height: auto; padding: 8px 10px; min-height: 60px; resize: vertical; }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }

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

/* ---- Alerts / Flash ---- */
.alert {
  padding: 12px 16px; border-radius: var(--radius);
  font-size: 14px; margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}
.alert-success { background: var(--success-bg); color: #15803d; border: 1px solid #bbf7d0; }
.alert-danger { background: var(--danger-bg); color: #b91c1c; border: 1px solid #fecaca; }

/* ---- Funnel ---- */
.funnel-bar { margin-bottom: 12px; }
.funnel-bar .funnel-label { display: flex; justify-content: space-between; font-size: 13px; font-weight: 500; margin-bottom: 4px; }
.funnel-bar .funnel-label span { color: var(--text-muted); }
.funnel-track { height: 32px; background: var(--bg); border-radius: 6px; overflow: hidden; }
.funnel-fill { height: 100%; border-radius: 6px; transition: width .6s ease; min-width: 2%; }

/* ---- Activity Timeline ---- */
.timeline { position: relative; padding-left: 24px; }
.timeline::before { content:''; position: absolute; left: 7px; top: 4px; bottom: 4px; width: 2px; background: var(--border); }
.timeline-item { position: relative; margin-bottom: 20px; }
.timeline-item::before {
  content:''; position: absolute; left: -24px; top: 4px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--card); border: 2px solid var(--lime);
}
.timeline-item .time { font-size: 11px; color: var(--text-light); }
.timeline-item .desc { font-size: 13px; margin-top: 2px; }

/* ---- Tabs ---- */
.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: 20px; }
.tab-btn {
  padding: 10px 20px; font-size: 14px; font-weight: 500;
  color: var(--text-muted); background: none; border: none;
  cursor: pointer; border-bottom: 2px solid transparent;
  margin-bottom: -2px; transition: all var(--transition);
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--lime-dark); border-bottom-color: var(--lime); font-weight: 600; }

/* ---- Grid helpers ---- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }

/* ---- Detail Section ---- */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.detail-item label { font-size: 12px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .3px; }
.detail-item p { font-size: 13px; margin-top: 2px; }

/* ============================================
   Lead Detail — Redesigned Layout
   ============================================ */
.ld-page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.ld-page-title { display: flex; align-items: center; gap: 12px; }
.ld-page-title h2 { font-size: 17px; font-weight: 700; margin: 0; }
.ld-nav-arrows { display: flex; gap: 4px; }

.ld-layout { display: flex; gap: 24px; align-items: flex-start; }
.ld-sidebar { width: 280px; min-width: 280px; display: flex; flex-direction: column; gap: 0; }
.ld-content { flex: 1; min-width: 0; }

.ld-profile-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 20px; margin-bottom: 16px; }
.ld-profile-top { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.ld-avatar { width: 38px; height: 38px; border-radius: 50%; background: #dbeafe; color: #3b82f6; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; flex-shrink: 0; }
.ld-profile-name { font-size: 14px; font-weight: 700; margin: 0; }
.ld-profile-stage { font-size: 12px; color: #64748b; margin: 2px 0 0; }
.ld-stage-label { color: #22c55e; font-weight: 600; }
.ld-contact-row { display: flex; flex-direction: column; gap: 8px; padding-bottom: 16px; border-bottom: 1px solid #f1f5f9; }
.ld-contact-item { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #334155; }
.ld-contact-item svg { color: #64748b; flex-shrink: 0; }
.ld-score-row { display: flex; align-items: center; justify-content: space-around; padding-top: 16px; }
.ld-score-item { text-align: center; }
.ld-score-icon { margin-bottom: 4px; }
.ld-score-value { font-size: 20px; font-weight: 700; color: #1e293b; }
.ld-score-label { font-size: 11px; color: #94a3b8; font-weight: 500; }

.ld-sidebar-section { background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; margin-bottom: 16px; overflow: hidden; }
.ld-section-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; cursor: pointer; }
.ld-section-header h4 { font-size: 13px; font-weight: 600; margin: 0; color: #1e293b; }
.ld-section-header svg { transition: transform .2s; color: #64748b; }
.ld-section-collapsed svg { transform: rotate(-90deg); }
.ld-section-body { padding: 0 16px 14px; }
.ld-hidden { display: none !important; }
.ld-detail-row { display: flex; flex-direction: column; margin-bottom: 10px; }
.ld-detail-row:last-child { margin-bottom: 0; }
.ld-detail-label { font-size: 11px; color: #94a3b8; font-weight: 500; text-transform: uppercase; letter-spacing: 0.3px; }
.ld-detail-value { font-size: 13px; color: #1e293b; font-weight: 500; margin-top: 2px; }

.ld-status-bar { display: flex; align-items: center; background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 16px 20px; margin-bottom: 20px; overflow-x: auto; }
.ld-stage-step { display: flex; align-items: center; white-space: nowrap; }
.ld-stage-dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid #cbd5e1; background: #fff; flex-shrink: 0; margin-right: 6px; }
.ld-stage-text { font-size: 12px; color: #94a3b8; font-weight: 500; }
.ld-stage-line { width: 40px; height: 2px; background: #e2e8f0; margin: 0 8px; flex-shrink: 0; }
.ld-stage-done .ld-stage-dot { background: #22c55e; border-color: #22c55e; }
.ld-stage-done .ld-stage-text { color: #22c55e; }
.ld-stage-done .ld-stage-line { background: #22c55e; }
.ld-stage-active .ld-stage-dot { background: #f97316; border-color: #f97316; }
.ld-stage-active .ld-stage-text { color: #f97316; font-weight: 600; }

.ld-tabs { display: flex; gap: 0; border-bottom: 2px solid #e2e8f0; margin-bottom: 0; background: #fff; border-radius: 10px 10px 0 0; padding: 0 8px; }
.ld-tab { display: flex; align-items: center; gap: 6px; padding: 12px 16px; font-size: 13px; font-weight: 500; color: #64748b; background: none; border: none; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all .15s; }
.ld-tab:hover { color: #3b82f6; }
.ld-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: 600; }
.ld-tab svg { flex-shrink: 0; }

.ld-tab-content { display: none; background: #fff; border: 1px solid #e2e8f0; border-top: none; border-radius: 0 0 10px 10px; padding: 20px; }
.ld-tab-content.active { display: block; }

.ld-subtabs { display: flex; gap: 0; margin-bottom: 20px; border-bottom: 1px solid #e2e8f0; }
.ld-subtab { padding: 8px 16px; font-size: 13px; font-weight: 500; color: #64748b; background: none; border: none; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: all .15s; }
.ld-subtab:hover { color: #3b82f6; }
.ld-subtab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: 600; }
.ld-subtab-content { display: none; }
.ld-subtab-content.active { display: block; }

.ld-fields-list { max-width: 700px; }
.ld-field-row { display: flex; align-items: baseline; padding: 10px 0; border-bottom: 1px solid #f8fafc; }
.ld-field-row:last-child { border-bottom: none; }
.ld-field-label { width: 220px; min-width: 220px; font-size: 13px; font-weight: 600; color: #1e293b; }
.ld-field-value { font-size: 13px; color: #475569; }

@media (max-width: 900px) {
  .ld-layout { flex-direction: column; }
  .ld-sidebar { width: 100%; min-width: 0; }
  .ld-status-bar { flex-wrap: wrap; gap: 8px; }
  .ld-stage-line { width: 20px; }
  .ld-tabs { overflow-x: auto; }
  .ld-field-label { width: 160px; min-width: 160px; }
}

/* ---- Timeline ---- */
.tl-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.tl-title { font-size: 18px; font-weight: 700; color: #1e293b; margin: 0; }
.tl-filters { display: flex; gap: 10px; align-items: center; }
.tl-filter-wrap { position: relative; }
.tl-filter-btn { display: flex; align-items: center; gap: 6px; padding: 8px 14px; font-size: 13px; color: #475569; background: #fff; border: 1px solid #cbd5e1; border-radius: 6px; cursor: pointer; white-space: nowrap; }
.tl-filter-btn:hover { border-color: #3b82f6; color: #3b82f6; }
.tl-dropdown { display: none; position: absolute; top: calc(100% + 4px); right: 0; min-width: 220px; background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.12); z-index: 100; padding: 8px 0; }
.tl-dropdown.tl-open { display: block; }
.tl-check-item { display: flex; align-items: center; gap: 10px; padding: 9px 16px; font-size: 14px; color: #1e293b; cursor: pointer; transition: background .1s; }
.tl-check-item:hover { background: #f0f4ff; }
.tl-check-item input[type="checkbox"] { width: 16px; height: 16px; accent-color: #3b82f6; cursor: pointer; }
.tl-dropdown-footer { display: flex; gap: 8px; justify-content: flex-end; padding: 8px 12px; border-top: 1px solid #e2e8f0; margin-top: 4px; }
.tl-dropdown-cancel { padding: 6px 16px; font-size: 13px; background: #fff; border: 1px solid #cbd5e1; border-radius: 6px; cursor: pointer; color: #475569; }
.tl-dropdown-cancel:hover { background: #f8fafc; }
.tl-dropdown-ok { padding: 6px 20px; font-size: 13px; background: #3b82f6; color: #fff; border: none; border-radius: 6px; cursor: pointer; font-weight: 600; }
.tl-dropdown-ok:hover { background: #2563eb; }
.tl-date-dropdown { min-width: 200px; }
.tl-date-option { padding: 9px 16px; font-size: 14px; color: #1e293b; cursor: pointer; transition: background .1s; }
.tl-date-option:hover { background: #f0f4ff; }
.tl-date-option.tl-date-active { background: #3b82f6; color: #fff; }
.tl-custom-range { display: flex; gap: 8px; padding: 8px 12px; }
.tl-custom-range input { font-size: 12px; padding: 4px 8px; }

/* Timeline list */
.tl-list { position: relative; }
.tl-loading { text-align: center; padding: 40px; color: #94a3b8; font-size: 14px; }
.tl-empty { text-align: center; padding: 40px; color: #94a3b8; font-size: 14px; }

/* Timeline entry row */
.tl-entry { display: flex; align-items: flex-start; gap: 16px; padding: 14px 0; border-bottom: 1px solid #f1f5f9; }
.tl-entry:last-child { border-bottom: none; }
.tl-entry-date { min-width: 80px; max-width: 80px; text-align: left; }
.tl-entry-date .tl-date-main { font-size: 13px; font-weight: 600; color: #1e293b; line-height: 1.3; }
.tl-entry-date .tl-date-time { font-size: 11px; color: #94a3b8; }
.tl-entry-icon { width: 32px; height: 32px; min-width: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #f1f5f9; color: #64748b; margin-top: 2px; }
.tl-entry-icon.tl-icon-email { background: #eff6ff; color: #3b82f6; }
.tl-entry-icon.tl-icon-sms { background: #eff6ff; color: #3b82f6; }
.tl-entry-icon.tl-icon-call { background: #f0fdf4; color: #22c55e; }
.tl-entry-icon.tl-icon-assignment { background: #fef3c7; color: #f59e0b; }
.tl-entry-icon.tl-icon-status { background: #f3e8ff; color: #a855f7; }
.tl-entry-icon.tl-icon-api { background: #f1f5f9; color: #64748b; }
.tl-entry-icon.tl-icon-registration { background: #f1f5f9; color: #64748b; }
.tl-entry-icon.tl-icon-create { background: #ecfdf5; color: #10b981; }
.tl-entry-body { flex: 1; min-width: 0; font-size: 13px; color: #334155; line-height: 1.6; }
.tl-entry-body strong { font-weight: 600; color: #1e293b; }
.tl-entry-body a { color: #3b82f6; text-decoration: none; }
.tl-entry-body a:hover { text-decoration: underline; }
.tl-entry-body .tl-meta { color: #f59e0b; font-size: 12px; }
.tl-entry-body .tl-meta a { color: #f59e0b; }
.tl-entry-score { min-width: 40px; text-align: right; font-size: 13px; font-weight: 700; padding-top: 2px; }
.tl-entry-score.tl-score-pos { color: #3b82f6; }
.tl-entry-score.tl-score-neg { color: #ef4444; }
.tl-entry-score.tl-score-zero { color: #94a3b8; }

.tl-load-more-btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 24px; font-size: 13px; font-weight: 600; color: #3b82f6; background: #fff; border: 1px solid #3b82f6; border-radius: 8px; cursor: pointer; transition: all .15s; }
.tl-load-more-btn:hover { background: #eff6ff; }

@media (max-width: 768px) {
  .tl-header { flex-direction: column; align-items: flex-start; gap: 10px; }
  .tl-entry { flex-wrap: wrap; gap: 8px; }
  .tl-entry-date { min-width: auto; max-width: none; }
}

/* ---- Login ---- */
.login-page {
  min-height: 100vh; display: flex; align-items: stretch;
  background: linear-gradient(-45deg, #1e293b, #0f172a, #134e4a, #1e3a5f, #1e293b);
  background-size: 400% 400%;
  animation: loginGradient 15s ease infinite;
  position: relative; overflow: hidden;
}
@keyframes loginGradient {
  0% { background-position: 0% 50%; }
  25% { background-position: 100% 50%; }
  50% { background-position: 100% 100%; }
  75% { background-position: 0% 100%; }
  100% { background-position: 0% 50%; }
}

/* Floating orbs */
.login-orb {
  position: absolute; border-radius: 50%;
  filter: blur(80px); opacity: 0.3;
  pointer-events: none;
}
.login-orb-1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(16,185,129,0.5), transparent 70%);
  top: -150px; right: -100px;
  animation: orbFloat1 8s ease-in-out infinite;
}
.login-orb-2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(59,130,246,0.4), transparent 70%);
  bottom: -120px; left: -80px;
  animation: orbFloat2 10s ease-in-out infinite;
}
.login-orb-3 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(139,92,246,0.3), transparent 70%);
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  animation: orbFloat3 12s ease-in-out infinite;
}
@keyframes orbFloat1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-40px, 30px) scale(1.1); }
  66% { transform: translate(20px, -20px) scale(0.95); }
}
@keyframes orbFloat2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -40px) scale(1.05); }
  66% { transform: translate(-20px, 20px) scale(0.9); }
}
@keyframes orbFloat3 {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.2); }
}

/* Grid overlay */
.login-grid-overlay {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}

/* Floating particles */
.login-particles {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden;
}
.login-particle {
  position: absolute; width: 4px; height: 4px;
  background: rgba(16,185,129,0.6); border-radius: 50%;
  animation: particleRise linear infinite;
}
.login-particle:nth-child(1) { left: 10%; animation-duration: 12s; animation-delay: 0s; width: 3px; height: 3px; }
.login-particle:nth-child(2) { left: 25%; animation-duration: 15s; animation-delay: 2s; width: 5px; height: 5px; background: rgba(59,130,246,0.5); }
.login-particle:nth-child(3) { left: 40%; animation-duration: 10s; animation-delay: 4s; }
.login-particle:nth-child(4) { left: 55%; animation-duration: 14s; animation-delay: 1s; width: 3px; height: 3px; background: rgba(139,92,246,0.5); }
.login-particle:nth-child(5) { left: 70%; animation-duration: 11s; animation-delay: 3s; width: 5px; height: 5px; }
.login-particle:nth-child(6) { left: 85%; animation-duration: 13s; animation-delay: 5s; width: 3px; height: 3px; background: rgba(59,130,246,0.4); }
.login-particle:nth-child(7) { left: 15%; animation-duration: 16s; animation-delay: 7s; background: rgba(139,92,246,0.4); }
.login-particle:nth-child(8) { left: 60%; animation-duration: 9s; animation-delay: 2s; width: 6px; height: 6px; }
@keyframes particleRise {
  0% { bottom: -10px; opacity: 0; transform: translateX(0); }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { bottom: 105%; opacity: 0; transform: translateX(30px); }
}

/* Split layout */
.login-split {
  display: flex; width: 100%; min-height: 100vh; position: relative; z-index: 10;
}

/* Left showcase panel */
.login-showcase {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 60px 48px; position: relative;
}
.login-showcase-content {
  max-width: 480px; animation: loginSlideRight 0.8s ease-out;
}
@keyframes loginSlideRight {
  from { opacity: 0; transform: translateX(-30px); }
  to { opacity: 1; transform: translateX(0); }
}
.login-showcase-brand {
  display: flex; align-items: center; gap: 10px; margin-bottom: 40px;
}
.login-showcase-logo {
  width: 40px; height: 40px; background: var(--lime); border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 800; color: white;
  box-shadow: 0 4px 16px rgba(16,185,129,0.35);
}
.login-showcase-brand span {
  font-size: 16px; font-weight: 700; color: rgba(255,255,255,0.9); letter-spacing: -0.3px;
}
.login-showcase-title {
  font-size: 44px; font-weight: 800; color: #fff; line-height: 1.15;
  margin-bottom: 20px; letter-spacing: -1px;
}
.login-showcase-title span { color: var(--lime-light); }
.login-showcase-desc {
  font-size: 16px; color: rgba(255,255,255,0.55); line-height: 1.7;
  margin-bottom: 36px;
}

/* Feature cards */
.login-features { display: flex; flex-direction: column; gap: 12px; margin-bottom: 36px; }
.login-feature {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  backdrop-filter: blur(8px);
  transition: all 0.3s ease;
}
.login-feature:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.15);
  transform: translateX(4px);
}
.login-feature-1 { animation: loginFeatureIn 0.6s ease-out 0.3s both; }
.login-feature-2 { animation: loginFeatureIn 0.6s ease-out 0.5s both; }
.login-feature-3 { animation: loginFeatureIn 0.6s ease-out 0.7s both; }
@keyframes loginFeatureIn {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}
.login-feature-icon {
  width: 42px; height: 42px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.login-feature strong {
  display: block; font-size: 14px; font-weight: 600; color: #fff; margin-bottom: 1px;
}
.login-feature span {
  font-size: 12px; color: rgba(255,255,255,0.45);
}

/* Stats ticker */
.login-stats-ticker {
  display: flex; align-items: center; gap: 24px;
  padding: 20px 24px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  animation: loginFeatureIn 0.6s ease-out 0.9s both;
}
.login-ticker-item { text-align: center; flex: 1; }
.login-ticker-value {
  font-size: 26px; font-weight: 800; color: var(--lime-light);
  line-height: 1.2;
}
.login-ticker-value small { font-size: 16px; font-weight: 600; }
.login-ticker-label {
  font-size: 11px; color: rgba(255,255,255,0.4);
  text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; margin-top: 4px;
}
.login-ticker-divider {
  width: 1px; height: 36px; background: rgba(255,255,255,0.1); flex-shrink: 0;
}

/* Right form side */
.login-form-side {
  width: 480px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 40px;
  background: rgba(255,255,255,0.03);
  backdrop-filter: blur(4px);
  border-left: 1px solid rgba(255,255,255,0.06);
}

.login-card {
  width: 100%; max-width: 380px;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.35), 0 0 0 1px rgba(255,255,255,0.1);
  padding: 36px;
  animation: loginCardEntry 0.6s ease-out 0.2s both;
}
@keyframes loginCardEntry {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Card header */
.login-card-header {
  text-align: center; margin-bottom: 28px;
}
.login-card-icon {
  width: 52px; height: 52px; margin: 0 auto 14px;
  background: linear-gradient(135deg, var(--lime), #059669);
  border-radius: 14px; display: flex; align-items: center; justify-content: center;
  color: white;
  box-shadow: 0 8px 24px rgba(16,185,129,0.3);
  animation: loginIconPulse 3s ease-in-out infinite;
}
@keyframes loginIconPulse {
  0%, 100% { box-shadow: 0 8px 24px rgba(16,185,129,0.3); }
  50% { box-shadow: 0 8px 32px rgba(16,185,129,0.5); }
}
.login-card-header h1 {
  font-size: 22px; font-weight: 700; color: var(--text); margin-bottom: 4px;
}
.login-card-header p {
  font-size: 13px; color: var(--text-muted);
}

/* Form inputs */
.login-form { display: flex; flex-direction: column; gap: 16px; }
.login-input-group {
  position: relative;
}
.login-input-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--text-light); z-index: 1; display: flex;
  transition: color 0.2s ease;
}
.login-input {
  width: 100%; height: 48px;
  padding: 0 14px 0 44px;
  border: 1.5px solid var(--border);
  border-radius: 12px; font-size: 14px;
  background: var(--bg); color: var(--text);
  font-family: inherit;
  transition: all 0.2s ease;
}
.login-input:focus {
  outline: none; border-color: var(--lime);
  box-shadow: 0 0 0 3px rgba(16,185,129,0.12);
  background: #fff;
}
.login-input:focus ~ .login-input-label {
  opacity: 1; transform: translateY(-28px) scale(0.85);
  color: var(--lime-dark);
}
.login-input:not(:placeholder-shown) ~ .login-input-label {
  opacity: 1; transform: translateY(-28px) scale(0.85);
}
.login-input-group:focus-within .login-input-icon { color: var(--lime); }
.login-input-label {
  position: absolute; left: 44px; top: 50%; transform: translateY(-50%);
  font-size: 13px; color: var(--text-muted); pointer-events: none;
  transition: all 0.2s ease; opacity: 0;
  background: #fff; padding: 0 4px;
}

/* Submit button */
.login-submit-btn {
  width: 100%; height: 48px; margin-top: 4px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(135deg, var(--lime), #059669);
  color: white; border: none; border-radius: 12px;
  font-size: 15px; font-weight: 600; font-family: inherit;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 16px rgba(16,185,129,0.3);
}
.login-submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(16,185,129,0.4);
}
.login-submit-btn:active {
  transform: translateY(0);
}
.login-submit-btn svg {
  transition: transform 0.2s ease;
}
.login-submit-btn:hover svg {
  transform: translateX(3px);
}

/* Footer */
.login-footer-text {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin-top: 24px; font-size: 11px; color: var(--text-light);
}

/* Legacy support - keep old classes functional */
.login-card .login-logo { text-align: center; margin-bottom: 32px; }
.login-card .login-logo .logo-icon {
  width: 56px; height: 56px; margin: 0 auto 12px;
  background: var(--lime); border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 800; color: white;
  box-shadow: 0 8px 24px rgba(16,185,129,0.3);
}
.login-card .login-logo h1 { font-size: 20px; font-weight: 700; }
.login-card .login-logo p { font-size: 14px; color: var(--text-muted); }

/* ---- Login Responsive ---- */
@media (max-width: 1024px) {
  .login-showcase { display: none; }
  .login-split { justify-content: center; }
  .login-form-side {
    width: 100%; max-width: 100%;
    border-left: none; background: transparent;
  }
}
@media (max-width: 480px) {
  .login-form-side { padding: 24px 16px; }
  .login-card { padding: 28px 24px; border-radius: 16px; }
  .login-showcase-title { font-size: 32px; }
}

/* ---- Score bar ---- */
.score-bar { display: flex; align-items: center; gap: 8px; }
.score-bar .bar { flex: 1; height: 6px; background: var(--bg); border-radius: 3px; overflow: hidden; }
.score-bar .bar-fill { height: 100%; border-radius: 3px; }
.score-bar .bar-fill.hot { background: var(--danger); }
.score-bar .bar-fill.warm { background: var(--warning); }
.score-bar .bar-fill.cold { background: var(--info); }

/* ---- Pagination ---- */
.pagination {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-top: 1px solid var(--border);
}
.pagination .page-info { font-size: 13px; color: var(--text-muted); }
.pagination .page-btns { display: flex; gap: 6px; }

/* ---- Sortable columns ---- */
.sortable-th:hover { background: var(--bg-muted, #f5f5f5); }
.sortable-th.sorted { color: var(--navy, #1a2b4a); }
.sort-arrows { display: inline-flex; flex-direction: column; line-height: 0.7; vertical-align: middle; }

/* ---- Filter bar ---- */
.filter-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  padding: 16px 20px;
}
.filter-bar .form-control { width: auto; min-width: 160px; height: 38px; font-size: 13px; }

/* ---- Empty state ---- */
.empty-state {
  text-align: center; padding: 48px 20px;
  color: var(--text-muted); font-size: 14px;
}
.empty-state svg { width: 48px; height: 48px; margin: 0 auto 12px; opacity: .3; }

/* ---- Modal Overlay (simple) ---- */
.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 50;
  background: rgba(0,0,0,.45); align-items: center; justify-content: center;
  padding: 24px;
}
.modal-overlay.open { display: flex; }
.modal, .modal-box {
  background: var(--card); border-radius: 12px;
  width: 95%; max-width: 640px; max-height: 85vh;
  box-shadow: var(--shadow-md);
  display: flex; flex-direction: column; overflow: hidden;
}
.modal-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.modal-header h3 { font-size: 16px; font-weight: 700; margin: 0; }
.modal-close { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--text-muted); line-height: 1; }
.modal-close:hover { color: var(--text); }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 14px 20px; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 8px;
  flex-shrink: 0; background: var(--bg);
}

/* ---- Master Data Breadcrumb ---- */
.md-breadcrumb {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 12px 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
}
.md-breadcrumb-home {
  color: var(--text-muted);
  display: flex; align-items: center;
  transition: color var(--transition);
}
.md-breadcrumb-home:hover { color: var(--info); }
.md-breadcrumb-sep { color: var(--text-light); display: flex; align-items: center; }
.md-breadcrumb-link {
  color: var(--info); font-weight: 500;
  transition: color var(--transition);
  max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.md-breadcrumb-link:hover { color: var(--lime-dark); text-decoration: underline; }
.md-breadcrumb-current { font-weight: 600; color: var(--text); }

/* ---- Master Data Values Header ---- */
.md-values-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.md-values-count { font-size: 14px; font-weight: 600; color: var(--text); }

/* ---- Toggle Switch ---- */
.md-toggle { position: relative; display: inline-block; width: 44px; height: 24px; cursor: pointer; }
.md-toggle input { opacity: 0; width: 0; height: 0; }
.md-toggle-slider {
  position: absolute; inset: 0;
  background: #cbd5e1; border-radius: 24px;
  transition: background var(--transition);
}
.md-toggle-slider::before {
  content: ''; position: absolute;
  width: 18px; height: 18px;
  left: 3px; top: 3px;
  background: #fff; border-radius: 50%;
  transition: transform var(--transition);
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
}
.md-toggle input:checked + .md-toggle-slider { background: var(--info); }
.md-toggle input:checked + .md-toggle-slider::before { transform: translateX(20px); }

/* ---- Master Data Action Dropdown ---- */
.md-dropdown { position: relative; }
.md-dropdown-trigger { position: relative; z-index: 1; }
.md-dropdown-menu {
  display: none;
  position: fixed;
  min-width: 230px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 30px rgba(0,0,0,.15);
  z-index: 100;
  padding: 6px 0;
}
.md-dropdown-menu.open { display: block; }
.md-dropdown-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 9px 16px;
  font-size: 13px; font-weight: 500;
  color: var(--text); background: none; border: none;
  cursor: pointer; text-align: left;
  transition: background var(--transition);
  text-decoration: none;
}
.md-dropdown-item:hover { background: var(--bg); }
.md-dropdown-item svg { flex-shrink: 0; color: var(--text-muted); }
.md-dropdown-danger { color: var(--danger); }
.md-dropdown-danger svg { color: var(--danger); }
.md-dropdown-danger:hover { background: var(--danger-bg); }
.md-dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ---- Settings Page ---- */
.settings-layout { display: grid; grid-template-columns: 240px 1fr; gap: 24px; }
.settings-nav {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 8px; position: sticky; top: 88px; max-height: calc(100vh - 112px); overflow-y: auto;
  box-shadow: var(--shadow-sm);
}
.settings-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 6px;
  font-size: 13px; font-weight: 500; color: var(--text-muted);
  transition: all var(--transition); cursor: pointer; margin-bottom: 2px;
}
.settings-nav-item:hover { background: var(--bg); color: var(--text); }
.settings-nav-item.active { background: rgba(16,185,129,.1); color: var(--lime-dark); font-weight: 600; }
.settings-nav-item svg { flex-shrink: 0; width: 18px; height: 18px; opacity: .7; }
.settings-nav-item.active svg { opacity: 1; }
.settings-nav-divider { height: 1px; background: var(--border); margin: 8px 6px; }
.settings-nav-label {
  display: block; padding: 8px 14px 4px;
  font-size: 11px; font-weight: 700; color: var(--text-light);
  text-transform: uppercase; letter-spacing: .5px;
}
.settings-content { min-width: 0; }
.settings-desc { font-size: 13px; color: var(--text-muted); margin-bottom: 20px; line-height: 1.5; }
.settings-score-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 14px; border: 1px solid var(--border); border-radius: var(--radius);
}
.settings-score-row label { font-size: 13px; font-weight: 500; margin-bottom: 0; }
.settings-score-row .form-control { height: 34px; font-size: 13px; }

@media (max-width: 1024px) {
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { position: static; max-height: none; display: flex; flex-wrap: wrap; gap: 4px; }
  .settings-nav-divider { display: none; }
  .settings-nav-label { display: none; }
  .settings-nav-item { padding: 8px 12px; font-size: 12px; }
}


/* ============================================
   HOME / LANDING PAGE — Modern Design
   ============================================ */

.home-container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ── Scroll reveal ── */
.scroll-reveal {
  opacity: 0; transform: translateY(28px);
  transition: opacity 0.7s cubic-bezier(0.22,1,0.36,1), transform 0.7s cubic-bezier(0.22,1,0.36,1);
}
.scroll-reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ── Scroll progress ── */
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0;
  background: linear-gradient(90deg, #10b981, #34d399, #6ee7b7);
  z-index: 9999; transition: width 0.05s linear;
  box-shadow: 0 0 8px rgba(16,185,129,0.5);
}

/* ── Nav ── */
.home-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(15,23,42,0.8); backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid rgba(255,255,255,0.06); height: 64px;
}
.home-nav .home-container { display: flex; align-items: center; justify-content: space-between; height: 100%; }
.home-nav-brand { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 700; color: #fff; }
.home-nav-brand .logo-icon {
  width: 32px; height: 32px; background: var(--lime); border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px; color: #fff;
}
.home-nav-links { display: flex; align-items: center; gap: 32px; }
.home-nav-links a {
  font-size: 13px; font-weight: 500; color: rgba(255,255,255,0.6);
  transition: color 0.2s; letter-spacing: -0.01em;
}
.home-nav-links a:hover { color: #fff; }
.home-nav-actions { display: flex; align-items: center; gap: 10px; }
.home-btn-outline { border-color: rgba(255,255,255,0.2) !important; color: #fff !important; font-size: 13px !important; padding: 7px 16px !important; }
.home-btn-outline:hover { background: rgba(255,255,255,0.06) !important; }
.home-menu-toggle { display: none; background: none; border: none; color: #fff; cursor: pointer; }

/* ── Hero ── */
.home-hero {
  padding: 130px 0 60px; position: relative; overflow: visible;
  background: #0b1120;
}
.home-hero::before {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 1px;
  background: rgba(255,255,255,0.06);
}
.hero-bg-wrap { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.hero-glow {
  position: absolute; border-radius: 50%; filter: blur(100px); pointer-events: none;
}
.hero-glow-1 {
  width: 700px; height: 700px; top: -250px; right: -200px;
  background: radial-gradient(circle, rgba(16,185,129,0.25), transparent 70%);
  animation: glowDrift1 12s ease-in-out infinite;
}
.hero-glow-2 {
  width: 500px; height: 500px; bottom: -200px; left: -150px;
  background: radial-gradient(circle, rgba(59,130,246,0.2), transparent 70%);
  animation: glowDrift2 15s ease-in-out infinite;
}
.hero-glow-3 {
  width: 400px; height: 400px; top: 40%; left: 40%;
  background: radial-gradient(circle, rgba(139,92,246,0.15), transparent 70%);
  animation: glowDrift3 18s ease-in-out infinite;
}
@keyframes glowDrift1 { 0%,100%{transform:translate(0,0)} 50%{transform:translate(-60px,40px)} }
@keyframes glowDrift2 { 0%,100%{transform:translate(0,0)} 50%{transform:translate(50px,-50px)} }
@keyframes glowDrift3 { 0%,100%{transform:translate(-50%,-50%) scale(1)} 50%{transform:translate(-50%,-50%) scale(1.3)} }

.hero-grid-bg {
  position: absolute; inset: 0; pointer-events: none; opacity: 0.4;
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, #000 20%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, #000 20%, transparent 100%);
}

/* Hero particles */
.hero-particles { position: absolute; inset: 0; pointer-events: none; }
.hero-particles span {
  position: absolute; border-radius: 50%; background: rgba(16,185,129,0.5);
  animation: particleDrift linear infinite;
}
.hero-particles span:nth-child(1) { width:3px; height:3px; left:10%; animation-duration:16s; }
.hero-particles span:nth-child(2) { width:4px; height:4px; left:22%; animation-duration:20s; animation-delay:3s; background:rgba(59,130,246,0.5); }
.hero-particles span:nth-child(3) { width:3px; height:3px; left:35%; animation-duration:14s; animation-delay:1s; }
.hero-particles span:nth-child(4) { width:5px; height:5px; left:48%; animation-duration:18s; animation-delay:5s; background:rgba(139,92,246,0.4); }
.hero-particles span:nth-child(5) { width:3px; height:3px; left:60%; animation-duration:22s; animation-delay:2s; }
.hero-particles span:nth-child(6) { width:4px; height:4px; left:72%; animation-duration:15s; animation-delay:7s; background:rgba(59,130,246,0.4); }
.hero-particles span:nth-child(7) { width:3px; height:3px; left:82%; animation-duration:19s; animation-delay:4s; }
.hero-particles span:nth-child(8) { width:5px; height:5px; left:90%; animation-duration:17s; animation-delay:6s; background:rgba(245,158,11,0.3); }
.hero-particles span:nth-child(9) { width:3px; height:3px; left:5%;  animation-duration:21s; animation-delay:8s; background:rgba(139,92,246,0.3); }
.hero-particles span:nth-child(10){ width:4px; height:4px; left:50%; animation-duration:13s; animation-delay:9s; }
@keyframes particleDrift {
  0%{bottom:-8px;opacity:0;transform:translateX(0)}
  8%{opacity:0.8}
  50%{transform:translateX(25px)}
  92%{opacity:0.6}
  100%{bottom:110%;opacity:0;transform:translateX(-15px)}
}

/* Hero inner */
.hero-inner {
  display: grid; grid-template-columns: 1fr 1.15fr; gap: 48px; align-items: center;
  position: relative; z-index: 2;
}

/* Hero text */
.hero-text { animation: heroTextIn 0.8s ease-out both; }
@keyframes heroTextIn { from{opacity:0;transform:translateY(30px)} to{opacity:1;transform:translateY(0)} }

.hero-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 14px 5px 10px; border-radius: 999px;
  background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.2);
  font-size: 12px; font-weight: 600; color: var(--lime-light);
  margin-bottom: 24px; cursor: default;
  transition: background 0.2s;
}
.hero-pill:hover { background: rgba(16,185,129,0.18); }
.hero-pill-dot {
  width: 7px; height: 7px; border-radius: 50%; background: #34d399;
  animation: dotPulse 2s ease-in-out infinite;
}
@keyframes dotPulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:0.4;transform:scale(0.8)} }
.hero-pill svg { opacity: 0.6; }

.hero-h1 {
  font-size: 52px; font-weight: 800; line-height: 1.1; color: #fff;
  letter-spacing: -1.5px; margin-bottom: 20px;
}
.hero-gradient-text {
  background: linear-gradient(135deg, #34d399, #6ee7b7, #34d399, #10b981);
  background-size: 300% auto;
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  animation: shimmerText 4s linear infinite;
}
@keyframes shimmerText { 0%{background-position:0% center} 100%{background-position:300% center} }

.hero-sub {
  font-size: 17px; line-height: 1.7; color: rgba(255,255,255,0.5);
  max-width: 480px; margin-bottom: 32px; letter-spacing: -0.01em;
}

/* Hero buttons */
.hero-actions { display: flex; align-items: center; gap: 14px; margin-bottom: 36px; flex-wrap: wrap; }
.hero-btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px; border-radius: 10px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff; font-size: 14px; font-weight: 600; font-family: inherit;
  text-decoration: none; border: none; cursor: pointer;
  box-shadow: 0 4px 20px rgba(16,185,129,0.3), inset 0 1px 0 rgba(255,255,255,0.15);
  transition: all 0.25s ease;
}
.hero-btn-primary:hover { box-shadow: 0 8px 30px rgba(16,185,129,0.4); transform: translateY(-2px); }
.hero-btn-primary svg { transition: transform 0.2s; }
.hero-btn-primary:hover svg { transform: translateX(3px); }

.hero-btn-secondary {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: 10px;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.8); font-size: 14px; font-weight: 500;
  text-decoration: none; transition: all 0.2s;
}
.hero-btn-secondary:hover { background: rgba(255,255,255,0.1); color: #fff; }

/* Social proof */
.hero-social-proof { display: flex; align-items: center; gap: 14px; }
.hero-avatars { display: flex; }
.hero-av {
  width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff; margin-left: -6px;
  border: 2px solid #0b1120;
}
.hero-av:first-child { margin-left: 0; }
.hero-proof-text { font-size: 12px; color: rgba(255,255,255,0.5); line-height: 1.4; }
.hero-proof-text strong { color: rgba(255,255,255,0.85); }
.hero-stars { display: flex; gap: 1px; margin-top: 2px; }

/* ── Hero mockup ── */
.hero-visual {
  animation: mockupIn 1s cubic-bezier(0.22,1,0.36,1) 0.3s both;
  position: relative; padding: 30px 40px 30px 30px;
}
@keyframes mockupIn { from{opacity:0;transform:perspective(1200px) rotateX(6deg) rotateY(-8deg) translateY(50px)} to{opacity:1;transform:perspective(1200px) rotateX(2deg) rotateY(-3deg)} }

.hero-mockup {
  background: #fff; border-radius: 12px; overflow: visible; position: relative;
  box-shadow: 0 40px 80px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.06), 0 0 60px rgba(16,185,129,0.08);
  transform: perspective(1200px) rotateX(2deg) rotateY(-3deg);
  transition: transform 0.3s ease;
  font-size: 0; /* reset for tight layout */
}
.hm-body, .hm-bar, .hm-body * { font-size: 14px; }
.hm-bar {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  background: #f1f5f9; border-bottom: 1px solid #e2e8f0;
}
.hm-dots { display: flex; gap: 5px; }
.hm-dots span { width: 8px; height: 8px; border-radius: 50%; }
.hm-dots span:nth-child(1) { background: #ef4444; }
.hm-dots span:nth-child(2) { background: #f59e0b; }
.hm-dots span:nth-child(3) { background: #22c55e; }
.hm-title { font-size: 11px; font-weight: 600; color: #94a3b8; }
.hm-body { padding: 12px; }

/* Mockup header extras */
.hm-bar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.hm-bar-avatar { width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 700; color: #fff; }

/* Mockup stat cards */
.hm-stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.hm-stat {
  padding: 10px; border-radius: 8px; background: #f8fafc; border: 1px solid #e2e8f0;
  opacity: 0; animation: hmCardIn 0.5s ease-out forwards; position: relative; overflow: hidden;
}
.hm-stat-1 { animation-delay: 0.6s; }
.hm-stat-2 { animation-delay: 0.75s; }
.hm-stat-3 { animation-delay: 0.9s; }
.hm-stat-4 { animation-delay: 1.05s; }
@keyframes hmCardIn { from{opacity:0;transform:translateY(10px)} to{opacity:1;transform:translateY(0)} }
.hm-stat-icon-sm { width: 24px; height: 24px; border-radius: 6px; display: flex; align-items: center; justify-content: center; margin-bottom: 6px; }
.hm-stat-num { font-size: 16px; font-weight: 800; color: #1e293b; line-height: 1.2; }
.hm-stat-lbl { font-size: 9px; color: #94a3b8; margin-top: 1px; }
.hm-stat-trend { display: flex; align-items: center; gap: 3px; font-size: 9px; font-weight: 700; margin-top: 4px; }
.hm-stat-trend.up { color: #10b981; }
.hm-mini-spark { position: absolute; bottom: 4px; right: 4px; opacity: 0.6; }

/* Two-column row */
.hm-row-2 { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 10px; margin-bottom: 12px; }

/* Mockup funnel */
.hm-pipeline { }
.hm-pipe-title { font-size: 9px; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.hm-pipe-bars { display: flex; flex-direction: column; gap: 3px; }
.hm-pipe {
  height: 22px; border-radius: 5px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 8px; color: #fff; font-size: 9px; font-weight: 600;
  width: var(--w); background: var(--c);
  transform-origin: left; transform: scaleX(0);
  animation: pipeGrow 0.7s cubic-bezier(0.22,1,0.36,1) var(--d) forwards;
}
@keyframes pipeGrow { to { transform: scaleX(1); } }

/* Donut chart */
.hm-donut-wrap { display: flex; flex-direction: column; align-items: center; }
.hm-donut { position: relative; width: 70px; height: 70px; margin: 0 auto 6px; }
.hm-donut-svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.hm-donut-seg { opacity: 0; animation: donutIn 0.8s ease-out forwards; }
.hm-donut-seg:nth-child(2) { animation-delay: 0.8s; }
.hm-donut-seg:nth-child(3) { animation-delay: 1s; }
.hm-donut-seg:nth-child(4) { animation-delay: 1.2s; }
.hm-donut-seg:nth-child(5) { animation-delay: 1.4s; }
@keyframes donutIn { to { opacity: 1; } }
.hm-donut-center {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  font-size: 12px; font-weight: 800; color: #1e293b;
}
.hm-donut-legend { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 8px; font-size: 8px; color: #64748b; }
.hm-donut-legend div { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.hm-donut-legend span { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }

/* Mini leads table */
.hm-leads-table { margin-bottom: 12px; }
.hm-table { border: 1px solid #e2e8f0; border-radius: 6px; overflow: hidden; }
.hm-trow { display: grid; grid-template-columns: 2fr 1.2fr 1fr 0.6fr; padding: 5px 8px; font-size: 9px; align-items: center; }
.hm-thead { background: #f1f5f9; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.3px; font-size: 8px; }
.hm-trow:not(.hm-thead) { border-top: 1px solid #f1f5f9; color: #334155; }
.hm-trow:not(.hm-thead) span:first-child { display: flex; align-items: center; gap: 5px; font-weight: 600; }
.hm-tav { width: 18px; height: 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 7px; font-weight: 700; color: #fff; flex-shrink: 0; }
.hm-tsrc { color: #64748b; }
.hm-tbadge { padding: 1px 6px; border-radius: 4px; font-size: 8px; font-weight: 600; }
.hm-b-new { background: #eff6ff; color: #3b82f6; }
.hm-b-contacted { background: #faf5ff; color: #8b5cf6; }
.hm-b-applied { background: #fffbeb; color: #f59e0b; }
.hm-b-enrolled { background: #ecfdf5; color: #10b981; }
.hm-tscore { font-weight: 700; color: #1e293b; }
.hm-trow-1 { opacity: 0; animation: hmCardIn 0.4s ease-out 1.2s forwards; }
.hm-trow-2 { opacity: 0; animation: hmCardIn 0.4s ease-out 1.35s forwards; }
.hm-trow-3 { opacity: 0; animation: hmCardIn 0.4s ease-out 1.5s forwards; }
.hm-trow-4 { opacity: 0; animation: hmCardIn 0.4s ease-out 1.65s forwards; }

/* Mockup chart */
.hm-chart { }
.hm-chart-title { font-size: 9px; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.hm-chart-bars { display: flex; align-items: flex-end; gap: 5px; height: 60px; }
.hm-bar-col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.hm-bar-fill {
  width: 100%; border-radius: 3px 3px 0 0; height: 0;
  background: linear-gradient(180deg, #10b981, #059669);
  animation: barGrow 0.6s cubic-bezier(0.22,1,0.36,1) calc(1.2s + var(--h, 0) * 0.01s) forwards;
}
@keyframes barGrow { to { height: var(--h); } }
.hm-bar-col span { font-size: 8px; color: #94a3b8; margin-top: 3px; }

/* Floating notification cards */
.hm-notif, .hm-activity, .hm-float-score, .hm-float-task {
  position: absolute; display: flex; align-items: center; gap: 8px;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 8px 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12); font-size: 10px; color: #1e293b;
  white-space: nowrap;
}
.hm-notif {
  top: 25%; right: -36px;
  animation: floatIn 0.5s ease-out 2.2s both, floatBob 3s ease-in-out 2.7s infinite;
}
.hm-activity {
  bottom: 30%; left: -30px;
  animation: floatIn 0.5s ease-out 3s both, floatBob2 3.5s ease-in-out 3.5s infinite;
}
.hm-float-score {
  top: 55%; right: -40px;
  animation: floatIn 0.5s ease-out 3.8s both, floatBob 4s ease-in-out 4.3s infinite;
}
.hm-float-task {
  bottom: 8%; left: -26px;
  animation: floatIn 0.5s ease-out 4.5s both, floatBob2 3.2s ease-in-out 5s infinite;
}
@keyframes floatIn { from{opacity:0;scale:0.9} to{opacity:1;scale:1} }
@keyframes floatBob { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-5px)} }
@keyframes floatBob2 { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-4px)} }
.hm-notif-dot, .hm-act-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.hm-notif-dot { background: #10b981; animation: dotPulse 1.5s ease-in-out infinite; }
.hm-score-ring { flex-shrink: 0; }
.hm-score-arc { animation: donutIn 1s ease-out 4s both; }
.hm-notif strong, .hm-activity strong { font-weight: 700; }
.hm-notif span, .hm-activity span { color: #64748b; font-size: 10px; }

/* ── Logos marquee ── */
.home-logos { padding: 28px 0; background: #fff; border-bottom: 1px solid var(--border); overflow: hidden; }
.logos-label { text-align: center; font-size: 11px; font-weight: 700; color: var(--text-light); text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 14px; }
.logos-marquee-wrap {
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.logos-marquee { display: flex; gap: 40px; width: max-content; animation: marquee 30s linear infinite; }
.logos-marquee:hover { animation-play-state: paused; }
@keyframes marquee { 0%{transform:translateX(0)} 100%{transform:translateX(-50%)} }
.logo-item {
  display: flex; align-items: center; gap: 7px; white-space: nowrap;
  font-size: 13px; font-weight: 600; color: var(--text-muted);
}
.logo-item svg { color: var(--lime); flex-shrink: 0; }

/* ── Section shared ── */
.section-badge {
  display: inline-block; padding: 4px 14px; border-radius: 6px;
  background: rgba(16,185,129,0.08); color: var(--lime-dark);
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px;
  margin-bottom: 14px;
}
.home-section-header { text-align: center; max-width: 600px; margin: 0 auto 56px; }
.home-section-header h2 { font-size: 34px; font-weight: 800; color: var(--navy); margin-bottom: 14px; letter-spacing: -0.5px; line-height: 1.2; }
.home-section-header p { font-size: 16px; color: var(--text-muted); line-height: 1.7; }

/* ── Features ── */
.home-features { padding: 100px 0; background: #fff; }
.home-features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.home-feature-card {
  padding: 28px; border: 1px solid var(--border); border-radius: 14px;
  transition: all 0.35s cubic-bezier(0.22,1,0.36,1);
  background: #fff; position: relative; overflow: hidden;
}
.home-feature-card::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--lime), var(--lime-dark));
  transform: scaleX(0); transform-origin: left; transition: transform 0.35s ease;
}
.home-feature-card:hover::after { transform: scaleX(1); }
.home-feature-card:hover { border-color: rgba(16,185,129,0.2); box-shadow: 0 12px 40px rgba(0,0,0,0.06); transform: translateY(-3px); }
.home-feature-icon {
  width: 44px; height: 44px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; margin-bottom: 16px;
}
.home-feature-icon.blue { background: #eff6ff; color: #3b82f6; }
.home-feature-icon.green { background: #ecfdf5; color: #10b981; }
.home-feature-icon.purple { background: #faf5ff; color: #8b5cf6; }
.home-feature-icon.orange { background: #fff7ed; color: #f59e0b; }
.home-feature-icon.red { background: #fef2f2; color: #ef4444; }
.home-feature-icon.teal { background: #f0fdfa; color: #14b8a6; }
.home-feature-card h3 { font-size: 16px; font-weight: 700; color: var(--navy); margin-bottom: 8px; }
.home-feature-card p { font-size: 13px; color: var(--text-muted); line-height: 1.65; margin-bottom: 12px; }
.feature-tag {
  display: inline-block; padding: 3px 10px; border-radius: 4px;
  background: #f8fafc; font-size: 11px; font-weight: 600; color: var(--text-muted); border: 1px solid var(--border);
}

/* ── Nav scrolled state ── */
.home-nav.nav-scrolled { background: rgba(11,17,32,0.95); box-shadow: 0 2px 20px rgba(0,0,0,0.3); }

/* ── Hero cursor ── */
.hero-cursor {
  display: inline-block; color: var(--lime-light); font-weight: 300;
  animation: cursorBlink 0.8s step-end infinite;
  margin-left: 2px;
}
@keyframes cursorBlink { 0%,100%{opacity:1} 50%{opacity:0} }

/* ── Live Activity Feed Grid ── */
.live-grid-header {
  display: flex; align-items: center; gap: 8px; margin-bottom: 14px;
}
.live-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #ef4444;
  animation: livePulse 1.5s ease-in-out infinite;
  box-shadow: 0 0 8px rgba(239,68,68,0.5);
}
@keyframes livePulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:0.5;transform:scale(0.8)} }
.live-label { font-size: 11px; font-weight: 700; color: #ef4444; text-transform: uppercase; letter-spacing: 0.8px; }
.live-grid {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px;
}
.live-card {
  padding: 14px; border-radius: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(8px);
  display: flex; flex-direction: column; gap: 8px;
  opacity: 0; transform: translateY(16px);
  animation: liveCardIn 0.5s ease-out forwards;
  transition: all 0.25s ease;
}
.live-card:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.15);
  transform: translateY(-3px);
}
.lc-1 { animation-delay: 0.2s; }
.lc-2 { animation-delay: 0.3s; }
.lc-3 { animation-delay: 0.4s; }
.lc-4 { animation-delay: 0.5s; }
.lc-5 { animation-delay: 0.6s; }
.lc-6 { animation-delay: 0.7s; }
@keyframes liveCardIn {
  to { opacity: 1; transform: translateY(0); }
}
.live-card-icon {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}
.live-card-text { display: flex; flex-direction: column; gap: 1px; }
.live-card-text strong { font-size: 12px; font-weight: 700; color: rgba(255,255,255,0.9); }
.live-card-text span { font-size: 11px; color: rgba(255,255,255,0.45); }
.live-card em {
  font-style: normal; font-size: 10px; color: rgba(255,255,255,0.25);
  margin-top: auto;
}

/* ── Big Numbers ── */
.home-big-numbers { padding: 80px 0; background: #0b1120; position: relative; overflow: hidden; }
.big-nums-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; }
.big-num { text-align: center; padding: 28px 20px; border: 1px solid rgba(255,255,255,0.06); border-radius: 16px; background: rgba(255,255,255,0.02); transition: all 0.3s ease; }
.big-num:hover { border-color: rgba(16,185,129,0.2); background: rgba(16,185,129,0.04); transform: translateY(-4px); }
.big-num-val { font-size: 40px; font-weight: 800; color: #fff; margin-bottom: 6px; }
.big-num-label { font-size: 13px; color: rgba(255,255,255,0.45); margin-bottom: 14px; }
.big-num-bar { height: 4px; border-radius: 4px; background: rgba(255,255,255,0.06); overflow: hidden; }
.big-num-fill { height: 100%; border-radius: 4px; width: 0; background: var(--c); transition: width 1.5s cubic-bezier(0.22,1,0.36,1); }

/* ── Testimonials ── */
.home-testimonials { padding: 100px 0; background: #fff; }
.testimonials-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.testimonial-card {
  padding: 28px; border: 1px solid var(--border); border-radius: 16px;
  background: #fff; transition: all 0.35s ease; position: relative; overflow: hidden;
}
.testimonial-card::before {
  content: '"'; position: absolute; top: -10px; right: 16px;
  font-size: 100px; font-weight: 800; color: rgba(16,185,129,0.06); line-height: 1; pointer-events: none;
}
.testimonial-card:hover { border-color: rgba(16,185,129,0.2); box-shadow: 0 12px 40px rgba(0,0,0,0.06); transform: translateY(-3px); }
.testimonial-stars { display: flex; gap: 2px; margin-bottom: 14px; }
.testimonial-text { font-size: 14px; color: var(--text-muted); line-height: 1.7; margin-bottom: 20px; font-style: italic; }
.testimonial-author { display: flex; align-items: center; gap: 10px; }
.testimonial-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.testimonial-author strong { display: block; font-size: 13px; color: var(--text); }
.testimonial-author span { font-size: 11px; color: var(--text-muted); }

/* ── How It Works ── */
.home-how-it-works { padding: 100px 0; background: var(--bg); }
.hiw-timeline { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; max-width: 960px; margin: 0 auto; }
.hiw-line {
  position: absolute; top: 22px; left: 10%; right: 10%; height: 2px;
  background: linear-gradient(90deg, #3b82f6, #8b5cf6, #f59e0b, #10b981);
  border-radius: 2px; opacity: 0.25;
}
.hiw-step { text-align: center; position: relative; z-index: 1; }
.hiw-num {
  width: 44px; height: 44px; border-radius: 50%; margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
  background: #fff; border: 2px solid var(--border);
  font-size: 15px; font-weight: 800; color: var(--lime-dark);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transition: all 0.3s ease;
}
.hiw-step:hover .hiw-num { border-color: var(--lime); background: rgba(16,185,129,0.05); transform: scale(1.1); }
.hiw-card { }
.hiw-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; margin: 0 auto 12px;
}
.hiw-card h4 { font-size: 15px; font-weight: 700; color: var(--navy); margin-bottom: 6px; }
.hiw-card p { font-size: 12px; color: var(--text-muted); line-height: 1.6; }

/* ── Stats ── */
.home-stats {
  padding: 80px 0; position: relative; overflow: hidden;
  background: linear-gradient(135deg, #0b1120 0%, #1e293b 100%);
}
.home-stats::before {
  content: ''; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: 600px; height: 600px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(16,185,129,0.08), transparent 70%);
}
.home-stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 40px;
  text-align: center; position: relative; z-index: 1;
}
.home-stat-item { transition: transform 0.3s ease; }
.home-stat-item:hover { transform: translateY(-4px); }
.home-stat-number { font-size: 44px; font-weight: 800; color: var(--lime-light); margin-bottom: 6px; }
.home-stat-text { font-size: 14px; color: rgba(255,255,255,0.5); font-weight: 500; }

/* ── CTA ── */
.home-cta {
  padding: 100px 0; text-align: center; position: relative; overflow: hidden;
  background: #0b1120;
}
.home-cta-content h2 { font-size: 36px; font-weight: 800; color: #fff; margin-bottom: 16px; letter-spacing: -0.5px; line-height: 1.2; }
.home-cta-content p { font-size: 16px; color: rgba(255,255,255,0.5); margin-bottom: 32px; max-width: 480px; margin-left: auto; margin-right: auto; }

/* ── Footer ── */
.home-footer { padding: 60px 0 0; background: #0b1120; border-top: 1px solid rgba(255,255,255,0.05); }
.home-footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; padding-bottom: 40px; }
.home-footer-brand p { font-size: 13px; color: rgba(255,255,255,0.35); margin-top: 14px; line-height: 1.6; }
.home-footer-col h4 { font-size: 12px; font-weight: 700; color: rgba(255,255,255,0.6); text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 14px; }
.home-footer-col a { display: block; font-size: 13px; color: rgba(255,255,255,0.35); padding: 4px 0; transition: color 0.15s; }
.home-footer-col a:hover { color: var(--lime-light); }
.home-footer-bottom { border-top: 1px solid rgba(255,255,255,0.06); padding: 20px 0; text-align: center; }
.home-footer-bottom p { font-size: 12px; color: rgba(255,255,255,0.25); }

/* ── Sidebar + Layout globals ── */
.hamburger-btn { display: flex; }
.sidebar { transform: translateX(-100%); transition: transform .3s ease; }
.sidebar.open { transform: translateX(0); }
.main-content { margin-left: 0 !important; transition: margin-left .3s ease; }
@media (min-width: 1025px) { .sidebar.open ~ .main-content { margin-left: 240px !important; } }
@media (min-width: 769px) and (max-width: 1024px) { .sidebar.open ~ .main-content { margin-left: 0 !important; } }

/* ══ Compact & Responsive Overrides ══ */

/* -- Tighter spacing globally -- */
.page-content { padding: 12px 16px; }
.page-header { margin-bottom: 14px; }
.page-header h2 { font-size: 16px; }
.card-body { padding: 14px; }
.card-header { padding: 10px 14px; }
.card-header h3 { font-size: 13px; }
.card-footer { padding: 10px 14px; }

/* -- Compact tables -- */
thead th { padding: 6px 10px; font-size: 10px; }
tbody td { padding: 6px 10px; font-size: 12px; }

/* -- Compact stat cards -- */
.stat-grid { gap: 10px; margin-bottom: 16px; }
.stat-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.stat-card { padding: 12px 14px; }
.stat-card .stat-icon { width: 32px; height: 32px; margin-bottom: 8px; border-radius: 8px; }
.stat-card .stat-value { font-size: 18px; }
.stat-card .stat-label { font-size: 11px; }

/* -- Compact forms -- */
.form-control { height: 32px; font-size: 12px; padding: 0 8px; }
textarea.form-control { padding: 6px 8px; min-height: 50px; }
.form-group { margin-bottom: 10px; }
.form-group label { font-size: 11px; margin-bottom: 3px; }
.form-row { gap: 12px; }

/* -- Compact buttons -- */
.btn { padding: 5px 12px; font-size: 12px; }
.btn svg { width: 14px; height: 14px; }
.btn-sm { padding: 3px 8px; font-size: 11px; }
.btn-icon { width: 28px; height: 28px; }

/* -- Compact header -- */
.header { height: 44px; padding: 0 12px; }
.header-search input { height: 32px; font-size: 12px; padding: 0 10px 0 30px; }
.header-search svg { width: 14px; height: 14px; left: 8px; }
.header-btn { width: 32px; height: 32px; }
.header-btn svg { width: 16px; height: 16px; }
.hamburger-btn { width: 34px; height: 34px; }

/* -- Compact sidebar -- */
.sidebar { width: 220px; }
.sidebar-logo { padding: 10px 12px; }
.sidebar-logo .logo-icon { width: 28px; height: 28px; font-size: 12px; border-radius: 6px; }
.sidebar-logo h1 { font-size: 13px; }
.sidebar-nav { padding: 6px 8px; }
.sidebar-nav a { padding: 6px 10px; font-size: 12px; gap: 8px; }
.sidebar-nav a svg { width: 16px; height: 16px; }
.sidebar-footer { padding: 8px 12px; }
.sidebar-footer .avatar { width: 28px; height: 28px; font-size: 11px; }
.sidebar-footer .user-info p { font-size: 12px; }

/* -- Compact badges -- */
.badge { padding: 1px 6px; font-size: 10px; }

/* -- Compact alerts -- */
.alert { padding: 8px 12px; font-size: 12px; margin-bottom: 12px; }

/* -- Compact modals -- */
.modal-header { padding: 12px 16px; }
.modal-header h3 { font-size: 15px; }
.modal-body { padding: 14px 16px; }
.modal-footer { padding: 10px 16px; }

/* -- Compact pagination -- */
.pagination { padding: 8px 0; font-size: 12px; }

/* -- Compact funnel -- */
.funnel-track { height: 24px; }
.funnel-bar .funnel-label { font-size: 12px; }

/* -- Compact timeline -- */
.timeline { padding-left: 20px; }

/* ══ Responsive Breakpoints ══ */

/* -- Large screens (1025px+) -- */
@media (min-width: 1025px) {
  .sidebar.open ~ .main-content { margin-left: 220px !important; }
}

/* -- Tablet (769px - 1024px) -- */
@media (min-width: 769px) and (max-width: 1024px) {
  .page-content { padding: 10px 12px; }
  .stat-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .form-row { grid-template-columns: 1fr 1fr; gap: 10px; }
  .grid-2 { grid-template-columns: 1fr 1fr; gap: 12px; }
  .hero-h1 { font-size: 40px; }
  .home-features-grid { grid-template-columns: 1fr 1fr; }
  .home-stats-grid { grid-template-columns: repeat(4, 1fr); }
  .home-footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
}

/* -- Mobile (up to 768px) -- */
@media (max-width: 768px) {
  .main-content { margin-left: 0 !important; }
  .page-content { padding: 8px 10px; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 8px; margin-bottom: 10px; }
  .page-header h2 { font-size: 15px; }

  /* Stack grids */
  .form-row, .grid-2, .grid-3 { grid-template-columns: 1fr; gap: 8px; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-card { padding: 10px; }
  .stat-card .stat-value { font-size: 16px; }
  .detail-grid { grid-template-columns: 1fr; }

  /* Compact table for mobile */
  thead th { padding: 5px 6px; font-size: 9px; }
  tbody td { padding: 5px 6px; font-size: 11px; }

  /* Header actions */
  .header { height: 40px; padding: 0 8px; }
  .header-left { gap: 6px; }
  .header-search { max-width: none; }
  .header-search input { height: 28px; font-size: 11px; }
  .header-btn { width: 28px; height: 28px; }
  .header-btn svg { width: 14px; height: 14px; }
  .hamburger-btn { width: 30px; height: 30px; }
  .header-actions { gap: 4px; }

  /* Forms */
  .form-control { height: 30px; font-size: 11px; }
  .btn { padding: 4px 10px; font-size: 11px; }
  .btn-sm { padding: 3px 6px; font-size: 10px; }

  /* Modals */
  .modal-box { margin: 8px; max-height: 90vh; }

  /* Card */
  .card-body { padding: 10px; }

  /* Wg header actions wrap */
  .wg-header-actions { flex-wrap: wrap; gap: 4px; }

  /* Home page responsive */
  .home-nav-links, .home-nav-actions { display: none; }
  .home-nav-links.open, .home-nav-actions.open {
    display: flex; flex-direction: column;
    position: absolute; top: 64px; left: 0; right: 0;
    background: rgba(15,23,42,0.97); padding: 16px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }
  .home-menu-toggle { display: block; }
  .hero-inner { grid-template-columns: 1fr; gap: 40px; }
  .hero-h1 { font-size: 28px; }
  .hero-visual { display: none; }
  .hero-actions { flex-direction: column; align-items: flex-start; }
  .home-hero { padding: 90px 0 50px; }
  .home-features-grid { grid-template-columns: 1fr; }
  .hiw-timeline { grid-template-columns: 1fr 1fr; gap: 16px; }
  .hiw-line { display: none; }
  .home-stats-grid { grid-template-columns: 1fr 1fr; gap: 16px; }
  .home-stat-number { font-size: 28px; }
  .home-footer-grid { grid-template-columns: 1fr 1fr; }
  .home-cta-content h2 { font-size: 22px; }
  .home-section-header h2 { font-size: 22px; }
  .big-nums-grid { grid-template-columns: 1fr 1fr; }
  .big-num-val { font-size: 24px; }
  .testimonials-grid { grid-template-columns: 1fr; }
  .live-grid { grid-template-columns: repeat(2, 1fr); }
  .live-card { padding: 8px; }
}

/* -- Small mobile (up to 480px) -- */
@media (max-width: 480px) {
  .page-content { padding: 6px 8px; }
  .stat-grid { grid-template-columns: 1fr; }
  .page-header { margin-bottom: 8px; }
  .page-header h2 { font-size: 14px; }
  thead th { white-space: nowrap; }
  .header-search { display: none; }
  .sidebar { width: 200px; }
  .modal-box { margin: 4px; }
  .wg-header-actions { gap: 2px; }
}

/* ─── Lead Source Accordion ────────────────────────── */
#ls-accordion { padding: 8px 0; }

.ls-source { border-bottom: 1px solid var(--border); }
.ls-source:last-child { border-bottom: none; }

.ls-source-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; cursor: pointer; transition: background 0.15s;
}
.ls-source-header:hover { background: var(--bg); }

.ls-source-body { padding: 0 0 8px 28px; }

.ls-medium { border: 1px solid var(--border); border-radius: 6px; margin: 4px 16px 4px 12px; background: var(--card); }

.ls-medium-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; cursor: pointer; transition: background 0.15s;
}
.ls-medium-header:hover { background: var(--bg); }

.ls-medium-body { padding: 0 16px 8px 28px; }

.ls-campaign { border-bottom: 1px solid var(--border); }
.ls-campaign:last-child { border-bottom: none; }

.ls-campaign-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 4px;
}

.ls-label { display: flex; align-items: center; gap: 8px; }

.ls-type { color: var(--text-muted); font-size: 13px; font-weight: 500; }
.ls-name { font-weight: 600; color: #b45309; font-size: 14px; }

.ls-chevron {
  transition: transform 0.2s; flex-shrink: 0; color: var(--text-muted);
}
.ls-chevron-open { transform: rotate(180deg); }

.ls-actions { display: flex; gap: 4px; }

.ls-action-btn {
  background: none; border: none; cursor: pointer; padding: 4px 6px;
  border-radius: 4px; color: var(--text-muted); transition: all 0.15s;
  display: flex; align-items: center;
}
.ls-action-btn:hover { background: var(--border); color: var(--text); }
.ls-action-btn.ls-delete:hover { background: var(--danger-bg); color: var(--danger); }

.ls-add-link {
  padding: 8px 16px; text-align: right;
}
.ls-add-link a {
  color: var(--lime); font-size: 13px; font-weight: 500; text-decoration: none;
}
.ls-add-link a:hover { text-decoration: underline; }

/* ─── Tracking Settings ─────────────────────────── */
.ls-tracking-divider {
  height: 3px; background: var(--lime); width: 60px; margin-bottom: 20px;
}

.ls-tracking-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.ls-tracking-row:last-child { border-bottom: none; }

.ls-tracking-label {
  font-size: 14px; color: var(--text-muted); font-weight: 500;
  display: flex; align-items: center; gap: 6px;
}

.ls-tracking-group {
  border: 1px solid var(--border); border-radius: 6px;
  padding: 0 16px; margin-top: 16px;
}

.ls-info-icon {
  font-size: 14px; color: var(--text-light); cursor: help;
}

/* ============================================
   DASHBOARD — Comprehensive Analytics Design
   ============================================ */

/* ---- Dashboard Header ---- */
.dash-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}
.dash-title { font-size: 24px; font-weight: 700; color: var(--navy); }
.dash-subtitle { color: var(--text-muted); font-size: 14px; margin-top: 2px; display: flex; align-items: center; gap: 8px; }
.dash-date-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 10px; border-radius: 999px;
  background: var(--info-bg); color: var(--info);
  font-size: 12px; font-weight: 600;
}
.dash-actions { display: flex; align-items: center; gap: 10px; }
.dash-date-filter {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--card);
  font-size: 13px; font-weight: 500; color: var(--text-muted);
  cursor: pointer; transition: all var(--transition);
}
.dash-date-filter:hover { border-color: var(--lime); color: var(--text); }

/* ---- Stat Cards (4-column) ---- */
.stat-grid-4 {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 16px; margin-bottom: 24px;
}
.dash-stat-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow-sm); transition: all var(--transition);
}
.dash-stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.dash-stat-top { display: flex; align-items: flex-start; justify-content: space-between; }
.dash-stat-label { font-size: 13px; color: var(--text-muted); font-weight: 500; }
.dash-stat-value { font-size: 28px; font-weight: 700; line-height: 1.3; color: var(--text); margin-top: 4px; }
.dash-stat-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.dash-stat-icon.blue { background: var(--info-bg); color: var(--info); }
.dash-stat-icon.green { background: var(--success-bg); color: var(--success); }
.dash-stat-icon.orange { background: var(--warning-bg); color: var(--warning); }
.dash-stat-icon.purple { background: #f5f3ff; color: #7c3aed; }
.dash-stat-icon.red { background: var(--danger-bg); color: var(--danger); }
.dash-stat-trend {
  display: flex; align-items: center; gap: 4px;
  margin-top: 12px; font-size: 12px; font-weight: 500;
}
.dash-stat-trend.up { color: var(--success); }
.dash-stat-trend.down { color: var(--danger); }
.dash-stat-trend.neutral { color: var(--text-muted); }

/* ---- Dashboard Cards ---- */
.dash-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}
.dash-card-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px;
}
.dash-card-header h3 { font-size: 15px; font-weight: 600; color: var(--text); }
.dash-card-actions { display: flex; align-items: center; gap: 8px; }
.dash-card-body { padding: 20px; }
.dash-card-body.p-0, .p-0 { padding: 0; }

/* ---- Dashboard Grid Layouts ---- */
.dash-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.dash-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.dash-row-2 > .dash-card, .dash-row-3 > .dash-card { margin-bottom: 0; }

/* ---- Performance Analysis ---- */
.perf-grid { display: flex; align-items: center; gap: 30px; }
.perf-chart-wrap { flex-shrink: 0; width: 180px; height: 180px; position: relative; }
.perf-stats { flex: 1; }
.perf-stat-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--border);
}
.perf-stat-item:last-child { border-bottom: none; }
.perf-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
.perf-dot.hot { background: #ef4444; }
.perf-dot.warm { background: #f59e0b; }
.perf-dot.cold { background: #3b82f6; }
.perf-dot.app { background: #8b5cf6; }
.perf-label { flex: 1; font-size: 13px; color: var(--text-muted); font-weight: 500; }
.perf-count { font-size: 15px; font-weight: 700; color: var(--text); }
.perf-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ---- Funnel Visual (trapezoid) ---- */
.funnel-visual { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 0; }
.funnel-stage { transition: all 0.3s ease; }
.funnel-stage-bar {
  padding: 10px 16px; border-radius: 6px; color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; font-weight: 600;
  min-height: 36px; transition: all 0.3s ease;
}
.funnel-stage-bar:hover { opacity: 0.9; transform: scale(1.02); }
.funnel-stage-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.funnel-stage-count { font-weight: 700; margin-left: 12px; white-space: nowrap; }

/* ---- Dashboard Table ---- */
.dash-table { width: 100%; border-collapse: collapse; }
.dash-table thead th {
  padding: 10px 16px; text-align: left;
  font-size: 11px; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase;
  letter-spacing: .5px;
  background: var(--bg); border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.dash-table tbody td {
  padding: 10px 16px; font-size: 13px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.dash-table tbody tr { transition: background var(--transition); }
.dash-table tbody tr:hover { background: #f8fafc; }
.dash-table tbody tr:last-child td { border-bottom: none; }

/* ---- Counselor Cell ---- */
.counselor-cell { display: flex; align-items: center; gap: 10px; }
.counselor-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 13px; font-weight: 700; flex-shrink: 0;
}
.counselor-name { font-size: 13px; font-weight: 600; color: var(--text); }
.counselor-email { font-size: 11px; color: var(--text-muted); }

/* ---- Communication Stats ---- */
.comm-stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.comm-stat-card {
  display: flex; align-items: center; gap: 12px;
  padding: 14px; border: 1px solid var(--border);
  border-radius: var(--radius); transition: all var(--transition);
}
.comm-stat-card:hover { border-color: var(--lime); box-shadow: var(--shadow-sm); }
.comm-stat-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.comm-stat-count { font-size: 20px; font-weight: 700; color: var(--text); }
.comm-stat-label { font-size: 12px; color: var(--text-muted); font-weight: 500; }

/* ---- Mini Bar ---- */
.mini-bar-wrap {
  width: 80px; height: 6px; background: var(--bg);
  border-radius: 3px; overflow: hidden; display: inline-block;
  vertical-align: middle; margin-right: 6px;
}
.mini-bar-fill { height: 100%; border-radius: 3px; transition: width 0.6s ease; }
.mini-bar-pct { font-size: 12px; color: var(--text-muted); font-weight: 600; }

/* ---- Period Tabs ---- */
.dash-period-tabs { display: flex; gap: 4px; }
.dash-period-tab {
  padding: 4px 12px; border-radius: 6px;
  font-size: 12px; font-weight: 500;
  background: transparent; border: 1px solid var(--border);
  color: var(--text-muted); cursor: pointer;
  transition: all var(--transition);
}
.dash-period-tab:hover { border-color: var(--lime); color: var(--text); }
.dash-period-tab.active { background: var(--lime); color: #fff; border-color: var(--lime); }

/* ---- Heatmap ---- */
.heatmap-container { overflow-x: auto; }
.heatmap-row { display: flex; gap: 3px; margin-bottom: 3px; }
.heatmap-header-row { margin-bottom: 6px; }
.heatmap-label {
  width: 40px; flex-shrink: 0; font-size: 11px; font-weight: 600;
  color: var(--text-muted); display: flex; align-items: center;
}
.heatmap-cell {
  flex: 1; min-width: 28px; height: 28px;
  border-radius: 4px; display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 600; color: var(--text);
  transition: all var(--transition); cursor: default;
}
.heatmap-cell:hover { transform: scale(1.1); box-shadow: var(--shadow-sm); }
.heatmap-hour-label { background: transparent !important; font-size: 10px; color: var(--text-muted); font-weight: 600; }
.heatmap-legend { display: flex; align-items: center; gap: 12px; }
.heatmap-legend-item { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--text-muted); font-weight: 500; }
.heatmap-box { width: 14px; height: 14px; border-radius: 3px; }

/* ---- Task Stats ---- */
.task-chart-row { display: flex; align-items: center; gap: 30px; }
.task-chart-wrap { flex-shrink: 0; width: 180px; height: 180px; }
.task-stats-list { flex: 1; }
.task-stat-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--border);
}
.task-stat-row:last-child { border-bottom: none; }
.task-stat-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.task-stat-label { flex: 1; font-size: 13px; color: var(--text-muted); font-weight: 500; }
.task-stat-val { font-size: 15px; font-weight: 700; color: var(--text); }

/* ---- Application Pipeline ---- */
.app-pipeline { padding: 20px; }
.app-pipeline-stage { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.app-pipeline-bar { height: 28px; border-radius: 6px; min-width: 8px; transition: width 0.6s ease; }
.app-pipeline-info { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.app-pipeline-name { font-size: 12px; font-weight: 600; color: var(--text); }
.app-pipeline-count { font-size: 13px; font-weight: 700; color: var(--text-muted); }

/* ---- Opportunity Funnel ---- */
.opp-funnel { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.opp-funnel-row { width: 100%; display: flex; justify-content: center; }
.opp-funnel-bar-wrap { transition: all 0.3s ease; }
.opp-funnel-bar {
  padding: 12px 18px; border-radius: 8px; color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; font-weight: 600;
  transition: all 0.3s ease;
}
.opp-funnel-bar:hover { opacity: 0.9; transform: scale(1.01); }
.opp-funnel-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.opp-funnel-val { font-weight: 700; margin-left: 12px; }

/* ---- Dashboard Responsive ---- */
@media (max-width: 1200px) {
  .stat-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .comm-stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .stat-grid-4 { grid-template-columns: 1fr; }
  .dash-row-2, .dash-row-3 { grid-template-columns: 1fr; }
  .perf-grid { flex-direction: column; }
  .perf-chart-wrap { width: 150px; height: 150px; }
  .task-chart-row { flex-direction: column; }
  .task-chart-wrap { width: 150px; height: 150px; }
  .comm-stats-grid { grid-template-columns: 1fr 1fr; }
  .heatmap-cell { min-width: 20px; height: 20px; font-size: 8px; }
  .heatmap-label { width: 30px; font-size: 10px; }
  .dash-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .dash-actions { flex-wrap: wrap; gap: 8px; }
  .dashlet-modal { width: 95%; max-width: 95%; }
  .header-search { max-width: none; }
  .header-search input { font-size: 14px; }
  .page-content { padding: 16px; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 12px; }
}

@media (max-width: 480px) {
  .stat-grid-4 { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr; }
  .comm-stats-grid { grid-template-columns: 1fr; }
  .dash-actions { flex-direction: column; align-items: stretch; }
  .dash-actions .btn { justify-content: center; }
  .header { padding: 0 12px; }
  .page-content { padding: 12px; }
  .header-search input { height: 36px; font-size: 13px; }
}

/* ============================================
   DASHLET MODAL — Add Dashlets Panel
   ============================================ */

/* ---- Sync Info ---- */
.dash-sync-info {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--text-muted); line-height: 1.3;
}
.dash-sync-info strong { color: var(--text); font-size: 12px; }
.dash-sync-dot {
  width: 24px; height: 24px; border-radius: 50%;
  background: #22c55e; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5'%3E%3Cpath d='M23 4v6h-6'/%3E%3Cpath d='M1 20v-6h6'/%3E%3Cpath d='M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: center; background-size: 14px;
}

/* ---- Modal Overlay ---- */
.dashlet-modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 60;
  background: rgba(0,0,0,.5); align-items: flex-start; justify-content: center;
  padding-top: 60px;
  backdrop-filter: blur(2px);
}
.dashlet-modal-overlay.open { display: flex; }

/* ---- Modal Container ---- */
.dashlet-modal {
  background: var(--card); border-radius: 12px;
  width: 680px; max-width: 90vw;
  max-height: calc(100vh - 120px);
  display: flex; flex-direction: column;
  box-shadow: 0 25px 50px rgba(0,0,0,.2);
  animation: dashletSlideIn .25s ease;
}
@keyframes dashletSlideIn {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---- Modal Header ---- */
.dashlet-modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; flex-shrink: 0;
}
.dashlet-modal-title {
  display: flex; align-items: center; gap: 10px;
}
.dashlet-modal-title h3 { font-size: 20px; font-weight: 700; color: var(--text); }
.dashlet-modal-play {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--info); color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all var(--transition);
}
.dashlet-modal-play:hover { background: #2563eb; }
.dashlet-modal-top-right {
  display: flex; align-items: center; gap: 12px;
}
.dashlet-modal-close {
  width: 32px; height: 32px; border-radius: 6px;
  background: none; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); transition: all var(--transition);
}
.dashlet-modal-close:hover { background: var(--bg); color: var(--text); }

/* ---- Category Dropdown ---- */
.dashlet-category-dropdown { position: relative; }
.dashlet-category-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--card);
  font-size: 13px; font-weight: 500; color: var(--text);
  cursor: pointer; transition: all var(--transition);
  min-width: 160px; justify-content: space-between;
}
.dashlet-category-btn:hover { border-color: var(--lime); }
.dashlet-category-menu {
  display: none; position: absolute; top: calc(100% + 4px); right: 0;
  min-width: 200px; background: var(--card);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 8px 30px rgba(0,0,0,.15); z-index: 70;
  overflow: hidden;
}
.dashlet-category-menu.open { display: block; }
.dashlet-category-search {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-bottom: 1px solid var(--border);
}
.dashlet-category-search svg { color: var(--text-muted); flex-shrink: 0; }
.dashlet-category-search input {
  width: 100%; border: none; outline: none;
  font-size: 13px; background: transparent; color: var(--text);
}
.dashlet-category-list { max-height: 200px; overflow-y: auto; padding: 4px 0; }
.dashlet-category-item {
  padding: 9px 16px; font-size: 13px; font-weight: 500;
  color: var(--text); cursor: pointer;
  transition: background var(--transition);
}
.dashlet-category-item:hover { background: var(--bg); }
.dashlet-category-item.active { color: var(--info); font-weight: 600; }

/* ---- Modal Body / Dashlet List ---- */
.dashlet-modal-body {
  flex: 1; overflow-y: auto; padding: 0;
}
.dashlet-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px; border-bottom: 1px solid var(--border);
  gap: 16px; transition: background var(--transition);
}
.dashlet-item:hover { background: #f8fafc; }
.dashlet-item:last-child { border-bottom: none; }
.dashlet-item-info { flex: 1; min-width: 0; }
.dashlet-item-name { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.dashlet-item-desc { font-size: 13px; color: var(--text-muted); line-height: 1.5; }

/* ---- Toggle Switch ---- */
.dashlet-toggle {
  position: relative; display: inline-block;
  width: 48px; height: 26px; flex-shrink: 0; cursor: pointer;
}
.dashlet-toggle input { opacity: 0; width: 0; height: 0; }
.dashlet-toggle-slider {
  position: absolute; inset: 0;
  background: #cbd5e1; border-radius: 26px;
  transition: background .25s ease;
}
.dashlet-toggle-slider::before {
  content: ''; position: absolute;
  width: 20px; height: 20px;
  left: 3px; top: 3px;
  background: #fff; border-radius: 50%;
  transition: transform .25s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
}
.dashlet-toggle input:checked + .dashlet-toggle-slider { background: var(--info); }
.dashlet-toggle input:checked + .dashlet-toggle-slider::before { transform: translateX(22px); }

/* ---- Modal Footer ---- */
.dashlet-modal-footer {
  padding: 16px 24px; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 8px; flex-shrink: 0;
}

/* ============================================
   LEAD FIELDS PAGE
   ============================================ */

/* ---- Header Actions ---- */
.lf-header-actions { display: flex; align-items: center; gap: 4px; }
.lf-icon-btn {
  width: 36px; height: 36px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--card); color: var(--text-muted);
  cursor: pointer; transition: all var(--transition);
}
.lf-icon-btn:hover { background: var(--bg); color: var(--text); border-color: var(--lime); }

/* ---- Search Bar ---- */
.lf-search-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px; margin-bottom: 16px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.lf-search-bar svg { color: var(--text-muted); flex-shrink: 0; }
.lf-search-bar .form-control { flex: 1; }

/* ---- Tab Bar ---- */
.lf-tab-bar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; gap: 12px; flex-wrap: wrap;
}
.lf-tabs { display: flex; gap: 0; }
.lf-tab {
  display: flex; align-items: center; gap: 6px;
  padding: 9px 18px; font-size: 13px; font-weight: 600;
  border: 1px solid var(--border); background: var(--card);
  color: var(--text-muted); cursor: pointer;
  transition: all var(--transition);
}
.lf-tab:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.lf-tab:last-child { border-radius: 0 var(--radius) var(--radius) 0; border-left: none; }
.lf-tab:hover { color: var(--text); }
.lf-tab.active { background: var(--info); color: #fff; border-color: var(--info); }
.lf-tab.active svg { stroke: #fff; }
.lf-tab-actions { display: flex; gap: 8px; }

/* ---- Fields Table ---- */
.lf-table { width: 100%; border-collapse: collapse; }
.lf-table thead th {
  padding: 6px 10px; text-align: left;
  font-size: 10px; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: .3px;
  background: var(--bg); border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.lf-th-label { width: 18%; }
.lf-th-key { width: 18%; }
.lf-th-type { width: 22%; }
.lf-th-props { width: 20%; }
.lf-th-status { width: 14%; }
.lf-th-actions { width: 8%; }

.lf-table tbody td {
  padding: 6px 10px; font-size: 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.lf-table tbody tr { transition: background var(--transition); }
.lf-table tbody tr:hover { background: #fafbfc; }
.lf-table tbody tr:last-child td { border-bottom: none; }

/* ---- Field Label Link ---- */
.lf-field-link {
  color: var(--info); font-weight: 600; font-size: 12px;
  text-decoration: none; transition: color var(--transition);
}
.lf-field-link:hover { color: var(--lime-dark); text-decoration: underline; }

/* ---- Field Key ---- */
.lf-td-key code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 13px; color: var(--text);
}

/* ---- Field Type Cell ---- */
.lf-td-type { }
.lf-td-type > div,
.lf-td-type { display: flex; align-items: center; gap: 10px; }
.lf-type-icon {
  width: 32px; height: 32px; border-radius: 6px;
  background: var(--bg); color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.lf-type-label { font-size: 14px; font-weight: 500; color: var(--text); }
.lf-field-source { font-size: 11px; color: var(--text-muted); margin-top: 1px; }

/* ---- Field Properties ---- */
.lf-props-row { display: flex; align-items: center; gap: 10px; }
.lf-prop-icon {
  width: 28px; height: 28px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-light); transition: color var(--transition);
}
.lf-prop-icon:hover { color: var(--text); }
.lf-prop-required { color: #ef4444 !important; }
.lf-prop-duplicate { color: #b45309; }

/* ---- More Button ---- */
.lf-more-btn { color: var(--text-muted); }
.lf-more-btn:hover { color: var(--text); background: var(--bg); }

/* ---- Checkbox label ---- */
.lf-checkbox-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 500; color: var(--text);
  cursor: pointer;
}
.lf-checkbox-label input[type="checkbox"] {
  width: 16px; height: 16px; cursor: pointer;
  accent-color: var(--info);
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .lf-tab-bar { flex-direction: column; align-items: flex-start; }
  .lf-th-props, .lf-td-props { display: none; }
  .lf-th-actions, .lf-td-actions { display: none; }
}

/* Lead Fields — Context Menu */
.lf-context-menu {
  position: absolute; z-index: 9999; min-width: 150px;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,.12); padding: 4px 0;
  animation: lfCtxFadeIn .15s ease;
}
@keyframes lfCtxFadeIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.lf-ctx-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 8px 14px; border: none; background: none;
  font-size: 13px; color: #334155; cursor: pointer; text-align: left;
}
.lf-ctx-item:hover { background: #f1f5f9; }
.lf-ctx-item svg { flex-shrink: 0; }
.lf-ctx-delete { color: #dc2626; }
.lf-ctx-delete:hover { background: #fef2f2; }

/* ============================================
   Lead Fields — Slide Panel
   ============================================ */

/* Overlay */
.lf-panel-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 1000;
  opacity: 0; visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease;
}
.lf-panel-overlay.open { opacity: 1; visibility: visible; }

/* Panel */
.lf-panel {
  position: fixed; top: 0; right: -520px;
  width: 510px; max-width: 100vw; height: 100vh;
  background: #fff;
  box-shadow: -4px 0 24px rgba(0,0,0,.15);
  z-index: 1001;
  display: flex; flex-direction: column;
  transition: right .3s cubic-bezier(.4,0,.2,1);
}
.lf-panel.open { right: 0; }

/* Panel Header */
.lf-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: #fff;
  flex-shrink: 0;
}
.lf-panel-header h3 {
  font-size: 16px; font-weight: 600; color: var(--text);
  margin: 0;
}
.lf-panel-header-right {
  display: flex; align-items: center; gap: 12px;
}
.lf-panel-limit {
  font-size: 12px; color: var(--text-muted);
  background: var(--bg); padding: 3px 10px;
  border-radius: 12px; font-weight: 500;
}
.lf-panel-close {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border: none; background: var(--bg);
  border-radius: 6px; cursor: pointer;
  color: var(--text-muted); font-size: 18px;
  transition: background var(--transition), color var(--transition);
}
.lf-panel-close:hover { background: var(--border); color: var(--text); }

/* Progress bar */
.lf-panel-progress {
  height: 3px; background: var(--bg);
  flex-shrink: 0;
}
.lf-panel-progress-bar {
  height: 100%; background: var(--lime);
  border-radius: 0 3px 3px 0;
  transition: width .3s ease;
}

/* Panel Body */
.lf-panel-body {
  flex: 1; overflow-y: auto;
  padding: 0;
}

/* Sections */
.lf-section {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.lf-section:last-child { border-bottom: none; }

.lf-section-gray {
  background: #f8fafc;
}

.lf-section h4 {
  font-size: 13px; font-weight: 700;
  color: var(--text); text-transform: uppercase;
  letter-spacing: .5px; margin-bottom: 14px;
}

/* Form rows inside sections */
.lf-section .form-row {
  display: flex; gap: 14px; margin-bottom: 14px;
}
.lf-section .form-row:last-child { margin-bottom: 0; }

.lf-section .form-group {
  flex: 1; display: flex; flex-direction: column;
}

/* ── Floating Label Text Inputs ── */
.lf-fg { position: relative; }

.lf-input-wrap {
  position: relative;
}
.lf-input-wrap .lf-input {
  width: 100%; padding: 14px 12px 6px;
  border: 1px solid var(--border);
  border-radius: 6px; font-size: 14px;
  color: var(--text); background: #fff;
  font-family: inherit;
  transition: border-color .2s ease, box-shadow .2s ease;
  outline: none;
}
.lf-input-wrap .lf-input:focus {
  border-color: var(--info);
  box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}
.lf-input-wrap .lf-label {
  position: absolute; left: 12px; top: 50%;
  transform: translateY(-50%);
  font-size: 14px; color: var(--text-muted);
  pointer-events: none;
  transition: all .2s ease;
  background: transparent;
  padding: 0 2px;
  white-space: nowrap;
}
.lf-input-wrap .lf-textarea ~ .lf-label {
  top: 14px; transform: none;
}
/* Float up on focus or when input has value */
.lf-input-wrap .lf-input:focus ~ .lf-label,
.lf-input-wrap .lf-input:not(:placeholder-shown) ~ .lf-label {
  top: -1px; transform: translateY(-50%);
  font-size: 11px; font-weight: 500;
  color: var(--info); background: #fff;
}
.lf-section-gray .lf-input-wrap .lf-input:focus ~ .lf-label,
.lf-section-gray .lf-input-wrap .lf-input:not(:placeholder-shown) ~ .lf-label {
  background: #f8fafc;
}
.lf-textarea {
  resize: vertical; min-height: 60px;
}

/* ── Custom Searchable Select ── */
.lf-select-wrap {
  position: relative;
}
.lf-select-display {
  display: flex; align-items: center;
  min-height: 44px; padding: 14px 36px 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px; background: #fff;
  cursor: pointer; position: relative;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.lf-select-wrap.open .lf-select-display {
  border-color: var(--info);
  box-shadow: 0 0 0 3px rgba(59,130,246,.12);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}
.lf-select-display .lf-label {
  position: absolute; left: 12px; top: 50%;
  transform: translateY(-50%);
  font-size: 14px; color: var(--text-muted);
  pointer-events: none;
  transition: all .2s ease;
  background: transparent;
  padding: 0 2px;
  white-space: nowrap;
}
/* Floated label when value selected or open */
.lf-select-wrap.has-value .lf-select-display .lf-label,
.lf-select-wrap.open .lf-select-display .lf-label {
  top: -1px; transform: translateY(-50%);
  font-size: 11px; font-weight: 500;
  color: var(--info); background: #fff;
}
.lf-section-gray .lf-select-wrap.has-value .lf-select-display .lf-label,
.lf-section-gray .lf-select-wrap.open .lf-select-display .lf-label {
  background: #f8fafc;
}
.lf-select-text {
  font-size: 14px; color: var(--text); font-weight: 400;
  flex: 1; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap;
}
.lf-select-arrow {
  position: absolute; right: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  transition: transform .2s ease;
  flex-shrink: 0;
}
.lf-select-wrap.open .lf-select-arrow {
  transform: translateY(-50%) rotate(180deg);
}

/* Dropdown panel */
.lf-select-dropdown {
  display: none;
  position: absolute; top: 100%; left: 0; right: 0;
  background: #fff;
  border: 1px solid var(--info);
  border-top: none;
  border-radius: 0 0 6px 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
  z-index: 100;
  max-height: 240px;
  overflow: hidden;
}
.lf-select-wrap.open .lf-select-dropdown {
  display: block;
}

/* Search inside dropdown */
.lf-select-search {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}
.lf-select-search svg { color: var(--text-light); flex-shrink: 0; }
.lf-select-search-input {
  border: none; outline: none;
  font-size: 14px; color: var(--text);
  width: 100%; background: transparent;
  font-family: inherit;
}

/* Options list */
.lf-select-options {
  max-height: 190px; overflow-y: auto;
}
.lf-select-option {
  padding: 9px 14px;
  font-size: 14px; color: var(--text);
  cursor: pointer;
  transition: background .1s ease;
}
.lf-select-option:hover {
  background: #f1f5f9;
}
.lf-select-option.selected {
  background: #dbeafe; color: var(--info); font-weight: 500;
}
.lf-select-option-header {
  color: var(--text-muted); font-weight: 500;
}
.lf-select-option-header.selected {
  background: #dbeafe;
}

/* Required asterisk */
.lf-req { color: #ef4444; margin-left: 2px; }

/* Checkbox/toggle rows in sections */
.lf-section .lf-toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0;
}
.lf-section .lf-toggle-row + .lf-toggle-row {
  border-top: 1px solid #f1f5f9;
}
.lf-section .lf-toggle-row label {
  font-size: 14px; color: var(--text); font-weight: 500;
  cursor: pointer;
}
.lf-section .lf-toggle-row .lf-toggle-hint {
  font-size: 12px; color: var(--text-muted); font-weight: 400;
  display: block; margin-top: 1px;
}

/* Small toggle switch used in panel */
.lf-switch {
  position: relative; width: 38px; height: 20px; flex-shrink: 0;
}
.lf-switch input { opacity: 0; width: 0; height: 0; }
.lf-switch .lf-switch-slider {
  position: absolute; inset: 0;
  background: #cbd5e1; border-radius: 20px;
  cursor: pointer;
  transition: background .2s ease;
}
.lf-switch .lf-switch-slider::before {
  content: ''; position: absolute;
  width: 16px; height: 16px;
  left: 2px; top: 2px;
  background: #fff; border-radius: 50%;
  transition: transform .2s ease;
}
.lf-switch input:checked + .lf-switch-slider {
  background: var(--lime);
}
.lf-switch input:checked + .lf-switch-slider::before {
  transform: translateX(18px);
}

/* Panel Footer */
.lf-panel-footer {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 10px; padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: #fff; flex-shrink: 0;
}
.lf-panel-footer .btn {
  padding: 9px 22px; border-radius: 6px;
  font-size: 14px; font-weight: 500;
  cursor: pointer; border: 1px solid var(--border);
  transition: all var(--transition);
}
.lf-panel-footer .btn-cancel {
  background: #fff; color: var(--text);
}
.lf-panel-footer .btn-cancel:hover { background: var(--bg); }
.lf-panel-footer .btn-save {
  background: var(--info); color: #fff;
  border-color: var(--info);
}
.lf-panel-footer .btn-save:hover {
  background: #2563eb; border-color: #2563eb;
}

/* Panel responsive */
@media (max-width: 540px) {
  .lf-panel { width: 100vw; right: -100vw; }
  .lf-section .form-row { flex-direction: column; }
}

/* ============================================
   Sidebar — Collapsible Submenu
   ============================================ */
.sidebar-submenu { margin-bottom: 2px; }
.sidebar-submenu-toggle {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: var(--radius);
  font-size: 14px; font-weight: 500;
  color: rgba(255,255,255,.65);
  cursor: pointer;
  transition: all var(--transition);
}
.sidebar-submenu-toggle:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar-submenu.open .sidebar-submenu-toggle,
.sidebar-submenu-toggle:has(~ .sidebar-submenu-items a.active) { color: #fff; }
.sidebar-submenu-toggle .submenu-arrow {
  margin-left: auto; opacity: .5;
  transition: transform .2s ease;
}
.sidebar-submenu.open .sidebar-submenu-toggle .submenu-arrow {
  transform: rotate(180deg);
}
.sidebar-submenu-items {
  max-height: 0; overflow: hidden;
  transition: max-height .25s ease;
  padding-left: 28px;
}
.sidebar-submenu.open .sidebar-submenu-items {
  max-height: 200px;
}
.sidebar-submenu-items a {
  display: block;
  padding: 7px 14px; border-radius: var(--radius);
  font-size: 13px; font-weight: 500;
  color: rgba(255,255,255,.55);
  transition: all var(--transition);
  margin-bottom: 1px;
}
.sidebar-submenu-items a:hover { color: #fff; background: rgba(255,255,255,.06); }
.sidebar-submenu-items a.active { color: var(--navy); background: var(--lime); font-weight: 600; }

/* ============================================
   Widgets — List Page
   ============================================ */
.wg-header-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.wg-pagination {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; border-top: 1px solid var(--border);
  font-size: 12px; color: var(--text-muted);
}
.wg-pagination-info {
  background: var(--bg); padding: 4px 12px;
  border-radius: 4px; font-weight: 500;
}
.wg-pagination-controls {
  display: flex; align-items: center; gap: 4px; font-size: 13px;
}

/* ============================================
   Widget Wizard
   ============================================ */
.wiz-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 0;
}
.wiz-header h2 { font-size: 18px; font-weight: 600; }
.wiz-header-right { display: flex; align-items: center; gap: 16px; }
.wiz-steps {
  display: flex; align-items: center; gap: 0;
}
.wiz-step {
  position: relative;
  padding: 8px 28px;
  font-size: 13px; font-weight: 600;
  color: var(--text-muted);
  background: var(--bg);
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%, 12px 50%);
  cursor: default;
}
.wiz-step:first-child { clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%); border-radius: 20px 0 0 20px; }
.wiz-step:last-child { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 12px 50%); border-radius: 0 20px 20px 0; }
.wiz-step.active { background: var(--lime); color: var(--navy); }
.wiz-step.completed { background: var(--lime-light); color: var(--navy); }

.wiz-progress { height: 4px; background: var(--bg); margin: 12px 0 20px; border-radius: 2px; }
.wiz-progress-bar { height: 100%; background: linear-gradient(90deg, var(--lime), #f59e0b); border-radius: 2px; transition: width .3s ease; }

.wiz-panel { background: #fff; border-radius: var(--radius); border: 1px solid var(--border); }

.wiz-success-msg {
  background: #d1fae5; color: #065f46; padding: 10px 20px;
  text-align: center; font-size: 14px; font-weight: 500;
  border-bottom: 1px solid #a7f3d0;
}

/* Step 1: Form */
.wiz-form { padding: 24px 32px; }
.wiz-form-row {
  display: flex; align-items: flex-start; gap: 24px;
  padding: 14px 0;
  border-bottom: 1px solid #f1f5f9;
}
.wiz-form-row:last-child { border-bottom: none; }
.wiz-label {
  width: 280px; flex-shrink: 0;
  font-size: 14px; font-weight: 500; color: var(--text);
  padding-top: 8px;
}
.wiz-field { flex: 1; }
.wiz-field .form-control {
  width: 100%; max-width: 460px;
}
.wiz-field-double { display: flex; gap: 12px; flex: 1; }
.wiz-field-double .form-control { flex: 1; }
.wiz-field-triple { display: flex; gap: 12px; flex: 1; }
.wiz-field-triple .form-control { flex: 1; }

/* Step 2: Field table */
.wiz-fields-table th { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .3px; }
.wiz-fields-table td { vertical-align: middle; }
.wiz-fields-table input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; accent-color: var(--info); }
.wiz-sort-input { text-align: center; }

/* Step 3: Program Mapping */
.wiz-mapping-section {
  border: 1px solid var(--border); border-radius: var(--radius);
  margin-bottom: 16px; overflow: hidden;
}
.wiz-mapping-header {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.wiz-mapping-icon {
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--info-bg); color: var(--info);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.wiz-mapping-label { font-size: 14px; font-weight: 600; display: block; }
.wiz-mapping-count { font-size: 12px; color: var(--text-muted); }
.wiz-mapping-body { padding: 0; }
.wiz-mapping-search {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-bottom: 1px solid #f1f5f9;
}
.wiz-mapping-actions {
  display: flex; gap: 8px; padding: 8px 16px;
  border-bottom: 1px solid #f1f5f9;
}
.wiz-mapping-list {
  max-height: 220px; overflow-y: auto;
}
.wiz-mapping-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; cursor: pointer; font-size: 13px;
  border-bottom: 1px solid #f8fafc;
  transition: background .1s;
}
.wiz-mapping-item:hover { background: var(--bg); }
.wiz-mapping-item:last-child { border-bottom: none; }
.wiz-mapping-item input[type="checkbox"] {
  width: 16px; height: 16px; accent-color: var(--info); cursor: pointer; flex-shrink: 0;
}
.wiz-fields-table tr.wiz-field-selected { background: var(--info-bg); }
.wiz-fields-table .wiz-label-input { border: 1px solid var(--border); border-radius: 4px; padding: 4px 8px; }
.wiz-fields-table .wiz-label-input:focus { border-color: var(--info); outline: none; }
.wiz-field-delete { opacity: .5; transition: opacity .15s; }
.wiz-field-delete:hover { opacity: 1; }

/* Step 3: Style & Preview layout */
.wiz-step3-layout { display: flex; gap: 0; min-height: 600px; }
.wiz-style-panel {
  width: 360px; flex-shrink: 0;
  border-right: 1px solid var(--border);
  overflow-y: auto; max-height: 700px;
}
.wiz-style-panel h3 {
  font-size: 15px; font-weight: 600; padding: 16px 20px;
  border-bottom: 1px solid var(--border); margin: 0;
}

/* Accordions */
.wiz-accordion { border-bottom: 1px solid var(--border); }
.wiz-accordion-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; cursor: pointer;
  font-size: 14px; font-weight: 500; color: var(--text);
  transition: background .15s ease;
}
.wiz-accordion-header:hover { background: var(--bg); }
.wiz-accordion-header svg { transition: transform .2s ease; color: var(--text-muted); }
.wiz-accordion.open .wiz-accordion-header svg { transform: rotate(180deg); }
.wiz-accordion-body {
  max-height: 0; overflow: hidden; padding: 0 20px;
  transition: max-height .3s ease, padding .3s ease;
}
.wiz-accordion.open .wiz-accordion-body {
  max-height: 600px; padding: 0 20px 16px;
}
.wiz-accordion-body .form-group { margin-bottom: 10px; }
.wiz-accordion-body .form-group label { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; display: block; }
.wiz-accordion-body .form-row { display: flex; gap: 12px; margin-bottom: 10px; }
.wiz-accordion-body .form-group { flex: 1; }

/* Preview panel */
.wiz-preview-panel { flex: 1; display: flex; flex-direction: column; }
.wiz-preview-toolbar {
  display: flex; align-items: center; gap: 16px;
  padding: 10px 20px; border-bottom: 1px solid var(--border);
  font-size: 13px; color: var(--text-muted);
}
.wiz-preview-devices { display: flex; gap: 4px; }
.wiz-device {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 6px;
  background: #fff; cursor: pointer;
  color: var(--text-muted);
  transition: all .15s ease;
}
.wiz-device:hover { border-color: var(--info); color: var(--info); }
.wiz-device.active { border-color: var(--info); background: var(--info-bg); color: var(--info); }
.wiz-preview-dims { display: flex; gap: 6px; margin-left: auto; align-items: center; }

.wiz-preview-frame {
  flex: 1; display: flex; align-items: flex-start; justify-content: center;
  padding: 24px; background: #f0f0f0; overflow: auto;
}
.wiz-preview-phone {
  width: 100%; max-width: 400px;
  background: #e8e8e8; border-radius: 28px;
  padding: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,.12);
  transition: max-width .3s ease;
}
.wiz-phone-notch {
  width: 80px; height: 6px; background: #ccc;
  border-radius: 3px; margin: 0 auto 10px;
}
.wiz-phone-screen {
  background: #fff; border-radius: 16px;
  padding: 20px; min-height: 400px;
  overflow-y: auto; max-height: 500px;
}
.wiz-phone-home {
  width: 40px; height: 40px; border-radius: 50%;
  border: 2px solid #ccc; margin: 10px auto 0;
}

/* Wizard footer */
.wiz-footer {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 12px; padding: 16px 24px;
  border-top: 1px solid var(--border);
}

/* Step 4: Field Order drag-and-drop */
.fo-item:hover { box-shadow: 0 2px 8px rgba(0,0,0,.08); border-color: #d1d5db !important; }
.fo-item:active { cursor: grabbing; }
.fo-item.dragging { opacity: 0.4; }

@media (max-width: 900px) {
  .wiz-step3-layout { flex-direction: column; }
  .wiz-style-panel { width: 100%; max-height: none; border-right: none; border-bottom: 1px solid var(--border); }
  .wiz-form-row { flex-direction: column; gap: 8px; }
  .wiz-label { width: auto; padding-top: 0; }
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Widget list actions */
.wg-actions { display: flex; align-items: center; gap: 4px; }

/* Embed modal */
.wg-modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.4); z-index: 1000;
  display: flex; align-items: center; justify-content: center;
}
.wg-modal {
  background: #fff; border-radius: var(--radius);
  box-shadow: var(--shadow-md); width: 520px; max-width: 90vw;
}
.wg-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.wg-modal-header h3 { font-size: 16px; font-weight: 600; }
.wg-modal-body { padding: 20px; }

/* ============================================
   Custom Scrollbar
   ============================================ */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-light); }

/* ============================================
   Toast Notifications
   ============================================ */
.toast-container {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 2000; display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 20px;
  box-shadow: var(--shadow-lg); display: flex; align-items: center;
  gap: 8px; animation: toastSlideIn .3s ease; min-width: 280px;
}
@keyframes toastSlideIn {
  from { opacity: 0; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}
.toast.success { border-left: 3px solid var(--lime); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.warning { border-left: 3px solid var(--warning); }
.toast-message { font-size: 13px; color: var(--text); }

/* ============================================
   Status Badges (extended)
   ============================================ */
.status-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 4px;
  font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .03em;
}
.status-badge.success { background: rgba(16,185,129,.1); color: var(--lime); }
.status-badge.warning { background: rgba(245,158,11,.1); color: var(--warning); }
.status-badge.danger { background: rgba(239,68,68,.1); color: var(--danger); }
.status-badge.info { background: rgba(59,130,246,.1); color: var(--info); }

/* ============================================
   Loading Spinner
   ============================================ */
.loading-spinner {
  display: flex; align-items: center; justify-content: center; padding: 48px;
}
.spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--lime);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

/* ============================================
   Tag Components
   ============================================ */
.tag {
  display: inline-block; padding: 2px 8px;
  border-radius: 4px; font-size: 12px; font-weight: 500;
}
.tag-red { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.tag-yellow { background: #fffbeb; color: #d97706; border: 1px solid #fde68a; }
.tag-blue { background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe; }
.tag-green { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }

/* ============================================
   Inline Code & Code Block
   ============================================ */
.inline-code {
  background: var(--bg); padding: 2px 6px;
  border-radius: 4px; font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: .85em; color: var(--danger);
}
.code-block {
  background: #1e293b; color: #e2e8f0;
  padding: 16px; border-radius: var(--radius);
  overflow-x: auto; margin: 16px 0;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 13px; line-height: 1.5;
}
.code-block code { color: inherit; background: none; padding: 0; }
