/* =========================================================
   Billing & Inventory System — Design System
   Palette: deep ledger-navy + warm brass accent, tuned for
   a finance/inventory product (not a generic admin theme).
   ========================================================= */

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

:root {
  --navy-950: #0f1729;
  --navy-900: #141d35;
  --navy-800: #1b2544;
  --navy-700: #26315a;
  --navy-100: #eef1f8;

  --brass-500: #c9922b;
  --brass-600: #b17d1e;
  --brass-100: #fbf1de;

  --ink-900: #131826;
  --ink-600: #5a6478;
  --ink-400: #8a93a6;

  --surface: #f6f7fb;
  --card: #ffffff;
  --border: #e7e9f2;

  --success: #1a9c6b;
  --success-bg: #e6f7f0;
  --danger: #d64545;
  --danger-bg: #fceaea;
  --warning: #c9922b;
  --warning-bg: #fbf1de;
  --info: #3768c9;
  --info-bg: #eaf1fd;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 41, 0.06);
  --shadow-md: 0 8px 24px rgba(15, 23, 41, 0.08);
  --sidebar-w: 264px;

  /* Overridden per-business from Business Settings → Theme Color (see includes/header.php) */
  --theme-glow-1: rgba(201, 146, 43, 0.16);
  --theme-glow-2: rgba(201, 146, 43, 0.10);
}

/* ---------- Dark mode ---------- */
:root[data-theme="dark"] {
  --navy-100: #202a48;

  --ink-900: #eef1f8;
  --ink-600: #b7c0d6;
  --ink-400: #7c869e;

  --surface: #0c1220;
  --card: #141c30;
  --border: #29324c;

  --success-bg: rgba(26, 156, 107, 0.16);
  --danger-bg: rgba(214, 69, 69, 0.16);
  --warning-bg: rgba(201, 146, 43, 0.16);
  --info-bg: rgba(55, 104, 201, 0.16);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
}
:root[data-theme="dark"] .btn-close { filter: invert(1) grayscale(100%); }
:root[data-theme="dark"] .table-hover tbody tr:hover { background: var(--navy-100); }
:root[data-theme="dark"] .invoice-sheet,
:root[data-theme="dark"] .auth-card { background: var(--card); }
:root[data-theme="dark"] .invoice-items-table thead th { background: var(--surface); }
:root[data-theme="dark"] .global-search-results,
:root[data-theme="dark"] .notif-dropdown,
:root[data-theme="dark"] .dropdown-menu { background: var(--card); border-color: var(--border); }
:root[data-theme="dark"] .dropdown-item { color: var(--ink-900); }
:root[data-theme="dark"] .dropdown-item:hover { background: var(--navy-100); }
:root[data-theme="dark"] .btn-profile,
:root[data-theme="dark"] .btn-icon,
:root[data-theme="dark"] .topbar-search,
:root[data-theme="dark"] .form-control,
:root[data-theme="dark"] .form-select {
  background: var(--card);
  border-color: var(--border);
  color: var(--ink-900);
}
:root[data-theme="dark"] .badge-inactive { color: var(--surface); }

* { box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, 'Segoe UI', Roboto, 'Noto Sans', Arial, sans-serif;
  background: var(--surface);
  color: var(--ink-900);
  font-size: 14.5px;
}

h1, h2, h3, h4, h5, h6, .brand-font {
  font-family: 'Manrope', 'Inter', 'Segoe UI', Roboto, 'Noto Sans', Arial, sans-serif;
  color: var(--ink-900);
}

.money, .tabular-nums, table td.text-end {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

a { text-decoration: none; }

/* ---------- Auth pages ---------- */
.auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 15% 20%, rgba(201, 146, 43, 0.12), transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(38, 49, 90, 0.25), transparent 40%),
    var(--navy-950);
  padding: 24px;
}
.auth-wrapper { width: 100%; max-width: 420px; }
.auth-card { border-radius: 20px; overflow: hidden; background: var(--card); }
.auth-card-brand { padding: 32px 24px 8px; }
.auth-logo {
  width: 56px; height: 56px; margin: 0 auto;
  background: linear-gradient(135deg, var(--brass-500), var(--brass-600));
  color: #fff; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; box-shadow: 0 8px 20px rgba(201, 146, 43, 0.35);
}
.toggle-pass { cursor: pointer; }

/* ---------- App shell ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--navy-950), var(--navy-900));
  color: #cfd5e6;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  display: flex; flex-direction: column;
  z-index: 1030;
  transition: transform 0.25s ease;
  border-right: 1px solid rgba(255,255,255,0.04);
}
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 22px 20px; border-bottom: 1px solid rgba(255,255,255,0.06);
}
.sidebar-logo-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--brass-500), var(--brass-600));
  display: flex; align-items: center; justify-content: center; color: #fff; flex-shrink: 0;
}
.sidebar-logo-img { width: 36px; height: 36px; border-radius: 10px; object-fit: cover; }
.sidebar-brand-text { font-family: 'Manrope', 'Noto Sans', Arial, sans-serif; font-weight: 800; color: #fff; font-size: 15px; line-height: 1.2; }

.sidebar-nav { padding: 14px 12px 24px; overflow-y: auto; flex: 1; }
.nav-section-label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em;
  color: #6b7391; font-weight: 700; padding: 14px 12px 6px;
}
.sidebar-nav .nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; border-radius: var(--radius-sm);
  color: #cfd5e6; font-size: 13.6px; font-weight: 500;
  margin-bottom: 2px; transition: background 0.15s, color 0.15s;
}
.sidebar-nav .nav-link i { width: 18px; text-align: center; color: #8891ac; font-size: 14px; }
.sidebar-nav .nav-link:hover { background: rgba(255,255,255,0.06); color: #fff; }
.sidebar-nav .nav-link.active { background: rgba(201, 146, 43, 0.16); color: #fff; }
.sidebar-nav .nav-link.active i { color: var(--brass-500); }
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 1020; }

.main-content { margin-left: var(--sidebar-w); flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: 64px; background: var(--card); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px; padding: 0 20px;
  position: sticky; top: 0; z-index: 1010;
}
.btn-icon {
  width: 38px; height: 38px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: #fff; color: var(--ink-600); display: flex; align-items: center; justify-content: center;
}
.topbar-search { flex: 1; max-width: 440px; position: relative; display: flex; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 0 12px; height: 40px; }
.topbar-search i { color: var(--ink-400); font-size: 13px; margin-right: 8px; }
.topbar-search input { border: none; background: transparent; outline: none; width: 100%; font-size: 13.6px; }
.global-search-results {
  position: absolute; top: 46px; left: 0; right: 0; background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-md); max-height: 320px; overflow-y: auto; z-index: 1050; display: none;
}
.global-search-results .result-item { display: block; padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--ink-900); }
.global-search-results .result-item:hover { background: var(--surface); }
.global-search-results .result-type { font-size: 10.5px; text-transform: uppercase; color: var(--ink-400); letter-spacing: 0.05em; }

.topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.notif-dot {
  position: absolute; top: 4px; right: 4px; background: var(--danger); color: #fff;
  font-size: 9px; min-width: 15px; height: 15px; border-radius: 50%; display: flex; align-items: center; justify-content: center; padding: 0 2px;
}
.notif-dropdown { width: 300px; max-height: 340px; overflow-y: auto; }
.btn-profile {
  display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); background: #fff;
  border-radius: 999px; padding: 5px 12px 5px 5px; font-size: 13.4px; font-weight: 600; color: var(--ink-900);
}
.avatar {
  width: 28px; height: 28px; border-radius: 50%; background: var(--navy-800); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 700;
}

.page-body { padding: 22px 24px 40px; }
.page-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 20px; }
.page-header h1 { font-size: 21px; font-weight: 800; margin: 0; }
.page-header .text-muted { font-size: 13px; }
.breadcrumb-mini { font-size: 12.5px; color: var(--ink-400); margin-bottom: 4px; }

/* ---------- Cards ---------- */
.card { border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.stat-card { background: var(--card); border-radius: var(--radius); border: 1px solid var(--border); padding: 18px 18px 16px; position: relative; overflow: hidden; }
.stat-card .stat-icon {
  width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 16px; margin-bottom: 12px;
}
.stat-card .stat-value { font-family: 'Manrope', 'Noto Sans', Arial, sans-serif; font-size: 22px; font-weight: 800; line-height: 1; }
.stat-card .stat-label { font-size: 12.5px; color: var(--ink-600); margin-top: 6px; }
.stat-card .stat-trend { font-size: 11.5px; font-weight: 700; margin-top: 8px; display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; }
.stat-icon.bg-brass { background: var(--brass-100); color: var(--brass-600); }
.stat-icon.bg-navy { background: var(--navy-100); color: var(--navy-800); }
.stat-icon.bg-success { background: var(--success-bg); color: var(--success); }
.stat-icon.bg-danger { background: var(--danger-bg); color: var(--danger); }
.stat-icon.bg-info { background: var(--info-bg); color: var(--info); }
.stat-icon.bg-warning { background: var(--warning-bg); color: var(--warning); }

.section-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); }
.section-card .section-card-header { padding: 16px 18px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.section-card .section-card-header h6 { margin: 0; font-weight: 800; font-size: 14px; }
.section-card .section-card-body { padding: 18px; }

/* ---------- Buttons ---------- */
.btn-primary { background: var(--navy-900); border-color: var(--navy-900); font-weight: 600; }
.btn-primary:hover, .btn-primary:focus { background: var(--navy-800); border-color: var(--navy-800); }
.btn-brass { background: var(--brass-500); border-color: var(--brass-500); color: #fff; font-weight: 600; }
.btn-brass:hover { background: var(--brass-600); border-color: var(--brass-600); color: #fff; }
.btn-outline-primary { color: var(--navy-900); border-color: var(--navy-700); }
.btn-outline-primary:hover { background: var(--navy-900); border-color: var(--navy-900); }

/* ---------- Tables ---------- */
.table thead th { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-600); border-bottom: 1px solid var(--border); font-weight: 700; background: var(--surface); }
.table td { font-size: 13.4px; vertical-align: middle; }
.table-hover tbody tr:hover { background: var(--navy-100); }

.badge-status { font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 999px; }
.badge-paid { background: var(--success-bg); color: var(--success); }
.badge-partial { background: var(--warning-bg); color: var(--warning); }
.badge-unpaid { background: var(--danger-bg); color: var(--danger); }
.badge-active { background: var(--success-bg); color: var(--success); }
.badge-inactive { background: var(--ink-400); color: #fff; }
.badge-low { background: var(--warning-bg); color: var(--warning); }
.badge-out { background: var(--danger-bg); color: var(--danger); }

/* ---------- Forms ---------- */
.form-label { font-size: 12.8px; font-weight: 600; color: var(--ink-900); }
.form-control, .form-select { border-color: var(--border); font-size: 13.6px; }
.form-control:focus, .form-select:focus { border-color: var(--brass-500); box-shadow: 0 0 0 3px rgba(201, 146, 43, 0.12); }

/* ---------- Invoice / billing builder ---------- */
.line-item-row td { padding: 8px 6px; }
.invoice-totals { max-width: 340px; margin-left: auto; }
.invoice-totals .row-item { display: flex; justify-content: space-between; padding: 6px 0; font-size: 13.5px; }
.invoice-totals .row-item.grand { font-weight: 800; font-size: 17px; border-top: 1px solid var(--border); margin-top: 6px; padding-top: 10px; }

.product-picker-result { padding: 9px 12px; border-bottom: 1px solid var(--border); cursor: pointer; font-size: 13px; }
.product-picker-result:hover { background: var(--navy-100); }

/* Printable invoice look */
.invoice-sheet {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  border-top: 4px solid var(--brass-500);
  padding: 32px;
  position: relative;
  animation: invoiceFadeIn 0.5s ease-out;
}
.invoice-sheet .inv-brand-mark { width: 46px; height: 46px; border-radius: 10px; background: linear-gradient(135deg, var(--brass-500), var(--brass-600)); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 20px; }

@keyframes invoiceFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes invoiceAccentGrow {
  from { width: 0; }
  to { width: 100%; }
}
.invoice-sheet::before {
  content: '';
  position: absolute;
  top: -1px; left: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--brass-500), var(--brass-600), var(--brass-500));
  border-radius: var(--radius) var(--radius) 0 0;
  animation: invoiceAccentGrow 0.6s ease-out;
}

/* Bordered, print-safe items table (grid lines survive "Save as PDF" in every browser) */
.invoice-items-table { width: 100%; border-collapse: collapse; margin-bottom: 4px; }
.invoice-items-table th, .invoice-items-table td {
  border: 1px solid #d7dbe8;
  padding: 8px 10px;
  font-size: 13px;
}
.invoice-items-table thead th {
  background: #f6f7fb;
  text-transform: uppercase;
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--ink-600);
  font-weight: 700;
}
.invoice-items-table tbody tr:nth-child(even) { background: #fbfbfd; }
.invoice-items-table tbody tr { transition: background-color 0.15s ease; }
.invoice-items-table tbody tr:hover { background-color: var(--brass-100); }
.invoice-items-table td.text-end, .invoice-items-table th.text-end { text-align: right; }

/* Developer credit footer */
.invoice-dev-credit {
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px dashed #d7dbe8;
  text-align: center;
  font-size: 11.5px;
  color: var(--ink-400);
}
.invoice-dev-credit .dev-name { font-weight: 700; color: var(--ink-600); }
.invoice-dev-credit .dev-links { margin-top: 6px; }
.invoice-dev-credit .dev-links a {
  color: var(--ink-600);
  text-decoration: none;
  margin: 0 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.15s ease;
}
.invoice-dev-credit .dev-links a:hover { color: var(--brass-600); }

@media print {
  .sidebar, .topbar, .no-print, .app-shell > .sidebar-overlay { display: none !important; }
  .main-content { margin-left: 0 !important; }
  .page-body { padding: 0 !important; }
  .invoice-sheet { border: 3px solid #000 !important; box-shadow: none; padding: 10mm; animation: none !important; }
  .invoice-sheet::before {
    animation: none !important;
    width: 100% !important;
    background: #000 !important; /* was still showing the brass/gold color in print — forced black as requested */
  }
  .invoice-items-table tbody tr:hover { background: inherit !important; }

  /* Without this, Chrome/Firefox drop background colors and some borders when printing/saving as PDF */
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; color-adjust: exact !important; }

  .invoice-items-table th, .invoice-items-table td { border: 1px solid #999 !important; }
  .invoice-items-table thead th { background: #eee !important; }

  /* Force a font that's explicitly downloaded (not just assumed to be installed on the
     device) and specifically built for complete Unicode coverage, including ₹ — this removes
     any dependency on font-loading timing or which fonts happen to exist on the printing
     device/browser. This is the belt-and-suspenders fix for the ₹ showing as "?" bug. */
  .invoice-sheet, .invoice-sheet * {
    font-family: 'Noto Sans', 'Inter', Arial, sans-serif !important;
  }
}

/* A4: standard full-width layout (default) */
@page { size: A4; margin: 12mm; }

/* Thermal receipt widths — condensed single-column layout for narrow paper */
.invoice-sheet.thermal-58, .invoice-sheet.thermal-80 {
  max-width: 100% !important;
  padding: 6mm !important;
  font-size: 11.5px;
}
.invoice-sheet.thermal-58 { width: 58mm; }
.invoice-sheet.thermal-80 { width: 80mm; }
.invoice-sheet.thermal-58 .invoice-items-table th,
.invoice-sheet.thermal-58 .invoice-items-table td,
.invoice-sheet.thermal-80 .invoice-items-table th,
.invoice-sheet.thermal-80 .invoice-items-table td {
  padding: 4px 5px;
  font-size: 10.5px;
}
.invoice-sheet.thermal-58 h4, .invoice-sheet.thermal-80 h4 { font-size: 16px; }
@media print {
  .invoice-sheet.thermal-58 { width: 58mm; }
  .invoice-sheet.thermal-80 { width: 80mm; }
}

/* ---------- Empty states ---------- */
.empty-state { text-align: center; padding: 48px 20px; color: var(--ink-400); }
.empty-state i { font-size: 34px; margin-bottom: 10px; color: var(--border); }

/* ---------- Live animated background ---------- */
/* Slow-moving color glow behind the app, tinted from the business's theme color. */
body.app-body {
  position: relative;
  z-index: 0; /* establishes a stacking context so the ::before layer below is reliably contained, not accidentally hidden behind other elements */
}
body.app-body::before {
  content: '';
  position: fixed;
  inset: -15%;
  z-index: -1;
  background:
    radial-gradient(circle at 15% 20%, var(--theme-glow-1) 0%, transparent 46%),
    radial-gradient(circle at 85% 75%, var(--theme-glow-2) 0%, transparent 52%),
    radial-gradient(circle at 50% 100%, var(--theme-glow-1) 0%, transparent 40%),
    var(--surface);
  background-size: 160% 160%;
  animation: liveBgFloat 18s ease-in-out infinite;
  pointer-events: none;
}
@keyframes liveBgFloat {
  0%, 100% { background-position: 0% 0%, 100% 100%, 50% 100%; }
  50% { background-position: 30% 40%, 70% 60%, 50% 70%; }
}
@media (prefers-reduced-motion: reduce) {
  body.app-body::before { animation: none; }
}

/* ---------- Theme toggle / fullscreen buttons ---------- */
#themeIcon, #fullscreenIcon { transition: transform 0.25s ease; }
#themeToggle:active #themeIcon, #fullscreenToggle:active #fullscreenIcon { transform: scale(0.85); }

/* ---------- Site-wide developer credit footer ---------- */
/* Lives inside the page content area (moved there by JS — see app.js), so it scrolls
   with the page and sizes itself to the content width automatically. */
.app-dev-footer {
  margin-top: 32px;
  border-top: 1px solid var(--border);
  padding: 18px 4px 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12.5px;
  color: var(--ink-400);
}
.app-dev-footer .dev-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}
.app-dev-footer .dev-brand .dev-avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brass-500), var(--brass-600));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0;
}
.app-dev-footer .dev-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.app-dev-footer .dev-links a {
  color: var(--ink-600);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  transition: color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.app-dev-footer .dev-links a:hover {
  color: #fff;
  background: var(--brass-500);
  border-color: var(--brass-500);
  transform: translateY(-1px);
}
@media (max-width: 575.98px) {
  .app-dev-footer { flex-direction: column; align-items: flex-start; }
}

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.show { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .sidebar-overlay.show { display: block; }
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #d3d8e6; border-radius: 8px; }

/* =========================================================
   Beck AI Business Assistant Widget Styles
   ========================================================= */
.beck-ai-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1050;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-radius: 50px;
  background: linear-gradient(135deg, #1b2544, #0f1729);
  border: 1.5px solid rgba(201, 146, 43, 0.4);
  color: #ffffff;
  box-shadow: 0 8px 30px rgba(15, 23, 41, 0.35), 0 0 15px rgba(201, 146, 43, 0.25);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.beck-ai-launcher:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 12px 35px rgba(15, 23, 41, 0.45), 0 0 25px rgba(201, 146, 43, 0.45);
  border-color: var(--brass-500);
}
.beck-ai-avatar-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e94560, #903749);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  box-shadow: 0 0 10px rgba(233, 69, 96, 0.5);
  position: relative;
}
.beck-status-pulse {
  position: absolute;
  top: -1px;
  right: -1px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #10b981;
  border: 1.5px solid #0f1729;
}
.beck-launcher-text {
  font-weight: 700;
  font-size: 13.5px;
  letter-spacing: 0.2px;
}
.beck-sparkle {
  color: #f59e0b;
  animation: beckSparklePulse 2s infinite ease-in-out;
}
@keyframes beckSparklePulse {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.25) rotate(15deg); opacity: 1; }
}

/* Chat Popup Window Card */
.beck-chat-card {
  position: fixed;
  bottom: 84px;
  right: 24px;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 520px;
  max-height: calc(100vh - 120px);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 15px 45px rgba(15, 23, 41, 0.25), 0 0 20px rgba(0,0,0,0.06);
  z-index: 1060;
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: beckSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.beck-chat-card.show {
  display: flex;
}
@keyframes beckSlideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.beck-chat-header {
  padding: 14px 16px;
  background: linear-gradient(135deg, #1b2544, #0f1729);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.beck-chat-header .beck-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}
.beck-header-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e94560, #903749);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #fff;
}
.beck-header-title {
  font-weight: 700;
  font-size: 14px;
  line-height: 1.2;
}
.beck-header-subtitle {
  font-size: 11px;
  color: #a0aec0;
}
.beck-chat-header-actions button {
  background: transparent;
  border: none;
  color: #cbd5e1;
  font-size: 14px;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color 0.15s;
}
.beck-chat-header-actions button:hover {
  color: #fff;
  background: rgba(255,255,255,0.1);
}

.beck-chat-body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--surface);
}

.beck-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.45;
  word-break: break-word;
}
.beck-msg p:last-child { margin-bottom: 0; }
.beck-msg-ai {
  align-self: flex-start;
  background: var(--card);
  color: var(--ink-900);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}
.beck-msg-user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--brass-500), var(--brass-600));
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

.beck-quick-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.beck-chip {
  font-size: 11.5px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 20px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--ink-900);
  cursor: pointer;
  transition: all 0.15s;
}
.beck-chip:hover {
  background: var(--brass-100);
  border-color: var(--brass-500);
  color: var(--brass-600);
}

.beck-typing-indicator {
  display: none;
  align-self: flex-start;
  padding: 8px 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  gap: 4px;
  align-items: center;
}
.beck-typing-indicator.show { display: flex; }
.beck-typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brass-500);
  animation: beckTyping 1.4s infinite ease-in-out both;
}
.beck-typing-dot:nth-child(1) { animation-delay: -0.32s; }
.beck-typing-dot:nth-child(2) { animation-delay: -0.16s; }
@keyframes beckTyping {
  0%, 80%, 100% { transform: scale(0); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

.beck-chat-footer {
  padding: 10px 14px;
  background: var(--card);
  border-top: 1px solid var(--border);
}
.beck-input-form {
  display: flex;
  gap: 8px;
  align-items: center;
}
.beck-chat-input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 8px 14px;
  font-size: 13.5px;
  background: var(--surface);
  color: var(--ink-900);
  outline: none;
  transition: border-color 0.15s;
}
.beck-chat-input:focus {
  border-color: var(--brass-500);
}
.beck-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--brass-500);
  border: none;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.beck-send-btn:hover {
  background: var(--brass-600);
  transform: scale(1.05);
}

