:root {
    --sv-ink: #172033;
    --sv-muted: #667085;
    --sv-border: #e5eaf2;
    --sv-surface: #ffffff;
    --sv-bg: #f5f7fb;
    --sv-navy: #0b1220;
    --sv-navy-2: #111d33;
    --sv-primary: #356ae6;
    --sv-primary-dark: #2856c8;
    --sv-accent: #73e2c1;
    --sv-shadow: 0 16px 40px rgba(21, 35, 62, .08);
    --sv-radius: 18px;
}

* { box-sizing: border-box; }

body.app-body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: var(--sv-ink);
    background: var(--sv-bg);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

.app-navbar {
    min-height: 76px;
    background: linear-gradient(115deg, var(--sv-navy) 0%, #121d35 62%, #172a4a 100%);
    box-shadow: 0 8px 24px rgba(7, 16, 33, .18);
}

.app-brand {
    display: inline-flex;
    align-items: center;
    gap: .7rem;
    color: #fff !important;
    font-weight: 800;
    letter-spacing: -.02em;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    color: #091522;
    background: linear-gradient(145deg, var(--sv-accent), #48b7df);
    box-shadow: 0 8px 18px rgba(91, 220, 191, .22);
    font-size: 1.25rem;
}

.brand-copy { display: flex; flex-direction: column; line-height: 1.05; font-size: 1.05rem; }
.brand-copy small { margin-top: .25rem; color: #9eabc0; font-size: .64rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; }
.brand-accent { color: var(--sv-accent); }

.app-nav-links { display: flex; align-items: center; flex-wrap: wrap; gap: .25rem; }
.app-nav-link {
    padding: .65rem .85rem;
    border-radius: 10px;
    color: #afbad0;
    text-decoration: none;
    font-size: .92rem;
    font-weight: 600;
    transition: .2s ease;
}
.app-nav-link:hover, .app-nav-link:focus, .app-nav-link.active { color: #fff; background: rgba(255, 255, 255, .1); }
.app-nav-cta { color: var(--sv-navy); border: 0; font-weight: 700; }

.user-menu {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    padding: .35rem .75rem .35rem .35rem;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 13px;
    color: #fff;
    background: rgba(255,255,255,.08);
    font: inherit;
}
.user-menu::after { margin-left: .2rem; }
.user-avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; color: #092032; background: var(--sv-accent); font-weight: 800; }
.user-menu-copy { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.1; }
.user-menu-copy strong { font-size: .82rem; }
.user-menu-copy small { margin-top: .2rem; color: #aebbd0; font-size: .67rem; }
.app-dropdown { min-width: 220px; margin-top: .65rem !important; padding: .5rem; border: 1px solid var(--sv-border); border-radius: 14px; box-shadow: var(--sv-shadow); }
.app-dropdown .dropdown-item { border-radius: 9px; padding: .6rem .7rem; font-size: .88rem; }
.app-dropdown .dropdown-item:hover { background: #f0f4fb; }

.app-shell { flex: 1; }
.app-footer { padding: 1.25rem 0; color: #8691a4; background: #fff; border-top: 1px solid var(--sv-border); font-size: .78rem; }
.app-alert { border: 0; border-left: 4px solid currentColor; border-radius: 12px; box-shadow: 0 7px 18px rgba(22, 31, 51, .05); }

h1, h2, h3, h4, h5, h6 { color: var(--sv-ink); font-weight: 750; letter-spacing: -.025em; }
.text-muted { color: var(--sv-muted) !important; }
.btn { border-radius: 10px; font-weight: 650; padding: .62rem 1rem; transition: transform .18s ease, box-shadow .18s ease, background .18s ease; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { border-color: var(--sv-primary); background: var(--sv-primary); }
.btn-primary:hover, .btn-primary:focus { border-color: var(--sv-primary-dark); background: var(--sv-primary-dark); box-shadow: 0 8px 18px rgba(53, 106, 230, .22); }
.btn-outline-primary { color: var(--sv-primary); border-color: #b8c9f5; }
.btn-outline-primary:hover { color: #fff; border-color: var(--sv-primary); background: var(--sv-primary); }
.btn-light { box-shadow: 0 7px 18px rgba(0,0,0,.08); }
.form-control, .form-select { min-height: 46px; border-color: #dce3ef; border-radius: 10px; color: var(--sv-ink); background: #fff; }
.form-control:focus, .form-select:focus { border-color: #88a8f4; box-shadow: 0 0 0 .22rem rgba(53, 106, 230, .12); }
.card { border: 1px solid var(--sv-border); border-radius: var(--sv-radius); box-shadow: var(--sv-shadow); }
.card-title { font-weight: 750; }

/* Dashboard */
.hero-panel {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    min-height: 270px;
    padding: clamp(1.7rem, 4vw, 3.25rem);
    border-radius: 24px;
    color: #fff;
    background: radial-gradient(circle at 90% 10%, rgba(115,226,193,.23), transparent 30%), linear-gradient(120deg, #111d33, #203866 72%, #2b5482);
    box-shadow: 0 20px 48px rgba(22, 43, 83, .2);
}
.hero-panel::after { content: ""; position: absolute; right: -90px; bottom: -120px; width: 310px; height: 310px; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; box-shadow: 0 0 0 26px rgba(255,255,255,.03), 0 0 0 52px rgba(255,255,255,.02); }
.hero-panel h1 { max-width: 660px; margin: .45rem 0 .65rem; color: #fff; font-size: clamp(2rem, 4vw, 3.1rem); }
.hero-panel p { max-width: 620px; margin-bottom: 1.35rem; color: #c6d1e3; font-size: 1.02rem; }
.eyebrow { color: var(--sv-accent); font-size: .73rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .7rem; }
.hero-actions .btn-light { color: #10213c; }
.hero-shield { position: relative; z-index: 1; display: grid; place-items: center; flex: 0 0 148px; width: 148px; height: 148px; border: 1px solid rgba(255,255,255,.2); border-radius: 42px; color: var(--sv-accent); background: rgba(255,255,255,.08); font-size: 4rem; transform: rotate(8deg); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin: 2.2rem 0 1rem; }
.section-heading h2 { margin-bottom: .2rem; font-size: 1.35rem; }
.section-heading p { margin-bottom: 0; color: var(--sv-muted); font-size: .9rem; }
.feature-card { height: 100%; padding: 1.35rem; border: 1px solid var(--sv-border); border-radius: var(--sv-radius); background: var(--sv-surface); box-shadow: 0 10px 28px rgba(22, 35, 62, .055); transition: .2s ease; }
.feature-card:hover { transform: translateY(-4px); box-shadow: 0 18px 36px rgba(22, 35, 62, .1); }
.feature-icon { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 1rem; border-radius: 14px; font-size: 1.45rem; background: #edf2ff; }
.feature-icon.green { background: #e7f9f2; }
.feature-icon.gold { background: #fff4d9; }
.feature-icon.purple { background: #f0eaff; }
.feature-card h3 { margin-bottom: .5rem; font-size: 1.05rem; }
.feature-card p { min-height: 48px; margin-bottom: 1.1rem; color: var(--sv-muted); font-size: .9rem; line-height: 1.55; }
.feature-card .btn { width: 100%; }
.dashboard-note { height: 100%; padding: 1.25rem; border-radius: var(--sv-radius); background: #eaf8f4; border: 1px solid #cceee4; }
.dashboard-note h3 { font-size: 1rem; }
.dashboard-note p { margin-bottom: 0; color: #426d63; font-size: .88rem; line-height: 1.6; }
.quick-links { height: 100%; padding: 1.25rem; border: 1px solid var(--sv-border); border-radius: var(--sv-radius); background: #fff; }
.quick-links a { display: flex; align-items: center; justify-content: space-between; padding: .7rem .2rem; color: var(--sv-ink); text-decoration: none; border-bottom: 1px solid #edf0f5; font-size: .9rem; font-weight: 650; }
.quick-links a:last-child { border-bottom: 0; }
.quick-links a span:last-child { color: var(--sv-primary); }

/* Landing and auth */
.landing-hero { padding: clamp(1.6rem, 4vw, 4rem) 0 2rem; }
.landing-hero h1 { max-width: 700px; margin: .55rem 0 1rem; font-size: clamp(2.5rem, 6vw, 4.8rem); line-height: .98; }
.landing-hero .lead { max-width: 630px; color: var(--sv-muted); font-size: 1.12rem; line-height: 1.7; }
.landing-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }
.landing-orbit { display: grid; place-items: center; min-height: 300px; border-radius: 28px; background: linear-gradient(145deg, #111d33, #264b78); box-shadow: var(--sv-shadow); }
.landing-orbit .orbit-core { display: grid; place-items: center; width: 142px; height: 142px; border: 1px solid rgba(255,255,255,.2); border-radius: 42px; color: var(--sv-accent); background: rgba(255,255,255,.08); font-size: 4.5rem; box-shadow: 0 0 0 26px rgba(115,226,193,.06), 0 0 0 52px rgba(115,226,193,.04); }
.benefit-card { height: 100%; padding: 1.2rem; border: 1px solid var(--sv-border); border-radius: 16px; background: #fff; }
.benefit-card h3 { font-size: 1rem; }
.benefit-card p { margin: 0; color: var(--sv-muted); font-size: .88rem; line-height: 1.55; }
.auth-card { max-width: 540px; margin: 1rem auto; padding: clamp(1.4rem, 4vw, 2.4rem); border: 1px solid var(--sv-border); border-radius: 22px; background: #fff; box-shadow: var(--sv-shadow); }
.auth-card h1 { margin-bottom: .45rem; font-size: 1.7rem; }
.auth-card .auth-subtitle { margin-bottom: 1.6rem; color: var(--sv-muted); }
.auth-card .btn[type="submit"] { width: 100%; margin-top: .4rem; }

/* First visit and trust disclosure */
.onboarding-panel {
    max-width: 760px;
    padding: clamp(1.5rem, 4vw, 3rem);
    border-radius: 24px;
    color: #eef4ff;
    background: linear-gradient(145deg, #0b1220, #172b4f);
    box-shadow: var(--sv-shadow);
}
.onboarding-panel h1 { margin: .8rem 0 1rem; color: #fff; font-size: clamp(1.8rem, 4vw, 2.4rem); }
.onboarding-panel p, .onboarding-panel li { color: #d0dbee; line-height: 1.6; }
.onboarding-panel ul { margin: 1.5rem 0 0; padding-left: 1.3rem; }
.onboarding-panel li { padding: .25rem 0; }
.onboarding-count { color: #bacbff; font-weight: 700; }
.practice-note { padding: 1.3rem; border: 1px solid #405271; border-radius: 18px; background: #172033; }
.practice-note small { color: #c7d5eb; }
.onboarding-panel .form-label { color: #eff5ff; }
.vault-trust-card { padding: 1.3rem; border: 1px solid #405271; border-radius: 18px; color: #f4f7ff; background: #172033; }
.vault-trust-card h2 { color: #fff; }
.vault-trust-point + .vault-trust-point { margin-top: 1rem; }
.vault-trust-point strong { color: #d5deff; }
.vault-trust-point p { margin: .25rem 0 0; color: #d0dbee; line-height: 1.55; }
[hidden] { display: none !important; }

/* Existing data pages */
.page-header { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.page-header h1, .page-header h2 { margin-bottom: .25rem; }
.page-header p { margin-bottom: 0; color: var(--sv-muted); }
.table-responsive { overflow: hidden; border: 1px solid var(--sv-border); border-radius: var(--sv-radius); background: #fff; box-shadow: var(--sv-shadow); }
.table { margin-bottom: 0; }
.table > :not(caption) > * > * { padding: .9rem .85rem; border-bottom-color: #edf0f5; }
.table-dark th { color: #dce7fb; background: #182943; border-color: #263a5b; }
.list-group-item { border-color: #edf0f5; }

@media (max-width: 991.98px) {
    .app-nav-links { flex-direction: column; align-items: stretch; gap: .1rem; margin-top: 1rem; }
    .app-nav-link { padding: .65rem .7rem; }
    .hero-panel { align-items: flex-start; }
    .hero-shield { display: none; }
}

@media (max-width: 575.98px) {
    .hero-panel { min-height: 0; padding: 1.5rem; border-radius: 20px; }
    .hero-panel h1 { font-size: 2rem; }
    .section-heading { align-items: flex-start; flex-direction: column; }
    .page-header { align-items: flex-start; flex-direction: column; }
    .landing-hero h1 { font-size: 2.7rem; }
    .landing-orbit { min-height: 220px; }
}
