:root {
    --sidebar-w: 220px;
    --sidebar-w-collapsed: 64px;
    --surface: rgba(255, 255, 255, 0.05);
    --surface-hover: rgba(255, 255, 255, 0.09);
    --border: rgba(255, 255, 255, 0.1);
    --border-focus: rgba(255, 255, 255, 0.4);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.5);
    --text-muted: rgba(255, 255, 255, 0.28);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --transition: 0.25s ease;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.55);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

/* ── Background ── */
body {
    font-family: 'Outfit', sans-serif;
    min-height: 100vh;
    color: var(--text-primary);
    display: flex;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url('https://steamcdn-a.akamaihd.net/steamcommunity/public/images/items/1148510/c71963b9fba8b79bc480e363d16f9faac5f44445.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -2;
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.74);
    z-index: -1;
}

/* ── Sidebar ── */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--sidebar-w);
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 1.5rem 0 1.5rem;
    z-index: 100;
    transition: width var(--transition);
    overflow: hidden;
}

.sidebar.collapsed {
    width: var(--sidebar-w-collapsed);
}

/* Brand */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 1.1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.sidebar-brand i {
    font-size: 1.4rem;
    color: #fff;
    flex-shrink: 0;
    width: 1.6rem;
    text-align: center;
}

.brand-text {
    font-size: 1.1rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.3px;
    transition: opacity var(--transition);
}

.sidebar.collapsed .brand-text {
    opacity: 0;
    pointer-events: none;
}

/* Nav */
.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1.25rem 0.6rem 0;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.7rem 0.85rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    transition: background var(--transition), color var(--transition);
}

.nav-item i {
    font-size: 1rem;
    flex-shrink: 0;
    width: 1.2rem;
    text-align: center;
}

.nav-item span {
    transition: opacity var(--transition);
}

.sidebar.collapsed .nav-item span {
    opacity: 0;
    pointer-events: none;
}

.nav-item:hover {
    background: var(--surface-hover);
    color: #fff;
}

.nav-item.active {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

/* Toggle button */
.sidebar-toggle {
    all: unset;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    margin: 0 auto;
    transition: background var(--transition), color var(--transition);
}

.sidebar-toggle:hover {
    background: var(--surface-hover);
    color: #fff;
}

/* ── Layout ── */
.layout {
    margin-left: var(--sidebar-w);
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left var(--transition);
    padding: clamp(1.25rem, 3vw, 2.25rem) clamp(1rem, 3vw, 2.5rem);
    padding-top: calc(52px + clamp(1.25rem, 3vw, 2.25rem));
    min-width: 0;
    max-width: 100%;
}

.layout.sidebar-collapsed {
    margin-left: var(--sidebar-w-collapsed);
}

/* ── Pages ── */
.page {
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

.page.hidden {
    display: none;
}

.page-header {
    margin-bottom: clamp(1.25rem, 3vw, 2rem);
}

.page-header h1 {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.page-header h1 i {
    font-size: 1.2em;
    color: rgba(255, 255, 255, 0.7);
}

/* ── Home grid ── */
.home-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.home-grid-single {
    grid-template-columns: minmax(260px, 520px);
}

.home-stats-grid {
    grid-template-columns: repeat(3, minmax(220px, 1fr));
}

.stat-card {
    background: rgba(0, 0, 0, 0.38);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 1.4rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: background var(--transition);
}

.stat-card:hover {
    background: rgba(255, 255, 255, 0.07);
}

.stat-card>i {
    font-size: 1.6rem;
    color: rgba(255, 255, 255, 0.7);
    flex-shrink: 0;
}

.stat-card div {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.user-count-card {
    position: relative;
    overflow: hidden;
    min-height: 210px;
    align-items: center;
    justify-content: space-between;
    padding: 1.8rem;
    background: rgba(0, 0, 0, 0.55);
}

.user-count-card::after {
    content: '';
    position: absolute;
    width: 180px;
    height: 180px;
    right: -55px;
    bottom: -70px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
}

.stat-icon-wrap {
    width: 76px;
    height: 76px;
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border);
    flex-shrink: 0;
    line-height: 1;
}

.stat-icon-wrap i {
    display: block;
    width: auto;
    height: auto;
    margin: 0;
    font-size: 2rem;
    line-height: 1;
    color: #fff;
}

.stat-content {
    align-items: flex-end;
    text-align: right;
    position: relative;
    z-index: 1;
}

.stat-label {
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
}

.stat-desc {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.stat-card-large {
    min-height: 180px;
}

.stat-card-large>i {
    font-size: 2.6rem;
}

.stat-number {
    font-size: clamp(4rem, 12vw, 7rem);
    line-height: 0.9;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.08em;
    margin: 0.2rem 0 0.35rem;
}

.active-user-card {
    background: rgba(0, 0, 0, 0.48);
}

.role-card {
    min-height: 210px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.55);
}

.role-card::before,
.role-card::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(24px);
    opacity: 0.55;
    pointer-events: none;
}

.role-card::before {
    width: 120px;
    height: 120px;
    right: -35px;
    top: -35px;
}

.role-card::after {
    width: 95px;
    height: 95px;
    left: -30px;
    bottom: -35px;
}

.role-title {
    position: relative;
    z-index: 1;
    font-size: clamp(2.2rem, 6vw, 4rem);
    line-height: 1;
    font-weight: 800;
    letter-spacing: -0.04em;
    text-transform: uppercase;
    text-shadow: 0 0 22px currentColor;
}

.role-member .role-title {
    color: #4cff8f;
}

.role-member::before,
.role-member::after {
    background: #24ff72;
}

.role-admin .role-title {
    color: #ff4a4a;
}

.role-admin::before,
.role-admin::after {
    background: #ff2020;
}

.role-premium .role-title {
    color: #ffd84a;
}

.role-premium::before,
.role-premium::after {
    background: #ffcc00;
}

.role-banned .role-title {
    color: #1b1b1b;
    text-shadow: 0 0 18px rgba(255, 255, 255, 0.22);
    -webkit-text-stroke: 1px rgba(255, 255, 255, 0.28);
}

.role-banned::before,
.role-banned::after {
    background: #000;
    opacity: 0.85;
}

.maintenance-alert {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.9rem 1rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

/* ── Main card (Bin Gen) ── */
.main-card {
    background: rgba(0, 0, 0, 0.42);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: clamp(1.25rem, 3vw, 2rem);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(1rem, 3vw, 2rem);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow: var(--shadow);
    animation: fadeUp 0.4s ease-out forwards;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Sections ── */
.input-section {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    border-right: 1px solid var(--border);
    padding-right: clamp(1rem, 3vw, 2rem);
}

.result-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* ── Inputs ── */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

label {
    font-size: 0.73rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.7px;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

input,
select,
textarea {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.68rem 0.9rem;
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    transition: var(--transition);
    outline: none;
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
}

input::placeholder,
textarea::placeholder {
    color: var(--text-muted);
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--border-focus);
    background: rgba(255, 255, 255, 0.07);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05);
}

select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='rgba(255,255,255,0.35)' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.85rem center;
    padding-right: 2.2rem;
    cursor: pointer;
}

select option {
    background: #1a1a1a;
    color: #fff;
}

textarea {
    resize: none;
    flex: 1;
    min-height: 220px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.77rem;
    line-height: 1.75;
}

/* ── Buttons ── */
button {
    width: 100%;
    padding: 0.78rem 1rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
}

#generate-btn {
    background: #fff;
    color: #000;
    margin-top: auto;
}

#generate-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.88);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.13);
}

#generate-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--surface-hover);
    border-color: rgba(255, 255, 255, 0.22);
}

.action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
}

.login-body {
    display: block;
}

.login-layout {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1rem;
}

.login-card {
    width: min(100%, 380px);
    background: rgba(0, 0, 0, 0.48);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 1.1rem;
    font-weight: 800;
}

.login-card h1 {
    font-size: 1.7rem;
}

.login-muted,
.admin-note {
    color: var(--text-secondary);
    font-size: 0.82rem;
    line-height: 1.5;
}

.login-error {
    background: rgba(255, 90, 90, 0.14);
    border: 1px solid rgba(255, 90, 90, 0.28);
    color: #ffb6b6;
    border-radius: var(--radius-sm);
    padding: 0.75rem 0.85rem;
    font-size: 0.86rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.login-success {
    background: rgba(74, 222, 128, 0.12);
    border: 1px solid rgba(74, 222, 128, 0.28);
    color: #86efac;
    border-radius: var(--radius-sm);
    padding: 0.75rem 0.85rem;
    font-size: 0.86rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.pw-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.pw-wrap input {
    padding-right: 2.8rem;
}

.pw-eye {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 2.6rem;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 0.85rem;
    transition: color var(--transition);
}

.pw-eye:hover { color: var(--text-primary); }

.admin-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.8fr);
    gap: 1rem;
    margin-bottom: 1rem;
    width: 100%;
    max-width: 100%;
}

.admin-card {
    background: rgba(0, 0, 0, 0.42);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.4rem;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow: var(--shadow);
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.admin-card h2 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.admin-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.admin-card-head h2 {
    margin-bottom: 0;
}

.admin-card-head .help-tip::after {
    right: 0;
    left: auto;
}

.setting-row .help-tip::after {
    left: 0;
    right: auto;
}

.help-tip {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 0.35rem;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid var(--border);
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.7rem;
    font-weight: 800;
    line-height: 1;
    cursor: help;
    position: relative;
    text-transform: none;
    letter-spacing: 0;
}

.help-tip::after {
    content: attr(data-tip);
    position: absolute;
    right: 0;
    bottom: calc(100% + 10px);
    transform: translateY(4px);
    width: min(260px, calc(100vw - 2rem));
    max-width: calc(100vw - 2rem);
    padding: 0.65rem 0.75rem;
    border-radius: var(--radius-sm);
    background: rgba(8, 8, 8, 0.96);
    border: 1px solid var(--border);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.45;
    white-space: normal;
    text-align: left;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
    z-index: 500;
    box-shadow: var(--shadow);
}

.help-tip:hover::after {
    opacity: 1;
    transform: translateY(0);
}

.admin-card form {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    color: var(--text-primary);
    font-size: 0.92rem;
}

.switch {
    width: 46px;
    height: 26px;
    display: block;
    position: relative;
    flex-shrink: 0;
}

.switch input {
    display: none;
}

.switch span {
    position: absolute;
    inset: 0;
    cursor: pointer;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    transition: var(--transition);
}

.switch span::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    top: 3px;
    left: 4px;
    background: #fff;
    border-radius: 50%;
    transition: var(--transition);
}

.switch input:checked + span {
    background: rgba(255, 255, 255, 0.22);
}

.switch input:checked + span::before {
    transform: translateX(18px);
}

.key-output {
    margin-top: 1rem;
    padding: 1.1rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.09);
    font-family: 'JetBrains Mono', monospace;
    font-size: 2rem;
    font-weight: 800;
    text-align: center;
    letter-spacing: 0.35rem;
    color: #fff;
}

.hidden {
    display: none !important;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

.admin-table th,
.admin-table td {
    border-bottom: 1px solid var(--border);
    padding: 0.75rem;
    text-align: left;
    font-size: 0.84rem;
    color: var(--text-secondary);
}

.admin-table th {
    color: var(--text-primary);
    font-weight: 700;
}

.admin-table button {
    padding: 0.55rem 0.7rem;
    font-size: 0.78rem;
}

.badge {
    display: inline-flex;
    border-radius: 999px;
    padding: 0.25rem 0.55rem;
    border: 1px solid var(--border);
    color: #fff;
    font-size: 0.75rem;
}

.badge-admin {
    background: rgba(255, 255, 255, 0.16);
}

.badge-user {
    background: rgba(255, 255, 255, 0.07);
}

/* ── Sidebar credits ── */
.sidebar-credits {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.65rem 1.1rem;
    margin: 0.75rem 0.6rem 0;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-credits i {
    font-size: 0.85rem;
    color: #ffd84a;
    flex-shrink: 0;
}

.sidebar-credits-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: opacity var(--transition);
}

.sidebar-credits-val {
    margin-left: auto;
    font-size: 0.9rem;
    font-weight: 800;
    color: #fff;
    transition: opacity var(--transition);
}

.sidebar.collapsed .sidebar-credits-label,
.sidebar.collapsed .sidebar-credits-val {
    opacity: 0;
    pointer-events: none;
}

/* ── Sidebar toggle: desktop only ── */
.sidebar-toggle-desktop {
    display: flex;
}

@media (max-width: 480px) {
    .sidebar-toggle-desktop {
        display: none;
    }
}

/* ── Credit edit in admin table ── */
.credit-edit-wrap {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

.credit-input {
    width: 80px;
    padding: 0.35rem 0.5rem;
    font-size: 0.82rem;
}

.credits-inf {
    font-size: 1.1rem;
    font-weight: 800;
    color: #ffd84a;
}

/* ── Topbar (all screens) ── */
.topbar {
    display: flex;
    position: fixed;
    top: 0;
    left: var(--sidebar-w);
    right: 0;
    height: 52px;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    align-items: center;
    gap: 0.75rem;
    padding: 0 1.25rem;
    z-index: 200;
    transition: left var(--transition);
}

.topbar.sidebar-collapsed {
    left: var(--sidebar-w-collapsed);
}

.topbar-toggle {
    all: unset;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-primary);
    flex-shrink: 0;
}

@media (max-width: 480px) {
    .topbar-toggle {
        display: flex;
    }
}

.topbar-brand {
    font-size: 1rem;
    font-weight: 800;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.topbar-credits {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: #ffd84a;
    background: rgba(255, 216, 74, 0.1);
    border: 1px solid rgba(255, 216, 74, 0.25);
    border-radius: var(--radius-sm);
    padding: 0.3rem 0.65rem;
    flex-shrink: 0;
}

/* ── Sidebar overlay (mobile) ── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 90;
}

.sidebar-overlay.active {
    display: block;
}

/* ── Responsive ── */
@media (max-width: 900px) {
    .sidebar {
        width: var(--sidebar-w-collapsed);
    }

    .sidebar .brand-text,
    .sidebar .nav-item span {
        opacity: 0;
        pointer-events: none;
    }

    .layout {
        margin-left: var(--sidebar-w-collapsed);
    }

    .topbar {
        left: var(--sidebar-w-collapsed);
    }

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

@media (max-width: 700px) {
    .main-card,
    .admin-grid {
        grid-template-columns: 1fr;
    }

    .input-section {
        border-right: none;
        padding-right: 0;
        border-bottom: 1px solid var(--border);
        padding-bottom: 1.25rem;
    }

    textarea {
        min-height: 160px;
    }
}

@media (max-width: 480px) {
    .topbar {
        left: 0;
    }

    .topbar-toggle {
        display: flex;
    }

    .sidebar {
        width: 0;
        border-right: none;
        overflow: hidden;
        top: 0;
        z-index: 100;
        transition: width var(--transition);
    }

    .sidebar.mobile-open {
        width: var(--sidebar-w);
        border-right: 1px solid var(--border);
    }

    .sidebar.mobile-open .brand-text,
    .sidebar.mobile-open .nav-item span {
        opacity: 1;
        pointer-events: auto;
    }

    .layout {
        margin-left: 0;
        padding: 1rem;
        padding-top: calc(52px + 1rem);
    }

    .home-grid {
        grid-template-columns: 1fr;
    }

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

    .stat-number {
        font-size: clamp(3rem, 18vw, 5rem);
    }

    .action-buttons {
        grid-template-columns: 1fr 1fr;
    }

    .stripe-card .input-section .action-buttons {
        grid-template-columns: 1fr 1fr;
    }

    .stripe-results {
        grid-template-columns: 1fr;
    }

    .stripe-stats {
        flex-wrap: wrap;
    }

    .admin-table {
        min-width: 600px;
    }
}

/* Stripe sayfası: input üstte tam genişlik, sonuçlar altta */
.stripe-card {
    grid-template-columns: 1fr;
}

.stripe-card .input-section {
    border-right: none;
    padding-right: 0;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1.25rem;
}

.stripe-card .input-section textarea {
    min-height: 150px;
}

.stripe-card .input-section .action-buttons {
    grid-template-columns: repeat(3, 1fr);
}

.stripe-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.stat-mini {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
}

.stripe-results {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    flex: 1;
}

.result-box {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.result-list {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    height: 220px;
    overflow-y: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    line-height: 1.6;
}

.result-item {
    margin-bottom: 0.35rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    word-break: break-all;
}

.live { color: #4cff8f; }
.dec  { color: #ff4a4a; }

.hidden { display: none !important; }

/* ── Badge variants ── */
.badge-banned { background: rgba(255, 74, 74, 0.18); color: #ff9999; }

/* ── Admin API table code tag ── */
.admin-table code {
    background: rgba(255,255,255,0.08);
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
}

/* ── Checker API select highlight ── */
#checker-api-select {
    font-weight: 600;
    background-color: rgba(255,255,255,0.07);
}

/* ── Admin add-api form inline inputs ── */
#admin-add-api-form input[type=text] {
    flex: 1;
}
#admin-add-api-form button {
    width: auto;
    padding: 0.68rem 1.4rem;
    background: #fff;
    color: #000;
    font-weight: 700;
    border-radius: var(--radius-sm);
}
#admin-add-api-form button:hover {
    background: rgba(255,255,255,0.88);
}

/* ── Select — daha iyi görünüm ── */
select {
    background: rgba(255,255,255,0.07) !important;
    border: 1px solid rgba(255,255,255,0.18) !important;
    border-radius: var(--radius-sm);
    padding: 0.72rem 2.4rem 0.72rem 0.95rem;
    color: #fff;
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' stroke='rgba(255,255,255,0.55)' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 0.9rem center !important;
}
select:focus {
    border-color: rgba(255,255,255,0.45) !important;
    box-shadow: 0 0 0 3px rgba(255,255,255,0.07) !important;
    outline: none;
}
select option { background: #1a1a2e; color: #fff; }

/* ── Toggle button ── */
.admin-toggle-api {
    width: 36px !important;
    height: 36px !important;
    padding: 0 !important;
    font-size: 1.1rem !important;
}
.admin-toggle-api .fa-toggle-on  { color: #4ade80; }
.admin-toggle-api .fa-toggle-off { color: rgba(255,255,255,0.3); }

/* ── Logs tab bar ── */
.logs-tab-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
}
.log-tab-btn {
    width: auto !important;
    padding: 0.48rem 1.2rem !important;
    border-radius: 999px !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    color: var(--text-secondary) !important;
    gap: 0.4rem;
    transition: var(--transition) !important;
}
.log-tab-btn:hover { background: var(--surface-hover) !important; color: #fff !important; }
.log-tab-btn.active {
    background: rgba(255,255,255,0.14) !important;
    border-color: rgba(255,255,255,0.3) !important;
    color: #fff !important;
}

/* ── Logs pagination ── */
.logs-pagination { display:flex; flex-wrap:wrap; gap:0.35rem; margin-top:0.75rem; }
.logs-pagination button {
    width: 36px !important;
    height: 36px !important;
    padding: 0 !important;
    font-size: 0.82rem !important;
    border-radius: var(--radius-sm) !important;
}
.log-page-active {
    background: rgba(255,255,255,0.2) !important;
    border-color: rgba(255,255,255,0.4) !important;
    color: #fff !important;
}
#page-logs .admin-table { min-width: 560px; }

/* ── Live Chat & Leaderboard Styles ── */
.user-glow-admin {
    font-weight: 800 !important;
    background: linear-gradient(90deg, #ff1e27, #ff5e62, #8b0000, #ff1e27);
    background-size: 200% auto;
    color: transparent !important;
    -webkit-background-clip: text;
    background-clip: text;
    text-shadow: 0 0 12px rgba(255, 30, 39, 0.6);
    animation: glowTextEffect 3s linear infinite;
}
@keyframes glowTextEffect {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}
.chat-message-item {
    display: flex;
    flex-direction: column;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.03);
    border-left: 3px solid rgba(255, 255, 255, 0.1);
}
.chat-message-item.role-admin {
    background: rgba(255, 30, 39, 0.06);
    border-left: 3px solid #ff1e27;
    box-shadow: inset 0 0 10px rgba(255, 30, 39, 0.1);
}
.chat-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 3px;
}
.chat-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-left: auto;
}
.chat-body {
    font-size: 0.85rem;
    color: var(--text-primary);
    word-break: break-all;
}
.leaderboard-item {
    transition: var(--transition);
}
.leaderboard-item:hover {
    background: rgba(255, 255, 255, 0.02) !important;
}
.badge-admin {
    background: rgba(255, 30, 39, 0.2);
    color: #ffb6b6;
    border: 1px solid rgba(255, 30, 39, 0.4);
}
.badge-user {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

/* ── Custom Layout Fixes & Buttons ── */
.credit-count-card {
    position: relative;
    overflow: hidden;
    min-height: 210px !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 1.8rem !important;
    background: rgba(0, 0, 0, 0.55) !important;
}
.credit-count-card::after {
    content: '';
    position: absolute;
    width: 180px;
    height: 180px;
    right: -55px;
    bottom: -70px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
}

button:not(.btn-secondary):not(.topbar-toggle):not(.pw-eye):not(.log-tab-btn) {
    background: #fff !important;
    color: #000 !important;
}
button:not(.btn-secondary):not(.topbar-toggle):not(.pw-eye):not(.log-tab-btn):hover {
    background: rgba(255, 255, 255, 0.88) !important;
}

#chat-send-btn {
    background: #fff !important;
    color: #000 !important;
    border: none !important;
    width: 50px !important;
    height: 42px !important;
    border-radius: var(--radius-sm) !important;
    padding: 0 !important;
    display: none !important;
    align-items: center;
    justify-content: center;
}
#chat-send-btn i {
    font-size: 1rem !important;
    color: #000 !important;
}
@media (max-width: 480px) {
    #chat-send-btn {
        display: flex !important;
    }
}

/* ── Mobile Responsive Optimizations for Admin Page ── */
@media (max-width: 480px) {
    /* Reduce admin card padding for more usable screen space */
    .admin-card {
        padding: 1.1rem 0.9rem !important;
        border-radius: var(--radius-md) !important;
    }

    /* Make setting headers look perfectly proportioned */
    .admin-card h2 {
        font-size: 1.05rem !important;
        margin-bottom: 0.85rem !important;
    }

    /* Admin card header stacking */
    .admin-card-head {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.65rem !important;
        margin-bottom: 0.85rem !important;
    }

    .admin-card-head h2 {
        font-size: 1.05rem !important;
    }

    /* Make buttons full width where appropriate */
    #admin-health-btn {
        margin-left: 0 !important;
        width: 100% !important;
        padding: 0.65rem 1rem !important;
        font-size: 0.85rem !important;
    }

    /* Stack inline input rows (e.g. Max Deneme & Kilit Dakika) */
    .admin-card .input-row {
        grid-template-columns: 1fr !important;
        gap: 0.85rem !important;
    }

    /* Prevent generated credit codes from overflowing */
    .key-output {
        font-size: 1.15rem !important;
        letter-spacing: 0.15rem !important;
        padding: 0.85rem 0.5rem !important;
        margin-top: 0.85rem !important;
    }

    /* Make sure scrollbars inside tables scroll elegantly on touch devices */
    .table-wrap {
        -webkit-overflow-scrolling: touch;
        margin-bottom: 0.5rem;
    }

    /* Slightly adjust table font size on tiny screens */
    .admin-table th, 
    .admin-table td {
        padding: 0.65rem 0.5rem !important;
        font-size: 0.8rem !important;
    }

    /* Compact credit editors inside the users table */
    .credit-edit-wrap {
        gap: 0.3rem !important;
    }

    .credit-input {
        width: 65px !important;
        padding: 0.3rem 0.4rem !important;
        font-size: 0.78rem !important;
    }

    .admin-table button {
        padding: 0.45rem 0.55rem !important;
        font-size: 0.74rem !important;
    }
    
    /* Dynamic Page Status Grid optimization */
    #admin-pages-control-form {
        grid-template-columns: 1fr !important;
        gap: 0.65rem !important;
    }
    
    #admin-pages-control-form button[type="submit"] {
        width: 100% !important;
        margin-top: 0.25rem !important;
    }
}