:root {
    --ink: #15213b;
    --muted: #8a9bbb;
    --line: #e5eaf2;
    --panel: #f7f9fc;
    --blue: #2454e8;
    --green: #24c77a;
    --red: #ea4f64;
    --amber: #f2a313;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: #f4f7fb; }
body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    font: 15px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
.topbar {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5vw;
    background: rgba(255,255,255,.94);
    border-bottom: 1px solid var(--line);
}
.brand { font-weight: 800; letter-spacing: -.02em; }
.nav-links { display: flex; align-items: center; gap: 20px; font-size: 14px; color: #62718d; }
.nav-user { font-weight: 700; color: var(--ink); }
main { min-height: calc(100vh - 112px); }
footer { padding: 18px; text-align: center; color: #98a6bf; font-size: 13px; }
footer a { text-decoration: underline; }

.landing {
    min-height: calc(100vh - 112px);
    display: grid;
    place-items: center;
    padding: 40px 20px;
    background:
        radial-gradient(circle at 15% 20%, rgba(64,103,242,.18), transparent 30%),
        radial-gradient(circle at 85% 75%, rgba(24,199,151,.14), transparent 32%),
        #f7f9fd;
}
.landing-panel {
    width: min(620px, 100%);
    padding: 54px;
    text-align: center;
    background: white;
    border: 1px solid rgba(223,229,240,.9);
    border-radius: 24px;
    box-shadow: 0 25px 70px rgba(35,55,95,.12);
}
.discord-mark {
    display: grid;
    place-items: center;
    width: 68px;
    height: 68px;
    margin: 0 auto 22px;
    color: white;
    background: #5865f2;
    border-radius: 22px;
    font-size: 36px;
}
.eyebrow { color: var(--blue); font-size: 12px; font-weight: 800; letter-spacing: .16em; }
.landing h1 { margin: 8px 0 12px; font-size: clamp(30px, 5vw, 46px); line-height: 1.1; letter-spacing: -.04em; }
.landing p:not(.eyebrow) { max-width: 490px; margin: 0 auto 28px; color: #6f7f9b; }

.verify-shell { width: 100%; padding: 30px 16px; }
.verify-card {
    width: min(398px, 100%);
    margin: 0 auto;
    overflow: hidden;
    background: white;
    border-radius: 7px;
    box-shadow: 0 12px 36px rgba(28,46,82,.09);
}
.verify-hero {
    min-height: 190px;
    padding: 28px 24px 24px;
    text-align: center;
    color: white;
    background:
        radial-gradient(circle at 50% 10%, rgba(31,89,198,.85), transparent 42%),
        linear-gradient(160deg, #071b35, #040812 80%);
    background-size: cover;
    background-position: center;
}
.verify-hero h1 { margin: 8px auto 2px; max-width: 350px; font-size: 22px; line-height: 1.28; letter-spacing: -.025em; }
.verify-hero p { margin: 3px 0; font-size: 13px; color: rgba(255,255,255,.9); }
.state-icon {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    margin: 0 auto;
    color: var(--blue);
    background: white;
    border-radius: 50%;
    border: 6px solid rgba(255,255,255,.18);
    background-clip: padding-box;
    font-size: 28px;
    font-weight: 800;
}
.status-pending .state-icon { color: var(--amber); }
.status-approved .state-icon { color: var(--green); }
.status-rejected .state-icon { color: var(--red); }
.verify-body { padding: 22px 28px 28px; }
.steps { display: grid; grid-template-columns: 52px 1fr 52px; align-items: start; margin-bottom: 35px; }
.steps i { height: 2px; margin-top: 13px; background: #dae1ec; }
.step { display: flex; flex-direction: column; align-items: center; gap: 6px; color: #9aabc6; }
.step span { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #eef2f8; font-size: 12px; }
.step small { font-size: 10px; }
.step.active { color: var(--blue); }
.step.active span { color: white; background: var(--blue); }
.verify-body h3 { margin: 18px 0 7px; font-size: 15px; }
.info-box {
    min-height: 66px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--panel);
    border: 1px solid #edf0f5;
    border-radius: 5px;
}
.info-box img, .fallback-logo { width: 42px; height: 42px; flex: 0 0 42px; border-radius: 50%; object-fit: cover; }
.fallback-logo { display: grid; place-items: center; color: white; background: linear-gradient(135deg,#225be7,#1aa6bd); font-weight: 900; }
.info-box div { min-width: 0; }
.info-box strong { display: block; overflow: hidden; text-overflow: ellipsis; }
.info-box small { display: block; color: #8ea0be; font-size: 11px; }
.info-box.compact { min-height: 50px; }
.permission-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 7px rgba(36,199,122,.08); }
.role-box { border-left: 3px solid var(--role-color); }
.role-box .permission-dot { background: var(--role-color); box-shadow: 0 0 0 7px color-mix(in srgb, var(--role-color) 10%, transparent); }
.role-box img.role-icon { width: 28px; height: 28px; flex-basis: 28px; border-radius: 7px; }
.role-emoji { width: 28px; text-align: center; font-size: 22px; line-height: 1; }
.submit-form { margin-top: 23px; padding-top: 16px; border-top: 1px solid var(--line); }
.primary-button {
    width: 100%;
    min-height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 13px 20px;
    border: 0;
    border-radius: 5px;
    color: white;
    background: var(--blue);
    box-shadow: 0 7px 16px rgba(36,84,232,.18);
    font-weight: 750;
    cursor: pointer;
}
.primary-button:hover { filter: brightness(1.06); }
.discord-login { width: max-content; min-width: 245px; margin: auto; background: #5865f2; }
.safe-close { margin: 30px 0 0; text-align: center; color: #91a2bf; font-size: 13px; }
.notice { margin: 18px 0; padding: 13px 15px; border-radius: 7px; background: #eef2f8; }
.notice.error { color: #a92b40; background: #fff0f2; border: 1px solid #ffd7dd; }
.notice.success { color: #10774b; background: #ebfbf4; border: 1px solid #c9f3df; }
.legal { width: min(760px, calc(100% - 32px)); margin: 42px auto; padding: 38px; background: white; border-radius: 16px; box-shadow: 0 12px 35px rgba(28,46,82,.07); }

.admin-shell { width: min(1180px, calc(100% - 32px)); margin: 38px auto; }
.admin-heading { display: flex; align-items: end; justify-content: space-between; gap: 28px; margin-bottom: 24px; }
.admin-heading h1 { margin: 0; font-size: 36px; letter-spacing: -.04em; }
.admin-heading .eyebrow { margin: 0 0 6px; }
.stats { display: flex; gap: 10px; }
.stats div { min-width: 104px; padding: 12px 16px; background: white; border: 1px solid var(--line); border-radius: 12px; }
.stats strong, .stats span { display: block; }
.stats strong { font-size: 22px; }
.stats span { color: var(--muted); font-size: 12px; }
.admin-panel { overflow: hidden; background: white; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 12px 34px rgba(28,46,82,.06); }
.tabs { display: flex; gap: 4px; padding: 14px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs a { padding: 9px 14px; border-radius: 8px; color: #70809b; font-weight: 700; white-space: nowrap; }
.tabs a.active { color: var(--blue); background: #edf2ff; }
.applications { padding: 5px 18px; }
.application-row {
    display: grid;
    grid-template-columns: 46px minmax(180px,1fr) minmax(150px,.6fr) minmax(280px,1.25fr);
    align-items: center;
    gap: 14px;
    min-height: 96px;
    padding: 14px 4px;
    border-bottom: 1px solid #edf0f5;
}
.application-row:last-child { border-bottom: 0; }
.application-row > img { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; }
.app-user strong, .app-user span, .app-user code, .app-meta time { display: block; }
.app-user span { color: #73829d; font-size: 13px; }
.app-user code { margin-top: 2px; color: #9aa8bd; font-size: 11px; }
.badge { display: inline-block; padding: 4px 9px; border-radius: 100px; font-size: 11px; font-weight: 800; }
.badge.pending { color: #a36a00; background: #fff5d9; }
.badge.approved { color: #10774b; background: #e8faf2; }
.badge.rejected { color: #a92b40; background: #ffedf0; }
.app-meta time { margin-top: 7px; color: #9ba8bb; font-size: 11px; }
.sync-ok, .sync-wait, .sync-error { display: block; margin-top: 5px; font-size: 11px; }
.sync-ok { color: #14925c; }
.sync-wait { color: #c08313; }
.sync-error { max-width: 230px; overflow: hidden; color: #c33249; text-overflow: ellipsis; white-space: nowrap; }
.review-actions { display: flex; align-items: center; justify-content: end; gap: 8px; }
.reject-form { display: flex; gap: 6px; }
.reject-form input { width: 145px; padding: 9px 10px; border: 1px solid #dbe1eb; border-radius: 7px; outline: 0; }
.approve-button, .reject-button, .retry-button { padding: 9px 12px; border: 0; border-radius: 7px; color: white; font-weight: 750; cursor: pointer; white-space: nowrap; }
.approve-button { background: #1aad6c; }
.reject-button { background: #df4c60; }
.retry-button { background: #e19418; }
.empty-state { padding: 70px 20px; text-align: center; color: var(--muted); }

@media (max-width: 850px) {
    .admin-heading { align-items: start; flex-direction: column; }
    .application-row { grid-template-columns: 46px 1fr; }
    .app-meta, .review-actions { grid-column: 2; justify-content: start; }
}
@media (max-width: 520px) {
    .topbar { padding: 0 16px; }
    .nav-user { display: none; }
    .landing-panel { padding: 38px 22px; }
    .verify-shell { padding: 18px 8px; }
    .verify-body { padding: 20px; }
    .stats { width: 100%; overflow-x: auto; }
    .stats div { flex: 1 0 96px; }
    .admin-heading h1 { font-size: 30px; }
    .applications { padding: 4px 10px; }
    .review-actions, .reject-form { align-items: stretch; flex-direction: column; }
    .reject-form input { width: 100%; }
}
