:root {
    /* One shared brand palette for public pages, marketplace and admin. */
    --sf-color-primary: #0f766e;
    --sf-color-primary-hover: #115e59;
    --sf-color-primary-soft: #ccfbf1;
    --sf-color-primary-rgb: 15, 118, 110;
    --sf-color-secondary: #0ea5e9;
    --sf-color-success: #16a34a;
    --sf-color-warning: #f59e0b;
    --sf-color-danger: #dc2626;
    --sf-color-ink: #0f172a;
    --sf-color-text: #334155;
    --sf-color-muted: #64748b;
    --sf-color-subtle: #94a3b8;
    --sf-color-page: #f6f8fb;
    --sf-color-surface: #ffffff;
    --sf-color-surface-soft: #f8fafc;
    --sf-color-border: #e2e8f0;
    --sf-color-border-strong: #cbd5e1;
    --sf-radius-xs: 5px;
    --sf-radius-sm: 9px;
    --sf-radius-md: 13px;
    --sf-radius-lg: 18px;
    --sf-space-1: .25rem;
    --sf-space-2: .5rem;
    --sf-space-3: .75rem;
    --sf-space-4: 1rem;
    --sf-space-5: 1.25rem;
    --sf-space-6: 1.5rem;
    --sf-shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
    --sf-shadow-md: 0 8px 24px rgba(15, 23, 42, .08);
    --sf-shadow-lg: 0 18px 42px rgba(15, 23, 42, .12);
    --sf-font-family: Vazirmatn, IRANSansX, Tahoma, Arial, sans-serif;
    --sf-transition-fast: 150ms ease;

    /* ── Storefront (premium marketplace) ───────────────────────────────────── */
    --sf-shop-accent: var(--sf-color-primary);
    --sf-shop-accent-hover: var(--sf-color-primary-hover);
    --sf-shop-accent-soft: var(--sf-color-primary-soft);
    --sf-shop-star: #f59e0b;
    --sf-shop-rating: #e11d48;
    --sf-shop-ink: #0b1220;
    --sf-shop-body: #475569;
    --sf-shop-line: #e6e9ef;
    --sf-shop-surface: #ffffff;
    --sf-shop-canvas: #fafbfc;
    --sf-shop-radius-sm: 8px;
    --sf-shop-radius: 14px;
    --sf-shop-radius-lg: 20px;
    --sf-shop-shadow-card: 0 1px 2px rgba(11, 18, 32, .04);
    --sf-shop-shadow-hover: 0 14px 34px rgba(11, 18, 32, .10);
    --sf-shop-ring: 0 0 0 3px rgba(15, 118, 110, .22);
}

html,
body,
.mud-typography,
.mud-button-root,
.mud-input,
.mud-list-item-text,
.mud-table {
    font-family: var(--sf-font-family);
}

body {
    background: var(--sf-color-page);
    color: var(--sf-color-ink);
}

a {
    text-underline-offset: 3px;
}

.sf-surface {
    background: var(--sf-color-surface);
    border: 1px solid var(--sf-color-border);
    border-radius: var(--sf-radius-md);
    box-shadow: var(--sf-shadow-sm);
}

.sf-admin-shell {
    --sf-admin-sidebar-width: 286px;
    --sf-admin-topbar-height: 64px;
}

/* ── Shared admin component styles (colors / product-categories) ─────────── */

.colors-page {
    max-width: 640px;
}

.colors-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.colors-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #202124;
    margin: 0;
}

.colors-subtitle {
    font-size: 0.82rem;
    color: #5f6368;
    margin: 0.15rem 0 0;
}

.colors-alert {
    padding: 0.65rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.colors-alert--ok {
    background: #e6f4ea;
    color: #1e7e34;
}

.colors-alert--error {
    background: #fce8e6;
    color: #c5221f;
}

.colors-card {
    background: #fff;
    border-radius: 0.65rem;
    border: 1px solid #e8eaed;
    margin-bottom: 1rem;
    overflow: hidden;
}

.colors-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem 0;
}

.colors-card-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: #202124;
    margin: 0;
}

.colors-count {
    font-size: 0.78rem;
    color: #5f6368;
}

.colors-card-body {
    padding: 1rem 1.25rem 1.25rem;
}

.colors-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: #3c4043;
    margin-bottom: 0.5rem;
}

.colors-input-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.colors-hex-input {
    width: 2.5rem;
    height: 2.5rem;
    border: 1px solid #dadce0;
    border-radius: 0.5rem;
    cursor: pointer;
    padding: 0;
    background: none;
}

.colors-hex-input::-webkit-color-swatch-wrapper {
    padding: 2px;
}

.colors-hex-input::-webkit-color-swatch {
    border: none;
    border-radius: 0.3rem;
}

.colors-swatch {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    flex-shrink: 0;
    border: 1px solid #dadce0;
}

.colors-hex-label {
    font-size: 0.75rem;
    color: #5f6368;
    font-family: monospace;
    direction: ltr;
}

.colors-input {
    flex: 1;
    padding: 0.55rem 0.75rem;
    border: 1px solid #dadce0;
    border-radius: 0.5rem;
    font-size: 0.88rem;
    color: #202124;
    outline: none;
    transition: border-color 0.15s ease;
}

.colors-input:focus {
    border-color: #1a73e8;
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.15);
}

.colors-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.55rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.colors-btn--primary {
    background: #1a73e8;
    color: #fff;
}

.colors-btn--primary:hover {
    background: #1765cc;
}

.colors-btn--primary:disabled {
    background: #c4c7c5;
    cursor: not-allowed;
}

.colors-empty {
    padding: 1rem;
    text-align: center;
    color: #5f6368;
    font-size: 0.85rem;
    background: #f8f9fa;
    border-radius: 0.5rem;
}

.colors-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.colors-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    background: #f1f3f4;
    border-radius: 999px;
    font-size: 0.85rem;
    color: #3c4043;
}

.colors-tag-text {
    font-weight: 500;
}

.colors-tag--editing {
    gap: 0.3rem;
    padding: 0.3rem 0.6rem;
    background: #e8f0fe;
    border: 1px solid #1a73e8;
}

.colors-hex-input-sm {
    width: 1.8rem;
    height: 1.8rem;
    border: 1px solid #dadce0;
    border-radius: 0.35rem;
    cursor: pointer;
    padding: 0;
    background: none;
}

.colors-hex-input-sm::-webkit-color-swatch-wrapper {
    padding: 1px;
}

.colors-hex-input-sm::-webkit-color-swatch {
    border: none;
    border-radius: 0.25rem;
}

.colors-edit-input {
    width: 6rem;
    padding: 0.25rem 0.45rem;
    border: 1px solid #dadce0;
    border-radius: 0.35rem;
    font-size: 0.82rem;
    outline: none;
}

.colors-edit-input:focus {
    border-color: #1a73e8;
}

.colors-btn-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0;
}

.colors-btn-sm--ok {
    background: #e6f4ea;
    color: #1e7e34;
}

.colors-btn-sm--ok:hover {
    background: #ceead6;
}

.colors-btn-sm--cancel {
    background: transparent;
    color: #5f6368;
}

.colors-btn-sm--cancel:hover {
    background: #e8eaed;
    color: #c5221f;
}

.colors-tag-edit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: #5f6368;
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0;
}

.colors-tag-edit:hover {
    background: #e8eaed;
    color: #1a73e8;
}

.colors-tag-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: #5f6368;
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0;
}

.colors-tag-remove:hover {
    background: #e8eaed;
    color: #c5221f;
}

/* Shared semantic tokens. This file loads last so legacy Bootstrap and page
   styles inherit the same palette without replacing purpose-built layouts. */
:root {
    --bs-primary: var(--sf-color-primary);
    --bs-primary-rgb: var(--sf-color-primary-rgb);
    --bs-link-color: var(--sf-color-primary);
    --bs-link-hover-color: var(--sf-color-primary-hover);
    --sf-accent: var(--sf-color-primary);
    --sf-accent-strong: var(--sf-color-primary-hover);
    --sf-ink: var(--sf-color-ink);
    --sf-muted: var(--sf-color-muted);
    --sf-border: var(--sf-color-border);
    --sf-surface: var(--sf-color-page);
    --sf-surface-raised: var(--sf-color-surface);
    --sf-surface-soft: var(--sf-color-surface-soft);
}

html {
    color-scheme: light;
    scroll-padding-top: 5rem;
}

body {
    background: var(--sf-color-page);
    color: var(--sf-color-ink);
}

:where(.sf-page-content, .admin-content) {
    min-width: 0;
    color: var(--sf-color-text);
}

.sf-page-content {
    min-height: 45vh;
}

:where(.sf-page-content, .admin-content) :where(.card, .modal-content, .offcanvas, .toast):not(.shop *) {
    border-color: var(--sf-color-border);
    border-radius: var(--sf-radius-md);
    box-shadow: var(--sf-shadow-sm);
}

:where(.sf-page-content, .admin-content) :where(.card-header, .modal-header, .offcanvas-header):not(.shop *) {
    border-color: var(--sf-color-border);
    background: var(--sf-color-surface-soft);
}

:where(.sf-page-content, .admin-content) :where(.btn-primary, .btn-success):not(.shop *) {
    --bs-btn-bg: var(--sf-color-primary);
    --bs-btn-border-color: var(--sf-color-primary);
    --bs-btn-hover-bg: var(--sf-color-primary-hover);
    --bs-btn-hover-border-color: var(--sf-color-primary-hover);
    --bs-btn-active-bg: var(--sf-color-primary-hover);
    --bs-btn-active-border-color: var(--sf-color-primary-hover);
    --bs-btn-focus-shadow-rgb: var(--sf-color-primary-rgb);
}

:where(.sf-page-content, .admin-content) :where(.form-control, .form-select, .input-group-text):not(.shop *) {
    border-color: var(--sf-color-border-strong);
    border-radius: var(--sf-radius-sm);
    color: var(--sf-color-ink);
}

:where(.sf-page-content, .admin-content) :where(.form-control, .form-select):not(.shop *):focus {
    border-color: var(--sf-color-primary);
    box-shadow: 0 0 0 .22rem rgba(var(--sf-color-primary-rgb), .14);
}

:where(.sf-page-content, .admin-content) :where(.form-label):not(.shop *) {
    color: var(--sf-color-ink);
    font-weight: 650;
}

:where(.sf-page-content, .admin-content) :where(.table, .list-group-item):not(.shop *) {
    --bs-table-border-color: var(--sf-color-border);
    --bs-list-group-border-color: var(--sf-color-border);
}

:where(.sf-page-content, .admin-content) :where(.dropdown-menu, .popover, .tooltip):not(.shop *) {
    border-color: var(--sf-color-border);
    border-radius: var(--sf-radius-md);
    box-shadow: var(--sf-shadow-md);
}

:where(.sf-page-content, .admin-content) :where(.alert):not(.shop *) {
    border-radius: var(--sf-radius-sm);
}

:where(.sf-page-content, .admin-content) :where(a):not(.shop a) {
    text-underline-offset: .2em;
}

:where(.sf-page-content, .admin-content) :where(button, a, input, select, textarea, [tabindex]):focus-visible {
    outline-color: var(--sf-color-primary);
}

@media (max-width: 575.98px) {
    .admin-content {
        overflow-x: clip;
    }
}
