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

:root {
    --p: #7c6ef7;
    --p2: #a89cf8;
    --p3: #5a4ed4;
    --p4: #ede9fe;
    --acc: #4ecdc4;
    --acc2: #f7c948;
    --bg: #f4f2ff;
    --bg2: #edeafd;
    --bg3: #faf9ff;
    --surf: #ffffff;
    --sf2: #f7f5ff;
    --tx: #1a1535;
    --tx2: #4a4468;
    --tx3: #8b84aa;
    --bdr: rgba(124, 110, 247, .15);
    --sh: 0 8px 32px rgba(124, 110, 247, .12);
    --sh2: 0 20px 60px rgba(124, 110, 247, .18);
    --r: 16px;
    --rs: 8px;
    --rl: 24px;
    --ease: cubic-bezier(.4, 0, .2, 1);
    --font: 'Google Sans', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg3);
    color: var(--tx);
    overflow-x: hidden;
    line-height: 1.7;
}

::-webkit-scrollbar {
    width: 5px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--p);
    border-radius: 3px;
}

.btn-p {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: 12px 28px;
    background: var(--p);
    color: #fff;
    border: none;
    border-radius: 100px;
    font-family: var(--font);
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all .3s var(--ease);
}

.btn-p:hover {
    background: var(--p3);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(124, 110, 247, .4);
}

.btn-p.full {
    width: 100%;
    justify-content: center;
}

.btn-o {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: 11px 26px;
    background: transparent;
    color: var(--p);
    border: 2px solid var(--p);
    border-radius: 100px;
    font-family: var(--font);
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all .3s var(--ease);
}

.btn-o:hover {
    background: var(--p4);
}

.demo-banner {
    background: linear-gradient(90deg, #7c6ef7, #4ecdc4);
    color: #fff;
    text-align: center;
    padding: .55rem 1rem;
    font-size: .78rem;
    font-weight: 600;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    flex-wrap: wrap;
}

.demo-banner code {
    background: rgba(0, 0, 0, .25);
    padding: 1px 8px;
    border-radius: 6px;
    font-family: monospace;
    letter-spacing: .03em;
    font-size: .8rem;
}

.demo-badge {
    background: rgba(255, 255, 255, .25);
    padding: 2px 10px;
    border-radius: 100px;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .05em;
}

body.admin-body-bg {
    background: var(--bg);
}

.admin-overlay {
    position: fixed;
    inset: 0;
    background: rgba(13, 8, 32, .92);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.login-card {
    background: var(--surf);
    border-radius: var(--rl);
    padding: 3rem;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--sh2);
    border: 1px solid var(--bdr);
    text-align: center;
}

.lock-icon {
    width: 60px;
    height: 60px;
    background: var(--p4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--p);
    font-size: 1.5rem;
    margin: 0 auto 1.2rem;
}

.login-card h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--tx);
    margin-bottom: .3rem;
}

.login-card p {
    color: var(--tx3);
    font-size: .85rem;
    margin-bottom: 1.8rem;
}

.login-err {
    color: #dc2626;
    font-size: .8rem;
    margin-top: .5rem;
    display: none;
}

.pw-hint {
    font-size: .75rem;
    color: var(--tx3);
    margin-top: .9rem;
    background: var(--p4);
    padding: .5rem .9rem;
    border-radius: var(--rs);
}

.pw-hint code {
    color: var(--p3);
    font-family: monospace;
}

.admin-nav {
    background: var(--surf);
    border-bottom: 1px solid var(--bdr);
    padding: .9rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    z-index: 100;
}

.anlogo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--tx);
}

.anlogo span {
    color: var(--p);
}

.admin-body {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 0 2rem 4rem;
}

.admin-tabs {
    display: flex;
    gap: .4rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.atab {
    padding: 8px 18px;
    border-radius: 100px;
    border: 1px solid var(--bdr);
    background: transparent;
    color: var(--tx2);
    font-size: .83rem;
    font-weight: 500;
    cursor: pointer;
    transition: all .3s;
    font-family: var(--font);
}

.atab.active {
    background: var(--p);
    color: #fff;
    border-color: var(--p);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.acard {
    background: var(--surf);
    border: 1px solid var(--bdr);
    border-radius: var(--rl);
    padding: 1.8rem;
    margin-bottom: 1.5rem;
}

.acard h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--tx);
    margin-bottom: 1.3rem;
    padding-bottom: .7rem;
    border-bottom: 1px solid var(--bdr);
    display: flex;
    align-items: center;
    gap: .5rem;
}

.acard h3 i {
    color: var(--p);
}

.ag2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.ag3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
}

.afg {
    display: flex;
    flex-direction: column;
    gap: .4rem;
    margin-bottom: 1rem;
}

.afg label {
    font-size: .78rem;
    font-weight: 600;
    color: var(--tx2);
}

.afg input,
.afg textarea,
.afg select {
    padding: 9px 13px;
    background: var(--sf2);
    border: 1px solid var(--bdr);
    border-radius: var(--r);
    font-family: var(--font);
    font-size: .88rem;
    color: var(--tx);
    outline: none;
    transition: border-color .3s;
    width: 100%;
}

.afg input:focus,
.afg textarea:focus,
.afg select:focus {
    border-color: var(--p);
}

.btn-row {
    display: flex;
    gap: .7rem;
    flex-wrap: wrap;
    margin-top: 1.2rem;
    align-items: center;
}

.img-preview {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--bdr);
    margin-top: .4rem;
}

.img-prev-rect {
    border-radius: var(--rs);
    width: 120px;
    height: 80px;
}

.upload-area {
    border: 2px dashed var(--bdr);
    border-radius: var(--r);
    padding: 1.2rem;
    text-align: center;
    cursor: pointer;
    transition: all .3s;
    background: var(--sf2);
}

.upload-area:hover {
    border-color: var(--p);
    background: var(--p4);
}

.upload-area i {
    font-size: 1.5rem;
    color: var(--tx3);
    display: block;
    margin-bottom: .4rem;
}

.upload-area p {
    color: var(--tx3);
    font-size: .8rem;
}

.upload-area input {
    display: none;
}

.sortable-list {
    display: flex;
    flex-direction: column;
    gap: .7rem;
    margin-bottom: 1.2rem;
}

.sort-item {
    display: flex;
    align-items: center;
    gap: .8rem;
    background: var(--sf2);
    border: 1px solid var(--bdr);
    border-radius: var(--r);
    padding: .8rem 1rem;
    cursor: grab;
    transition: all .3s;
}

.sort-item:active {
    cursor: grabbing;
    opacity: .7;
}

.sort-item.dragging {
    opacity: .4;
}

.sort-item.drag-over {
    border-color: var(--p);
    background: var(--p4);
}

.drag-handle {
    color: var(--tx3);
    font-size: .9rem;
    cursor: grab;
}

.sort-item img {
    width: 40px;
    height: 30px;
    border-radius: var(--rs);
    object-fit: cover;
    flex-shrink: 0;
}

.si-info {
    flex: 1;
    min-width: 0;
}

.si-info strong {
    font-size: .88rem;
    color: var(--tx);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.si-info span {
    font-size: .75rem;
    color: var(--tx3);
}

.si-actions {
    display: flex;
    gap: .4rem;
    flex-shrink: 0;
}

.btn-sm {
    padding: 6px 14px;
    font-size: .78rem;
}

.btn-edit {
    background: var(--p4);
    color: var(--p3);
    border: none;
    border-radius: var(--rs);
    padding: 5px 12px;
    font-size: .75rem;
    cursor: pointer;
    font-family: var(--font);
    transition: all .3s;
}

.btn-edit:hover {
    background: var(--p);
    color: #fff;
}

.btn-del {
    background: #fef2f2;
    color: #dc2626;
    border: none;
    border-radius: var(--rs);
    padding: 5px 10px;
    font-size: .75rem;
    cursor: pointer;
    font-family: var(--font);
    transition: all .3s;
}

.btn-del:hover {
    background: #dc2626;
    color: #fff;
}

.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 11px 22px;
    border-radius: var(--r);
    font-size: .85rem;
    font-weight: 500;
    box-shadow: var(--sh2);
    z-index: 10000;
    transform: translateY(100px);
    opacity: 0;
    transition: all .4s var(--ease);
    color: #fff;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.ok {
    background: #16a34a;
}

.toast.err {
    background: #dc2626;
}

.toast.info {
    background: var(--tx);
}

.section-note {
    font-size: .8rem;
    color: var(--tx3);
    margin-bottom: 1rem;
    line-height: 1.5;
    background: var(--p4);
    padding: .7rem 1rem;
    border-radius: var(--rs);
    border-left: 3px solid var(--p);
}

.bar-group {
    padding: 1rem;
    background: var(--sf2);
    border: 1px solid var(--bdr);
    border-radius: var(--r);
    margin-bottom: 1rem;
}

.bar-group-header {
    display: flex;
    gap: .6rem;
    align-items: flex-end;
    margin-bottom: .8rem;
}

.bar-group-header .afg {
    margin-bottom: 0;
}

.bar-item-row {
    display: flex;
    gap: .6rem;
    align-items: flex-end;
    margin-bottom: .5rem;
}

.bar-item-row .afg {
    margin-bottom: 0;
    flex: 1;
}

.inline-row {
    display: flex;
    gap: .6rem;
    align-items: flex-end;
    margin-bottom: .9rem;
    flex-wrap: wrap;
    padding: .9rem;
    background: var(--sf2);
    border: 1px solid var(--bdr);
    border-radius: var(--r);
}

.inline-row .afg {
    margin-bottom: 0;
    flex: 1;
    min-width: 120px;
}

@media (max-width: 900px) { .ag2, .ag3 { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .admin-body { padding: 0 1rem 4rem; } }