:root {
    --bg: #f5f7fb;
    --surface: #ffffff;
    --text: #172033;
    --muted: #667085;
    --border: #e4e7ec;
    --primary: #5b43d6;
    --primary-dark: #4933bb;
    --success: #087a55;
    --danger: #b42318;
    --warning: #a15c00;
    --shadow: 0 16px 40px rgba(23, 32, 51, 0.08);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 18px clamp(20px, 5vw, 72px);
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(14px);
}

.brand {
    color: var(--text);
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.site-header nav {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.site-header nav a,
.link-button {
    color: var(--text);
    font: inherit;
    font-weight: 650;
}

.inline-form { display: inline; margin: 0; }
.link-button {
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
}

.container {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 48px 0 64px;
}

.hero {
    min-height: 430px;
    display: grid;
    place-items: center;
    padding: clamp(36px, 7vw, 88px);
    border-radius: 28px;
    background:
        radial-gradient(circle at 85% 15%, rgba(115, 88, 255, 0.28), transparent 35%),
        linear-gradient(135deg, #181629, #352d70);
    color: white;
    box-shadow: var(--shadow);
}

.hero > div { max-width: 760px; text-align: center; }
.hero h1 {
    margin: 12px 0 18px;
    font-size: clamp(2.4rem, 6vw, 4.7rem);
    line-height: 1.02;
    letter-spacing: -0.055em;
}
.hero p {
    margin: 0 auto 28px;
    max-width: 680px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.08rem;
    line-height: 1.7;
}

.eyebrow {
    display: inline-block;
    color: #7358ff;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.hero .eyebrow { color: #c8bdff; }

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

.button {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 11px;
    padding: 12px 18px;
    font: inherit;
    font-weight: 750;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease;
}
.button:hover { text-decoration: none; transform: translateY(-1px); }
.button:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.button.primary { background: var(--primary); color: white; }
.button.primary:hover { background: var(--primary-dark); }
.button.secondary { background: #eef0f6; color: var(--text); }
.button.success { background: #dcfae6; color: var(--success); }
.button.danger { background: #fee4e2; color: var(--danger); }
.button.small { padding: 8px 11px; border-radius: 8px; font-size: 0.86rem; }
.button.full { width: 100%; margin-top: 8px; }

.card-grid {
    display: grid;
    gap: 20px;
    margin-top: 24px;
}
.card-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.card,
.form-card,
.stat,
.error-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow);
}

.card { padding: 26px; margin-top: 24px; }
.card-grid .card { margin-top: 0; }
.card h2 { margin: 0 0 10px; font-size: 1.14rem; }
.card p { color: var(--muted); line-height: 1.6; }

.auth-shell {
    display: grid;
    place-items: center;
    min-height: 65vh;
}

.form-card {
    width: min(100%, 500px);
    padding: clamp(24px, 5vw, 38px);
}
.form-card.wide { width: min(100%, 720px); }

.form-heading { margin-bottom: 24px; }
.form-heading h1 { margin: 8px 0; font-size: 2rem; letter-spacing: -0.04em; }
.form-heading p { margin: 0; color: var(--muted); }

label {
    display: grid;
    gap: 7px;
    margin-bottom: 16px;
    color: #344054;
    font-size: 0.92rem;
    font-weight: 700;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid #d0d5dd;
    border-radius: 10px;
    background: white;
    padding: 12px 13px;
    color: var(--text);
    font: inherit;
    outline: none;
}
input:focus,
textarea:focus,
select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(91, 67, 214, 0.12);
}
textarea { resize: vertical; }

.two-column {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.form-links {
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 20px;
    font-size: 0.9rem;
}

.flash-stack { display: grid; gap: 10px; margin-bottom: 20px; }
.flash {
    border-radius: 10px;
    padding: 13px 15px;
    border: 1px solid transparent;
}
.flash-success { color: #05603a; background: #ecfdf3; border-color: #abefc6; }
.flash-danger { color: #912018; background: #fef3f2; border-color: #fecdca; }
.flash-warning { color: #7a2e0e; background: #fffaeb; border-color: #fedf89; }

.page-heading { margin-bottom: 26px; }
.page-heading h1 { margin: 8px 0; font-size: clamp(2rem, 4vw, 3.2rem); letter-spacing: -0.05em; }
.page-heading p { color: var(--muted); }
.heading-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}
.stat { padding: 22px; }
.stat strong { display: block; font-size: 2rem; }
.stat span { color: var(--muted); }

.details { margin: 0; }
.details div {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 16px;
    padding: 11px 0;
    border-bottom: 1px solid var(--border);
}
.details div:last-child { border-bottom: 0; }
.details dt { color: var(--muted); }
.details dd { margin: 0; font-weight: 700; }

.table-wrap { overflow-x: auto; }
table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}
th, td {
    padding: 14px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
th {
    color: #475467;
    font-size: 0.78rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
td { font-size: 0.92rem; }
td small { color: var(--muted); }

.table-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.badge {
    display: inline-flex;
    border-radius: 999px;
    padding: 5px 9px;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: capitalize;
}
.badge.approved { color: #05603a; background: #dcfae6; }
.badge.pending { color: #7a2e0e; background: #fef0c7; }
.badge.rejected, .badge.disabled { color: #912018; background: #fee4e2; }

.notice {
    margin: 8px 0 16px;
    padding: 13px 15px;
    border-radius: 10px;
}
.notice.warning { background: #fffaeb; color: #7a2e0e; }

.error-card {
    max-width: 620px;
    margin: 80px auto;
    padding: 52px;
    text-align: center;
}
.error-code { font-size: 4rem; font-weight: 900; color: var(--primary); }

.site-footer {
    padding: 28px;
    text-align: center;
    color: var(--muted);
    font-size: 0.9rem;
}

@media (max-width: 820px) {
    .card-grid.three,
    .card-grid.two,
    .stats-grid,
    .two-column {
        grid-template-columns: 1fr;
    }
    .heading-row {
        align-items: flex-start;
        flex-direction: column;
    }
    .site-header {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 520px) {
    .container { width: min(100% - 20px, 1180px); padding-top: 26px; }
    .hero { padding: 36px 20px; border-radius: 18px; }
    .form-card { padding: 22px 18px; }
}

.notice.info { background: #eef4ff; color: #3538cd; border: 1px solid #c7d7fe; }
.otp-input {
    text-align: center;
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: 0.45em;
    padding-left: calc(13px + 0.45em);
}
.resend-form { margin-top: 10px; }
