:root {
    --bg: #f5f7fb;
    --surface: rgba(255, 255, 255, .86);
    --surface-solid: #ffffff;
    --text: #102033;
    --muted: #69778a;
    --line: #dfe7f1;
    --primary: #1463ff;
    --primary-dark: #0d3fbd;
    --navy: #10243f;
    --navy-2: #152f52;
    --accent: #16c784;
    --warning: #f59e0b;
    --danger: #e11d48;
    --shadow: 0 18px 45px rgba(16, 36, 63, .10);
    --radius: 22px;
    --radius-sm: 14px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(20, 99, 255, .14), transparent 32rem),
        radial-gradient(circle at top right, rgba(22, 199, 132, .11), transparent 26rem),
        linear-gradient(180deg, #f8fbff 0%, var(--bg) 48%, #eef3fa 100%);
    color: var(--text);
    min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; transition: .18s ease; }
a:hover { color: var(--primary-dark); }
h1 { margin: 0 0 18px; font-size: clamp(28px, 4vw, 46px); letter-spacing: -.04em; line-height: 1.05; }
h2 { margin: 0 0 14px; font-size: 21px; letter-spacing: -.02em; }
p { line-height: 1.65; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    min-height: 76px;
    background: rgba(16, 36, 63, .92);
    backdrop-filter: blur(18px);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 28px;
    box-shadow: 0 12px 30px rgba(16, 36, 63, .18);
}
.brand { font-weight: 900; font-size: 23px; letter-spacing: -.03em; }
.userbox { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.userbox a, .topbar a { color: #ddecff; font-weight: 750; }
.userbox a:hover, .topbar a:hover { color: #fff; }

.shell {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    min-height: calc(100vh - 76px);
}
.sidebar {
    background: rgba(255, 255, 255, .74);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--line);
    padding: 20px 16px;
}
.sidebar a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 14px;
    border-radius: 16px;
    color: #25364b;
    margin-bottom: 8px;
    font-weight: 800;
}
.sidebar a:hover, .sidebar a.active {
    background: linear-gradient(135deg, rgba(20, 99, 255, .12), rgba(22, 199, 132, .09));
    color: var(--primary-dark);
    transform: translateX(2px);
}
.nav-icon {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 10px;
    background: #edf4ff;
}
.content { padding: 30px; max-width: 1400px; width: 100%; }

.card, .glass-card {
    background: var(--surface);
    border: 1px solid rgba(223, 231, 241, .86);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 22px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}
.card .card { box-shadow: none; background: rgba(255,255,255,.62); }
.grid { display: grid; gap: 20px; }
.cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.metric { font-size: 34px; font-weight: 950; color: var(--navy); letter-spacing: -.04em; }

button, .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    background: linear-gradient(135deg, var(--primary), #4b8dff);
    color: #fff !important;
    padding: 12px 18px;
    border-radius: 14px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(20, 99, 255, .18);
}
button:hover, .button:hover { transform: translateY(-1px); filter: brightness(.98); }
button.secondary, .button.secondary {
    background: linear-gradient(135deg, var(--navy), var(--navy-2));
    box-shadow: 0 10px 22px rgba(16, 36, 63, .18);
}
.button.xl { padding: 15px 22px; border-radius: 18px; font-size: 16px; }

input, select, textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 15px;
    padding: 13px 15px;
    font: inherit;
    color: var(--text);
    background: rgba(255,255,255,.92);
    outline: none;
}
input:focus, select:focus, textarea:focus {
    border-color: rgba(20,99,255,.7);
    box-shadow: 0 0 0 4px rgba(20,99,255,.10);
}
input[type="checkbox"] { width: auto; margin-right: 8px; }
label { font-weight: 850; margin-top: 8px; color: #23344a; }
.stack { display: grid; gap: 12px; }

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: rgba(255,255,255,.72);
    border: 1px solid var(--line);
    border-radius: 18px;
    overflow: hidden;
}
th, td {
    text-align: left;
    border-bottom: 1px solid var(--line);
    padding: 13px 14px;
    vertical-align: top;
}
th {
    color: var(--navy);
    background: #f2f6fb;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .04em;
}
tr:last-child td { border-bottom: 0; }

.alert {
    padding: 14px 16px;
    border-radius: 16px;
    background: #eaf4ff;
    margin-bottom: 16px;
    border: 1px solid #bcdcff;
    color: #123a64;
}
.alert.success { background: #e9fbf3; border-color: #b7efd2; color: #0b6b40; }
.alert.danger { background: #fff0f3; border-color: #ffc2d0; color: #9f1239; }

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}
.login-card {
    width: 100%;
    max-width: 440px;
    background: var(--surface);
    padding: 34px;
    border-radius: 28px;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}
.login-card.wide { max-width: 760px; }
.public-shell { padding: 34px; max-width: 1180px; margin: 0 auto; }

.phase-ladder { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
.phase-ladder span, .ui-badge {
    padding: 10px 13px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 900;
    display: inline-flex;
    align-items: center;
    gap: 7px;
}
.phase-ladder .done, .ui-badge.pass, .ui-badge.done { background: #e9fbf3; color: #0b6b40; }
.phase-ladder .active, .ui-badge.active { background: #fff7db; color: #925d00; }
.phase-ladder .locked, .ui-badge.locked { background: #eef2f7; color: #667085; }
.score { font-size: 42px; font-weight: 950; margin-bottom: 10px; letter-spacing: -.05em; }
.score.pass { color: var(--accent); }
.score.fail { color: var(--danger); }

.status-chip {
    display: inline-flex;
    align-items: center;
    padding: 7px 10px;
    border-radius: 999px;
    background: #eef4ff;
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 900;
}
.status-pass, .status-live, .status-resolved, .status-contact-unlocked, .status-unlocked { background: #e9fbf3; color: #0b6b40; }
.status-fail, .status-rejected, .status-cancelled { background: #fff0f3; color: #9f1239; }
.status-pending, .status-warning { background: #fff7db; color: #925d00; }

.landing-page { overflow-x: hidden; }
.landing-nav {
    max-width: 1220px;
    margin: 18px auto 0;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255,255,255,.74);
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}
.brand-lockup { display: flex; align-items: center; gap: 12px; color: var(--navy); }
.brand-mark {
    width: 44px; height: 44px;
    display: grid; place-items: center;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--navy), var(--primary));
    color: white;
    font-weight: 950;
}
.brand-lockup strong { display: block; font-size: 18px; letter-spacing: -.03em; }
.brand-lockup small { color: var(--muted); font-weight: 750; }
.landing-nav nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.landing-nav nav a { color: #26394f; font-weight: 850; padding: 10px 12px; border-radius: 999px; }
.landing-nav .nav-pill { background: var(--navy); color: white; }

.landing-wrap { max-width: 1220px; margin: 0 auto; padding: 34px 18px 60px; }
.hero-modern {
    display: grid;
    grid-template-columns: 1.2fr .8fr;
    gap: 28px;
    align-items: center;
    min-height: 560px;
}
.eyebrow {
    display: inline-flex;
    padding: 9px 13px;
    border-radius: 999px;
    background: rgba(20,99,255,.10);
    color: var(--primary-dark);
    font-weight: 950;
    margin-bottom: 16px;
}
.hero-copy p { font-size: 18px; color: var(--muted); max-width: 720px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 24px 0; }
.trust-row { display: flex; flex-wrap: wrap; gap: 10px; }
.trust-row span {
    padding: 9px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,.74);
    border: 1px solid var(--line);
    font-weight: 800;
    color: #31455d;
}
.hero-panel { min-height: 430px; display: grid; align-content: center; }
.panel-header { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.pulse-dot {
    width: 12px; height: 12px; border-radius: 999px;
    background: var(--accent);
    box-shadow: 0 0 0 8px rgba(22,199,132,.12);
}
.flow-steps { display: grid; gap: 12px; }
.flow-steps div {
    display: flex; align-items: center; gap: 12px;
    padding: 14px;
    border-radius: 18px;
    background: rgba(255,255,255,.66);
    border: 1px solid var(--line);
}
.flow-steps b {
    width: 34px; height: 34px;
    display: grid; place-items: center;
    border-radius: 12px;
    background: #edf4ff;
    color: var(--primary-dark);
}
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 26px;
    padding: 24px;
    box-shadow: var(--shadow);
}
.feature-icon { font-size: 34px; }
.feature-card a { font-weight: 950; }
.ops-strip {
    margin-top: 22px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.ops-strip div {
    background: var(--navy);
    color: #fff;
    border-radius: 22px;
    padding: 20px;
}
.ops-strip strong { display: block; margin-bottom: 8px; }
.ops-strip span { color: #c8d6e8; }

@media (max-width: 1000px) {
    .shell { grid-template-columns: 1fr; }
    .sidebar {
        display: flex;
        overflow-x: auto;
        border-right: 0;
        border-bottom: 1px solid var(--line);
        padding: 12px;
        gap: 8px;
    }
    .sidebar a { min-width: max-content; margin-bottom: 0; }
    .cards, .two, .three, .feature-grid, .ops-strip, .hero-modern { grid-template-columns: 1fr; }
    .hero-modern { min-height: auto; padding-top: 20px; }
    .topbar { align-items: flex-start; flex-direction: column; gap: 10px; }
    .content, .public-shell { padding: 18px; }
    .landing-nav { margin: 10px; flex-direction: column; align-items: stretch; gap: 14px; }
    .landing-nav nav { justify-content: center; }
}

.ui-rise { animation: uiRise .38s ease both; }
.table-scroll { width: 100%; overflow-x: auto; }
@keyframes uiRise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
