:root {
    --ink: #27263f;
    --ink-soft: #4b5563;
    --muted: #737181;
    --paper: #ffffff;
    --canvas: #f8f7fa;
    --line: #e8e5ed;
    --purple: #7214e8;
    --purple-dark: #6d00e7;
    --purple-soft: #f1e8ff;
    --orange: #9138f5;
    --orange-soft: #f6ecff;
    --green: #16885b;
    --green-soft: #e5f8ef;
    --red: #c53838;
    --red-soft: #fff0f0;
    --amber: #a26309;
    --amber-soft: #fff5dc;
    --shadow-sm: 0 6px 22px rgba(39, 38, 63, .07);
    --shadow-lg: 0 24px 70px rgba(39, 38, 63, .15);
    --radius-sm: 10px;
    --radius: 18px;
    --radius-lg: 28px;
    --sidebar: 254px;
    color-scheme: light;
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background: var(--canvas);
    font-family: "Nunito", sans-serif;
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--purple); text-decoration: none; }
a:hover { color: var(--purple-dark); }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: "Readex Pro", sans-serif; font-weight: 500; line-height: 1.12; letter-spacing: -.025em; }
h1 { font-size: clamp(2rem, 4vw, 3.75rem); }
h2 { font-size: clamp(1.35rem, 2vw, 1.8rem); }
h3 { font-size: 1.05rem; }
code, .mono { font-family: "SFMono-Regular", Consolas, monospace; }

.brand-lockup {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: var(--ink);
    font-size: 1.45rem;
    font-weight: 850;
    letter-spacing: -.055em;
}
.brand-lockup:hover { color: var(--ink); }
.brand-lockup > span > span { color: var(--purple); }
.brand-lockup img { flex: 0 0 auto; }
.brand-lockup-image img { width: 139px; height: auto; }
.eyebrow, .step-label {
    margin: 0 0 7px;
    color: var(--purple);
    font-size: .73rem;
    font-weight: 800;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.button {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 10px 17px;
    cursor: pointer;
    font-weight: 750;
    line-height: 1.2;
    transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease;
}
.button:hover { transform: translateY(-1px); }
.button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible {
    outline: 3px solid rgba(111, 50, 255, .25);
    outline-offset: 2px;
}
.button:disabled { cursor: not-allowed; filter: grayscale(.5); opacity: .48; transform: none; }
.button-primary { color: #fff; background: var(--purple); box-shadow: 0 9px 22px rgba(111, 50, 255, .22); }
.button-primary:hover { color: #fff; background: var(--purple-dark); box-shadow: 0 11px 28px rgba(111, 50, 255, .28); }
.button-secondary { color: var(--ink); background: var(--paper); border-color: var(--line); }
.button-secondary:hover { color: var(--purple); border-color: #c7b8ee; }
.button-ghost { color: var(--ink-soft); background: transparent; border-color: var(--line); }
.button-danger { color: var(--red); background: var(--red-soft); border-color: #f5c6c6; }
.button-wide { width: 100%; }
.button-small { min-height: 36px; padding: 8px 12px; font-size: .82rem; border-radius: 9px; }

.alert { border: 1px solid; border-radius: 13px; padding: 12px 15px; margin-bottom: 18px; }
.alert ul { margin: 6px 0 0; padding-left: 18px; }
.alert-success { color: #0e6e48; background: var(--green-soft); border-color: #bcebd5; }
.alert-error { color: #9a2626; background: var(--red-soft); border-color: #f4c8c8; }

.form-stack { display: grid; gap: 18px; }
.form-stack.compact { gap: 12px; }
.form-grid { display: grid; gap: 15px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { display: grid; gap: 7px; color: var(--ink-soft); font-size: .85rem; font-weight: 720; }
.field input, .field select, .field textarea, .search-field input {
    width: 100%;
    border: 1px solid #dcd7e4;
    border-radius: 11px;
    color: var(--ink);
    background: #fff;
    padding: 11px 13px;
    font-weight: 520;
    transition: border-color .16s ease, box-shadow .16s ease;
}
.field input, .field select { min-height: 46px; }
.field textarea { resize: vertical; min-height: 84px; }
.field input:focus, .field select:focus, .field textarea:focus, .search-field input:focus {
    border-color: var(--purple);
    box-shadow: 0 0 0 3px rgba(111, 50, 255, .09);
}
.field small { color: var(--muted); font-size: .75rem; font-weight: 500; }
.field-wide { grid-column: 1 / -1; }
.check { display: flex; align-items: flex-start; gap: 9px; color: var(--ink-soft); font-size: .84rem; }
.check input { flex: 0 0 auto; width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--purple); }
.form-inline { display: flex; align-items: center; gap: 12px; }
.form-inline-between { justify-content: space-between; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; }
.form-note { margin: -5px 0 0; text-align: center; color: var(--muted); font-size: .76rem; }
.honeypot { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }

/* Authentication */
.guest-body { background: #0f172a; }
.guest-shell { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(430px, .85fr); min-height: 100vh; }
.guest-brand {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    padding: clamp(28px, 5vw, 72px);
    color: #fff;
    background:
        radial-gradient(circle at 78% 7%, rgba(79, 157, 204, .18), transparent 27%),
        radial-gradient(circle at 16% 88%, rgba(114, 20, 232, .42), transparent 36%),
        #111326;
}
.guest-brand::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: .18;
    background-image: linear-gradient(rgba(255,255,255,.22) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.22) 1px, transparent 1px);
    background-size: 54px 54px;
    mask-image: linear-gradient(to bottom, #000, transparent 85%);
}
.guest-brand .brand-lockup { position: relative; z-index: 2; color: #fff; }
.guest-brand .brand-lockup > span > span { color: #a783ff; }
.guest-copy { position: relative; z-index: 2; max-width: 700px; margin-top: clamp(80px, 14vh, 150px); }
.guest-copy .eyebrow { color: #bdabf3; }
.guest-copy h1 { max-width: 650px; margin-bottom: 24px; font-weight: 500; }
.guest-copy > p { max-width: 570px; color: #c9c4d8; font-size: clamp(1rem, 1.4vw, 1.18rem); }
.guest-points { display: grid; gap: 12px; margin: 35px 0 0; padding: 0; list-style: none; color: #e5e1ee; }
.guest-points li { display: flex; align-items: center; gap: 13px; }
.guest-points span { color: #aa91ec; font: 700 .7rem "SFMono-Regular", Consolas, monospace; }
.guest-preview {
    position: absolute;
    z-index: 1;
    width: min(42%, 370px);
    right: clamp(-55px, -3vw, -18px);
    bottom: -8%;
    transform: rotate(5deg);
    filter: drop-shadow(0 30px 50px rgba(0,0,0,.42));
}
.guest-preview { display: grid; gap: 11px; padding: 23px; border: 1px solid rgba(255,255,255,.18); border-radius: 23px; color: var(--ink); background: rgba(255,255,255,.96); box-shadow: 0 24px 70px rgba(0,0,0,.26); }
.guest-preview-head { display: grid; margin-bottom: 3px; line-height: 1.35; }
.guest-preview-head span { color: var(--purple); font-size: .64rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.guest-preview-head b { font-family: "Readex Pro", sans-serif; font-size: 1.1rem; font-weight: 500; }
.guest-preview-product { display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 10px; padding: 9px; border: 1px solid var(--line); border-radius: 11px; }
.guest-preview-product > i { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 9px; color: #fff; background: linear-gradient(135deg,#4f9dcc,#7214e8); font-style: normal; font-weight: 800; }
.guest-preview-product > span { display: grid; line-height: 1.3; }
.guest-preview-product b { font-size: .7rem; }
.guest-preview-product small { color: var(--muted); font-size: .62rem; }
.guest-preview-product em { color: var(--purple); font-style: normal; font-weight: 800; }
.guest-preview-total { display: flex; justify-content: space-between; padding-top: 10px; border-top: 1px solid var(--line); font-size: .72rem; }
.guest-preview-action { display: flex; justify-content: center; gap: 16px; padding: 10px; border-radius: 10px; color: #fff; background: var(--purple); font-size: .7rem; font-weight: 800; }
.guest-panel { display: grid; align-content: center; justify-items: center; gap: 18px; padding: 34px; background: #faf9fb; }
.auth-card { width: min(100%, 540px); padding: clamp(26px, 4.5vw, 50px); border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fff; box-shadow: var(--shadow-lg); }
.auth-heading { margin-bottom: 28px; }
.auth-heading h2 { margin-bottom: 10px; font-size: clamp(1.65rem, 3vw, 2.25rem); }
.auth-heading p:last-child { color: var(--ink-soft); }
.auth-switch { margin: 24px 0 0; text-align: center; color: var(--ink-soft); }
.auth-footnote { margin: 0; color: var(--muted); font-size: .76rem; }

/* Signed-in shell */
.app-shell { min-height: 100vh; }
.sidebar {
    position: fixed;
    z-index: 40;
    inset: 0 auto 0 0;
    width: var(--sidebar);
    display: flex;
    flex-direction: column;
    padding: 26px 18px;
    color: #fff;
    background: #0f172a;
    border-right: 1px solid rgba(255,255,255,.07);
}
.brand-lockup-sidebar { color: #fff; padding: 0 10px 24px; }
.brand-lockup-sidebar img { width: 132px; }
.brand-lockup-sidebar:hover { color: #fff; }
.store-chip { display: flex; align-items: center; gap: 10px; margin: 4px 0 24px; padding: 11px; border: 1px solid rgba(255,255,255,.1); border-radius: 13px; background: rgba(255,255,255,.05); }
.store-avatar, .user-avatar { display: grid; place-items: center; flex: 0 0 auto; width: 34px; height: 34px; border-radius: 10px; color: #fff; background: linear-gradient(135deg, var(--purple), #9f77ff); font-weight: 800; }
.store-chip > span:last-child { min-width: 0; display: grid; }
.store-chip strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .82rem; }
.store-chip small { color: #a9a3b9; font-size: .64rem; letter-spacing: .11em; }
.main-nav { display: grid; gap: 5px; }
.main-nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: #aaa5b8; font-size: .88rem; font-weight: 660; }
.main-nav a > span { width: 20px; color: #817b91; text-align: center; font-size: 1rem; }
.main-nav a:hover { color: #fff; background: rgba(255,255,255,.06); }
.main-nav a.active { color: #fff; background: rgba(111,50,255,.3); }
.main-nav a.active > span { color: #b8a0ff; }
.nav-secondary { margin-top: 24px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.08); }
.logout-form { margin-top: auto; padding-top: 20px; }
.logout-form button { width: 100%; border: 0; border-radius: 9px; padding: 10px; color: #aaa5b8; background: transparent; cursor: pointer; text-align: left; }
.logout-form button:hover { color: #fff; background: rgba(255,255,255,.06); }
.app-content { min-height: 100vh; margin-left: var(--sidebar); }
.topbar { min-height: 92px; display: flex; align-items: center; gap: 22px; justify-content: space-between; padding: 18px clamp(24px, 4vw, 52px); border-bottom: 1px solid var(--line); background: rgba(255,255,255,.88); backdrop-filter: blur(18px); }
.topbar .eyebrow { margin-bottom: 3px; }
.topbar h1 { margin: 0; font-size: clamp(1.5rem, 3vw, 2.15rem); }
.topbar-user { display: flex; align-items: center; gap: 11px; color: var(--ink-soft); font-size: .85rem; font-weight: 650; }
.mobile-menu { display: none; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; }
.page-main { max-width: 1600px; margin: 0 auto; padding: clamp(24px, 4vw, 52px); }
.page-intro { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.page-intro h2 { margin-bottom: 6px; }
.page-intro p { margin: 0; color: var(--ink-soft); }

.panel, .counter-card, .recent-card, .table-card, .editor-panel { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); }
.panel { padding: clamp(20px, 3vw, 30px); }
.panel-head, .counter-card-head, .section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.panel-head h2, .counter-card-head h2, .section-heading h3 { margin: 0; }
.panel-head time { color: var(--muted); font-size: .78rem; }

.mode-banner { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; padding: 11px 15px; border-radius: 12px; border: 1px solid; }
.mode-banner.is-sandbox { color: #704808; background: var(--amber-soft); border-color: #eed89e; }
.mode-banner.is-live { color: #0c6b46; background: var(--green-soft); border-color: #b9e9d1; }
.mode-banner .status-dot { width: 9px; height: 9px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px rgba(255,255,255,.55); }
.mode-banner > div { display: grid; line-height: 1.25; }
.mode-banner small { opacity: .8; }
.mode-banner a { margin-left: auto; color: currentColor; font-size: .8rem; font-weight: 750; }

/* Counter */
.counter-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(320px, .75fr); gap: 22px; align-items: start; }
.counter-card { overflow: hidden; }
.counter-card > .counter-card-head { padding: 23px 26px 18px; }
.counter-stepper { display: grid; grid-template-columns: auto 1fr auto 1fr auto; align-items: center; gap: 11px; padding: 11px 26px; color: var(--muted); background: #faf9fc; border-block: 1px solid var(--line); font-size: .72rem; font-weight: 730; }
.counter-stepper span.active { color: var(--purple); }
.counter-stepper i { height: 1px; background: var(--line); }
.counter-section { padding: 24px 26px; border-bottom: 1px solid var(--line); }
.section-heading { margin-bottom: 15px; }
.section-heading p { margin: 4px 0 0; color: var(--muted); font-size: .8rem; }
.section-heading a { font-size: .78rem; font-weight: 750; }
.quick-products { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.quick-product { display: grid; grid-template-columns: 46px minmax(0,1fr) auto; align-items: center; gap: 11px; width: 100%; border: 1px solid var(--line); border-radius: 13px; padding: 10px; color: var(--ink); background: #fff; cursor: pointer; text-align: left; }
.quick-product:hover { border-color: #bca8ed; box-shadow: 0 7px 18px rgba(72,41,140,.08); }
.quick-product > span:nth-child(2) { min-width: 0; display: grid; }
.quick-product strong, .quick-product small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quick-product small { color: var(--muted); font-size: .7rem; }
.quick-product b { color: var(--purple); font-size: .81rem; white-space: nowrap; }
.product-thumb { display: grid; place-items: center; width: 46px; height: 46px; overflow: hidden; border-radius: 10px; color: #fff; background: linear-gradient(145deg, #2b2445, var(--purple)); font-weight: 850; }
.product-thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-thumb.small { width: 38px; height: 38px; border-radius: 8px; }
.custom-item, .customer-details { border: 0; border-bottom: 1px solid var(--line); }
.custom-item > summary, .customer-details > summary, .editor-panel > summary, .inline-editor > summary {
    display: flex; align-items: center; justify-content: space-between; gap: 15px; cursor: pointer; list-style: none;
}
.custom-item > summary::-webkit-details-marker, .customer-details > summary::-webkit-details-marker, .editor-panel > summary::-webkit-details-marker, .inline-editor > summary::-webkit-details-marker { display: none; }
.custom-item > summary, .customer-details > summary { padding: 18px 26px; }
.custom-item > summary span, .customer-details > summary span { display: grid; }
.custom-item > summary small, .customer-details > summary small { color: var(--muted); font-size: .76rem; font-weight: 500; }
.custom-item > summary b, .customer-details > summary b { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 50%; color: var(--purple); background: var(--purple-soft); transition: transform .2s ease; }
.custom-item[open] > summary b, .customer-details[open] > summary b { transform: rotate(45deg); }
.custom-item-fields, .customer-fields { display: grid; gap: 15px; padding: 0 26px 22px; }
.cart-section { background: #fcfbfd; }
.cart-lines { display: grid; gap: 8px; }
.cart-line { display: grid; grid-template-columns: minmax(0,1fr) auto auto; align-items: center; gap: 13px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.cart-line > span:first-child { min-width: 0; display: grid; }
.cart-line strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .88rem; }
.cart-line small { color: var(--muted); font-size: .72rem; }
.cart-quantity { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.cart-quantity button { width: 30px; height: 31px; border: 0; color: var(--ink); background: #fff; cursor: pointer; }
.cart-quantity span { min-width: 27px; text-align: center; font-size: .78rem; font-weight: 750; }
.cart-remove { width: 30px; height: 30px; border: 0; color: var(--muted); background: transparent; cursor: pointer; }
.cart-remove:hover { color: var(--red); }
.cart-total { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; padding-top: 14px; border-top: 2px solid var(--ink); }
.cart-total strong { font-size: 1.25rem; }
.checkout-button { margin: 22px 26px 12px; width: calc(100% - 52px); }
.recent-card { position: sticky; top: 20px; overflow: hidden; }
.recent-card > .counter-card-head { padding: 23px 22px 16px; }
.counter-card-head > a { align-self: center; font-size: .76rem; font-weight: 750; }
.recent-sales { border-top: 1px solid var(--line); }
.recent-sale { display: grid; grid-template-columns: 9px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 13px 20px; color: var(--ink); border-bottom: 1px solid var(--line); }
.recent-sale:hover { color: var(--ink); background: #faf9fc; }
.recent-sale > span { min-width: 0; display: grid; }
.recent-sale > span:last-child { text-align: right; }
.recent-sale strong, .recent-sale small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-sale small { color: var(--muted); font-size: .69rem; }
.sale-state { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); }
.sale-state.state-paid { background: var(--green); }
.sale-state.state-failed, .sale-state.state-cancelled { background: var(--red); }
.public-store-card { display: grid; gap: 7px; margin: 18px; padding: 16px; border-radius: 13px; color: #fff; background: linear-gradient(135deg, #221b41, #3d266c); }
.public-store-card > span { color: #bdb5d2; font-size: .71rem; }
.public-store-card > strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .77rem; }
.public-store-card > div { display: flex; gap: 7px; margin-top: 5px; }
.public-store-card .button { color: #fff; border-color: rgba(255,255,255,.2); background: rgba(255,255,255,.08); }

/* Products */
.editor-panel { margin-bottom: 24px; overflow: hidden; }
.editor-panel > summary { padding: 16px 21px; color: var(--purple); font-weight: 800; }
.editor-panel[open] > summary { border-bottom: 1px solid var(--line); }
.editor-panel > form { padding: 22px; }
.product-admin-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 18px; }
.product-admin-card { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); }
.product-admin-image { position: relative; display: grid; place-items: center; height: 160px; color: #fff; background: linear-gradient(135deg, #282040, #7742ff); font-size: 2.3rem; font-weight: 850; }
.product-admin-image img { width: 100%; height: 100%; object-fit: cover; }
.badge { position: absolute; top: 12px; right: 12px; border-radius: 99px; padding: 5px 9px; color: #fff; background: rgba(23,20,46,.8); font-size: .65rem; }
.badge-draft { color: #684a00; background: #ffedbb; }
.product-admin-body { padding: 18px 19px; }
.product-admin-body .mono { margin-bottom: 5px; color: var(--muted); font-size: .67rem; }
.product-admin-body h3 { margin-bottom: 7px; }
.product-admin-body > p:not(.mono) { min-height: 42px; margin-bottom: 17px; color: var(--ink-soft); font-size: .8rem; }
.product-admin-price { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.product-admin-price strong { color: var(--purple); }
.product-admin-price span { color: var(--muted); font-size: .68rem; text-align: right; }
.inline-editor { border-top: 1px solid var(--line); }
.inline-editor > summary { padding: 12px 19px; color: var(--purple); font-size: .78rem; font-weight: 750; }
.inline-editor > form { padding: 0 19px 17px; }
.inline-editor .danger-zone { padding-top: 14px; border-top: 1px solid var(--line); }

/* Tables, sales and invoices */
.filter-tabs { display: flex; gap: 6px; margin-bottom: 15px; overflow-x: auto; }
.filter-tabs a { flex: 0 0 auto; padding: 8px 13px; border-radius: 9px; color: var(--ink-soft); font-size: .79rem; font-weight: 720; }
.filter-tabs a.active { color: #fff; background: var(--ink); }
.table-card { overflow: hidden; }
.data-table { min-width: 730px; }
.data-row { display: grid; align-items: center; gap: 16px; padding: 14px 18px; color: var(--ink); border-bottom: 1px solid var(--line); }
.sales-table .data-row, .invoice-table .data-row { grid-template-columns: 1.25fr 1fr .8fr .7fr auto; }
.data-row:last-child { border-bottom: 0; }
a.data-row:hover { color: var(--ink); background: #faf9fc; }
.data-row > span { min-width: 0; display: grid; }
.data-row strong, .data-row small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.data-row small { color: var(--muted); font-size: .7rem; }
.data-head { color: var(--muted); background: #faf9fc; font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.row-arrow { color: var(--purple); font-size: 1.1rem; }
.status-pill { display: inline-flex; width: max-content; align-items: center; border-radius: 99px; padding: 5px 9px; color: #714907; background: var(--amber-soft); font-size: .67rem; font-weight: 790; text-transform: uppercase; letter-spacing: .04em; }
.status-paid { color: #0c7048; background: var(--green-soft); }
.status-failed, .status-cancelled, .status-expired { color: #a52e2e; background: var(--red-soft); }
.table-actions { display: flex !important; flex-direction: row !important; gap: 6px; }
.number-chip { flex: 0 0 auto; border: 1px solid #d7caf6; border-radius: 99px; padding: 8px 13px; color: var(--purple); background: var(--purple-soft); font-size: .76rem; font-weight: 750; }
.sale-detail-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.sale-detail-head > a { font-size: .81rem; font-weight: 700; }
.sale-detail-head > div { display: flex; align-items: center; gap: 15px; }
.sale-detail-head > div > strong { font-size: 1.35rem; }
.sale-detail-grid { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(300px,.65fr); gap: 20px; align-items: start; }
.sale-summary { grid-row: span 2; }
.invoice-lines { margin-top: 19px; }
.invoice-line { display: grid; grid-template-columns: 38px minmax(0,1fr) auto; align-items: center; gap: 11px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.invoice-line > span:nth-child(2) { min-width: 0; display: grid; }
.invoice-line small { color: var(--muted); font-size: .72rem; }
.totals-list, .detail-list { margin: 18px 0 0; }
.totals-list div, .detail-list div { display: flex; justify-content: space-between; gap: 15px; padding: 7px 0; }
.totals-list dt, .detail-list dt { color: var(--muted); }
.totals-list dd, .detail-list dd { margin: 0; text-align: right; font-weight: 650; }
.totals-list .grand { margin-top: 7px; padding-top: 12px; border-top: 2px solid var(--ink); font-size: 1.08rem; }
.payment-share { display: grid; gap: 16px; }
.qr-wrap { display: grid; place-items: center; width: min(100%, 250px); aspect-ratio: 1; margin: 0 auto; padding: 6px; border: 1px solid var(--line); border-radius: 17px; background: #fff; }
.qr-wrap img { width: 100%; height: 100%; }
.qr-frame { display: grid; place-items: center; width: min(100%, 240px); aspect-ratio: 1; margin: 0 auto; padding: 15px; border: 1px solid var(--line); border-radius: 17px; background: #fff; }
.qr-frame img { width: 100%; height: 100%; }
.copy-field { display: grid; gap: 6px; color: var(--muted); font-size: .72rem; font-weight: 700; }
.copy-field > span:last-child { display: flex; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.copy-field input { min-width: 0; flex: 1; border: 0; padding: 9px 10px; color: var(--ink-soft); background: transparent; font-size: .7rem; }
.copy-field button { border: 0; border-left: 1px solid var(--line); padding: 8px 11px; color: var(--purple); background: #faf9fc; cursor: pointer; font-size: .72rem; font-weight: 750; }
.inline-warning { margin: 0; border-radius: 9px; padding: 10px; color: #8b2e2e; background: var(--red-soft); font-size: .72rem; overflow-wrap: anywhere; }
.share-url { display: grid; gap: 8px; }
.share-url code { overflow: hidden; padding: 9px 11px; border-radius: 8px; color: var(--ink-soft); background: #f3f1f6; text-overflow: ellipsis; white-space: nowrap; font-size: .69rem; }
.paid-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; color: #fff; background: var(--green); font-size: 1.35rem; font-weight: 850; }
.paid-icon.large { width: 68px; height: 68px; margin: 0 auto 20px; font-size: 2rem; }

/* Settings */
.settings-grid { display: grid; grid-template-columns: minmax(0,1.45fr) minmax(280px,.55fr); gap: 20px; align-items: start; }
.settings-main { gap: 23px; }
.settings-side { display: grid; gap: 20px; }
.toggle-list { display: grid; gap: 10px; }
.toggle { display: flex; align-items: flex-start; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.toggle > input { position: absolute; opacity: 0; pointer-events: none; }
.toggle > span { position: relative; flex: 0 0 auto; width: 38px; height: 22px; border-radius: 99px; background: #cbc6d4; transition: background .18s ease; }
.toggle > span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .18s ease; box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.toggle > input:checked + span { background: var(--purple); }
.toggle > input:checked + span::after { transform: translateX(16px); }
.toggle b { display: grid; font-size: .86rem; }
.toggle small { margin-top: 2px; color: var(--muted); font-size: .73rem; font-weight: 500; }
.mode-options { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.mode-option { position: relative; cursor: pointer; }
.mode-option > input { position: absolute; opacity: 0; }
.mode-option > span { min-height: 112px; display: grid; align-content: start; gap: 5px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; }
.mode-option small { color: var(--muted); font-size: .72rem; }
.mode-option > input:checked + span { border-color: var(--purple); background: var(--purple-soft); box-shadow: inset 0 0 0 1px var(--purple); }
.api-key-block { display: grid; grid-template-columns: minmax(170px,.55fr) minmax(220px,1fr); align-items: center; gap: 16px; padding: 16px; border: 1px solid var(--line); border-radius: 13px; }
.api-key-block h3 { margin-bottom: 4px; }
.api-key-block p { margin: 0; color: var(--muted); font-size: .73rem; }
.api-key-block .check { grid-column: 2; }
.live-confirm { padding: 11px; border-radius: 9px; background: var(--amber-soft); }
.connection-icon { display: grid; place-items: center; width: 46px; height: 46px; margin-bottom: 16px; border-radius: 13px; color: var(--purple); background: var(--purple-soft); font-size: 1.35rem; }
.connection-panel > p:not(.step-label), .public-link-panel > p:not(.step-label) { color: var(--ink-soft); font-size: .82rem; }
.connection-panel > small { display: block; margin-top: 12px; color: var(--muted); font-size: .7rem; }
.security-note ul { margin: 14px 0 0; padding-left: 18px; color: var(--ink-soft); font-size: .8rem; }
.public-link-panel > p { overflow-wrap: anywhere; }

/* Public store and checkout */
.store-body { background: #f8f7fa; }
.store-header { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 15px clamp(20px, 4vw, 60px); border-bottom: 1px solid var(--line); background: #fff; }
.store-header > div { display: grid; text-align: right; line-height: 1.25; }
.store-header > div span { color: var(--muted); font-size: .68rem; }
.store-main { max-width: 1520px; display: grid; grid-template-columns: minmax(0,1.55fr) minmax(350px,.55fr); gap: 24px; margin: 0 auto; padding: clamp(24px,4vw,56px); }
.store-hero { max-width: 720px; margin-bottom: 34px; }
.store-hero h1 { margin-bottom: 13px; }
.store-hero > p:last-child { color: var(--ink-soft); font-size: 1.04rem; }
.store-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.store-toolbar h2 { margin: 0; }
.search-field { display: flex; align-items: center; gap: 7px; width: min(290px, 100%); border: 1px solid var(--line); border-radius: 11px; padding-left: 12px; background: #fff; }
.search-field input { border: 0; padding-left: 3px; box-shadow: none !important; }
.store-product-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 17px; }
.store-product { display: grid; grid-template-columns: 148px minmax(0,1fr); min-height: 180px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); }
.store-product-image { display: grid; place-items: center; color: #fff; background: linear-gradient(135deg,#282041,#7945ff); font-size: 2.2rem; font-weight: 850; }
.store-product-image img { width: 100%; height: 100%; object-fit: cover; }
.store-product > div:last-child { min-width: 0; display: flex; flex-direction: column; padding: 17px; }
.store-product small { color: var(--muted); font-size: .67rem; }
.store-product h3 { margin: 4px 0 7px; }
.store-product p { margin-bottom: 14px; color: var(--ink-soft); font-size: .76rem; }
.store-product > div:last-child > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; }
.store-product button { border: 0; border-radius: 9px; padding: 7px 10px; color: #fff; background: var(--purple); cursor: pointer; font-size: .72rem; font-weight: 750; }
.store-cart { position: sticky; top: 20px; align-self: start; overflow: hidden; padding: 23px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-lg); }
.store-cart-head { margin-bottom: 18px; }
.store-cart-head h2 { margin: 0; }
.store-cart .form-stack { margin-top: 22px; }
.checkout-extra { border-block: 1px solid var(--line); padding-block: 11px; }
.checkout-extra summary { cursor: pointer; color: var(--purple); font-size: .79rem; font-weight: 750; }
.checkout-extra > div { padding-top: 13px; }
.checkout-trust { margin: 16px 0 0; color: var(--muted); font-size: .68rem; text-align: center; }
.checkout-main { min-height: calc(100vh - 78px); display: grid; place-items: center; padding: 30px 18px; }
.checkout-card { width: min(100%, 560px); padding: clamp(26px,5vw,48px); border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fff; box-shadow: var(--shadow-lg); text-align: center; }
.checkout-card h1 { margin-bottom: 12px; font-size: clamp(2rem,5vw,3rem); }
.checkout-card > p:not(.eyebrow):not(.checkout-trust) { color: var(--ink-soft); }
.checkout-lines { margin: 25px 0 0; border-top: 1px solid var(--line); }
.checkout-lines > div { display: flex; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); text-align: left; }
.checkout-lines span { display: grid; }
.checkout-lines small { color: var(--muted); }
.checkout-total { display: flex; align-items: center; justify-content: space-between; margin: 20px 0; padding: 16px; border-radius: 12px; color: #fff; background: var(--ink); }
.checkout-total strong { font-size: 1.35rem; }
.sandbox-badge { display: inline-flex; margin-bottom: 20px; border-radius: 99px; padding: 6px 10px; color: #7a4d00; background: var(--amber-soft); font-size: .64rem; font-weight: 850; letter-spacing: .08em; }

.empty-state { padding: 28px 18px; color: var(--ink-soft); text-align: center; }
.empty-state.compact { padding: 15px 10px; font-size: .8rem; }
.empty-state strong { display: block; color: var(--ink); }
.empty-state p { margin: 5px 0 0; }
.empty-large { grid-column: 1 / -1; min-height: 160px; display: grid; place-content: center; }
nav[role="navigation"] { margin-top: 22px; }
nav[role="navigation"] > div:first-child { display: none; }
nav[role="navigation"] > div:last-child { display: flex; justify-content: space-between; align-items: center; gap: 15px; }
nav[role="navigation"] span[aria-current="page"] span, nav[role="navigation"] a { display: inline-flex; min-width: 34px; min-height: 34px; align-items: center; justify-content: center; border: 1px solid var(--line); background: #fff; }
nav[role="navigation"] span[aria-current="page"] span { color: #fff; border-color: var(--purple); background: var(--purple); }

@media (max-width: 1180px) {
    .product-admin-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .store-main { grid-template-columns: minmax(0,1.25fr) minmax(320px,.75fr); }
    .store-product-grid { grid-template-columns: 1fr; }
}

@media (max-width: 960px) {
    .guest-shell { grid-template-columns: 1fr; }
    .guest-brand { min-height: 420px; }
    .guest-copy { margin-top: 65px; padding-right: 100px; }
    .guest-preview { width: 240px; right: -50px; }
    .guest-panel { min-height: 620px; }
    .sidebar { transform: translateX(-101%); transition: transform .22s ease; box-shadow: 20px 0 50px rgba(0,0,0,.25); }
    .app-shell.menu-open .sidebar { transform: translateX(0); }
    .app-shell.menu-open::after { content: ""; position: fixed; z-index: 30; inset: 0; background: rgba(16,12,30,.45); }
    .app-content { margin-left: 0; }
    .mobile-menu { display: block; }
    .topbar { justify-content: flex-start; }
    .topbar-user { margin-left: auto; }
    .counter-layout, .sale-detail-grid, .settings-grid { grid-template-columns: 1fr; }
    .recent-card, .store-cart { position: static; }
    .sale-summary { grid-row: auto; }
    .store-main { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
    body { font-size: 14px; }
    .guest-brand { min-height: 370px; padding: 24px; }
    .guest-copy { margin-top: 50px; padding-right: 0; }
    .guest-copy h1 { font-size: 2.25rem; }
    .guest-copy > p { max-width: calc(100% - 50px); }
    .guest-points { display: none; }
    .guest-preview { width: 170px; opacity: .35; right: -48px; }
    .guest-panel { min-height: auto; padding: 20px 14px 36px; }
    .auth-card { padding: 25px 20px; border-radius: 21px; }
    .form-grid.two, .form-grid.three, .mode-options { grid-template-columns: 1fr; }
    .topbar { min-height: 76px; padding: 12px 15px; }
    .topbar .eyebrow, .topbar-user > span:first-child { display: none; }
    .topbar h1 { font-size: 1.35rem; }
    .page-main { padding: 18px 13px 36px; }
    .page-intro { align-items: stretch; flex-direction: column; }
    .page-intro .button { width: 100%; }
    .mode-banner { align-items: flex-start; }
    .mode-banner small { display: none; }
    .counter-card > .counter-card-head, .counter-section { padding-inline: 17px; }
    .counter-stepper { padding-inline: 17px; gap: 7px; }
    .counter-stepper span { font-size: .64rem; }
    .quick-products { grid-template-columns: 1fr; }
    .custom-item > summary, .customer-details > summary { padding-inline: 17px; }
    .custom-item-fields, .customer-fields { padding-inline: 17px; }
    .checkout-button { margin-inline: 17px; width: calc(100% - 34px); }
    .product-admin-grid { grid-template-columns: 1fr; }
    .table-card { overflow-x: auto; }
    .sale-detail-head { align-items: flex-start; flex-direction: column; }
    .api-key-block { grid-template-columns: 1fr; }
    .api-key-block .check { grid-column: 1; }
    .store-header { padding: 13px 16px; }
    .store-header .brand-lockup { font-size: 1.2rem; }
    .store-header > div { max-width: 48%; }
    .store-main { padding: 25px 13px; }
    .store-toolbar { align-items: stretch; flex-direction: column; }
    .search-field { width: 100%; }
    .store-product { grid-template-columns: 105px minmax(0,1fr); min-height: 155px; }
    .store-product > div:last-child { padding: 13px; }
    .store-product p { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
    .store-cart { padding: 19px 16px; }
    .checkout-card { padding-inline: 20px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
