@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400&family=Inter:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&display=swap');

/* ══════════════════════════════════════════
   TASKOR APP — DARK MODE PREMIUM DESIGN SYSTEM
══════════════════════════════════════════ */
:root {
  /* Brand */
  --green:        #00E5A0;
  --green-2:      #00c98a;
  --green-dim:    rgba(0,229,160,0.12);
  --green-glow:   rgba(0,229,160,0.25);
  --blue:         #005FFF;
  --blue-2:       #0077ff;
  --blue-dim:     rgba(0,95,255,0.12);
  --cyan:         #22d3ee;
  --purple:       #8b5cf6;
  --red:          #ef4444;
  --red-dim:      rgba(239,68,68,0.12);
  --yellow:       #f59e0b;

  /* Backgrounds */
  --bg-base:      #070B16;
  --bg-surface:   #0C1120;
  --bg-elevated:  #111827;
  --bg-card:      rgba(255,255,255,0.035);
  --bg-input:     rgba(255,255,255,0.055);
  --bg-hover:     rgba(255,255,255,0.06);

  /* Borders */
  --border:       rgba(255,255,255,0.07);
  --border-soft:  rgba(255,255,255,0.05);
  --border-green: rgba(0,229,160,0.3);
  --border-blue:  rgba(0,95,255,0.3);

  /* Text */
  --text:         #E8EDF5;
  --text-muted:   #6B7A8D;
  --text-dim:     rgba(255,255,255,0.35);
  --text-label:   rgba(255,255,255,0.5);

  /* Layout */
  --sidebar-w:    240px;
  --topbar-h:     64px;

  /* Radii */
  --r-sm:  10px;
  --r-md:  14px;
  --r-lg:  20px;
  --r-xl:  28px;

  /* Easing */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Reset ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; background: var(--bg-base); }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg-base);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
h1,h2,h3,h4,h5,h6 { font-family: 'Plus Jakarta Sans', system-ui, sans-serif; }
img { display: block; max-width: 100%; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; color: inherit; }
input, select, textarea { font-family: inherit; }

/* ══════════════════════════════════════════
   KEYFRAMES
══════════════════════════════════════════ */
@keyframes fadeUp    { from{opacity:0;transform:translateY(16px)}to{opacity:1;transform:none} }
@keyframes fadeIn    { from{opacity:0}to{opacity:1} }
@keyframes slideIn   { from{opacity:0;transform:translateX(-16px)}to{opacity:1;transform:none} }
@keyframes scaleIn   { from{opacity:0;transform:scale(.94)}to{opacity:1;transform:scale(1)} }
@keyframes pulse     { 0%,100%{opacity:1}50%{opacity:.4} }
@keyframes blobDrift { 0%,100%{transform:translate(0,0)scale(1)}50%{transform:translate(30px,-20px)scale(1.08)} }
@keyframes wave      { 0%,100%{transform:scaleY(.3)}50%{transform:scaleY(1)} }
@keyframes spin      { to{transform:rotate(360deg)} }
@keyframes shimmer   { 0%{background-position:-200%}100%{background-position:200%} }
@keyframes pingRing  { 0%{box-shadow:0 0 0 0 rgba(0,229,160,.5)}70%{box-shadow:0 0 0 12px rgba(0,229,160,0)}100%{box-shadow:0 0 0 0 rgba(0,229,160,0)} }
@keyframes callPulse { 0%,100%{box-shadow:0 0 0 0 rgba(0,229,160,.4)}50%{box-shadow:0 0 0 16px rgba(0,229,160,0)} }
@keyframes ringBell  { 0%,100%{transform:rotate(0)}15%{transform:rotate(15deg)}30%{transform:rotate(-12deg)}45%{transform:rotate(8deg)}60%{transform:rotate(-5deg)}75%{transform:rotate(3deg)} }
@keyframes float     { 0%,100%{transform:translateY(0)}50%{transform:translateY(-8px)} }
@keyframes gradShift { 0%,100%{background-position:0% 50%}50%{background-position:100% 50%} }
@keyframes slideDown { from{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:none} }
@keyframes toastIn   { from{opacity:0;transform:translateX(100%)}to{opacity:1;transform:none} }
@keyframes progressW { from{width:0}to{width:var(--tw)} }

/* ══════════════════════════════════════════
   APP LAYOUT
══════════════════════════════════════════ */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 200;
  transition: transform .35s var(--ease);
}
.sidebar-logo {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-logo-text {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -.03em;
  color: var(--text);
}
.sidebar-logo-text span { color: var(--green); }

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar-nav::-webkit-scrollbar { width: 0; }

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

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
  transition: all .18s var(--ease);
  position: relative;
  cursor: pointer;
  text-decoration: none;
}
.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text);
}
.nav-item.active {
  background: var(--green-dim);
  color: var(--green);
  font-weight: 600;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: 3px;
  background: var(--green);
  border-radius: 0 2px 2px 0;
}
.nav-icon {
  width: 18px; height: 18px;
  flex-shrink: 0;
  opacity: .7;
}
.nav-item.active .nav-icon { opacity: 1; }
.nav-item:hover .nav-icon { opacity: .9; }

.nav-badge {
  margin-left: auto;
  background: var(--green);
  color: var(--bg-base);
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 100px;
  min-width: 18px;
  text-align: center;
}
.nav-badge.red { background: var(--red); color: white; }

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.demo-banner {
  background: rgba(245,158,11,.1);
  border: 1px solid rgba(245,158,11,.2);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  margin-bottom: 10px;
}
.demo-banner-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--yellow);
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 2px;
}
.demo-banner-sub { font-size: 10px; color: rgba(245,158,11,.6); }

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--r-sm);
  transition: background .18s;
  cursor: pointer;
}
.user-card:hover { background: var(--bg-hover); }
.user-avatar {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--green), var(--blue));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  color: var(--bg-base);
  flex-shrink: 0;
}
.user-name  { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.2; }
.user-plan  { font-size: 11px; color: var(--text-muted); }

/* ── Main wrapper ── */
.main-wrapper {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Topbar ── */
.topbar {
  height: var(--topbar-h);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  gap: 16px;
}
.topbar-title {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.topbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}
.topbar-breadcrumb .sep { opacity: .3; }
.topbar-breadcrumb .current { color: var(--text); font-weight: 600; }

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.topbar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 8px 14px;
  width: 220px;
  transition: border-color .2s, width .3s;
}
.topbar-search:focus-within {
  border-color: var(--border-green);
  width: 280px;
}
.topbar-search input {
  background: none;
  border: none;
  outline: none;
  font-size: 13px;
  color: var(--text);
  width: 100%;
}
.topbar-search input::placeholder { color: var(--text-muted); }

.icon-btn {
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all .18s;
  position: relative;
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }

.notif-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 7px; height: 7px;
  background: var(--red);
  border-radius: 50%;
  border: 1.5px solid var(--bg-surface);
  animation: pulse 2s infinite;
}

/* ── Main content ── */
.main-content {
  flex: 1;
  padding: 28px;
  max-width: 1400px;
  width: 100%;
}

/* ══════════════════════════════════════════
   CARDS & SURFACES
══════════════════════════════════════════ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px;
}
.card-sm  { padding: 18px; border-radius: var(--r-md); }
.card-xs  { padding: 14px; border-radius: var(--r-sm); }

.glass {
  background: rgba(255,255,255,.04);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,.07);
}

/* ── Metric cards ── */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
@media(max-width:1200px){ .metric-grid { grid-template-columns: repeat(2,1fr); } }
@media(max-width:640px){  .metric-grid { grid-template-columns: 1fr; } }

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 22px 24px;
  position: relative;
  overflow: hidden;
  transition: border-color .25s, transform .25s;
}
.metric-card:hover { border-color: rgba(255,255,255,.13); transform: translateY(-2px); }
.metric-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--card-color, var(--green)), transparent);
  opacity: .5;
}
.metric-icon {
  width: 40px; height: 40px;
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
  font-size: 18px;
}
.metric-value {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  letter-spacing: -.03em;
  margin-bottom: 4px;
}
.metric-label { font-size: 13px; color: var(--text-muted); font-weight: 500; margin-bottom: 12px; }
.metric-change {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 100px;
}
.metric-change.up   { background: rgba(0,229,160,.1); color: var(--green); }
.metric-change.down { background: rgba(239,68,68,.1);  color: var(--red); }
.metric-change.neu  { background: rgba(255,255,255,.06); color: var(--text-muted); }

/* ══════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 13.5px;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: var(--r-sm);
  transition: all .18s var(--ease);
  cursor: pointer;
  white-space: nowrap;
  font-family: 'Inter', system-ui, sans-serif;
}
.btn-green {
  background: var(--green);
  color: var(--bg-base);
  box-shadow: 0 4px 20px rgba(0,229,160,.25);
}
.btn-green:hover { background: var(--green-2); box-shadow: 0 8px 28px rgba(0,229,160,.4); transform: translateY(-1px); }
.btn-green:active { transform: none; }

.btn-ghost {
  background: var(--bg-hover);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: rgba(255,255,255,.15); background: rgba(255,255,255,.08); }

.btn-outline {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-outline:hover { color: var(--text); border-color: rgba(255,255,255,.15); }

.btn-danger {
  background: rgba(239,68,68,.15);
  color: var(--red);
  border: 1px solid rgba(239,68,68,.2);
}
.btn-danger:hover { background: rgba(239,68,68,.25); }

.btn-sm { padding: 6px 14px; font-size: 12px; border-radius: 8px; }
.btn-lg { padding: 12px 24px; font-size: 15px; border-radius: var(--r-md); }
.btn-icon { padding: 8px; gap: 0; }

.btn svg { width: 15px; height: 15px; }
.btn-sm svg { width: 13px; height: 13px; }

/* ══════════════════════════════════════════
   BADGES & CHIPS
══════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 100px;
  white-space: nowrap;
}
.badge-green  { background: rgba(0,229,160,.12); color: var(--green); border: 1px solid rgba(0,229,160,.2); }
.badge-blue   { background: rgba(0,95,255,.12);  color: #60a5fa;      border: 1px solid rgba(0,95,255,.2); }
.badge-red    { background: rgba(239,68,68,.12); color: #f87171;      border: 1px solid rgba(239,68,68,.2); }
.badge-yellow { background: rgba(245,158,11,.12);color: var(--yellow); border: 1px solid rgba(245,158,11,.2); }
.badge-gray   { background: rgba(255,255,255,.07);color: var(--text-muted); border: 1px solid var(--border); }
.badge-purple { background: rgba(139,92,246,.12);color: #a78bfa;     border: 1px solid rgba(139,92,246,.2); }

.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-green  { background: var(--green); box-shadow: 0 0 6px var(--green); }
.dot-red    { background: var(--red);   box-shadow: 0 0 6px var(--red); }
.dot-yellow { background: var(--yellow); }
.dot-gray   { background: var(--text-muted); }

/* ══════════════════════════════════════════
   TABLES
══════════════════════════════════════════ */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
}
table {
  width: 100%;
  border-collapse: collapse;
}
thead tr {
  border-bottom: 1px solid var(--border);
}
thead th {
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  text-align: left;
  white-space: nowrap;
  background: rgba(255,255,255,.02);
}
tbody tr {
  border-bottom: 1px solid var(--border-soft);
  transition: background .15s;
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--bg-hover); }
td {
  padding: 13px 16px;
  font-size: 13.5px;
  color: var(--text);
  vertical-align: middle;
}
td.muted { color: var(--text-muted); }

/* ══════════════════════════════════════════
   FORMS & INPUTS
══════════════════════════════════════════ */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-label);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.form-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.form-input:focus {
  border-color: var(--border-green);
  box-shadow: 0 0 0 3px rgba(0,229,160,.08);
}
.form-input::placeholder { color: var(--text-muted); }
select.form-input { cursor: pointer; }
textarea.form-input { resize: vertical; min-height: 100px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media(max-width:640px){ .form-row { grid-template-columns: 1fr; } }

/* ══════════════════════════════════════════
   PAGE HEADER
══════════════════════════════════════════ */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
  flex-wrap: wrap;
}
.page-title {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.02em;
  margin-bottom: 4px;
}
.page-subtitle { font-size: 13px; color: var(--text-muted); }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ══════════════════════════════════════════
   TABS
══════════════════════════════════════════ */
.tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-input);
  border-radius: var(--r-sm);
  padding: 4px;
  width: fit-content;
}
.tab {
  padding: 7px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all .2s;
}
.tab.active {
  background: var(--bg-elevated);
  color: var(--text);
  font-weight: 600;
}
.tab:not(.active):hover { color: var(--text); }

/* ══════════════════════════════════════════
   CALL INTERFACE
══════════════════════════════════════════ */
.call-active-card {
  background: linear-gradient(135deg, rgba(0,229,160,.08), rgba(0,95,255,.06));
  border: 1px solid rgba(0,229,160,.25);
  border-radius: var(--r-xl);
  padding: 28px;
  position: relative;
  overflow: hidden;
}
.call-active-card::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(0,229,160,.08), transparent 70%);
  pointer-events: none;
}

.call-phone-ring {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--green-dim);
  border: 2px solid var(--border-green);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  animation: callPulse 2s ease-in-out infinite;
  flex-shrink: 0;
}

.wave-bars {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 28px;
}
.wave-bar {
  width: 3px;
  border-radius: 3px;
  background: var(--green);
  animation: wave 1.2s ease-in-out infinite;
}
.wave-bar:nth-child(1){height:8px;animation-delay:0s}
.wave-bar:nth-child(2){height:18px;animation-delay:.1s}
.wave-bar:nth-child(3){height:26px;animation-delay:.2s}
.wave-bar:nth-child(4){height:20px;animation-delay:.1s}
.wave-bar:nth-child(5){height:10px;animation-delay:0s}
.wave-bar:nth-child(6){height:16px;animation-delay:.15s}
.wave-bar:nth-child(7){height:24px;animation-delay:.05s}

/* ── Call action buttons ── */
.call-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.call-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.call-btn-circle {
  width: 48px; height: 48px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  transition: all .2s;
}
.call-btn-label { font-size: 10px; color: var(--text-muted); text-align: center; }
.call-btn-circle.green { background: var(--green); color: var(--bg-base); }
.call-btn-circle.red   { background: var(--red);   color: white; }
.call-btn-circle.gray  { background: var(--bg-elevated); color: var(--text-muted); border: 1px solid var(--border); }
.call-btn-circle:hover { transform: scale(1.1); }

/* ══════════════════════════════════════════
   CHAT / MESSAGES INTERFACE
══════════════════════════════════════════ */
.chat-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  height: calc(100vh - var(--topbar-h) - 56px);
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
@media(max-width:768px){ .chat-layout { grid-template-columns: 1fr; } }

.chat-sidebar {
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.chat-sidebar-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.conv-list { flex: 1; overflow-y: auto; }
.conv-item {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-soft);
  transition: background .15s;
}
.conv-item:hover { background: var(--bg-hover); }
.conv-item.active { background: var(--green-dim); }
.conv-avatar {
  width: 40px; height: 40px;
  border-radius: 12px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  font-weight: 700;
  font-family: 'Plus Jakarta Sans', sans-serif;
}
.conv-name { font-size: 13.5px; font-weight: 600; color: var(--text); margin-bottom: 3px; }
.conv-preview { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.conv-time { font-size: 11px; color: var(--text-dim); margin-left: auto; flex-shrink: 0; }
.conv-unread {
  min-width: 18px; height: 18px;
  background: var(--green);
  color: var(--bg-base);
  border-radius: 50%;
  font-size: 10px;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  margin-left: auto;
}

.chat-main {
  display: flex;
  flex-direction: column;
  background: var(--bg-base);
  overflow: hidden;
}
.chat-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-surface);
  flex-shrink: 0;
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.msg-bubble {
  max-width: 65%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.5;
  position: relative;
}
.msg-bubble.in {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  border-bottom-left-radius: 4px;
  align-self: flex-start;
}
.msg-bubble.out {
  background: linear-gradient(135deg, var(--green), #00c48a);
  color: var(--bg-base);
  border-bottom-right-radius: 4px;
  align-self: flex-end;
  font-weight: 500;
}
.msg-bubble.system {
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 10px;
  font-size: 12px;
  align-self: center;
  padding: 6px 14px;
}
.msg-time { font-size: 10px; margin-top: 4px; opacity: .5; }
.msg-out-wrap  { display: flex; justify-content: flex-end; }
.msg-in-wrap   { display: flex; align-items: flex-end; gap: 8px; }

.chat-input-area {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg-surface);
  flex-shrink: 0;
}
.chat-input-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}
.chat-textarea {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  font-size: 13.5px;
  color: var(--text);
  resize: none;
  outline: none;
  max-height: 120px;
  transition: border-color .2s;
  line-height: 1.5;
}
.chat-textarea:focus { border-color: var(--border-green); }
.chat-textarea::placeholder { color: var(--text-muted); }

/* ══════════════════════════════════════════
   ACTIVITY FEED
══════════════════════════════════════════ */
.activity-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-soft);
  align-items: flex-start;
  animation: fadeUp .4s var(--ease) both;
}
.activity-item:last-child { border-bottom: none; }
.activity-icon {
  width: 34px; height: 34px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.activity-body { flex: 1; }
.activity-text { font-size: 13px; color: var(--text); line-height: 1.4; }
.activity-text strong { color: var(--green); }
.activity-time { font-size: 11px; color: var(--text-dim); margin-top: 2px; }

/* ══════════════════════════════════════════
   TOGGLE SWITCH
══════════════════════════════════════════ */
.toggle {
  width: 44px; height: 24px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  position: relative;
  cursor: pointer;
  transition: all .25s;
  flex-shrink: 0;
}
.toggle.on { background: var(--green); border-color: var(--green); }
.toggle::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
  transition: left .25s;
}
.toggle.on::after { left: 23px; }

/* ══════════════════════════════════════════
   NOTIFICATIONS / TOAST
══════════════════════════════════════════ */
#toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
  min-width: 300px;
  max-width: 380px;
  animation: toastIn .35s var(--ease);
}
.toast.success { border-color: rgba(0,229,160,.3); }
.toast.error   { border-color: rgba(239,68,68,.3); }
.toast.info    { border-color: rgba(0,95,255,.3); }
.toast-icon { font-size: 20px; flex-shrink: 0; }
.toast-body { flex: 1; }
.toast-title { font-size: 13.5px; font-weight: 600; color: var(--text); margin-bottom: 1px; }
.toast-msg   { font-size: 12px; color: var(--text-muted); }
.toast-close { cursor: pointer; color: var(--text-muted); font-size: 16px; line-height: 1; flex-shrink: 0; }

/* ══════════════════════════════════════════
   MODAL / DRAWER
══════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(6px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn .2s var(--ease);
}
.modal {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 32px;
  width: 100%;
  max-width: 520px;
  animation: scaleIn .25s var(--ease);
  position: relative;
}
.modal-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}
.modal-sub { font-size: 13px; color: var(--text-muted); margin-bottom: 24px; }
.modal-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 28px; height: 28px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  transition: all .18s;
}
.modal-close:hover { background: var(--bg-hover); color: var(--text); }

/* Side drawer */
.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 420px;
  max-width: 100%;
  background: var(--bg-elevated);
  border-left: 1px solid var(--border);
  z-index: 500;
  padding: 28px;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform .35s var(--ease);
}
.drawer.open { transform: translateX(0); }

/* ══════════════════════════════════════════
   INCOMING CALL OVERLAY
══════════════════════════════════════════ */
.incoming-call-overlay {
  position: fixed;
  top: 80px; right: 24px;
  z-index: 900;
  background: var(--bg-elevated);
  border: 1px solid rgba(0,229,160,.35);
  border-radius: var(--r-xl);
  padding: 20px 24px;
  width: 320px;
  box-shadow: 0 30px 80px rgba(0,0,0,.5), 0 0 0 1px rgba(0,229,160,.1);
  animation: slideDown .4s var(--ease);
  display: none;
}
.incoming-call-overlay.show { display: block; }
.call-glow {
  position: absolute;
  top: -20px; left: 50%;
  transform: translateX(-50%);
  width: 100px; height: 100px;
  background: radial-gradient(circle, rgba(0,229,160,.2), transparent 70%);
  pointer-events: none;
}

/* ══════════════════════════════════════════
   CALENDAR
══════════════════════════════════════════ */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.cal-day-header {
  background: var(--bg-surface);
  padding: 10px 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.cal-day {
  background: var(--bg-surface);
  min-height: 80px;
  padding: 8px;
  cursor: pointer;
  transition: background .15s;
  position: relative;
}
.cal-day:hover { background: var(--bg-hover); }
.cal-day.today  { background: rgba(0,229,160,.06); }
.cal-day.other  { opacity: .4; }
.cal-day-num {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.cal-day.today .cal-day-num {
  background: var(--green);
  color: var(--bg-base);
  width: 24px; height: 24px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
}
.cal-event {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-event.green { background: rgba(0,229,160,.2); color: var(--green); }
.cal-event.blue  { background: rgba(0,95,255,.2);  color: #60a5fa; }

/* ══════════════════════════════════════════
   AI CONFIG
══════════════════════════════════════════ */
.ai-voice-select {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.voice-option {
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px;
  cursor: pointer;
  transition: all .2s;
  text-align: center;
}
.voice-option.active {
  border-color: var(--border-green);
  background: var(--green-dim);
}
.voice-option:hover:not(.active) { border-color: rgba(255,255,255,.15); }
.voice-name { font-size: 13px; font-weight: 600; color: var(--text); margin-top: 8px; }
.voice-desc { font-size: 11px; color: var(--text-muted); }

/* ══════════════════════════════════════════
   PROGRESS / STATS BARS
══════════════════════════════════════════ */
.progress-bar {
  height: 6px;
  background: var(--bg-elevated);
  border-radius: 100px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 100px;
  background: linear-gradient(90deg, var(--green), var(--cyan));
  transition: width 1s var(--ease);
}

/* ══════════════════════════════════════════
   GRADIENT TEXT
══════════════════════════════════════════ */
.grad-green { background: linear-gradient(135deg,#00E5A0,#22d3ee); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.grad-blue  { background: linear-gradient(135deg,#60a5fa,#22d3ee); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

/* ══════════════════════════════════════════
   SCROLL REVEAL
══════════════════════════════════════════ */
.reveal     { opacity:0; transform:translateY(20px); transition:opacity .5s var(--ease),transform .5s var(--ease); }
.reveal.show { opacity:1; transform:none; }

/* ══════════════════════════════════════════
   SCROLLBAR
══════════════════════════════════════════ */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.15); }

/* ══════════════════════════════════════════
   MOBILE
══════════════════════════════════════════ */
.menu-toggle {
  display: none;
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  align-items: center; justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
}
@media(max-width:900px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 20px 0 60px rgba(0,0,0,.4);
  }
  .main-wrapper { margin-left: 0; }
  .menu-toggle { display: flex; }
  .main-content { padding: 20px 16px; }
  .metric-grid  { grid-template-columns: repeat(2,1fr); }
}
@media(max-width:480px) {
  .metric-grid { grid-template-columns: 1fr; }
}

/* Overlay for mobile sidebar */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 199;
  backdrop-filter: blur(4px);
}
.sidebar-overlay.show { display: block; }

/* ══════════════════════════════════════════
   MISC UTILS
══════════════════════════════════════════ */
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.text-green  { color: var(--green); }
.text-blue   { color: #60a5fa; }
.text-red    { color: var(--red); }
.text-yellow { color: var(--yellow); }
.text-muted  { color: var(--text-muted); }
.text-dim    { color: var(--text-dim); }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mt-auto { margin-top: auto; }
.hidden { display: none !important; }
.relative { position: relative; }
.overflow-hidden { overflow: hidden; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ══════════════════════════════════════════
   LIGHT MODE — [data-theme="light"]
══════════════════════════════════════════ */
[data-theme="light"] {
  --bg-base:      #f5f7fa;
  --bg-surface:   #ffffff;
  --bg-elevated:  #f0f3f8;
  --bg-card:      rgba(0,0,0,0.025);
  --bg-input:     rgba(0,0,0,0.04);
  --bg-hover:     rgba(0,0,0,0.05);

  --border:       rgba(0,0,0,0.08);
  --border-soft:  rgba(0,0,0,0.05);
  --border-green: rgba(0,180,125,0.4);
  --border-blue:  rgba(0,80,220,0.3);

  --text:         #0f172a;
  --text-muted:   #64748b;
  --text-dim:     rgba(0,0,0,0.3);
  --text-label:   rgba(0,0,0,0.5);

  --green:        #00b87d;
  --green-2:      #009e6b;
  --green-dim:    rgba(0,184,125,0.1);
  --green-glow:   rgba(0,184,125,0.2);
  --blue-dim:     rgba(0,80,220,0.08);
  --red-dim:      rgba(220,38,38,0.08);
}

/* Light mode component overrides */
[data-theme="light"] .sidebar {
  background: #ffffff;
  border-right-color: rgba(0,0,0,0.08);
  box-shadow: 2px 0 20px rgba(0,0,0,0.05);
}
[data-theme="light"] .topbar {
  background: #ffffff;
  border-bottom-color: rgba(0,0,0,0.08);
  box-shadow: 0 1px 12px rgba(0,0,0,0.05);
}
[data-theme="light"] .card,
[data-theme="light"] .settings-card,
[data-theme="light"] .contact-detail-panel {
  background: #ffffff;
  border-color: rgba(0,0,0,0.08);
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
[data-theme="light"] .metric-card {
  background: #ffffff;
  border-color: rgba(0,0,0,0.08);
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
[data-theme="light"] .table-wrap { border-color: rgba(0,0,0,0.08); }
[data-theme="light"] thead th    { background: rgba(0,0,0,0.02); }
[data-theme="light"] tbody tr:hover { background: rgba(0,0,0,0.025); }
[data-theme="light"] .modal      { background: #ffffff; border-color: rgba(0,0,0,0.1); }
[data-theme="light"] .drawer     { background: #ffffff; border-left-color: rgba(0,0,0,0.08); }
[data-theme="light"] .toast      { background: #ffffff; border-color: rgba(0,0,0,0.12); box-shadow: 0 8px 32px rgba(0,0,0,0.12); }
[data-theme="light"] .demo-banner { background: rgba(245,158,11,0.08); border-color: rgba(245,158,11,0.2); }
[data-theme="light"] .user-card:hover { background: rgba(0,0,0,0.04); }
[data-theme="light"] .chat-sidebar { background: #f8fafc; }
[data-theme="light"] .chat-main   { background: #f5f7fa; }
[data-theme="light"] .chat-header,
[data-theme="light"] .chat-input-area { background: #ffffff; }
[data-theme="light"] .msg-bubble.in { background: #ffffff; border-color: rgba(0,0,0,0.08); color: #0f172a; }
[data-theme="light"] .transcript-area { background: #f8fafc; }
[data-theme="light"] .nav-item { color: #64748b; }
[data-theme="light"] .nav-item:hover { background: rgba(0,0,0,0.05); color: #0f172a; }
[data-theme="light"] .sidebar-logo-text { color: #0f172a; }
[data-theme="light"] .topbar-search { background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.08); }
[data-theme="light"] .topbar-search input { color: #0f172a; }
[data-theme="light"] .icon-btn { color: #64748b; }
[data-theme="light"] .icon-btn:hover { background: rgba(0,0,0,0.06); color: #0f172a; }
[data-theme="light"] .btn-ghost { background: rgba(0,0,0,0.04); color: #0f172a; border-color: rgba(0,0,0,0.1); }
[data-theme="light"] .btn-ghost:hover { background: rgba(0,0,0,0.07); }
[data-theme="light"] .btn-outline { color: #64748b; border-color: rgba(0,0,0,0.1); }
[data-theme="light"] .form-input { background: #ffffff; border-color: rgba(0,0,0,0.12); color: #0f172a; }
[data-theme="light"] .tabs { background: rgba(0,0,0,0.04); }
[data-theme="light"] .tab.active { background: #ffffff; }
[data-theme="light"] .tab { color: #64748b; }
[data-theme="light"] .badge-gray { background: rgba(0,0,0,0.06); color: #64748b; }
[data-theme="light"] .filter-chip { background: #ffffff; border-color: rgba(0,0,0,0.1); color: #64748b; }
[data-theme="light"] .filter-chip:hover { color: #0f172a; }
[data-theme="light"] .progress-bar { background: rgba(0,0,0,0.06); }
[data-theme="light"] .call-active-card { background: linear-gradient(135deg, rgba(0,184,125,.06), rgba(0,80,220,.04)); }
[data-theme="light"] .incoming-call-overlay { background: #ffffff; box-shadow: 0 20px 60px rgba(0,0,0,.2); }
[data-theme="light"] .queue-item { background: #f8fafc; border-color: rgba(0,0,0,.08); }
[data-theme="light"] ::-webkit-scrollbar-track { background: rgba(0,0,0,.04); }
[data-theme="light"] ::-webkit-scrollbar-thumb { background: rgba(0,0,0,.15); }
[data-theme="light"] .week-day   { background: #ffffff; border-color: rgba(0,0,0,.08); }
[data-theme="light"] .cal-day    { background: #ffffff; }
[data-theme="light"] .cal-day-header { background: #f8fafc; }
[data-theme="light"] .rdv-card   { background: #ffffff; border-color: rgba(0,0,0,.08); }
[data-theme="light"] .voice-option { background: #ffffff; }
[data-theme="light"] .knowledge-item { background: #f8fafc; }
[data-theme="light"] .template-card { background: #f8fafc; }
[data-theme="light"] .conv-item.active { background: rgba(0,184,125,.08); }
[data-theme="light"] .chat-textarea { background: #f8fafc; color: #0f172a; }
[data-theme="light"] .settings-nav-item { color: #64748b; }
[data-theme="light"] .settings-nav-item:hover,
[data-theme="light"] .settings-nav-item.active { background: rgba(0,0,0,.05); color: #0f172a; }
[data-theme="light"] .plan-card { background: linear-gradient(135deg, rgba(0,184,125,.06), rgba(0,80,220,.04)); }
[data-theme="light"] .twilio-field { background: #f8fafc; color: #0f172a; }
[data-theme="light"] .api-key-row { background: #f8fafc; }
[data-theme="light"] .activity-item { border-bottom-color: rgba(0,0,0,.05); }
[data-theme="light"] .timeline-item { border-bottom-color: rgba(0,0,0,.05); }
[data-theme="light"] .perf-item  { border-bottom-color: rgba(0,0,0,.05); }
[data-theme="light"] .notif-dropdown { background: #ffffff; border-color: rgba(0,0,0,.1); box-shadow: 0 12px 40px rgba(0,0,0,.12); }
[data-theme="light"] .notif-item:hover { background: rgba(0,0,0,.03); }
[data-theme="light"] .sidebar-overlay { background: rgba(0,0,0,.4); }

/* Theme transition (smooth swap) */
*, *::before, *::after {
  transition: background-color .22s ease, border-color .22s ease, color .15s ease, box-shadow .22s ease;
}
/* Except animations that should not be slowed */
.wave-bar, .blob, .live-dot, .notif-dot, .call-phone-ring { transition: none !important; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Production mode: hide demo data for real accounts ── */
.is-real-user [data-demo]        { display: none !important; }
.is-real-user [data-empty]       { display: block !important; }
.is-real-user .metric-change     { display: none !important; }
