@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

:root {
    color-scheme: dark;
    --admin-ink: #f9f5ff;
    --admin-muted: #c5b7d8;
    --admin-gold: #f2d579;
    --admin-border: #d2b6f03b;
    --admin-panel: linear-gradient(150deg, #281147ed, #140923f2);
}

* {
    box-sizing: border-box;
}

body.admin-page {
    min-height: 100vh;
    margin: 0;
    background: linear-gradient(#170933b0), url('../assets/bg.png') center / cover fixed;
    color: var(--admin-ink);
    font-family: 'Poppins', sans-serif;
}

.admin-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    min-height: 76px;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 12px clamp(18px, 4vw, 56px);
    border-bottom: 1px solid #ffffff24;
    background: linear-gradient(115deg, #311568f6, #421d8ef5);
    box-shadow: 0 5px 24px #08001844;
}

.admin-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-size: 17px;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
}

.admin-brand-mark {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border: 1px solid #e2c86682;
    border-radius: 13px;
    background: #e2c8661a;
    color: var(--admin-gold);
}

.admin-brand-mark img {
    width: 100%;
    height: 100%;
    border-radius: 10px;
    object-fit: contain;
}

.admin-brand small {
    display: block;
    margin-top: 2px;
    color: #ddcbed;
    font-size: 8px;
    letter-spacing: 1.2px;
}

.admin-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

.admin-nav a,
.admin-nav form button {
    display: inline-flex;
    min-height: 39px;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: #eee6ff;
    font: 500 12px 'Poppins', sans-serif;
    text-decoration: none;
    cursor: pointer;
}

.admin-nav a:hover,
.admin-nav form button:hover {
    border-color: #ffffff1c;
    background: #ffffff10;
    color: #ffe28a;
}

.admin-nav form {
    margin: 0;
}

.admin-nav form button {
    color: #ffccd2;
}

.admin-user {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #e6d9f4;
    font-size: 11px;
    white-space: nowrap;
}

.admin-user i {
    color: var(--admin-gold);
}

.admin-main {
    width: min(1120px, calc(100% - 36px));
    margin: 0 auto;
    padding: 46px 0 70px;
}

.dashboard-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    width: min(620px, calc(100% - 36px));
    min-height: calc(100vh - 76px);
    padding: 28px 0 80px;
}

.dashboard-page .admin-nav {
    display: none;
}

.dashboard-manage,
.dashboard-redirect {
    width: 100%;
    padding: 22px;
    text-align: center;
}

.dashboard-manage {
    display: grid;
    gap: 14px;
    border: 1px solid #ffffff35;
    border-radius: 20px;
    background: linear-gradient(110deg, var(--theme-accent-strong), var(--theme-accent));
    box-shadow: 0 18px 42px #08001838;
}

.dashboard-manage h1,
.dashboard-redirect h2 {
    margin: 0 0 2px;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: .5px;
}

.dashboard-manage-links,
.dashboard-redirect-links {
    display: grid;
    gap: 12px;
}

.dashboard-manage-links a {
    display: grid;
    min-height: 54px;
    place-items: center;
    padding: 10px 14px;
    border: 1px solid #ffffff2e;
    border-radius: 18px;
    background: #ffffff38;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .4px;
    text-decoration: none;
    transition: background .18s ease, transform .18s ease;
}

.dashboard-manage-links a:hover,
.dashboard-manage-links a:focus-visible {
    outline: none;
    background: #ffffff55;
    transform: translateY(-1px);
}

.dashboard-logout {
    margin: 0;
}

.dashboard-logout button {
    width: 100%;
    min-height: 54px;
    border: 1px solid #ffffff20;
    border-radius: 18px;
    background: #3f3f46;
    color: #fff;
    font: 700 19px 'Poppins', sans-serif;
    cursor: pointer;
}

.dashboard-logout button:hover,
.dashboard-logout button:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
    background: #27272a;
}

.dashboard-theme-form {
    display: flex;
    gap: 8px;
    margin: 0;
}

.dashboard-theme-form select {
    min-width: 0;
    min-height: 54px;
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #ffffff40;
    border-radius: 16px;
    outline: none;
    background: #170923;
    color: #fff;
    font: 500 14px 'Poppins', sans-serif;
}

.dashboard-theme-form option {
    background: #170923;
    color: #fff;
}

.dashboard-theme-form select:focus-visible {
    border-color: #fff;
    box-shadow: 0 0 0 3px #ffffff35;
}

.dashboard-theme-form button {
    width: 54px;
    min-height: 54px;
    border: 1px solid #ffffff40;
    border-radius: 16px;
    background: #170923;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
}

.dashboard-theme-form button:hover,
.dashboard-theme-form button:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.dashboard-redirect {
    border: 2px solid #fff;
    border-radius: 12px;
    background: linear-gradient(110deg, var(--theme-accent-strong), var(--theme-accent));
    box-shadow: 0 18px 42px #08001838;
}

.dashboard-redirect h2 {
    margin-bottom: 20px;
}

.dashboard-redirect-links button {
    min-height: 68px;
    border: 2px solid #fff;
    border-radius: 0;
    background: transparent;
    color: #fff;
    font: 500 15px 'Poppins', sans-serif;
    cursor: pointer;
    transition: background .18s ease, transform .18s ease;
}

.dashboard-redirect-links button:hover,
.dashboard-redirect-links button:focus-visible {
    outline: none;
    background: #ffffff24;
    transform: translateY(-1px);
}

.site-theme-panel {
    width: min(100%, 820px);
    margin-top: 20px;
}

.theme-form {
    grid-template-columns: minmax(0, 1fr);
    align-items: end;
    gap: 14px;
}

.theme-options {
    display: grid;
    min-width: 0;
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 0;
    padding: 0;
    border: 0;
}

.theme-options legend {
    margin-bottom: 8px;
    color: #eee6ff;
    font-size: 11px;
    font-weight: 600;
}

.theme-option {
    display: flex;
    min-height: 76px;
    align-items: center;
    gap: 12px;
    margin: 0;
    padding: 13px;
    border: 1px solid #ffffff24;
    border-radius: 13px;
    background: #ffffff08;
    cursor: pointer;
    transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.theme-option:hover {
    border-color: #ffffff55;
    transform: translateY(-1px);
}

.theme-option.is-selected {
    border-color: var(--admin-gold);
    background: #e2c86614;
    box-shadow: 0 0 0 2px #e2c86614;
}

.theme-option input {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    margin: 0;
    accent-color: var(--admin-gold);
}

.theme-swatch {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border: 1px solid #ffffff35;
    border-radius: 11px;
}

.theme-swatch-orange {
    background: linear-gradient(135deg, #fff 0 52%, #f47721 52%);
}

.theme-swatch-neon {
    background: linear-gradient(135deg, #fff 0 52%, #5146e5 52%);
}

.theme-option-copy {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.theme-option-copy strong {
    color: #fff;
    font-size: 11px;
}

.theme-option-copy small {
    color: var(--admin-muted);
    font-size: 9px;
    font-weight: 400;
    line-height: 1.5;
}

.theme-form .admin-primary-button {
    grid-column: 1;
    justify-self: end;
    width: auto;
    min-width: 180px;
    margin-top: 0;
}

.admin-welcome,
.page-heading {
    margin-bottom: 26px;
}

.admin-welcome {
    text-align: center;
}

.admin-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--admin-gold);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1.5px;
}

.admin-welcome h1,
.page-heading h1 {
    margin: 9px 0 6px;
    color: #fff;
    font-size: clamp(27px, 5vw, 38px);
    line-height: 1.2;
}

.admin-welcome p,
.page-heading p {
    margin: 0;
    color: var(--admin-muted);
    font-size: 12px;
    line-height: 1.7;
}

.outcome-panel {
    display: grid;
    width: min(100%, 820px);
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.outcome-button {
    display: flex;
    min-height: 160px;
    align-items: center;
    gap: 17px;
    padding: 24px;
    border: 1px solid #ffffff27;
    border-radius: 21px;
    background: var(--admin-panel);
    color: #fff;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.outcome-button:hover,
.outcome-button:focus-visible {
    outline: none;
    transform: translateY(-4px);
}

.outcome-success:hover,
.outcome-success:focus-visible {
    border-color: #62e5a188;
    box-shadow: 0 16px 40px #15965330;
}

.outcome-failed:hover,
.outcome-failed:focus-visible {
    border-color: #ff758588;
    box-shadow: 0 16px 40px #d9344830;
}

.outcome-icon {
    display: grid;
    width: 60px;
    height: 60px;
    flex: 0 0 60px;
    place-items: center;
    border: 1px solid #ffffff28;
    border-radius: 19px;
    background: #ffffff0c;
    font-size: 27px;
}

.outcome-success .outcome-icon {
    color: #68e9a2;
    box-shadow: 0 0 25px #39d9871f;
}

.outcome-failed .outcome-icon {
    color: #ff7788;
    box-shadow: 0 0 25px #ff40501f;
}

.outcome-button > span:nth-child(2) {
    display: grid;
    flex: 1;
    gap: 6px;
}

.outcome-button strong {
    font-size: 21px;
    font-weight: 700;
}

.outcome-button small {
    color: #c5b7d8;
    font-size: 10px;
    line-height: 1.6;
}

.outcome-arrow {
    color: #cbbddd;
}

.form-cancel-link,
.auth-return-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 20px;
    color: #e7d8f6;
    font-size: 11px;
    text-decoration: none;
}

.form-cancel-link:hover,
.auth-return-link:hover {
    color: var(--admin-gold);
}

.developer-watermark {
    position: fixed;
    right: 18px;
    bottom: 16px;
    z-index: 20;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 13px;
    border: 1px solid #ffffff30;
    border-radius: 999px;
    background: #170933e8;
    box-shadow: 0 8px 24px #08001880;
    color: #e7d8f6;
    font-size: 10px;
    text-decoration: none;
    backdrop-filter: blur(12px);
}

.developer-watermark i {
    color: #55e58a;
    font-size: 15px;
}

.developer-watermark strong {
    color: var(--admin-gold);
    font-weight: 700;
}

.developer-watermark:hover,
.developer-watermark:focus-visible {
    border-color: #55e58a88;
    outline: none;
    box-shadow: 0 8px 28px #20c76638;
}

.page-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.page-heading h1 {
    font-size: clamp(25px, 4vw, 34px);
}

.admin-content-grid {
    display: grid;
    grid-template-columns: minmax(270px, .8fr) minmax(0, 1.2fr);
    align-items: start;
    gap: 20px;
}

.admin-panel,
.auth-card {
    border: 1px solid var(--admin-border);
    border-radius: 19px;
    background: var(--admin-panel);
    box-shadow: 0 18px 50px #08001866, inset 0 1px #ffffff14;
}

.admin-panel {
    padding: 22px;
}

.panel-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.panel-icon {
    display: grid;
    width: 43px;
    height: 43px;
    flex: 0 0 43px;
    place-items: center;
    border: 1px solid #e2c86655;
    border-radius: 13px;
    background: #e2c86614;
    color: var(--admin-gold);
}

.panel-title h2 {
    margin: 0;
    color: #fff;
    font-size: 15px;
}

.panel-title p {
    margin: 3px 0 0;
    color: var(--admin-muted);
    font-size: 10px;
    line-height: 1.5;
}

.admin-form {
    display: grid;
    gap: 10px;
}

.admin-form label {
    margin-top: 4px;
    color: #eee6ff;
    font-size: 11px;
    font-weight: 600;
}

.admin-form input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]),
.admin-form textarea,
.admin-form select {
    width: 100%;
    min-height: 43px;
    padding: 10px 12px;
    border: 1px solid #ffffff2a;
    border-radius: 10px;
    outline: none;
    background: #09031a88;
    color: #fff;
    font: 12px 'Poppins', sans-serif;
}

.admin-form textarea {
    min-height: 150px;
    resize: vertical;
}

.admin-form input:focus,
.admin-form textarea:focus,
.admin-form select:focus {
    border-color: #c69bff;
    box-shadow: 0 0 0 3px #c69bff26;
}

.admin-checkbox {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 6px 0;
    color: #eee6ff;
    font-size: 11px;
}

.admin-checkbox input {
    width: 16px;
    height: 16px;
    accent-color: #d9b94f;
}

.admin-primary-button,
.admin-secondary-button {
    display: inline-flex;
    min-height: 43px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 15px;
    border: 1px solid #f4dc8c;
    border-radius: 10px;
    background: linear-gradient(110deg, #f3d875, #cf9f39);
    color: #281044;
    font: 700 12px 'Poppins', sans-serif;
    text-decoration: none;
    cursor: pointer;
}

.admin-primary-button {
    width: 100%;
    margin-top: 8px;
}

.admin-secondary-button {
    border-color: #ffffff2b;
    background: #ffffff0c;
    color: #f8edff;
}

.admin-secondary-button:hover {
    border-color: #e1c36780;
    color: #ffe28a;
}

.pack-admin-list {
    display: grid;
    gap: 9px;
}

.pack-admin-row {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid #ffffff18;
    border-radius: 12px;
    background: #ffffff07;
}

.pack-admin-coin {
    display: grid;
    width: 39px;
    height: 39px;
    flex: 0 0 39px;
    place-items: center;
    border-radius: 11px;
    background: #ffffff0d;
}

.pack-admin-coin img {
    width: 33px;
    height: 33px;
    object-fit: contain;
}

.pack-admin-info {
    display: grid;
    min-width: 0;
    flex: 1;
    gap: 3px;
}

.pack-admin-info strong {
    color: #111111;
    font-size: 12px;
    overflow-wrap: anywhere;
}

.pack-admin-info span {
    color: #c5b7d8;
    font-size: 10px;
}

.icon-action {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    place-items: center;
    border: 1px solid #ffffff1c;
    border-radius: 9px;
    background: #ffffff08;
    color: #e9dcf6;
    text-decoration: none;
    cursor: pointer;
}

.icon-action:hover {
    border-color: #e1c36788;
    color: #ffe28a;
}

.icon-action.is-danger:hover {
    border-color: #ff758588;
    color: #ff8c9a;
}

.pack-admin-row form {
    margin: 0;
}

.form-error,
.form-success {
    margin: 0 0 16px;
    padding: 11px 13px;
    border: 1px solid #ff758566;
    border-radius: 10px;
    background: #a52e452b;
    color: #ffccd2;
    font-size: 11px;
    line-height: 1.6;
}

.form-success {
    border-color: #62e5a155;
    background: #1596531e;
    color: #a8f4c9;
}

.form-error[hidden] {
    display: none;
}

.reason-form {
    max-width: 720px;
}

.empty-state {
    padding: 20px 10px;
    color: var(--admin-muted);
    font-size: 12px;
    text-align: center;
}

.auth-page {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 24px;
}

.auth-card {
    width: min(100%, 430px);
    padding: 30px;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 27px;
    color: #fff;
    font-size: 17px;
    font-weight: 900;
    letter-spacing: .7px;
    text-decoration: none;
}

.auth-brand img {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: #fff;
    object-fit: contain;
}

.auth-brand span {
    color: var(--admin-gold);
    font-size: 9px;
    letter-spacing: 1px;
}

.auth-card h1 {
    margin: 9px 0 5px;
    color: #fff;
    font-size: 25px;
}

.auth-description {
    margin: 0 0 19px;
    color: var(--admin-muted);
    font-size: 11px;
    line-height: 1.7;
}

.auth-return-link {
    justify-content: center;
    width: 100%;
    margin-top: 17px;
}

@media (max-width: 760px) {
    .outcome-panel {
        grid-template-columns: 1fr;
    }

    .admin-header {
        flex-wrap: wrap;
        gap: 9px 15px;
        padding: 11px 16px;
    }

    .admin-nav {
        order: 3;
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        border-top: 1px solid #ffffff18;
        padding-top: 8px;
    }

    .admin-nav a,
    .admin-nav form button {
        min-height: 35px;
        padding: 7px 9px;
        font-size: 10px;
    }

    .admin-content-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 540px) {
    .dashboard-main {
        min-height: calc(100vh - 130px);
        padding-top: 22px;
    }

    .outcome-panel {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .theme-options {
        grid-template-columns: 1fr;
    }

    .theme-form .admin-primary-button {
        justify-self: stretch;
        width: 100%;
    }

    .dashboard-page .developer-watermark {
        display: none;
    }

    .outcome-button {
        min-height: 122px;
        padding: 17px;
        border-radius: 17px;
    }

    .outcome-icon {
        width: 51px;
        height: 51px;
        flex-basis: 51px;
        font-size: 23px;
    }

    .admin-main {
        width: min(100% - 28px, 580px);
        padding-top: 30px;
    }

    .page-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .auth-card,
    .admin-panel {
        padding: 21px;
    }
}
