@charset "UTF-8";
@import url('https://fonts.googleapis.com/css2?family=Anek+Bangla:wght@400;500;600;700&family=Instrument+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --bg: #08090a;
  --bg2: #0c0e0f;
  --bg3: #fffdfa;
  --surface: #101214;
  --surface2: #171a1c;
  --surface3: #1f2325;
  --surface4: #e4dfd2;
  --acid: #c3f53c;
  --acid-bg: rgba(195, 245, 60, 0.08);
  --acid-ink: #08090a;
  --acid-line: rgba(195, 245, 60, 0.22);
  --text: #f3f6f2;
  --muted: #858c86;
  --muted2: #5d635e;
  --line: hsla(0, 0%, 100%, 0.075);
  --line2: hsla(0, 0%, 100%, 0.14);
  --fb: #1877f2;
  --wa: #25d366;
  --ig: #e1306c;
  --mode-ai: #4ea8de;
  --mode-human: #f5a524;
  --mode-temp: #a78bfa;
  --emerald: #136b4c;
  --mint: #7fe0a0;
  --amber: #8a5804;
  --danger: #ff6b7d;
  --sans: 'Instrument Sans', 'Anek Bangla', system-ui, sans-serif;
  --bn: 'Anek Bangla', 'Instrument Sans', sans-serif;
  --mono: 'IBM Plex Mono', monospace;
  --r-1: 4px;
  --r-2: 6px;
  --r-3: 8px;
  --r-4: 12px;
  --r-pill: 9999px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  height: 100vh;
  overflow: hidden;
  display: flex;
}

/* Sidebar Layout */
.sidebar {
  width: 240px;
  background-color: var(--bg2);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 16px 12px;
  flex-shrink: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  margin-bottom: 20px;
  text-decoration: none;
  color: var(--text);
}

.brand-logo {
  width: 28px;
  height: 28px;
  background: var(--acid);
  border-radius: var(--r-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--acid-ink);
  font-weight: 900;
  font-size: 16px;
}

.brand-text {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-tag {
  font-size: 10px;
  background: var(--surface3);
  color: var(--muted);
  padding: 2px 6px;
  border-radius: var(--r-1);
}

.nav-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: var(--r-2);
  color: var(--muted);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: all 0.15s var(--ease);
  cursor: pointer;
}

.nav-item:hover {
  background: var(--surface);
  color: var(--text);
}

.nav-item.active {
  background: var(--surface2);
  color: var(--text);
  border-left: 2px solid var(--acid);
}

.nav-badge {
  margin-left: auto;
  font-size: 11px;
  background: var(--acid-bg);
  color: var(--acid);
  border: 1px solid var(--acid-line);
  padding: 1px 7px;
  border-radius: var(--r-pill);
}

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

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
}

.user-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
}

.user-role {
  font-size: 11px;
  color: var(--muted);
}

/* Main Content Area */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  height: 56px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  flex-shrink: 0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-family: var(--mono);
  background: rgba(127, 224, 160, 0.1);
  color: var(--mint);
  border: 1px solid rgba(127, 224, 160, 0.25);
  padding: 3px 9px;
  border-radius: var(--r-pill);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 6px var(--mint);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.credit-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line2);
  padding: 4px 12px;
  border-radius: var(--r-pill);
  font-size: 13px;
}

.credit-amount {
  color: var(--acid);
  font-weight: 700;
}

.content-pane {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

/* Common UI Components */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  padding: 20px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--r-2);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
  font-family: var(--sans);
}

.btn-acid {
  background: var(--acid);
  color: var(--acid-ink);
}

.btn-acid:hover {
  background: #d2ff5c;
  box-shadow: 0 0 12px rgba(195, 245, 60, 0.35);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line2);
}

.btn-outline:hover {
  background: var(--surface2);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

/* Grid & Stats */
.grid-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  padding: 16px;
}

.stat-label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.stat-value {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* 3-Pane Inbox */
.inbox-container {
  display: flex;
  height: calc(100vh - 104px);
  margin: -24px;
  overflow: hidden;
}

.inbox-list {
  width: 320px;
  border-right: 1px solid var(--line);
  overflow-y: auto;
  background: var(--bg2);
}

.inbox-chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.inbox-details {
  width: 300px;
  border-left: 1px solid var(--line);
  background: var(--surface);
  padding: 20px;
  overflow-y: auto;
}

.conv-item {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  display: flex;
  gap: 12px;
  transition: background 0.1s ease;
}

.conv-item:hover, .conv-item.active {
  background: var(--surface2);
}

.mode-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--r-1);
  text-transform: uppercase;
}

.mode-ai { background: rgba(78, 168, 222, 0.15); color: var(--mode-ai); }
.mode-human { background: rgba(245, 165, 36, 0.15); color: var(--mode-human); }
.mode-temp { background: rgba(167, 139, 250, 0.15); color: var(--mode-temp); }

/* Chat Thread */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.msg-bubble {
  max-width: 65%;
  padding: 10px 14px;
  border-radius: var(--r-3);
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.msg-customer {
  align-self: flex-start;
  background: var(--surface2);
  border: 1px solid var(--line2);
  color: var(--text);
  border-bottom-left-radius: 2px;
}

.msg-ai {
  align-self: flex-end;
  background: #142308;
  border: 1px solid var(--acid-line);
  color: #e5fbc2;
  border-bottom-right-radius: 2px;
}

.msg-human {
  align-self: flex-end;
  background: #2d1e07;
  border: 1px solid rgba(245, 165, 36, 0.3);
  color: #ffeed3;
  border-bottom-right-radius: 2px;
}

.chat-input-bar {
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 10px;
  background: var(--bg2);
}

.chat-input {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--line2);
  color: var(--text);
  padding: 10px 14px;
  border-radius: var(--r-2);
  font-size: 14px;
  font-family: var(--sans);
  outline: none;
}

.chat-input:focus {
  border-color: var(--acid);
}

/* Data Tables & Pipelines */
.table-container {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  overflow: hidden;
  margin-top: 16px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th {
  background: var(--surface2);
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  border-bottom: 1px solid var(--line2);
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  vertical-align: middle;
}

.data-table tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

/* Trust Score & Badges */
.badge-trusted {
  background: rgba(195, 245, 60, 0.12);
  color: var(--acid);
  border: 1px solid var(--acid-line);
  padding: 2px 8px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-medium {
  background: rgba(245, 165, 36, 0.12);
  color: var(--mode-human);
  border: 1px solid rgba(245, 165, 36, 0.3);
  padding: 2px 8px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 700;
}

.badge-risk {
  background: rgba(255, 107, 125, 0.12);
  color: var(--danger);
  border: 1px solid rgba(255, 107, 125, 0.3);
  padding: 2px 8px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 700;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* Floating Merchant Copilot Drawer */
.copilot-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--surface2);
  border: 2px solid var(--acid);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 0 20px rgba(195, 245, 60, 0.25);
  color: var(--acid);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1000;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
}

.copilot-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.8), 0 0 30px rgba(195, 245, 60, 0.4);
}

.copilot-drawer {
  position: fixed;
  bottom: 90px;
  right: 24px;
  width: 380px;
  height: 540px;
  background: var(--bg2);
  border: 1px solid var(--line2);
  border-radius: var(--r-4);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.8);
  display: none;
  flex-direction: column;
  z-index: 1000;
  overflow: hidden;
}

.copilot-drawer.open {
  display: flex;
}

.copilot-header {
  padding: 14px 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.copilot-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.copilot-msg {
  padding: 10px 14px;
  border-radius: var(--r-3);
  font-size: 13px;
  line-height: 1.45;
}

.copilot-msg-ai {
  background: var(--surface2);
  border: 1px solid var(--line);
  color: var(--text);
  align-self: flex-start;
}

.copilot-msg-merchant {
  background: var(--acid-bg);
  border: 1px solid var(--acid-line);
  color: #d8faa1;
  align-self: flex-end;
}

.copilot-action-box {
  margin-top: 8px;
  padding: 10px;
  background: var(--surface3);
  border: 1px dashed var(--acid-line);
  border-radius: var(--r-2);
}

.copilot-quick-actions {
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  background: var(--surface);
  border-top: 1px solid var(--line);
  overflow-x: auto;
}

.copilot-chip {
  padding: 4px 8px;
  background: var(--surface2);
  border: 1px solid var(--line2);
  border-radius: var(--r-pill);
  font-size: 11px;
  color: var(--text);
  white-space: nowrap;
  cursor: pointer;
}

.copilot-chip:hover {
  border-color: var(--acid);
  color: var(--acid);
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.modal-card {
  background: var(--bg2);
  border: 1px solid var(--line2);
  border-radius: var(--r-4);
  width: 480px;
  max-width: 90vw;
  padding: 24px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.9);
}
