* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #0f1115;
    color: #f5f7fb;
}

a {
    text-decoration: none;
}

.admin-login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(circle at top left, rgba(220, 38, 38, 0.18), transparent 35%),
        linear-gradient(180deg, #0f1115 0%, #161a22 100%);
}

.login-shell {
    width: 100%;
    max-width: 460px;
}

.login-card {
    background: rgba(24, 28, 37, 0.96);
    border: 1px solid #2c3342;
    border-radius: 18px;
    padding: 28px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.brand-block h1 {
    margin: 0 0 8px;
    font-size: 30px;
    line-height: 1.1;
}

.brand-block p {
    margin: 0 0 22px;
    color: #adb7c8;
}

.form-stack {
    display: grid;
    gap: 16px;
}

.form-group {
    display: grid;
    gap: 8px;
}

.form-group label {
    font-size: 14px;
    color: #c7d0df;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid #364055;
    background: #11161f;
    color: #f5f7fb;
    outline: none;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

.alert {
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 18px;
    font-size: 14px;
}

.alert-error {
    background: rgba(220, 38, 38, 0.12);
    border: 1px solid rgba(220, 38, 38, 0.35);
    color: #ffb4b4;
}

.alert-success {
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.35);
    color: #b6f3c8;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 16px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    font-weight: 700;
    transition: 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: #dc2626;
    color: #ffffff;
}

.btn-primary:hover {
    background: #ef4444;
}

.btn-secondary {
    background: #232a37;
    color: #f5f7fb;
    border: 1px solid #384255;
}

.btn-secondary:hover {
    background: #2d3647;
}

.btn-block {
    width: 100%;
}

.admin-body {
    background: #0f1115;
    color: #f5f7fb;
}

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

.admin-sidebar {
    background: #121720;
    border-right: 1px solid #232b39;
    position: sticky;
    top: 0;
    height: 100vh;
}

.admin-sidebar-inner {
    padding: 24px 20px;
}

.admin-brand {
    margin-bottom: 28px;
}

.admin-brand h2 {
    margin: 0;
    font-size: 28px;
    line-height: 1;
}

.admin-brand span {
    display: block;
    margin-top: 6px;
    color: #aeb8c8;
    font-size: 14px;
}

.admin-nav {
    display: grid;
    gap: 10px;
}

.admin-nav a {
    padding: 12px 14px;
    border-radius: 12px;
    color: #d6deeb;
    background: transparent;
    border: 1px solid transparent;
    transition: 0.2s ease;
}

.admin-nav a:hover,
.admin-nav a.active {
    background: #1b2230;
    border-color: #303a4d;
    color: #ffffff;
}

.admin-main {
    padding: 28px;
}

.page-header {
    margin-bottom: 24px;
}

.page-header h1 {
    margin: 0 0 6px;
    font-size: 34px;
    line-height: 1.1;
}

.page-header p {
    margin: 0;
    color: #aeb8c8;
}

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

.admin-card {
    background: #161c26;
    border: 1px solid #273041;
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.card-header {
    margin-bottom: 12px;
}

.card-header h3 {
    margin: 0;
    font-size: 20px;
}

.admin-card p {
    margin: 0 0 18px;
    color: #b5bfce;
    line-height: 1.5;
}

.admin-page-wrap {
    max-width: 1100px;
    margin: 0 auto;
}

.form-card {
    background: #161c26;
    border: 1px solid #273041;
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

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

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

    .admin-sidebar {
        position: relative;
        height: auto;
        border-right: none;
        border-bottom: 1px solid #232b39;
    }

    .admin-main {
        padding: 20px;
    }

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

    .page-header h1 {
        font-size: 28px;
    }
}

.toggle-list {
    display: grid;
    gap: 16px;
}

.toggle-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px;
    border: 1px solid #2d3748;
    border-radius: 16px;
    background: #11161f;
}

.toggle-card-copy h3 {
    margin: 0 0 6px;
    font-size: 18px;
}

.toggle-card-copy p {
    margin: 0;
    color: #aeb8c8;
    font-size: 14px;
    line-height: 1.4;
}

.toggle-card-copy code {
    background: #1b2230;
    border: 1px solid #303a4d;
    border-radius: 8px;
    padding: 2px 8px;
    color: #f5f7fb;
    font-family: Consolas, Monaco, monospace;
    font-size: 13px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 62px;
    height: 34px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.slider {
    position: absolute;
    inset: 0;
    cursor: pointer;
    background: #313b4d;
    transition: 0.25s ease;
    border-radius: 999px;
    border: 1px solid #434f65;
}

.slider::before {
    content: "";
    position: absolute;
    height: 26px;
    width: 26px;
    left: 3px;
    top: 3px;
    background: #ffffff;
    transition: 0.25s ease;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.switch input:checked + .slider {
    background: #dc2626;
    border-color: #dc2626;
}

.switch input:checked + .slider::before {
    transform: translateX(28px);
}

.switch input:focus + .slider {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

@media (max-width: 640px) {
    .toggle-card {
        align-items: flex-start;
        flex-direction: column;
    }
}

.toggle-list {
    display: grid;
    gap: 16px;
}

.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 20px;
    border: 1px solid #273041;
    border-radius: 16px;
    background: #11161f;
}

.toggle-row-content h3 {
    margin: 0 0 6px;
    font-size: 18px;
    color: #f5f7fb;
}

.toggle-row-content p {
    margin: 0;
    color: #aeb8c8;
    font-size: 14px;
}

.toggle-row-action {
    flex-shrink: 0;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 68px;
    height: 36px;
}

.toggle-switch input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    cursor: pointer;
    background: #2a3342;
    border: 1px solid #3a4659;
    border-radius: 999px;
    transition: all 0.25s ease;
}

.toggle-slider::before {
    content: "";
    position: absolute;
    height: 28px;
    width: 28px;
    left: 3px;
    top: 3px;
    background: #ffffff;
    border-radius: 50%;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.toggle-switch input:checked + .toggle-slider {
    background: #dc2626;
    border-color: #dc2626;
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(32px);
}

.toggle-switch input:focus + .toggle-slider {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

@media (max-width: 640px) {
    .toggle-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .toggle-row-action {
        width: 100%;
    }
}

.roster-preview-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.asset-preview-card {
    background: #11161f;
    border: 1px solid #273041;
    border-radius: 16px;
    padding: 18px;
}

.asset-preview-card h3 {
    margin: 0 0 14px;
    font-size: 18px;
    color: #f5f7fb;
}

.asset-preview-frame {
    width: 100%;
    aspect-ratio: 3 / 4;
    background: #0b0f16;
    border: 1px solid #273041;
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

.asset-preview-frame img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

@media (max-width: 1100px) {
    .roster-preview-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .roster-preview-grid {
        grid-template-columns: 1fr;
    }
}

.section-spacing {
    margin-bottom: 22px;
}

.section-title {
    margin: 0 0 18px;
    font-size: 22px;
    line-height: 1.2;
}

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

.field-manager-card {
    padding: 18px;
    border: 1px solid #273041;
    border-radius: 16px;
    background: #11161f;
}

@media (max-width: 760px) {
    .two-col-grid {
        grid-template-columns: 1fr;
    }
}

.character-edit-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 18px;
    align-items: start;
}

.dynamic-field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.form-help {
    display: block;
    margin-top: 8px;
    color: #aeb8c8;
    font-size: 13px;
    line-height: 1.4;
}

@media (max-width: 900px) {
    .character-edit-grid {
        grid-template-columns: 1fr;
    }

    .dynamic-field-grid {
        grid-template-columns: 1fr;
    }
}

.left-align {
            text-align: left; /* Aligns text to the left */
        }

.update-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 22px;
}

.version-stat-card {
    padding: 18px;
    border: 1px solid #273041;
    border-radius: 16px;
    background: #11161f;
}

.version-stat-label {
    font-size: 14px;
    color: #aeb8c8;
    margin-bottom: 8px;
}

.version-stat-value {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.1;
    color: #f5f7fb;
    margin-bottom: 10px;
}

.version-stat-meta {
    font-size: 14px;
    color: #aeb8c8;
}

.status-banner {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 16px 18px;
    border-radius: 14px;
    border: 1px solid #273041;
}

.status-banner strong {
    font-size: 16px;
}

.status-banner span {
    color: #d6deeb;
    line-height: 1.5;
}

.status-banner-warning {
    background: rgba(220, 38, 38, 0.12);
    border-color: rgba(220, 38, 38, 0.35);
}

.status-banner-success {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.35);
}

.status-banner-neutral {
    background: rgba(59, 130, 246, 0.10);
    border-color: rgba(59, 130, 246, 0.25);
}

.detail-list {
    display: grid;
    gap: 12px;
    margin-bottom: 18px;
}

.detail-row {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid #273041;
}

.detail-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.detail-label {
    color: #aeb8c8;
    font-weight: 600;
}

.detail-value {
    color: #f5f7fb;
}

.detail-break {
    word-break: break-word;
}

.notes-block {
    margin-top: 18px;
    padding: 18px;
    border-radius: 14px;
    background: #11161f;
    border: 1px solid #273041;
}

.notes-block h3 {
    margin: 0 0 10px;
    font-size: 18px;
}

.notes-block p {
    margin: 0;
    color: #d6deeb;
    line-height: 1.6;
}

.action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 14px;
}

.update-help-text {
    margin: 0;
    color: #aeb8c8;
    line-height: 1.5;
    font-size: 14px;
}

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

    .detail-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }
}

.active-character-card {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 20px;
    align-items: center;
}

.active-character-image,
.character-dashboard-image {
    width: 100%;
    aspect-ratio: 3 / 4;
    background: #0b0f16;
    border: 1px solid #273041;
    border-radius: 14px;
    overflow: hidden;
}

.active-character-image img,
.character-dashboard-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.active-character-content h3,
.character-dashboard-content h3 {
    margin: 0 0 8px;
    font-size: 24px;
    color: #f5f7fb;
}

.active-character-content p,
.character-dashboard-content p {
    margin: 0 0 14px;
    color: #aeb8c8;
    line-height: 1.5;
}

.character-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.character-dashboard-card {
    background: #11161f;
    border: 1px solid #273041;
    border-radius: 16px;
    overflow: hidden;
}

.character-dashboard-content {
    padding: 16px;
}

.active-badge {
    display: inline-block;
    margin-bottom: 14px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(220, 38, 38, 0.14);
    border: 1px solid rgba(220, 38, 38, 0.3);
    color: #ffd0d0;
    font-size: 13px;
    font-weight: 700;
}

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

@media (max-width: 900px) {
    .active-character-card {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .character-dashboard-grid {
        grid-template-columns: 1fr;
    }
}

.theme-list {
    display: grid;
    gap: 18px;
}

.theme-card {
    background: #11161f;
    border: 1px solid #273041;
    border-radius: 16px;
    overflow: hidden;
}

.theme-card-header {
    padding: 18px 18px 0;
}

.theme-card-header h3 {
    margin: 0;
    font-size: 20px;
    color: #f5f7fb;
}

.theme-card-body {
    padding: 16px 18px 18px;
    display: grid;
    gap: 16px;
}

.theme-block {
    display: grid;
    gap: 8px;
}

.theme-label {
    font-size: 14px;
    font-weight: 700;
    color: #aeb8c8;
}

.theme-card audio {
    width: 100%;
}

.theme-link-wrap {
    margin: 0;
    line-height: 1.6;
    word-break: break-word;
}

.theme-link-wrap a {
    color: #f87171;
}

.section-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
}

.section-header-row .section-title {
    margin: 0;
}

.promo-list {
    display: grid;
    gap: 18px;
}

.promo-card {
    background: #11161f;
    border: 1px solid #273041;
    border-radius: 16px;
    overflow: hidden;
}

.promo-card-header {
    padding: 18px 18px 0;
}

.promo-card-header h3 {
    margin: 0 0 6px;
    font-size: 20px;
    color: #f5f7fb;
}

.promo-meta {
    margin: 0;
    color: #aeb8c8;
    font-size: 14px;
    line-height: 1.4;
}

.promo-card-body {
    padding: 16px 18px 18px;
}

.promo-card-body p {
    margin: 0;
    color: #d6deeb;
    line-height: 1.7;
}

@media (max-width: 700px) {
    .section-header-row {
        flex-direction: column;
        align-items: flex-start;
    }
}

.promo-title-link {
    color: #f5f7fb;
}

.promo-title-link:hover {
    color: #f87171;
}

.promo-view-body {
    background: #11161f;
    border: 1px solid #273041;
    border-radius: 16px;
    padding: 20px;
    color: #d6deeb;
    line-height: 1.7;
    min-height: 100%;
}

.promo-view-body p:first-child {
    margin-top: 0;
}

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

.bio-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #11161f;
    border: 1px solid #273041;
    border-radius: 16px;
    overflow: hidden;
}

.bio-card-body {
    padding: 16px 18px 18px;
    color: #d6deeb;
    line-height: 1.7;
    flex: 1;
}

.bio-card-footer {
    padding: 0 18px 18px;
}

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


.user-role-badge {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.14);
    border: 1px solid rgba(59, 130, 246, 0.28);
    color: #cfe0ff;
    font-size: 13px;
    font-weight: 700;
}

@media (max-width: 700px) {
    .user-manager-card-top {
        flex-direction: column;
    }

    .user-manager-form {
        grid-template-columns: 1fr;
    }
}

.admin-mobile-topbar {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #111;
    border-bottom: 1px solid #2a2a2a;
    position: sticky;
    top: 0;
    z-index: 1100;
}

.admin-mobile-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    color: #fff;
    font-weight: 700;
}

.admin-mobile-brand img {
    width: 120px;
    height: auto;
    display: block;
}

.admin-menu-toggle {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid #333;
    background: #1a1a1a;
    border-radius: 8px;
    cursor: pointer;
    flex: 0 0 auto;
}

.admin-menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: #fff;
    margin: 0 auto;
    transition: 0.2s ease;
}

.admin-sidebar-overlay {
    display: none;
}

@media (max-width: 900px) {
    .admin-mobile-topbar {
        display: flex;
    }

    .admin-shell {
        display: block;
    }

    .admin-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        max-width: 85vw;
        height: 100vh;
        z-index: 1200;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        overflow-y: auto;
    }

    .admin-sidebar.is-open {
        transform: translateX(0);
    }

    .admin-sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.55);
        z-index: 1150;
    }

    .admin-sidebar-overlay.is-open {
        display: block;
    }

    .admin-brand {
        padding-right: 40px;
	}
	
}

.user-manager-header {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.user-manager-subtext {
    margin: 6px 0 0;
    opacity: 0.8;
    font-size: 14px;
}

.user-manager-search-wrap {
    min-width: 280px;
    max-width: 420px;
    width: 100%;
}

.user-manager-search {
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid #333;
    background: #111;
    color: #fff;
    font-size: 14px;
    box-sizing: border-box;
}

.user-manager-search:focus {
    outline: none;
    border-color: #b30000;
    box-shadow: 0 0 0 3px rgba(179, 0, 0, 0.15);
}

.user-manager-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 18px;
}

.user-manager-card {
    background: #141414;
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: 100%;
    box-sizing: border-box;
}

.user-manager-card-top {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 12px;
}

.user-manager-card h3 {
    margin: 0 0 8px;
    font-size: 18px;
}

.user-manager-meta {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    opacity: 0.9;
}

.user-manager-form {
    margin-top: auto;
}

.user-role-badge,
.active-badge {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.user-role-badge {
    background: #222;
    color: #ddd;
    border: 1px solid #3a3a3a;
}

.user-search-empty {
    margin-top: 18px;
    padding: 14px;
    border: 1px dashed #444;
    border-radius: 10px;
    text-align: center;
    color: #ccc;
}

@media (max-width: 640px) {
    .user-manager-grid {
        grid-template-columns: 1fr;
    }

    .user-manager-card-top {
        flex-direction: column;
        align-items: flex-start;
    }

    .user-manager-search-wrap {
        min-width: 100%;
    }
}