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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-l1);
  color: var(--content-01);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

/* ===== HEADER ===== */
.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: 64px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px;
  background: var(--bg-l1);
  border-bottom: 1px solid var(--border-03);
}
.header .account-toggle {
  position: absolute; left: 50%; transform: translateX(-50%);
}
.header-logo { display: flex; align-items: center; gap: 12px; }
.header-logo svg { height: 28px; }
.header-right { display: flex; align-items: center; gap: 20px; }
.header-user {
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; font-weight: 500; color: var(--content-01);
}
.header-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--brand-01); color: var(--content-03);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600;
}
.header-bell {
  position: relative; cursor: pointer;
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-l2); transition: background 0.2s;
}
.header-bell:hover { background: var(--bg-l3); }
.header-bell svg { width: 20px; height: 20px; color: var(--content-01); }
.header-bell-badge {
  position: absolute; top: 2px; right: 2px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--negative-01); color: white;
  font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.demo-mode-btn {
  padding: 6px 14px; border-radius: var(--radius-full);
  background: var(--brand-01); color: var(--content-03);
  font-size: 12px; font-weight: 500; cursor: pointer;
  border: none; transition: all 0.2s; letter-spacing: 0.02em;
}
.demo-mode-btn:hover { background: #004d33; }
.demo-mode-btn.active { background: var(--positive-01); }

/* ===== ACCOUNT TOGGLE (Segmented Control) ===== */
.account-toggle {
  display: flex;
  border-radius: 24px;
  border: 1px solid var(--border-02);
  overflow: hidden;
  background: var(--bg-l2);
  position: relative;
}
.account-toggle-btn {
  padding: 7px 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--content-02);
  transition: background 0.3s, color 0.3s;
  font-family: 'Inter', sans-serif;
  min-width: 90px;
  text-align: center;
  border-radius: 24px;
  position: relative;
  z-index: 1;
}
.account-toggle-btn:hover {
  color: var(--content-01);
}
.account-toggle-btn.active {
  background: var(--brand-01);
  color: white;
  box-shadow: 0 2px 8px rgba(0,56,36,0.2);
}

/* ===== FOOTER ===== */
.footer {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  height: 44px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px;
  background: var(--bg-l1);
  border-top: 1px solid var(--border-03);
  font-size: 11px; color: var(--content-04);
}
.footer-dots { display: flex; gap: 8px; }
.footer-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--border-02); cursor: pointer; transition: all 0.2s;
}
.footer-dot:hover, .footer-dot.active { background: var(--brand-01); transform: scale(1.3); }

/* ===== PANEL OVERLAY ===== */
.panel-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(10,11,11,0.3);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  z-index: 200; opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease;
}
.panel-overlay.active { opacity: 1; pointer-events: all; }
.panel {
  position: fixed; top: 0; right: -520px; bottom: 0;
  width: 520px; max-width: 100vw;
  background: var(--bg-l1);
  box-shadow: var(--shadow-xl);
  z-index: 201;
  display: flex; flex-direction: column;
  transition: right 0.3s ease;
}
.panel.active { right: 0; }
.panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-03);
}
.panel-header-left { display: flex; align-items: center; gap: 12px; }
.panel-avatar-sm {
  width: 36px; height: 36px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #00664a, var(--brand-01));
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  overflow: hidden;
}
.panel-avatar-sm .eye {
  width: 4px; height: 4px; border-radius: 50%;
  background: rgba(255,255,255,0.85); display: inline-block; margin: 0 2px;
}
.panel-title { font-size: 15px; font-weight: 600; color: var(--content-01); }
.panel-close {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--bg-l2); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: var(--content-02); transition: all 0.2s;
}
.panel-close:hover { background: var(--bg-l3); color: var(--content-01); }
.panel-body {
  flex: 1; overflow-y: auto; padding: 24px;
  display: flex; flex-direction: column; gap: 16px;
}

/* ===== CHAT MESSAGES ===== */
.chat-msg { max-width: 92%; animation: fadeInUp 0.4s ease-out; }
.chat-msg.aria { align-self: flex-start; }
.chat-msg.user { align-self: flex-end; }
.chat-bubble { padding: 14px 18px; border-radius: var(--radius-lg); font-size: 14px; line-height: 1.6; }
.chat-msg.aria .chat-bubble { background: var(--bg-l2); color: var(--content-01); border-bottom-left-radius: 4px; }
.chat-msg.user .chat-bubble { background: var(--brand-01); color: var(--content-03); border-bottom-right-radius: 4px; }

/* ===== TYPING INDICATOR ===== */
.typing-indicator {
  display: flex; gap: 4px; padding: 14px 18px;
  background: var(--bg-l2); border-radius: var(--radius-lg);
  border-bottom-left-radius: 4px; width: fit-content;
}
.typing-indicator span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--content-04); animation: bounce-dot 1.2s ease-in-out infinite;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

/* ===== QUICK REPLIES ===== */
.quick-replies { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; animation: fadeInUp 0.4s ease-out; }
.quick-reply-btn {
  padding: 10px 16px; background: var(--bg-l1);
  border: 1px solid var(--border-02); border-radius: var(--radius-full);
  font-size: 13px; color: var(--brand-01); cursor: pointer;
  font-weight: 500; transition: all 0.2s; font-family: 'Inter', sans-serif;
}
.quick-reply-btn:hover { background: var(--state-hover); border-color: var(--brand-01); }

/* ===== CONTENT CARDS ===== */
.content-card {
  background: var(--bg-l2); border: 1px solid var(--border-03);
  border-radius: var(--radius-md); padding: 16px; animation: fadeInUp 0.4s ease-out;
}
.content-card.success { background: var(--positive-bg); border-color: rgba(2,120,57,0.2); }
.content-card.warning { background: var(--warning-bg); border-color: rgba(143,83,10,0.2); }
.content-card.danger { background: var(--negative-bg); border-color: rgba(185,47,19,0.2); }
.content-card.info { background: var(--notice-bg); border-color: rgba(0,95,179,0.2); }

/* ===== TABLES ===== */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  text-align: left; padding: 10px 12px; background: var(--bg-l3);
  font-weight: 600; color: var(--content-01); border-bottom: 1px solid var(--border-02);
}
.data-table td { padding: 10px 12px; border-bottom: 1px solid var(--border-03); color: var(--content-01); }
.data-table tr:last-child td { border-bottom: none; }

/* ===== PROGRESS BARS ===== */
.progress-bar-container { background: var(--bg-l3); border-radius: var(--radius-full); height: 8px; overflow: hidden; margin: 8px 0; }
.progress-bar-fill { height: 100%; border-radius: var(--radius-full); transition: width 1s ease-out; }

/* ===== STATUS TRACKER ===== */
.status-tracker { display: flex; flex-direction: column; gap: 12px; }
.status-step { display: flex; align-items: flex-start; gap: 12px; font-size: 13px; }
.status-icon {
  width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; flex-shrink: 0; margin-top: 1px;
}
.status-icon.done { background: var(--positive-bg2); color: var(--positive-01); }
.status-icon.progress { background: var(--notice-bg); color: var(--notice-01); }
.status-icon.pending { background: var(--bg-l3); color: var(--content-04); }

/* ===== TRANSACTION ROWS ===== */
.txn-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px; border-radius: var(--radius-sm); cursor: pointer; transition: background 0.2s;
}
.txn-row:hover { background: var(--state-hover); }
.txn-row .txn-left { display: flex; flex-direction: column; gap: 2px; }
.txn-row .txn-merchant { font-size: 14px; font-weight: 500; }
.txn-row .txn-date { font-size: 12px; color: var(--content-02); }
.txn-row .txn-amount { font-size: 14px; font-weight: 600; }
.txn-row .txn-flag { color: var(--warning-01); font-size: 12px; margin-left: 4px; }

/* ===== CHART CONTAINER ===== */
.chart-container { position: relative; width: 200px; height: 200px; margin: 12px auto; }

/* ===== OPTION CARDS ===== */
.option-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.option-card {
  padding: 16px; background: var(--bg-l1); border: 1px solid var(--border-02);
  border-radius: var(--radius-md); text-align: center; cursor: pointer; transition: all 0.2s;
}
.option-card:hover { border-color: var(--brand-01); background: var(--state-hover); }
.option-card .opt-icon { font-size: 28px; margin-bottom: 8px; }
.option-card .opt-title { font-size: 13px; font-weight: 600; color: var(--content-01); }
.option-card .opt-desc { font-size: 11px; color: var(--content-02); margin-top: 4px; }

/* ===== APPLICATION STEPS ===== */
.app-step {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; background: var(--bg-l2);
  border-radius: var(--radius-md); margin-bottom: 8px;
}
.app-step .step-num {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--brand-01); color: var(--content-03);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.app-step .step-num.done { background: var(--positive-01); }
.app-step .step-content { flex: 1; }
.app-step .step-label { font-size: 13px; color: var(--content-02); }
.app-step .step-value { font-size: 14px; font-weight: 500; color: var(--content-01); }
.app-step .step-check { color: var(--positive-01); font-size: 16px; }

/* ===== LOADING BAR ===== */
.loading-bar { height: 4px; background: var(--bg-l3); border-radius: var(--radius-full); overflow: hidden; margin: 12px 0; }
.loading-bar-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--brand-01), var(--positive-01));
  border-radius: var(--radius-full); animation: loading 2s ease-out forwards;
}

/* ===== APPROVED CARD ===== */
.approved-card { text-align: center; padding: 24px; }
.approved-icon {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--positive-bg2);
  display: flex; align-items: center; justify-content: center; margin: 0 auto 16px;
}

/* ===== UTILITY CLASSES ===== */
.text-positive { color: var(--positive-01); }
.text-negative { color: var(--negative-01); }
.text-warning { color: var(--warning-01); }
.text-notice { color: var(--notice-01); }
.text-brand { color: var(--brand-01); }
.text-muted { color: var(--content-02); }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.text-bold { font-weight: 600; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes bounce-dot {
  0%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-8px); }
}
@keyframes loading {
  0% { width: 0%; }
  100% { width: 100%; }
}

/* ===== SCROLLBAR ===== */
.panel-body::-webkit-scrollbar { width: 4px; }
.panel-body::-webkit-scrollbar-track { background: transparent; }
.panel-body::-webkit-scrollbar-thumb { background: var(--border-02); border-radius: 4px; }

/* ===== VIEW SYSTEM ===== */
.view { position: absolute; top: 64px; left: 0; right: 0; bottom: 0; overflow: hidden; }
.view.hidden { display: none; }
.view.slide-out-left { animation: slideOutLeft 400ms ease-in-out forwards; }
.view.slide-in-right { animation: slideInRight 400ms ease-in-out forwards; }
.view.slide-out-right { animation: slideOutRight 400ms ease-in-out forwards; }
.view.slide-in-left { animation: slideInLeft 400ms ease-in-out forwards; }

@keyframes slideOutLeft { from { transform: translateX(0); opacity: 1; } to { transform: translateX(-100%); opacity: 0; } }
@keyframes slideInRight { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideOutRight { from { transform: translateX(0); opacity: 1; } to { transform: translateX(100%); opacity: 0; } }
@keyframes slideInLeft { from { transform: translateX(-100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
