/* ==========================================================================
   Aussie Grant & Loan — Web Portal
   Modern, responsive, mobile-first stylesheet
   ========================================================================== */

:root {
    --navy-900: #071a3d;
    --navy-800: #0a2450;
    --navy-700: #123468;
    --navy-600: #1d4690;
    --blue-500: #2f6bd8;
    --gold-500: #f5b301;
    --gold-400: #ffc42e;
    --green-600: #0e9f6e;
    --red-600: #dc2626;
    --ink: #17233c;
    --muted: #5b6b87;
    --line: #e3e9f4;
    --bg: #f3f6fc;
    --card: #ffffff;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 10px 30px rgba(10, 36, 80, .08);
    --shadow-lg: 0 20px 50px rgba(10, 36, 80, .14);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    color: var(--ink);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

img { max-width: 100%; display: block; }
a { color: var(--blue-500); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.site-main { flex: 1; }

/* --------------------------------------------------------------------------
   Header / navigation
   -------------------------------------------------------------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(7, 26, 61, .92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.nav-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 64px;
    gap: 16px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-size: 1.05rem;
    font-weight: 500;
}
.brand:hover { text-decoration: none; }
.brand-logo { width: 36px; height: 36px; border-radius: 10px; box-shadow: 0 3px 8px rgba(0, 0, 0, .25); flex-shrink: 0; }
.brand-flag { font-size: 1.5rem; }
.brand-text strong { color: var(--gold-400); font-weight: 800; }

.site-nav { display: flex; align-items: center; gap: 4px; }

.nav-link {
    color: rgba(255, 255, 255, .82);
    font-weight: 500;
    font-size: .93rem;
    padding: 8px 12px;
    border-radius: 8px;
    transition: background .15s, color .15s;
}
.nav-link:hover { background: rgba(255, 255, 255, .1); color: #fff; text-decoration: none; }
.nav-link.active { color: var(--gold-400); }

.nav-cta {
    background: var(--gold-500);
    color: var(--navy-900) !important;
    font-weight: 700;
    margin-left: 6px;
    padding: 9px 16px;
    border-radius: 999px;
}
.nav-cta:hover { background: var(--gold-400); }
.nav-cta.active { color: var(--navy-900) !important; box-shadow: 0 0 0 2px #fff inset; }

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 42px;
    height: 42px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 10px;
    cursor: pointer;
    padding: 9px;
}
.nav-toggle span { display: block; height: 2px; background: #fff; border-radius: 2px; transition: .2s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero {
    position: relative;
    color: #fff;
    background:
        radial-gradient(1000px 500px at 85% -10%, rgba(245, 179, 1, .22), transparent 60%),
        radial-gradient(800px 420px at -10% 110%, rgba(47, 107, 216, .35), transparent 55%),
        linear-gradient(135deg, var(--navy-900) 0%, var(--navy-700) 55%, var(--navy-600) 100%);
    overflow: hidden;
}
.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, .07) 1px, transparent 1px);
    background-size: 26px 26px;
    pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; padding: 72px 0 84px; text-align: center; }

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .18);
    padding: 7px 16px;
    border-radius: 999px;
    font-size: .83rem;
    font-weight: 600;
    letter-spacing: .4px;
    text-transform: uppercase;
    margin-bottom: 22px;
}

.eyebrow-logo { width: 22px; height: 22px; border-radius: 6px; }
.notify-logo { width: 34px; height: 34px; border-radius: 9px; }

.hero h1 {
    font-size: clamp(2rem, 5.4vw, 3.4rem);
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: -.5px;
    max-width: 780px;
    margin: 0 auto 18px;
}
.hero h1 .accent { color: var(--gold-400); }

.hero p.lead {
    font-size: clamp(1rem, 2.2vw, 1.18rem);
    color: rgba(255, 255, 255, .82);
    max-width: 640px;
    margin: 0 auto 34px;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }

.hero-stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px 44px;
    margin-top: 52px;
}
.hero-stat { text-align: center; }
.hero-stat b { display: block; font-size: 1.55rem; font-weight: 800; color: var(--gold-400); }
.hero-stat span { font-size: .85rem; color: rgba(255, 255, 255, .72); }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font);
    font-size: .97rem;
    font-weight: 700;
    padding: 13px 26px;
    border-radius: 12px;
    border: 0;
    cursor: pointer;
    transition: transform .12s, box-shadow .12s, background .15s;
    text-decoration: none !important;
    line-height: 1.2;
}
.btn:active { transform: translateY(1px); }

.btn-gold { background: var(--gold-500); color: var(--navy-900); box-shadow: 0 8px 20px rgba(245, 179, 1, .35); }
.btn-gold:hover { background: var(--gold-400); }

.btn-navy { background: var(--navy-700); color: #fff; }
.btn-navy:hover { background: var(--navy-600); }

.btn-outline { background: rgba(255, 255, 255, .1); color: #fff; border: 1.5px solid rgba(255, 255, 255, .45); }
.btn-outline:hover { background: rgba(255, 255, 255, .2); }

.btn-outline-dark { background: #fff; color: var(--navy-700); border: 1.5px solid var(--line); }
.btn-outline-dark:hover { border-color: var(--navy-600); background: var(--bg); }

.btn-green { background: var(--green-600); color: #fff; }
.btn-green:hover { background: #0b8a5f; }

.btn-red { background: var(--red-600); color: #fff; }
.btn-red:hover { background: #b91c1c; }

.btn-sm { padding: 8px 14px; font-size: .85rem; border-radius: 9px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* --------------------------------------------------------------------------
   Sections / cards
   -------------------------------------------------------------------------- */
.section { padding: 64px 0; }
.section-alt { background: #fff; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 44px; }
.section-head h2 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); font-weight: 800; letter-spacing: -.4px; margin-bottom: 12px; }
.section-head p { color: var(--muted); }

.grid { display: grid; gap: 22px; }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: 1fr 1fr; }

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px;
}

.card-hover { transition: transform .18s, box-shadow .18s; }
.card-hover:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

.card-icon {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(245, 179, 1, .18), rgba(47, 107, 216, .14));
    margin-bottom: 16px;
}
.card h3 { font-size: 1.12rem; font-weight: 700; margin-bottom: 8px; }
.card p { color: var(--muted); font-size: .95rem; }

/* Product cards (loan / grant) */
.product-card { position: relative; overflow: hidden; display: flex; flex-direction: column; }
.product-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 6px;
    background: linear-gradient(90deg, var(--gold-500), var(--blue-500));
}
.product-card .amount-range {
    font-size: 1.9rem;
    font-weight: 800;
    color: var(--navy-700);
    letter-spacing: -.5px;
    margin: 6px 0 4px;
}
.product-card ul { list-style: none; margin: 16px 0 22px; }
.product-card li { padding: 7px 0 7px 28px; position: relative; color: var(--muted); font-size: .95rem; }
.product-card li::before { content: "✓"; position: absolute; left: 0; top: 7px; color: var(--green-600); font-weight: 800; }
.product-card .btn { margin-top: auto; }

/* Steps */
.steps { counter-reset: step; }
.step-card { position: relative; padding-top: 34px; }
.step-card::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    top: -20px;
    left: 24px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--navy-700);
    color: var(--gold-400);
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 14px rgba(10, 36, 80, .3);
}

/* CTA band */
.cta-band {
    background: linear-gradient(120deg, var(--navy-800), var(--navy-600));
    border-radius: var(--radius);
    color: #fff;
    padding: 46px 32px;
    text-align: center;
    box-shadow: var(--shadow-lg);
}
.cta-band h2 { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 800; margin-bottom: 10px; }
.cta-band p { color: rgba(255, 255, 255, .8); max-width: 520px; margin: 0 auto 24px; }

/* Live notification slider (home page) */
.notify-band {
    position: relative;
    background:
        radial-gradient(600px 200px at 90% -20%, rgba(245, 179, 1, .18), transparent 60%),
        linear-gradient(120deg, var(--navy-800), var(--navy-600));
    border-radius: var(--radius);
    color: #fff;
    padding: 22px 26px 16px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}
.notify-band-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    font-weight: 800;
    font-size: 1.02rem;
    margin-bottom: 14px;
    position: relative;
    z-index: 1;
}
.notify-band-note { font-size: .78rem; font-weight: 500; color: rgba(255, 255, 255, .65); }

.notify-slider { position: relative; z-index: 1; min-height: 62px; }
.notify-slide { display: none; align-items: center; gap: 14px; flex-wrap: wrap; }
.notify-slide.active { display: flex; animation: fadeSlide .4s ease; }
.notify-icon { font-size: 1.9rem; flex-shrink: 0; }
.notify-body { min-width: 0; }
.notify-title { font-weight: 700; font-size: 1.02rem; }
.notify-title b { color: var(--gold-400); }
.notify-meta { color: rgba(255, 255, 255, .75); font-size: .86rem; }
.notify-meta b { color: #fff; }
.notify-badge { margin-left: auto; }

.notify-dots { display: flex; gap: 7px; margin-top: 12px; position: relative; z-index: 1; }
.notify-dots button {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    border: 0;
    background: rgba(255, 255, 255, .35);
    cursor: pointer;
    padding: 0;
    transition: width .2s, background .2s;
}
.notify-dots button.active { background: var(--gold-400); width: 22px; }
.notify-dots button:hover { background: rgba(255, 255, 255, .7); }

/* --------------------------------------------------------------------------
   Badges & alerts
   -------------------------------------------------------------------------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .78rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 999px;
    white-space: nowrap;
}
.badge-green  { background: #dcf7ec; color: #067a52; }
.badge-blue   { background: #ddeafe; color: #1d4fc4; }
.badge-red    { background: #fde2e2; color: #b91c1c; }
.badge-amber  { background: #fdf1d3; color: #a16207; }
.badge-indigo { background: #e3e6fd; color: #4338ca; }
.badge-purple { background: #f0e4fd; color: #7e22ce; }
.badge-orange { background: #ffeadb; color: #c2410c; }
.badge-teal   { background: #d9f5f2; color: #0f766e; }
.badge-grey   { background: #e8edf5; color: #475569; }

.alert {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 15px 18px;
    border-radius: var(--radius-sm);
    font-size: .93rem;
    margin-bottom: 20px;
    border: 1px solid transparent;
}
.alert-error   { background: #fdecec; border-color: #f5c6c6; color: #991b1b; }
.alert-success { background: #e6f9f0; border-color: #b9ecd4; color: #065f46; }
.alert-info    { background: #e8f0fe; border-color: #c8dbfb; color: #1e40af; }
.alert ul { margin: 6px 0 0 18px; }

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */
.form-card { max-width: 760px; margin: 0 auto; }

.form-grid { display: grid; gap: 18px; grid-template-columns: 1fr; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-weight: 600; font-size: .9rem; }
.field label .req { color: var(--red-600); }
.field .hint { font-size: .8rem; color: var(--muted); }
.field .error-text { font-size: .82rem; color: var(--red-600); font-weight: 600; display: none; }
.field.invalid .error-text { display: block; }
.field.invalid .form-control { border-color: var(--red-600); }

.form-control {
    font-family: var(--font);
    font-size: .96rem;
    color: var(--ink);
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
}
.form-control:focus {
    outline: none;
    border-color: var(--blue-500);
    box-shadow: 0 0 0 4px rgba(47, 107, 216, .14);
}
textarea.form-control { resize: vertical; min-height: 96px; }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235b6b87' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; }

/* Selectable option cards (application type, payment method, gender...) */
.option-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
.option-card {
    position: relative;
    display: flex;
    gap: 14px;
    align-items: center;
    padding: 18px;
    border: 2px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.option-card:hover { border-color: #b9c8e4; }
.option-card.selected { border-color: var(--blue-500); background: #f5f9ff; box-shadow: 0 0 0 4px rgba(47, 107, 216, .12); }
.option-card .opt-icon { font-size: 1.9rem; }
.option-card .opt-title { font-weight: 700; font-size: 1rem; }
.option-card .opt-desc { font-size: .85rem; color: var(--muted); }
.option-card input { position: absolute; opacity: 0; pointer-events: none; }
.option-card .opt-check {
    margin-left: auto;
    width: 24px; height: 24px;
    border-radius: 50%;
    border: 2px solid var(--line);
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    color: transparent;
    font-size: .8rem;
    transition: .15s;
}
.option-card.selected .opt-check { background: var(--blue-500); border-color: var(--blue-500); color: #fff; }

/* Option cards rendered as <button> (e.g. KYC scheduling) */
button.option-card {
    font-family: var(--font);
    font-size: 1rem;
    text-align: left;
    width: 100%;
    cursor: pointer;
}
button.option-card:hover { border-color: var(--blue-500); background: #f5f9ff; }

/* ID checkbox tiles */
.id-tiles { display: grid; gap: 12px; grid-template-columns: 1fr; }
.id-tile {
    display: flex; align-items: center; gap: 12px;
    border: 2px solid var(--line);
    border-radius: 12px;
    padding: 14px 16px;
    cursor: pointer;
    font-weight: 600;
    background: #fff;
    transition: .15s;
}
.id-tile:hover { border-color: #b9c8e4; }
.id-tile.selected { border-color: var(--green-600); background: #f2fbf7; }
.id-tile .tile-emoji { font-size: 1.4rem; }
.id-tile .tile-check { margin-left: auto; font-size: 1.1rem; color: var(--green-600); opacity: 0; transition: .15s; }
.id-tile.selected .tile-check { opacity: 1; }
.id-tile input { position: absolute; opacity: 0; pointer-events: none; }

.id-section {
    border: 1.5px solid var(--line);
    border-radius: var(--radius);
    padding: 22px;
    margin-top: 18px;
    background: #fbfcff;
}
.id-section h3 { display: flex; align-items: center; gap: 10px; font-size: 1.02rem; margin-bottom: 16px; }

/* Dropzone file inputs */
.dropzone {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 120px;
    padding: 18px;
    border: 2px dashed #c3cfe6;
    border-radius: var(--radius-sm);
    background: #fff;
    cursor: pointer;
    text-align: center;
    transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--blue-500); background: #f5f9ff; }
.dropzone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.dropzone .dz-icon { font-size: 1.6rem; }
.dropzone .dz-text { font-size: .88rem; color: var(--muted); }
.dropzone .dz-text b { color: var(--blue-500); }
.dropzone.has-file { border-style: solid; border-color: var(--green-600); background: #f2fbf7; }
.dropzone .dz-preview { max-height: 110px; border-radius: 8px; box-shadow: var(--shadow); }
.dropzone .dz-name { font-size: .8rem; color: var(--green-600); font-weight: 600; word-break: break-all; }

/* --------------------------------------------------------------------------
   Wizard
   -------------------------------------------------------------------------- */
.wizard-progress {
    display: flex;
    gap: 6px;
    margin-bottom: 28px;
}
.wizard-progress .seg {
    flex: 1;
    height: 6px;
    border-radius: 999px;
    background: var(--line);
    overflow: hidden;
    transition: background .2s;
}
.wizard-progress .seg.done { background: linear-gradient(90deg, var(--gold-500), var(--green-600)); }

.wizard-step-label {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
}
.wizard-step-label .step-count { font-size: .8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.wizard-step-label h2 { font-size: 1.3rem; font-weight: 800; letter-spacing: -.3px; }
.wizard-sub { color: var(--muted); font-size: .93rem; margin-bottom: 22px; }

.wizard-step { display: none; }
.wizard-step.active { display: block; animation: fadeSlide .25s ease; }

@keyframes fadeSlide {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.wizard-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 28px; }

/* Review table */
.review-list { display: grid; gap: 0; }
.review-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 11px 0;
    border-bottom: 1px solid var(--line);
    font-size: .93rem;
}
.review-row:last-child { border-bottom: 0; }
.review-row dt { color: var(--muted); font-weight: 500; flex-shrink: 0; }
.review-row dd { font-weight: 600; text-align: right; word-break: break-word; }
.review-group { font-size: .8rem; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; color: var(--navy-600); margin: 20px 0 6px; }

/* --------------------------------------------------------------------------
   Success / status pages
   -------------------------------------------------------------------------- */
.success-hero { text-align: center; padding: 30px 0 10px; }
.success-tick {
    width: 84px; height: 84px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: #dcf7ec;
    color: var(--green-600);
    font-size: 2.4rem;
    display: flex; align-items: center; justify-content: center;
    animation: pop .35s ease;
}
@keyframes pop { 0% { transform: scale(.4); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

.app-id-box {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: var(--navy-800);
    color: var(--gold-400);
    font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
    font-size: clamp(1rem, 4vw, 1.35rem);
    font-weight: 700;
    letter-spacing: 1px;
    padding: 16px 26px;
    border-radius: 12px;
    margin: 18px 0;
    word-break: break-all;
}

.status-timeline { list-style: none; margin-top: 8px; }
.status-timeline li { position: relative; padding: 0 0 22px 34px; }
.status-timeline li::before {
    content: "";
    position: absolute;
    left: 8px; top: 4px;
    width: 14px; height: 14px;
    border-radius: 50%;
    background: var(--line);
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px var(--line);
}
.status-timeline li::after {
    content: "";
    position: absolute;
    left: 14px; top: 20px; bottom: 0;
    width: 2px;
    background: var(--line);
}
.status-timeline li:last-child::after { display: none; }
.status-timeline li.done::before { background: var(--green-600); box-shadow: 0 0 0 2px #b9ecd4; }
.status-timeline li.current::before { background: var(--gold-500); box-shadow: 0 0 0 2px #fbe3a2; }
.status-timeline .st-title { font-weight: 700; font-size: .95rem; }
.status-timeline .st-desc { font-size: .85rem; color: var(--muted); }

/* --------------------------------------------------------------------------
   Admin
   -------------------------------------------------------------------------- */
.admin-shell { max-width: 1120px; margin: 0 auto; }
.admin-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 24px; }
.admin-head h1 { font-size: 1.5rem; font-weight: 800; letter-spacing: -.3px; }
.admin-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.admin-tabs a {
    padding: 8px 15px;
    border-radius: 999px;
    background: #fff;
    border: 1.5px solid var(--line);
    font-size: .86rem;
    font-weight: 600;
    color: var(--muted);
}
.admin-tabs a:hover { text-decoration: none; border-color: var(--navy-600); color: var(--navy-700); }
.admin-tabs a.active { background: var(--navy-700); border-color: var(--navy-700); color: #fff; }

.stat-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, 1fr); margin-bottom: 26px; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); }
.stat-card .stat-label { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.stat-card .stat-value { font-size: 1.9rem; font-weight: 800; color: var(--navy-700); letter-spacing: -.5px; }

.table-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.table-scroll { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data-table th {
    text-align: left;
    font-size: .74rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--muted);
    padding: 14px 16px;
    background: #f8fafd;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
table.data-table td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data-table tr:last-child td { border-bottom: 0; }
table.data-table tr:hover td { background: #f8fafd; }
table.data-table .mono { font-family: ui-monospace, Consolas, monospace; font-size: .82rem; }

.detail-grid { display: grid; gap: 22px; grid-template-columns: 1fr; }
.detail-section h3 {
    font-size: .82rem; font-weight: 800; text-transform: uppercase; letter-spacing: .6px;
    color: var(--navy-600); margin-bottom: 12px; padding-bottom: 8px; border-bottom: 2px solid var(--line);
}
.doc-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.doc-thumb { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.doc-thumb img { width: 100%; height: 120px; object-fit: cover; }
.doc-thumb .doc-meta { padding: 9px 11px; font-size: .76rem; }
.doc-thumb .doc-meta b { display: block; font-size: .8rem; margin-bottom: 4px; }

.action-bar { display: flex; flex-wrap: wrap; gap: 10px; }
.inline-form { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-form select, .inline-form input { width: auto; }

.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 22px; flex-wrap: wrap; }
.pagination a, .pagination span {
    min-width: 38px; height: 38px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 9px; border: 1.5px solid var(--line);
    background: #fff; font-weight: 600; font-size: .88rem; color: var(--ink);
    padding: 0 10px;
}
.pagination a:hover { border-color: var(--navy-600); text-decoration: none; }
.pagination .current { background: var(--navy-700); border-color: var(--navy-700); color: #fff; }

.login-card { max-width: 420px; margin: 40px auto; }
.login-card .lock { font-size: 2.2rem; text-align: center; display: block; margin-bottom: 10px; }

/* Filter bar */
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.filter-bar .form-control { max-width: 260px; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer { background: var(--navy-900); color: rgba(255, 255, 255, .75); margin-top: 64px; }
.footer-grid { display: grid; gap: 30px; grid-template-columns: 1fr; padding: 48px 0 30px; }
.site-footer h4 { color: #fff; font-size: .92rem; margin-bottom: 12px; }
.site-footer a { display: block; color: rgba(255, 255, 255, .75); padding: 4px 0; font-size: .9rem; }
.site-footer a:hover { color: var(--gold-400); }
.footer-text { font-size: .9rem; }
.footer-text.small { font-size: .8rem; line-height: 1.55; }
.footer-brand { margin-bottom: 12px; }
.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, .1);
    padding: 18px 0 22px;
    font-size: .82rem;
    text-align: center;
    color: rgba(255, 255, 255, .5);
}

/* --------------------------------------------------------------------------
   Live chat
   -------------------------------------------------------------------------- */
.chat-box {
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: 340px;
    overflow-y: auto;
    padding: 16px;
    background: #f6f8fd;
    border: 1px solid var(--line);
    border-radius: 12px;
}
.chat-empty { margin: auto; color: var(--muted); font-size: .9rem; text-align: center; }
.chat-msg { display: flex; flex-direction: column; max-width: 80%; }
.chat-msg.own { align-self: flex-end; align-items: flex-end; }
.chat-msg.other { align-self: flex-start; align-items: flex-start; }
.chat-bubble {
    padding: 10px 14px;
    border-radius: 16px;
    font-size: .93rem;
    line-height: 1.45;
    word-break: break-word;
    white-space: pre-wrap;
}
.chat-msg.own .chat-bubble {
    background: var(--navy-700);
    color: #fff;
    border-bottom-right-radius: 4px;
}
.chat-msg.other .chat-bubble {
    background: #fff;
    border: 1px solid var(--line);
    border-bottom-left-radius: 4px;
}
.chat-time { font-size: .72rem; color: var(--muted); margin-top: 3px; padding: 0 4px; }
.chat-input-row { display: flex; gap: 10px; margin-top: 12px; align-items: center; }
.chat-input-row .form-control { flex: 1; }

.chat-img {
    display: block;
    max-width: 220px;
    max-height: 220px;
    border-radius: 10px;
    cursor: zoom-in;
}
.chat-msg.other .chat-img { border: 1px solid var(--line); }
.chat-img-wrap { position: relative; display: inline-block; margin-bottom: 4px; }
.chat-img-status {
    position: absolute;
    left: 6px;
    bottom: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .35);
}

/* Admin split chat layout with vertical user tabs */
.chat-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 18px;
    align-items: start;
}
.chat-users {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow-y: auto;
    max-height: 620px;
    box-shadow: var(--shadow);
}
.chat-users-head {
    padding: 14px 16px;
    font-weight: 800;
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--muted);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
}
.chat-user-tab {
    display: block;
    padding: 13px 16px;
    border-bottom: 1px solid var(--line);
    border-left: 4px solid transparent;
    cursor: pointer;
    transition: background .12s;
}
.chat-user-tab:hover { background: #f8fafd; }
.chat-user-tab.active { background: #eef4ff; border-left-color: var(--blue-500); }
.chat-user-tab .u-name { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-weight: 700; font-size: .9rem; }
.chat-user-tab .u-msg {
    color: var(--muted);
    font-size: .79rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 3px;
}
.chat-user-tab .u-meta { font-size: .72rem; color: var(--muted); margin-top: 4px; }
.chat-main-head {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
    font-size: 1rem;
}
.chat-main-head a { margin-left: auto; }
.chat-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 300px;
    color: var(--muted);
    text-align: center;
}
.chat-placeholder .big { font-size: 2.6rem; }

/* Image lightbox popup */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(7, 15, 35, .86);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeSlide .18s ease;
}
.lightbox-card {
    background: #fff;
    border-radius: 16px;
    max-width: min(94vw, 780px);
    max-height: 94vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
}
.lightbox-img-wrap {
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0b1526;
    min-height: 200px;
}
.lightbox-img { max-width: 100%; max-height: 66vh; object-fit: contain; }
.lightbox-bar {
    display: flex;
    gap: 10px;
    padding: 14px 16px;
    align-items: center;
    flex-wrap: wrap;
}
.lightbox-status { min-width: 0; }
.lightbox-close { margin-left: auto; }

/* Typing indicator */
.chat-typing {
    font-size: .8rem;
    color: var(--muted);
    font-style: italic;
    margin-top: 8px;
    min-height: 1.2em;
}
.chat-typing::after {
    content: '';
    animation: typingDots 1.2s steps(4, end) infinite;
}
@keyframes typingDots {
    0% { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75% { content: '...'; }
    100% { content: ''; }
}

/* Toast notifications */
.toast-stack {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: min(92vw, 380px);
}
.toast {
    background: var(--navy-800);
    color: #fff;
    padding: 13px 15px;
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(7, 26, 61, .35);
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-size: .9rem;
    line-height: 1.45;
    border-left: 4px solid var(--gold-400);
    animation: toastIn .25s ease;
}
.toast .toast-msg { flex: 1; }
.toast .toast-close {
    background: transparent;
    border: 0;
    color: rgba(255, 255, 255, .65);
    cursor: pointer;
    font-size: .9rem;
    padding: 0 2px;
    line-height: 1.4;
}
.toast .toast-close:hover { color: #fff; }
.toast.hide { opacity: 0; transform: translateY(8px); transition: opacity .3s, transform .3s; }
@keyframes toastIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Document re-upload (status page) */
.doc-reupload { margin-top: 8px; }
.doc-reupload .form-control { font-size: .82rem; padding: 8px 10px; }

@media (max-width: 860px) {
    .chat-layout { grid-template-columns: 1fr; }
    .chat-users { max-height: 220px; }
    .chat-main-head a { margin-left: 0; }
}

@media (max-width: 640px) {
    .chat-box { height: 300px; }
    .chat-thread .t-msg { max-width: 180px; }
    .lightbox-img { max-height: 56vh; }
}

.chat-attach {
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    border: 1.5px solid var(--line);
    background: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color .15s, background .15s;
}
.chat-attach:hover { border-color: var(--blue-500); background: #f5f9ff; }

.chat-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #f8fafd;
    width: fit-content;
}
.chat-preview-img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; }
.chat-preview-remove {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 0;
    background: var(--red-600);
    color: #fff;
    font-size: .8rem;
    cursor: pointer;
    line-height: 1;
}

.chat-thread {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 15px 18px;
    border-bottom: 1px solid var(--line);
    color: var(--ink);
}
.chat-thread:last-child { border-bottom: 0; }
.chat-thread:hover { background: #f8fafd; text-decoration: none; }
.chat-thread .t-name { font-weight: 700; font-size: .95rem; }
.chat-thread .t-msg {
    color: var(--muted);
    font-size: .85rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 380px;
}
.chat-thread .t-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.chat-thread .t-time { font-size: .78rem; color: var(--muted); white-space: nowrap; }

@media (max-width: 640px) {
    .chat-box { height: 300px; }
    .chat-thread .t-msg { max-width: 180px; }
}
.page-head { padding: 44px 0 8px; text-align: center; }
.page-head h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); font-weight: 800; letter-spacing: -.4px; }
.page-head p { color: var(--muted); max-width: 560px; margin: 10px auto 0; }
.page-body { padding: 30px 0 60px; }

.text-muted { color: var(--muted); }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 32px; }
.mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.hidden { display: none !important; }
.mono { font-family: ui-monospace, Consolas, monospace; }

/* --------------------------------------------------------------------------
   Modals / confirmation cards
   -------------------------------------------------------------------------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(7, 26, 61, .55);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 460px;
    padding: 28px;
    animation: modal-in .2s ease-out;
}
@keyframes modal-in {
    from { opacity: 0; transform: translateY(-12px); }
    to { opacity: 1; transform: translateY(0); }
}
.modal-card .modal-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(220, 38, 38, .1);
    color: var(--red-600);
    font-size: 1.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}
.modal-card h3 { font-size: 1.25rem; font-weight: 800; margin-bottom: 8px; }
.modal-card p { color: var(--muted); font-size: .95rem; margin-bottom: 16px; }
.modal-card .delete-checklist {
    list-style: none;
    background: #f8fafd;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 20px;
    font-size: .9rem;
}
.modal-card .delete-checklist li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    color: var(--ink);
}
.modal-card .delete-checklist li::before {
    content: "✓";
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--red-600);
    color: #fff;
    font-size: .7rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.modal-card .modal-actions { display: flex; gap: 10px; justify-content: flex-end; }
.modal-card .modal-actions .btn { padding: 10px 20px; font-size: .9rem; }

/* Table action buttons */
table.data-table td.actions {
    white-space: nowrap;
    width: 1%;
}
table.data-table td.actions .btn {
    margin-right: 6px;
}
table.data-table td.actions .btn:last-child {
    margin-right: 0;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (min-width: 640px) {
    .grid-2 { grid-template-columns: repeat(2, 1fr); }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .option-grid.two { grid-template-columns: repeat(2, 1fr); }
    .form-grid.two { grid-template-columns: repeat(2, 1fr); }
    .stat-grid { grid-template-columns: repeat(3, 1fr); }
    .id-tiles { grid-template-columns: repeat(3, 1fr); }
    .footer-grid { grid-template-columns: 1.2fr .8fr 1.2fr; }
}

@media (min-width: 900px) {
    .grid-3 { grid-template-columns: repeat(3, 1fr); }
    .grid-4 { grid-template-columns: repeat(4, 1fr); }
    .detail-grid { grid-template-columns: 1.4fr 1fr; }
    .stat-grid { grid-template-columns: repeat(5, 1fr); }
}

@media (max-width: 820px) {
    .nav-toggle { display: flex; }
    .site-nav {
        position: absolute;
        top: 64px;
        left: 0; right: 0;
        flex-direction: column;
        align-items: stretch;
        background: var(--navy-900);
        border-bottom: 1px solid rgba(255, 255, 255, .1);
        padding: 12px 20px 18px;
        gap: 4px;
        display: none;
        box-shadow: 0 24px 40px rgba(0, 0, 0, .35);
    }
    .site-nav.open { display: flex; }
    .nav-link { padding: 12px 14px; }
    .nav-cta { margin: 8px 0 0; text-align: center; }
    .hero-inner { padding: 52px 0 60px; }
    .section { padding: 46px 0; }
    .card { padding: 22px; }
    .wizard-nav .btn { flex: 1; }
    .review-row { flex-direction: column; gap: 2px; }
    .review-row dd { text-align: left; }
}
