:root {
    color-scheme: dark;
    --bg: #06090e;
    --panel: #0e141d;
    --panel-2: #121b27;
    --panel-3: #0a0f16;
    --border: #243044;
    --text: #f5f7fb;
    --muted: #8e9db1;
    --blue: #2588ff;
    --blue-2: #1268cf;
    --cyan: #5ec8ff;
    --success: #4ad79b;
    --warning: #ffc45c;
    --danger: #ff667c;
    --shadow: 0 18px 55px rgba(0,0,0,.28);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font-family: Inter, Segoe UI, Arial, sans-serif; background: radial-gradient(circle at 15% 0%, #121e31 0, var(--bg) 38%); color: var(--text); }
a { color: inherit; }
input, select, textarea, button { font: inherit; }
button { cursor: pointer; }
.layout { min-height: 100vh; display: grid; grid-template-columns: 245px minmax(0,1fr); }
.sidebar { background: rgba(9,13,20,.96); border-right: 1px solid var(--border); padding: 22px 16px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display:flex; align-items:center; gap:12px; padding: 4px 8px 22px; }
.brand-mark { width:43px; height:43px; border-radius:12px; display:grid; place-items:center; background:linear-gradient(135deg,var(--blue),var(--cyan)); font-weight:900; box-shadow:0 10px 30px rgba(37,136,255,.24); }
.brand-title { font-weight:800; font-size:18px; }
.brand-sub { color:var(--muted); font-size:11px; margin-top:2px; }
.nav-label { color:#5f6f84; font-size:10px; font-weight:800; letter-spacing:.12em; text-transform:uppercase; padding:16px 10px 7px; }
.nav a { text-decoration:none; display:flex; align-items:center; gap:10px; border-radius:10px; padding:10px 11px; color:#aebbd0; margin:3px 0; border:1px solid transparent; }
.nav a:hover { background:#101925; color:#fff; }
.nav a.active { background:linear-gradient(90deg,rgba(37,136,255,.18),rgba(37,136,255,.05)); color:#fff; border-color:rgba(37,136,255,.28); }
.nav-dot { width:8px; height:8px; border-radius:50%; background:#46576d; }
.nav a.active .nav-dot { background:var(--blue); box-shadow:0 0 12px rgba(37,136,255,.8); }
.sidebar-user { margin-top:22px; padding:12px; border:1px solid var(--border); background:#0c121b; border-radius:12px; }
.sidebar-user strong { display:block; font-size:13px; }
.sidebar-user span { color:var(--muted); font-size:11px; }
.main { min-width:0; padding:26px 30px 42px; }
.topbar { display:flex; justify-content:space-between; gap:18px; align-items:center; margin-bottom:22px; }
.topbar h1 { margin:0 0 5px; font-size:28px; }
.muted { color:var(--muted); }
.actions { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.button, button { border:0; border-radius:10px; padding:10px 14px; color:#fff; background:linear-gradient(180deg,var(--blue),var(--blue-2)); text-decoration:none; display:inline-flex; align-items:center; justify-content:center; font-weight:700; }
.button.secondary, button.secondary { background:#151f2d; border:1px solid var(--border); }
button.danger, .button.danger { background:#4f1f2a; border:1px solid #793044; }
button.ghost, .button.ghost { background:transparent; border:1px solid var(--border); color:#bec9d8; }
.panel { background:rgba(14,20,29,.96); border:1px solid var(--border); border-radius:16px; box-shadow:var(--shadow); }
.panel-head { display:flex; justify-content:space-between; gap:15px; align-items:center; padding:18px 20px; border-bottom:1px solid var(--border); }
.panel-head h2, .panel-head h3 { margin:0; }
.panel-body { padding:20px; }
.stats { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:13px; margin-bottom:20px; }
.stat { padding:17px; }
.stat strong { font-size:26px; display:block; margin-bottom:4px; }
.stat span { color:var(--muted); font-size:12px; }
.grid-2 { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; }
.grid-main { display:grid; grid-template-columns:minmax(0,1.45fr) minmax(320px,.55fr); gap:18px; }
.field { display:grid; gap:6px; margin-bottom:13px; }
.field label { color:var(--muted); font-size:12px; font-weight:650; }
input, select, textarea { width:100%; background:#090e15; color:var(--text); border:1px solid var(--border); border-radius:9px; padding:10px 11px; outline:none; }
textarea { min-height:105px; resize:vertical; }
input:focus, select:focus, textarea:focus { border-color:var(--blue); box-shadow:0 0 0 3px rgba(37,136,255,.12); }
.form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:0 12px; }
.form-grid .full { grid-column:1 / -1; }
.check-row { display:flex; gap:18px; align-items:center; flex-wrap:wrap; margin:4px 0 14px; }
.check-row label { display:flex; align-items:center; gap:7px; color:#c2ccda; font-size:12px; }
.check-row input { width:auto; }
.notice { border:1px solid; padding:11px 13px; border-radius:10px; margin-bottom:17px; }
.notice.success { border-color:rgba(74,215,155,.35); background:rgba(74,215,155,.08); color:#8ee8c2; }
.notice.error { border-color:rgba(255,102,124,.36); background:rgba(255,102,124,.08); color:#ffa0ae; }
.badge { display:inline-flex; align-items:center; border-radius:999px; padding:4px 8px; font-size:10px; font-weight:800; background:#18283e; color:#91c9ff; }
.badge.member { background:#192432; color:#c0ccda; }
.badge.premium { background:#3b2d13; color:#ffd26f; }
.badge.developer { background:#16352e; color:#75e0bf; }
.badge.admin { background:#36203f; color:#df9aff; }
.badge.hidden { background:#3c2027; color:#ff9ca9; }
.badge.featured { background:#17344b; color:#79d3ff; }
.table-scroll { overflow:auto; }
table { width:100%; border-collapse:collapse; min-width:760px; }
th, td { padding:12px 14px; text-align:left; border-bottom:1px solid #1d2736; vertical-align:top; font-size:12px; }
th { color:#7f90a7; text-transform:uppercase; letter-spacing:.07em; font-size:10px; background:#0a1018; }
tr:last-child td { border-bottom:0; }
.link { color:#7bbcff; text-decoration:none; }
.link:hover { text-decoration:underline; }
.list { display:grid; gap:10px; }
.list-item { padding:12px; border:1px solid #1d2939; background:#0b1119; border-radius:11px; display:flex; justify-content:space-between; gap:12px; align-items:center; }
.list-item strong { display:block; margin-bottom:3px; }
.small { font-size:11px; }
.login-wrap { min-height:100vh; display:grid; place-items:center; padding:25px; }
.login-card { width:min(450px,100%); padding:28px; }
hr.sep { border:0; border-top:1px solid var(--border); margin:18px 0; }
.release-card { border:1px solid #202c3d; border-radius:13px; background:#0a1018; overflow:hidden; }
.release-head { padding:14px; display:flex; justify-content:space-between; gap:12px; align-items:flex-start; }
.release-title { font-size:15px; font-weight:800; margin-bottom:5px; }
.release-meta { color:var(--muted); font-size:11px; display:flex; flex-wrap:wrap; gap:9px; }
.release-files { border-top:1px solid #202c3d; padding:10px 14px; display:grid; gap:7px; }
.file-row { display:flex; justify-content:space-between; gap:12px; align-items:center; background:#0d1520; padding:9px 10px; border-radius:9px; }
.file-name { min-width:0; }
.file-name strong { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:560px; }
.file-name span { color:var(--muted); font-size:10px; }
.empty { padding:28px; text-align:center; color:var(--muted); }
@media (max-width:1100px) {
    .stats { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .grid-main, .grid-2 { grid-template-columns:1fr; }
}
@media (max-width:820px) {
    .layout { grid-template-columns:1fr; }
    .sidebar { position:static; height:auto; border-right:0; border-bottom:1px solid var(--border); }
    .nav { display:flex; flex-wrap:wrap; gap:4px; }
    .nav-label { display:none; }
    .nav a { margin:0; }
    .main { padding:20px 16px 34px; }
    .topbar { align-items:flex-start; flex-direction:column; }
}
@media (max-width:560px) {
    .stats { grid-template-columns:1fr; }
    .form-grid { grid-template-columns:1fr; }
    .form-grid .full { grid-column:auto; }
}


/* =========================================================
   PS4Scene Control Centre 6.3
   Dashboard additions - existing admin pages remain compatible
   ========================================================= */

.sidebar {
    display: flex;
    flex-direction: column;
}

.sidebar-spacer { flex: 1; min-height: 24px; }

.nav-icon {
    width: 22px;
    height: 22px;
    display: inline-grid;
    place-items: center;
    border-radius: 7px;
    background: #111b29;
    color: #70849c;
    font-size: 12px;
    font-weight: 900;
}

.nav a:hover .nav-icon,
.nav a.active .nav-icon {
    background: rgba(37,136,255,.15);
    color: #7cc6ff;
}

.sidebar-user {
    display: grid;
    grid-template-columns: 36px minmax(0,1fr) 28px;
    align-items: center;
    gap: 10px;
    margin-top: 18px;
}

.sidebar-avatar,
.mini-avatar {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 50%;
    font-weight: 900;
    color: #dceeff;
    background: linear-gradient(145deg,#1c3555,#152438);
    border: 1px solid #315177;
}

.sidebar-avatar { width: 36px; height: 36px; }
.mini-avatar { width: 34px; height: 34px; font-size: 12px; }

.sidebar-user-copy { min-width: 0; }
.sidebar-user-copy strong,
.sidebar-user-copy span {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.sidebar-logout {
    text-decoration: none;
    color: #75879e;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 8px;
}
.sidebar-logout:hover { background:#182334; color:#fff; }

.eyebrow {
    color: #4e9cff;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .14em;
    margin-bottom: 6px;
}

.health-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border: 1px solid var(--border);
    background: #0d141e;
    border-radius: 999px;
    color: #a8b6c9;
    font-size: 11px;
    font-weight: 700;
}

.health-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--warning);
    box-shadow: 0 0 12px rgba(255,196,92,.45);
}

.health-pill.healthy .health-dot {
    background: var(--success);
    box-shadow: 0 0 12px rgba(74,215,155,.5);
}

.hero {
    min-height: 210px;
    display: grid;
    grid-template-columns: minmax(0,1fr) 330px;
    gap: 28px;
    align-items: stretch;
    padding: 28px;
    margin-bottom: 18px;
    overflow: hidden;
    position: relative;
    background:
        radial-gradient(circle at 10% 10%,rgba(37,136,255,.16),transparent 38%),
        linear-gradient(135deg,#0e1724,#0b111a 68%);
}

.hero::after {
    content: "";
    position: absolute;
    width: 260px;
    height: 260px;
    right: -90px;
    top: -120px;
    border: 1px solid rgba(94,200,255,.13);
    border-radius: 50%;
    box-shadow: 0 0 0 35px rgba(94,200,255,.025), 0 0 0 70px rgba(94,200,255,.018);
    pointer-events: none;
}

.hero-copy { align-self: center; position: relative; z-index: 1; }
.hero-copy h2 { margin: 0; font-size: clamp(25px,3vw,36px); }
.hero-copy p { color:#93a4b9; max-width:650px; line-height:1.65; margin:9px 0 19px; }

.hero-status {
    position: relative;
    z-index: 1;
    align-self: center;
    background: rgba(6,10,16,.56);
    border: 1px solid #223147;
    border-radius: 14px;
    padding: 17px;
}

.hero-status-title {
    color: #7e91a9;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .1em;
    text-transform: uppercase;
    margin-bottom: 9px;
}

.system-row {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #1d2939;
    font-size: 11px;
}
.system-row:last-child { border-bottom:0; }
.system-row span { display:flex; align-items:center; gap:8px; color:#9cacbf; }
.system-row strong { font-size:10px; color:#d8e2ee; }
.system-row i { width:7px; height:7px; border-radius:50%; }
.system-row i.ok { background:var(--success); box-shadow:0 0 10px rgba(74,215,155,.5); }
.system-row i.bad { background:var(--danger); }

.stats-primary { grid-template-columns: repeat(4,minmax(0,1fr)); }
.stats-secondary { grid-template-columns: repeat(4,minmax(0,1fr)); }

.stat:not(.compact) {
    display: flex;
    align-items: center;
    gap: 14px;
}

.stat-icon {
    width: 43px;
    height: 43px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: #142238;
    border: 1px solid #263b59;
    color: #6eb9ff;
    font-size: 16px;
    font-weight: 900;
}

.stat-icon.premium { color:#ffd370; background:#2b2414; border-color:#4b3d1c; }
.stat-icon.releases { color:#80dfbf; background:#122820; border-color:#214739; }
.stat-icon.traffic { color:#b998ff; background:#21182f; border-color:#38264f; }

.stat.compact strong { font-size:21px; }

.platform-strip {
    display: grid;
    grid-template-columns: repeat(4,minmax(0,1fr));
    gap: 12px;
    margin-bottom: 13px;
}

.platform-card {
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    min-height: 78px;
    background: linear-gradient(145deg,#0d151f,#0b1119);
}

.platform-card strong {
    display: block;
    font-size: 22px;
    margin-top: 7px;
}

.platform-label {
    color: #aebcd0;
    font-size: 11px;
    font-weight: 800;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0,1.35fr) minmax(320px,.65fr);
    gap: 18px;
    margin-top: 18px;
}

.dashboard-grid-lower {
    grid-template-columns: repeat(2,minmax(0,1fr));
}

.list-main { min-width: 0; }
.user-line { display:flex; align-items:center; gap:10px; min-width:0; }

.rank-list { display:grid; }
.rank-item {
    display: grid;
    grid-template-columns: 32px minmax(0,1fr) auto;
    align-items: center;
    gap: 11px;
    padding: 11px 0;
    border-bottom: 1px solid #1d2939;
}
.rank-item:last-child { border-bottom:0; }
.rank-number {
    width: 28px;
    height: 28px;
    display:grid;
    place-items:center;
    border-radius:8px;
    background:#121d2b;
    color:#7591b0;
    font-size:11px;
    font-weight:900;
}
.rank-copy { min-width:0; }
.rank-copy strong { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.rank-copy span { display:block; color:var(--muted); font-size:10px; margin-top:3px; }
.rank-value { color:#7dc5ff; font-size:12px; }

.payment-meta {
    display:grid;
    justify-items:end;
    gap:5px;
    font-size:11px;
}
.badge.payment-completed { background:#12372d; color:#74dfb9; }
.badge.payment-created,
.badge.payment-awaiting_approval { background:#3b3017; color:#ffd16d; }
.badge.payment-failed,
.badge.payment-cancelled { background:#3c2027; color:#ff9ca9; }

.activity-panel { margin-top:18px; }
.activity-summary { color:#73869e; font-size:10px; font-weight:700; }
.activity-status { background:#172538; color:#9dc7ef; }

.small-button { padding:7px 10px; font-size:10px; }

.admin-footer {
    display:flex;
    justify-content:space-between;
    gap:15px;
    margin-top:24px;
    padding:14px 3px 0;
    color:#596b82;
    font-size:10px;
    border-top:1px solid #172131;
}

.login-brand { padding:0 0 14px; }
.login-copy { color:var(--muted); font-size:12px; line-height:1.6; margin:0 0 20px; }
.login-button { width:100%; margin-top:6px; }

@media (max-width: 1280px) {
    .stats-secondary { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 1100px) {
    .hero { grid-template-columns:1fr; }
    .platform-strip { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .dashboard-grid, .dashboard-grid-lower { grid-template-columns:1fr; }
}

@media (max-width: 700px) {
    .stats-primary, .stats-secondary, .platform-strip { grid-template-columns:1fr; }
    .hero { padding:20px; }
    .hero-status { width:100%; }
    .admin-footer { flex-direction:column; }
}


/* =========================================================
   PS4Scene Admin 7.0 - unified control centre
   ========================================================= */

html { background: var(--bg); }
body { min-height:100vh; }
.layout, .app-shell, .admin-shell {
    min-height:100vh;
    display:grid;
    grid-template-columns:245px minmax(0,1fr);
}
.main, .content {
    min-width:0;
    padding:26px 30px 42px;
}
.admin-shell > .content, .app-shell > .content { width:auto; max-width:none; margin:0; }

.admin-sidebar {
    display:flex;
    flex-direction:column;
    width:auto;
    min-width:0;
    padding:18px 14px;
    overflow-x:hidden;
    transition:padding .16s ease;
}
.admin-brand { padding:4px 4px 18px; position:relative; min-height:52px; }
.brand-copy { min-width:0; transition:opacity .12s ease; }
.sidebar-toggle {
    margin-left:auto;
    width:30px;
    height:30px;
    border-radius:8px;
    padding:0;
    flex:0 0 auto;
    background:#111a27;
    border:1px solid var(--border);
    color:#8597ae;
}
.sidebar-toggle:hover { background:#172235; color:#fff; }
.sidebar-spacer { flex:1; min-height:18px; }
.nav-icon {
    width:23px;
    height:23px;
    flex:0 0 23px;
    display:grid;
    place-items:center;
    border-radius:7px;
    background:#111b29;
    color:#70849c;
    font-size:11px;
    font-weight:900;
}
.nav a:hover .nav-icon, .nav a.active .nav-icon { background:rgba(37,136,255,.15); color:#7cc6ff; }
.nav-text { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.sidebar-user {
    display:grid;
    grid-template-columns:36px minmax(0,1fr) 28px;
    align-items:center;
    gap:9px;
    margin-top:12px;
}
.sidebar-avatar, .mini-avatar {
    display:grid;
    place-items:center;
    border-radius:50%;
    font-weight:900;
    background:linear-gradient(145deg,#1c3555,#152438);
    border:1px solid #315177;
    color:#dceeff;
}
.sidebar-avatar { width:36px; height:36px; }
.mini-avatar { width:34px; height:34px; font-size:12px; flex:0 0 34px; }
.sidebar-user-copy { min-width:0; }
.sidebar-user-copy strong, .sidebar-user-copy span { display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.sidebar-logout { width:28px; height:28px; display:grid; place-items:center; text-decoration:none; border-radius:8px; color:#75879e; }
.sidebar-logout:hover { background:#182334; color:#fff; }

.admin-sidebar-collapsed .layout,
.admin-sidebar-collapsed .app-shell,
.admin-sidebar-collapsed .admin-shell { grid-template-columns:76px minmax(0,1fr); }
.admin-sidebar-collapsed .admin-sidebar { padding-left:10px; padding-right:10px; }
.admin-sidebar-collapsed .brand-copy,
.admin-sidebar-collapsed .nav-label,
.admin-sidebar-collapsed .nav-text,
.admin-sidebar-collapsed .sidebar-user-copy,
.admin-sidebar-collapsed .sidebar-logout { display:none; }
.admin-sidebar-collapsed .admin-brand { display:grid; grid-template-columns:44px; justify-content:center; gap:7px; }
.admin-sidebar-collapsed .brand-mark { width:42px; height:42px; }
.admin-sidebar-collapsed .sidebar-toggle { margin:4px auto 0; }
.admin-sidebar-collapsed .nav a { justify-content:center; padding:9px; }
.admin-sidebar-collapsed .nav-icon { width:28px; height:28px; flex-basis:28px; }
.admin-sidebar-collapsed .sidebar-user { display:flex; justify-content:center; padding:8px 4px; }

.topbar, .top, .page-head {
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:18px;
    margin-bottom:22px;
}
.topbar h1, .top h1, .page-head h1 { margin:0 0 5px; font-size:28px; }
.page-head p { margin:4px 0 0; color:var(--muted); }
.eyebrow { color:#4e9cff; font-size:10px; font-weight:900; letter-spacing:.14em; margin-bottom:6px; }

.alert, .notice {
    border:1px solid var(--border);
    border-radius:11px;
    padding:11px 13px;
    margin-bottom:17px;
}
.alert.success, .notice.success { border-color:rgba(74,215,155,.35); background:rgba(74,215,155,.08); color:#8ee8c2; }
.alert.error, .alert.danger, .notice.error { border-color:rgba(255,102,124,.36); background:rgba(255,102,124,.08); color:#ffa0ae; }
.alert.warning { border-color:rgba(255,196,92,.35); background:rgba(255,196,92,.08); color:#ffd889; }

.panel > h2:first-child, .panel > h3:first-child { margin-top:0; }
.app-shell .panel, .admin-shell .panel { margin-bottom:18px; }
.app-shell form.panel, .admin-shell form.panel { padding:20px; }
.app-shell .panel:not(:has(.panel-head)):not(form), .admin-shell .panel:not(:has(.panel-head)):not(form) { padding:20px; }
label { color:#aebbd0; font-size:12px; font-weight:650; }
label > input, label > select, label > textarea { margin-top:6px; }
.check { display:flex; gap:8px; align-items:center; }
.check input { width:auto; margin:0; }

.admin-page-section { margin-top:18px; }
.admin-subtitle { color:var(--muted); font-size:11px; margin-top:4px; }

@media (max-width:820px) {
    .layout, .app-shell, .admin-shell,
    .admin-sidebar-collapsed .layout,
    .admin-sidebar-collapsed .app-shell,
    .admin-sidebar-collapsed .admin-shell { grid-template-columns:1fr; }
    .admin-sidebar { position:static; height:auto; border-right:0; border-bottom:1px solid var(--border); }
    .sidebar-toggle { display:none; }
    .brand-copy, .nav-label, .nav-text, .sidebar-user-copy, .sidebar-logout { display:initial !important; }
    .nav { display:flex; flex-wrap:wrap; }
    .nav-label { display:block !important; width:100%; }
    .nav a { justify-content:flex-start !important; }
    .sidebar-spacer { display:none; }
    .sidebar-user { display:grid !important; margin-top:16px; max-width:360px; }
    .main, .content { padding:20px 16px 34px; }
}
