/**
 * CoinTap Financial Design System
 * Sử dụng font Manrope đồng bộ 100% với Mobile App & Web Admin (project_24ct_lenhatnam).
 */

@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@300;400;500;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200');

:root {
  --brand-dark: #0b132b;
  --brand-navy: #1c2541;
  --brand-primary: #6366f1;
  --brand-primary-hover: #4f46e5;
  --brand-light: #eef2ff;
  --brand-glow: rgba(99, 102, 241, 0.15);

  --accent-mint: #10b981;
  --accent-mint-hover: #059669;
  --accent-mint-bg: #ecfdf5;
  --accent-mint-text: #065f46;

  --accent-coral: #f43f5e;
  --accent-coral-hover: #e11d48;
  --accent-coral-bg: #fff1f2;
  --accent-coral-text: #9f1239;

  --accent-amber: #f59e0b;
  --accent-amber-bg: #fffbeb;
  --accent-amber-text: #92400e;

  --accent-blue: #0284c7;
  --accent-blue-bg: #f0f9ff;

  --bg-canvas: #f8fafc;
  --surface-card: #ffffff;
  --surface-hover: #f1f5f9;
  --border-subtle: #e2e8f0;
  --border-strong: #cbd5e1;

  --text-main: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-inverse: #ffffff;

  --font-main: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Manrope', SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.07), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.25);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --sidebar-width: 260px;
  --sidebar-collapsed-width: 76px;
  --header-height: 70px;
}

/* Reset cơ bản */
html {
  box-sizing: border-box;
  overflow-x: hidden;
  max-width: 100vw;
}

*, *::before, *::after {
  box-sizing: inherit;
  margin: 0;
  padding: 0;
}

img, canvas {
  max-width: 100%;
  height: auto;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-canvas);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  overflow-x: hidden;
  max-width: 100vw;
  position: relative;
}

button, input, select, textarea {
  font-family: var(--font-main);
}

/* Tabular numbers cho mọi con số tài chính */
.num, .amount, .tabular {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

/* Bố cục chính (Layout Frame) */
.app-container {
  display: flex;
  min-height: 100vh;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  position: relative;
}

/* 1. Sidebar bên trái */
.app-sidebar {
  width: var(--sidebar-width);
  background-color: var(--brand-dark);
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s ease;
  will-change: width, transform;
}

.sidebar-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.15rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  position: relative;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  overflow: hidden;
  min-width: 0;
  transition: all 0.2s ease;
}

.brand-logo-wrap {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.brand-badge:hover .brand-logo-wrap {
  transform: scale(1.08) rotate(3deg);
}

.brand-logo-img {
  width: 36px !important;
  height: 36px !important;
  max-width: 36px !important;
  max-height: 36px !important;
  object-fit: contain !important;
  flex-shrink: 0;
  display: block;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.25));
}

.brand-text {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  white-space: nowrap;
  min-width: 0;
  transition: opacity 0.2s ease;
}

.brand-title {
  font-family: var(--font-main);
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 0.68rem;
  font-weight: 700;
  color: #818cf8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.2;
  margin-top: 2px;
}

/* Nút thu gọn / mở rộng Sidebar tại Header (chuẩn đồng bộ 100% web_admin) */
.btn-sidebar-toggle {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  padding: 0;
  margin-left: auto;
}
.btn-sidebar-toggle .material-symbols-outlined {
  font-size: 1.2rem;
  transition: transform 0.25s ease;
}
.btn-sidebar-toggle:hover {
  background: rgba(99, 102, 241, 0.2);
  color: #ffffff;
  border-color: var(--brand-primary);
  transform: scale(1.05);
}

.brand-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #6366f1 0%, #4338ca 100%);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 800;
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.35);
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  overflow-y: auto;
  overflow-x: hidden !important;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}
.sidebar-nav::-webkit-scrollbar {
  width: 4px;
  height: 0px !important;
}
.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.nav-section-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: #64748b;
  letter-spacing: 0.05em;
  padding: 0.75rem 0.85rem 0.35rem;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity 0.2s ease;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  color: #94a3b8;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.925rem;
  border-radius: var(--radius-sm);
  transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
  white-space: nowrap;
  overflow: hidden;
}

.nav-link:hover {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.06);
  transform: translateX(2px);
}

.nav-link.active {
  color: #ffffff;
  background: linear-gradient(135deg, #2563eb 0%, #6366f1 100%);
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
  transform: none;
}

.nav-link .material-symbols-outlined {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.nav-link span:not(.material-symbols-outlined) {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-link.nav-link-admin {
  color: #f59e0b !important;
  border: 1px dashed rgba(245, 158, 11, 0.4);
  margin-top: 0.5rem;
}

.nav-link.nav-link-user-switch {
  color: #38bdf8 !important;
}

.nav-badge {
  margin-left: auto;
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  background-color: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  flex-shrink: 0;
}

.nav-badge.alert {
  background-color: var(--accent-coral);
}

.sidebar-footer {
  padding: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  transition: padding 0.25s ease;
}

.user-profile-pill {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-sm);
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
  transition: all 0.2s ease;
}

.user-profile-pill:hover {
  background-color: rgba(255, 255, 255, 0.07);
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  color: #ffffff;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
}

.user-info-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.user-info-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-info-role {
  font-size: 0.75rem;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-logout-btn {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background-color: rgba(244, 63, 94, 0.1);
  color: #f43f5e;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: all 0.2s ease;
  flex-shrink: 0;
  border: 1px solid rgba(244, 63, 94, 0.18);
}
.sidebar-logout-btn:hover {
  background-color: #f43f5e;
  color: #ffffff;
  transform: scale(1.06);
}

/* 2. Main Content Area */
.app-main {
  margin-left: var(--sidebar-width);
  width: calc(100% - var(--sidebar-width));
  max-width: calc(100% - var(--sidebar-width));
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left 0.25s cubic-bezier(0.4, 0, 0.2, 1), width 0.25s cubic-bezier(0.4, 0, 0.2, 1), max-width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box;
}

/* Header Sidebar Toggle Button */
.sidebar-toggle-btn {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}
.sidebar-toggle-btn:hover {
  background-color: #f8fafc;
  border-color: #cbd5e1;
  color: var(--brand-primary);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.1);
}
.sidebar-toggle-btn:active {
  transform: translateY(0);
}

/* ========================================================================= */
/* SIDEBAR THU GỌN (COLLAPSED SIDEBAR) - KHỚP 100% GIAO DIỆN WEB ADMIN       */
/* ========================================================================= */
.app-sidebar.collapsed,
html.sidebar-is-collapsed .app-sidebar {
  width: var(--sidebar-collapsed-width, 76px) !important;
}

.app-sidebar.collapsed ~ .app-main,
html.sidebar-is-collapsed .app-main {
  margin-left: var(--sidebar-collapsed-width, 76px) !important;
  width: calc(100% - var(--sidebar-collapsed-width, 76px)) !important;
  max-width: calc(100% - var(--sidebar-collapsed-width, 76px)) !important;
}

/* Header khi thu gọn: căn giữa tuyệt đối logo, ẩn text & nút toggle phụ */
.app-sidebar.collapsed .sidebar-header,
html.sidebar-is-collapsed .app-sidebar .sidebar-header {
  padding: 0 !important;
  justify-content: center !important;
}

.app-sidebar.collapsed .brand-badge,
html.sidebar-is-collapsed .app-sidebar .brand-badge {
  justify-content: center !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  gap: 0 !important;
  cursor: pointer;
}

.app-sidebar.collapsed .brand-text,
html.sidebar-is-collapsed .app-sidebar .brand-text,
.app-sidebar.collapsed .btn-sidebar-toggle,
html.sidebar-is-collapsed .app-sidebar .btn-sidebar-toggle {
  display: none !important;
}

.app-sidebar.collapsed .brand-logo-wrap,
html.sidebar-is-collapsed .app-sidebar .brand-logo-wrap {
  width: 42px !important;
  height: 42px !important;
  margin: 0 auto !important;
}

.app-sidebar.collapsed .brand-logo-img,
html.sidebar-is-collapsed .app-sidebar .brand-logo-img {
  width: 38px !important;
  height: 38px !important;
  max-width: 38px !important;
  max-height: 38px !important;
}

/* Nav items khi thu gọn: loại bỏ hoàn toàn thanh cuộn ngang (overflow-x: hidden) */
.app-sidebar.collapsed .sidebar-nav,
html.sidebar-is-collapsed .app-sidebar .sidebar-nav {
  padding: 1rem 0 !important;
  align-items: center !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

.app-sidebar.collapsed .nav-section-title,
html.sidebar-is-collapsed .app-sidebar .nav-section-title {
  font-size: 0 !important;
  height: 1px !important;
  width: 36px !important;
  margin: 0.55rem auto !important;
  padding: 0 !important;
  background-color: rgba(255, 255, 255, 0.12) !important;
  border: none !important;
  overflow: hidden !important;
  flex-shrink: 0 !important;
}

.app-sidebar.collapsed .nav-link,
html.sidebar-is-collapsed .app-sidebar .nav-link {
  width: 46px !important;
  height: 46px !important;
  margin: 0.35rem auto !important;
  padding: 0 !important;
  justify-content: center !important;
  border-radius: 12px !important;
  position: relative !important;
  flex-shrink: 0 !important;
  transform: none !important;
}

.app-sidebar.collapsed .nav-link span:not(.material-symbols-outlined),
html.sidebar-is-collapsed .app-sidebar .nav-link span:not(.material-symbols-outlined) {
  display: none !important;
}

.app-sidebar.collapsed .nav-link .nav-badge,
html.sidebar-is-collapsed .app-sidebar .nav-link .nav-badge,
.app-sidebar.collapsed .nav-link .badge,
html.sidebar-is-collapsed .app-sidebar .nav-link .badge {
  display: none !important;
}

.app-sidebar.collapsed .nav-link .material-symbols-outlined,
html.sidebar-is-collapsed .app-sidebar .nav-link .material-symbols-outlined {
  font-size: 1.45rem !important;
  margin: 0 !important;
}

.app-sidebar.collapsed .nav-link.active,
html.sidebar-is-collapsed .app-sidebar .nav-link.active {
  background: linear-gradient(135deg, #2563eb 0%, #6366f1 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.45) !important;
  border-radius: 14px !important;
}

/* Tooltip nổi lên bên phải khi hover lúc thu gọn */
.app-sidebar.collapsed .nav-link[data-tooltip]::after,
html.sidebar-is-collapsed .app-sidebar .nav-link[data-tooltip]::after,
.app-sidebar.collapsed .sidebar-logout-btn[data-tooltip]::after,
html.sidebar-is-collapsed .app-sidebar .sidebar-logout-btn[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 14px);
  top: 50%;
  transform: translateY(-50%) translateX(-8px);
  background-color: #0f172a;
  color: #ffffff;
  padding: 0.45rem 0.8rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: all 0.18s ease;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
  z-index: 1000;
}

.app-sidebar.collapsed .nav-link:hover::after,
html.sidebar-is-collapsed .app-sidebar .nav-link:hover::after,
.app-sidebar.collapsed .sidebar-logout-btn:hover::after,
html.sidebar-is-collapsed .app-sidebar .sidebar-logout-btn:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0);
}

/* Footer khi thu gọn: căn giữa avatar và nút logout theo cột */
.app-sidebar.collapsed .sidebar-footer,
html.sidebar-is-collapsed .app-sidebar .sidebar-footer {
  padding: 0.85rem 0 !important;
  display: flex !important;
  justify-content: center !important;
}

.app-sidebar.collapsed .user-profile-pill,
html.sidebar-is-collapsed .app-sidebar .user-profile-pill {
  flex-direction: column !important;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  gap: 0.65rem !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
}

.app-sidebar.collapsed .user-info-text,
html.sidebar-is-collapsed .app-sidebar .user-info-text {
  display: none !important;
}

.app-sidebar.collapsed .avatar,
html.sidebar-is-collapsed .app-sidebar .avatar {
  width: 40px !important;
  height: 40px !important;
  font-size: 1rem !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25) !important;
}

.app-sidebar.collapsed .sidebar-logout-btn,
html.sidebar-is-collapsed .app-sidebar .sidebar-logout-btn {
  width: 36px !important;
  height: 36px !important;
  border-radius: 10px !important;
  background-color: rgba(244, 63, 94, 0.14) !important;
  color: #f43f5e !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-decoration: none !important;
  position: relative !important;
  border: 1px solid rgba(244, 63, 94, 0.25) !important;
}

.app-sidebar.collapsed .sidebar-logout-btn:hover,
html.sidebar-is-collapsed .app-sidebar .sidebar-logout-btn:hover {
  background-color: #f43f5e !important;
  color: #ffffff !important;
  transform: scale(1.06) !important;
}

/* Topbar */
.app-header {
  height: var(--header-height);
  background-color: var(--surface-card);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 90;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.live-clock-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  background-color: var(--bg-canvas);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Nút bấm (Buttons) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.55rem 1.15rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
  line-height: 1.25;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background-color: var(--brand-primary);
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(99, 102, 241, 0.25);
}

.btn-primary:hover {
  background-color: var(--brand-primary-hover);
  box-shadow: 0 4px 8px rgba(99, 102, 241, 0.35);
}

.btn-success {
  background-color: var(--accent-mint);
  color: #ffffff;
}

.btn-success:hover {
  background-color: var(--accent-mint-hover);
}

.btn-danger {
  background-color: var(--accent-coral);
  color: #ffffff;
}

.btn-danger:hover {
  background-color: var(--accent-coral-hover);
}

.btn-outline {
  background-color: var(--surface-card);
  border-color: var(--border-subtle);
  color: var(--text-main);
}

.btn-outline:hover {
  background-color: var(--surface-hover);
  border-color: var(--border-strong);
}

.btn-ghost {
  background-color: transparent;
  color: var(--text-muted);
}

.btn-ghost:hover {
  background-color: var(--surface-hover);
  color: var(--text-main);
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.825rem;
}

.btn-icon {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: var(--radius-sm);
}

/* Content Body */
.app-content {
  flex: 1;
  padding: 2rem;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

/* Thẻ bề mặt (Cards) */
.card {
  background-color: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

/* Hero Section: Financial Pulse */
.financial-pulse-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.75rem;
  width: 100%;
  box-sizing: border-box;
}

@media (min-width: 1240px) {
  .financial-pulse-grid {
    grid-template-columns: 1.25fr 1fr 1fr 1fr;
  }
}

/* Dashboard Two-Column Grid Helper */
.dashboard-two-col-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.1fr);
  gap: 1.75rem;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 1024px) {
  .dashboard-two-col-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.25rem;
  }
}

.pulse-card-hero {
  background: linear-gradient(135deg, #0b132b 0%, #1c2541 100%);
  color: #ffffff;
  border: none;
  position: relative;
  overflow: hidden;
}

.pulse-card-hero::after {
  content: '';
  position: absolute;
  top: -30%;
  right: -20%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.4) 0%, transparent 70%);
  pointer-events: none;
}

.pulse-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: #94a3b8;
  margin-bottom: 0.5rem;
}

.pulse-val {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.pulse-sub {
  font-size: 0.825rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  font-size: 0.775rem;
  font-weight: 600;
  border-radius: var(--radius-full);
}

.badge-mint {
  background-color: var(--accent-mint-bg);
  color: var(--accent-mint-text);
}

.badge-coral {
  background-color: var(--accent-coral-bg);
  color: var(--accent-coral-text);
}

.badge-amber {
  background-color: var(--accent-amber-bg);
  color: var(--accent-amber-text);
}

.badge-indigo {
  background-color: var(--brand-light);
  color: var(--brand-primary);
}

.badge-neutral {
  background-color: #f1f5f9;
  color: #475569;
}

/* Thanh đo Ngân sách (Budget Burn Progress) */
.budget-meter {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.meter-track {
  width: 100%;
  height: 8px;
  background-color: #f1f5f9;
  border-radius: var(--radius-full);
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

.meter-fill.success { background-color: var(--accent-mint); }
.meter-fill.warning { background-color: var(--accent-amber); }
.meter-fill.danger { background-color: var(--accent-coral); }

/* Bảng dữ liệu (Data Table) */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

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

.data-table th {
  padding: 0.75rem 1rem;
  background-color: #f8fafc;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.8rem;
  border-bottom: 1px solid var(--border-subtle);
  text-transform: none;
}

.data-table td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background-color 0.1s ease;
}

.data-table tbody tr:hover {
  background-color: #f8fafc;
}

/* Thẻ ví tiền (Wallet Card) */
.wallet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.wallet-card {
  border-radius: var(--radius-md);
  padding: 1.25rem;
  background-color: var(--surface-card);
  border: 1px solid var(--border-subtle);
  position: relative;
  transition: all 0.2s ease;
  overflow: hidden;
}

.wallet-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background-color: var(--wallet-color, #10b981);
}

.wallet-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.wallet-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.wallet-icon-box {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
}

/* AI Assistant Chat UI */
.chat-container {
  display: flex;
  height: calc(100vh - var(--header-height) - 4rem);
  background-color: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.chat-sessions-sidebar {
  width: 300px;
  background-color: #f8fafc;
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
}

.sessions-header {
  padding: 1rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sessions-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.session-item {
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.15s ease;
}

.session-item:hover {
  background-color: #e2e8f0;
  color: var(--text-main);
}

.session-item.active {
  background-color: var(--brand-light);
  color: var(--brand-primary);
  font-weight: 600;
}

.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background-color: #ffffff;
}

.chat-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.chat-bubble {
  max-width: 80%;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.925rem;
  line-height: 1.6;
}

.chat-bubble.user {
  align-self: flex-end;
  background-color: var(--brand-primary);
  color: #ffffff;
  border-bottom-right-radius: 2px;
}

.chat-bubble.ai {
  align-self: flex-start;
  background-color: #f1f5f9;
  color: var(--text-main);
  border-bottom-left-radius: 2px;
}

.chat-bubble.ai strong {
  color: var(--brand-dark);
}

.chat-bubble.ai ul {
  padding-left: 1.25rem;
  margin: 0.5rem 0;
}

.chat-input-bar {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-subtle);
  background-color: #ffffff;
}

.chat-input-form {
  display: flex;
  gap: 0.75rem;
}

.chat-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.925rem;
  outline: none;
  transition: border-color 0.15s ease;
}

.chat-input:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px var(--brand-glow);
}

/* Modal Dialogs */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-backdrop.active {
  display: flex;
}

.modal-box {
  background-color: var(--surface-card);
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  background-color: #f8fafc;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Forms */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-control {
  width: 100%;
  padding: 0.65rem 0.85rem;
  font-size: 0.9rem;
  font-family: inherit;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background-color: #ffffff;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px var(--brand-glow);
}

/* Toast Messages */
.toast-container {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 380px;
}

.toast {
  padding: 0.85rem 1.25rem;
  background-color: #ffffff;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--brand-primary);
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: toastIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.toast.success { border-left-color: var(--accent-mint); }
.toast.error { border-left-color: var(--accent-coral); }
.toast.warning { border-left-color: var(--accent-amber); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(60px) scale(0.9); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

/* ========================================================================= */
/* ANIMATION SUITE - ANTHROPIC FRONTEND-DESIGN POLISH                        */
/* ========================================================================= */

/* 1. Staggered Page Entrance Animation */
@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translateY(18px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.app-content > * {
  animation: fadeInUp 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.financial-pulse-grid > div:nth-child(1) { animation-delay: 0.04s; }
.financial-pulse-grid > div:nth-child(2) { animation-delay: 0.08s; }
.financial-pulse-grid > div:nth-child(3) { animation-delay: 0.12s; }
.financial-pulse-grid > div:nth-child(4) { animation-delay: 0.16s; }

/* 2. Enhanced Card Interactions & 3D Lift */
.card {
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease, border-color 0.25s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md), 0 0 15px rgba(99, 102, 241, 0.08);
  border-color: #cbd5e1;
}

.pulse-card-hero:hover {
  transform: translateY(-4px) scale(1.005);
  box-shadow: 0 16px 30px -6px rgba(11, 19, 43, 0.35), var(--shadow-glow);
}

.wallet-card {
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease, border-color 0.25s ease;
}

.wallet-card:hover {
  transform: translateY(-5px) scale(1.01);
  box-shadow: 0 12px 24px -6px rgba(15, 23, 42, 0.12), 0 0 18px -2px var(--wallet-color, rgba(16, 185, 129, 0.25));
}

/* 3. Button Micro-interactions */
.btn {
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}

.btn:hover {
  transform: translateY(-1.5px);
}

.btn:active {
  transform: scale(0.96) translateY(0);
}

/* Hiệu ứng Ripple tinh tế khi click */
.btn::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  background: rgba(255, 255, 255, 0.4);
  opacity: 0;
  border-radius: 100%;
  transform: scale(1, 1) translate(-50%);
  transform-origin: 50% 50%;
}

.btn:focus:not(:active)::after {
  animation: ripple 0.6s ease-out;
}

@keyframes ripple {
  0% { transform: scale(0, 0); opacity: 0.5; }
  100% { transform: scale(40, 40); opacity: 0; }
}

/* 4. Live Pulse Dot Animation */
@keyframes liveDotPulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    transform: scale(1.15);
    box-shadow: 0 0 0 7px rgba(16, 185, 129, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-mint);
  animation: liveDotPulse 2s infinite cubic-bezier(0.4, 0, 0.6, 1);
  vertical-align: middle;
  margin-right: 0.25rem;
}

/* 5. Smooth Meter Progress Bar Animation */
.meter-fill {
  transition: width 1s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.meter-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.25) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: translateX(-100%);
  animation: shimmer 2.5s infinite;
}

@keyframes shimmer {
  100% {
    transform: translateX(100%);
  }
}

/* 6. AI Chat Typing Animated Dots */
.typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 4px;
}

.typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--brand-primary);
  animation: bounceDot 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounceDot {
  0%, 80%, 100% {
    transform: scale(0.4);
    opacity: 0.4;
  }
  40% {
    transform: scale(1.1);
    opacity: 1;
  }
}

/* 7. Modal Bounce Entrance */
.modal-backdrop.active .modal-box {
  animation: modalBounceIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalBounceIn {
  0% {
    opacity: 0;
    transform: scale(0.85) translateY(24px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* 8. Table Row Hover Micro-glow */
.data-table tbody tr {
  transition: all 0.15s ease;
}

.data-table tbody tr:hover {
  background-color: #f1f5f9;
  transform: scale(1.002);
}

/* 9. Prompt Suggestion Pill Hover Lift */
.prompt-suggestion-pill {
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.prompt-suggestion-pill:hover {
  transform: translateY(-2px);
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.15);
}

/* 10. Respect Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Responsive */
@media (max-width: 1024px) {
  .financial-pulse-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
  }
}

@media (max-width: 768px) {
  .app-sidebar {
    transform: translateX(-100%);
    box-shadow: 4px 0 25px rgba(0, 0, 0, 0.4);
  }
  .app-sidebar.open {
    transform: translateX(0);
  }
  .app-main {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  .app-header {
    padding: 0 1rem;
  }
  .header-actions .btn span:not(.material-symbols-outlined) {
    display: none;
  }
  .live-clock-pill {
    display: none;
  }
  .app-content {
    padding: 1.25rem 1rem;
  }
  .financial-pulse-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .chat-container {
    flex-direction: column;
    height: auto;
  }
  .chat-sessions-sidebar {
    width: 100%;
    max-height: 200px;
  }
}

@media (max-width: 900px) {
  .filter-form-grid {
    grid-template-columns: 1fr 1fr !important;
  }
}

@media (max-width: 540px) {
  .filter-form-grid {
    grid-template-columns: 1fr !important;
  }
}

