/* ── Reset & Variables ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --accent:       #2ec4a0;
  --accent-light: #5edbbe;
  --accent-bright:#8aecd5;
  --accent-dark:  #1a9b7c;
  --accent-muted: #178268;
  --bg:           #f6f5f2;
  --bg2:          #efeee9;
  --bg3:          #ffffff;
  --border:       #ddd9d1;
  --border-light: #ccc7bd;
  --text:         #2a2a28;
  --text-muted:   #6e6b63;
  --text-dim:     #a09d95;
  --success:      #2ec47a;
  --danger:       #d95050;
  --radius:       10px;
  --shadow:       0 1px 4px rgba(0,0,0,.06), 0 2px 12px rgba(0,0,0,.04);
  --shadow-lg:    0 12px 48px rgba(0,0,0,.1);
  /* compat aliases */
  --primary:      var(--accent);
  --primary-dark: var(--accent-dark);
  --primary-light: rgba(46,196,160,0.1);
  --card:         var(--bg3);
  --navy-light:   var(--accent-dark);
  --gold:         var(--accent);
  --gold-light:   var(--accent-light);
  --gold-dark:    var(--accent-dark);
  --gold-muted:   var(--accent-muted);
  --gold-bright:  var(--accent-bright);
}

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

/* ── Login ─────────────────────────────────────────────────────────────── */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(46,196,160,0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(46,196,160,0.04) 0%, transparent 50%),
    var(--bg);
  position: relative;
  overflow: hidden;
}
.login-wrapper::before {
  content: '';
  position: absolute;
  width: 500px; height: 500px;
  border-radius: 50%;
  border: 1px solid rgba(46,196,160,0.08);
  top: -120px; right: -120px;
}
.login-wrapper::after {
  content: '';
  position: absolute;
  width: 350px; height: 350px;
  border-radius: 50%;
  border: 1px solid rgba(46,196,160,0.06);
  bottom: -80px; left: -80px;
}

.login-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 44px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg), 0 0 80px rgba(46,196,160,0.04);
  position: relative;
  z-index: 1;
}

.login-logo {
  text-align: center;
  margin-bottom: 28px;
}
.login-logo img {
  width: 240px;
  max-width: 100%;
  border-radius: 12px;
  padding: 12px 20px;
  margin-bottom: 14px;
  background: #fff;
  box-shadow: 0 1px 6px rgba(0,0,0,.08);
}
.login-logo h1 { font-size: 18px; font-weight: 700; color: var(--text); }
.login-logo p  { font-size: 12px; color: var(--text-muted); margin-top: 3px; letter-spacing: .06em; text-transform: uppercase; }

.login-card .error-msg {
  background: rgba(217,80,80,0.06);
  border: 1px solid rgba(217,80,80,0.18);
  color: #c04040;
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 16px;
}
.success-msg {
  background: rgba(46,196,122,0.06);
  border: 1px solid rgba(46,196,122,0.18);
  color: #1a8a5a;
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 16px;
}

.btn-login {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .2s, box-shadow .2s;
  margin-top: 4px;
  box-shadow: 0 4px 20px rgba(46,196,160,0.25);
  letter-spacing: .03em;
}
.btn-login:hover { opacity: .92; box-shadow: 0 6px 28px rgba(46,196,160,0.35); }

/* ── App Shell ─────────────────────────────────────────────────────────── */
.app-shell { display: flex; min-height: 100vh; }

/* ── Sidebar ───────────────────────────────────────────────────────────── */
.sidebar {
  width: 230px;
  min-height: 100vh;
  background: var(--bg3);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
}

.sidebar-header {
  padding: 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg3);
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sidebar-header .brand { display: flex; align-items: center; justify-content: center; padding: 12px; }
.sidebar-header .brand img {
  width: 170px;
  max-height: 52px;
  object-fit: contain;
  border-radius: 8px;
  padding: 6px 12px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.sidebar-nav {
  flex: 1;
  padding: 10px 7px;
  overflow-y: auto;
}

.nav-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-dim);
  padding: 10px 10px 4px;
  margin-top: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  margin-bottom: 2px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all .15s;
  text-decoration: none;
  border: none;
  border-left: 3px solid transparent;
  background: none;
  width: 100%;
  text-align: left;
  white-space: nowrap;
}
.nav-item:hover  { background: rgba(46,196,160,0.06); color: var(--accent-dark); }
.nav-item.active {
  background: rgba(46,196,160,0.08);
  border-left: 3px solid var(--accent);
  color: var(--accent-dark);
  font-weight: 700;
}
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }

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

.user-info {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  border-radius: 6px;
}
.user-avatar {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--accent-dark), var(--accent));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 13px;
  flex-shrink: 0;
}
.user-info-text { flex: 1; min-width: 0; }
.user-info-text .name  { font-size: 12px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-info-text .role  { font-size: 10px; color: var(--text-dim); text-transform: capitalize; }

.btn-logout {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 7px 10px;
  background: none; border: none;
  color: var(--danger); cursor: pointer;
  border-radius: 6px; font-size: 12px;
  transition: all .15s; margin-top: 2px;
}
.btn-logout:hover { background: rgba(217,80,80,0.06); }
.btn-logout svg { width: 15px; height: 15px; }

/* ── Main Content ──────────────────────────────────────────────────────── */
.main-content {
  margin-left: 230px;
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  position: relative;
}
.main-content::before {
  content: '';
  position: fixed;
  top: 50%; left: calc(230px + (100% - 230px) / 2);
  transform: translate(-50%, -50%);
  width: 300px; height: 300px;
  background: url('logo.png') no-repeat center / contain;
  opacity: 0.04;
  pointer-events: none;
  z-index: 0;
}

.topbar {
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  flex-shrink: 0;
}
.topbar h1 { font-size: 18px; font-weight: 700; color: var(--text); letter-spacing: .02em; }
.topbar .topbar-actions { display: flex; gap: 10px; align-items: center; }

.page-body { padding: 24px; flex: 1; }

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: var(--radius);
  font-size: 13px; font-weight: 600;
  cursor: pointer; border: none; transition: all .15s;
  text-decoration: none; white-space: nowrap;
}
.btn svg { width: 14px; height: 14px; flex-shrink: 0; }

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 10px rgba(46,196,160,0.25);
}
.btn-primary:hover { background: var(--accent-dark); box-shadow: 0 4px 16px rgba(46,196,160,0.3); }

.btn-danger  { background: rgba(217,80,80,0.08); color: #c04040; border: 1px solid rgba(217,80,80,0.15); }
.btn-danger:hover { background: rgba(217,80,80,0.14); }

.btn-ghost {
  background: var(--bg);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg2); color: var(--text); border-color: var(--border-light); }

.btn-sm   { padding: 4px 10px; font-size: 11px; }
.btn-icon { padding: 5px; border-radius: 6px; }

/* ── Card ──────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg3);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

/* ── Stats Row ─────────────────────────────────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  border-left: 3px solid var(--accent);
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 60px; height: 60px;
  background: radial-gradient(circle, rgba(46,196,160,0.05), transparent);
  border-radius: 50%;
}
.stat-card .stat-label { font-size: 11px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.stat-card .stat-value { font-size: 30px; font-weight: 800; color: var(--accent-dark); margin-top: 4px; }
.stat-card .stat-sub   { font-size: 11px; color: var(--text-dim); margin-top: 2px; }

/* ── Toolbar ───────────────────────────────────────────────────────────── */
.toolbar {
  display: flex; gap: 10px; align-items: center;
  flex-wrap: wrap; margin-bottom: 16px;
}

.search-wrap { position: relative; }
.search-wrap svg {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  color: var(--text-dim); width: 15px; height: 15px; pointer-events: none;
}
.search-input {
  flex: 1; min-width: 200px; max-width: 340px;
  padding: 8px 12px 8px 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  background: var(--bg3);
  color: var(--text);
  transition: border-color .15s;
  outline: none;
}
.search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(46,196,160,0.1); }

/* ── Table ─────────────────────────────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg3);
  box-shadow: var(--shadow);
}
table { width: 100%; border-collapse: collapse; font-size: 12.5px; min-width: 1100px; }

thead th {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 10px 12px;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  white-space: nowrap;
  position: sticky;
  top: 0;
}
tbody tr { border-bottom: 1px solid var(--border); transition: background .1s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: rgba(46,196,160,0.04); }
tbody td { padding: 10px 12px; vertical-align: middle; color: var(--text-muted); }
tbody td.bold, .td-customer { color: var(--text); font-weight: 600; }

.td-nowrap  { white-space: nowrap; }
.td-remarks { max-width: 180px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.td-actions { white-space: nowrap; display: flex; gap: 6px; align-items: center; }

/* Badges */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 12px;
  font-size: 10px; font-weight: 700;
}
.badge-air   { background: rgba(41,182,246,0.08); color: #0891b2; }
.badge-sea   { background: rgba(46,196,160,0.08); color: var(--accent-dark); }
.badge-road  { background: rgba(217,170,50,0.08); color: #a07820; }
.badge-other { background: rgba(46,196,160,0.08); color: var(--accent-dark); }
.badge-yes   { background: rgba(46,196,122,0.08); color: #1a8a5a; }
.badge-no    { background: rgba(120,120,120,0.06); color: #888; }

/* ── Forms ─────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }

label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text);
  background: var(--bg3);
  transition: border-color .15s;
  outline: none;
  font-family: inherit;
}
.form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(46,196,160,0.1); }
.form-control option { background: var(--bg3); color: var(--text); }

textarea.form-control { resize: vertical; min-height: 70px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-grid .span-2 { grid-column: span 2; }

/* Attendees checkboxes */
.attendees-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
  padding: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  max-height: 160px;
  overflow-y: auto;
}
.attendee-check {
  display: flex; align-items: center; gap: 7px;
  font-size: 13px; cursor: pointer; padding: 4px 6px;
  border-radius: 4px; transition: background .1s;
  color: var(--text-muted);
}
.attendee-check:hover { background: rgba(46,196,160,0.06); color: var(--text); }
.attendee-check input { cursor: pointer; accent-color: var(--accent); }

/* ── Modal ─────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.25);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  z-index: 500;
  padding: 20px;
  animation: fadeIn .15s;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(0,0,0,.12), 0 0 40px rgba(46,196,160,0.03);
  width: 100%;
  max-width: 780px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  animation: slideUp .2s;
}
@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
  border-radius: 16px 16px 0 0;
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.modal-header h2 { font-size: 15px; font-weight: 700; color: var(--text); }

.modal-close {
  background: none; border: none; cursor: pointer;
  color: var(--text-dim); padding: 4px; border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; line-height: 1;
  transition: color .15s;
}
.modal-close svg { width: 18px; height: 18px; }
.modal-close:hover { color: var(--accent); }

.modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}
.modal-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px;
  flex-shrink: 0;
}

/* ── Role badges ─────────────────────────────────────────────────────── */
.role-badge {
  display: inline-flex; align-items: center;
  padding: 2px 10px; border-radius: 12px;
  font-size: 11px; font-weight: 700;
}
.role-admin   { background: rgba(46,196,160,0.1); color: var(--accent-dark); }
.role-staff   { background: rgba(41,182,246,0.08); color: #0891b2; }
.role-contact { background: rgba(46,196,122,0.08); color: #1a8a5a; }

/* ── Chips ─────────────────────────────────────────────────────────────── */
.chip-list { display: flex; flex-wrap: wrap; gap: 4px; }
.chip {
  background: rgba(46,196,160,0.08);
  color: var(--accent-dark);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}

/* ── Empty State ───────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 56px 24px;
  color: var(--text-muted);
}
.empty-state svg { width: 48px; height: 48px; margin-bottom: 12px; opacity: .2; }
.empty-state h3  { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.empty-state p   { font-size: 13px; }

/* ── Toast ─────────────────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  top: 66px; right: 20px;
  z-index: 2000;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  padding: 11px 18px;
  border-radius: 9px;
  font-size: 13px; font-weight: 600;
  animation: slideIn .2s ease;
  max-width: 320px;
}
@keyframes slideIn {
  from { transform: translateX(20px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
.toast-success { background: #f0faf5; border: 1px solid #b0e8cc; color: #1a7a4a; }
.toast-error   { background: #fef2f2; border: 1px solid #f0bfbf; color: #b03030; }
.toast-info    { background: var(--bg3); border: 1px solid var(--border); color: var(--accent-dark); }

/* ── Confirm dialog ────────────────────────────────────────────────────── */
.confirm-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.25);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  z-index: 600;
}
.confirm-box {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 28px 20px;
  max-width: 380px; width: 100%;
  box-shadow: var(--shadow-lg);
  animation: slideUp .15s;
}
.confirm-box h3 { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.confirm-box p  { font-size: 13px; color: var(--text-muted); margin-bottom: 20px; }
.confirm-box .actions { display: flex; justify-content: flex-end; gap: 10px; }

/* ── Misc ──────────────────────────────────────────────────────────────── */
.section-title {
  font-size: 14px; font-weight: 700;
  margin-bottom: 12px; color: var(--text);
  display: flex; align-items: center; gap: 8px;
}
.section-title svg { width: 15px; height: 15px; }

.divider { height: 1px; background: var(--border); margin: 16px 0; }
.text-muted { color: var(--text-muted); }
.text-sm    { font-size: 12px; }

/* ── UID badge ─────────────────────────────────────────────────────────── */
.uid-badge {
  display: inline-block;
  font-family: monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--accent-dark);
  padding: 2px 7px;
  border-radius: 4px;
  cursor: default;
  user-select: all;
}

/* ── Contact detail grid ────────────────────────────────────────────────── */
.contact-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 28px;
}
.detail-field { display: flex; flex-direction: column; gap: 3px; }
.detail-label {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-dim);
}
.detail-value { font-size: 13px; color: var(--text); }
.detail-value a { color: var(--accent-dark); text-decoration: none; }
.detail-value a:hover { text-decoration: underline; }

/* ── Two-column attendees ──────────────────────────────────────────────── */
.two-col-attendees {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 4px;
}
@media (max-width: 600px) { .two-col-attendees { grid-template-columns: 1fr; } }

/* ── Stage badge ────────────────────────────────────────────────────────── */
.stage-badge {
  display: inline-block;
  font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: 20px;
  border: 1px solid;
  background: transparent;
  white-space: nowrap;
}

/* ── Form section title ─────────────────────────────────────────────────── */
.form-section-title {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--accent-muted);
  margin: 16px 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

/* ── Dashboard ──────────────────────────────────────────────────────────── */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 20px;
}
.dash-card { padding: 20px; min-height: 200px; }
.dash-task-item {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.dash-task-item:last-child { border-bottom: none; }
.dash-task-left { display: flex; align-items: flex-start; gap: 10px; }
.dash-task-title { font-size: 13px; font-weight: 600; }
.priority-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0; margin-top: 4px;
}
.priority-dot.priority-high   { background: #d95050; }
.priority-dot.priority-medium { background: #e0a030; }
.priority-dot.priority-low    { background: var(--accent); }
.dash-activity-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--border);
}
.dash-activity-item:last-child { border-bottom: none; }
.dash-act-info { flex: 1; min-width: 0; }
.act-type-dot {
  width: 10px; height: 10px;
  border-radius: 50%; flex-shrink: 0; margin-top: 4px;
}
.act-call      { background: #0891b2; }
.act-meeting   { background: var(--accent); }
.act-visit     { background: #2ec47a; }
.act-email     { background: #8b5cf6; }
.act-whatsapp  { background: #22a44a; }
.act-video     { background: #e0881a; }
.act-video-call { background: #e0881a; }
.act-other     { background: #8899a6; }

/* ── Kanban Pipeline ────────────────────────────────────────────────────── */
.kanban-board {
  display: flex; gap: 14px;
  align-items: flex-start;
  min-width: max-content;
  padding-bottom: 20px;
}
.kanban-col {
  width: 220px; flex-shrink: 0;
  background: var(--bg3);
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow: hidden;
}
.kanban-col-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg2);
}
.kanban-col-title { font-size: 13px; font-weight: 700; color: var(--text); }
.kanban-col-count {
  font-size: 11px; font-weight: 700;
  background: var(--border); color: var(--text-muted);
  padding: 1px 7px; border-radius: 10px;
}
.kanban-cards { padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 100px; }
.kanban-empty { color: var(--text-dim); font-size: 12px; text-align: center; padding: 20px 0; }
.kanban-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  cursor: pointer;
  transition: border-color .15s, transform .1s;
}
.kanban-card:hover { border-color: var(--accent); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(46,196,160,0.08); }
.kanban-card { cursor: grab; }
.kanban-card:active { cursor: grabbing; }
.kanban-card.dragging { opacity: 0.4; transform: scale(0.95); }
.kanban-col.drag-over { background: rgba(46,196,160,0.08); outline: 2px dashed var(--accent); outline-offset: -4px; }
.kanban-card-name   { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.kanban-card-person { font-size: 11px; color: var(--text-muted); margin-bottom: 3px; }
.kanban-card-meta   { font-size: 11px; color: var(--text-dim); margin-bottom: 6px; }
.kanban-card-actions { display: flex; gap: 4px; margin-top: 8px; }

/* ── Activity badges ────────────────────────────────────────────────────── */
.act-badge {
  display: inline-block;
  font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: 20px;
}
.act-badge.act-call      { background: rgba(8,145,178,.08);  color: #0891b2; }
.act-badge.act-meeting   { background: rgba(46,196,160,.08); color: var(--accent-dark); }
.act-badge.act-visit     { background: rgba(46,196,122,.08); color: #1a8a5a; }
.act-badge.act-email     { background: rgba(139,92,246,.08); color: #7c3aed; }
.act-badge.act-whatsapp  { background: rgba(34,164,74,.08);  color: #22a44a; }
.act-badge.act-video,
.act-badge.act-video-call { background: rgba(224,136,26,.08); color: #c07010; }
.act-badge.act-other     { background: rgba(136,153,166,.08); color: #7088a0; }

.outcome-badge {
  display: inline-block;
  font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: 20px;
}
.outcome-positive { background: rgba(46,196,122,.08); color: #1a8a5a; }
.outcome-negative { background: rgba(217,80,80,.08);  color: #b03030; }
.outcome-nominated{ background: rgba(46,196,160,.08); color: var(--accent-dark); }
.outcome-lost     { background: rgba(136,153,166,.08); color: #7088a0; }
.outcome-followup { background: rgba(224,136,26,.08);  color: #c07010; }
.outcome-neutral  { background: rgba(120,120,120,.06); color: #888; }

/* ── Task badges ────────────────────────────────────────────────────────── */
.priority-badge {
  display: inline-block;
  font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: 20px;
}
.priority-high   { background: rgba(217,80,80,.08);  color: #b03030; }
.priority-medium { background: rgba(224,160,48,.08); color: #a07820; }
.priority-low    { background: rgba(46,196,160,.08); color: var(--accent-dark); }

.task-status-badge {
  display: inline-block;
  font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: 20px;
  white-space: nowrap;
}
.status-pending    { background: rgba(224,160,48,.08); color: #a07820; }
.status-inprogress, .status-in-progress { background: rgba(8,145,178,.08); color: #0891b2; }
.status-done       { background: rgba(46,196,122,.08); color: #1a8a5a; }
.status-cancelled  { background: rgba(136,153,166,.08); color: #7088a0; }

.row-overdue td { background: rgba(217,80,80,.03); }
.text-danger    { color: #c04040 !important; }
.task-title-cell { max-width: 250px; }

/* ── Visit Planner Calendar ─────────────────────────────────────────────── */
.planner-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  min-width: 900px;
}
.planner-day {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden;
  min-height: 300px;
}
.planner-today { border-color: var(--accent); box-shadow: 0 0 12px rgba(46,196,160,0.1); }
.planner-day-header {
  padding: 8px 10px;
  background: var(--bg2);
  font-size: 11px; font-weight: 700;
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: space-between;
  text-transform: uppercase; letter-spacing: .05em;
}
.planner-today-header { background: rgba(46,196,160,0.08); color: var(--accent-dark); }
.planner-day-num { font-size: 18px; font-weight: 700; color: var(--text); }
.planner-today-num { color: var(--accent-dark); }
.planner-day-body { padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.planner-event {
  display: flex; align-items: flex-start; gap: 6px;
  padding: 6px 8px; border-radius: 6px; cursor: pointer;
  transition: opacity .15s;
}
.planner-event:hover { opacity: .8; }
.act-event  { background: rgba(8,145,178,.05);   border-left: 2px solid #0891b2; }
.task-event { background: rgba(46,196,160,.05);  border-left: 2px solid var(--accent); }
.planner-dot { width: 8px; height: 8px; margin-top: 3px; flex-shrink: 0; }
.planner-event-text { min-width: 0; }
.planner-event-text strong { font-size: 11px; font-weight: 700; display: block; }
.planner-empty { color: var(--text-dim); font-size: 11px; text-align: center; padding: 12px 0; }

/* ── Reports ────────────────────────────────────────────────────────────── */
.reports-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.report-card { padding: 20px; }
.report-card.span-2 { grid-column: span 2; }
.report-bar-row {
  display: grid;
  grid-template-columns: 90px 1fr 32px;
  align-items: center; gap: 10px;
  margin-bottom: 10px;
}
.report-bar-label { font-size: 12px; font-weight: 600; }
.report-bar-track {
  height: 10px; background: var(--bg);
  border-radius: 5px; overflow: hidden;
  border: 1px solid var(--border);
}
.report-bar-fill { height: 100%; border-radius: 5px; background: linear-gradient(90deg, var(--accent-dark), var(--accent)); transition: width .4s; }
.report-bar-val  { font-size: 12px; font-weight: 700; color: var(--text-muted); text-align: right; }

.monthly-chart {
  display: flex; align-items: flex-end; gap: 6px;
  height: 120px; padding-bottom: 4px;
  overflow-x: auto;
}
.monthly-bar-col {
  display: flex; flex-direction: column; align-items: center;
  gap: 2px; flex: 1; min-width: 36px;
}
.monthly-bar-wrap { flex: 1; width: 100%; display: flex; align-items: flex-end; }
.monthly-bar {
  width: 100%;
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-dark) 100%);
  border-radius: 4px 4px 0 0; min-height: 4px;
  transition: height .3s;
  opacity: .85;
}
.monthly-bar-label { font-size: 9px; color: var(--text-muted); }
.monthly-bar-count { font-size: 10px; font-weight: 700; color: var(--accent-dark); }

/* ── Contacts Layout with Folder Panel ─────────────────────────────────── */
.contacts-layout {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.folder-panel {
  width: 220px;
  flex-shrink: 0;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  position: sticky;
  top: 80px;
}

.folder-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
}

.folder-tree {
  padding: 6px 0;
  max-height: 60vh;
  overflow-y: auto;
}

.folder-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-muted);
  transition: all .12s;
  position: relative;
}
.folder-item:hover {
  background: rgba(46,196,160,.04);
  color: var(--text);
}
.folder-item.folder-active {
  background: rgba(46,196,160,.08);
  color: var(--accent-dark);
  font-weight: 700;
}
.folder-item.folder-active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}

.folder-icon {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.folder-icon svg { width: 14px; height: 14px; }

.folder-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folder-count {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-dim);
  background: var(--bg2);
  padding: 0 6px;
  border-radius: 8px;
  flex-shrink: 0;
}

.folder-actions {
  display: none;
  gap: 2px;
  flex-shrink: 0;
}
.folder-item:hover .folder-actions { display: flex; }
.folder-item:hover .folder-count { display: none; }

.folder-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 12px;
}

.contacts-main {
  flex: 1;
  min-width: 0;
}

@media (max-width: 900px) {
  .contacts-layout { flex-direction: column; }
  .folder-panel { width: 100%; position: static; }
}

/* ── Month Calendar ────────────────────────────────────────────────────── */
.month-cal {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.month-cal-head {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
}

.month-cal-dow {
  padding: 10px 6px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: .05em;
  text-transform: uppercase;
}

.month-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.month-cal-cell {
  min-height: 100px;
  padding: 6px 5px 4px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
  transition: background .15s;
}

.month-cal-cell:hover { background: rgba(46,196,160,.04); }
.month-cal-cell:nth-child(7n) { border-right: none; }

.month-other { opacity: .35; }
.month-today { background: rgba(46,196,160,.06); }

.month-cell-num {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 2px;
  line-height: 1;
}

.month-today-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

/* ── Month events ───────────────────────────────────────────────────────── */
.month-event {
  font-size: 10px;
  border-radius: 4px;
  padding: 1px 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  line-height: 1.6;
  transition: filter .1s;
}

.month-event:hover { filter: brightness(1.1); }

/* Meeting — accent */
.month-meeting {
  background: rgba(46,196,160,.12);
  color: var(--accent-dark);
  border-left: 2px solid var(--accent);
}

/* Activity types */
.month-act-call        { background: rgba(8,145,178,.1);   color: #0891b2; border-left: 2px solid #0891b2; }
.month-act-email       { background: rgba(139,92,246,.08); color: #7c3aed; border-left: 2px solid #8b5cf6; }
.month-act-visit       { background: rgba(224,136,26,.08); color: #c07010; border-left: 2px solid #e0881a; }
.month-act-meeting     { background: rgba(46,196,160,.12); color: var(--accent-dark); border-left: 2px solid var(--accent); }
.month-act-whatsapp    { background: rgba(34,164,74,.08);  color: #1a7a3a; border-left: 2px solid #22a44a; }
.month-act-video-call  { background: rgba(139,92,246,.08); color: #7c3aed; border-left: 2px solid #8b5cf6; }

/* Tasks */
.month-task {
  background: rgba(217,80,80,.08);
  color: #b03030;
  border-left: 2px solid #d95050;
}

/* "+N more" overflow */
.month-more {
  font-size: 9px;
  color: var(--text-dim);
  margin-top: 1px;
  padding-left: 4px;
  cursor: default;
}

/* ── Month legend ───────────────────────────────────────────────────────── */
.month-legend {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.month-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
}

@media (max-width: 900px) {
  .reports-grid       { grid-template-columns: 1fr; }
  .report-card.span-2 { grid-column: span 1; }
  .dash-grid          { grid-template-columns: 1fr; }
  .planner-grid       { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 700px) {
  .month-cal-cell  { min-height: 70px; }
  .month-event     { font-size: 9px; }
  .month-cal-dow   { font-size: 10px; padding: 6px 3px; }
  .month-cell-num  { font-size: 11px; }
}
