/* =========================================================
   VividPyro Moderator Application System
   Fully responsive public app + admin dashboard + review UI
   ========================================================= */

:root {
    --bg: #08090d;
    --bg-2: #0d0f16;
    --panel: rgba(255,255,255,.045);
    --panel-2: rgba(255,255,255,.065);
    --line: rgba(255,255,255,.095);
    --line-strong: rgba(255,255,255,.16);
    --text: #ffffff;
    --muted: #b8bac5;
    --muted-2: #8d909d;
    --red: #ff3f3f;
    --red-2: #b90000;
    --red-soft: rgba(255,63,63,.13);
    --green: #39ff8a;
    --green-soft: rgba(57,255,138,.12);
    --yellow: #ffc857;
    --yellow-soft: rgba(255,200,87,.12);
    --blue: #55a7ff;
    --blue-soft: rgba(85,167,255,.13);
    --purple: #9d7bff;
    --purple-soft: rgba(157,123,255,.13);
    --shadow: 0 24px 70px rgba(0,0,0,.42);
    --shadow-soft: 0 12px 38px rgba(0,0,0,.25);
    --radius-sm: 12px;
    --radius: 18px;
    --radius-lg: 26px;
    --container: min(1200px, calc(100% - 32px));
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

body {
    overflow-x: hidden;
}

.vivid-body {
    background:
        radial-gradient(circle at 90% -10%, rgba(255,64,64,.22), transparent 34%),
        radial-gradient(circle at 8% 8%, rgba(255,0,0,.13), transparent 30%),
        radial-gradient(circle at 50% 110%, rgba(88,101,242,.12), transparent 35%),
        linear-gradient(180deg, #09090d 0%, #07080d 100%);
    color: var(--text);
    min-height: 100vh;
}

.app-bg-glow {
    position: fixed;
    inset: auto -120px -180px auto;
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, rgba(255,64,64,.18), transparent 70%);
    filter: blur(12px);
    pointer-events: none;
    z-index: 0;
}

a {
    text-decoration: none;
    color: inherit;
}

button,
input,
textarea,
select {
    font-family: inherit;
}

input,
textarea,
select {
    width: 100%;
    background: rgba(255,255,255,.048);
    border: 1px solid var(--line);
    color: white;
    padding: 14px 15px;
    border-radius: 14px;
    outline: none;
    margin-top: 8px;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

select {
    cursor: pointer;
}

input::placeholder,
textarea::placeholder {
    color: rgba(255,255,255,.38);
}

input:focus,
textarea:focus,
select:focus {
    border-color: rgba(255,80,80,.75);
    background: rgba(255,255,255,.065);
    box-shadow: 0 0 0 4px rgba(255,68,68,.13);
}

textarea {
    resize: vertical;
    min-height: 110px;
    line-height: 1.6;
}

label {
    display: block;
    margin-bottom: 20px;
    font-size: 14px;
    color: rgba(255,255,255,.92);
    line-height: 1.45;
}

label small,
.small-note,
.muted {
    color: var(--muted);
}

h1,
h2,
h3,
p {
    overflow-wrap: anywhere;
}

.primary-btn,
.ghost-btn,
.mini-btn,
.discord-login-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border: 0;
    border-radius: 14px;
    cursor: pointer;
    font-weight: 800;
    transition: transform .18s ease, filter .18s ease, background .18s ease, border-color .18s ease;
    min-height: 44px;
}

.primary-btn {
    background: linear-gradient(135deg, var(--red), var(--red-2));
    color: white;
    padding: 14px 22px;
    box-shadow: 0 14px 34px rgba(255,0,0,.20);
}

.primary-btn:hover,
.ghost-btn:hover,
.mini-btn:hover,
.discord-login-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.06);
}

.primary-btn:disabled,
.ghost-btn:disabled {
    opacity: .55;
    cursor: not-allowed;
    transform: none;
}

.ghost-btn {
    background: rgba(255,255,255,.035);
    color: white;
    border: 1px solid var(--line-strong);
    padding: 14px 22px;
}

.mini-btn {
    padding: 10px 15px;
    background: rgba(255,0,0,.16);
    border: 1px solid rgba(255,70,70,.18);
    color: white;
    border-radius: 12px;
    font-size: 13px;
}

.small-btn {
    padding: 11px 16px;
    min-height: 40px;
    font-size: 13px;
}

.full-btn {
    width: 100%;
    margin-top: 12px;
}

.hidden {
    display: none !important;
}

.brand-badge {
    width: 60px;
    height: 60px;
    min-width: 60px;
    border-radius: 19px;
    background: linear-gradient(135deg, #ff5151, #7b0000);
    display: grid;
    place-items: center;
    font-weight: 950;
    font-size: 24px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.16), 0 18px 40px rgba(255,0,0,.16);
}

.brand-badge.large {
    width: 92px;
    height: 92px;
    min-width: 92px;
    border-radius: 28px;
    font-size: 34px;
}

/* ---------- Shared Cards ---------- */

.key-card,
.application-card,
.closed-card,
.submitted-card,
.panel,
.login-card,
.stat-card,
.admin-login-card {
    background: var(--panel);
    border: 1px solid var(--line);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-soft);
}

.panel {
    margin-bottom: 28px;
}

.empty-box {
    padding: 42px 24px;
    text-align: center;
    color: var(--muted);
    border: 1px dashed rgba(255,255,255,.13);
    border-radius: var(--radius);
    background: rgba(255,255,255,.025);
}

.text-green { color: var(--green); }
.text-red { color: #ff6b6b; }
.text-yellow { color: var(--yellow); }
.text-blue { color: var(--blue); }

/* ---------- Public Application ---------- */

.modapp-shell {
    position: relative;
    z-index: 1;
    width: var(--container);
    margin: 0 auto;
    padding: 48px 0;
}

.modapp-hero {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 24px;
    align-items: center;
    margin-bottom: 28px;
}

.eyebrow {
    color: #ff6262;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 12px;
    font-weight: 900;
    margin: 0 0 8px;
}

.modapp-hero h1,
.dash-header h1,
.review-hero h1 {
    margin: 0;
    font-size: clamp(30px, 5vw, 54px);
    line-height: 1.02;
}

.hero-text {
    color: #d1d2da;
    max-width: 850px;
    line-height: 1.75;
    margin-bottom: 0;
}

.key-card,
.application-card,
.closed-card,
.submitted-card {
    margin-top: 20px;
}

.key-card h2,
.application-card h2,
.panel h2 {
    margin-top: 0;
}

.key-input-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 14px;
    margin-top: 18px;
}

.form-message {
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: 14px;
    display: none;
}

.form-message:not(:empty) {
    display: block;
}

.form-message.info {
    background: var(--blue-soft);
    border: 1px solid rgba(85,167,255,.18);
    color: #dbeeff;
}

.form-message.success {
    background: var(--green-soft);
    border: 1px solid rgba(57,255,138,.18);
    color: #d9ffe8;
}

.form-message.danger {
    background: rgba(255,60,60,.12);
    border: 1px solid rgba(255,60,60,.24);
    color: #ffdada;
}

.info-banner,
#autosaveInfo {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    background: linear-gradient(135deg, rgba(70,150,255,.15), rgba(70,150,255,.06));
    border: 1px solid rgba(85,167,255,.24);
    color: #e5f2ff;
    border-radius: 18px;
    padding: 16px;
    margin-bottom: 22px;
}

.info-dot,
.info-icon {
    width: 28px;
    height: 28px;
    min-width: 28px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: rgba(85,167,255,.20);
    border: 1px solid rgba(85,167,255,.35);
    color: #a9d5ff;
    font-weight: 900;
}

#autosaveInfo strong,
.info-banner strong {
    display: block;
    margin-bottom: 3px;
}

#autosaveInfo p,
.info-banner p {
    margin: 0;
    color: #bedfff;
    line-height: 1.45;
}

#autosaveInfo small {
    display: block;
    margin-top: 6px;
    color: #9bcaff;
}

.progress-wrap {
    margin-bottom: 30px;
    padding: 18px;
    border-radius: 18px;
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.07);
}

.progress-wrap > div:first-child {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

#pageText {
    color: var(--muted);
    font-weight: 700;
}

#pageTitle {
    font-size: 18px;
}

.progress-bar {
    margin-top: 14px;
    height: 10px;
    background: rgba(255,255,255,.08);
    border-radius: 999px;
    overflow: hidden;
}

#progressFill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #ff6262, #ff0000);
    border-radius: 999px;
    transition: width .25s ease;
}

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

.form-page {
    display: none;
    animation: fadeSlide .22s ease;
}

.form-page.active {
    display: block;
}

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

.form-actions {
    position: sticky;
    bottom: 16px;
    z-index: 20;
    margin-top: 30px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 14px;
    border-radius: 20px;
    background: rgba(8,9,13,.86);
    border: 1px solid rgba(255,255,255,.08);
    backdrop-filter: blur(18px);
}

.discord-card {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255,255,255,.035);
    border: 1px solid rgba(255,255,255,.075);
    border-radius: 20px;
    padding: 18px;
    margin-bottom: 28px;
}

.avatar-placeholder,
#discordAvatarPreview {
    width: 58px;
    height: 58px;
    min-width: 58px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff4a4a, #790000);
    display: grid;
    place-items: center;
    font-weight: 900;
    overflow: hidden;
}

.avatar-placeholder img,
#discordAvatarPreview img,
.app-avatar img,
.big-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.final-checks label {
    display: flex;
    gap: 12px;
    margin-bottom: 18px;
    padding: 16px;
    border-radius: 16px;
    background: rgba(255,255,255,.035);
    border: 1px solid rgba(255,255,255,.075);
}

.final-checks input {
    width: 18px;
    height: 18px;
    margin: 2px 0 0;
    accent-color: var(--red);
}

.submit-warning {
    margin-top: 26px;
    padding: 20px;
    border-radius: 18px;
    background: rgba(255,70,70,.10);
    border: 1px solid rgba(255,70,70,.20);
    color: #ffd9d9;
    line-height: 1.6;
}

.closed-card,
.submitted-card {
    text-align: center;
}

.closed-icon,
.success-icon {
    width: 76px;
    height: 76px;
    margin: 0 auto 18px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 32px;
    font-weight: 950;
}

.closed-icon {
    background: rgba(255,0,0,.15);
    border: 1px solid rgba(255,70,70,.22);
}

.success-icon {
    background: rgba(0,255,100,.13);
    border: 1px solid rgba(0,255,100,.22);
}

/* ---------- Toasts ---------- */

#appToastArea {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.vivid-toast {
    min-width: 340px;
    max-width: min(520px, calc(100vw - 28px));
    padding: 18px;
    border-radius: 18px;
    display: flex;
    gap: 14px;
    align-items: flex-start;
    transform: translateY(22px) scale(.98);
    opacity: 0;
    transition: .28s ease;
    box-shadow: var(--shadow);
    pointer-events: auto;
}

.vivid-toast.show {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.vivid-toast.success {
    background: linear-gradient(135deg, #0e8f39, #075f28);
    border: 1px solid rgba(0,255,90,.35);
}

.vivid-toast.danger {
    background: linear-gradient(135deg, #ad1111, #5c0505);
    border: 1px solid rgba(255,70,70,.45);
}

.vivid-toast.info {
    background: linear-gradient(135deg, #145b9f, #0b345e);
    border: 1px solid rgba(85,167,255,.42);
}

.toast-icon {
    width: 29px;
    height: 29px;
    min-width: 29px;
    border-radius: 50%;
    background: rgba(255,255,255,.18);
    display: grid;
    place-items: center;
    font-weight: 950;
}

.vivid-toast strong {
    display: block;
    margin-bottom: 4px;
}

.vivid-toast p {
    margin: 0;
    line-height: 1.45;
    color: rgba(255,255,255,.88);
}

/* ---------- Admin Login ---------- */

.login-wrap,
.admin-login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-card,
.admin-login-card {
    width: min(480px, 95vw);
}

.admin-login-brand {
    display: flex;
    gap: 18px;
    align-items: center;
    margin-bottom: 24px;
}

.admin-login-brand h1 {
    margin: 0;
}

.admin-login-brand p {
    margin: 6px 0 0;
    color: var(--muted);
}

.oauth-box {
    background: rgba(255,255,255,.035);
    border: 1px solid rgba(255,255,255,.075);
    border-radius: 18px;
    padding: 20px;
    margin-bottom: 20px;
}

.oauth-box h3 {
    margin-top: 0;
}

.oauth-box p {
    color: var(--muted);
}

.discord-login-btn {
    width: 100%;
    margin-top: 16px;
    padding: 14px 18px;
    background: linear-gradient(135deg, #5865F2, #3540b7);
    color: white;
}

.login-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #777;
    margin: 22px 0;
}

.login-divider::before,
.login-divider::after {
    content: "";
    height: 1px;
    flex: 1;
    background: rgba(255,255,255,.08);
}

.login-footer-note {
    margin-top: 20px;
    color: #999;
    font-size: 13px;
    line-height: 1.5;
}

.alert.danger,
.login-alert.error,
.login-alert.danger {
    background: rgba(255,0,0,.12);
    border: 1px solid rgba(255,60,60,.25);
    padding: 14px;
    border-radius: 14px;
    margin: 18px 0;
}

.login-alert.success {
    background: rgba(0,255,100,.1);
    border: 1px solid rgba(0,255,100,.22);
    padding: 14px;
    border-radius: 14px;
    margin-bottom: 18px;
}

/* ---------- Dashboard ---------- */

.dash-shell {
    display: grid;
    grid-template-columns: 300px 1fr;
    min-height: 100vh;
}

.dash-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    background: rgba(255,255,255,.032);
    padding: 28px;
    border-right: 1px solid rgba(255,255,255,.07);
    overflow-y: auto;
}

.brand-block {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-bottom: 36px;
}

.brand-block h2 {
    margin: 0;
}

.brand-block span {
    color: var(--muted);
    font-size: 13px;
}

.dash-sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dash-sidebar nav a {
    padding: 14px;
    border-radius: 14px;
    background: rgba(255,255,255,.035);
    border: 1px solid rgba(255,255,255,.06);
    color: #e7e7e7;
}

.dash-sidebar nav a.active,
.dash-sidebar nav a:hover {
    background: rgba(255,0,0,.16);
    border-color: rgba(255,70,70,.22);
}

.dash-main {
    min-width: 0;
    padding: 38px;
}

.dash-header,
.dash-header-upgraded {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 24px;
}

.dash-status-box {
    background: rgba(255,255,255,.045);
    border: 1px solid rgba(255,255,255,.085);
    padding: 14px 18px;
    border-radius: 16px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.live-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.live-dot.green {
    background: var(--green);
    box-shadow: 0 0 14px var(--green);
}

.live-dot.red {
    background: #ff3b3b;
    box-shadow: 0 0 14px #ff3b3b;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin: 28px 0;
}

.stat-card {
    min-width: 0;
}

.stat-card span {
    color: var(--muted);
    font-size: 13px;
}

.stat-card strong {
    display: block;
    margin-top: 12px;
    font-size: clamp(24px, 3vw, 34px);
}

.upgraded-stat {
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.upgraded-stat:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
    border-color: rgba(255,80,80,.20);
}

.settings-toggle-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin: 24px 0 28px;
}

.setting-toggle-card {
    margin: 0;
    padding: 18px;
    min-height: 120px;
    border-radius: 18px;
    background: rgba(255,255,255,.035);
    border: 1px solid rgba(255,255,255,.08);
    display: flex;
    align-items: flex-start;
    gap: 14px;
    cursor: pointer;
}

.setting-toggle-card input {
    width: 20px;
    height: 20px;
    margin: 2px 0 0;
    accent-color: var(--red);
}

.setting-toggle-card strong {
    display: block;
    font-size: 16px;
    margin-bottom: 8px;
}

.setting-toggle-card span {
    color: var(--muted);
    line-height: 1.5;
    font-size: 13px;
}

.clean-label {
    margin-top: 10px;
    font-weight: 800;
}

.panel-topline {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
    margin-bottom: 22px;
}

.dash-search,
.filter-select {
    width: 320px;
    max-width: 100%;
}

.dashboard-filters,
.filter-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.app-card-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.application-review-card {
    display: grid;
    grid-template-columns: 1.35fr .9fr 1.6fr auto;
    gap: 18px;
    align-items: center;
    background: rgba(255,255,255,.032);
    border: 1px solid rgba(255,255,255,.075);
    border-radius: 22px;
    padding: 22px;
    transition: transform .2s ease, border-color .2s ease, background .2s ease;
}

.application-review-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255,80,80,.22);
    background: rgba(255,255,255,.045);
}

.applicant-main {
    display: flex;
    gap: 16px;
    align-items: center;
    min-width: 0;
}

.applicant-main h3 {
    margin: 0;
    font-size: 18px;
}

.applicant-main p {
    margin: 4px 0;
    color: var(--muted);
}

.applicant-main small {
    color: var(--muted-2);
    display: block;
}

.app-avatar {
    width: 58px;
    height: 58px;
    min-width: 58px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff4444, #7d0000);
    display: grid;
    place-items: center;
    font-size: 23px;
    font-weight: 900;
    overflow: hidden;
}

.app-badges {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.status-pill,
.risk-pill {
    padding: 9px 13px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 850;
    width: fit-content;
    white-space: nowrap;
}

.status-pending { background: var(--yellow-soft); color: #ffd76d; }
.status-approved { background: var(--green-soft); color: #64ff9f; }
.status-denied { background: rgba(255,50,50,.14); color: #ff7777; }
.status-reviewing { background: var(--blue-soft); color: #93caff; }

.risk-low { background: var(--green-soft); color: #64ff9f; }
.risk-medium { background: var(--yellow-soft); color: #ffd76d; }
.risk-high { background: rgba(255,60,60,.14); color: #ff7777; }
.risk-unknown { background: rgba(255,255,255,.08); color: #ddd; }

.app-mini-stats {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.app-mini-stats div {
    background: rgba(255,255,255,.026);
    border: 1px solid rgba(255,255,255,.055);
    border-radius: 14px;
    padding: 11px;
    min-width: 0;
}

.app-mini-stats span {
    display: block;
    color: var(--muted-2);
    font-size: 12px;
    margin-bottom: 5px;
}

.app-mini-stats strong {
    font-size: 15px;
}

.app-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
}

/* ---------- Review Page ---------- */

.review-shell {
    width: var(--container);
    margin: 0 auto;
    padding: 40px 0;
}

.review-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 26px;
}

.review-status-card {
    background: rgba(255,255,255,.045);
    border: 1px solid rgba(255,255,255,.085);
    border-radius: 20px;
    padding: 22px;
    min-width: 180px;
}

.review-status-card span {
    display: block;
    color: var(--muted);
    margin-bottom: 8px;
}

.review-status-card strong {
    font-size: 24px;
}

.applicant-overview {
    display: flex;
    align-items: center;
    gap: 22px;
}

.big-avatar {
    width: 96px;
    height: 96px;
    min-width: 96px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff4444, #700000);
    display: grid;
    place-items: center;
    font-size: 42px;
    font-weight: 950;
    overflow: hidden;
}

.applicant-info h2 {
    margin: 0;
}

.applicant-info p {
    margin: 8px 0;
    color: var(--muted);
}

.applicant-info small {
    color: var(--muted-2);
}

.risk-meter-card {
    margin-left: auto;
    border-radius: 20px;
    padding: 22px;
    min-width: 260px;
}

.risk-meter-card span {
    display: block;
    color: var(--muted);
    margin-bottom: 8px;
}

.risk-meter-card strong {
    display: block;
    font-size: 34px;
    margin-bottom: 10px;
}

.risk-meter-card p {
    margin: 0;
    color: var(--muted-2);
    font-size: 13px;
}

.risk-card-low { background: var(--green-soft); border: 1px solid rgba(57,255,138,.20); }
.risk-card-medium { background: var(--yellow-soft); border: 1px solid rgba(255,200,87,.22); }
.risk-card-high { background: rgba(255,60,60,.11); border: 1px solid rgba(255,60,60,.22); }
.risk-card-unknown { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.11); }

.reason-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
    margin-top: 22px;
}

.reason-card {
    padding: 17px;
    border-radius: 16px;
    font-weight: 700;
    line-height: 1.45;
}

.reason-card.good { background: var(--green-soft); border: 1px solid rgba(57,255,138,.15); }
.reason-card.warning { background: var(--yellow-soft); border: 1px solid rgba(255,200,87,.16); }
.reason-card.danger { background: rgba(255,60,60,.11); border: 1px solid rgba(255,60,60,.20); }
.reason-card.info { background: var(--blue-soft); border: 1px solid rgba(85,167,255,.20); }

.answers-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.answer-block {
    background: rgba(255,255,255,.028);
    border: 1px solid rgba(255,255,255,.065);
    border-radius: 18px;
    padding: 20px;
}

.answer-block h3 {
    color: #ff6969;
    margin-top: 0;
}

.answer-block p {
    color: #eeeeee;
    line-height: 1.75;
    white-space: pre-wrap;
    margin-bottom: 0;
}

.question-timeline,
.question-breakdown-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.question-risk-card {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 16px;
    padding: 16px;
    border-radius: 16px;
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.07);
}

.question-risk-card.medium {
    border-color: rgba(255,200,87,.22);
    background: rgba(255,200,87,.08);
}

.question-risk-card.high {
    border-color: rgba(255,70,70,.26);
    background: rgba(255,70,70,.09);
}

.question-risk-card .meta {
    color: var(--muted);
    font-size: 13px;
    margin-top: 6px;
}

.flag-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.flag-pill {
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.10);
    color: #ddd;
    padding: 6px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.flag-pill.warning {
    background: var(--yellow-soft);
    border-color: rgba(255,200,87,.18);
    color: #ffdd88;
}

.flag-pill.danger {
    background: rgba(255,70,70,.12);
    border-color: rgba(255,70,70,.22);
    color: #ff9c9c;
}

/* ---------- Replay Player ---------- */

.replay-controls,
.upgraded-replay-controls {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin: 20px 0;
}

.replay-controls select {
    width: auto;
    min-width: 130px;
    margin-top: 0;
}

.replay-box,
.upgraded-replay-box {
    background: #050507;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 18px;
    padding: 20px;
    min-height: 360px;
}

#replayMeta {
    color: #ff7373;
    margin-bottom: 14px;
    font-weight: 800;
}

#replayOutput {
    white-space: pre-wrap;
    color: #f1f1f1;
    font-family: Consolas, ui-monospace, monospace;
    line-height: 1.55;
}

.replay-timeline-wrap {
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,.08);
}

.replay-time-row {
    display: flex;
    justify-content: space-between;
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 10px;
}

.replay-progress-track {
    height: 10px;
    background: rgba(255,255,255,.08);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 20px;
}

#replayProgressFill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #ff4040, #b30000);
    border-radius: 999px;
    transition: width .15s linear;
}

.replay-feed-title {
    color: #ff7373;
    font-weight: 900;
    margin-bottom: 12px;
}

.replay-event-feed {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 260px;
    overflow-y: auto;
}

.feed-item {
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255,255,255,.04);
    color: #ddd;
    font-size: 13px;
}

.feed-item.good { background: var(--green-soft); border: 1px solid rgba(57,255,138,.15); }
.feed-item.warning { background: var(--yellow-soft); border: 1px solid rgba(255,200,87,.15); }
.feed-item.danger { background: rgba(255,50,50,.10); border: 1px solid rgba(255,50,50,.18); }

/* ---------- Decision / Admin Modals ---------- */

.decision-panel {
    margin-top: 30px;
}

.decision-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-top: 22px;
}

.decision-card {
    border: 0;
    padding: 26px;
    border-radius: 22px;
    text-align: left;
    cursor: pointer;
    color: white;
    transition: transform .2s ease, filter .2s ease;
}

.decision-card:hover {
    transform: translateY(-4px);
    filter: brightness(1.06);
}

.decision-card strong {
    display: block;
    font-size: 21px;
    margin-bottom: 9px;
}

.decision-card span {
    color: rgba(255,255,255,.84);
    line-height: 1.45;
}

.decision-card.approve { background: linear-gradient(135deg, #0b8f46, #04592b); }
.decision-card.deny { background: linear-gradient(135deg, #a01212, #5c0505); }
.decision-card.pending { background: linear-gradient(135deg, #b07b00, #6a4b00); }

.modal-backdrop,
.admin-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9998;
    display: none;
    place-items: center;
    padding: 18px;
    background: rgba(0,0,0,.68);
    backdrop-filter: blur(10px);
}

.modal-backdrop.show,
.admin-modal-backdrop.show {
    display: grid;
}

.admin-modal,
.decision-modal {
    width: min(720px, 96vw);
    max-height: 90vh;
    overflow-y: auto;
    background: #0c0e14;
    border: 1px solid rgba(255,255,255,.11);
    border-radius: 24px;
    padding: 24px;
    box-shadow: var(--shadow);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 18px;
}

.modal-header h2,
.modal-header h3 {
    margin: 0;
}

.modal-close {
    background: rgba(255,255,255,.07);
    border: 1px solid rgba(255,255,255,.10);
    color: white;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 900;
}

.template-box,
.generated-message-box {
    background: rgba(255,255,255,.035);
    border: 1px solid rgba(255,255,255,.075);
    border-radius: 16px;
    padding: 16px;
    white-space: pre-wrap;
    color: #f0f0f0;
    line-height: 1.55;
    max-height: 260px;
    overflow-y: auto;
}

.copy-row,
.modal-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
    margin-top: 16px;
}

/* ---------- Tables Legacy ---------- */

.app-table {
    margin-top: 25px;
}

.table-head,
.table-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr 100px;
    gap: 15px;
    padding: 16px;
    align-items: center;
}

.table-head {
    font-weight: 900;
    color: #ff7373;
}

.table-row {
    background: rgba(255,255,255,.03);
    margin-bottom: 10px;
    border-radius: 14px;
}

/* ---------- Responsive ---------- */

@media (max-width: 1350px) {
    .application-review-card {
        grid-template-columns: 1fr;
    }

    .app-mini-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1100px) {
    .dash-shell {
        grid-template-columns: 1fr;
    }

    .dash-sidebar {
        position: relative;
        height: auto;
        width: 100%;
        border-right: 0;
        border-bottom: 1px solid rgba(255,255,255,.07);
    }

    .dash-sidebar nav {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .stat-grid,
    .settings-toggle-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .applicant-overview {
        flex-direction: column;
        align-items: flex-start;
    }

    .risk-meter-card {
        margin-left: 0;
        width: 100%;
    }

    .decision-grid,
    .reason-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    :root {
        --container: min(100% - 22px, 1200px);
    }

    .modapp-shell,
    .review-shell {
        padding: 24px 0;
    }

    .modapp-hero {
        grid-template-columns: 1fr;
    }

    .brand-badge.large {
        width: 76px;
        height: 76px;
        min-width: 76px;
        border-radius: 22px;
        font-size: 28px;
    }

    .form-grid,
    .stat-grid,
    .settings-toggle-grid {
        grid-template-columns: 1fr;
    }

    .key-input-row {
        grid-template-columns: 1fr;
    }

    .dash-main {
        padding: 22px;
    }

    .dash-header,
    .dash-header-upgraded,
    .panel-topline,
    .review-hero {
        flex-direction: column;
        align-items: stretch;
    }

    .dash-sidebar nav {
        grid-template-columns: 1fr;
    }

    .app-mini-stats {
        grid-template-columns: 1fr;
    }

    .table-head,
    .table-row {
        grid-template-columns: 1fr;
    }

    .review-status-card,
    .dash-status-box {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .key-card,
    .application-card,
    .closed-card,
    .submitted-card,
    .panel,
    .login-card,
    .stat-card,
    .admin-login-card {
        padding: 20px;
        border-radius: 20px;
    }

    .form-actions {
        left: 10px;
        right: 10px;
        bottom: 10px;
        flex-direction: column;
    }

    .form-actions .primary-btn,
    .form-actions .ghost-btn {
        width: 100%;
    }

    #appToastArea {
        left: 12px;
        right: 12px;
        bottom: 12px;
    }

    .vivid-toast {
        min-width: 0;
        width: 100%;
    }

    .applicant-main,
    .discord-card,
    .admin-login-brand,
    .brand-block {
        align-items: flex-start;
    }

    .applicant-main {
        flex-direction: column;
    }

    .review-controls,
    .replay-controls,
    .upgraded-replay-controls,
    .copy-row,
    .modal-actions {
        flex-direction: column;
    }

    .review-controls .primary-btn,
    .review-controls .ghost-btn,
    .copy-row .primary-btn,
    .copy-row .ghost-btn,
    .modal-actions .primary-btn,
    .modal-actions .ghost-btn {
        width: 100%;
    }

    .question-risk-card {
        grid-template-columns: 1fr;
    }
}


/* Final review timeline/table polish */
select, select option { color: #fff; background: #111116; }
.activity-table-wrap { width: 100%; overflow-x: auto; }
.activity-table { width: 100%; border-collapse: collapse; min-width: 820px; }
.activity-table th, .activity-table td { padding: 13px 14px; border-bottom: 1px solid rgba(255,255,255,.08); text-align: left; vertical-align: top; }
.activity-table th { color: #ff6d6d; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.question-timeline { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.question-chip { text-align: left; border: 1px solid rgba(255,255,255,.08); color: #fff; border-radius: 16px; padding: 16px; background: rgba(255,255,255,.035); cursor: pointer; }
.question-chip strong, .question-chip span, .question-chip em { display: block; }
.question-chip span { color: #bbb; margin-top: 6px; font-size: 13px; }
.question-chip em { color: #ffca5c; margin-top: 8px; font-style: normal; font-size: 12px; }
.question-chip.risk-high { border-color: rgba(255,70,70,.35); background: rgba(255,60,60,.10); }
.question-chip.risk-medium { border-color: rgba(255,190,60,.32); background: rgba(255,180,0,.09); }
.question-chip.risk-low { border-color: rgba(80,255,150,.25); background: rgba(0,255,120,.07); }
.message-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.form-actions.left { justify-content: flex-start; gap: 12px; flex-wrap: wrap; }
.big-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.review-status-card small { display:block; color:#aaa; margin-top:8px; }
@media (max-width: 900px) { .question-timeline, .message-grid { grid-template-columns: 1fr; } }


/* ---------- Suspicious Question Graph ---------- */

.suspicion-graph-panel {
    position: relative;
}

.graph-legend {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: 13px;
    flex-wrap: wrap;
}

.legend-dot {
    width: 10px;
    height: 10px;
    display: inline-block;
    border-radius: 999px;
    margin-left: 8px;
}

.legend-dot.high { background: #ff5757; box-shadow: 0 0 12px rgba(255,87,87,.55); }
.legend-dot.medium { background: #ffc857; box-shadow: 0 0 12px rgba(255,200,87,.45); }
.legend-dot.low { background: #39ff8a; box-shadow: 0 0 12px rgba(57,255,138,.45); }

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

.suspicion-bar-card {
    position: relative;
    display: block;
    width: 100%;
    text-align: left;
    color: white;
    background: rgba(255,255,255,.035);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 18px;
    padding: 16px;
    cursor: pointer;
    transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.suspicion-bar-card:hover,
.suspicion-bar-card:focus {
    transform: translateY(-3px);
    background: rgba(255,255,255,.055);
    outline: none;
}

.suspicion-bar-card.risk-high {
    border-color: rgba(255,70,70,.32);
}

.suspicion-bar-card.risk-medium {
    border-color: rgba(255,200,87,.28);
}

.suspicion-bar-card.risk-low {
    border-color: rgba(57,255,138,.22);
}

.suspicion-bar-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 12px;
}

.suspicion-bar-top strong {
    line-height: 1.35;
}

.suspicion-bar-top span {
    padding: 6px 9px;
    border-radius: 999px;
    background: rgba(255,255,255,.08);
    color: #eee;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.suspicion-bar-card.risk-high .suspicion-bar-top span {
    background: rgba(255,70,70,.16);
    color: #ff9d9d;
}

.suspicion-bar-card.risk-medium .suspicion-bar-top span {
    background: rgba(255,200,87,.15);
    color: #ffdc86;
}

.suspicion-bar-card.risk-low .suspicion-bar-top span {
    background: rgba(57,255,138,.13);
    color: #85ffb7;
}

.suspicion-bar-track {
    height: 12px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255,255,255,.08);
    margin-bottom: 12px;
}

.suspicion-bar-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #39ff8a, #ffc857, #ff5757);
    box-shadow: 0 0 18px rgba(255,87,87,.18);
}

.suspicion-bar-card.risk-low .suspicion-bar-fill {
    background: linear-gradient(90deg, #0d8f46, #39ff8a);
}

.suspicion-bar-card.risk-medium .suspicion-bar-fill {
    background: linear-gradient(90deg, #b07b00, #ffc857);
}

.suspicion-bar-card.risk-high .suspicion-bar-fill {
    background: linear-gradient(90deg, #b90000, #ff5757);
}

.suspicion-bar-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 12px;
}

.suspicion-bar-meta span {
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.07);
    padding: 5px 8px;
    border-radius: 999px;
}

.suspicion-tooltip {
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: calc(100% + 12px);
    z-index: 40;
    display: none;
    flex-direction: column;
    gap: 6px;
    padding: 14px;
    border-radius: 16px;
    color: white;
    background: #11131c;
    border: 1px solid rgba(255,255,255,.14);
    box-shadow: var(--shadow);
    pointer-events: none;
}

.suspicion-tooltip::after {
    content: "";
    position: absolute;
    left: 28px;
    top: 100%;
    border-width: 8px;
    border-style: solid;
    border-color: #11131c transparent transparent transparent;
}

.suspicion-tooltip b {
    color: #fff;
    margin-bottom: 3px;
}

.suspicion-tooltip span {
    color: #d8dbe6;
    font-size: 13px;
}

.suspicion-tooltip em {
    margin-top: 5px;
    color: #ffcf72;
    font-style: normal;
    font-size: 12px;
}

.suspicion-bar-card:hover .suspicion-tooltip,
.suspicion-bar-card:focus .suspicion-tooltip {
    display: flex;
}

.suspicion-detail-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.suspicion-detail-grid div {
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.075);
    border-radius: 14px;
    padding: 14px;
}

.suspicion-detail-grid span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 6px;
}

.suspicion-detail-grid strong {
    font-size: 18px;
}

.suspicion-flag-box {
    margin-top: 16px;
    background: rgba(255,200,87,.08);
    border: 1px solid rgba(255,200,87,.18);
    border-radius: 16px;
    padding: 16px;
}

.suspicion-flag-box p {
    margin-bottom: 0;
    color: #ffe2a1;
}

@media (max-width: 900px) {
    .suspicion-graph,
    .suspicion-detail-grid {
        grid-template-columns: 1fr;
    }

    .suspicion-tooltip {
        display: none !important;
    }
}

/* ---------- Owner/Admin Tool Polish ---------- */
.tool-button-row,
.dash-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.admin-tools-panel {
    border-color: rgba(85,167,255,.16);
    background: linear-gradient(135deg, rgba(85,167,255,.06), rgba(255,255,255,.035));
}

.owner-warning-box,
.review-danger-zone {
    margin-top: 18px;
    padding: 18px;
    border-radius: 18px;
    background: rgba(255,60,60,.08);
    border: 1px solid rgba(255,60,60,.18);
}

.owner-warning-box strong,
.review-danger-zone strong {
    color: #ff8989;
    display: block;
    margin-bottom: 6px;
}

.inline-danger-form {
    display: grid;
    grid-template-columns: minmax(180px, 260px) auto auto auto;
    gap: 12px;
    align-items: center;
    margin-top: 14px;
}

.inline-check,
.mini-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.inline-check input,
.mini-check input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--red);
}

.active-check {
    padding: 14px 15px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255,255,255,.035);
    margin-top: 28px;
}

.danger-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border: 0;
    border-radius: 14px;
    cursor: pointer;
    font-weight: 900;
    min-height: 44px;
    padding: 14px 22px;
    color: white;
    background: linear-gradient(135deg, #ff4040, #8d0000);
    box-shadow: 0 14px 34px rgba(255,0,0,.16);
    transition: transform .18s ease, filter .18s ease;
}

.danger-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.07);
}

.admin-grid-form,
.key-edit-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.full-span {
    grid-column: 1 / -1;
}

.admin-table-list,
.key-admin-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.admin-row-card,
.key-admin-card {
    background: rgba(255,255,255,.032);
    border: 1px solid rgba(255,255,255,.075);
    border-radius: 20px;
    padding: 18px;
    display: grid;
    grid-template-columns: 1.1fr .7fr 1.3fr auto;
    gap: 16px;
    align-items: center;
}

.admin-row-card strong,
.key-admin-card strong {
    display: block;
    font-size: 17px;
    margin-bottom: 6px;
}

.admin-row-card small,
.key-meta small {
    display: block;
    color: var(--muted-2);
    margin-top: 4px;
}

.admin-row-card p {
    color: #ececf2;
    line-height: 1.55;
    margin: 0;
}

.key-admin-card {
    display: block;
}

.key-actions-clean {
    position: relative;
    bottom: auto;
    background: transparent;
    border: 0;
    backdrop-filter: none;
    padding: 0;
    margin-top: 8px;
}

.key-meta {
    margin-top: 14px;
    padding: 12px;
    border-radius: 14px;
    background: rgba(255,255,255,.025);
    border: 1px solid rgba(255,255,255,.055);
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

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

.review-admin-actions form {
    padding: 16px;
    border-radius: 16px;
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.075);
}

@media (max-width: 1100px) {
    .inline-danger-form,
    .admin-row-card,
    .review-admin-actions {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .admin-grid-form,
    .key-edit-grid {
        grid-template-columns: 1fr;
    }

    .tool-button-row,
    .dash-filter-row {
        flex-direction: column;
        align-items: stretch;
    }

    .tool-button-row .ghost-btn,
    .dash-filter-row .primary-btn,
    .dash-filter-row select,
    .dash-filter-row input {
        width: 100%;
    }
}
