/* =========================================================================
   Munimji design system — glass, gradients, motion. Light + dark themes.
   ========================================================================= */

:root {
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --brand-1: #6366f1;   /* indigo */
  --brand-2: #8b5cf6;   /* violet */
  --brand-3: #ec4899;   /* pink */
  --brand-4: #06b6d4;   /* cyan */
  --grad: linear-gradient(135deg, var(--brand-1), var(--brand-2) 55%, var(--brand-3));
  --grad-soft: linear-gradient(135deg, rgba(99,102,241,.12), rgba(236,72,153,.10));
  --g-green: linear-gradient(135deg, #10b981, #34d399);
  --g-blue: linear-gradient(135deg, #3b82f6, #06b6d4);
  --g-orange: linear-gradient(135deg, #f59e0b, #f97316);
  --g-violet: linear-gradient(135deg, #8b5cf6, #d946ef);
  --g-pink: linear-gradient(135deg, #ec4899, #f43f5e);

  --bg: #f4f5fb;
  --surface: rgba(255, 255, 255, .72);
  --surface-solid: #ffffff;
  --surface-2: rgba(255, 255, 255, .55);
  --border: rgba(15, 23, 42, .07);
  --text: #0f172a;
  --muted: #64748b;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.04), 0 2px 8px rgba(15,23,42,.04);
  --shadow: 0 4px 6px -2px rgba(15,23,42,.05), 0 12px 32px -8px rgba(15,23,42,.10);
  --shadow-lg: 0 24px 60px -18px rgba(79,70,229,.35);
  --radius: 18px;
  --radius-sm: 12px;
  --sidebar-w: 268px;
  --ease: cubic-bezier(.22, 1, .36, 1);

  --bs-body-font-family: var(--font);
  --bs-body-color: var(--text);
  --bs-body-bg: var(--bg);
  --bs-primary: #6366f1;
  --bs-primary-rgb: 99, 102, 241;
  --bs-link-color: #6366f1;
  --bs-link-color-rgb: 99, 102, 241;
  --bs-link-hover-color: #4f46e5;
  --bs-border-color: var(--border);
}

[data-bs-theme="dark"] {
  --bg: #0b1020;
  --surface: rgba(22, 28, 48, .72);
  --surface-solid: #151b2e;
  --surface-2: rgba(30, 38, 64, .6);
  --border: rgba(148, 163, 184, .12);
  --text: #e2e8f0;
  --muted: #94a3b8;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
  --shadow: 0 12px 32px -10px rgba(0,0,0,.55);
  --bs-body-color: var(--text);
  --bs-body-bg: var(--bg);
  --bs-link-color: #a5b4fc;
  --bs-link-color-rgb: 165, 180, 252;
  --bs-border-color: var(--border);
  --bs-secondary-color: var(--muted);
}

* { scrollbar-width: thin; scrollbar-color: rgba(99,102,241,.35) transparent; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  transition: background-color .4s var(--ease), color .4s var(--ease);
}
a { text-decoration: none; }
.text-muted, .form-text { color: var(--muted) !important; }
::selection { background: rgba(139, 92, 246, .25); }

/* ---------- animated aurora background ---------- */
.aurora { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.aurora span {
  position: absolute; border-radius: 50%; filter: blur(80px); opacity: .55;
  animation: drift 22s var(--ease) infinite alternate;
}
.aurora span:nth-child(1) { width: 520px; height: 520px; background: #c7d2fe; top: -160px; left: 10%; }
.aurora span:nth-child(2) { width: 460px; height: 460px; background: #fbcfe8; top: 30%; right: -120px; animation-duration: 26s; }
.aurora span:nth-child(3) { width: 420px; height: 420px; background: #a5f3fc; bottom: -160px; left: 35%; animation-duration: 30s; }
[data-bs-theme="dark"] .aurora span { opacity: .22; }
[data-bs-theme="dark"] .aurora span:nth-child(1) { background: #4f46e5; }
[data-bs-theme="dark"] .aurora span:nth-child(2) { background: #be185d; }
[data-bs-theme="dark"] .aurora span:nth-child(3) { background: #0e7490; }
@keyframes drift {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(60px, 40px) scale(1.12); }
  100% { transform: translate(-40px, 80px) scale(.95); }
}

/* ---------- shell: sidebar + topbar ---------- */
.app-sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 1040;
  display: flex; flex-direction: column; padding: 18px 14px;
  background: var(--surface); backdrop-filter: blur(22px) saturate(160%); -webkit-backdrop-filter: blur(22px) saturate(160%);
  border-right: 1px solid var(--border);
  transition: transform .45s var(--ease);
}
.app-brand { display: flex; align-items: center; gap: 12px; padding: 6px 10px 18px; color: var(--text); }
.app-brand .logo {
  width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; color: #fff; font-size: 1.25rem;
  background: var(--grad); box-shadow: var(--shadow-lg); overflow: hidden; flex-shrink: 0;
  animation: logoGlow 6s ease-in-out infinite;
}
.app-brand .logo img { width: 100%; height: 100%; object-fit: cover; background: #fff; }
@keyframes logoGlow { 50% { box-shadow: 0 10px 40px -8px rgba(236,72,153,.55); } }
.app-brand .name { font-weight: 800; font-size: 1.02rem; line-height: 1.1; letter-spacing: -.01em; }
.app-brand .sub { font-size: .72rem; color: var(--muted); }

.side-cta {
  display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0 4px 16px; padding: 11px;
  border-radius: 14px; color: #fff !important; font-weight: 700; background: var(--grad); background-size: 200% 200%;
  box-shadow: var(--shadow-lg); animation: gradShift 8s ease infinite; transition: transform .25s var(--ease);
}
.side-cta:hover { transform: translateY(-2px) scale(1.01); }
.side-cta kbd { background: rgba(255,255,255,.22); font-size: .65rem; padding: 2px 6px; border-radius: 6px; }
@keyframes gradShift { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }

.side-nav { flex: 1; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.side-label { font-size: .66rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 14px 12px 6px; }
.side-link {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 9px 12px; margin: 2px 0;
  border-radius: 12px; color: var(--muted); font-weight: 600; font-size: .9rem;
  transition: background .25s var(--ease), color .25s var(--ease), transform .25s var(--ease);
}
.side-link i { font-size: 1.05rem; width: 22px; text-align: center; transition: transform .3s var(--ease); }
.side-link:hover { color: var(--text); background: var(--surface-2); transform: translateX(3px); }
.side-link:hover i { transform: scale(1.15) rotate(-6deg); }
.side-link.active { color: var(--brand-1); background: var(--grad-soft); }
[data-bs-theme="dark"] .side-link.active { color: #c7d2fe; }
.side-link.active::before {
  content: ''; position: absolute; left: -4px; top: 20%; bottom: 20%; width: 4px; border-radius: 4px; background: var(--grad);
}
.side-link .badge { margin-left: auto; }

.side-user {
  display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; margin-top: 10px;
  background: var(--surface-2); border: 1px solid var(--border);
}
.avatar {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff;
  background: var(--g-violet); flex-shrink: 0; font-size: .9rem;
}
.side-user .who { line-height: 1.15; min-width: 0; }
.side-user .who b { display: block; font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user .who small { color: var(--muted); font-size: .72rem; }

.app-main { margin-left: var(--sidebar-w); min-height: 100vh; transition: margin .45s var(--ease); }
.app-topbar {
  position: sticky; top: 0; z-index: 1030; display: flex; align-items: center; gap: 12px; padding: 14px 28px;
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent; transition: border-color .3s, box-shadow .3s;
}
.app-topbar.scrolled { border-bottom-color: var(--border); box-shadow: var(--shadow-sm); }
.crumb { font-weight: 700; font-size: .95rem; }
.crumb small { display: block; color: var(--muted); font-weight: 500; font-size: .75rem; }
.top-search {
  display: flex; align-items: center; gap: 10px; min-width: 260px; padding: 9px 14px; border-radius: 12px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); color: var(--muted); font-size: .88rem;
  transition: border-color .25s, box-shadow .25s;
}
.top-search:hover { border-color: rgba(99,102,241,.45); box-shadow: 0 0 0 4px rgba(99,102,241,.08); }
.top-search kbd { margin-left: auto; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); font-size: .7rem; }
.icon-btn {
  position: relative; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 1.1rem;
  background: var(--surface); border: 1px solid var(--border); color: var(--text); transition: all .25s var(--ease);
}
.icon-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); color: var(--brand-1); }
.icon-btn .dot {
  position: absolute; top: -4px; right: -4px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px;
  background: var(--g-pink); color: #fff; font-size: .66rem; font-weight: 800; display: grid; place-items: center;
  box-shadow: 0 0 0 3px var(--bg); animation: pop .5s var(--ease);
}
.icon-btn .ring { animation: ring 2.4s ease-in-out infinite; transform-origin: top center; }
@keyframes ring { 0%, 70%, 100% { transform: rotate(0); } 75% { transform: rotate(14deg); } 82% { transform: rotate(-12deg); } 89% { transform: rotate(8deg); } }
@keyframes pop { from { transform: scale(0); } to { transform: scale(1); } }
.theme-toggle i { transition: transform .6s var(--ease); }
.theme-toggle:hover i { transform: rotate(180deg); }
.content-wrap { padding: 8px 28px 48px; }

.sidebar-backdrop { display: none; }
@media (max-width: 991.98px) {
  .app-sidebar { transform: translateX(-105%); box-shadow: var(--shadow); background: var(--surface-solid); }
  body.sidebar-open .app-sidebar { transform: none; }
  body.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 1035; background: rgba(15,23,42,.4); backdrop-filter: blur(3px); animation: fadeIn .3s; }
  .app-main { margin-left: 0; }
  .app-topbar { padding: 12px 14px; }
  .content-wrap { padding: 6px 14px 90px; }
  .top-search { min-width: 0; flex: 1; }
  .top-search span, .top-search kbd { display: none; }
}

/* ---------- page header ---------- */
.content-wrap h4 { font-weight: 800; letter-spacing: -.025em; font-size: 1.55rem; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.content-wrap h4 > i.bi:first-child {
  width: 44px; height: 44px; border-radius: 14px; display: inline-grid; place-items: center; font-size: 1.2rem; color: #fff;
  background: var(--grad); box-shadow: var(--shadow-lg);
}
.content-wrap h4 small { font-weight: 600; }

/* ---------- cards ---------- */
.card {
  --bs-card-bg: var(--surface); --bs-card-border-color: var(--border); --bs-card-cap-bg: transparent;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius) !important;
  box-shadow: var(--shadow-sm); backdrop-filter: blur(18px) saturate(150%); -webkit-backdrop-filter: blur(18px) saturate(150%);
  transition: transform .4s var(--ease), box-shadow .4s var(--ease), border-color .4s;
}
.card:hover { box-shadow: var(--shadow); }
.card-header { background: transparent; border-bottom: 1px solid var(--border); padding: 14px 18px; font-weight: 700; border-radius: var(--radius) var(--radius) 0 0 !important; }
.card-body { padding: 18px; }
.list-group { --bs-list-group-bg: transparent; --bs-list-group-border-color: var(--border); --bs-list-group-action-hover-bg: var(--surface-2); --bs-list-group-color: var(--text); }

.section-icon {
  width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px;
  background: var(--grad-soft); color: var(--brand-1); font-size: 1.15rem;
}
.section-title { font-weight: 700; margin: 0; line-height: 1.15; }
.section-sub { font-size: .8rem; color: var(--muted); }
.label-caps { font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* ---------- stat cards ---------- */
.stat-card { position: relative; overflow: hidden; padding: 20px !important; }
.stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.stat-card::after {
  content: ''; position: absolute; width: 140px; height: 140px; border-radius: 50%; right: -50px; top: -60px;
  background: var(--accent, var(--grad)); opacity: .12; transition: transform .6s var(--ease);
}
.stat-card:hover::after { transform: scale(1.35); }
.stat-card.accent-1 { --accent: var(--g-green); }
.stat-card.accent-2 { --accent: var(--g-blue); }
.stat-card.accent-3 { --accent: var(--g-orange); }
.stat-card.accent-4 { --accent: var(--g-violet); }
.stat-card .stat-icon {
  width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; color: #fff; font-size: 1.25rem;
  background: var(--accent, var(--grad)); margin-bottom: 14px; box-shadow: 0 10px 24px -10px rgba(15,23,42,.45);
}
.stat-card .value { font-size: 1.75rem; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; position: relative; z-index: 1; }
.stat-card .label { color: var(--muted); font-size: .85rem; font-weight: 600; position: relative; z-index: 1; }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden; border-radius: 24px; padding: 28px 30px; color: #fff; margin-bottom: 22px;
  background: var(--grad); background-size: 200% 200%; animation: gradShift 14s ease infinite; box-shadow: var(--shadow-lg);
}
.hero::before, .hero::after { content: ''; position: absolute; border-radius: 50%; background: rgba(255,255,255,.12); }
.hero::before { width: 300px; height: 300px; right: -80px; top: -140px; animation: float 9s ease-in-out infinite; }
.hero::after { width: 180px; height: 180px; right: 160px; bottom: -110px; animation: float 11s ease-in-out infinite reverse; }
.hero h2 { font-weight: 800; letter-spacing: -.03em; margin: 0; }
.hero p { opacity: .85; margin: 4px 0 0; }
.hero .hero-chip { display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.18); padding: 5px 12px; border-radius: 30px; font-size: .78rem; font-weight: 600; backdrop-filter: blur(6px); }
.hero .form-control { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.3); color: #fff; }
.hero .form-control::-webkit-calendar-picker-indicator { filter: invert(1); }
@keyframes float { 50% { transform: translateY(18px) scale(1.05); } }
.wave { display: inline-block; animation: wave 2.4s ease-in-out infinite; transform-origin: 70% 70%; }
@keyframes wave { 0%, 60%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(14deg); } 20% { transform: rotate(-8deg); } 40% { transform: rotate(-4deg); } 50% { transform: rotate(10deg); } }

/* ---------- quick actions ---------- */
.quick-action {
  position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 20px 10px;
  border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); color: var(--text); font-weight: 700; font-size: .88rem;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s;
}
.quick-action i {
  width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-size: 1.4rem; color: #fff;
  background: var(--qa, var(--grad)); transition: transform .45s var(--ease); box-shadow: 0 12px 24px -12px rgba(15,23,42,.5);
}
.quick-action:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: rgba(99,102,241,.35); color: var(--text); }
.quick-action:hover i { transform: scale(1.1) rotate(-8deg); }
.qa-1 { --qa: var(--grad); } .qa-2 { --qa: var(--g-blue); } .qa-3 { --qa: var(--g-green); } .qa-4 { --qa: var(--g-orange); }

/* ---------- progress / meters ---------- */
.meter { height: 8px; border-radius: 8px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--border); }
.meter > span { display: block; height: 100%; width: 0; border-radius: 8px; background: var(--grad); transition: width 1.4s var(--ease); }
.donut {
  --p1: 0; --p2: 0; width: 132px; height: 132px; border-radius: 50%; flex-shrink: 0; position: relative;
  background: conic-gradient(#10b981 0 calc(var(--p1) * 1%), #6366f1 0 calc(var(--p2) * 1%), #06b6d4 0 100%);
  animation: spinIn 1.2s var(--ease);
}
.donut::after { content: ''; position: absolute; inset: 18px; border-radius: 50%; background: var(--surface-solid); }
.donut .center { position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; text-align: center; font-weight: 800; font-size: .95rem; line-height: 1.1; }
.donut .center small { display: block; color: var(--muted); font-weight: 600; font-size: .68rem; }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 8px; }
@keyframes spinIn { from { transform: rotate(-90deg) scale(.7); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- buttons ---------- */
.btn { border-radius: 12px; font-weight: 600; transition: transform .2s var(--ease), box-shadow .25s var(--ease), background .25s; position: relative; overflow: hidden; }
.btn:active { transform: scale(.97); }
.btn-primary { --bs-btn-bg: #6366f1; --bs-btn-border-color: transparent; --bs-btn-hover-border-color: transparent; background: var(--grad); background-size: 160% 160%; border: 0; box-shadow: 0 8px 20px -8px rgba(99,102,241,.7); }
.btn-primary:hover, .btn-primary:focus { background: var(--grad); background-position: 100% 50%; box-shadow: 0 12px 28px -8px rgba(139,92,246,.75); transform: translateY(-1px); }
.btn-success { background: var(--g-green); border: 0; box-shadow: 0 8px 20px -8px rgba(16,185,129,.7); }
.btn-success:hover { background: var(--g-green); filter: brightness(1.05); transform: translateY(-1px); }
.btn-warning { background: var(--g-orange); border: 0; color: #fff !important; }
.btn-outline-primary { --bs-btn-color: #6366f1; --bs-btn-border-color: rgba(99,102,241,.45); --bs-btn-hover-bg: #6366f1; --bs-btn-hover-border-color: #6366f1; --bs-btn-active-bg: #6366f1; }
[data-bs-theme="dark"] .btn-outline-primary { --bs-btn-color: #a5b4fc; }
.btn-outline-secondary { --bs-btn-color: var(--text); --bs-btn-border-color: var(--border); --bs-btn-hover-bg: var(--surface-2); --bs-btn-hover-color: var(--text); --bs-btn-hover-border-color: var(--border); background: var(--surface); }
.ripple { position: absolute; border-radius: 50%; transform: scale(0); background: rgba(255,255,255,.45); animation: ripple .65s linear; pointer-events: none; }
@keyframes ripple { to { transform: scale(4); opacity: 0; } }

/* ---------- forms ---------- */
.form-control, .form-select {
  border-radius: 12px; border-color: var(--border); background-color: var(--surface-solid); color: var(--text);
  transition: border-color .2s, box-shadow .25s var(--ease);
}
.form-control:focus, .form-select:focus { border-color: #818cf8; box-shadow: 0 0 0 4px rgba(99,102,241,.15); background-color: var(--surface-solid); color: var(--text); }
.form-control-lg { border-radius: 14px; }
.input-group-text { border-radius: 12px; background: var(--surface-2); border-color: var(--border); color: var(--muted); }
.form-check-input:checked { background-color: #6366f1; border-color: #6366f1; }
.form-label { color: var(--muted); }

/* ---------- tables ---------- */
.table { --bs-table-bg: transparent; --bs-table-color: var(--text); --bs-table-border-color: var(--border); --bs-table-hover-bg: rgba(99,102,241,.05); margin-bottom: 0; }
.table thead th { font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; white-space: nowrap; padding-top: 12px; padding-bottom: 12px; background: transparent; }
.table td { padding-top: .8rem; padding-bottom: .8rem; }
.table tbody tr { transition: background .2s, transform .2s; }
.table-hover tbody tr:hover { --bs-table-bg-state: rgba(99,102,241,.06); }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.card > .table-responsive:first-child, .card > .table:first-child { border-radius: var(--radius) var(--radius) 0 0; }

/* ---------- status pills ---------- */
.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: .3rem .7rem; border-radius: 999px; font-size: .72rem; font-weight: 700; white-space: nowrap; }
.status-pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-pending, .status-open { background: rgba(245,158,11,.14); color: #b45309; }
.status-pending::before, .status-open::before { animation: blink 1.6s ease-in-out infinite; }
.status-partial { background: rgba(59,130,246,.14); color: #1d4ed8; }
.status-billed, .status-approved { background: rgba(16,185,129,.14); color: #047857; }
.status-rejected, .status-cancelled { background: rgba(244,63,94,.14); color: #be123c; }
[data-bs-theme="dark"] .status-pending, [data-bs-theme="dark"] .status-open { color: #fcd34d; }
[data-bs-theme="dark"] .status-partial { color: #93c5fd; }
[data-bs-theme="dark"] .status-billed, [data-bs-theme="dark"] .status-approved { color: #6ee7b7; }
[data-bs-theme="dark"] .status-rejected, [data-bs-theme="dark"] .status-cancelled { color: #fda4af; }
@keyframes blink { 50% { opacity: .3; } }
.badge { border-radius: 8px; font-weight: 700; }

/* ---------- toasts ---------- */
.toast-stack { position: fixed; top: 18px; right: 18px; z-index: 2100; display: flex; flex-direction: column; gap: 10px; max-width: 380px; }
.m-toast {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 16px; color: var(--text);
  background: var(--surface-solid); border: 1px solid var(--border); box-shadow: var(--shadow);
  animation: toastIn .55s var(--ease) both; position: relative; overflow: hidden;
}
.m-toast i { font-size: 1.25rem; }
.m-toast.success i { color: #10b981; } .m-toast.danger i { color: #f43f5e; } .m-toast.warning i { color: #f59e0b; } .m-toast.info i { color: #6366f1; }
.m-toast .bar { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--grad); animation: shrink 5s linear forwards; }
.m-toast.hide { animation: toastOut .45s var(--ease) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(40px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(40px); } }
@keyframes shrink { from { width: 100%; } to { width: 0; } }

/* ---------- reveal motion ---------- */
.reveal { opacity: 0; transform: translateY(16px) scale(.99); }
.reveal.in { opacity: 1; transform: none; transition: opacity .55s var(--ease), transform .6s var(--ease); transition-delay: var(--d, 0ms); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } .reveal { opacity: 1; transform: none; } }

/* top page-load progress */
#nprogress { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 3000; background: var(--grad); box-shadow: 0 0 12px rgba(139,92,246,.7); transition: width .4s var(--ease), opacity .4s; }

/* ---------- command palette ---------- */
.cmdk-backdrop { position: fixed; inset: 0; z-index: 2500; background: rgba(15,23,42,.45); backdrop-filter: blur(6px); display: none; align-items: flex-start; justify-content: center; padding-top: 12vh; }
.cmdk-backdrop.open { display: flex; animation: fadeIn .2s; }
.cmdk { width: min(620px, 92vw); border-radius: 20px; background: var(--surface-solid); border: 1px solid var(--border); box-shadow: 0 40px 80px -20px rgba(0,0,0,.45); overflow: hidden; animation: cmdIn .35s var(--ease); }
@keyframes cmdIn { from { opacity: 0; transform: translateY(-12px) scale(.97); } to { opacity: 1; transform: none; } }
.cmdk input { width: 100%; border: 0; outline: 0; padding: 18px 20px 18px 52px; font-size: 1.05rem; background: transparent; color: var(--text); }
.cmdk .search-wrap { position: relative; border-bottom: 1px solid var(--border); }
.cmdk .search-wrap i { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 1.1rem; }
.cmdk-list { max-height: 52vh; overflow-y: auto; padding: 8px; }
.cmdk-group { font-size: .66rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 10px 12px 4px; }
.cmdk-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--text); cursor: pointer; }
.cmdk-item i { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--grad-soft); color: var(--brand-1); }
.cmdk-item small { color: var(--muted); margin-left: auto; }
.cmdk-item.active { background: var(--grad-soft); }
.cmdk-foot { display: flex; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--border); color: var(--muted); font-size: .75rem; }

/* ---------- typeahead ---------- */
.typeahead { position: relative; }
.typeahead-menu {
  position: absolute; z-index: 1050; top: calc(100% + 6px); left: 0; right: 0; max-height: 320px; overflow: auto; padding: 6px;
  background: var(--surface-solid); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow);
  animation: cmdIn .25s var(--ease);
}
.typeahead-menu .ta-item { padding: .6rem .8rem; cursor: pointer; border-radius: 10px; }
.typeahead-menu .ta-item:hover, .typeahead-menu .ta-item.active { background: var(--grad-soft); }
.typeahead-menu .ta-item small { color: var(--muted); }

/* ---------- POS ---------- */
.pos-total {
  font-size: 2.6rem; font-weight: 800; letter-spacing: -.04em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  font-variant-numeric: tabular-nums;
}
.pos-total.bump { animation: bump .45s var(--ease); }
@keyframes bump { 40% { transform: scale(1.08); } }
.pos-table input { min-width: 70px; }
.pos-table tbody tr:not(.empty) { animation: rowIn .45s var(--ease); }
@keyframes rowIn { from { opacity: 0; transform: translateX(-14px); background: rgba(99,102,241,.12); } to { opacity: 1; transform: none; } }
.mode-btn { border-radius: 14px !important; flex-direction: column; display: flex !important; align-items: center; gap: 2px; padding: 10px 4px; font-size: .82rem; }
.mode-btn i { font-size: 1.2rem; }
#modes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.mode-btn.active { color: #fff !important; transform: translateY(-2px); box-shadow: var(--shadow); }
.mic-on { animation: pulse 1s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(244,63,94,.6); } 100% { box-shadow: 0 0 0 16px rgba(244,63,94,0); } }
.success-burst { font-size: 3.4rem; color: #10b981; animation: burst .6s var(--ease); display: inline-block; }
@keyframes burst { 0% { transform: scale(0) rotate(-45deg); } 70% { transform: scale(1.2) rotate(8deg); } 100% { transform: scale(1); } }
.modal-content { border-radius: 24px; border: 1px solid var(--border); background: var(--surface-solid); box-shadow: 0 40px 80px -20px rgba(0,0,0,.4); }
.confetti { position: fixed; top: -12px; width: 9px; height: 14px; z-index: 3000; border-radius: 2px; pointer-events: none; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(105vh) rotate(720deg); opacity: .7; } }

/* ---------- misc ---------- */
.offline-banner { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 2000; background: var(--g-pink); color: #fff; padding: .6rem 1.2rem; border-radius: 40px; font-size: .88rem; font-weight: 600; box-shadow: var(--shadow); animation: toastIn .5s var(--ease); }
.trend-bar { background: var(--grad); border-radius: 10px 10px 4px 4px; min-height: 4px; height: 0; transition: height 1.2s var(--ease); box-shadow: 0 10px 20px -10px rgba(99,102,241,.8); }
.trend-bar:hover { filter: brightness(1.12); }
.notif-unread { background: var(--grad-soft) !important; }
.alert { border-radius: 14px; border: 0; }
.alert-warning { background: rgba(245,158,11,.12); color: #92400e; }
.alert-danger { background: rgba(244,63,94,.12); color: #9f1239; }
.alert-success { background: rgba(16,185,129,.12); color: #065f46; }
.alert-light { background: var(--surface); color: var(--text); }
[data-bs-theme="dark"] .alert-warning { color: #fcd34d; } [data-bs-theme="dark"] .alert-danger { color: #fda4af; } [data-bs-theme="dark"] .alert-success { color: #6ee7b7; }
.pagination { --bs-pagination-border-radius: 10px; --bs-pagination-bg: var(--surface); --bs-pagination-border-color: var(--border); --bs-pagination-color: var(--text); --bs-pagination-disabled-bg: var(--surface); --bs-pagination-disabled-color: var(--muted); gap: 6px; }
.dropdown-menu { border-radius: 14px; border: 1px solid var(--border); box-shadow: var(--shadow); padding: 6px; background: var(--surface-solid); animation: cmdIn .2s var(--ease); }
.dropdown-item { border-radius: 10px; padding: .5rem .75rem; }
.mobile-fab { display: none; }
@media (max-width: 991.98px) {
  .mobile-fab {
    display: grid; place-items: center; position: fixed; right: 18px; bottom: 22px; z-index: 1020; width: 60px; height: 60px; border-radius: 20px;
    color: #fff; font-size: 1.6rem; background: var(--grad); box-shadow: var(--shadow-lg); animation: pop .6s var(--ease);
  }
  .pos-total { font-size: 2rem; }
  .stat-card .value { font-size: 1.3rem; }
  .hero { padding: 22px; }
}

/* ---------- login ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-art { position: relative; overflow: hidden; color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; background: var(--grad); background-size: 220% 220%; animation: gradShift 16s ease infinite; }
.auth-art .orb { position: absolute; border-radius: 50%; background: rgba(255,255,255,.14); backdrop-filter: blur(2px); }
.auth-art .orb.o1 { width: 380px; height: 380px; right: -120px; top: -120px; animation: float 10s ease-in-out infinite; }
.auth-art .orb.o2 { width: 220px; height: 220px; left: -60px; bottom: 80px; animation: float 13s ease-in-out infinite reverse; }
.auth-art .orb.o3 { width: 120px; height: 120px; right: 25%; bottom: -40px; animation: float 8s ease-in-out infinite; }
.auth-art h1 { font-weight: 800; font-size: clamp(2rem, 3.6vw, 3.2rem); letter-spacing: -.04em; line-height: 1.05; }
.auth-feature { display: flex; gap: 12px; align-items: center; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22); padding: 12px 16px; border-radius: 16px; backdrop-filter: blur(10px); margin-bottom: 10px; width: fit-content; animation: toastIn .8s var(--ease) both; }
.auth-feature i { font-size: 1.2rem; }
.auth-form { display: grid; place-items: center; padding: 32px; }
.auth-card { width: min(420px, 100%); }
.auth-card .form-control { padding: .8rem 1rem; }
@media (max-width: 860px) { .auth-wrap { grid-template-columns: 1fr; } .auth-art { display: none; } }
