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

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

:root {
  --teal:       #6d28d9;
  --teal-dark:  #5b21b6;
  --teal-light: #f5f3ff;
  --dark:       #1e1b3a;
  --dark2:      #2a2350;
  --white:      #fff;
  --bg:         #F4F7FB;
  --bg2:        #EEF2F8;
  --border:     #E2E8F0;
  --border2:    #CBD5E0;
  --text:       #1A202C;
  --text2:      #2D3748;
  --muted:      #718096;
  --success:    #38A169;
  --danger:     #E53E3E;
  --warning:    #D69E2E;
  --primary:    #6d28d9;
  --radius:     10px;
  --shadow-sm:  0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow:     0 2px 8px rgba(0,0,0,.08), 0 1px 3px rgba(0,0,0,.05);
  --shadow-md:  0 4px 16px rgba(0,0,0,.1), 0 2px 6px rgba(0,0,0,.06);
}

body { font-family: 'Manrope', sans-serif; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }

a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── TOP NAV ── */
.top-nav {
  background: var(--dark);
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 4px;
  height: 52px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 rgba(255,255,255,.05), 0 2px 12px rgba(0,0,0,.25);
}
.nav-brand {
  font-size: 15px; font-weight: 800; color: #fff;
  margin-right: 12px; white-space: nowrap; letter-spacing: -.3px;
  text-decoration: none;
}
.nav-brand:hover { text-decoration: none; }
.nav-brand span { color: var(--teal); }
.nav-links { display: flex; gap: 1px; flex: 1; overflow: hidden; }
.nav-link {
  color: rgba(255,255,255,.55); padding: 5px 11px; border-radius: 7px;
  font-weight: 500; font-size: 13px; transition: all .15s; white-space: nowrap;
}
.nav-link:hover  { background: rgba(255,255,255,.08); color: rgba(255,255,255,.9); text-decoration: none; }
.nav-link.active { background: rgba(109,40,217,.18);   color: #5DD8EE; text-decoration: none; }
.nav-user { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-shrink: 0; }
.nav-username { color: rgba(255,255,255,.65); font-size: 12px; font-weight: 500; white-space: nowrap; }
.nav-branch-badge { background: rgba(255,255,255,.12); color: #fff; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 12px; white-space: nowrap; letter-spacing: .2px; }
.nav-branch-select { background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.2); border-radius: 8px; font-size: 12px; font-weight: 700; padding: 4px 8px; cursor: pointer; outline: none; }
.nav-branch-select option { background: #1e3a5f; color: #fff; }
.nav-logout {
  color: rgba(255,255,255,.35); font-size: 12px; padding: 4px 8px;
  border-radius: 6px; transition: all .15s;
}
.nav-logout:hover { background: rgba(255,255,255,.08); color: rgba(255,255,255,.8); text-decoration: none; }

/* hamburger — hidden on desktop */
.nav-burger {
  display: none;
  flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; width: 36px; height: 36px; border-radius: 8px;
  background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,.7); transition: background .15s;
  flex-shrink: 0; padding: 0;
}
.nav-burger:hover { background: rgba(255,255,255,.1); }
.nav-burger span { display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; transition: all .2s; }

/* ── BELL ── */
.nav-bell {
  position: relative; display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 8px;
  background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,.55); transition: background .15s, color .15s;
  flex-shrink: 0;
}
.nav-bell:hover { background: rgba(255,255,255,.1); color: rgba(255,255,255,.9); }
.bell-badge {
  position: absolute; top: 2px; right: 2px;
  background: #EF4444; color: #fff; font-size: 9px; font-weight: 800;
  min-width: 14px; height: 14px; border-radius: 7px; padding: 0 3px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--dark); line-height: 1;
}

/* ── NOTIFICATION PANEL ── */
#notif-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,.3); backdrop-filter: blur(2px);
}
#notif-panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 1001;
  width: 380px; max-width: 100vw;
  background: var(--bg); display: flex; flex-direction: column;
  box-shadow: -8px 0 40px rgba(0,0,0,.18);
  animation: panel-in .22s cubic-bezier(.25,.8,.25,1);
}
@keyframes panel-in { from { transform: translateX(100%); opacity:.6; } to { transform: none; opacity:1; } }
.notif-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; flex-shrink: 0;
  background: var(--dark);
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.notif-panel-title { font-weight: 700; font-size: 14px; color: #fff; letter-spacing: -.2px; }
.notif-close {
  background: none; border: none; color: rgba(255,255,255,.5);
  font-size: 16px; cursor: pointer; padding: 4px 7px; border-radius: 6px; line-height: 1;
  transition: all .15s;
}
.notif-close:hover { background: rgba(255,255,255,.1); color: #fff; }
#notif-panel-body { flex: 1; overflow-y: auto; }
.notif-loading {
  padding: 48px 20px; text-align: center; color: var(--muted); font-size: 13px;
}
.notif-section-title {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px;
  color: var(--muted); padding: 14px 18px 6px;
}
.notif-item {
  display: flex; gap: 11px; padding: 11px 18px;
  border-bottom: 1px solid var(--border); cursor: pointer;
  transition: background .12s; text-decoration: none; color: inherit;
}
.notif-item:hover { background: #fff; text-decoration: none; }
.notif-icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0; margin-top: 1px;
}
.notif-icon.booking { background: var(--teal-light); }
.notif-icon.visit   { background: #ECFDF5; }
.notif-content { flex: 1; min-width: 0; }
.notif-name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.notif-meta { font-size: 11px; color: var(--muted); margin-top: 2px; line-height: 1.4; }
.notif-tag {
  display: inline-block; font-size: 10px; font-weight: 600; padding: 1px 6px;
  border-radius: 20px; margin-top: 5px; letter-spacing: .2px;
}
.notif-tag.new-booking { background: var(--teal-light); color: #4f46e5; }
.notif-tag.new-visit   { background: #DCFCE7; color: #166534; }
.notif-time { font-size: 10px; color: var(--muted); flex-shrink: 0; margin-top: 2px; }
.notif-empty {
  padding: 56px 20px; text-align: center; color: var(--muted); font-size: 13px;
}
.notif-empty::before { content: '✓'; display: block; font-size: 28px; margin-bottom: 8px; color: var(--success); }
.notif-footer {
  padding: 12px 18px; border-top: 1px solid var(--border);
  display: flex; gap: 8px; flex-shrink: 0; background: #fff;
}
.notif-footer a {
  flex: 1; text-align: center; padding: 8px; border-radius: 8px;
  font-size: 12px; font-weight: 600; background: var(--bg);
  color: var(--text2); text-decoration: none; border: 1.5px solid var(--border);
  transition: all .15s;
}
.notif-footer a:hover { border-color: var(--teal); color: var(--teal); text-decoration: none; background: var(--teal-light); }

/* ── TOAST ── */
#crm-toasts {
  position: fixed; top: 62px; right: 16px; z-index: 9999;
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.crm-toast {
  background: #fff; border: 1px solid var(--border); border-left: 3px solid var(--teal);
  border-radius: 10px; padding: 12px 15px; min-width: 290px; max-width: 340px;
  box-shadow: var(--shadow-md); pointer-events: all; cursor: pointer;
  animation: toast-in .22s cubic-bezier(.25,.8,.25,1);
}
.crm-toast.fade-out { animation: toast-out .28s ease forwards; }
.crm-toast-title { font-weight: 700; font-size: 12px; margin-bottom: 3px; color: var(--dark); letter-spacing: -.1px; }
.crm-toast-body  { font-size: 12px; color: var(--muted); line-height: 1.4; }
@keyframes toast-in  { from { opacity:0; transform:translateX(32px); } to { opacity:1; transform:none; } }
@keyframes toast-out { from { opacity:1; transform:none; } to { opacity:0; transform:translateX(32px); } }

/* ── LAYOUT ── */
.page-wrap { max-width: 1300px; margin: 0 auto; padding: 24px 20px; }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.page-header h1 { font-size: 21px; font-weight: 800; letter-spacing: -.3px; }
.header-actions { display: flex; gap: 8px; }
.back-link { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }

/* ── CARD ── */
.card {
  background: #fff; border-radius: 12px; border: 1px solid var(--border);
  padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow-sm);
}
.card-title {
  font-size: 13px; font-weight: 700; color: var(--text2);
  margin-bottom: 14px; padding-bottom: 11px; border-bottom: 1px solid var(--border);
  letter-spacing: -.1px;
}
.card-meta { padding: 14px 18px; }
.meta-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 13px;
}
.meta-row:last-child { border-bottom: none; }
.meta-row span:first-child { color: var(--muted); }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 600;
  cursor: pointer; border: none; transition: all .15s; white-space: nowrap;
  background: transparent; line-height: 1.4; letter-spacing: -.1px;
}
.btn:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

.btn-primary {
  background: linear-gradient(135deg, #00AECB 0%, #007E98 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(109,40,217,.35), inset 0 1px 0 rgba(255,255,255,.15);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #00BFDF 0%, #008EAB 100%);
  box-shadow: 0 4px 14px rgba(109,40,217,.45);
  color: #fff; text-decoration: none; transform: translateY(-1px);
}
.btn-primary:active { transform: none; box-shadow: 0 1px 4px rgba(109,40,217,.3); }

.btn-secondary {
  background: #fff; color: var(--text2);
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.btn-secondary:hover {
  border-color: var(--teal); color: var(--teal);
  background: var(--teal-light); text-decoration: none; box-shadow: none;
}

.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text2); }
.btn-outline:hover { border-color: var(--teal); color: var(--teal); text-decoration: none; }

.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--bg); color: var(--text); text-decoration: none; }

.btn-danger {
  background: linear-gradient(135deg, #FC8181 0%, #E53E3E 100%);
  color: #fff; box-shadow: 0 2px 8px rgba(229,62,62,.3);
}
.btn-danger:hover { filter: brightness(1.07); color: #fff; text-decoration: none; transform: translateY(-1px); }

.btn-full { width: 100%; justify-content: center; }
.btn-sm   { padding: 5px 11px; font-size: 12px; border-radius: 7px; }
.btn-xs   { padding: 3px 8px;  font-size: 11px; border-radius: 6px; }

/* ── FORMS ── */
.form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.form-group label, .form-label {
  font-size: 11px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .5px; display: block; margin-bottom: 2px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

input[type=text], input[type=password], input[type=number], input[type=datetime-local],
input[type=date], input[type=time], input[type=search], input[type=email],
select, textarea, .form-control {
  width: 100%; padding: 9px 12px; border: 1.5px solid var(--border); border-radius: 8px;
  font-size: 13px; font-family: inherit; color: var(--text); background: #fff;
  transition: border-color .15s, box-shadow .15s; box-sizing: border-box;
}
input:focus, select:focus, textarea:focus, .form-control:focus {
  outline: none; border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(109,40,217,.12);
}
input:disabled, select:disabled { background: var(--bg); color: var(--muted); cursor: not-allowed; }
textarea { resize: vertical; min-height: 70px; }
.req { color: var(--danger); }
.input-sm { padding: 5px 10px; font-size: 12px; border-radius: 7px; border: 1.5px solid var(--border); font-family: inherit; }
.input-sm:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(109,40,217,.1); }

/* ── ALERTS ── */
.alert {
  padding: 11px 14px 11px 16px;
  border-radius: 9px; margin-bottom: 14px;
  font-weight: 500; font-size: 13px;
  display: flex; align-items: flex-start; gap: 8px;
  border: 1px solid transparent;
}
.alert-error   { background: #FFF5F5; border-color: #FED7D7; color: #C53030; border-left: 3px solid #E53E3E; }
.alert-success { background: #F0FFF4; border-color: #C6F6D5; color: #276749; border-left: 3px solid #38A169; }
.alert-warning { background: #FFFBEB; border-color: #FEEBC8; color: #744210; border-left: 3px solid #D69E2E; }
.alert-info    { background: var(--teal-light); border-color: #B2E4F0; color: #0E6B7C; border-left: 3px solid var(--teal); }
.alert-danger  { background: #FFF5F5; border-color: #FED7D7; color: #C53030; border-left: 3px solid #E53E3E; }

/* ── TABLE ── */
.table-wrap { overflow-x: auto; border-radius: 0 0 10px 10px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  background: var(--bg); padding: 9px 12px; text-align: left;
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
  color: var(--muted); border-bottom: 1px solid var(--border); white-space: nowrap;
}
.data-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tbody tr:hover td { background: #F7FBFF; }
.data-table tbody tr:last-child td { border-bottom: none; }
.text-center { text-align: center; }
.empty-row { text-align: center; padding: 40px; color: var(--muted); }
.row-overdue td { background: #FFFBEB !important; }
.row-inactive td { opacity: .5; }
.tiny { font-size: 11px; }
.text-muted   { color: var(--muted); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }

/* ── BADGES ── */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 600;
  white-space: nowrap; letter-spacing: .1px;
}
.badge-lg { padding: 5px 13px; font-size: 12px; }

.badge-new          { background: #EBF8FF; color: #2B6CB0; }
.badge-calling      { background: #FEFCE8; color: #854D0E; }
.badge-appointed    { background: #F3E8FF; color: #6B21A8; }
.badge-came         { background: #DCFCE7; color: #166534; }
.badge-bought       { background: #DCFCE7; color: #166534; border: 1.5px solid #86EFAC; }
.badge-refused      { background: #FEE2E2; color: #991B1B; }
.badge-unreachable  { background: #F1F5F9; color: #475569; }
.badge-interested   { background: #EFF6FF; color: #1E40AF; }
.badge-no_answer    { background: #F1F5F9; color: #475569; }
.badge-contraindicated { background: #FEE2E2; color: #991B1B; font-style: italic; }
.badge-cold { background: #F1F5F9; color: #475569; }
.badge-warm { background: #FEFCE8; color: #854D0E; }
.badge-count {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; background: var(--bg); border: 1px solid var(--border);
  border-radius: 50%; font-size: 11px; font-weight: 700;
}

.source-badge { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.source-facebook  { background: #EFF6FF; color: #1D4ED8; }
.source-instagram { background: #FDF2F8; color: #9D174D; }
.source-telegram  { background: #EFF6FF; color: #1D4ED8; }
.source-manual    { background: var(--bg); color: var(--muted); }
.source-other     { background: var(--bg); color: var(--muted); }

.calls-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; background: var(--teal-light); color: var(--teal);
  border-radius: 50%; font-size: 11px; font-weight: 700;
}
.overdue-tag {
  display: inline-block; background: #FEF2F2; color: var(--danger);
  border-radius: 4px; padding: 1px 6px; font-size: 10px; font-weight: 700; margin-left: 4px;
}

/* ── STATUS TABS ── */
.status-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 14px; padding: 3px; background: var(--bg); border-radius: 10px; border: 1px solid var(--border); width: fit-content; }
.tab {
  padding: 5px 13px; border-radius: 7px; font-size: 12px; font-weight: 600;
  color: var(--muted); background: transparent; border: none;
  transition: all .15s; cursor: pointer; text-decoration: none;
}
.tab:hover { color: var(--text); background: rgba(0,0,0,.04); text-decoration: none; }
.tab.active { background: #fff; color: var(--teal); box-shadow: var(--shadow-sm); text-decoration: none; }
.tab-count { font-size: 10px; opacity: .7; margin-left: 3px; }

/* ── FILTERS ── */
.filters-bar { margin-bottom: 16px; }
.filters-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filter-search {
  flex: 1; min-width: 200px; max-width: 320px; padding: 8px 12px 8px 34px;
  border: 1.5px solid var(--border); border-radius: 8px; font-size: 13px;
  font-family: inherit; background: #fff 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='%23A0AEC0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") 10px center no-repeat;
  transition: border-color .15s, box-shadow .15s;
}
.filter-search:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(109,40,217,.1); }
.filter-select {
  padding: 8px 12px; border: 1.5px solid var(--border); border-radius: 8px;
  font-size: 13px; font-family: inherit; background: #fff; color: var(--text);
  transition: border-color .15s, box-shadow .15s; cursor: pointer;
}
.filter-select:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(109,40,217,.1); }

/* ── SEARCH BAR ── */
.search-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.search-input {
  flex: 1; min-width: 200px; padding: 8px 14px; background: #fff;
  border: 1.5px solid var(--border); border-radius: 8px;
  font-size: 13px; font-family: inherit; transition: border-color .15s, box-shadow .15s;
}
.search-input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(109,40,217,.1); }

/* ── PAGINATION ── */
.pagination { display: flex; gap: 4px; margin-top: 16px; flex-wrap: wrap; align-items: center; }
.page-btn, .page-link {
  padding: 6px 12px; border-radius: 7px; font-size: 13px; font-weight: 600;
  border: 1.5px solid var(--border); color: var(--text2); display: inline-flex;
  align-items: center; background: #fff; transition: all .15s;
}
.page-btn:hover, .page-link:hover { border-color: var(--teal); color: var(--teal); text-decoration: none; }
.page-btn.active, .page-link.active { background: var(--teal); border-color: var(--teal); color: #fff; box-shadow: 0 2px 8px rgba(109,40,217,.3); }
.page-dots { padding: 6px 4px; color: var(--muted); font-size: 13px; }

/* ── LEAD DETAIL ── */
.lead-layout { display: grid; grid-template-columns: 1fr 320px; gap: 16px; align-items: start; }
.lead-main { display: flex; flex-direction: column; gap: 0; }
.lead-side { display: flex; flex-direction: column; gap: 0; }
.lead-name { font-weight: 600; color: var(--dark); }
.lead-name:hover { color: var(--teal); }
.lead-phone { font-size: 12px; color: var(--muted); margin-top: 2px; }
.inline-assign { border: 1.5px solid var(--border); border-radius: 7px; padding: 4px 8px; font-size: 12px; background: #fff; font-family: inherit; transition: border-color .15s; }
.inline-assign:focus { outline: none; border-color: var(--teal); }

/* ── CALL LOG ── */
.call-form-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.call-form-row select { flex-shrink: 0; width: 160px; }
.call-form-row input  { flex: 1; min-width: 120px; }
.call-log { display: flex; flex-direction: column; gap: 8px; }
.call-entry { padding: 10px 13px; background: var(--bg); border-radius: 9px; border: 1px solid var(--border); }
.call-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.call-result { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 20px; }
.call-no_answer   { background: #F1F5F9; color: #475569; }
.call-callback    { background: #FEFCE8; color: #854D0E; }
.call-appointed   { background: #DCFCE7; color: #166534; }
.call-refused     { background: #FEE2E2; color: #991B1B; }
.call-interested  { background: #EFF6FF; color: #1E40AF; }
.call-other       { background: var(--bg); color: var(--muted); }
.call-who    { font-size: 13px; font-weight: 600; }
.call-time   { font-size: 12px; color: var(--muted); }
.call-comment{ font-size: 13px; color: var(--text2); padding-top: 4px; }

/* ── VISIT CHECKS ── */
.visit-checks { display: flex; gap: 20px; margin: 12px 0; }
.check-label { display: flex; align-items: center; gap: 6px; font-weight: 600; cursor: pointer; }
.check-label input { width: 16px; height: 16px; accent-color: var(--teal); }

/* ── UPLOAD ── */
.upload-layout { display: grid; grid-template-columns: 1fr 340px; gap: 16px; align-items: start; }
.drop-zone {
  border: 2px dashed var(--border); border-radius: 12px; padding: 44px 20px;
  text-align: center; cursor: pointer; transition: all .2s; background: #fafcff;
}
.drop-zone:hover, .drop-zone.dragover { border-color: var(--teal); background: var(--teal-light); }
.drop-icon { font-size: 36px; margin-bottom: 12px; }
.drop-hint { font-size: 12px; margin-top: 8px; color: var(--muted); }
.link-label { color: var(--teal); cursor: pointer; font-weight: 600; }
.col-mapping { display: flex; flex-direction: column; gap: 8px; }
.col-map-row { display: flex; align-items: center; gap: 12px; }
.col-label { width: 120px; font-size: 13px; font-weight: 600; color: var(--muted); flex-shrink: 0; }
.col-label.required { color: var(--text); }
.col-map-row select { flex: 1; }

/* ── DASHBOARD ── */
.funnel-row { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.funnel-card {
  flex: 1; min-width: 120px; background: #fff; border: 1px solid var(--border);
  border-radius: 12px; padding: 18px; text-align: center; box-shadow: var(--shadow-sm);
}
.funnel-val { font-size: 30px; font-weight: 800; color: var(--dark); letter-spacing: -.5px; }
.funnel-lbl { font-size: 10px; color: var(--muted); margin-top: 4px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; }
.period-tabs { display: flex; gap: 4px; }
.kpi-table th, .kpi-table td { text-align: center; }
.kpi-table td:first-child { text-align: left; }
.conv-pill { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.conv-good { background: #DCFCE7; color: #166534; }
.conv-mid  { background: #FEFCE8; color: #854D0E; }
.conv-low  { background: #FEE2E2; color: #991B1B; }
.stats-row { display: flex; gap: 12px; flex-wrap: wrap; }
.stat-card { flex: 1; min-width: 160px; text-align: center; padding: 20px; }
.stat-val { font-size: 32px; font-weight: 800; letter-spacing: -.5px; }
.stat-lbl { font-size: 11px; color: var(--muted); margin-top: 4px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; }

/* ── ADMIN ── */
.admin-layout { display: grid; grid-template-columns: 1fr 400px; gap: 16px; align-items: start; }
.role-badge { display: inline-flex; padding: 2px 9px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.role-admin     { background: #F3E8FF; color: #6B21A8; }
.role-sales     { background: var(--teal-light); color: #0E6B7C; }
.role-doctor    { background: #DCFCE7; color: #166534; }
.role-manager   { background: var(--teal-light); color: #0E6B7C; }
.role-marketing { background: #FDF2F8; color: #9D174D; }

/* ── CLIENT CARD ── */
.client-header { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.client-avatar {
  width: 52px; height: 52px; border-radius: 14px;
  background: linear-gradient(135deg, #00AECB, #007E98);
  color: #fff; font-size: 20px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(109,40,217,.3);
}
.client-meta { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* ── SUB SESSIONS ── */
.sessions-bar { height: 6px; background: var(--border); border-radius: 3px; margin-top: 6px; overflow: hidden; }
.sessions-bar-fill { height: 100%; background: linear-gradient(90deg, #00AECB, #007E98); border-radius: 3px; }
.sessions-label { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ── TWO COL GRID ── */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 700px) { .two-col { grid-template-columns: 1fr; } }

/* ── BONUS TYPES ── */
.bonus-A        { color: #166534; font-weight: 600; }
.bonus-C        { color: #854D0E; font-weight: 600; }
.bonus-B_caller { color: #1E40AF; }
.bonus-B_seller { color: #166534; }

/* ── EMPTY STATE ── */
.empty-state { text-align: center; padding: 64px 20px; color: var(--muted); }
.empty-state p { margin-top: 6px; font-size: 14px; }

/* ── STAGE/ROUND PILLS ── */
.stage-pill { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 12px; font-weight: 500; }

/* ── LOGIN ── */
.login-page  { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--dark); }
.login-wrap  { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--dark); }
.login-box   { background: #fff; border-radius: 18px; padding: 40px; width: 360px; box-shadow: 0 12px 48px rgba(0,0,0,.4); }
.login-logo  { font-size: 26px; font-weight: 800; color: var(--dark); text-align: center; margin-bottom: 6px; letter-spacing: -.4px; }
.login-logo span { color: var(--teal); }
.login-sub   { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 28px; }
.alert-danger{ background: #FFF5F5; border-left: 3px solid #E53E3E; border-color: #FED7D7; color: #C53030; }

/* ── HINT / CHEAT SHEET ── */
.help-q-btn {
  background: none; border: 1.5px solid var(--border); border-radius: 50%;
  width: 20px; height: 20px; font-size: 11px; font-weight: 700;
  color: var(--muted); cursor: pointer; line-height: 1; padding: 0;
  vertical-align: middle; margin-left: 8px; transition: all .15s;
}
.help-q-btn:hover, .help-q-btn.open { background: var(--teal); color: #fff; border-color: var(--teal); }
.hint-block {
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  padding: 18px 22px; margin-bottom: 16px; box-shadow: 0 2px 12px rgba(0,0,0,.05);
}
.hint-cols { display: flex; gap: 24px; flex-wrap: wrap; }
.hint-col  { flex: 1; min-width: 160px; }
.hint-divider { width: 1px; background: var(--border); align-self: stretch; flex-shrink: 0; }
.hint-col-title {
  font-size: 13px; font-weight: 700; color: var(--dark); margin-bottom: 10px;
  display: flex; align-items: center; gap: 8px;
}
.hint-icon { width: 28px; height: 28px; border-radius: 7px; font-size: 14px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.hint-step { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; color: var(--muted); margin-bottom: 7px; line-height: 1.5; }
.hint-num  { background: var(--teal); color: #fff; border-radius: 50%; width: 18px; height: 18px; font-size: 10px; font-weight: 800; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 1px; }
.hint-dot  { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); opacity: .5; flex-shrink: 0; margin-top: 5px; }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .lead-layout, .upload-layout, .admin-layout { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .funnel-card { min-width: 100px; }
}
@media (max-width: 600px) {
  .page-wrap { padding: 16px 12px; }
  .top-nav { padding: 0 12px; }
  .nav-links {
    display: none;
    position: fixed; top: 52px; left: 0; right: 0;
    background: var(--dark);
    flex-direction: column;
    padding: 8px 10px 12px;
    gap: 2px;
    box-shadow: 0 6px 20px rgba(0,0,0,.35);
    z-index: 99;
  }
  .nav-links.open { display: flex; }
  .nav-link { padding: 10px 12px; font-size: 14px; }
  .nav-burger { display: flex; }
  .nav-username { display: none; }
  .nav-branch-badge { display: none; }
  .nav-branch-select { max-width: 110px; }
  .data-table { font-size: 12px; }
  .status-tabs { gap: 3px; flex-wrap: wrap; }
  .tab { padding: 5px 10px; font-size: 11px; }
  .page-header h1 { font-size: 17px; }
  .funnel-card { min-width: 80px; padding: 12px 10px; }
  .funnel-val { font-size: 22px; }
}
