:root {
    --bg: #07111f;
    --bg-elevated: rgba(12, 21, 39, 0.82);
    --bg-soft: rgba(255, 255, 255, 0.06);
    --card: rgba(255, 255, 255, 0.08);
    --card-strong: rgba(255, 255, 255, 0.12);
    --card-border: rgba(255, 255, 255, 0.12);
    --text: #ecf4ff;
    --text-muted: #9fb0cf;
    --text-dim: #7d8aa8;
    --primary: #7c3aed;
    --primary-2: #22d3ee;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #38bdf8;
    --radius: 22px;
    --radius-sm: 16px;
    --shadow: 0 28px 70px rgba(0, 0, 0, 0.28);
    --container: 1200px;
    --sidebar-width: 290px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(124, 58, 237, 0.24), transparent 32%),
        radial-gradient(circle at top right, rgba(34, 211, 238, 0.16), transparent 24%),
        linear-gradient(180deg, #091320 0%, #08111b 48%, #07111f 100%);
    color: var(--text);
    line-height: 1.5;
}

body.theme-storefront {
    background:
        radial-gradient(circle at top left, rgba(34, 197, 94, 0.16), transparent 32%),
        radial-gradient(circle at bottom right, rgba(59, 130, 246, 0.18), transparent 28%),
        linear-gradient(180deg, #081620 0%, #07111a 100%);
}

body.theme-dashboard {
    background:
        radial-gradient(circle at top left, rgba(124, 58, 237, 0.18), transparent 28%),
        radial-gradient(circle at bottom left, rgba(14, 165, 233, 0.12), transparent 30%),
        linear-gradient(180deg, #060d18 0%, #08111c 100%);
}

body.admin-theme {
    --primary: #f97316;
    --primary-2: #facc15;
}

img {
    display: block;
    max-width: 100%;
}

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

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

button {
    cursor: pointer;
}

code {
    padding: 0.18rem 0.45rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    color: #d4e0ff;
}

h1,
h2,
h3,
h4,
p {
    margin: 0;
}

h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.05;
}

h2 {
    font-size: clamp(1.35rem, 2vw, 1.9rem);
}

h3 {
    font-size: 1.1rem;
}

small {
    color: var(--text-dim);
}

ul,
ol {
    margin: 0;
    padding-left: 1.1rem;
}

.container {
    width: min(calc(100% - 32px), var(--container));
    margin: 0 auto;
}

.page-space {
    padding-top: 28px;
    padding-bottom: 48px;
}

.row {
    display: flex;
    align-items: flex-start;
}

.wrap {
    flex-wrap: wrap;
}

.space-between {
    justify-content: space-between;
}

.align-center {
    align-items: center;
}

.align-end {
    align-items: flex-end;
}

.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.stack-8 > * + * { margin-top: 8px; }
.stack-10 > * + * { margin-top: 10px; }
.stack-12 > * + * { margin-top: 12px; }
.stack-16 > * + * { margin-top: 16px; }
.stack-20 > * + * { margin-top: 20px; }
.stack-24 > * + * { margin-top: 24px; }
.section-space { margin-top: 28px; }

.grid-2,
.grid-3,
.grid-4,
.hero-grid,
.auth-grid,
.store-detail-grid,
.stats-grid,
.catalog-grid,
.pricing-grid {
    display: grid;
    gap: 18px;
}

.grid-2,
.auth-grid,
.store-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3,
.pricing-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4,
.four-up,
.stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.three-up { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hero-grid { grid-template-columns: minmax(0, 1.18fr) minmax(320px, 0.82fr); align-items: stretch; }
.catalog-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.wide-aside { grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr); }

.card,
.hero-card,
.glass-card,
.notice-card,
.stat-card,
.catalog-card,
.pricing-card,
.auth-panel {
    position: relative;
    border: 1px solid var(--card-border);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.06));
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    backdrop-filter: blur(18px);
}

.card::before,
.hero-card::before,
.glass-card::before,
.pricing-card::before,
.auth-panel::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0), var(--primary), rgba(255, 255, 255, 0));
    opacity: 0.75;
}

.padded,
.hero-card,
.glass-card,
.pricing-card,
.auth-panel,
.notice-card,
.stat-card,
.catalog-card {
    padding: 22px;
}

.notice-card,
.notice-banner {
    background: linear-gradient(180deg, rgba(34, 211, 238, 0.14), rgba(255, 255, 255, 0.06));
    border: 1px solid rgba(34, 211, 238, 0.22);
}

.notice-banner {
    border-radius: var(--radius);
}

.eyebrow,
.tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #dce7ff;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hero-title {
    font-size: clamp(2.6rem, 6vw, 4.5rem);
    line-height: 0.98;
    letter-spacing: -0.04em;
    max-width: 12ch;
}

.hero-copy {
    max-width: 60ch;
    font-size: 1.05rem;
    color: var(--text-muted);
}

.hero-mosaic {
    display: grid;
    gap: 16px;
}

.store-hero {
    background:
        radial-gradient(circle at top right, color-mix(in srgb, var(--store-accent, var(--primary)) 45%, transparent), transparent 35%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.06));
}

.muted {
    color: var(--text-muted);
}

.center-text {
    text-align: center;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 1.02rem;
}

.brand-light {
    color: #fff;
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: inline-grid;
    place-items: center;
    font-weight: 900;
    color: white;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    box-shadow: 0 10px 22px rgba(124, 58, 237, 0.28);
}

.topbar,
.store-topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(16px);
    background: rgba(6, 12, 22, 0.68);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.topbar .container,
.store-topbar .container {
    min-height: 78px;
}

.nav-pills a,
.sidebar-nav a,
.mobile-menu a {
    display: inline-flex;
    align-items: center;
    padding: 11px 14px;
    border-radius: 14px;
    color: var(--text-muted);
    transition: 0.2s ease;
}

.nav-pills a:hover,
.sidebar-nav a:hover,
.mobile-menu a:hover,
.sidebar-nav a.is-active,
.nav-pills a.is-active {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.mobile-only {
    display: none;
}

.mobile-menu {
    display: none;
    flex-direction: column;
    gap: 8px;
    padding: 0 16px 16px;
}

.mobile-menu.is-open {
    display: flex;
}

.hamburger {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 12px 18px;
    border-radius: 15px;
    border: 1px solid transparent;
    font-weight: 700;
    transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

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

.btn-small {
    min-height: 38px;
    padding: 8px 13px;
    font-size: 0.92rem;
}

.btn-primary {
    color: white;
    background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary-2) 65%, var(--primary)));
    box-shadow: 0 16px 30px rgba(124, 58, 237, 0.24);
}

.btn-secondary {
    color: #dbe7ff;
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.07);
}

.btn-danger {
    color: white;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 16px 30px rgba(239, 68, 68, 0.16);
}

.field {
    display: grid;
    gap: 8px;
}

.field span {
    color: #d9e6ff;
    font-weight: 600;
}

.field small {
    color: var(--text-dim);
}

input,
select,
textarea {
    width: 100%;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(4, 11, 20, 0.72);
    color: var(--text);
    padding: 13px 14px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input::placeholder,
textarea::placeholder {
    color: #7f8ca9;
}

input:focus,
select:focus,
textarea:focus {
    border-color: color-mix(in srgb, var(--primary) 72%, white);
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.15);
}

textarea {
    min-height: 110px;
    resize: vertical;
}

.readonly-field input {
    letter-spacing: 0.02em;
}

.checkbox-group {
    padding: 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.checkbox {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
}

.checkbox input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--primary);
}

.table-wrap {
    overflow: auto;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(4, 11, 20, 0.44);
}

.table-wrap table {
    width: 100%;
    border-collapse: collapse;
    min-width: 640px;
}

.table-wrap th,
.table-wrap td {
    padding: 15px 16px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    vertical-align: top;
}

.table-wrap th {
    color: #d8e5ff;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: rgba(255, 255, 255, 0.05);
}

.table-wrap tr:last-child td {
    border-bottom: none;
}

.table-wrap tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.status-pill,
.lock-pill,
.price-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    width: fit-content;
}

.status-pill,
.price-pill {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.lock-pill,
.locked-card .btn {
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.24);
    color: #facc15;
}

.status-pending { background: rgba(245, 158, 11, 0.14); color: #fde68a; border: 1px solid rgba(245, 158, 11, 0.28); }
.status-approved,
.status-active,
.status-delivered { background: rgba(34, 197, 94, 0.14); color: #bbf7d0; border: 1px solid rgba(34, 197, 94, 0.28); }
.status-rejected,
.status-refunded,
.status-suspended,
.status-disabled { background: rgba(239, 68, 68, 0.14); color: #fecaca; border: 1px solid rgba(239, 68, 68, 0.28); }
.status-draft,
.status-pending_payment { background: rgba(56, 189, 248, 0.14); color: #bae6fd; border: 1px solid rgba(56, 189, 248, 0.28); }

.hero-card,
.catalog-card,
.pricing-card,
.auth-panel,
.stat-card,
.glass-card {
    height: 100%;
}

.catalog-card {
    display: grid;
    gap: 16px;
}

.catalog-media,
.detail-image {
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    aspect-ratio: 16 / 11;
    background:
        linear-gradient(135deg, rgba(124, 58, 237, 0.22), rgba(34, 211, 238, 0.16)),
        rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.catalog-media img,
.detail-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.locked-card {
    opacity: 0.92;
    border-color: rgba(245, 158, 11, 0.24);
    background: linear-gradient(180deg, rgba(245, 158, 11, 0.08), rgba(255, 255, 255, 0.05));
}

.price-line {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.price-line strong {
    font-size: 2.1rem;
}

.feature-list {
    display: grid;
    gap: 12px;
    list-style: none;
    padding: 0;
    color: var(--text-muted);
}

.feature-list li {
    padding-left: 1.4rem;
    position: relative;
}

.feature-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--primary-2);
}

.pricing-card.featured {
    border-color: rgba(34, 211, 238, 0.28);
    transform: translateY(-6px);
    background: linear-gradient(180deg, rgba(124, 58, 237, 0.18), rgba(255, 255, 255, 0.07));
}

.page-head {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.05));
}

.stat-card,
.stat-strip,
.usage-row,
.alert-item,
.delivery-box {
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
}

.stat-card {
    display: grid;
    gap: 10px;
}

.stat-card span,
.stat-strip span,
.usage-row span {
    color: var(--text-muted);
}

.stat-card strong,
.stat-strip strong,
.usage-row strong {
    font-size: 1.45rem;
}

.stat-strip,
.usage-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 16px;
}

.alert-list {
    display: grid;
    gap: 12px;
}

.alert-item,
.delivery-box {
    padding: 16px;
}

.delivery-box {
    color: #d1fae5;
    background: rgba(34, 197, 94, 0.08);
    border-color: rgba(34, 197, 94, 0.14);
    white-space: pre-wrap;
    word-break: break-word;
}

.number-list {
    display: grid;
    gap: 12px;
    counter-reset: item;
    list-style: none;
    padding: 0;
}

.number-list li {
    counter-increment: item;
    display: grid;
    grid-template-columns: 34px 1fr;
    gap: 12px;
    align-items: start;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.number-list li::before {
    content: counter(item);
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 12px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: white;
}

.auth-grid {
    align-items: stretch;
}

.auth-single {
    max-width: 560px;
    margin: 0 auto;
}

.auth-panel {
    min-height: 100%;
}

.text-link {
    color: #bfd2ff;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.details-panel {
    margin-top: 12px;
    padding: 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.compact input,
.compact select,
.compact textarea {
    padding-top: 10px;
    padding-bottom: 10px;
}

.bg-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(24px);
    z-index: -1;
    opacity: 0.6;
}

.orb-a {
    width: 290px;
    height: 290px;
    top: 60px;
    left: -70px;
    background: rgba(124, 58, 237, 0.24);
}

.orb-b {
    width: 260px;
    height: 260px;
    top: 20%;
    right: -40px;
    background: rgba(34, 211, 238, 0.18);
}

.flash {
    padding: 0;
}

.flash > div,
.flash-success,
.flash-error,
.flash-info {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.flash-success { background: rgba(34, 197, 94, 0.12); color: #dcfce7; border-color: rgba(34, 197, 94, 0.22); }
.flash-error { background: rgba(239, 68, 68, 0.12); color: #fee2e2; border-color: rgba(239, 68, 68, 0.2); }
.flash-info { background: rgba(56, 189, 248, 0.12); color: #e0f2fe; border-color: rgba(56, 189, 248, 0.22); }

.dashboard-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 26px 18px;
    background:
        linear-gradient(180deg, rgba(5, 10, 18, 0.95), rgba(7, 13, 24, 0.92)),
        radial-gradient(circle at top, rgba(124, 58, 237, 0.16), transparent 30%);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-sidebar {
    background:
        linear-gradient(180deg, rgba(17, 10, 5, 0.95), rgba(21, 13, 7, 0.92)),
        radial-gradient(circle at top, rgba(249, 115, 22, 0.16), transparent 30%);
}

.sidebar-head {
    display: grid;
    gap: 12px;
    padding-bottom: 20px;
    margin-bottom: 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-subtitle {
    color: var(--text-dim);
    font-size: 0.92rem;
}

.sidebar-nav {
    display: grid;
    gap: 8px;
}

.dashboard-main {
    min-width: 0;
}

.dashboard-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 28px 28px 0;
}

.dashboard-topbar p {
    color: var(--text-muted);
    margin-top: 8px;
}

.dashboard-content {
    padding: 22px 28px 40px;
}

.store-detail-grid .card {
    min-height: 100%;
}

.delivery-box + .delivery-box {
    margin-top: 12px;
}

@media (max-width: 1180px) {
    .grid-4,
    .four-up,
    .stats-grid,
    .grid-3,
    .pricing-grid,
    .catalog-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hero-grid,
    .wide-aside {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 980px) {
    .mobile-only {
        display: inline-flex;
    }

    .desktop-only {
        display: none !important;
    }

    .dashboard-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: min(88vw, 320px);
        transform: translateX(-100%);
        transition: transform 0.22s ease;
        z-index: 80;
        box-shadow: 22px 0 50px rgba(0, 0, 0, 0.32);
    }

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

    .dashboard-topbar,
    .dashboard-content {
        padding-left: 18px;
        padding-right: 18px;
    }

    .grid-2,
    .auth-grid,
    .store-detail-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .container {
        width: min(calc(100% - 24px), var(--container));
    }

    .page-space {
        padding-top: 18px;
        padding-bottom: 32px;
    }

    .catalog-grid,
    .grid-3,
    .grid-4,
    .stats-grid,
    .pricing-grid {
        grid-template-columns: 1fr;
    }

    .hero-title {
        max-width: none;
    }

    .padded,
    .hero-card,
    .glass-card,
    .pricing-card,
    .catalog-card,
    .auth-panel,
    .notice-card,
    .stat-card {
        padding: 18px;
    }

    .btn {
        width: 100%;
    }

    .row.wrap > .btn,
    .row.gap-12.wrap > .btn,
    .row.gap-8.wrap > .btn {
        flex: 1 1 100%;
    }

    .topbar .container,
    .store-topbar .container {
        min-height: 70px;
    }

    .dashboard-topbar {
        align-items: flex-start;
    }

    .table-wrap table {
        min-width: 560px;
    }
}
