/* =====================================================================
   AxisOne professional layer: motion, collapsible sidebar, toasts,
   command palette, dashboard hero and charts, animated sign-in.
   Loaded after site.css.
   ===================================================================== */
:root {
    --ease-out: cubic-bezier(.16, 1, .3, 1);
    --shadow-md: 0 6px 18px -6px rgba(16,24,40,.12), 0 2px 4px rgba(16,24,40,.04);
    --shadow-lg: 0 24px 48px -12px rgba(16,24,40,.22);
    /* Chart roles: validated categorical slots 1–2 (light surface) */
    --chart-1: #2a78d6;
    --chart-2: #eb6834;
    --chart-grid: #eceef1;
    --chart-text: #52514e;
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes pulseRing { 0% { box-shadow: 0 0 0 0 rgba(220,38,38,.45); } 70% { box-shadow: 0 0 0 8px rgba(220,38,38,0); } 100% { box-shadow: 0 0 0 0 rgba(220,38,38,0); } }

/* Page content enters softly, children staggered */
.content > * { animation: fadeUp .5s var(--ease-out) both; }
.content > *:nth-child(2) { animation-delay: .05s; }
.content > *:nth-child(3) { animation-delay: .1s; }
.content > *:nth-child(4) { animation-delay: .15s; }
.content > *:nth-child(n+5) { animation-delay: .2s; }
.stagger > * { animation: fadeUp .5s var(--ease-out) both; }
.stagger > *:nth-child(1) { animation-delay: .04s; }
.stagger > *:nth-child(2) { animation-delay: .08s; }
.stagger > *:nth-child(3) { animation-delay: .12s; }
.stagger > *:nth-child(4) { animation-delay: .16s; }
.stagger > *:nth-child(5) { animation-delay: .2s; }
.stagger > *:nth-child(n+6) { animation-delay: .24s; }

/* Cards and buttons */
.card { transition: box-shadow .25s var(--ease-out), border-color .25s; }
.card:hover { box-shadow: var(--shadow-md); }
.kpi, .task { transition: transform .25s var(--ease-out), box-shadow .25s var(--ease-out), border-color .2s; }
a.kpi:hover, .task:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.btn { transition: transform .15s, box-shadow .2s, background-color .2s, border-color .2s, color .2s; }
.btn-primary:hover { box-shadow: 0 6px 16px -6px rgba(15,118,110,.55); }
.btn:active { transform: translateY(1px); }
.bell-count { animation: pulseRing 2s infinite; }
.kpi { position: relative; overflow: hidden; }
.kpi::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: linear-gradient(90deg, #14b8a6, #0f766e); transform: scaleX(0); transform-origin: left; transition: transform .4s var(--ease-out); }
a.kpi:hover::after { transform: scaleX(1); }

/* Navigation progress bar */
#navProgress { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 2000; background: linear-gradient(90deg, #14b8a6, #2dd4bf, #0f766e); box-shadow: 0 0 10px rgba(20,184,166,.6); opacity: 0; pointer-events: none; }
#navProgress.active { opacity: 1; width: 85%; transition: width 5s cubic-bezier(.1,.7,.2,1); }

/* Sidebar polish, user card and desktop collapse */
.sidebar { transition: width .3s var(--ease-out); background-image: radial-gradient(600px 300px at -10% -10%, rgba(20,184,166,.14), transparent 60%) !important; }
.nav-link-item { position: relative; white-space: nowrap; }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin: 0 10px 12px; border-radius: 12px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.07); }
.sidebar-user .avatar { background: linear-gradient(135deg, #14b8a6, #0f766e); flex-shrink: 0; }
.sidebar-user > div { min-width: 0; }
.sidebar-user-name { color: #fff; font-size: 12.5px; font-weight: 600; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { color: #8b9ab0; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 992px) {
    body.sidebar-collapsed .sidebar { width: 76px; }
    body.sidebar-collapsed .brand-link > span:last-child,
    body.sidebar-collapsed .nav-section,
    body.sidebar-collapsed .nav-link-item span,
    body.sidebar-collapsed .sidebar-foot,
    body.sidebar-collapsed .sidebar-user > div { display: none; }
    body.sidebar-collapsed .nav-link-item { justify-content: center; padding: 10px 0; }
    body.sidebar-collapsed .nav-link-item i { font-size: 17px; }
    body.sidebar-collapsed .sidebar-brand { justify-content: center; }
    body.sidebar-collapsed .sidebar-user { justify-content: center; padding: 8px 0; }
    body.sidebar-collapsed .sidebar { overflow: visible; }
    body.sidebar-collapsed .nav-link-item:hover::after {
        content: attr(data-label); position: absolute; left: 62px; top: 50%; transform: translateY(-50%); background: #0b1422; color: #fff;
        padding: 6px 10px; border-radius: 8px; font-size: 12px; box-shadow: var(--shadow-md); z-index: 1050; animation: fadeIn .15s; pointer-events: none;
    }
}

/* Top bar search trigger */
.search-trigger { display: flex; align-items: center; gap: 10px; min-width: 260px; height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--fh-line); background: #f7f9fb; color: var(--fh-muted); font-size: 13px; transition: border-color .2s, background .2s; }
.search-trigger:hover { border-color: #9ccfc9; background: #fff; }
.search-trigger kbd { margin-left: auto; font-family: inherit; font-size: 11px; background: #fff; color: var(--fh-muted); border: 1px solid var(--fh-line); border-radius: 6px; padding: 1px 6px; }

/* Command palette */
.cmdk .modal-content { border: 0; border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden; }
.cmdk-input { border: 0; border-bottom: 1px solid var(--fh-line); font-size: 16px; padding: 18px 20px 18px 52px; outline: 0; width: 100%; }
.cmdk-search-icon { position: absolute; left: 20px; top: 19px; font-size: 18px; color: var(--fh-muted); }
.cmdk-list { max-height: 380px; overflow-y: auto; padding: 8px; }
.cmdk-item { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; color: var(--fh-text); cursor: pointer; }
.cmdk-item i { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: #eef2f7; color: #33415a; }
.cmdk-item small { margin-left: auto; color: var(--fh-muted); font-size: 11px; text-transform: uppercase; letter-spacing: .4px; }
.cmdk-item.active { background: var(--fh-accent-soft); color: var(--fh-text); }
.cmdk-item.active i { background: var(--fh-accent); color: #fff; }
.cmdk-empty { padding: 26px; text-align: center; color: var(--fh-muted); font-size: 13px; }
.cmdk-foot { border-top: 1px solid var(--fh-line); padding: 8px 16px; font-size: 11.5px; color: var(--fh-muted); display: flex; gap: 14px; }
.cmdk-foot kbd { font-family: inherit; background: #f1f4f8; color: #33415a; border: 1px solid var(--fh-line); border-radius: 5px; padding: 0 5px; font-size: 11px; }

/* Toasts */
.toast-stack { position: fixed; top: 76px; right: 20px; z-index: 1090; display: flex; flex-direction: column; gap: 10px; width: min(420px, calc(100vw - 40px)); }
.fh-toast { position: relative; display: flex; gap: 12px; align-items: flex-start; background: #fff; border: 1px solid var(--fh-line); border-left: 4px solid #17733a; border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow-lg); animation: slideInRight .45s var(--ease-out); font-size: 13.5px; overflow: hidden; }
.fh-toast.error { border-left-color: #b42318; }
.fh-toast > i { font-size: 18px; color: #17733a; margin-top: 1px; }
.fh-toast.error > i { color: #b42318; }
.fh-toast-title { font-weight: 600; margin-bottom: 2px; }
.fh-toast .btn-close { margin-left: auto; font-size: 10px; flex-shrink: 0; }
.fh-toast.hide { opacity: 0; transform: translateX(28px); transition: all .35s var(--ease-out); }
.fh-toast-bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: rgba(23,115,58,.35); transform-origin: left; }
.fh-toast.error .fh-toast-bar { background: rgba(180,35,24,.35); }

/* Dashboard hero */
.hero { position: relative; overflow: hidden; border-radius: 18px; padding: 26px 28px; color: #e6eef7; background: linear-gradient(120deg, #0f1b2d 0%, #123a44 55%, #0f766e 100%); box-shadow: var(--shadow-md); }
.hero::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.08) 1px, transparent 1px); background-size: 18px 18px; -webkit-mask-image: linear-gradient(90deg, transparent, #000 60%); mask-image: linear-gradient(90deg, transparent, #000 60%); }
.hero-orb { position: absolute; border-radius: 50%; filter: blur(40px); opacity: .45; animation: floatOrb 14s ease-in-out infinite; pointer-events: none; }
.hero-orb.a { width: 260px; height: 260px; background: #14b8a6; right: -60px; top: -90px; }
.hero-orb.b { width: 200px; height: 200px; background: #2a78d6; right: 220px; bottom: -120px; animation-delay: -6s; }
@keyframes floatOrb { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(-30px, 20px) scale(1.1); } }
.hero > *:not(.hero-orb) { position: relative; }
.hero h2 { color: #fff; font-size: 24px; font-weight: 700; letter-spacing: -.4px; margin: 4px 0 6px; }
.hero-eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: #7dd3c8; font-weight: 600; }
.hero-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.14); font-size: 12px; color: #e6eef7; }
.hero-stat { text-align: right; }
.hero-stat .n { font-size: 44px; font-weight: 700; color: #fff; line-height: 1; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.hero-stat .l { font-size: 12.5px; color: #a9c4c0; }
.btn-hero { background: #fff; color: #0f1b2d; border: 0; font-weight: 600; }
.btn-hero:hover { background: #e6f4f2; color: #0f1b2d; }
.btn-hero-ghost { background: rgba(255,255,255,.08); color: #fff; border: 1px solid rgba(255,255,255,.22); }
.btn-hero-ghost:hover { background: rgba(255,255,255,.16); color: #fff; }

/* Chart cards */
.chart-card .card-header { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.chart-sub { display: block; font-size: 12px; color: var(--fh-muted); font-weight: 400; margin-top: 2px; }
.chart-box { position: relative; height: 260px; }
.chart-toggle { font-size: 12px; border: 1px solid var(--fh-line); background: #fff; border-radius: 8px; padding: 3px 9px; color: var(--fh-muted); }
.chart-toggle:hover { border-color: #9ccfc9; color: var(--fh-text); }
.chart-table { display: none; max-height: 260px; overflow: auto; }
.chart-card.show-table .chart-box { display: none; }
.chart-card.show-table .chart-table { display: block; }
.chart-legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--chart-text); }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--fh-muted); font-size: 13px; text-align: center; padding: 20px; }

/* Activity on the dashboard */
.activity { list-style: none; margin: 0; padding: 0; }
.activity li { display: flex; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px dashed var(--fh-line); font-size: 13px; }
.activity li:last-child { border-bottom: 0; }
.activity .dot { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; background: #eef2f7; color: #33415a; font-size: 14px; }
.activity .dot.add { background: #e7f6ec; color: #17733a; }
.activity .dot.mod { background: #fff4e0; color: #9a5b00; }

/* ===================== Animated sign-in ===================== */
.auth-side { position: relative; overflow: hidden; background: #0b1422 !important; }
.auth-bg { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.auth-blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; animation: blob 18s ease-in-out infinite; }
.auth-blob.b1 { width: 520px; height: 520px; background: #0f766e; left: -120px; top: -120px; }
.auth-blob.b2 { width: 420px; height: 420px; background: #1d4ed8; right: -140px; top: 30%; animation-delay: -6s; opacity: .35; }
.auth-blob.b3 { width: 380px; height: 380px; background: #14b8a6; left: 25%; bottom: -160px; animation-delay: -12s; opacity: .4; }
@keyframes blob { 0%, 100% { transform: translate(0, 0) scale(1); } 33% { transform: translate(60px, -40px) scale(1.12); } 66% { transform: translate(-40px, 50px) scale(.92); } }
.auth-grid { position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px); background-size: 44px 44px; -webkit-mask-image: radial-gradient(ellipse at 40% 40%, #000 30%, transparent 75%); mask-image: radial-gradient(ellipse at 40% 40%, #000 30%, transparent 75%); animation: gridMove 30s linear infinite; }
@keyframes gridMove { to { background-position: 44px 44px, 44px 44px; } }
.auth-side > *:not(.auth-bg) { position: relative; z-index: 1; }
.auth-side h2 { font-size: 34px; animation: fadeUp .8s var(--ease-out) .1s both; }
.auth-side .auth-lead { animation: fadeUp .8s var(--ease-out) .2s both; }
.auth-flow { animation: fadeUp .8s var(--ease-out) .28s both; }
.auth-flow span { transition: background .4s, border-color .4s, color .4s, transform .4s; }
.auth-flow span.lit { background: rgba(20,184,166,.28); border-color: rgba(94,234,212,.65); color: #fff; transform: translateY(-2px); }
.ledger-demo { margin-top: 28px; max-width: 480px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); border-radius: 16px; padding: 16px 18px; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); animation: fadeUp .8s var(--ease-out) .35s both; box-shadow: 0 30px 60px -20px rgba(0,0,0,.5); }
.ledger-demo-head { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: #9fb3c8; margin-bottom: 8px; }
.ledger-demo-head strong { color: #fff; font-size: 13px; }
.ledger-cols { display: grid; grid-template-columns: 1fr 100px 100px; gap: 8px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .6px; color: #7f93ab; padding-bottom: 4px; }
.ledger-cols span:not(:first-child), .ledger-row .amt { text-align: right; }
.ledger-row { display: grid; grid-template-columns: 1fr 100px 100px; gap: 8px; font-size: 12.5px; padding: 7px 0; border-top: 1px solid rgba(255,255,255,.07); opacity: 0; transform: translateX(-10px); transition: opacity .5s var(--ease-out), transform .5s var(--ease-out); font-variant-numeric: tabular-nums; color: #dbe5f0; }
.ledger-row.in { opacity: 1; transform: none; }
.ledger-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; min-height: 22px; }
.ledger-ok { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: #5eead4; opacity: 0; transition: opacity .5s; }
.ledger-ok.in { opacity: 1; }
.ledger-step { font-size: 11.5px; color: #9fb3c8; }
.auth-form { position: relative; background: radial-gradient(800px 400px at 100% 0%, #eaf6f4, #fff 60%) !important; }
.auth-card { animation: fadeUp .7s var(--ease-out) .15s both; background: #fff; padding: 36px 34px; border-radius: 20px; border: 1px solid var(--fh-line); box-shadow: var(--shadow-lg); max-width: 420px; }
.auth-card .brand-mark { width: 46px; height: 46px; font-size: 20px; color: #fff; margin-bottom: 18px; box-shadow: 0 10px 24px -8px rgba(15,118,110,.6); }
.input-icon { position: relative; }
.input-icon > i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--fh-muted); font-size: 16px; pointer-events: none; transition: color .2s; z-index: 2; }
.input-icon .form-control { padding-left: 42px; height: 48px; border-radius: 12px; }
.input-icon:focus-within > i { color: var(--fh-accent); }
.pw-toggle { position: absolute; right: 7px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--fh-muted); width: 34px; height: 34px; border-radius: 8px; z-index: 2; }
.pw-toggle:hover { background: #f1f4f8; color: var(--fh-text); }
.caps-warn { display: none; font-size: 12px; color: #9a5b00; margin-top: 6px; }
.caps-warn.on { display: block; animation: fadeIn .2s; }
.btn-signin { height: 50px; border-radius: 12px; font-weight: 600; position: relative; overflow: hidden; }
.btn-signin::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.28) 50%, transparent 70%); transform: translateX(-100%); transition: transform .7s; }
.btn-signin:hover::after { transform: translateX(100%); }
.auth-trust { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-top: 22px; font-size: 12px; color: var(--fh-muted); }
.auth-trust span { display: inline-flex; align-items: center; gap: 5px; }
.shake { animation: shake .45s; }
@keyframes shake { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); } 30%, 50%, 70% { transform: translateX(-6px); } 40%, 60% { transform: translateX(6px); } }
