/* ===== XTROLOGY ADMIN · GLOBAL STYLES ===== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

/* ===== CSS VARIABLES ===== */
:root {
  --brand:         #2563eb;
  --brand-light:   #eff6ff;
  --brand-mid:     #bfdbfe;
  --sidebar-bg:    #0f172a;
  --sidebar-text:  #94a3b8;
  --sidebar-hover: #1e293b;
  --sidebar-active:#2563eb;
  --bg:            #f1f5f9;
  --surface:       #ffffff;
  --border:        #e2e8f0;
  --text-primary:  #0f172a;
  --text-secondary:#64748b;
  --text-muted:    #94a3b8;
  --success:       #10b981;
  --success-bg:    #ecfdf5;
  --danger:        #ef4444;
  --danger-bg:     #fef2f2;
  --warning:       #f59e0b;
  --warning-bg:    #fffbeb;
  --radius:        12px;
  --radius-lg:     18px;
  --shadow-sm:     0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow:        0 4px 16px rgba(0,0,0,.07);
  --shadow-lg:     0 12px 40px rgba(0,0,0,.10);
  --sidebar-w:     260px;
  --transition:    0.18s ease;
}

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

body {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: var(--brand); }
a:hover { color: #1d4ed8; }

/* ===== LAYOUT ===== */
.dashboard { display: flex; min-height: 100vh; }

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  scrollbar-width: none;
  transition: transform 0.22s cubic-bezier(.4,0,.2,1);
}
.sidebar::-webkit-scrollbar { display: none; }

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
  text-decoration: none;
}
.logo-img { height: 32px; width: auto; border-radius: 8px; }
.logo span {
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.admin-info {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 40px;
  padding: 7px 8px 7px 14px;
}
.admin-info span {
  font-size: 13px;
  font-weight: 500;
  color: #cbd5e1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}
.logout-link {
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 20px;
  padding: 4px 12px;
  transition: var(--transition);
  flex-shrink: 0;
}
.logout-link:hover { background: rgba(255,255,255,.14); color: #e2e8f0; }

/* Sidebar nav */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px;
  scrollbar-width: none;
}
.sidebar-nav::-webkit-scrollbar { display: none; }

.nav-section { margin-bottom: 4px; padding: 20px 0 0; }

.nav-section-label,
.section-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #475569;
  padding: 4px 12px 6px;
  margin: 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--sidebar-text);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  transition: var(--transition);
  margin-bottom: 2px;
  position: relative;
  cursor: pointer;
  border-left: 3px solid transparent;
}
.nav-item i { width: 20px; font-size: 15px; color: #475569; transition: var(--transition); }
.nav-item:hover { background: var(--sidebar-hover); color: #e2e8f0; }
.nav-item:hover i,
.nav-item:hover .nav-icon { color: #94a3b8; }
.nav-item.active {
  background: rgba(37,99,235,.15);
  color: #60a5fa;
  border-left-color: #2563eb;
  font-weight: 600;
}
.nav-item.active i,
.nav-item.active .nav-icon { color: #60a5fa; }
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 20%; bottom: 20%;
  width: 3px;
  background: var(--brand);
  border-radius: 0 3px 3px 0;
}

.nav-icon {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  font-size: 14px;
  color: #6b7280;
  background: transparent;
  transition: var(--transition);
  flex-shrink: 0;
}
.nav-item:hover .nav-icon,
.nav-item.active .nav-icon { background: rgba(37,99,235,.1); color: #1d4ed8; }

.nav-label { flex: 1; }

.nav-divider,
.divider {
  height: 1px;
  background: rgba(255,255,255,.06);
  margin: 10px 4px;
}

/* Sidebar footer */
.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  background: #fafbfc;
  flex-shrink: 0;
}
.admin-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: #eff6ff;
  border: 1.5px solid #bfdbfe;
  display: flex; align-items: center; justify-content: center;
  color: #2563eb;
  font-size: 16px;
  flex-shrink: 0;
}
.admin-details { flex: 1; min-width: 0; }
.admin-name {
  display: block;
  font-size: 13px; font-weight: 700; color: #111827;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.admin-role {
  display: block;
  font-size: 11px; font-weight: 500; color: var(--text-muted);
}
.logout-btn {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  color: #6b7280;
  font-size: 15px;
  text-decoration: none;
  transition: var(--transition);
  background: transparent;
  border: 1px solid transparent;
  flex-shrink: 0;
}
.logout-btn:hover { background: #fef2f2; color: #dc2626; border-color: #fecaca; }

/* Mobile topbar */
.mobile-topbar {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 300;
  box-shadow: 0 1px 8px rgba(0,0,0,.06);
}
.mobile-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}
.mobile-logo span {
  font-size: 17px; font-weight: 800; letter-spacing: -0.5px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Sidebar toggle button */
.sidebar-toggle-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  transition: background var(--transition);
  flex-shrink: 0;
}
.sidebar-toggle-btn span {
  display: block;
  width: 18px; height: 2px;
  background: #374151;
  border-radius: 2px;
  transition: all 0.22s cubic-bezier(.4,0,.2,1);
}
.sidebar-toggle-btn:hover { background: #e2e8f0; }
.sidebar-toggle-btn.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.sidebar-toggle-btn.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.sidebar-toggle-btn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Sidebar overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  z-index: 199;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.sidebar-overlay.active { display: block; }

/* ===== MAIN AREA ===== */
.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-width: 0;
  display: flex;
  flex-direction: column;
  transition: margin-left 0.22s cubic-bezier(.4,0,.2,1);
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  gap: 16px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 50;
}
.page-header h1,
.page-header h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.header-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px; font-weight: 600;
  color: var(--brand);
  background: var(--brand-light);
  border: 1px solid var(--brand-mid);
  padding: 6px 16px;
  border-radius: 40px;
}

.main-content { padding: 28px 32px; flex: 1; }

/* ===== STAT CARDS ===== */
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }

.stat-icon-wrap {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.ic-blue   { background: #eff6ff; color: #2563eb; }
.ic-green  { background: #ecfdf5; color: #10b981; }
.ic-amber  { background: #fffbeb; color: #f59e0b; }
.ic-red    { background: #fef2f2; color: #ef4444; }
.ic-purple { background: #f5f3ff; color: #7c3aed; }

.stat-lbl { font-size: 12px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 4px; }
.stat-val { font-size: 26px; font-weight: 800; color: var(--text-primary); letter-spacing: -1px; line-height: 1; }

/* ===== FINANCE CARDS ===== */
.fin-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.fin-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.fin-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; }
.fin-rev::before { background: linear-gradient(90deg, #10b981, #34d399); }
.fin-exp::before { background: linear-gradient(90deg, #ef4444, #f87171); }
.fin-pro::before { background: linear-gradient(90deg, #2563eb, #818cf8); }
.fin-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.fin-lbl { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .7px; color: var(--text-muted); }
.fin-badge { font-size: 11px; font-weight: 600; padding: 2px 10px; border-radius: 20px; }
.badge-green { background: #ecfdf5; color: #059669; }
.badge-red   { background: #fef2f2; color: #dc2626; }
.badge-blue  { background: #eff6ff; color: #2563eb; }
.fin-val { font-size: 28px; font-weight: 800; letter-spacing: -1px; line-height: 1.1; }
.fin-rev .fin-val { color: #059669; }
.fin-exp .fin-val { color: #dc2626; }
.fin-pro .fin-val { color: #2563eb; }
.fin-sub { font-size: 12px; color: var(--text-muted); margin-top: 6px; }

/* ===== TABLE ===== */
.table-wrapper {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.table-wrapper .table { margin: 0; }
.table { font-size: 13.5px; }
.table thead th {
  background: #f8fafc;
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td {
  padding: 14px 16px;
  color: var(--text-primary);
  font-weight: 500;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: #f8fafc; }
.table-footer { font-size: 13px; color: var(--text-muted); padding: 12px 0 4px; font-weight: 500; }

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ===== STATUS BADGES ===== */
.badge-embedded, .badge-success-pill {
  background: #ecfdf5; color: #065f46;
  padding: 4px 10px; border-radius: 20px;
  font-size: 11.5px; font-weight: 600;
  display: inline-block;
}
.badge-pending, .badge-warning-pill {
  background: #fffbeb; color: #92400e;
  padding: 4px 10px; border-radius: 20px;
  font-size: 11.5px; font-weight: 600;
  display: inline-block;
}
.badge-failed, .badge-danger-pill {
  background: #fef2f2; color: #991b1b;
  padding: 4px 10px; border-radius: 20px;
  font-size: 11.5px; font-weight: 600;
  display: inline-block;
}

/* ===== STAT PILLS ===== */
.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px; font-weight: 600;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid;
}
.stat-pill i { font-size: 12px; }
.stat-pill.blue   { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.stat-pill.green  { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.stat-pill.amber  { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.stat-pill.slate  { background: #f8fafc; color: #475569; border-color: #e2e8f0; }
.stat-pill.dark   { background: #0f172a; color: #f8fafc; border-color: #1e293b; }
.stat-pill.purple { background: #f5f3ff; color: #5b21b6; border-color: #ddd6fe; }

/* ===== GENDER PILLS ===== */
.gender-pill {
  font-size: 11px; padding: 3px 10px;
  border-radius: 20px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 5px;
}
.gender-pill.male   { background: #eff6ff; color: #1d4ed8; }
.gender-pill.female { background: #fdf2f8; color: #9d174d; }

/* ===== FILE TYPE BADGES ===== */
.ext-badge {
  font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: 5px;
  letter-spacing: .3px; text-transform: uppercase;
  flex-shrink: 0;
}
.ext-pdf   { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.ext-med   { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.ext-other { background: #f8fafc; color: #64748b; border: 1px solid #e2e8f0; }

/* ===== MONO ID ===== */
.mono-id,
.user-id {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: #64748b;
}

/* ===== FILE LINK ===== */
.file-link {
  font-size: 12.5px; font-weight: 600;
  color: #2563eb;
  text-decoration: none;
  display: inline-flex; align-items: center; gap: 4px;
  font-family: 'JetBrains Mono', monospace;
}
.file-link:hover { text-decoration: underline; }

/* ===== FILE DETAILS (KB table) ===== */
.fd-name {
  font-weight: 700; font-size: 14px;
  color: var(--text-primary);
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
}
.fd-desc { font-size: 12px; color: var(--text-muted); margin-top: 3px; line-height: 1.5; }
.fd-size { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.fd-date {
  font-size: 11.5px; color: var(--text-muted);
  display: flex; align-items: center; gap: 5px; margin-top: 3px;
}
.fd-date i { font-size: 10px; color: #94a3b8; }

/* ===== PROFILE LINKS ===== */
.profile-name-link { font-weight: 700; color: var(--text-primary); text-decoration: none; }
.profile-name-link:hover { color: #2563eb; }

/* ===== DELETE BUTTON ===== */
.btn-delete {
  background: #fef2f2; color: #dc2626;
  border: 1px solid #fecaca;
  font-weight: 600; border-radius: 7px;
  font-size: 12.5px; padding: 5px 12px;
  cursor: pointer;
  transition: all .18s ease;
  white-space: nowrap;
}
.btn-delete:hover { background: #fee2e2; border-color: #fca5a5; }
.btn-delete-full {
  width: 100%; padding: 10px; font-size: 13px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}

/* ===== MOBILE CARDS (hidden on desktop) ===== */
.mobile-cards { display: none; }

/* Shared mobile card pieces */
.mc-label {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .5px;
  color: #94a3b8;
  display: flex; align-items: center; gap: 4px;
}
.mc-value { font-size: 13px; font-weight: 600; color: #1e293b; }

.mc-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.mc-title {
  font-size: 14px; font-weight: 700; color: #111827;
  flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.mc-filename {
  font-size: 14px; font-weight: 700; color: #111827;
  word-break: break-word;
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  line-height: 1.4;
}

.mc-name {
  font-size: 15px; font-weight: 700; color: #111827;
  text-decoration: none;
  flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mc-name:hover { color: #2563eb; }

.mc-date-row,
.mc-date {
  font-size: 12px; color: #64748b; font-weight: 500;
  display: flex; align-items: center; gap: 5px;
  flex-shrink: 0;
}
.mc-date-row i,
.mc-date i { color: #94a3b8; font-size: 11px; }

.mc-meta-row { display: flex; flex-wrap: wrap; gap: 12px; }
.mc-meta-item {
  font-size: 12px; color: #64748b; font-weight: 500;
  display: flex; align-items: center; gap: 5px;
}
.mc-meta-item i { color: #94a3b8; font-size: 11px; }

.mc-ids { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 12px; }
.mc-dot { color: #cbd5e1; }
.mc-mobile-num { font-weight: 600; color: #374151; font-size: 12px; }
.mc-mobile { font-size: 15px; font-weight: 700; color: #111827; }

.mc-row { display: flex; flex-wrap: wrap; gap: 10px; }
.mc-meta { font-size: 12px; color: #64748b; display: flex; align-items: center; gap: 5px; font-weight: 500; }
.mc-meta i { color: #94a3b8; font-size: 11px; }

.mc-user-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  background: #f8fafc; border: 1px solid #e8edf4;
  border-radius: 10px; padding: 12px;
}
.mc-user-info { display: flex; flex-direction: column; gap: 2px; }

.mc-details {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  background: #f8fafc; border-radius: 10px; padding: 12px;
  border: 1px solid #e8edf4;
}
.mc-full { grid-column: 1 / -1; }
.mc-detail-item { display: flex; flex-direction: column; gap: 2px; }
.mc-detail-lbl {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; color: #94a3b8;
  display: flex; align-items: center; gap: 4px;
}
.mc-detail-val { font-size: 13px; font-weight: 600; color: #1e293b; }

.mc-badge-row {
  display: flex; flex-wrap: wrap; gap: 10px;
  background: #f8fafc; border: 1px solid #e8edf4;
  border-radius: 10px; padding: 12px;
}
.mc-badge-item { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 80px; }

.mc-status-row {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px;
  background: #f8fafc; border: 1px solid #e8edf4;
  border-radius: 10px; padding: 12px;
}
.mc-status-item { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }

.mc-stats {
  display: flex; align-items: center;
  background: #f8fafc; border: 1px solid #e8edf4;
  border-radius: 10px; padding: 10px 0;
}
.mc-stat { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.mc-stat-val { font-size: 16px; font-weight: 700; color: #111827; }
.mc-stat-lbl { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: #94a3b8; }
.mc-stat-divider { width: 1px; height: 28px; background: #e8edf4; }

.mc-file-row {
  display: flex; align-items: center; justify-content: space-between;
  background: #f8fafc; border: 1px solid #e8edf4;
  border-radius: 10px; padding: 10px 12px;
}
.mc-job-row {
  display: flex; flex-direction: column; gap: 4px;
  background: #f8fafc; border: 1px solid #e8edf4;
  border-radius: 10px; padding: 10px 12px;
}

.mc-bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mc-view-btn { flex-shrink: 0; border-radius: 8px !important; padding: 8px 16px !important; }

.mc-question { font-size: 13.5px; font-weight: 600; color: #1e293b; line-height: 1.5; }
.mc-answer-box {
  background: #f8fafc; border: 1px solid #e8edf4;
  border-radius: 10px; padding: 12px;
  display: flex; flex-direction: column; gap: 6px;
}
.mc-answer-text { font-size: 13px; color: #374151; line-height: 1.6; }

/* ===== TAB PANEL ===== */
.tab-panel-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  padding: 24px;
}

/* ===== PAGINATION ===== */
.pag-btn {
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px; font-size: 13px; font-weight: 600;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition);
}
.pag-btn:hover { background: var(--brand-light); border-color: var(--brand-mid); color: var(--brand); }
.pag-btn.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.pag-btn.disabled { opacity: .35; pointer-events: none; }
.pag-info { font-size: 13px; color: var(--text-muted); font-weight: 500; }

.pagination .page-link {
  border-color: var(--border); color: var(--text-secondary);
  font-weight: 600; font-size: 13px;
  border-radius: 8px !important; margin: 0 2px;
}
.pagination .page-item.active .page-link { background: var(--brand); border-color: var(--brand); }
.pagination .page-item.disabled .page-link { opacity: .4; }

/* ===== SEARCH BOX ===== */
.search-box {
  display: flex; align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden;
  max-width: 320px; box-shadow: var(--shadow-sm);
}
.search-box input {
  border: none; outline: none;
  padding: 10px 14px; font-size: 13.5px;
  font-family: inherit; width: 100%;
  color: var(--text-primary); background: transparent;
}
.search-box button {
  background: var(--brand); border: none; color: #fff;
  padding: 10px 18px; font-size: 13px;
  cursor: pointer; transition: var(--transition);
}
.search-box button:hover { background: #1d4ed8; }

/* ===== FORMS ===== */
.settings-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px;
  max-width: 560px; box-shadow: var(--shadow-sm);
}
.form-label { font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.form-control {
  border-color: var(--border); border-radius: 10px;
  font-size: 13.5px; padding: 10px 14px;
  font-family: inherit; color: var(--text-primary);
  transition: var(--transition);
}
.form-control:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }

/* ===== BUTTONS ===== */
.btn-primary { background: var(--brand); border-color: var(--brand); font-weight: 600; border-radius: 9px; }
.btn-primary:hover { background: #1d4ed8; border-color: #1d4ed8; }
.btn-sm { font-size: 12.5px; padding: 5px 12px; border-radius: 7px; font-weight: 600; }

/* ===== CARDS ===== */
.info-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px;
  box-shadow: var(--shadow-sm); height: 100%;
}
.info-card .label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); margin-bottom: 6px; }
.info-card .value { font-size: 15px; font-weight: 700; color: var(--text-primary); }

.rev-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 22px;
  box-shadow: var(--shadow-sm); text-align: center;
}
.rev-card h6 { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); margin-bottom: 10px; }
.rev-card h3 { font-size: 28px; font-weight: 800; letter-spacing: -1px; }

.card-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow-sm);
}

.profile-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600;
  color: var(--text-secondary);
  background: #f8fafc; border: 1px solid var(--border);
  padding: 6px 16px; border-radius: 40px;
}

/* ===== TABS ===== */
.nav-tabs { border-bottom: 2px solid var(--border); }
.nav-tabs .nav-link {
  font-weight: 600; font-size: 13.5px;
  color: var(--text-muted);
  border: none; border-bottom: 2px solid transparent;
  padding: 10px 18px; margin-bottom: -2px;
  transition: var(--transition);
}
.nav-tabs .nav-link:hover { color: var(--text-primary); }
.nav-tabs .nav-link.active { color: var(--brand); border-bottom-color: var(--brand); background: transparent; }

/* ===== TOAST ===== */
.toast { border-radius: 10px; font-size: 13.5px; font-weight: 500; }

/* ===== STATS ROW ===== */
.stats-row { display: flex; flex-wrap: wrap; gap: 10px; padding: 16px 0; }

/* ===== RESPONSIVE ===== */

/* Tablet */
@media (max-width: 1024px) {
  :root { --sidebar-w: 230px; }
}

/* Mobile */
@media (max-width: 768px) {

  /* Show mobile topbar */
  .mobile-topbar { display: flex; }

  /* Hide sidebar, push left */
  .sidebar {
    transform: translateX(-100%);
    width: 270px;
    box-shadow: 0 8px 40px rgba(0,0,0,.13);
    top: 0;
  }
  .sidebar.open { transform: translateX(0); }

  /* Show toggle button */
  .sidebar-toggle-btn { display: flex; }

  /* Main: full width + push below topbar */
  .main {
    margin-left: 0 !important;
    padding-top: 56px;
  }

  /* Page header */
  .page-header { padding: 16px; }
  .main-content { padding: 16px; }

  /* Tab panel */
  .tab-panel-wrap { padding: 0; }
  .nav-tabs .nav-link { padding: 10px 12px; font-size: 13px; }

  /* Tables → cards */
  .table-scroll { display: none; }
  .mobile-cards { display: block; }

  .mobile-card {
    padding: 16px;
    border-bottom: 1px solid #f1f5f9;
    display: flex; flex-direction: column; gap: 12px;
  }
  .mobile-card:last-child { border-bottom: none; }

  .mc-stats { padding: 10px 0; }

  .mc-bottom {
    display: flex; align-items: center;
    justify-content: space-between; gap: 10px;
  }
  .mc-stats.mc-bottom-stats {
    padding: 8px 16px; gap: 16px; flex: 1;
  }

  .rev-card { padding: 16px; }
}

@media (max-width: 480px) {
  .sidebar { width: 88vw; max-width: 300px; }
}
.chat-box {
    height: 400px;
    overflow-y: auto;
    display: flex;
    flex-direction: column; /* column-reverse hatao */
    gap: 8px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #f9f9f9;
}

.msg {
    max-width: 70%;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 14px;
    word-wrap: break-word;
}

.msg.user {
    align-self: flex-end;         /* Right side */
    background-color: #d1f0d1;
    text-align: right;
}

.msg.bot {
    align-self: flex-start;       /* Left side */
    background-color: #ffffff;
    border: 1px solid #ddd;
    text-align: left;
}

.msg.bot.bg-danger {
    background-color: #f8d7da !important;
    border-color: #f5c6cb;
    color: #721c24;
}

    #chatModal .modal-content   { display:flex; flex-direction:column; }
    #chatModal .modal-body      { flex:1; overflow-y:auto; display:flex; flex-direction:column; gap:10px; }

    /* ── Bubbles ─────────────────────────────────────────────── */
    .chat-bubble        { max-width:78%; padding:10px 14px; border-radius:14px; font-size:13px; line-height:1.55; }
    .bubble-user        { align-self:flex-end;  background:var(--brand,#2563eb); color:#fff; border-bottom-right-radius:3px; }
    .bubble-bot         { align-self:flex-start; background:var(--surface-2,#f1f5f9); color:var(--text-primary,#1e293b); border-bottom-left-radius:3px; }
    .bubble-role        { font-size:10px; font-weight:700; opacity:.6; margin-bottom:4px; text-transform:uppercase; letter-spacing:.5px; }
    .bubble-time        { font-size:10px; opacity:.5; margin-top:5px; text-align:right; }
    .bubble-text        { white-space:pre-wrap; word-break:break-word; }

    /* ── Typing indicator dots ───────────────────────────────── */
    .typing-indicator           { display:flex; align-items:center; gap:4px; padding:12px 16px; }
    .typing-indicator span      { width:7px; height:7px; border-radius:50%; background:#94a3b8; animation:bounce 1.2s infinite; }
    .typing-indicator span:nth-child(2) { animation-delay:.2s; }
    .typing-indicator span:nth-child(3) { animation-delay:.4s; }
    @keyframes bounce { 0%,60%,100%{transform:translateY(0)} 30%{transform:translateY(-6px)} }


        /* ── Transaction type pills ── */
        .txn-type-credit {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            background: #f0fdf4;
            color: #15803d;
            border: 1px solid #bbf7d0;
            border-radius: 20px;
            padding: 3px 10px;
            font-size: 12px;
            font-weight: 600;
        }
        .txn-type-debit {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            background: #fef2f2;
            color: #b91c1c;
            border: 1px solid #fecaca;
            border-radius: 20px;
            padding: 3px 10px;
            font-size: 12px;
            font-weight: 600;
        }

        /* ── Status badges ── */
        .badge-txn {
            display: inline-block;
            border-radius: 6px;
            padding: 2px 9px;
            font-size: 11px;
            font-weight: 600;
        }
        .badge-txn.success { background:#f0fdf4; color:#166534; border:1px solid #86efac; }
        .badge-txn.pending { background:#fffbeb; color:#92400e; border:1px solid #fcd34d; }
        .badge-txn.failed  { background:#fef2f2; color:#991b1b; border:1px solid #fca5a5; }
        .badge-txn.neutral { background:#f3f4f6; color:#374151; border:1px solid #d1d5db; }

        /* ── Amount coloring ── */
        .amt-cr { color: #16a34a; font-weight: 700; }
        .amt-db { color: #dc2626; font-weight: 700; }

        /* ── Balance summary card ── */
        .balance-summary {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
            gap: 14px;
            margin-bottom: 24px;
        }
        .bal-card {
            background: var(--card-bg, #fff);
            border: 1px solid var(--border, #e5e7eb);
            border-radius: 12px;
            padding: 16px 20px;
        }
        .bal-card .bc-label {
            font-size: 12px;
            color: #6b7280;
            font-weight: 500;
            margin-bottom: 6px;
        }
        .bal-card .bc-val {
            font-size: 20px;
            font-weight: 700;
            color: var(--text-primary, #111827);
        }
        .bal-card .bc-val.cr { color: #16a34a; }
        .bal-card .bc-val.db { color: #dc2626; }
        .bal-card .bc-val.bl { color: #2563eb; }

        /* ── Filter pills ── */
        .filter-pills {
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
            margin-bottom: 18px;
        }
        .fpill {
            display: inline-block;
            padding: 5px 16px;
            border-radius: 20px;
            font-size: 12px;
            font-weight: 600;
            border: 1.5px solid transparent;
            cursor: pointer;
            text-decoration: none;
            transition: all .15s;
        }
        .fpill.all    { background:#f3f4f6; color:#374151; border-color:#d1d5db; }
        .fpill.cr     { background:#f0fdf4; color:#15803d; border-color:#bbf7d0; }
        .fpill.db     { background:#fef2f2; color:#b91c1c; border-color:#fecaca; }
        .fpill.active { box-shadow: 0 0 0 3px rgba(99,102,241,.15); }
        .fpill.all.active  { background:#374151; color:#fff; border-color:#374151; }
        .fpill.cr.active   { background:#15803d; color:#fff; border-color:#15803d; }
        .fpill.db.active   { background:#b91c1c; color:#fff; border-color:#b91c1c; }

        /* ── Mobile txn card ── */
        .txn-card {
            background: var(--card-bg, #fff);
            border: 1px solid var(--border, #e5e7eb);
            border-radius: 12px;
            padding: 14px 16px;
            margin-bottom: 10px;
        }
        .txn-card-top {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            margin-bottom: 8px;
        }
        .txn-card-remark {
            font-size: 13px;
            color: var(--text-secondary, #555);
            margin-bottom: 8px;
        }
        .txn-card-meta {
            display: flex;
            gap: 10px;
            align-items: center;
            flex-wrap: wrap;
        }
        .txn-id-chip {
            font-size: 11px;
            color: #9ca3af;
            font-family: monospace;
        }

        /* ── Wallet info header card ── */
        .wallet-header-card {
            background: var(--card-bg, #fff);
            border: 1px solid var(--border, #e5e7eb);
            border-radius: 14px;
            padding: 18px 22px;
            margin-bottom: 24px;
            display: flex;
            flex-wrap: wrap;
            gap: 20px;
            align-items: center;
        }
        .wh-item {
            display: flex;
            flex-direction: column;
            gap: 2px;
        }
        .wh-item .wh-lbl {
            font-size: 11px;
            color: #9ca3af;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: .05em;
        }
        .wh-item .wh-val {
            font-size: 15px;
            font-weight: 700;
            color: var(--text-primary, #111827);
        }
        .wh-divider {
            width: 1px;
            height: 36px;
            background: var(--border, #e5e7eb);
        }

        @media (max-width: 767px) {
            .table-scroll { display: none; }
            .wh-divider   { display: none; }
        }
        @media (min-width: 768px) {
            .mobile-txn-cards { display: none; }
        }

