:root {
    --brand-primary: #0B32D9;
    --brand-primary-dark: #071e88;
    --brand-secondary: #1F4FFF;
    --brand-gold: #F5C21A;
    --brand-gold-light: #FFD54A;
    --brand-red: #E30613;
    --ink: #101638;
    --muted: #6b7280;
    --bg: #f4f6fb;
    --card: #ffffff;
    --border: #e5e9f2;
}

html, body { height: 100%; }
body {
    font-family: 'Plus Jakarta Sans', 'Inter', 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--ink);
    margin: 0;
    font-size: 14.5px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4, h5, h6, .brand-title { font-family: 'Plus Jakarta Sans', 'Inter', 'Segoe UI', sans-serif; font-weight: 700; letter-spacing: -.01em; color: var(--ink); }
h1 { font-size: 2rem; } h2 { font-size: 1.55rem; } h3 { font-size: 1.3rem; } h4 { font-size: 1.1rem; } h5 { font-size: 1rem; }
.small, small { font-size: 12.5px; }
.text-muted { color: var(--muted) !important; }
label.form-label, .form-label { font-weight: 600; font-size: 13px; color: #2b3559; }
.table thead th { font-size: 11.5px; letter-spacing: .5px; text-transform: uppercase; color: #4b5570; font-weight: 700; }
.btn { font-weight: 600; letter-spacing: .1px; }

/* ============ App Shell ============ */
.app-body { min-height: 100vh; overflow-x: hidden; }
.app-sidebar {
    width: 275px;
    background: linear-gradient(180deg, var(--brand-primary) 0%, var(--brand-primary-dark) 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    padding: 22px 14px 0;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1000;
    flex-shrink: 0;
}
.app-sidebar .brand { display: flex; gap: 12px; align-items: center; margin-bottom: 18px; padding: 4px 6px; flex: 0 0 auto; }
.brand-badge {
    width: 44px; height: 44px; border-radius: 12px;
    background: linear-gradient(135deg, var(--brand-gold), var(--brand-gold-light));
    color: var(--brand-primary-dark);
    display: grid; place-items: center; font-size: 22px; font-weight: 700;
    box-shadow: 0 4px 12px rgba(0,0,0,.25);
}
.brand-title { font-weight: 700; letter-spacing: .2px; font-size: 15px; line-height: 1.15; }
.brand-sub { font-size: 11.5px; opacity: .75; }

.side-nav {
    display: flex; flex-direction: column; gap: 2px; margin-top: 2px;
    flex: 1 1 auto; overflow-y: auto; overflow-x: hidden;
    padding-right: 4px; padding-bottom: 10px;
    scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.35) transparent;
}
.side-nav::-webkit-scrollbar { width: 6px; }
.side-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.25); border-radius: 6px; }
.side-nav::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.45); }
.side-nav a {
    color: rgba(255,255,255,.88);
    text-decoration: none;
    padding: 9px 12px;
    border-radius: 10px;
    display: flex; align-items: center; gap: 10px;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: .1px;
    transition: background .15s, transform .15s, color .15s;
    white-space: nowrap;
}
.side-nav a span { width: 22px; text-align: center; font-size: 16px; }
.side-nav a:hover { background: rgba(255,255,255,.10); color: #fff; transform: translateX(2px); }
.side-nav a.active { background: rgba(255,213,74,.20); border-left: 3px solid var(--brand-gold); color: #fff; font-weight: 600; }
.side-heading { color: rgba(255,255,255,.55); font-size: 10.5px; letter-spacing: 1.6px; text-transform: uppercase; margin: 14px 12px 6px; font-weight: 600; }
.side-footer { color: rgba(255,255,255,.65); flex: 0 0 auto; padding: 10px 6px; border-top: 1px solid rgba(255,255,255,.12); background: rgba(0,0,0,.10); font-size: 12px; }

/* Bulletproof sticky-footer via CSS grid: topbar | content | footer.
   The 1fr row absorbs any leftover vertical space so the footer always
   sits flush at the bottom of .app-main (no white area after it). */
.app-main { 
    display: grid;
    grid-template-rows: auto 1fr auto;
    min-width: 0;
    min-height: 100vh;
    margin-left: 275px;
}
.app-topbar {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 12px 24px;
    display: flex; justify-content: space-between; align-items: center;
    position: sticky; top: 0; z-index: 20;
}
.topbar-title { font-weight: 600; font-size: 18px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.chip {
    background: linear-gradient(135deg, var(--brand-secondary), var(--brand-primary));
    color: #fff; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
}
.app-content { padding: 24px; }
.page-header { margin-bottom: 18px; }
.page-header h2 { font-weight: 700; margin-bottom: 4px; }

.app-footer {
    padding: 18px 24px;
    background: #ffffff;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 12.5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.app-footer-sub { opacity: .9; }
.app-footer-link { color: var(--brand-primary); text-decoration: none; font-weight: 600; }
.app-footer-link:hover { text-decoration: underline; }
@media (max-width: 575.98px) {
    .app-footer { padding: 12px 14px; font-size: 12px; text-align: center; justify-content: center; }
}

/* ============ Buttons ============ */
.btn-brand {
    background: linear-gradient(135deg, var(--brand-secondary), var(--brand-primary));
    border: none; color: #fff; font-weight: 600;
    box-shadow: 0 4px 12px rgba(11,50,217,.25);
}
.btn-brand:hover { color: #fff; filter: brightness(1.05); box-shadow: 0 6px 16px rgba(11,50,217,.35); }
.btn-outline-brand { border: 1.5px solid var(--brand-primary); color: var(--brand-primary); background: #fff; font-weight: 600; }
.btn-outline-brand:hover { background: var(--brand-primary); color: #fff; }

/* ============ Cards ============ */
.premium-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 4px 20px rgba(16,22,56,.05);
    overflow: hidden;
}
.premium-card .card-header {
    background: #fbfcff; border-bottom: 1px solid var(--border);
    padding: 14px 18px; font-weight: 600;
}
.shadow-xl { box-shadow: 0 20px 60px rgba(11,50,217,.20); }

/* ============ KPI ============ */
.kpi {
    border-radius: 14px; padding: 18px 20px; color: #fff;
    display: flex; flex-direction: column; gap: 4px; min-height: 118px;
    box-shadow: 0 6px 18px rgba(16,22,56,.10);
}
.kpi-label { text-transform: uppercase; font-size: 11px; letter-spacing: 1.2px; opacity: .85; }
.kpi-value { font-size: 28px; font-weight: 700; }
.kpi-foot { font-size: 12px; opacity: .8; }
.kpi-primary   { background: linear-gradient(135deg, #0B32D9, #1F4FFF); }
.kpi-secondary { background: linear-gradient(135deg, #1F4FFF, #4b7bff); }
.kpi-gold      { background: linear-gradient(135deg, #F5C21A, #FFD54A); color: #3b2b00; }
.kpi-red       { background: linear-gradient(135deg, #E30613, #ff4a55); }

/* ============ Timeline ============ */
.list-timeline { list-style: none; padding: 0; margin: 0; }
.list-timeline li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--border); }
.list-timeline li:last-child { border-bottom: none; }
.dot { width: 12px; height: 12px; border-radius: 50%; margin-top: 6px; }
.dot-in { background: #2ecc71; box-shadow: 0 0 0 4px rgba(46,204,113,.15); }
.dot-out { background: var(--brand-red); box-shadow: 0 0 0 4px rgba(227,6,19,.15); }

/* ============ Tables ============ */
.table thead th { color: var(--muted); font-weight: 600; font-size: 12.5px; letter-spacing: .3px; text-transform: uppercase; border-bottom: 1px solid var(--border); }
.table tbody td { vertical-align: middle; }

/* ============ Auth ============ */
.auth-body {
    background: radial-gradient(1200px 600px at 10% -10%, #1F4FFF33, transparent),
                radial-gradient(1000px 500px at 110% 110%, #F5C21A33, transparent),
                linear-gradient(160deg, #0B32D9, #071e88);
    min-height: 100vh; display: grid; place-items: center; color: var(--ink);
}
.auth-wrapper { width: 100%; max-width: 460px; padding: 24px; }
.auth-card { background: #fff; border-radius: 20px; overflow: hidden; }
.auth-brand {
    background: linear-gradient(135deg, #0B32D9, #1F4FFF);
    color: #fff; padding: 30px 24px; text-align: center;
    border-bottom: 4px solid var(--brand-gold);
}
.auth-brand .brand-mark {
    width: 68px; height: 68px; border-radius: 18px; margin: 0 auto 12px;
    background: linear-gradient(135deg, var(--brand-gold), var(--brand-gold-light));
    color: var(--brand-primary-dark); display: grid; place-items: center; font-size: 32px;
    box-shadow: 0 6px 22px rgba(0,0,0,.25);
}
.auth-brand h1 { font-size: 22px; margin-bottom: 4px; }
.auth-brand .tagline { opacity: .85; font-size: 13px; margin: 0; }

/* ============ Toasts ============ */
.toast-stack { 
    position: fixed; top: 20px; right: 20px; z-index: 1080; 
    display: flex; flex-direction: column; gap: 12px; max-width: 380px; 
    pointer-events: none;
}
.app-toast, .toast-brand {
    background: #fff; 
    border-radius: 12px; 
    padding: 14px 16px; 
    box-shadow: 0 12px 40px rgba(16,22,56,.2);
    animation: toastSlideIn .35s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: all;
    backdrop-filter: blur(8px);
    border-left: 4px solid var(--brand-secondary);
    display: flex;
    gap: 12px;
    align-items: flex-start;
}
.app-toast .t-ico, .app-toast .t-ico { 
    font-size: 20px; 
    line-height: 1.2;
    flex-shrink: 0;
    margin-top: 2px;
}
.app-toast .t-body { 
    flex: 1; 
    font-size: 14px; 
    color: #0f172a;
    line-height: 1.5;
}
.app-toast .t-body strong { 
    display: block; 
    margin-bottom: 3px; 
    font-weight: 600;
    color: #000;
}
.app-toast .t-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #9ca3af;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    transition: color .2s;
    line-height: 1;
}
.app-toast .t-close:hover { color: #0f172a; }

.toast-brand { border-left-color: var(--brand-secondary); }
.toast-brand.success, .app-toast.success { border-left-color: #16a34a; }
.app-toast.success .t-ico { color: #16a34a; }
.toast-brand.error, .app-toast.error { border-left-color: #dc2626; }
.app-toast.error .t-ico { color: #dc2626; }
.toast-brand.warn, .app-toast.warn { border-left-color: #f59e0b; }
.app-toast.warn .t-ico { color: #f59e0b; }
.toast-brand.info, .app-toast.info { border-left-color: #2563eb; }
.app-toast.info .t-ico { color: #2563eb; }

@@keyframes toastSlideIn { 
    from { 
        transform: translateX(400px); 
        opacity: 0; 
    } 
    to { 
        transform: translateX(0); 
        opacity: 1; 
    } 
}

/* Responsive */
@@media (max-width: 900px) {
    .app-sidebar { position: fixed; transform: translateX(-100%); z-index: 30; transition: transform .2s; }
    .app-sidebar.open { transform: translateX(0); }
    .app-main { width: 100%; }
}
/* Public site */
.public-body { background:#fafbff; }
.public-nav { background: linear-gradient(90deg,#0B32D9,#1F4FFF); box-shadow:0 2px 6px rgba(0,0,0,.15); }
.public-brand { color:#fff; text-decoration:none; display:flex; align-items:center; gap:12px; }
.brand-badge { display:inline-flex; width:42px; height:42px; border-radius:50%; background:#F5C21A; align-items:center; justify-content:center; font-size:22px; }
.public-footer { background:#0B32D9; color:#fff; }
.btn-brand-gold { background:#F5C21A; color:#0B32D9; border:none; font-weight:600; }
.btn-brand-gold:hover { background:#FFD54A; color:#0B32D9; }
.hero { background:linear-gradient(135deg,#0B32D9 0%,#1F4FFF 100%); min-height:340px; display:flex; align-items:center; }
.hero-slim { background:linear-gradient(135deg,#0B32D9 0%,#1F4FFF 100%); }
.mv-card { background:#fff; border-radius:14px; padding:26px; box-shadow:0 4px 18px rgba(11,50,217,.08); position:relative; border-left:6px solid #0B32D9; height:100%; }
.mv-mission { border-left-color:#F5C21A; }
.mv-vision { border-left-color:#0B32D9; }
.mv-card h3 { color:#0B32D9; font-weight:700; margin-bottom:10px; }
.mv-icon { position:absolute; top:-12px; right:20px; background:#fff; border-radius:50%; width:42px; height:42px; display:inline-flex; align-items:center; justify-content:center; font-size:22px; box-shadow:0 2px 6px rgba(0,0,0,.1); }
.feature-card { background:#fff; border-radius:14px; padding:24px; box-shadow:0 4px 18px rgba(11,50,217,.06); height:100%; }
.fc-ico { font-size:36px; margin-bottom:8px; }
.text-primary-brand { color:#0B32D9 !important; }
.btn-brand { background:#0B32D9; color:#fff; border:none; }
.btn-brand:hover { background:#1F4FFF; color:#fff; }
.btn-outline-brand { border:1px solid #0B32D9; color:#0B32D9; background:#fff; }
.btn-outline-brand:hover { background:#0B32D9; color:#fff; }
.premium-card { border:none; border-radius:14px; box-shadow:0 4px 18px rgba(11,50,217,.06); }

/* Logo sizing */
.brand-logo { width:44px; height:44px; object-fit:contain; border-radius:8px; background:#fff; padding:2px; }
.public-logo { width:44px; height:44px; object-fit:contain; border-radius:50%; background:#fff; padding:3px; margin-right:10px; }

/* ======= Typewriter ======= */
.typewriter { display:inline-block; white-space:pre-wrap; }
.tw-caret::after {
    content:'|';
    display:inline-block;
    margin-left:2px;
    color: var(--brand-gold, #F5C21A);
    animation: tw-blink 0.9s steps(2) infinite;
    font-weight:400;
}
@keyframes tw-blink { 0%,50%{opacity:1} 51%,100%{opacity:0} }

/* ======= Premium animations ======= */
.fade-in-up { animation: fadeInUp .7s ease-out both; }
.fade-in-up-delay { animation: fadeInUp .9s ease-out .6s both; }
@keyframes fadeInUp {
    from { opacity:0; transform: translateY(24px); }
    to   { opacity:1; transform: translateY(0); }
}

.float-soft { animation: floatSoft 4s ease-in-out infinite; }
@keyframes floatSoft {
    0%,100% { transform: translateY(0); }
    50%     { transform: translateY(-6px); }
}

.pulse-soft { animation: pulseSoft 2.6s ease-in-out infinite; display:inline-block; }
@keyframes pulseSoft {
    0%,100% { transform: scale(1); text-shadow: 0 0 0 rgba(11,50,217,0); }
    50%     { transform: scale(1.08); text-shadow: 0 6px 18px rgba(11,50,217,.22); }
}

.heartbeat { display:inline-block; animation: heartbeat 1.4s ease-in-out infinite; }
@keyframes heartbeat {
    0%,100% { transform: scale(1); }
    25%     { transform: scale(1.25); }
    50%     { transform: scale(1); }
    75%     { transform: scale(1.18); }
}

.lift-on-hover { transition: transform .35s ease, box-shadow .35s ease; }
.lift-on-hover:hover { transform: translateY(-6px); box-shadow: 0 12px 30px rgba(11,50,217,.18); }

.shine-on-hover { position:relative; overflow:hidden; }
.shine-on-hover::after {
    content:''; position:absolute; top:0; left:-120%;
    width:60%; height:100%;
    background: linear-gradient(120deg, transparent, rgba(255,255,255,.55), transparent);
    transform: skewX(-20deg);
    transition: left .7s ease;
}
.shine-on-hover:hover::after { left:120%; }

/* ======= Phosphor feature card icons ======= */
.feature-card .fc-ico {
    font-size: 44px;
    color: var(--brand-primary, #0B32D9);
    margin-bottom: 8px;
    display:inline-block;
}

/* ======= Login field icons ======= */
.with-icon { position:relative; }
.with-icon .field-icon {
    position:absolute; top:50%; left:14px;
    transform: translateY(-50%);
    color: var(--brand-primary, #0B32D9);
    font-size: 18px;
    z-index:3;
    pointer-events:none;
}
.brand-mark-img { width:70px; height:70px; object-fit:contain; border-radius:16px; background:#fff; padding:6px; box-shadow:0 6px 18px rgba(11,50,217,.18); }

/* ======= Credit line ======= */
.credit-line { opacity:.85; }
.credit-link {
    color: var(--brand-gold, #F5C21A);
    text-decoration:none; font-weight:600;
    background-image: linear-gradient(90deg, currentColor, currentColor);
    background-size: 0% 1px; background-repeat:no-repeat; background-position:0 100%;
    transition: background-size .35s ease;
}
.credit-link:hover { background-size: 100% 1px; color: var(--brand-gold, #F5C21A); }

/* ======= Premium footer ======= */
.premium-footer {
    position:relative;
    background: linear-gradient(135deg, #0B32D9 0%, #1F4FFF 100%);
    color:#fff; overflow:hidden;
}
.premium-footer::before {
    content:''; position:absolute; inset:0;
    background: radial-gradient(circle at 20% 30%, rgba(245,194,26,.18), transparent 40%),
                radial-gradient(circle at 80% 70%, rgba(255,255,255,.10), transparent 40%);
    animation: footerGlow 8s ease-in-out infinite alternate;
    pointer-events:none;
}
@keyframes footerGlow {
    from { transform: translate(0,0); }
    to   { transform: translate(-10px,10px); }
}
.footer-wave {
    height:6px;
    background: linear-gradient(90deg, #F5C21A, #FFD54A, #F5C21A);
    background-size: 200% 100%;
    animation: waveShift 4s linear infinite;
}
@keyframes waveShift {
    from { background-position: 0% 0; }
    to   { background-position: 200% 0; }
}
.footer-links a {
    color:#fff; text-decoration:none; opacity:.85;
    transition: opacity .25s ease, transform .25s ease;
}
.footer-links a:hover { opacity:1; transform: translateY(-2px); color:#FFD54A; }

/* === Phase 3 premium additions === */

