@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --admin-bg: #f4f5f7;
    --admin-surface: #ffffff;
    --admin-ink: #16171a;
    --admin-muted: #737780;
    --admin-line: #e5e7eb;
    --admin-blue: #087cf0;
    --admin-blue-soft: #eef6ff;
    --admin-red: #e5484d;
    --admin-green: #15803d;
    --admin-sidebar: #090a0d;
}

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

body {
    background: var(--admin-bg);
    color: var(--admin-ink);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    color: inherit;
}

.auth-page {
    align-items: center;
    background:
        radial-gradient(circle at 12% 20%, rgba(8, 124, 240, 0.16), transparent 32%),
        radial-gradient(circle at 90% 82%, rgba(76, 72, 230, 0.13), transparent 30%),
        #07080a;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding: 28px;
}

.auth-card {
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 28px;
    box-shadow: 0 35px 100px rgba(0, 0, 0, 0.45);
    max-width: 540px;
    padding: 44px;
    width: 100%;
}

.auth-card--compact {
    max-width: 470px;
}

.admin-brand {
    align-items: baseline;
    display: inline-flex;
    font-size: 19px;
    font-weight: 800;
    letter-spacing: -0.055em;
}

.admin-brand strong {
    color: var(--admin-blue);
}

.admin-brand small {
    background: rgba(8, 124, 240, 0.1);
    border-radius: 999px;
    color: var(--admin-blue);
    font-size: 7px;
    letter-spacing: 0.12em;
    margin-left: 8px;
    padding: 4px 6px;
}

.auth-card__intro {
    margin-block: 42px 26px;
}

.admin-eyebrow {
    color: var(--admin-blue);
    font-size: 10px !important;
    font-weight: 700;
    letter-spacing: 0.12em;
    margin-bottom: 9px;
    text-transform: uppercase;
}

.auth-card h1 {
    font-size: 34px;
    letter-spacing: -0.05em;
    line-height: 1.08;
}

.auth-card__intro > p:last-child {
    color: var(--admin-muted);
    font-size: 13px;
    line-height: 1.65;
    margin-top: 13px;
}

.auth-form {
    display: grid;
    gap: 17px;
}

.auth-form label,
.form-grid label {
    display: grid;
    gap: 8px;
}

.auth-form label > span,
.form-grid label > span {
    color: #464951;
    font-size: 11px;
    font-weight: 600;
}

.auth-form small,
.form-grid small {
    color: #91949b;
    font-size: 10px;
}

input,
select,
textarea {
    background: #fff;
    border: 1px solid #dfe2e7;
    border-radius: 11px;
    color: var(--admin-ink);
    outline: none;
    padding: 12px 14px;
    transition: border-color 160ms ease, box-shadow 160ms ease;
    width: 100%;
}

input,
select {
    min-height: 44px;
}

textarea {
    line-height: 1.55;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--admin-blue);
    box-shadow: 0 0 0 3px rgba(8, 124, 240, 0.11);
}

input[type="file"] {
    border-style: dashed;
    cursor: pointer;
    padding: 17px;
}

input[type="file"]::file-selector-button {
    background: #eef1f5;
    border: 0;
    border-radius: 7px;
    cursor: pointer;
    font-size: 10px;
    font-weight: 700;
    margin-right: 12px;
    padding: 8px 10px;
}

input[type="color"] {
    cursor: pointer;
    min-height: 46px;
    padding: 5px;
    width: 58px;
}

.admin-button {
    align-items: center;
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    display: inline-flex;
    font-size: 11px;
    font-weight: 700;
    justify-content: center;
    min-height: 42px;
    padding: 0 17px;
    transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

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

.admin-button--primary {
    background: var(--admin-blue);
    box-shadow: 0 8px 20px rgba(8, 124, 240, 0.2);
    color: #fff;
}

.admin-button--primary:hover {
    box-shadow: 0 11px 25px rgba(8, 124, 240, 0.29);
}

.admin-button--secondary {
    background: #fff;
    border-color: var(--admin-line);
    color: #3a3d43;
}

.auth-form .admin-button {
    margin-top: 7px;
    width: 100%;
}

.auth-back {
    color: #868991;
    display: block;
    font-size: 10px;
    margin-top: 26px;
    text-align: center;
}

.alert {
    border-radius: 11px;
    font-size: 11px;
    line-height: 1.5;
    margin-bottom: 22px;
    padding: 13px 15px;
}

.alert--error {
    background: #fff0f0;
    border: 1px solid #ffd2d2;
    color: #b4232a;
}

.alert--success {
    background: #edfff3;
    border: 1px solid #c7f4d5;
    color: var(--admin-green);
}

.admin-page {
    min-height: 100vh;
}

.admin-sidebar {
    background: var(--admin-sidebar);
    color: #fff;
    display: flex;
    flex-direction: column;
    height: 100vh;
    justify-content: space-between;
    left: 0;
    padding: 30px 18px 22px;
    position: fixed;
    top: 0;
    width: 245px;
    z-index: 20;
}

.admin-sidebar .admin-brand {
    margin-left: 12px;
}

.admin-nav {
    display: grid;
    gap: 5px;
    margin-top: 44px;
}

.admin-nav button {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 10px;
    color: #858992;
    cursor: pointer;
    display: flex;
    font-size: 11px;
    font-weight: 500;
    gap: 12px;
    min-height: 43px;
    padding: 0 12px;
    text-align: left;
    transition: background 160ms ease, color 160ms ease;
    width: 100%;
}

.admin-nav button i {
    color: #4d5057;
    font-size: 8px;
    font-style: normal;
    letter-spacing: 0.08em;
}

.admin-nav button:hover {
    background: rgba(255, 255, 255, 0.04);
    color: #dddfe4;
}

.admin-nav button.is-active {
    background: rgba(8, 124, 240, 0.14);
    color: #fff;
}

.admin-nav button.is-active i {
    color: #4fa5ff;
}

.admin-sidebar__footer {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: grid;
    gap: 10px;
    padding: 18px 12px 0;
}

.admin-sidebar__footer a,
.admin-sidebar__footer button {
    background: none;
    border: 0;
    color: #6f737b;
    cursor: pointer;
    font-size: 9px;
    text-align: left;
}

.admin-sidebar__footer a:hover,
.admin-sidebar__footer button:hover {
    color: #fff;
}

.admin-shell {
    margin-left: 245px;
    min-height: 100vh;
}

.admin-topbar {
    align-items: center;
    background: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid var(--admin-line);
    backdrop-filter: blur(15px);
    display: flex;
    height: 68px;
    justify-content: space-between;
    padding: 0 36px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.admin-topbar p {
    color: #92959c;
    font-size: 8px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.admin-topbar strong {
    display: block;
    font-size: 11px;
    margin-top: 2px;
}

.save-state {
    align-items: center;
    color: #8b8f97;
    display: flex;
    font-size: 9px;
    gap: 7px;
}

.save-state::before {
    background: #20a958;
    border-radius: 50%;
    content: "";
    height: 6px;
    width: 6px;
}

.save-state.is-dirty {
    color: #9b6700;
}

.save-state.is-dirty::before {
    background: #e3a008;
}

.admin-menu-toggle {
    background: transparent;
    border: 0;
    cursor: pointer;
    display: none;
}

.admin-content {
    margin: 0 auto;
    max-width: 1160px;
    padding: 46px 36px 100px;
}

.admin-section {
    display: none;
}

.admin-section.is-active {
    display: block;
    animation: section-in 220ms ease;
}

@keyframes section-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.admin-section__heading {
    align-items: flex-end;
    display: flex;
    gap: 30px;
    justify-content: space-between;
    margin-bottom: 30px;
}

.admin-section__heading h1 {
    font-size: 31px;
    letter-spacing: -0.045em;
    line-height: 1.1;
}

.admin-section__heading > div:first-child > p:last-child {
    color: var(--admin-muted);
    font-size: 11px;
    margin-top: 9px;
}

.admin-actions {
    display: flex;
    gap: 9px;
}

.form-card {
    background: var(--admin-surface);
    border: 1px solid var(--admin-line);
    border-radius: 18px;
    box-shadow: 0 4px 18px rgba(25, 33, 47, 0.025);
    margin-bottom: 18px;
    padding: 28px;
}

.form-card__heading {
    border-bottom: 1px solid #eceef1;
    margin-bottom: 25px;
    padding-bottom: 20px;
}

.form-card__heading h2 {
    font-size: 15px;
    letter-spacing: -0.025em;
}

.form-card__heading p {
    color: var(--admin-muted);
    font-size: 10px;
    margin-top: 5px;
}

.form-grid {
    display: grid;
    gap: 19px;
}

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

.field-full {
    grid-column: 1 / -1;
}

.input-large {
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.color-field {
    align-items: center;
    display: flex;
    gap: 10px;
}

.color-field code {
    color: #737780;
    font-size: 10px;
}

.upload-field {
    background: #fafbfc;
    border-radius: 12px;
    padding: 13px;
}

.stack-list {
    display: grid;
    gap: 15px;
}

.item-card {
    margin-bottom: 0;
}

.item-card__top {
    align-items: center;
    border-bottom: 1px solid #eceef1;
    display: flex;
    justify-content: space-between;
    margin-bottom: 25px;
    padding-bottom: 17px;
}

.item-card__top > span,
.item-card__top > div:first-child > span {
    color: #92959c;
    display: block;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.item-card__top > div:first-child > strong {
    display: block;
    font-size: 14px;
    margin-top: 3px;
}

.item-card__actions {
    align-items: center;
    display: flex;
    gap: 20px;
}

.danger-link {
    background: transparent;
    border: 0;
    color: var(--admin-red);
    cursor: pointer;
    font-size: 9px;
    font-weight: 600;
}

.switch {
    align-items: center;
    color: #737780;
    cursor: pointer;
    display: inline-flex !important;
    font-size: 9px !important;
    font-weight: 600;
    gap: 8px !important;
}

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

.switch i {
    background: #d8dbe0;
    border-radius: 999px;
    display: inline-block;
    height: 20px;
    position: relative;
    transition: background 160ms ease;
    width: 35px;
}

.switch i::after {
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    content: "";
    height: 16px;
    left: 2px;
    position: absolute;
    top: 2px;
    transition: transform 160ms ease;
    width: 16px;
}

.switch input:checked + i {
    background: var(--admin-blue);
}

.switch input:checked + i::after {
    transform: translateX(15px);
}

.switch--field {
    align-self: end;
    border: 1px solid #e3e5e9;
    border-radius: 11px;
    min-height: 44px;
    padding-inline: 13px;
}

.product-editor__layout {
    align-items: start;
    display: grid;
    gap: 28px;
    grid-template-columns: 200px 1fr;
}

.image-preview {
    align-items: center;
    background: #0d0e11;
    border-radius: 14px;
    color: #686c74;
    display: flex;
    font-size: 9px;
    justify-content: center;
    min-height: 240px;
    overflow: hidden;
    position: sticky;
    top: 90px;
}

.image-preview img {
    height: 240px;
    object-fit: cover;
    width: 100%;
}

.stats-editor {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(3, 1fr);
}

.stat-editor {
    background: #f8f9fa;
    border: 1px solid #eceef1;
    border-radius: 12px;
    display: grid;
    gap: 10px;
    grid-template-columns: 0.5fr 1fr 0.5fr;
    padding: 15px;
}

.stat-editor label {
    display: grid;
    gap: 5px;
}

.stat-editor label:last-child {
    grid-column: 1 / -1;
}

.stat-editor span {
    color: #797d85;
    font-size: 8px;
    font-weight: 600;
}

.stat-editor input {
    min-height: 38px;
    padding: 8px;
}

.account-form {
    max-width: 660px;
}

@media (max-width: 980px) {
    .admin-sidebar {
        transform: translateX(-100%);
        transition: transform 200ms ease;
    }

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

    .admin-shell {
        margin-left: 0;
    }

    .admin-menu-toggle {
        display: block;
    }

    .admin-topbar {
        justify-content: flex-start;
        gap: 16px;
    }

    .admin-topbar .save-state {
        margin-left: auto;
    }

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

@media (max-width: 720px) {
    .auth-page {
        padding: 14px;
    }

    .auth-card {
        border-radius: 20px;
        padding: 28px 22px;
    }

    .admin-topbar {
        padding-inline: 18px;
    }

    .save-state {
        display: none;
    }

    .admin-content {
        padding: 32px 14px 80px;
    }

    .admin-section__heading {
        align-items: stretch;
        flex-direction: column;
    }

    .admin-section__heading .admin-button {
        width: 100%;
    }

    .admin-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .form-card {
        border-radius: 15px;
        padding: 20px 16px;
    }

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

    .field-full {
        grid-column: auto;
    }

    .item-card__top {
        align-items: flex-start;
        gap: 16px;
    }

    .item-card__actions {
        align-items: flex-end;
        flex-direction: column;
        gap: 9px;
    }

    .product-editor__layout {
        grid-template-columns: 1fr;
    }

    .image-preview {
        min-height: 220px;
        position: static;
    }

    .image-preview img {
        height: 260px;
    }
}
