/* ============ THEME ============ */
:root {
  --bg-0: #0a0b10;
  --bg-1: #0f1117;
  --bg-2: #151823;
  --bg-3: #1b1f2e;
  --bg-4: #242a3d;
  --border: #252a3d;
  --border-strong: #323853;
  --text: #e7e9f2;
  --text-dim: #9aa2b8;
  --text-mute: #6b7390;
  --primary: #6366f1;
  --primary-2: #8b5cf6;
  --accent: #22d3ee;
  --success: #10b981;
  --warn: #f59e0b;
  --danger: #ef4444;
  --whatsapp: #25d366;
  --shadow-lg: 0 20px 50px rgba(0,0,0,0.5);
  --radius: 14px;
  --radius-sm: 10px;
  --sidebar-w: 252px;
  --topbar-h: 64px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(1200px 600px at 90% -10%, rgba(99,102,241,0.12), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(34,211,238,0.08), transparent 60%),
    var(--bg-0);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select {
  font-family: inherit; color: inherit; background: var(--bg-2);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 12px; outline: none; width: 100%; font-size: 13px;
  transition: all .15s ease;
}
input:focus, textarea:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,0.15); }

/* ============ TOPBAR ============ */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--topbar-h);
  background: rgba(15,17,23,0.85); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; z-index: 100;
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-center { flex: 1; max-width: 520px; margin: 0 24px; }

.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo {
  width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: white;
  box-shadow: 0 6px 20px rgba(99,102,241,0.35);
}
.brand-text h1 { font-size: 15px; font-weight: 700; letter-spacing: .2px; }
.brand-text span { font-size: 11px; color: var(--text-mute); }

.search-wrap {
  position: relative; display: flex; align-items: center;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px;
  padding: 0 12px;
}
.search-wrap i { color: var(--text-mute); font-size: 13px; }
.search-wrap input { border: none; background: transparent; padding: 10px 8px; }
.search-wrap input:focus { box-shadow: none; border: none; }
.search-wrap kbd {
  font-size: 10px; background: var(--bg-3); border: 1px solid var(--border);
  padding: 2px 6px; border-radius: 4px; color: var(--text-mute);
}

.icon-btn {
  position: relative;
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--bg-2); border: 1px solid var(--border);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-dim); transition: all .15s;
  gap: 8px; padding: 0 12px;
}
.icon-btn:hover { background: var(--bg-3); color: var(--text); border-color: var(--border-strong); }
.icon-btn .btn-label { font-size: 12px; font-weight: 500; }
#check-in-btn { width: auto; }
#check-in-btn.checked-in { background: rgba(16,185,129,0.12); border-color: rgba(16,185,129,0.4); color: #34d399; }

.notif-dot {
  position: absolute; top: 6px; right: 6px;
  background: var(--danger); color: white; font-size: 9px; font-weight: 700;
  width: 16px; height: 16px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg-1);
}

.user-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 5px 12px 5px 5px; background: var(--bg-2);
  border: 1px solid var(--border); border-radius: 100px;
}
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px; color: white;
  flex-shrink: 0;
}
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.avatar.lg { width: 48px; height: 48px; font-size: 15px; }
.user-meta { line-height: 1.2; }
.user-meta strong { font-size: 12px; display: block; }
.user-meta span { font-size: 10px; color: var(--text-mute); }

/* ============ SIDEBAR ============ */
.sidebar {
  position: fixed; top: var(--topbar-h); left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--bg-1); border-right: 1px solid var(--border);
  padding: 16px 12px; overflow-y: auto;
  display: flex; flex-direction: column;
  z-index: 50;
}
.nav { flex: 1; }
.nav-section {
  font-size: 10px; text-transform: uppercase; letter-spacing: 1.2px;
  color: var(--text-mute); padding: 14px 12px 6px; font-weight: 600;
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 10px;
  color: var(--text-dim); font-size: 13px; font-weight: 500;
  margin-bottom: 2px; transition: all .15s; position: relative;
}
.nav-item i { width: 18px; font-size: 14px; text-align: center; }
.nav-item:hover { background: var(--bg-2); color: var(--text); }
.nav-item.active {
  background: linear-gradient(90deg, rgba(99,102,241,0.22), rgba(139,92,246,0.08));
  color: white;
}
.nav-item.active::before {
  content: ''; position: absolute; left: 0; top: 8px; bottom: 8px;
  width: 3px; background: var(--primary); border-radius: 0 3px 3px 0;
}
.nav-item .badge {
  margin-left: auto; font-style: normal; font-size: 10px; font-weight: 700;
  background: var(--bg-3); color: var(--text); padding: 2px 7px; border-radius: 10px;
}
.nav-item .badge-warn { background: rgba(245,158,11,0.18); color: var(--warn); }

.sidebar-footer {
  padding: 14px 8px 4px; border-top: 1px solid var(--border);
}
.status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--text-dim); font-weight: 500;
  padding: 5px 10px; background: var(--bg-2); border-radius: 100px;
  border: 1px solid var(--border);
}
.dot { width: 6px; height: 6px; border-radius: 50%; }
.dot.green { background: var(--success); box-shadow: 0 0 8px var(--success); }
.dot.orange { background: var(--warn); }
.dot.red { background: var(--danger); }
.dot.blue { background: var(--accent); }
.small { font-size: 11px; }
.muted { color: var(--text-mute); }

/* ============ MAIN ============ */
.main {
  margin-left: var(--sidebar-w);
  margin-top: var(--topbar-h);
  padding: 24px 28px 48px;
  min-height: calc(100vh - var(--topbar-h));
}

.page-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 22px; gap: 16px; flex-wrap: wrap;
}
.page-header h2 { font-size: 22px; font-weight: 700; letter-spacing: -.3px; }
.page-header .subtitle { color: var(--text-mute); font-size: 13px; margin-top: 4px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: 10px; font-size: 13px; font-weight: 600;
  border: 1px solid var(--border); background: var(--bg-2); color: var(--text);
  transition: all .15s;
}
.btn:hover { background: var(--bg-3); border-color: var(--border-strong); }
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  border-color: transparent; color: white;
  box-shadow: 0 6px 16px rgba(99,102,241,0.3);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(99,102,241,0.4); }
.btn-success { background: var(--success); color: white; border-color: transparent; }
.btn-danger { background: var(--danger); color: white; border-color: transparent; }
.btn-whatsapp { background: var(--whatsapp); color: white; border-color: transparent; }
.btn-ghost { background: transparent; }
.btn-sm { padding: 6px 10px; font-size: 12px; }

/* ============ CARDS / GRID ============ */
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 1200px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 720px) { .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.card {
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; transition: all .2s;
}
.card:hover { border-color: var(--border-strong); }
.card-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px;
}
.card-head h3 { font-size: 14px; font-weight: 600; }
.card-head .muted { font-size: 12px; }

/* Stat cards */
.stat {
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; position: relative; overflow: hidden;
}
.stat::before {
  content: ''; position: absolute; top: 0; right: 0; width: 120px; height: 120px;
  background: radial-gradient(circle, var(--_c, rgba(99,102,241,0.18)), transparent 70%);
  pointer-events: none;
}
.stat-icon {
  width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-3); font-size: 15px; color: var(--primary);
  margin-bottom: 12px;
}
.stat-icon.success { color: var(--success); background: rgba(16,185,129,0.1); }
.stat-icon.warn { color: var(--warn); background: rgba(245,158,11,0.1); }
.stat-icon.danger { color: var(--danger); background: rgba(239,68,68,0.1); }
.stat-icon.accent { color: var(--accent); background: rgba(34,211,238,0.1); }
.stat-label { font-size: 12px; color: var(--text-mute); font-weight: 500; }
.stat-value { font-size: 26px; font-weight: 700; margin-top: 2px; letter-spacing: -.5px; }
.stat-trend { font-size: 11px; margin-top: 6px; display: flex; align-items: center; gap: 4px; }
.stat-trend.up { color: var(--success); }
.stat-trend.down { color: var(--danger); }

/* ============ TABLES ============ */
.table-wrap {
  background: var(--bg-1); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left; padding: 12px 16px; font-size: 11px;
  text-transform: uppercase; letter-spacing: 1px;
  color: var(--text-mute); font-weight: 600;
  background: var(--bg-2); border-bottom: 1px solid var(--border);
}
tbody td {
  padding: 14px 16px; font-size: 13px;
  border-bottom: 1px solid var(--border);
}
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: rgba(255,255,255,0.02); }

/* ============ BADGES ============ */
.badge-status {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 100px; font-size: 11px; font-weight: 600;
  text-transform: capitalize;
}
.badge-status .dot { width: 5px; height: 5px; }
.badge-status.todo { background: rgba(107,115,144,0.15); color: var(--text-dim); }
.badge-status.progress { background: rgba(99,102,241,0.15); color: #a5b4fc; }
.badge-status.review { background: rgba(34,211,238,0.15); color: #67e8f9; }
.badge-status.done { background: rgba(16,185,129,0.15); color: #34d399; }
.badge-status.overdue { background: rgba(239,68,68,0.15); color: #fca5a5; }
.badge-status.pending { background: rgba(245,158,11,0.15); color: #fcd34d; }
.badge-status.approved { background: rgba(16,185,129,0.15); color: #34d399; }
.badge-status.rejected { background: rgba(239,68,68,0.15); color: #fca5a5; }
.badge-status.active { background: rgba(16,185,129,0.15); color: #34d399; }
.badge-status.away { background: rgba(245,158,11,0.15); color: #fcd34d; }
.badge-status.offline { background: rgba(107,115,144,0.15); color: var(--text-dim); }

.priority {
  display: inline-block; padding: 2px 8px; border-radius: 6px;
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
}
.priority.high { background: rgba(239,68,68,0.15); color: #fca5a5; }
.priority.medium { background: rgba(245,158,11,0.15); color: #fcd34d; }
.priority.low { background: rgba(99,102,241,0.15); color: #a5b4fc; }

/* ============ KANBAN ============ */
.kanban { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 1100px) { .kanban { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .kanban { grid-template-columns: 1fr; } }
.kanban-col {
  background: var(--bg-1); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px; min-height: 400px;
}
.kanban-col-head {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px;
  padding-bottom: 10px; border-bottom: 1px solid var(--border);
}
.kanban-col-head h4 { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; display: flex; align-items: center; gap: 8px; }
.kanban-col-head .count { background: var(--bg-3); padding: 1px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; }

.kanban-card {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px; margin-bottom: 10px; cursor: pointer; transition: all .15s;
}
.kanban-card:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: 0 8px 16px rgba(0,0,0,0.3); }
.kanban-card .title { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.kanban-card .meta { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; font-size: 11px; color: var(--text-mute); }
.kanban-card .tags { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 8px; }
.tag { font-size: 10px; padding: 2px 7px; background: var(--bg-3); border-radius: 5px; color: var(--text-dim); }
.avatars-stack { display: flex; }
.avatars-stack .avatar { border: 2px solid var(--bg-2); margin-left: -8px; }
.avatars-stack .avatar:first-child { margin-left: 0; }

/* ============ DRAWER ============ */
.drawer {
  position: fixed; top: 0; right: -420px; bottom: 0; width: 400px;
  background: var(--bg-1); border-left: 1px solid var(--border);
  z-index: 200; transition: right .3s;
  display: flex; flex-direction: column;
}
.drawer.open { right: 0; }
.drawer-head {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.drawer-head h3 { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 12px; }
.drawer-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  z-index: 150; opacity: 0; pointer-events: none; transition: opacity .3s;
}
.drawer-backdrop.open { opacity: 1; pointer-events: all; }

.notif-item {
  padding: 12px; border-radius: 10px; margin-bottom: 8px;
  background: var(--bg-2); border: 1px solid var(--border);
  display: flex; gap: 10px;
}
.notif-item .icon {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 13px;
}
.notif-item .content { flex: 1; }
.notif-item .title { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.notif-item .desc { font-size: 12px; color: var(--text-dim); line-height: 1.4; }
.notif-item .time { font-size: 10px; color: var(--text-mute); margin-top: 4px; }

/* ============ MODAL ============ */
.modal {
  position: fixed; inset: 0; background: rgba(5,6,10,0.75);
  z-index: 300; display: none; align-items: center; justify-content: center;
  padding: 20px;
}
.modal.open { display: flex; }
.modal-card {
  background: var(--bg-1); border: 1px solid var(--border-strong);
  border-radius: 16px; width: 100%; max-width: 560px;
  max-height: 90vh; display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
}
.modal-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.modal-head h3 { font-size: 15px; }
.modal-body { padding: 20px; overflow-y: auto; }
.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 6px; color: var(--text-dim); }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ============ TOAST ============ */
.toast-container {
  position: fixed; bottom: 20px; right: 20px; z-index: 400;
  display: flex; flex-direction: column; gap: 10px;
}
.toast {
  background: var(--bg-2); border: 1px solid var(--border-strong);
  border-radius: 12px; padding: 12px 16px; min-width: 280px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: var(--shadow-lg);
  animation: slideIn .3s ease;
}
.toast .icon {
  width: 30px; height: 30px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; font-size: 13px;
}
.toast.success .icon { background: rgba(16,185,129,0.15); color: var(--success); }
.toast.info .icon { background: rgba(99,102,241,0.15); color: var(--primary); }
.toast.warn .icon { background: rgba(245,158,11,0.15); color: var(--warn); }
.toast.whatsapp .icon { background: rgba(37,211,102,0.15); color: var(--whatsapp); }
.toast .msg { font-size: 13px; font-weight: 500; }
.toast .msg small { display: block; color: var(--text-mute); font-weight: 400; font-size: 11px; margin-top: 2px; }

@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ============ MAP (mock) ============ */
.map-wrap {
  position: relative;
  background: linear-gradient(135deg, #0f172a, #1e1b4b);
  border-radius: var(--radius); border: 1px solid var(--border);
  height: 500px; overflow: hidden;
}
.map-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(99,102,241,0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99,102,241,0.08) 1px, transparent 1px);
  background-size: 40px 40px;
}
.map-glow {
  position: absolute; border-radius: 50%;
  background: radial-gradient(circle, rgba(99,102,241,0.3), transparent 70%);
  filter: blur(20px); pointer-events: none;
}
.map-pin {
  position: absolute; transform: translate(-50%, -100%); cursor: pointer;
  z-index: 2;
}
.map-pin .pin-icon {
  width: 36px; height: 36px; border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: white; font-size: 11px;
  border: 2px solid rgba(255,255,255,0.3);
  box-shadow: 0 4px 14px rgba(0,0,0,0.5);
}
.map-pin .pin-icon span { transform: rotate(45deg); }
.map-pin .pulse {
  position: absolute; top: 0; left: 0; width: 36px; height: 36px;
  border-radius: 50%; background: currentColor; opacity: .4;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { transform: scale(1); opacity: .4; }
  100% { transform: scale(2.5); opacity: 0; }
}
.map-pin .label {
  position: absolute; top: 42px; left: 50%; transform: translateX(-50%);
  background: rgba(15,17,23,0.95); border: 1px solid var(--border-strong);
  padding: 4px 9px; border-radius: 6px; font-size: 11px; white-space: nowrap;
  font-weight: 600;
}

/* ============ FILES ============ */
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.file-card {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px;
  padding: 16px; text-align: center; cursor: pointer; transition: all .15s;
}
.file-card:hover { transform: translateY(-2px); border-color: var(--primary); }
.file-icon {
  width: 52px; height: 52px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px; font-size: 20px;
}
.file-icon.pdf { background: rgba(239,68,68,0.15); color: #fca5a5; }
.file-icon.img { background: rgba(139,92,246,0.15); color: #c4b5fd; }
.file-icon.vid { background: rgba(34,211,238,0.15); color: #67e8f9; }
.file-icon.doc { background: rgba(59,130,246,0.15); color: #93c5fd; }
.file-icon.zip { background: rgba(245,158,11,0.15); color: #fcd34d; }
.file-card .name { font-size: 12px; font-weight: 600; margin-bottom: 3px; word-break: break-word; }
.file-card .meta { font-size: 10px; color: var(--text-mute); }

/* ============ CHAT / WHATSAPP ============ */
.wa-layout { display: grid; grid-template-columns: 300px 1fr; gap: 16px; height: 640px; }
@media (max-width: 900px) { .wa-layout { grid-template-columns: 1fr; height: auto; } }
.wa-sidebar {
  background: var(--bg-1); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
}
.wa-sidebar-head { padding: 14px 16px; border-bottom: 1px solid var(--border); }
.wa-list { flex: 1; overflow-y: auto; }
.wa-contact {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  border-bottom: 1px solid var(--border); cursor: pointer; transition: .15s;
}
.wa-contact:hover, .wa-contact.active { background: var(--bg-2); }
.wa-contact .info { flex: 1; }
.wa-contact .name { font-size: 13px; font-weight: 600; }
.wa-contact .last { font-size: 11px; color: var(--text-mute); }
.wa-contact .count {
  background: var(--whatsapp); color: white; font-size: 10px;
  font-weight: 700; padding: 2px 7px; border-radius: 10px;
}

.wa-chat {
  background: var(--bg-1); border: 1px solid var(--border); border-radius: var(--radius);
  display: flex; flex-direction: column; overflow: hidden;
}
.wa-chat-head {
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.wa-chat-body {
  flex: 1; overflow-y: auto; padding: 20px;
  background:
    radial-gradient(circle at 20% 30%, rgba(37,211,102,0.04), transparent 50%),
    var(--bg-0);
}
.wa-msg { max-width: 70%; margin-bottom: 12px; }
.wa-msg .bubble {
  padding: 10px 14px; border-radius: 12px; font-size: 13px;
  background: var(--bg-3); color: var(--text);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.wa-msg .bubble small { display: block; font-size: 10px; color: var(--text-mute); margin-top: 4px; }
.wa-msg.sent { margin-left: auto; }
.wa-msg.sent .bubble { background: linear-gradient(135deg, #128c7e, #25d366); color: white; border-radius: 12px 12px 2px 12px; }
.wa-msg.sent .bubble small { color: rgba(255,255,255,0.7); }
.wa-msg.received .bubble { border-radius: 12px 12px 12px 2px; }

.wa-input {
  padding: 12px; border-top: 1px solid var(--border);
  display: flex; gap: 10px; align-items: center;
}

/* ============ PROFILE / DETAILS ============ */
.profile-card { text-align: center; padding: 24px; }
.profile-card .avatar { margin: 0 auto 12px; width: 72px; height: 72px; font-size: 22px; }
.profile-card h3 { font-size: 16px; margin-bottom: 2px; }
.profile-card .role { color: var(--text-mute); font-size: 12px; margin-bottom: 14px; }
.profile-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
.profile-stat {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px; text-align: center;
}
.profile-stat strong { display: block; font-size: 16px; }
.profile-stat span { font-size: 10px; color: var(--text-mute); }

/* ============ PROGRESS ============ */
.progress {
  height: 6px; background: var(--bg-3); border-radius: 100px; overflow: hidden;
}
.progress-bar {
  height: 100%; background: linear-gradient(90deg, var(--primary), var(--primary-2));
  border-radius: 100px; transition: width .4s;
}
.progress-bar.success { background: linear-gradient(90deg, #10b981, #34d399); }
.progress-bar.warn { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.progress-bar.danger { background: linear-gradient(90deg, #ef4444, #f87171); }

/* ============ TIMELINE ============ */
.timeline { position: relative; padding-left: 24px; }
.timeline::before {
  content: ''; position: absolute; left: 8px; top: 4px; bottom: 4px;
  width: 2px; background: var(--border);
}
.timeline-item { position: relative; padding-bottom: 18px; }
.timeline-item::before {
  content: ''; position: absolute; left: -20px; top: 4px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--primary); border: 3px solid var(--bg-1);
  box-shadow: 0 0 0 1px var(--primary);
}
.timeline-item .time { font-size: 11px; color: var(--text-mute); }
.timeline-item .title { font-size: 13px; font-weight: 600; margin: 2px 0; }
.timeline-item .desc { font-size: 12px; color: var(--text-dim); }

/* ============ FILTER CHIPS ============ */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.chip {
  padding: 6px 12px; border-radius: 100px;
  background: var(--bg-2); border: 1px solid var(--border);
  font-size: 12px; color: var(--text-dim); cursor: pointer; transition: .15s;
}
.chip:hover { color: var(--text); }
.chip.active { background: var(--primary); color: white; border-color: var(--primary); }

/* ============ RESPONSIVE ============ */
.mobile-toggle { display: none; }
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .3s; }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; padding: 16px; }
  .mobile-toggle { display: inline-flex; }
  .topbar-center { display: none; }
  .user-meta { display: none; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--bg-4); }

/* Action menu */
.row-actions { display: flex; gap: 6px; }
.row-actions button {
  width: 30px; height: 30px; border-radius: 8px; background: var(--bg-2);
  border: 1px solid var(--border); color: var(--text-dim); font-size: 12px;
  display: inline-flex; align-items: center; justify-content: center;
}
.row-actions button:hover { background: var(--bg-3); color: var(--text); }

.empty {
  text-align: center; padding: 60px 20px; color: var(--text-mute);
}
.empty i { font-size: 42px; margin-bottom: 14px; opacity: .4; }

/* chart container */
.chart-wrap { position: relative; height: 260px; }

/* Flex helpers */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 4px; } .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; }
.mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; }
.text-right { text-align: right; }
