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

/* Ensure form controls inherit body font so nothing renders in browser-default serif/mono */
input, select, textarea, button {
    font: inherit;
}

:root {
    --sidebar-w: 240px;
    --bg: #f4f4f2;
    --surface: #ffffff;
    --border: #e8e8e5;
    --text: #1a1a18;
    --muted: #76766f;
    --primary: #1a1a18;
    --primary-hover: #333330;
    --success-bg: #e1f5ee;
    --success-text: #0f6e56;
    --warning-bg: #faeeda;
    --warning-text: #854f0b;
    --danger: #e24b4a;
    --danger-bg: #fcebeb;
    --info-bg: #e6f1fb;
    --info-text: #185fa5;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow: 0 1px 4px rgba(0,0,0,0.07);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.10);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", sans-serif;
    font-size: 14px;
    color: var(--text);
    background: var(--bg);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ── Layout ─────────────────────────────────────────────────────────────────── */
.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-w);
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 10;
    box-shadow: 2px 0 8px rgba(0,0,0,0.04);
}

.sidebar-header {
    padding: 28px 20px 20px;
    border-bottom: 1px solid var(--border);
}

.logo {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text);
}

.shop-name {
    font-size: 11px;
    color: var(--muted);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-list {
    list-style: none;
    padding: 12px 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    color: var(--muted);
    text-decoration: none;
    border-radius: var(--radius);
    font-size: 13.5px;
    font-weight: 400;
    transition: color 0.15s, background 0.15s;
}

.nav-badge {
    margin-left: auto;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    line-height: 18px;
    text-align: center;
    letter-spacing: 0;
}

    .nav-item:hover {
        color: var(--text);
        background: var(--bg);
    }

    .nav-item.active {
        color: var(--text);
        font-weight: 500;
        background: var(--bg);
        box-shadow: inset 0 0 0 1px var(--border);
    }

.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid var(--border);
}

.main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    padding: 36px 48px;
}

/* ── Page header ─────────────────────────────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}

    .page-header h1 {
        font-size: 24px;
        font-weight: 600;
        letter-spacing: -0.3px;
    }

.page-sub {
    font-size: 13px;
    color: var(--muted);
    margin-top: 2px;
}

/* ── Metrics ─────────────────────────────────────────────────────────────────── */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 36px;
}

.metric-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
}

.metric-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.metric-value {
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.5px;
    color: var(--text);
}

    .metric-value.success {
        color: var(--success-text);
    }

    .metric-value.warning {
        color: var(--warning-text);
    }

/* ── Section header ──────────────────────────────────────────────────────────── */
.section-header {
    margin-bottom: 14px;
}

    .section-header h2 {
        font-size: 15px;
        font-weight: 600;
        color: var(--text);
    }

/* ── Table ───────────────────────────────────────────────────────────────────── */
.table-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background: var(--bg);
    text-align: left;
    padding: 11px 18px;
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border-bottom: 1px solid var(--border);
}

td {
    padding: 13px 18px;
    border-bottom: 1px solid var(--border);
    font-size: 13.5px;
    color: var(--text);
}

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

tbody tr {
    transition: background 0.1s;
}

    tbody tr:hover td {
        background: #fafaf8;
    }

.font-medium {
    font-weight: 500;
}

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

/* ── Badges ──────────────────────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.badge-pending {
    background: var(--warning-bg);
    color: var(--warning-text);
}

.badge-paid {
    background: var(--success-bg);
    color: var(--success-text);
}

.badge-delivered {
    background: var(--info-bg);
    color: var(--info-text);
}

.badge-cancelled {
    background: var(--danger-bg);
    color: var(--danger);
}

.badge-active {
    background: var(--success-bg);
    color: var(--success-text);
}

.badge-inactive {
    background: var(--danger-bg);
    color: var(--danger);
}

/* ── Stat chips ──────────────────────────────────────────────────────────────── */
.stat-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--muted);
}
.stat-chip strong { color: var(--text); }
.stat-chip.active { border-color: var(--success-bg); background: var(--success-bg); color: var(--success-text); }
.stat-chip.active strong { color: var(--success-text); }
.stat-chip.inactive { border-color: var(--danger-bg); background: var(--danger-bg); color: var(--danger); }
.stat-chip.inactive strong { color: var(--danger); }

/* ── Buttons ─────────────────────────────────────────────────────────────────── */
.btn-primary {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 9px 18px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    white-space: nowrap;
}

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

    .btn-primary:active {
        transform: scale(0.98);
    }

    .btn-primary:disabled {
        opacity: 0.45;
        cursor: not-allowed;
    }

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 9px 18px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}

    .btn-secondary:hover {
        background: var(--bg);
    }

.btn-full {
    width: 100%;
    padding: 11px;
    font-size: 14px;
}

.btn-link {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 12px;
    padding: 3px 6px;
    border-radius: 4px;
    text-decoration: none;
    transition: color 0.15s, background 0.15s;
}

    .btn-link:hover {
        color: var(--text);
        background: var(--bg);
    }

    .btn-link.danger:hover {
        color: var(--danger);
        background: var(--danger-bg);
    }

.btn-sm {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 5px 11px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    margin-right: 4px;
    transition: background 0.15s;
    white-space: nowrap;
}

    .btn-sm:hover {
        background: var(--bg);
    }

    .btn-sm.success {
        border-color: #9fe1cb;
        color: var(--success-text);
    }

        .btn-sm.success:hover {
            background: var(--success-bg);
        }

.btn-logout {
    width: 100%;
    background: none;
    border: 1px solid var(--border);
    padding: 8px;
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--muted);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

    .btn-logout:hover {
        background: var(--danger-bg);
        color: var(--danger);
        border-color: #f09595;
    }

/* ── Filter bar ──────────────────────────────────────────────────────────────── */
.filter-bar {
    display: flex;
    gap: 6px;
    margin-bottom: 18px;
}

.filter-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    color: var(--muted);
    transition: all 0.15s;
}

    .filter-btn:hover {
        background: var(--bg);
        color: var(--text);
    }

    .filter-btn.active {
        background: var(--primary);
        color: #fff;
        border-color: var(--primary);
    }

/* ── Search bar ──────────────────────────────────────────────────────────────── */
.search-bar {
    margin-bottom: 18px;
}

    .search-bar input {
        width: 100%;
        max-width: 380px;
        padding: 9px 14px;
        border: 1px solid var(--border);
        border-radius: var(--radius);
        font-size: 13px;
        background: var(--surface);
        color: var(--text);
        box-shadow: var(--shadow);
        transition: border-color 0.15s, box-shadow 0.15s;
    }

        .search-bar input:focus {
            outline: none;
            border-color: #aaa;
            box-shadow: 0 0 0 3px rgba(0,0,0,0.06);
        }

/* Products filter toolbar */
.product-filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.product-filter-field {
    display: flex;
    align-items: center;
    min-width: 0;
}

.product-filter-field--search {
    flex: 1 1 220px;
    min-width: 220px;
    max-width: 380px;
}

.product-filter-field--category {
    flex: 0 1 180px;
    min-width: 180px;
}

.product-filter-field--status {
    flex: 0 1 140px;
    min-width: 140px;
}

.product-filter-control {
    width: 100%;
    height: 38px;
    padding: 9px 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    font-size: 13px;
    line-height: 1.2;
    box-shadow: var(--shadow);
    transition: border-color 0.15s, box-shadow 0.15s;
}

select.product-filter-control {
    padding-right: 32px;
}

.product-filter-control:focus {
    outline: none;
    border-color: #aaa;
    box-shadow: 0 0 0 3px rgba(0,0,0,0.06);
}

.product-price-range {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 6px;
}

.product-filter-control--price {
    flex: 0 0 110px;
    width: 110px;
}

.product-price-range__separator {
    color: var(--muted);
    font-size: 13px;
    line-height: 38px;
}

.product-filters__actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.product-filters__actions .btn-primary,
.product-filters__actions .btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    padding-top: 0;
    padding-bottom: 0;
}

@media (max-width: 760px) {
    .product-filter-field--search,
    .product-filter-field--category,
    .product-filter-field--status {
        flex: 1 1 calc(50% - 4px);
        max-width: none;
        min-width: 160px;
    }
}

@media (max-width: 640px) {
    .product-filter-field--search,
    .product-filter-field--category,
    .product-filter-field--status,
    .product-price-range,
    .product-filters__actions {
        width: 100%;
        flex: 1 1 100%;
    }

    .product-filter-control--price {
        flex: 1 1 0;
        width: 100%;
        min-width: 0;
    }

    .product-filters__actions .btn-primary,
    .product-filters__actions .btn-secondary {
        flex: 1;
    }
}

/* ── Forms ───────────────────────────────────────────────────────────────────── */
.form-group {
     margin-bottom: 18px;
}

    .form-group label:not(.toggle-row) {
        display: block;
        font-size: 12px;
        font-weight: 600;
        margin-bottom: 6px;
        color: var(--muted);
        text-transform: uppercase;
        letter-spacing: 0.3px;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        width: 100%;
        padding: 9px 13px;
        border: 1px solid var(--border);
        border-radius: var(--radius);
        font-size: 13.5px;
        background: var(--surface);
        color: var(--text);
        transition: border-color 0.15s, box-shadow 0.15s;
    }

        .form-group input:focus,
        .form-group select:focus,
        .form-group textarea:focus {
            outline: none;
            border-color: #aaa;
            box-shadow: 0 0 0 3px rgba(0,0,0,0.06);
        }

.inline-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.translation-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    padding: 12px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.translation-toolbar__label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
}

.translation-toolbar__hint {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
}

.translation-toolbar__select {
    width: auto;
    min-width: 180px;
    flex-shrink: 0;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    font-size: 13px;
}

@media (max-width: 640px) {
    .translation-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .translation-toolbar__select {
        width: 100%;
    }
}

/* ── Modal ───────────────────────────────────────────────────────────────────── */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}

.modal {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 28px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
}

.modal-wide {
    max-width: 620px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

    .modal-header h3 {
        font-size: 17px;
        font-weight: 600;
    }

.modal-close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--muted);
    line-height: 1;
    padding: 0 4px;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}

    .modal-close:hover {
        color: var(--text);
        background: var(--bg);
    }

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

/* ── Variant table (product edit modal) ──────────────────────────────────── */
.variant-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-bottom: 6px;
}
.variant-table th {
    text-align: left;
    padding: 4px 6px;
    color: var(--muted);
    font-weight: 500;
    border-bottom: 1px solid var(--border);
}
.variant-table td { padding: 4px 6px; }
.variant-table td input {
    width: 100%;
    padding: 5px 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 13px;
}
.variant-table td:last-child { width: 32px; text-align: center; }

.items-table {
    width: 100%;
    margin: 12px 0;
    font-size: 13px;
    border-collapse: collapse;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

    .items-table th, .items-table td {
        padding: 8px 12px;
        border-bottom: 1px solid var(--border);
        text-align: left;
    }

    .items-table th {
        background: var(--bg);
        font-size: 11px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.4px;
        color: var(--muted);
    }

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

.order-total {
    text-align: right;
    font-size: 14px;
    margin-bottom: 16px;
    color: var(--muted);
}

    .order-total strong {
        color: var(--text);
        font-size: 16px;
    }

/* ── Alerts ──────────────────────────────────────────────────────────────────── */
.alert-error {
    background: var(--danger-bg);
    color: var(--danger);
    padding: 11px 14px;
    border-radius: var(--radius);
    font-size: 13px;
    margin-bottom: 16px;
    border: 1px solid #f09595;
}

/* ── Login page ──────────────────────────────────────────────────────────────── */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
}

.login-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 44px 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-md);
}

    .login-card h1 {
        font-size: 26px;
        font-weight: 700;
        letter-spacing: -0.5px;
        margin-bottom: 4px;
    }

.login-sub {
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 32px;
}

/* ── Loading ─────────────────────────────────────────────────────────────────── */
.loading {
    color: var(--muted);
    padding: 60px 0;
    text-align: center;
    font-size: 14px;
}

/* ── Responsive ──────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    :root {
        --sidebar-w: 200px;
    }

    .main-content {
        padding: 24px 24px;
    }

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

@media (max-width: 640px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        flex-direction: row;
    }

    .main-content {
        margin-left: 0;
        padding: 16px;
    }
}

/* ── Settings ────────────────────────────────────────────────────────────────── */
.settings-wrap {
    max-width: 1000px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.settings-section {
    padding: 0;
    background: var(--surface);
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.settings-section-header {
    padding: 20px 24px;
    border-bottom: 1px solid #E5E7EB;
    background: var(--bg);
}

    .settings-section-header h2 {
        font-size: 16px;
        font-weight: 600;
        margin-bottom: 4px;
        color: #111827;
    }

    .settings-section-header p {
        font-size: 13px;
        color: #6B7280;
        margin: 0;
    }

.settings-section-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

    /* ── Scoped overrides for settings forms ─────────────────────────────── */
    .settings-section-body .form-group > label:first-child:not(.toggle-row) {
        font-size: 13px;
        font-weight: 500;
        color: #374151;
        text-transform: none;
        letter-spacing: normal;
        margin-bottom: 6px;
        display: block;
    }

    .settings-section-body input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]),
    .settings-section-body select {
        height: 40px;
        padding: 0 12px;
        box-sizing: border-box;
    }

    .settings-section-body textarea {
        padding: 10px 12px;
    }

    .settings-section-body input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus,
    .settings-section-body select:focus,
    .settings-section-body textarea:focus {
        outline: none;
        border-color: #2563EB;
        box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
    }

.common-currencies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.currency-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 7px 14px;
    border-radius: var(--radius);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 6px;
}

    .currency-btn span {
        font-size: 11px;
        color: var(--muted);
    }

    .currency-btn:hover {
        background: var(--bg);
        border-color: #aaa;
    }

    .currency-btn.active {
        background: var(--primary);
        color: #fff;
        border-color: var(--primary);
    }

        .currency-btn.active span {
            color: rgba(255,255,255,0.7);
        }

/* ── Settings tabs ───────────────────────────────────────────────────────── */
.settings-tabs {
    display: flex;
    gap: 2px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
    overflow-x: auto;
    -ms-overflow-style: none;
}

    .settings-tabs::-webkit-scrollbar { display: none; }

.settings-tab {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 500;
    color: var(--muted);
    cursor: pointer;
    white-space: nowrap;
    margin-bottom: -1px;
    transition: color 0.15s, border-color 0.15s;
}

    .settings-tab:hover {
        color: var(--text);
    }

    .settings-tab.active {
        color: #2563EB;
        border-bottom-color: #2563EB;
        font-weight: 600;
    }

/* ── Theme picker ────────────────────────────────────────────────────────── */
.theme-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.theme-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
    min-width: 150px;
    position: relative;
}

    .theme-card:hover:not(:disabled) {
        border-color: #aaa;
        box-shadow: var(--shadow);
    }

    .theme-card--active {
        border-color: var(--primary);
        box-shadow: 0 0 0 3px rgba(26,26,24,0.08);
    }

    .theme-card:disabled {
        opacity: 0.55;
        cursor: not-allowed;
    }

.theme-card__swatches {
    display: flex;
    gap: 5px;
}

.theme-card__swatch {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.08);
    display: inline-block;
}

.theme-card__name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
}

.theme-card__check {
    position: absolute;
    top: 8px;
    right: 10px;
    font-size: 13px;
    color: var(--primary);
    font-weight: 700;
}

/* ── Toggle switch (ToggleField component) ───────────────────────────────── */
.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
}

.toggle-row__label {
    font-size: 14px;
    color: #374151;
    font-weight: 500;
    flex: 1;
}

.toggle-switch {
    display: inline-block;
    position: relative;
    width: 44px;
    min-width: 44px;
    height: 24px;
    flex-shrink: 0;
}

    .toggle-switch input[type="checkbox"] {
        opacity: 0;
        width: 0;
        height: 0;
        position: absolute;
    }

    .toggle-slider {
        position: absolute;
        inset: 0;
        background: #6B7280;
        border-radius: 12px;
        border: 1.5px solid rgba(0,0,0,0.12);
        transition: background 0.2s, border-color 0.2s;
        cursor: pointer;
    }

        .toggle-slider::before {
            content: "";
            position: absolute;
            width: 18px;
            height: 18px;
            left: 3px;
            top: 3px;
            background: #fff;
            border-radius: 50%;
            transition: transform 0.2s;
            box-shadow: 0 1px 3px rgba(0,0,0,0.15);
        }

    .toggle-switch input:checked + .toggle-slider { background: #2563EB; border-color: #1D4ED8; }
    .toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }
    .toggle-switch input:disabled + .toggle-slider {
        background: #9CA3AF;
        border-color: #6B7280;
        cursor: not-allowed;
    }
    .toggle-switch input:checked:disabled + .toggle-slider {
        background: #93C5FD;
        border-color: #60A5FA;
    }

.alert-success {
    background: var(--success-bg);
    color: var(--success-text);
    padding: 11px 14px;
    border-radius: var(--radius);
    font-size: 13px;
    border: 1px solid #9fe1cb;
}

/* ── Register page — append to app.css ──────────────────────────────────────── */
.register-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 44px 40px;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    gap: 0;
}

.register-header {
    margin-bottom: 28px;
}

    .register-header .logo {
        font-size: 20px;
        font-weight: 700;
        letter-spacing: -0.5px;
        margin-bottom: 16px;
        color: var(--text);
    }

    .register-header h1 {
        font-size: 22px;
        font-weight: 600;
        letter-spacing: -0.3px;
        margin-bottom: 6px;
    }

    .register-header p {
        font-size: 13px;
        color: var(--muted);
    }

.register-footer-note {
    text-align: center;
    font-size: 13px;
    color: var(--muted);
    margin-top: 20px;
}

    .register-footer-note a {
        color: var(--text);
        font-weight: 500;
        text-decoration: underline;
    }

/* ── Success state ────────────────────────────────────────────────────────────── */
.success-state {
    text-align: center;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.success-icon {
    width: 56px;
    height: 56px;
    background: var(--success-bg);
    color: var(--success-text);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.success-state h2 {
    font-size: 20px;
    font-weight: 600;
}

.success-state p {
    font-size: 14px;
    color: var(--text);
}

/* ── Append to app.css ───────────────────────────────────────────────────────── */

.forgot-link {
    text-align: right;
    margin: -8px 0 16px;
}

    .forgot-link a {
        font-size: 12px;
        color: var(--muted);
        text-decoration: none;
    }

        .forgot-link a:hover {
            color: var(--text);
            text-decoration: underline;
        }

/* ── Cloudflare Turnstile widget ─────────────────────────────────────────── */
[id^="cf-turnstile-"] {
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 8px;
    background: #f5f5f5;
}

[id^="cf-turnstile-"] iframe {
    width: 100% !important;
    border-radius: 8px;
}

.divider-or {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: var(--muted);
    font-size: 12px;
}

    .divider-or::before,
    .divider-or::after {
        content: '';
        flex: 1;
        height: 1px;
        background: var(--border);
    }

.google-btn-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 4px;
}

.google-email-pill {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 20px;
    text-align: center;
}

/* ── Admin panel — append to app.css ─────────────────────────────────────────── */

.admin-badge {
    background: #26215C;
    color: #CECBF6;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    letter-spacing: 0.3px;
}

.nav-divider {
    height: 1px;
    background: var(--border);
    margin: 8px 0;
    list-style: none;
}

.nav-item-admin {
    color: #534AB7 !important;
    font-weight: 500;
}

    .nav-item-admin:hover {
        background: #EEEDFE !important;
    }

    .nav-item-admin.active {
        background: #EEEDFE !important;
        box-shadow: inset 0 0 0 1px #AFA9EC !important;
    }

.sidebar-user {
    font-size: 11px;
    color: var(--muted);
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.badge-plan-free {
    background: #f1efe8;
    color: #5f5e5a;
}

.badge-plan-pro {
    background: #EEEDFE;
    color: #3C3489;
}

.badge-plan-enterprise {
    background: #26215C;
    color: #CECBF6;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
    border: none;
    padding: 9px 18px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.15s;
}

    .btn-danger:hover {
        opacity: 0.85;
    }

.admin-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 8px;
}

/* ── Order detail ────────────────────────────────────────────────────────── */
.order-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 20px;
}

@media (max-width: 640px) {
    .order-detail-grid { grid-template-columns: 1fr; }
}

.info-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
}

.info-card-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--muted);
    margin-bottom: 14px;
}

.info-row {
    display: flex;
    gap: 12px;
    align-items: baseline;
    padding: 5px 0;
    border-bottom: 1px solid var(--border);
}

.info-row:last-child { border-bottom: none; }

.info-label {
    font-size: 12px;
    color: var(--muted);
    min-width: 64px;
    flex-shrink: 0;
}

.info-value {
    font-size: 14px;
    color: var(--text);
    word-break: break-word;
}

.info-value a {
    color: var(--primary);
    text-decoration: none;
}

.info-value a:hover { text-decoration: underline; }

.btn-copy {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    color: var(--muted);
    padding: 0 4px;
    opacity: 0.6;
    vertical-align: middle;
}

.btn-copy:hover { opacity: 1; color: var(--primary); }

.order-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.btn-sm.danger {
    border-color: var(--danger);
    color: var(--danger);
}

.btn-sm.danger:hover { background: var(--danger-bg); }

.clickable-row { cursor: pointer; }
.clickable-row:hover td { background: var(--bg); }

.alert-success {
    background: var(--success-bg);
    color: var(--success-text);
    border: 1px solid #9fe1cb;
    border-radius: var(--radius);
    padding: 10px 14px;
    font-size: 14px;
}

.danger-zone {
    margin-top: 32px;
    padding: 24px;
    border: 1px solid #f09595;
    border-radius: var(--radius-lg);
    background: #fff8f8;
}

    .danger-zone h2 {
        font-size: 15px;
        font-weight: 600;
        color: var(--danger);
        margin-bottom: 8px;
    }

    .danger-zone p {
        font-size: 13px;
        color: var(--muted);
        margin-bottom: 14px;
    }

.danger-warning {
    color: var(--danger) !important;
}

/* ── Store URL display — append to app.css ───────────────────────────────── */
.store-url-display {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 9px 13px;
    font-size: 13px;
    font-family: var(--font-mono);
    color: var(--text);
    word-break: break-all;
}

.badge-cash {
    background: #faeeda;
    color: #854f0b;
}

.badge-stripe {
    background: #EEEDFE;
    color: #3C3489;
}

.badge-manual {
    background: var(--bg);
    color: var(--muted);
    border: 1px solid var(--border);
}

.badge-auto {
    background: #e1f5ee;
    color: #0f6e56;
}

/* ── Pagination ───────────────────────────────────────────────────────────── */
.pagination {
    display: flex;
    gap: 4px;
    margin-top: 16px;
    justify-content: center;
}

.page-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 6px 12px;
    border-radius: var(--radius);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
}

    .page-btn:hover {
        background: var(--bg);
    }

    .page-btn.active {
        background: var(--primary);
        color: #fff;
        border-color: var(--primary);
    }

/* ── Tenant selector (admin sidebar) ────────────────────────────── */
.tenant-selector {
    width: 100%;
    margin-top: 8px;
    padding: 5px 8px;
    font-size: 12px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--radius);
    color: inherit;
    cursor: pointer;
}

/* ── Impersonation banner ────────────────────────────────────────── */
.impersonation-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    margin-bottom: 16px;
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: var(--radius);
    font-size: 13px;
    color: #92400e;
}

.impersonation-bar .btn-link {
    margin-left: auto;
    color: #92400e;
    font-weight: 600;
    text-decoration: underline;
}

/* ── Subscription status banners ─────────────────────────────────── */
.subscription-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    margin-bottom: 16px;
    border-radius: var(--radius);
    font-size: 13px;
    flex-wrap: wrap;
}

.subscription-banner-warning {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    color: #92400e;
}

.subscription-banner-error {
    background: #fee2e2;
    border: 1px solid #ef4444;
    color: #991b1b;
}

/* ── Nav badge variant ───────────────────────────────────────────── */
.nav-badge-warning {
    background: #f59e0b;
    color: #fff;
}

/* ── Inline alert banners (Billing page) ─────────────────────────── */
.info-banner, .warning-banner, .error-banner {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    margin-top: 8px;
}

.info-banner {
    background: #eff6ff;
    border: 1px solid #3b82f6;
    color: #1e40af;
}

.warning-banner {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    color: #92400e;
}

.error-banner {
    background: #fee2e2;
    border: 1px solid #ef4444;
    color: #991b1b;
}

/* ── Metric value variants ───────────────────────────────────────── */
.metric-value.info {
    color: #3b82f6;
}

.metric-value.error {
    color: #ef4444;
}

/* ── Variables tab ──────────────────────────────────────────────────── */
.var-category { margin-bottom: 28px; }
.var-category-title {
    font-size: 11px; font-weight: 700; letter-spacing: .5px;
    text-transform: uppercase; color: var(--muted); margin-bottom: 12px;
    padding-bottom: 8px; border-bottom: 1px solid var(--border);
}
.var-row {
    display: grid;
    grid-template-columns: 220px 1fr auto auto;
    align-items: center; gap: 12px;
    padding: 12px 0; border-bottom: 1px solid var(--border);
}
.var-row:last-child { border-bottom: none; }
.var-label { font-size: 13px; font-weight: 600; color: var(--text); }
.var-label-hint { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.var-value {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 12.5px; color: var(--text);
    background: var(--bg); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 5px 10px;
}
.var-empty { font-style: italic; color: var(--muted); background: none; border-color: transparent; }
.var-eye-btn {
    background: none; border: none; cursor: pointer;
    color: var(--muted); padding: 4px 5px; border-radius: 4px;
    display: flex; align-items: center; flex-shrink: 0;
    transition: color .15s, background .15s;
}
.var-eye-btn:hover { color: var(--text); background: var(--border); }
.var-badge {
    font-size: 10px; font-weight: 700; padding: 2px 7px;
    border-radius: 4px; text-transform: uppercase; letter-spacing: .3px; white-space: nowrap;
}
.var-badge--required { background: #fef3c7; color: #92400e; }
.var-badge--optional { background: var(--bg); color: var(--muted); border: 1px solid var(--border); }
.var-badge--sensitive { background: #fce7f3; color: #9d174d; }
.var-badge--readonly { background: #e0f2fe; color: #075985; }
.var-edit-link {
    font-size: 12px; color: #2563EB; cursor: pointer;
    text-decoration: none; white-space: nowrap;
}
.var-edit-link:hover { text-decoration: underline; }
.var-readonly-note {
    display: flex; align-items: center; gap: 6px;
    font-size: 12px; color: var(--muted);
    background: var(--bg); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 8px 12px; margin-bottom: 12px;
}
.var-input-wrap {
    position: relative; display: flex; align-items: center; gap: 6px;
}
.var-input-wrap input { flex: 1; }
.var-input-eye {
    background: none; border: none; cursor: pointer;
    color: var(--muted); padding: 4px 5px; border-radius: 4px;
    display: flex; align-items: center; flex-shrink: 0;
    transition: color .15s, background .15s;
}
.var-input-eye:hover { color: var(--text); background: var(--border); }

/* ── Settings — missing utility classes ─────────────────────────────────── */

/* Textarea defaults inside settings sections */
.settings-section-body textarea {
    width: 100%;
    resize: vertical;
}

/* Payment options and similar grouped sub-sections */
.settings-box {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.settings-box-title {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
}

/* Inline checkbox + label used where ToggleField is not applicable */
.toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
}

/* Logo / image preview row */
.logo-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

/* Number input + inline unit label (e.g. "3 days") */
.input-with-unit {
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-unit {
    font-size: 13px;
    color: var(--muted);
    white-space: nowrap;
}

/* Language checkbox list */
.lang-checkboxes {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.lang-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: normal;
}

/* Trust badges checkbox grid */
.trust-badges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    margin-top: 4px;
}

.trust-badge-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: normal;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

/* Danger zone section modifier */
.settings-section--danger {
    border-color: #fca5a5;
}

.settings-section--danger .settings-section-header {
    background: #fff5f5;
    border-bottom-color: #fca5a5;
}

.settings-section--danger .settings-section-header h2 {
    color: #ef4444;
}

.danger-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px;
    border: 1px solid #fca5a5;
    border-radius: 8px;
    background: #fff5f5;
}

/* ── Customer detail page ────────────────────────────────────────────────── */
.customer-detail-field {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    gap: 12px;
}

.customer-detail-field:last-child {
    border-bottom: none;
}

.customer-detail-field .text-muted {
    flex-shrink: 0;
    width: 70px;
}
