
:root {
    --bg: #071019;
    --panel: rgba(15, 29, 42, .78);
    --panel-solid: #0f1d2a;
    --panel-2: #142536;
    --text: #f5f8fb;
    --muted: #91a5b7;
    --line: rgba(255,255,255,.09);
    --blue: #45a9ff;
    --blue-2: #74c1ff;
    --cyan: #44e2d4;
    --green: #45d483;
    --red: #ff6675;
    --amber: #ffbf5f;
    --radius: 18px;
    --shadow: 0 20px 70px rgba(0,0,0,.28);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 10% 0%, rgba(69,169,255,.12), transparent 28rem),
        radial-gradient(circle at 90% 15%, rgba(68,226,212,.07), transparent 25rem),
        var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--blue-2); }

.ambient {
    position: fixed;
    width: 380px;
    height: 380px;
    filter: blur(100px);
    opacity: .08;
    pointer-events: none;
    z-index: -1;
}
.ambient-one { background: var(--blue); top: 20%; left: -120px; }
.ambient-two { background: var(--cyan); right: -120px; top: 50%; }

.topbar {
    width: min(1180px, calc(100% - 36px));
    margin: 18px auto 0;
    min-height: 72px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    padding: 12px 16px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(7,16,25,.75);
    backdrop-filter: blur(18px);
    position: sticky;
    top: 12px;
    z-index: 20;
}

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark {
    width: 42px; height: 42px; display: grid; place-items: center;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--blue), var(--cyan));
    color: #03111d; font-weight: 900;
}
.brand strong, .brand small { display: block; }
.brand small { color: var(--muted); font-size: .72rem; margin-top: 1px; }

.navlinks { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.navlinks a { color: #dbe7f0; font-size: .92rem; }
.navlinks a:hover { color: #fff; }
.navlinks .nav-muted { color: var(--muted); }

.shell {
    width: min(1180px, calc(100% - 36px));
    margin: 0 auto;
    padding: 72px 0 90px;
}

.glass {
    background: var(--panel);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.hero {
    min-height: 560px;
    display: grid;
    grid-template-columns: 1.14fr .86fr;
    gap: 54px;
    align-items: center;
}

.hero h1, .page-heading h1, .detail-copy h1 {
    font-size: clamp(2.7rem, 6vw, 5.8rem);
    line-height: .96;
    letter-spacing: -.055em;
    margin: 14px 0 22px;
}

.hero h1 span {
    display: block;
    color: transparent;
    background: linear-gradient(90deg, var(--blue-2), var(--cyan));
    -webkit-background-clip: text;
    background-clip: text;
}

.hero p {
    max-width: 690px;
    color: #afc0cf;
    font-size: 1.08rem;
    margin: 0 0 28px;
}

.eyebrow {
    color: var(--blue-2);
    text-transform: uppercase;
    letter-spacing: .15em;
    font-size: .76rem;
    font-weight: 800;
}

.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.button {
    border: 0;
    cursor: pointer;
    color: #04111c;
    font-weight: 850;
    border-radius: 12px;
    padding: 13px 18px;
    background: linear-gradient(135deg, var(--blue), var(--cyan));
    display: inline-flex;
    justify-content: center;
    align-items: center;
    transition: transform .16s ease, box-shadow .16s ease;
}
.button:hover { color: #04111c; transform: translateY(-1px); box-shadow: 0 10px 28px rgba(69,169,255,.2); }
.button.small { padding: 9px 12px; border-radius: 10px; }
.button.big { padding: 16px 18px; }
.button.full { width: 100%; }
.button.ghost {
    background: rgba(255,255,255,.04);
    color: var(--text);
    border: 1px solid var(--line);
}
.button.success { background: var(--green); }
.button.danger-button { background: var(--red); color: #21040a; }
.button:disabled { opacity: .4; cursor: not-allowed; transform: none; }

.hero-panel {
    border-radius: 24px;
    padding: 24px;
    transform: rotate(1deg);
}

.search-kicker { font-size: .78rem; color: var(--muted); display: block; margin-bottom: 10px; }
.search-orbit form { display: flex; gap: 8px; }
.search-orbit input { flex: 1; }

.stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 20px 0;
}
.stat-grid > div {
    background: rgba(255,255,255,.035);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 16px;
}
.stat-grid strong { display: block; font-size: 1.55rem; }
.stat-grid span { color: var(--muted); font-size: .78rem; }

.trust-note {
    display: flex; gap: 12px; align-items: center;
    padding: 15px;
    border-radius: 14px;
    background: rgba(69,212,131,.07);
    border: 1px solid rgba(69,212,131,.16);
}
.trust-note .shield {
    width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center;
    border-radius: 50%; background: rgba(69,212,131,.15); color: var(--green); font-weight: 900;
}
.trust-note strong, .trust-note span { display: block; }
.trust-note span { color: #9fb9aa; font-size: .82rem; }

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 24px;
    margin: 66px 0 20px;
}
.section-head h2 { font-size: 2rem; letter-spacing: -.035em; margin: 5px 0 0; }
.section-head > a { color: var(--blue-2); font-size: .9rem; }

.card-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.livery-card {
    overflow: hidden;
    border: 1px solid var(--line);
    background: rgba(15,29,42,.72);
    border-radius: var(--radius);
    transition: transform .16s ease, border-color .16s ease;
}
.livery-card:hover { transform: translateY(-3px); border-color: rgba(116,193,255,.28); }

.card-image {
    position: relative;
    aspect-ratio: 16/10;
    display: block;
    background: #0b1620;
    overflow: hidden;
}
.card-image img, .detail-preview img, .moderation-preview img {
    width: 100%; height: 100%; object-fit: cover; display: block;
}
.placeholder-art {
    width: 100%; height: 100%; min-height: 160px;
    display: grid; place-items: center;
    background:
        linear-gradient(135deg, rgba(69,169,255,.14), rgba(68,226,212,.04)),
        repeating-linear-gradient(135deg, transparent, transparent 14px, rgba(255,255,255,.018) 14px, rgba(255,255,255,.018) 28px);
}
.placeholder-art span {
    width: 64px; height: 64px; display: grid; place-items: center;
    border-radius: 18px; color: var(--blue-2); font-weight: 900;
    border: 1px solid rgba(116,193,255,.25);
    background: rgba(69,169,255,.07);
}
.placeholder-art.large { min-height: 440px; }

.pill {
    position: absolute;
    top: 12px; right: 12px;
    font-size: .68rem;
    font-weight: 800;
    padding: 6px 9px;
    border-radius: 999px;
    color: #dff6ff;
    background: rgba(4,17,28,.82);
    border: 1px solid rgba(255,255,255,.1);
    backdrop-filter: blur(10px);
}
.pill.static { position: static; display: inline-flex; }
.pill.warning { background: rgba(255,191,95,.14); color: var(--amber); }

.card-body { padding: 15px; }
.card-meta { color: var(--blue-2); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.card-body h3 { margin: 5px 0 4px; font-size: 1.05rem; }
.card-body p { margin: 0; color: var(--muted); font-size: .84rem; }
.card-footer {
    display: flex; justify-content: space-between; gap: 8px;
    border-top: 1px solid var(--line);
    margin-top: 14px; padding-top: 12px;
    font-size: .74rem; color: var(--muted);
}

.feature-band {
    margin: 70px 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border: 1px solid var(--line);
    border-radius: 22px;
    overflow: hidden;
}
.feature-band > div { padding: 26px; background: rgba(255,255,255,.02); }
.feature-band > div + div { border-left: 1px solid var(--line); }
.feature-icon { font-size: 1.6rem; }
.feature-band h3 { margin: 10px 0 5px; }
.feature-band p { margin: 0; color: var(--muted); font-size: .88rem; }

.page-heading { margin-bottom: 28px; max-width: 850px; }
.page-heading h1 { font-size: clamp(2.5rem, 5vw, 4.4rem); }
.page-heading p { color: var(--muted); max-width: 720px; margin: 0; }
.split-heading { max-width: none; display: flex; justify-content: space-between; align-items: end; gap: 20px; }

.filter-bar {
    display: grid;
    grid-template-columns: 1.5fr repeat(5, minmax(120px, .75fr)) auto;
    gap: 8px;
    padding: 12px;
    border-radius: 16px;
}
input, select, textarea {
    width: 100%;
    background: #091621;
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 12px 13px;
    outline: none;
    font: inherit;
}
input:focus, select:focus, textarea:focus { border-color: rgba(116,193,255,.52); box-shadow: 0 0 0 3px rgba(69,169,255,.08); }
textarea { resize: vertical; }

.results-line { margin: 22px 0 13px; color: var(--muted); font-size: .85rem; }
.results-line strong { color: var(--text); }

.empty-state {
    padding: 44px;
    border-radius: var(--radius);
    border: 1px dashed rgba(255,255,255,.12);
    background: rgba(255,255,255,.015);
    color: var(--muted);
    text-align: center;
}
.empty-state h3 { color: var(--text); margin-top: 0; }
.empty-state.wide { grid-column: 1 / -1; }

.auth-shell { min-height: 62vh; display: grid; place-items: center; }
.form-card {
    width: 100%;
    max-width: 720px;
    padding: 28px;
    border-radius: 20px;
}
.form-card h1 { margin: 5px 0 22px; font-size: 2.2rem; }
.form-card h2 { margin-top: 0; }
.form-card label { display: block; color: #cbd9e4; font-size: .84rem; font-weight: 700; margin-bottom: 15px; }
.form-card label input, .form-card label select, .form-card label textarea { margin-top: 7px; }
.muted { color: var(--muted); }
.center { text-align: center; }

.narrow { max-width: 760px; margin: 0 auto; }
.narrow-wide { max-width: 920px; margin: 0 auto; }

.status-card {
    border-radius: 15px;
    padding: 16px 18px;
    margin-bottom: 14px;
}
.status-card strong, .status-card span { display: block; }
.status-card span { color: var(--muted); font-size: .85rem; margin-top: 3px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-grid .span-2 { grid-column: 1 / -1; }

.permission-checks {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin: 8px 0 18px;
}
.permission-checks label { margin: 0; font-weight: 600; }
.permission-checks input { width: auto; margin-right: 6px; }

.upload-notice {
    color: var(--muted);
    font-size: .82rem;
    padding: 13px;
    background: rgba(255,255,255,.025);
    border: 1px solid var(--line);
    border-radius: 11px;
    margin-bottom: 16px;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 18px;
}
.dashboard-stats > * {
    border-radius: 16px;
    padding: 18px;
}
.dashboard-stats strong { display: block; font-size: 1.7rem; }
.dashboard-stats span { color: var(--muted); font-size: .78rem; }
.stat-link:hover { border-color: rgba(116,193,255,.32); }

.table-card { border-radius: 18px; overflow: hidden; }
.table-head { padding: 16px 18px; border-bottom: 1px solid var(--line); }
.table-head h2 { margin: 0; font-size: 1.1rem; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 14px 18px; border-bottom: 1px solid var(--line); font-size: .86rem; }
th { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; }
tr:last-child td { border-bottom: 0; }

.status {
    display: inline-flex;
    padding: 5px 8px;
    border-radius: 999px;
    font-size: .7rem;
    font-weight: 800;
}
.status.approved { background: rgba(69,212,131,.12); color: var(--green); }
.status.pending { background: rgba(255,191,95,.12); color: var(--amber); }
.status.rejected { background: rgba(255,102,117,.12); color: var(--red); }

.detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 24px;
    align-items: start;
}
.detail-preview { border-radius: 22px; overflow: hidden; min-height: 420px; }
.detail-preview img { aspect-ratio: 16 / 10; }
.detail-copy { padding: 26px 6px 0; }
.detail-copy h1 { font-size: clamp(2.5rem, 5vw, 4.6rem); }
.lead { color: #b1c0cd; font-size: 1rem; white-space: pre-line; }
.badge-row { display: flex; gap: 7px; flex-wrap: wrap; }

.permission-grid { display: flex; gap: 8px; flex-wrap: wrap; }
.permission-grid span {
    padding: 8px 10px; border-radius: 9px; font-size: .8rem; border: 1px solid var(--line);
}
.permission-grid .ok { color: var(--green); background: rgba(69,212,131,.06); }
.permission-grid .no { color: #d7a7ad; background: rgba(255,102,117,.04); }
.permission-grid .neutral { color: var(--muted); }

.detail-sidebar {
    padding: 20px;
    border-radius: 20px;
    position: sticky;
    top: 105px;
}
.creator-row { display: flex; align-items: center; gap: 10px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.creator-row small, .creator-row strong { display: block; }
.creator-row small { color: var(--muted); }
.avatar {
    width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 auto;
    border-radius: 12px; background: linear-gradient(135deg, rgba(69,169,255,.25), rgba(68,226,212,.12));
    color: var(--blue-2); border: 1px solid rgba(116,193,255,.22); font-weight: 900;
}
.avatar.xl { width: 74px; height: 74px; border-radius: 20px; font-size: 1.55rem; }

dl { margin: 8px 0 20px; }
dl > div { padding: 12px 0; border-bottom: 1px solid var(--line); }
dt { color: var(--muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; }
dd { margin: 3px 0 0; font-size: .9rem; }
.download-note { display: block; text-align: center; color: var(--muted); margin-top: 9px; }

.creator-hero {
    display: flex; align-items: center; gap: 18px;
    padding: 24px; border-radius: 20px; margin-bottom: 24px;
}
.creator-hero h1 { margin: 2px 0; font-size: 2.4rem; }
.creator-hero p { margin: 0; color: var(--muted); }

.flash-stack { margin-bottom: 18px; }
.flash { padding: 13px 15px; border-radius: 12px; margin-bottom: 8px; border: 1px solid var(--line); }
.flash.success { background: rgba(69,212,131,.09); color: #b7f4d1; }
.flash.danger { background: rgba(255,102,117,.09); color: #ffc1c8; }
.flash.warning { background: rgba(255,191,95,.09); color: #ffe1b0; }
.flash.info { background: rgba(69,169,255,.09); color: #cae8ff; }

.two-column { display: grid; grid-template-columns: 360px 1fr; gap: 18px; align-items: start; }
.text-button { border: 0; background: none; color: var(--blue-2); cursor: pointer; padding: 0; }

.admin-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.action-card { padding: 22px; border-radius: 16px; }
.action-card strong, .action-card span { display: block; }
.action-card span { color: var(--muted); margin-top: 5px; font-size: .86rem; }

.tab-links { display: flex; gap: 8px; }
.tab-links a { padding: 8px 11px; border-radius: 9px; border: 1px solid var(--line); color: var(--muted); }
.tab-links a.active { color: var(--text); background: rgba(69,169,255,.08); border-color: rgba(116,193,255,.25); }

.moderation-list { display: grid; gap: 14px; }
.moderation-card {
    display: grid;
    grid-template-columns: 200px 1fr 250px;
    gap: 18px;
    align-items: center;
    padding: 14px;
    border-radius: 17px;
}
.moderation-preview { aspect-ratio: 16/10; overflow: hidden; border-radius: 12px; }
.moderation-copy h2 { margin: 6px 0; }
.moderation-copy p { margin: 2px 0; }
.moderation-actions textarea { margin-bottom: 7px; }
.moderation-actions .button { width: 100%; margin-top: 6px; }

.designer-app {
    display: flex; justify-content: space-between; gap: 20px;
    padding: 22px; border-radius: 17px;
}
.designer-app h2 { margin: 8px 0 4px; }
.designer-app p { color: #b8c6d1; max-width: 800px; white-space: pre-line; }
.app-meta { display: flex; gap: 12px; color: var(--muted); font-size: .83rem; }
.stack-actions { min-width: 170px; }
.stack-actions .button { width: 100%; margin-bottom: 8px; }

.vehicle-note { margin-top: 8px !important; }

footer {
    width: min(1180px, calc(100% - 36px));
    margin: 0 auto 28px;
    display: flex;
    justify-content: space-between;
    gap: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: .78rem;
}
footer strong, footer span { display: block; }

@media (max-width: 1040px) {
    .card-grid { grid-template-columns: repeat(3, 1fr); }
    .filter-bar { grid-template-columns: repeat(3, 1fr); }
    .filter-bar input { grid-column: 1 / -1; }
    .dashboard-stats { grid-template-columns: repeat(3, 1fr); }
    .moderation-card { grid-template-columns: 160px 1fr; }
    .moderation-actions { grid-column: 1 / -1; }
}

@media (max-width: 820px) {
    .topbar { position: static; }
    .brand small { display: none; }
    .hero { grid-template-columns: 1fr; gap: 24px; min-height: 0; }
    .hero-panel { transform: none; }
    .card-grid { grid-template-columns: repeat(2, 1fr); }
    .feature-band { grid-template-columns: 1fr; }
    .feature-band > div + div { border-left: 0; border-top: 1px solid var(--line); }
    .detail-grid { grid-template-columns: 1fr; }
    .detail-sidebar { position: static; }
    .two-column { grid-template-columns: 1fr; }
    .admin-links { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
    .topbar { width: min(100% - 20px, 1180px); align-items: flex-start; }
    .navlinks { gap: 10px; justify-content: flex-end; }
    .navlinks a:not(.button) { font-size: .82rem; }
    .shell { width: min(100% - 22px, 1180px); padding-top: 46px; }
    .hero h1 { font-size: 3.1rem; }
    .search-orbit form { display: grid; }
    .stat-grid { grid-template-columns: 1fr; }
    .card-grid { grid-template-columns: 1fr; }
    .section-head, .split-heading, footer { align-items: flex-start; flex-direction: column; }
    .filter-bar { grid-template-columns: 1fr; }
    .filter-bar input { grid-column: auto; }
    .dashboard-stats { grid-template-columns: repeat(2, 1fr); }
    .form-grid { grid-template-columns: 1fr; }
    .form-grid .span-2 { grid-column: auto; }
    .moderation-card { grid-template-columns: 1fr; }
    .designer-app { flex-direction: column; }
}

/* Admin user management */
.admin-user-search {
    display: flex;
    gap: 8px;
    width: min(430px, 100%);
}
.admin-user-search input { min-width: 0; }
.user-admin-layout { grid-template-columns: 330px minmax(0, 1fr); }
.user-list { display: grid; gap: 12px; }
.user-control-card {
    border-radius: 17px;
    padding: 18px;
    display: grid;
    gap: 16px;
}
.user-control-main { display: flex; gap: 12px; align-items: center; min-width: 0; }
.user-control-main > div:last-child { min-width: 0; }
.user-title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.user-title-row h3 { margin: 0; }
.user-control-main p { margin: 3px 0; color: #bdcad5; overflow-wrap: anywhere; }
.user-control-main small { color: var(--muted); }
.role-badge {
    display: inline-flex;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid var(--line);
    color: var(--muted);
    font-size: .66rem;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.role-badge.role-admin { color: #ffc5ce; background: rgba(255,102,117,.08); }
.role-badge.role-moderator { color: #ffe0a8; background: rgba(255,191,95,.08); }
.role-badge.role-trusted_designer { color: #baf2ff; background: rgba(68,226,212,.08); }
.role-badge.role-designer { color: #cfe9ff; background: rgba(69,169,255,.08); }
.user-control-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}
.user-control-actions form { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; }
.user-control-actions label { color: var(--muted); font-size: .72rem; font-weight: 700; }
.user-control-actions label input,
.user-control-actions label select { margin-top: 5px; }

@media (max-width: 900px) {
    .user-admin-layout { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
    .admin-user-search { width: 100%; }
    .user-control-actions { grid-template-columns: 1fr; }
    .user-control-actions form { grid-template-columns: 1fr; }
}
