:root {
    color-scheme: dark;
    --bg: #081426;
    --sidebar: #071124;
    --surface: #0d1b30;
    --surface-raised: #10213a;
    --line: #1d2c43;
    --line-bright: #293b55;
    --text: #e9f0f7;
    --muted: #8b9bb0;
    --teal: #17c7a2;
    --teal-dark: #0d9e84;
    --red: #f47f86;
    --amber: #f0c474;
    font-family: 'Segoe UI', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--bg); }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 5; display: flex; flex-direction: column;
    width: 248px; padding: 27px 17px 18px; background: var(--sidebar); border-right: 1px solid #102039;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 5px 10px 30px; color: var(--teal); font: 700 18px 'Segoe UI', Arial, sans-serif; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 13px; background: linear-gradient(145deg, #1cd4ad, #0e8d8a); color: #06221f; font: 800 13px 'Segoe UI', Arial, sans-serif; box-shadow: 0 6px 20px #10b79620; }
.side-label { padding: 14px 10px 9px; color: #73839a; font-size: 10px; font-weight: 700; letter-spacing: .12em; }
.side-nav { display: grid; gap: 5px; }
.side-nav a, .nav-link { display: flex; align-items: center; gap: 13px; min-height: 43px; padding: 0 11px; border: 1px solid transparent; border-radius: 9px; color: #b4c1cf; font-size: 14px; font-weight: 500; transition: .18s ease; }
.side-nav a:hover, .nav-link:hover { background: #0d1c31; color: var(--text); }
.side-nav a.active { border-color: #123a3b; background: #0a292f; color: #46d9bb; }
.nav-icon { width: 18px; color: var(--teal-dark); font-size: 19px; line-height: 1; text-align: center; }
.sidebar-bottom { margin-top: auto; border-top: 1px solid var(--line); padding-top: 14px; }
.profile { display: flex; align-items: center; gap: 10px; padding: 7px 8px 13px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.avatar-fallback { display: grid; place-items: center; background: #163e47; color: #69e0c6; font-weight: 700; }
.profile-copy { display: grid; gap: 2px; min-width: 0; }
.profile-copy strong { overflow: hidden; max-width: 150px; color: #dce6f1; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.profile-copy span { color: var(--muted); font-size: 11px; }
.logout-form { margin: 0; }
.nav-link { width: 100%; background: transparent; border: 0; cursor: pointer; text-align: left; }

.main { min-height: 100vh; margin-left: 248px; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; justify-content: space-between; min-height: 69px; padding: 0 50px; border-bottom: 1px solid var(--line); }
.crumb { color: #93a3b9; font-size: 12px; }
.crumb span { margin: 0 8px; color: #43526a; }
.signed-in { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.signed-in strong { color: #dce6f1; font-weight: 600; }
.rank-pill { margin-left: 4px; padding: 5px 9px; border: 1px solid #15443f; border-radius: 20px; background: #0a292b; color: #45d2b2; font-size: 10px; }
.content { width: min(1280px, 100%); flex: 1; margin: 0 auto; padding: 40px 50px 54px; }
.footer { display: flex; justify-content: space-between; margin: 0 50px; padding: 17px 0 24px; border-top: 1px solid var(--line); color: #76879e; font-size: 11px; }

.hero { position: relative; overflow: hidden; min-height: 330px; margin-bottom: 48px; padding: 47px 48px; border: 1px solid #213750; border-radius: 16px; background: radial-gradient(ellipse at 83% 20%, #10393a 0, #10233a 28%, #0d1b30 62%); }
.hero > *:not(.hero-orb) { position: relative; z-index: 1; }
.eyebrow { color: #59d5b8; font-size: 10px; font-weight: 700; letter-spacing: .13em; }
.status-dot { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 10px #17c7a277; }
.hero h1, .auth-card h1 { margin: 18px 0 12px; font: 800 clamp(32px, 4vw, 48px)/1.14 'Segoe UI', Arial, sans-serif; letter-spacing: -.045em; }
.hero h1 span, .auth-card h1 span { color: #40d4b5; }
.hero p { max-width: 500px; margin: 0; color: #a2b1c3; font-size: 14px; line-height: 1.75; }
.hero-actions { display: flex; align-items: center; gap: 22px; margin-top: 25px; }
.hero-orb { position: absolute; border: 1px solid #29c9a51c; border-radius: 50%; }
.orb-one { width: 360px; height: 360px; top: -112px; right: 8%; box-shadow: 0 0 0 38px #2bc4a309, 0 0 0 82px #2bc4a306; }
.orb-two { width: 150px; height: 150px; top: 81px; right: 20%; background: radial-gradient(circle, #20c5a51a, transparent 70%); }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 17px; border: 1px solid var(--teal); border-radius: 9px; background: var(--teal); color: #06251f; font-weight: 700; font-size: 13px; cursor: pointer; transition: .18s ease; }
.button:hover { transform: translateY(-1px); background: #34dbb8; border-color: #34dbb8; }
.button-small { min-height: 34px; padding: 0 12px; font-size: 12px; }
.button-outline { border-color: var(--line-bright); background: transparent; color: #c0ccda; }
.button-outline:hover { border-color: var(--teal); background: #0b2c31; color: #71e0c7; }
.button-danger { border-color: #823f4c; background: #672c3b; color: #ffe0e0; }
.button-danger:hover { border-color: #b74b5b; background: #803345; }
.text-link { color: #73d8c1; font-size: 13px; font-weight: 600; }
.text-link span { margin-left: 4px; }
.section-head, .page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 21px; }
.section-head h2, .page-heading h1 { margin: 7px 0 4px; font: 700 24px 'Segoe UI', Arial, sans-serif; letter-spacing: -.025em; }
.section-head p, .page-heading p { margin: 0; font-size: 13px; }
.search-form { display: flex; gap: 8px; }
.search-form input { width: 230px; }
input, textarea, select { width: 100%; min-height: 42px; padding: 10px 12px; border: 1px solid #293951; border-radius: 8px; outline: none; background: #09172a; color: var(--text); font-size: 13px; }
input:focus, textarea:focus, select:focus { border-color: #1caa91; box-shadow: 0 0 0 3px #17c7a21b; }
input::placeholder, textarea::placeholder { color: #60718a; }
textarea { resize: vertical; line-height: 1.65; }
select { color: #dce6ef; }
.bot-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.bot-card, .panel, .stat-card, .empty-state { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.bot-card { min-width: 0; padding: 18px; transition: border-color .18s ease, transform .18s ease; }
.bot-card:hover { transform: translateY(-2px); border-color: #31505c; }
.bot-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bot-monogram { display: grid; place-items: center; flex: 0 0 auto; width: 42px; height: 42px; border: 1px solid #20524e; border-radius: 13px; background: linear-gradient(145deg, #164440, #123344); color: #71e2c8; font: 700 17px 'Segoe UI', Arial, sans-serif; }
.badge { display: inline-flex; align-items: center; min-height: 23px; padding: 3px 8px; border: 1px solid transparent; border-radius: 20px; font-size: 10px; font-weight: 600; white-space: nowrap; }
.badge-approved { border-color: #1d5146; background: #10372f; color: #6bdbb9; }
.badge-pending { border-color: #554629; background: #342c1c; color: #ebc875; }
.badge-denied { border-color: #593440; background: #3b2330; color: #f19aa2; }
.bot-card h3 { margin: 16px 0 6px; font: 700 16px 'Segoe UI', Arial, sans-serif; }
.bot-card h3 a:hover { color: #69dbc1; }
.bot-summary { min-height: 42px; margin: 0; color: #a5b2c2; font-size: 12px; line-height: 1.65; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 13px 0; }
.tag { padding: 5px 8px; border: 1px solid #21334b; border-radius: 6px; background: #112139; color: #a8b8ca; font-size: 10px; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 15px; padding-top: 13px; border-top: 1px solid var(--line); color: #8a9bb1; font-size: 11px; }
.card-foot a { color: #60d5bb; font-weight: 600; }
code { padding: 3px 6px; border: 1px solid #273a51; border-radius: 5px; background: #09172a; color: #88d9c5; font: 11px ui-monospace, SFMono-Regular, Consolas, monospace; }
.muted { color: var(--muted); }
.small { font-size: 11px; }
.empty-state { padding: 48px 20px; text-align: center; }
.empty-state h3 { margin: 12px 0 5px; font: 700 17px 'Segoe UI', Arial, sans-serif; }
.empty-state p { margin: 0 0 17px; color: var(--muted); font-size: 13px; }
.empty-icon { color: var(--teal); font-size: 28px; }
.compact { padding: 38px 20px; border: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }

.auth-wrap { display: grid; place-items: center; min-height: 65vh; }
.auth-card { width: min(450px, 100%); padding: 35px; border: 1px solid var(--line-bright); border-radius: 16px; background: linear-gradient(145deg, #102039, #0d1a2e); text-align: center; }
.brand-mark-large { width: 55px; height: 55px; margin: 0 auto 25px; border-radius: 17px; font-size: 16px; }
.auth-card h1 { margin: 14px 0; font-size: 34px; }
.auth-card > p { color: #a3b2c4; font-size: 13px; line-height: 1.75; }
.discord-button { width: 100%; margin-top: 15px; border-color: #6471d8; background: #5865d8; color: white; }
.discord-button:hover { border-color: #7884f1; background: #6773e8; }
.discord-glyph { font-size: 18px; }
.auth-card .fine-print { margin-top: 17px; color: #77889d; font-size: 10px; }

.notice { margin: 0 0 20px; padding: 12px 15px; border: 1px solid var(--line-bright); border-radius: 9px; font-size: 13px; }
.notice-success { border-color: #1d5549; background: #0d2c2b; color: #75dfc2; }
.notice-error { border-color: #603b46; background: #321f2b; color: #f3a0a4; }
.notice-warning { border-color: #65512d; background: #30291e; color: #f0cb7c; }
.page-heading { margin-bottom: 25px; }
.page-heading h1 { font-size: 29px; }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px; }
.stat-card { display: grid; gap: 8px; padding: 17px; }
.stat-card span { color: var(--muted); font-size: 11px; }
.stat-card strong { color: #e5edf6; font: 700 24px 'Segoe UI', Arial, sans-serif; }
.panel { margin-bottom: 17px; padding: 21px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 17px; }
.panel-heading h2, .form-section-title h2, .review-card h2 { margin: 0; font: 700 17px 'Segoe UI', Arial, sans-serif; }
.panel-heading p, .form-section-title p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 12px; }
th { padding: 10px 12px; border-bottom: 1px solid var(--line-bright); color: #7f90a6; font-size: 10px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
td { padding: 12px; border-bottom: 1px solid #1a293e; color: #b9c6d5; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
td strong, td small { display: block; }
td strong { color: #e1e9f2; font-weight: 600; }
td small { margin-top: 4px; color: #8292a7; font-size: 10px; }
td .denial-copy { color: #e1a1a5; }
.form-panel { padding: 0 22px; }
.form-section { padding: 24px 0; border-bottom: 1px solid var(--line); }
.form-section-title { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 20px; }
.step { display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid #1f5049; border-radius: 8px; background: #0e302f; color: #70ddc3; font-size: 11px; font-weight: 700; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.form-grid label, .form-section > label { display: grid; gap: 7px; color: #cbd5e1; font-size: 12px; font-weight: 600; }
.form-grid .full-width { grid-column: 1 / -1; }
.form-grid label small { color: #8192a7; font-size: 10px; font-weight: 400; }
.required { color: #65d9bf; }
.optional { margin-left: 5px; color: #8192a7; font: 400 11px 'Segoe UI', Arial, sans-serif; }
.form-section > label input { margin-top: 3px; }
.extra-tags { margin-top: 10px; color: #67d4bb; font-size: 11px; }
.extra-tags summary { margin-bottom: 10px; cursor: pointer; }
.extra-tags input { margin-bottom: 8px; }
.form-actions { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 19px 0; }
.queue-count { padding: 7px 11px; border: 1px solid #554629; border-radius: 30px; background: #342c1c; color: #ebc875; font-size: 11px; }
.review-list { display: grid; gap: 15px; }
.review-card { padding: 21px; }
.review-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.review-tools { display: flex; align-items: center; gap: 8px; }
.review-top h2 { margin-top: 11px; }
.review-top p { margin: 5px 0 0; font-size: 11px; }
.review-meta { display: flex; flex-wrap: wrap; gap: 10px 25px; margin: 17px 0 6px; color: #c3cfdd; font-size: 12px; }
.review-meta span { display: flex; align-items: center; gap: 8px; }
.review-meta b { color: #7e91a8; font-size: 10px; font-weight: 500; text-transform: uppercase; }
.review-card > .bot-summary { min-height: 0; margin: 12px 0 8px; }
.long-description, .detail-description { color: #c1ccda; font-size: 12px; line-height: 1.8; }
.link-row { display: flex; flex-wrap: wrap; gap: 9px 17px; margin: 15px 0; }
.link-row a { color: #69d6bd; font-size: 11px; }
.link-row a:hover { text-decoration: underline; }
.review-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.review-actions form { display: flex; align-items: center; gap: 8px; }
.review-actions select { width: 200px; }
.review-actions input[name="other_reason"] { width: 190px; }
.rank-card { padding: 16px 0; border-bottom: 1px solid var(--line); }
.rank-card:last-child { border-bottom: 0; }
.rank-name { display: flex; align-items: end; justify-content: space-between; gap: 12px; }
.rank-name label { display: grid; gap: 7px; width: min(320px, 100%); color: #aebdce; font-size: 11px; }
.permission-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 20px; margin-top: 13px; }
.check-row { display: flex; align-items: center; gap: 8px; color: #b3c1d1; font-size: 11px; cursor: pointer; }
.check-row input { width: 15px; min-height: 15px; height: 15px; margin: 0; accent-color: var(--teal); }
.inline-form { display: flex; align-items: center; gap: 8px; }
.inline-form select { width: 165px; min-height: 33px; padding: 6px 8px; font-size: 11px; }
.reason-add { margin: 0 0 15px; }
.reason-add input { max-width: 420px; }
.reason-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.reason-row > span:first-child { flex: 1; color: #bdc9d7; font-size: 12px; }
.text-button { padding: 5px 0; border: 0; background: none; color: #69d6bd; font-size: 11px; cursor: pointer; }
.text-button:hover { text-decoration: underline; }
.detail-head { display: flex; align-items: center; gap: 15px; padding-bottom: 19px; border-bottom: 1px solid var(--line); }
.detail-head > div:nth-child(2) { flex: 1; }
.bot-monogram-large { width: 58px; height: 58px; font-size: 23px; }
.detail-head h2 { margin: 8px 0 3px; font: 700 20px 'Segoe UI', Arial, sans-serif; }
.detail-head p { margin: 0; font-size: 11px; }
.detail-summary { margin: 20px 0 8px; color: #d1dce7; font-size: 15px; }
.detail-description { margin: 18px 0; }
.delete-form { margin-top: 17px; }

@media (max-width: 1100px) {
    .sidebar { width: 215px; }
    .main { margin-left: 215px; }
    .topbar { padding: 0 30px; }
    .content { padding: 32px 30px 45px; }
    .footer { margin: 0 30px; }
    .bot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .review-actions { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 700px) {
    .sidebar { position: relative; inset: auto; width: 100%; padding: 12px 15px; border-right: 0; border-bottom: 1px solid var(--line); }
    .brand { padding: 0 2px 11px; font-size: 15px; }
    .brand-mark { width: 31px; height: 31px; border-radius: 10px; font-size: 11px; }
    .side-label, .sidebar-bottom { display: none; }
    .side-nav { display: flex; gap: 5px; overflow-x: auto; }
    .side-nav a { flex: 0 0 auto; min-height: 36px; padding: 0 9px; font-size: 11px; }
    .nav-icon { width: 15px; font-size: 15px; }
    .main { margin-left: 0; min-height: calc(100vh - 100px); }
    .topbar { min-height: 49px; padding: 0 17px; }
    .crumb { font-size: 10px; }
    .signed-in { font-size: 10px; }
    .signed-in .rank-pill { display: none; }
    .content { padding: 24px 16px 34px; }
    .footer { flex-direction: column; gap: 5px; margin: 0 16px; padding: 13px 0 18px; font-size: 10px; }
    .hero { min-height: 0; margin-bottom: 32px; padding: 30px 24px; }
    .hero h1 { font-size: 35px; }
    .orb-one { right: -170px; }
    .section-head, .page-heading { align-items: flex-start; flex-direction: column; }
    .search-form { width: 100%; }
    .search-form input { flex: 1; width: 0; }
    .bot-grid { grid-template-columns: 1fr; }
    .bot-summary { min-height: 0; }
    .stat-row { gap: 7px; }
    .stat-card { padding: 12px; }
    .stat-card span { font-size: 9px; }
    .stat-card strong { font-size: 20px; }
    .panel { padding: 16px; }
    .form-panel { padding: 0 15px; }
    .form-grid { grid-template-columns: 1fr; }
    .form-grid .full-width { grid-column: auto; }
    .form-actions { align-items: flex-start; flex-direction: column; }
    .review-top { flex-direction: column; }
    .review-tools { align-items: flex-start; flex-wrap: wrap; }
    .review-actions form { align-items: stretch; flex-wrap: wrap; width: 100%; }
    .review-actions select, .review-actions input[name="other_reason"] { flex: 1 1 160px; width: auto; }
    .permission-grid { grid-template-columns: 1fr; }
    .rank-name { align-items: flex-start; flex-direction: column; }
    .inline-form { flex-wrap: wrap; }
    .reason-row { flex-wrap: wrap; }
    .reason-row > span:first-child { flex-basis: 100%; }
    .detail-head { align-items: flex-start; flex-wrap: wrap; }
    .detail-head > div:nth-child(2) { min-width: 55%; }
    .detail-head > .button { margin-left: auto; }
}
