/* admin.css — GENERATED by tools/sitedash/bin/build-css.mjs: os/admin.css (OmniStore) + sd.css (SiteDash). Edit those, not this. */
/* ============================================================
   NexaStore Admin Dashboard — CSS
   Dark theme, refined, production-grade
   ============================================================ */

/* ── Reset & Variables ──────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --sidebar-w: 250px;
    --topbar-h: 60px;
    --primary: #5E296D;
    --primary-hover: #4A2058;
    --primary-light: rgba(94,41,109,0.09);
    --bg: #F7F7F5;
    --bg-card: #FFFFFF;
    --bg-input: #FBFAF7;
    --border: #E7E2D9;
    --border-hover: #CEC7BA;
    --text: #201E24;
    --text-muted: #6F6A77;
    --text-dim: #A19BAA;
    --success: #178A50;
    --success-bg: rgba(23,138,80,0.10);
    --warning: #A87508;
    --warning-bg: rgba(185,126,10,0.12);
    --danger: #CF3A3A;
    --danger-bg: rgba(207,58,58,0.10);
    --info: #2563C4;
    --info-bg: rgba(37,99,196,0.09);
    --radius: 10px;
    --radius-sm: 6px;
    --shadow: 0 1px 2px rgba(32,30,36,0.05), 0 10px 28px -18px rgba(32,30,36,0.14);
    --transition: 0.2s ease;
    /* Sidebar rail — deliberately kept ink-dark: a calm contrast anchor that
       also keeps client logos (usually light marks) visible. */
    --side-bg: #2A1130;
    --side-bg-hover: rgba(255,255,255,0.06);
    --side-border: #3D2144;
    --side-text: #C9BCD0;
    --side-text-dim: #8A7694;
}

body {
    font-family: 'Manrope', 'Cairo', -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
    min-height: 100vh;
}

body[dir="rtl"] { font-family: 'Cairo', 'Manrope', sans-serif; }

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }
img { max-width: 100%; }

/* ── Sidebar ────────────────────────────────────────────── */
.admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: var(--side-bg);
    border-right: 1px solid var(--side-border);
    overflow-y: auto;
    z-index: 100;
    transition: transform 0.3s;
}

body[dir="rtl"] .admin-sidebar { left: auto; right: 0; border-right: none; border-left: 1px solid var(--side-border); }

.sidebar-logo {
    padding: 18px 20px;
    border-bottom: 1px solid var(--side-border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-logo img { height: 32px; width: auto; }

.sidebar-logo .logo-text {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.3px;
    display: inline-block;
    background: linear-gradient(90deg, #453C8F 0%, #9B5C84 50%, #FD7A6C 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.sidebar-logo .logo-text span { -webkit-text-fill-color: transparent; color: transparent; }

.sidebar-nav { padding: 12px 0; }

.sidebar-section {
    padding: 6px 20px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--side-text-dim);
    margin-top: 12px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 20px;
    color: var(--side-text);
    font-size: 13px;
    transition: all var(--transition);
    border-left: 3px solid transparent;
}

body[dir="rtl"] .sidebar-nav a { border-left: none; border-right: 3px solid transparent; }

.sidebar-nav a:hover { color: #fff; background: var(--side-bg-hover); }

.sidebar-nav a.active {
    color: #FF9B94;
    background: rgba(215,52,44,0.16);
    border-left-color: var(--primary);
}

body[dir="rtl"] .sidebar-nav a.active { border-left-color: transparent; border-right-color: var(--primary); }

.sidebar-nav a svg { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.7; }
.sidebar-nav a.active svg { opacity: 1; }

.sidebar-nav .nav-badge {
    margin-left: auto;
    background: var(--primary);
    color: #fff;
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 10px;
    font-weight: 600;
}

body[dir="rtl"] .sidebar-nav .nav-badge { margin-left: 0; margin-right: auto; }

/* ── Topbar ─────────────────────────────────────────────── */
.admin-topbar {
    position: fixed;
    top: 0;
    left: var(--sidebar-w);
    right: 0;
    height: var(--topbar-h);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 90;
}

body[dir="rtl"] .admin-topbar { left: 0; right: var(--sidebar-w); }

.topbar-left { display: flex; align-items: center; gap: 12px; }

.topbar-title { font-size: 16px; font-weight: 600; }

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    padding: 6px;
}

.topbar-right { display: flex; align-items: center; gap: 16px; }

.topbar-right .lang-switch {
    padding: 5px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    transition: all var(--transition);
}

.topbar-right .lang-switch:hover { border-color: var(--primary); color: var(--text); }

.topbar-right .admin-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
}

.topbar-right .admin-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
}

.topbar-right .btn-logout {
    color: var(--text-dim);
    font-size: 12px;
    cursor: pointer;
    background: none;
    border: none;
    transition: color var(--transition);
}

.topbar-right .btn-logout:hover { color: var(--danger); }

/* ── Main Content ───────────────────────────────────────── */
.admin-main {
    margin-left: var(--sidebar-w);
    margin-top: var(--topbar-h);
    padding: 24px;
    min-height: calc(100vh - var(--topbar-h));
}

body[dir="rtl"] .admin-main { margin-left: 0; margin-right: var(--sidebar-w); }

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

.page-header h1 {
    font-size: 22px;
    font-weight: 700;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.breadcrumb a { color: var(--text-dim); }
.breadcrumb a:hover { color: var(--primary); }

/* ── Cards ──────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
}

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

.card-header h3 { font-size: 15px; font-weight: 600; }

.card-flush { padding: 0; }
.card-flush .card-header { padding: 18px 24px; margin-bottom: 0; }

/* ── Stats Grid ─────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: border-color var(--transition);
}

.stat-card:hover { border-color: var(--border-hover); }

.stat-card .stat-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.stat-card .stat-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

/* ── Tables ─────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.card-flush { overflow-x: auto; -webkit-overflow-scrolling: touch; }

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

table th, .tbl th {
    padding: 12px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-dim);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

body[dir="rtl"] table th { text-align: right; }

table td, .tbl td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    vertical-align: middle;
}

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

table tr:hover td { background: rgba(32,30,36,0.028); }

table .thumb {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background: var(--bg);
    border: 1px solid var(--border);
}

table .no-thumb {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    background: var(--bg);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    font-size: 16px;
}

/* ── Buttons ────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 18px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.4;
}

.btn svg { width: 16px; height: 16px; }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); color: #fff; transform: translateY(-1px); }

.btn-success { background: var(--success); color: #000; }
.btn-success:hover { opacity: 0.9; }

.btn-danger { background: var(--danger-bg); color: var(--danger); border: 1px solid rgba(248,113,113,0.2); }
.btn-danger:hover { background: var(--danger); color: #fff; }

.btn-outline { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--text-muted); color: var(--text); }

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 12px 28px; font-size: 14px; }
.btn-block { width: 100%; }

.btn-icon {
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

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

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

.form-group label .required { color: var(--primary); }

.form-control {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color var(--transition);
}

.form-control:focus { border-color: var(--primary); }

.form-control::placeholder { color: var(--text-dim); }

textarea.form-control { min-height: 100px; resize: vertical; }

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%237A7A96' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

body[dir="rtl"] select.form-control {
    background-position: left 12px center;
    padding-right: 14px;
    padding-left: 32px;
}

.form-hint {
    font-size: 11px;
    color: var(--text-dim);
    margin-top: 4px;
}

.form-error {
    font-size: 11px;
    color: var(--danger);
    margin-top: 4px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.form-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

/* ── Tabs ───────────────────────────────────────────────── */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
    overflow-x: auto;
}

.tabs .tab {
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    font-family: inherit;
}

.tabs .tab:hover { color: var(--text); }
.tabs .tab.active { color: var(--primary); border-bottom-color: var(--primary); }

.tab-content { display: none; }
.tab-content.active { display: block; }

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

.badge-success { background: var(--success-bg); color: var(--success); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-muted { background: rgba(32,30,36,0.07); color: var(--text-muted); }

.stat-badge { font-size: 11px; color: var(--warning); margin-top: 4px; }
.breadcrumb { font-size: 12px; color: var(--text-muted); display: flex; gap: 6px; margin-bottom: 4px; }
.breadcrumb a { color: var(--text-dim); }
.breadcrumb a:hover { color: var(--primary); }

/* ── Image Upload ───────────────────────────────────────── */
.image-upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    background: var(--bg);
}

.image-upload-area:hover { border-color: var(--primary); background: var(--primary-light); }

.image-upload-area svg { color: var(--text-dim); margin-bottom: 8px; }
.image-upload-area p { color: var(--text-muted); font-size: 13px; }
.image-upload-area .hint { font-size: 11px; color: var(--text-dim); margin-top: 4px; }

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.image-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 2px solid var(--border);
    cursor: grab;
    transition: border-color var(--transition);
}

.image-item:hover { border-color: var(--border-hover); }
.image-item.primary { border-color: var(--primary); }

.image-item img,
.image-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: #000;
}

.image-item .media-type-badge {
    position: absolute;
    top: 4px;
    left: 4px;
    background: rgba(0,0,0,0.78);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .3px;
    padding: 2px 7px;
    border-radius: 4px;
    pointer-events: none;
}

body[dir="rtl"] .image-item .media-type-badge { left: auto; right: 4px; }

.image-item .image-actions {
    position: absolute;
    top: 4px;
    right: 4px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity var(--transition);
}

body[dir="rtl"] .image-item .image-actions { right: auto; left: 4px; }

.image-item:hover .image-actions { opacity: 1; }

.image-item .image-actions button {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
}

.image-item .btn-set-primary { background: var(--primary); color: #fff; }
.image-item .btn-delete-img { background: rgba(0,0,0,0.7); color: var(--danger); }

.image-item .primary-badge {
    position: absolute;
    bottom: 4px;
    left: 4px;
    background: var(--primary);
    color: #fff;
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 600;
}

body[dir="rtl"] .image-item .primary-badge { left: auto; right: 4px; }

/* ── Option Groups ──────────────────────────────────────── */
.option-group-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
    background: var(--bg);
}

.option-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.option-values-list { margin-top: 10px; }

.option-value-row {
    display: grid;
    grid-template-columns: 1fr 1fr 80px 80px 80px 36px;
    gap: 8px;
    align-items: center;
    margin-bottom: 6px;
}

.option-value-row input {
    padding: 7px 10px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    font-size: 12px;
    font-family: inherit;
    outline: none;
}

.option-value-row input:focus { border-color: var(--primary); }

/* ── Color Picker ───────────────────────────────────────── */
input[type="color"] {
    width: 36px;
    height: 36px;
    padding: 2px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
}

/* ── Flash Messages ─────────────────────────────────────── */
.flash-messages { margin-bottom: 20px; }

.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: slideDown 0.3s ease;
}

.alert-success { background: var(--success-bg); color: var(--success); border: 1px solid rgba(52,211,153,0.2); }
.alert-error { background: var(--danger-bg); color: var(--danger); border: 1px solid rgba(248,113,113,0.2); }
.alert-warning { background: var(--warning-bg); color: var(--warning); border: 1px solid rgba(251,191,36,0.2); }
.alert-info { background: var(--info-bg); color: var(--info); border: 1px solid rgba(96,165,250,0.2); }

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

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

.pagination a, .pagination span {
    padding: 7px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    border: 1px solid var(--border);
    color: var(--text-muted);
    transition: all var(--transition);
}

.pagination a:hover { border-color: var(--primary); color: var(--primary); }
.pagination .active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination .disabled { opacity: 0.4; pointer-events: none; }

/* ── Logo Preview ───────────────────────────────────────── */
.logo-preview {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
}

.logo-preview img {
    max-height: 50px;
    width: auto;
    background: var(--bg);
    padding: 8px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

/* ── Empty State ────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
}

.empty-state svg { color: var(--text-dim); margin-bottom: 12px; }
.empty-state h3 { font-size: 16px; margin-bottom: 6px; color: var(--text); }
.empty-state p { font-size: 13px; margin-bottom: 16px; }

/* ── Confirm Modal ──────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
}

.modal-overlay.show { opacity: 1; visibility: visible; }

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    max-width: 400px;
    width: 90%;
    transform: scale(0.95);
    transition: transform 0.2s;
}

.modal-overlay.show .modal { transform: scale(1); }
.modal h3 { margin-bottom: 8px; }
.modal p { color: var(--text-muted); font-size: 13px; margin-bottom: 20px; }

/* ── Loading ────────────────────────────────────────────── */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(12,12,16,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    z-index: 10;
}

/* ── Search Bar ─────────────────────────────────────────── */
.search-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.search-bar input {
    flex: 1;
    padding: 9px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 13px;
    outline: none;
    font-family: inherit;
}

.search-bar input:focus { border-color: var(--primary); }

/* ── Responsive ─────────────────────────────────────────── */
/* ============================================================
   RESPONSIVE — Tablet (1024px) + Mobile (768px) + Small (480px)
   ============================================================ */

/* Sidebar overlay backdrop */
.sidebar-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 49; opacity: 0; visibility: hidden; transition: all 0.3s; }
.sidebar-overlay.show { opacity: 1; visibility: visible; }

@media (max-width: 1024px) {
    .admin-sidebar { transform: translateX(-100%); z-index: 50; }
    body[dir="rtl"] .admin-sidebar { transform: translateX(100%); }
    .admin-sidebar.open { transform: translateX(0) !important; }
    .admin-topbar { left: 0 !important; right: 0 !important; }
    .admin-main { margin-left: 0 !important; margin-right: 0 !important; }
    .menu-toggle { display: block !important; }
}

@media (max-width: 768px) {
    .admin-main { padding: 14px 10px; }

    /* Stats */
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .stat-card { padding: 14px; }
    .stat-value { font-size: 20px; }

    /* Page header */
    .page-header { flex-direction: column; align-items: stretch !important; gap: 10px; }
    .page-header h1 { font-size: 18px; }
    .page-header .btn { width: 100%; text-align: center; justify-content: center; }

    /* Cards side-by-side → stack */
    [style*="grid-template-columns: 1fr 1fr"],
    [style*="grid-template-columns:1fr 1fr"],
    [style*="grid-template-columns: 2fr 1fr"],
    [style*="grid-template-columns:2fr 1fr"],
    [style*="grid-template-columns: 1fr 1.2fr"],
    [style*="grid-template-columns:1fr 1.2fr"] {
        grid-template-columns: 1fr !important;
    }

    /* Forms */
    .form-row { grid-template-columns: 1fr !important; }
    .option-value-row { grid-template-columns: 1fr 1fr; }

    /* Tables — horizontal scroll */
    .table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    table { min-width: 600px; }
    .card-flush table { min-width: 500px; }
    th, td { padding: 10px 8px; font-size: 12px; white-space: nowrap; }
    .thumb { width: 36px; height: 36px; }

    /* Tabs — horizontal scroll */
    .tabs { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; gap: 0; }
    .tabs .tab { white-space: nowrap; flex-shrink: 0; padding: 10px 14px; font-size: 12px; }

    /* Topbar */
    .admin-topbar { padding: 0 10px; }
    .topbar-title { font-size: 14px; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .topbar-right { gap: 6px; }
    .admin-info span { display: none; }
    .btn-logout { font-size: 11px; padding: 5px 10px; }
    .lang-switch { font-size: 11px; padding: 4px 8px; }

    /* Cards */
    .card { padding: 14px; }
    .card-header { padding: 12px 14px; }
    .card-header h3 { font-size: 14px; }

    /* Search bar */
    .search-bar { flex-direction: column; }
    .search-bar input { width: 100%; }
    .search-bar .btn { width: 100%; }

    /* Buttons */
    .btn-group { flex-wrap: wrap; }
    .btn { padding: 8px 14px; font-size: 12px; }
    .btn-sm { padding: 5px 10px; font-size: 11px; }
    .btn-lg { padding: 12px 20px; font-size: 14px; }
    .btn-block { width: 100%; }

    /* Status filter tabs */
    [style*="display:flex;gap:6px;margin-bottom"] { overflow-x: auto; flex-wrap: nowrap !important; -webkit-overflow-scrolling: touch; padding-bottom: 6px; }

    /* Dashboard grids */
    [style*="grid-template-columns: repeat(4,1fr)"],
    [style*="grid-template-columns:repeat(4,1fr)"],
    [style*="grid-template-columns: repeat(3,1fr)"],
    [style*="grid-template-columns:repeat(3,1fr)"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Hero slides admin — image preview */
    .card img[style*="max-height:100px"] { max-height: 60px !important; }

    /* Shipping governorates table */
    .card-flush table input[type="number"],
    .card-flush table input[type="text"] { min-width: 50px; }

    /* Admin sidebar */
    .admin-sidebar { width: 260px; }
    .sidebar-logo { padding: 14px; }
    .sidebar-logo h2 { font-size: 16px; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .stat-card { padding: 12px; }
    .stat-value { font-size: 18px; }
    .stat-label { font-size: 11px; }

    .admin-main { padding: 10px 8px; }
    .card { padding: 12px; border-radius: 8px; }

    table { min-width: 450px; }
    th, td { padding: 8px 6px; font-size: 11px; }

    .page-header h1 { font-size: 16px; }
    .breadcrumb { font-size: 11px; }

    /* Sidebar full width on small phones */
    .admin-sidebar { width: 100%; max-width: 280px; }
}

/* ============================================================
   Responsive hardening — prevent horizontal overflow on mobile
   (dashboard KPI numbers, inline grids, period filter, tables)
   ============================================================ */
.admin-main { overflow-x: hidden; max-width: 100%; }
html, body { overflow-x: hidden; }

/* Grid items must be allowed to shrink below their content width,
   otherwise long currency values push the layout wider than the screen. */
.dash-kpis > *,
[style*="grid-template-columns"] > * { min-width: 0; }

/* Big inline numbers on the dashboard health strip should wrap, not overflow. */
.admin-main a[style*="font-weight:800"] > div,
.admin-main div[style*="font-weight:800"] { overflow-wrap: anywhere; word-break: break-word; }

/* Period / date filter bar: wrap on small screens instead of overflowing. */
.period-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.period-custom { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

@media (max-width: 768px) {
    .period-bar { gap: 6px; }
    .period-bar .period-btn { flex: 0 0 auto; }
    .period-custom { width: 100%; }
    .period-custom .form-control { flex: 1 1 130px; min-width: 0; }
    .period-sep { display: none; }
    /* Health strip + any 5/6-col inline grids → 2 columns on phones */
    [style*="repeat(auto-fit,minmax(150px"],
    [style*="repeat(auto-fit, minmax(150px"] { grid-template-columns: repeat(2, 1fr) !important; }
    [style*="repeat(auto-fit,minmax(170px"],
    [style*="repeat(auto-fit, minmax(170px"] { grid-template-columns: repeat(2, 1fr) !important; }
}
@media (max-width: 420px) {
    [style*="repeat(auto-fit,minmax(150px"],
    [style*="repeat(auto-fit, minmax(150px"],
    [style*="repeat(auto-fit,minmax(170px"],
    [style*="repeat(auto-fit, minmax(170px"] { grid-template-columns: 1fr 1fr !important; }
}

/* ═══════════════════════════════════════════════════════════
   LIGHT-MODE POLISH LAYER
   Scrollbars, selection, focus rings, multi-selects, and
   component refinement for the paper-and-ink admin canvas.
   ═══════════════════════════════════════════════════════════ */

/* ── Scrollbars — slim, rounded, quiet ── */
* { scrollbar-width: thin; scrollbar-color: #CFC8BC transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: #D5CEC2; border-radius: 99px;
    border: 3px solid transparent; background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: #B9B1A2; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-corner { background: transparent; }
/* dark rail keeps a dark thumb */
.admin-sidebar { scrollbar-color: #38343F transparent; }
.admin-sidebar::-webkit-scrollbar { width: 8px; }
.admin-sidebar::-webkit-scrollbar-thumb { background: #38343F; border: 2px solid transparent; background-clip: padding-box; }
.admin-sidebar::-webkit-scrollbar-thumb:hover { background: #4A4556; }

::selection { background: rgba(215,52,44,0.18); }

/* ── Inputs: calmer borders, real focus ring ── */
.form-control { background: var(--bg-input); }
.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
    background: #fff;
    outline: none;
}
.form-control::placeholder { color: var(--text-dim); }

/* ── Multi-selects (e.g. product categories): no more raw OS box ── */
select[multiple].form-control, select[size].form-control {
    padding: 6px;
    background: #fff;
    border-radius: var(--radius-sm);
    overflow-y: auto;
}
select[multiple].form-control option, select[size].form-control option {
    padding: 8px 12px;
    border-radius: 6px;
    margin: 2px 2px;
    color: var(--text);
    cursor: pointer;
}
select[multiple].form-control option:hover { background: rgba(32,30,36,0.05); }
select[multiple].form-control option:checked,
select[size].form-control option:checked {
    background: linear-gradient(0deg, var(--primary-light), var(--primary-light)) #fff;
    color: var(--primary);
    font-weight: 600;
}

/* ── Cards: hairline + soft diffuse shadow ── */
.card { box-shadow: var(--shadow); }

/* ── Buttons: subtle depth on primary, crisp neutrals ── */
.btn-primary { box-shadow: 0 1px 2px rgba(179,39,31,0.28), 0 6px 16px -8px rgba(215,52,44,0.45); }
.btn-primary:hover { box-shadow: 0 1px 2px rgba(179,39,31,0.3), 0 8px 18px -8px rgba(215,52,44,0.55); }
.btn:active { transform: translateY(1px); }

/* ── Tables: micro-label headers ── */
table th, .tbl th {
    font-size: 11px; text-transform: uppercase; letter-spacing: 0.7px;
    color: var(--text-muted); font-weight: 600;
}

/* ── Topbar: frosted paper ── */
.admin-topbar { background: rgba(255,255,255,0.85); backdrop-filter: blur(10px); }

/* ── Nice checkbox/radio accent ── */
input[type="checkbox"], input[type="radio"] { accent-color: var(--primary); }
input[type="range"] { accent-color: var(--primary); }

/* ═══ Sidebar nav groups (collapsible) ═══ */
.nav-group { margin: 2px 0; }
.nav-group__head {
    display: flex; align-items: center; justify-content: space-between; width: 100%;
    background: none; border: none; cursor: pointer;
    padding: 9px 20px 7px; margin-top: 8px;
    font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px;
    color: var(--side-text-dim); font-family: inherit;
    transition: color var(--transition);
}
.nav-group__head:hover { color: var(--side-text); }
.nav-group__chev { width: 14px; height: 14px; transition: transform 0.22s ease; opacity: .7; }
.nav-group.open .nav-group__chev { transform: rotate(180deg); }
.nav-group__items { display: none; }
.nav-group.open .nav-group__items { display: block; animation: navg .18s ease; }
@keyframes navg { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
.nav-group.is-active-group .nav-group__head { color: var(--side-text); }
.nav-external { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--side-border); }

/* ═══ Topbar: global search + View Store ═══ */
.topbar-search {
    position: relative; flex: 1; max-width: 460px; margin: 0 18px;
    display: flex; align-items: center; gap: 8px;
    background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
    padding: 7px 12px; transition: border-color var(--transition), box-shadow var(--transition);
}
.topbar-search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); background: #fff; }
.topbar-search svg { width: 15px; height: 15px; color: var(--text-dim); flex: none; }
.topbar-search input { flex: 1; border: none; background: transparent; font: inherit; font-size: 13px; color: var(--text); outline: none; min-width: 0; }
.topbar-search input::placeholder { color: var(--text-dim); }
.topbar-search__results {
    display: none; position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 200;
    background: #fff; border: 1px solid var(--border); border-radius: 12px;
    box-shadow: 0 18px 44px -18px rgba(32,30,36,0.28); max-height: 420px; overflow-y: auto; padding: 6px;
}
.topbar-search__results.open { display: block; }
.gs-group { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-dim); padding: 8px 10px 4px; }
.gs-row { display: block; padding: 8px 10px; border-radius: 8px; color: var(--text); }
.gs-row:hover { background: var(--primary-light); color: var(--text); }
.gs-row strong { display: block; font-size: 13px; font-weight: 600; }
.gs-row span { display: block; font-size: 11.5px; color: var(--text-muted); margin-top: 1px; }
.gs-empty { padding: 14px; text-align: center; color: var(--text-muted); font-size: 13px; }
.btn-viewstore {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 7px 13px; border: 1px solid var(--border); border-radius: 9px;
    color: var(--text) !important; font-size: 12.5px; font-weight: 600; background: #fff;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.btn-viewstore:hover { border-color: var(--border-hover); box-shadow: var(--shadow); }
@media (max-width: 900px) { .topbar-search { display: none; } .btn-viewstore span { display: none; } }

/* ═══ Sticky save bar ═══ */
.sticky-save-bar {
    position: fixed; bottom: 0; left: var(--sidebar-w); right: 0; z-index: 90;
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    background: rgba(255,255,255,0.92); backdrop-filter: blur(8px);
    border-top: 1px solid var(--border); padding: 12px 24px;
    box-shadow: 0 -10px 30px -18px rgba(32,30,36,0.25);
    transform: translateY(110%); transition: transform 0.25s ease;
}
body[dir="rtl"] .sticky-save-bar { left: 0; right: var(--sidebar-w); }
.sticky-save-bar.show { transform: none; }
.sticky-save-bar span { font-size: 13px; font-weight: 600; color: var(--text-muted); }
@media (max-width: 1024px) { .sticky-save-bar, body[dir="rtl"] .sticky-save-bar { left: 0; right: 0; } }

/* ═══ Dashboard: quick actions + launch checklist ═══ */
.quick-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.qa {
    display: inline-flex; align-items: center; gap: 8px;
    background: #fff; border: 1px solid var(--border); border-radius: 11px;
    padding: 10px 16px; font-size: 13px; font-weight: 600; color: var(--text) !important;
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}
.qa:hover { border-color: var(--border-hover); box-shadow: var(--shadow); transform: translateY(-1px); }
.qa span { font-size: 15px; }

.launch-card { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px; margin-bottom: 18px; box-shadow: var(--shadow); }
.launch-card__head { display: flex; justify-content: space-between; align-items: flex-start; }
.launch-card__head > div { display: flex; align-items: center; gap: 10px; }
.launch-card__head h3 { font-size: 15px; margin: 0; }
.launch-card__count { font-size: 12px; font-weight: 700; color: var(--primary); background: var(--primary-light); padding: 2px 9px; border-radius: 99px; }
.launch-card__dismiss { color: var(--text-dim); font-size: 20px; line-height: 1; padding: 0 4px; }
.launch-card__dismiss:hover { color: var(--text); }
.launch-card__bar { height: 6px; background: var(--bg); border-radius: 6px; margin: 12px 0 14px; overflow: hidden; }
.launch-card__bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), #F08A3C); border-radius: 6px; transition: width .4s ease; }
.launch-card__titles { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.launch-card__items { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.launch-item {
    display: flex; align-items: center; gap: 10px;
    background: var(--bg); border: 1.5px solid var(--border); border-radius: 12px;
    padding: 12px 14px; font-size: 13px; font-weight: 600; color: var(--text) !important;
    transition: border-color var(--transition), background var(--transition),
                box-shadow var(--transition), transform var(--transition);
}
.launch-item:hover { border-color: var(--primary); background: #fff; box-shadow: var(--shadow); transform: translateY(-2px); }
.launch-item__tick {
    width: 22px; height: 22px; border-radius: 50%; border: 2px dashed var(--border-hover);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 12px; color: #fff; flex: none; background: #fff;
    transition: border-color var(--transition);
}
.launch-item:hover .launch-item__tick { border-color: var(--primary); }
.launch-item__label { flex: 1; line-height: 1.35; }
.launch-item__go {
    display: inline-flex; align-items: center; gap: 4px; flex: none;
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
    color: var(--primary); background: var(--primary-light);
    padding: 4px 10px; border-radius: 99px;
}
.launch-item__go i { font-style: normal; transition: transform var(--transition); }
.launch-item:hover .launch-item__go i { transform: translateX(2px); }
body[dir="rtl"] .launch-item__go i { transform: scaleX(-1); }
body[dir="rtl"] .launch-item:hover .launch-item__go i { transform: scaleX(-1) translateX(2px); }
.launch-item.done { opacity: .58; }
.launch-item.done .launch-item__label { text-decoration: line-through; }
.launch-item.done .launch-item__tick { background: var(--success); border: 2px solid var(--success); }
.launch-item.done:hover { transform: none; border-color: var(--border); box-shadow: none; background: var(--bg); }

/* ═══ In-page tab bars (Analytics / Accounting families) ═══ */
.page-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 18px; background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 5px; width: fit-content; max-width: 100%; }
.page-tab {
    padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 600;
    color: var(--text-muted) !important; transition: background var(--transition), color var(--transition);
}
.page-tab:hover { color: var(--text) !important; background: var(--bg); }
.page-tab.active { background: var(--primary); color: #fff !important; box-shadow: 0 4px 12px -6px rgba(215,52,44,0.5); }

/* ═══════════════════════════════════════════════════════════
   MODERN FILE INPUTS (global)
   Restyles every native <input type="file"> across the admin —
   the "Choose File / No file chosen" control — into a branded
   button + filename row, without touching any page markup.
   ═══════════════════════════════════════════════════════════ */
input[type="file"] {
    font-family: inherit;
    font-size: 13px;
    color: var(--text-muted);
    background: var(--bg-input);
    border: 1.5px dashed var(--border-hover);
    border-radius: 10px;
    padding: 10px 12px;
    cursor: pointer;
    max-width: 100%;
    transition: border-color var(--transition), background var(--transition);
}
input[type="file"]:hover { border-color: var(--primary); background: #fff; }
input[type="file"]:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }

input[type="file"]::file-selector-button {
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    background: var(--primary);
    border: none;
    border-radius: 7px;
    padding: 8px 16px;
    margin-inline-end: 12px;
    cursor: pointer;
    transition: background var(--transition), transform var(--transition);
    box-shadow: 0 1px 2px rgba(179,39,31,0.28), 0 6px 14px -8px rgba(215,52,44,0.5);
}
input[type="file"]::file-selector-button:hover { background: var(--primary-hover); transform: translateY(-1px); }
/* legacy WebKit fallback */
input[type="file"]::-webkit-file-upload-button {
    font-family: inherit; font-size: 13px; font-weight: 600; color: #fff;
    background: var(--primary); border: none; border-radius: 7px;
    padding: 8px 16px; margin-inline-end: 12px; cursor: pointer;
}

/* ── Button depth polish (subtle, applies to existing .btn classes) ── */
.btn { letter-spacing: 0.01em; }
.btn-outline { background: #fff; }
.btn-outline:hover { border-color: var(--border-hover); color: var(--text); box-shadow: var(--shadow); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-sm { padding: 7px 13px; font-size: 12.5px; }

/* ── PWA topbar buttons (install + order alerts bell) ── */
.btn-topbar-icon {
    position: relative; display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: 9px; flex: none;
    border: 1px solid var(--border); background: #fff; color: var(--text-muted);
    cursor: pointer; transition: all var(--transition);
}
.btn-topbar-icon:hover { color: var(--text); border-color: var(--border-hover); box-shadow: var(--shadow); }
#pwa-notify-dot { position: absolute; top: 6px; right: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); border: 2px solid #fff; }

/* ════════════════════════════════════════════════════════════════════════
   Admin account menu (v1_45).
   The topbar could not hold View Store + language + name + Logout on a
   phone — the trailing controls were pushed past the edge in both LTR and
   RTL. Everything after the bell now collapses behind the avatar on mobile,
   while desktop keeps the familiar inline row.
   ════════════════════════════════════════════════════════════════════════ */
.admin-acct { position: relative; flex-shrink: 0; }
.admin-acct__btn {
    display: flex; align-items: center; gap: 9px;
    padding: 4px 8px 4px 4px; border: 1px solid transparent; border-radius: 999px;
    background: transparent; cursor: pointer; font-family: inherit;
    color: var(--text); transition: background .18s, border-color .18s;
}
.admin-acct__btn:hover { background: var(--bg-gray, #f4f5f7); border-color: var(--border-color, #e5e7eb); }
.admin-acct.is-open .admin-acct__btn { background: var(--bg-gray, #f4f5f7); border-color: var(--border-color, #e5e7eb); }
.admin-acct__name { font-size: 13px; font-weight: 600; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-acct__chev { flex-shrink: 0; opacity: .55; transition: transform .2s; }
.admin-acct.is-open .admin-acct__chev { transform: rotate(180deg); }

.admin-acct__menu {
    position: absolute; top: calc(100% + 8px); inset-inline-end: 0; z-index: 300;
    min-width: 232px; padding: 6px;
    background: var(--card-bg, #fff); border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 12px; box-shadow: 0 16px 44px rgba(15, 23, 42, .16);
    opacity: 0; visibility: hidden; transform: translateY(-6px);
    transition: opacity .18s ease, transform .18s ease, visibility 0s .18s;
}
.admin-acct.is-open .admin-acct__menu { opacity: 1; visibility: visible; transform: none; transition: opacity .18s ease, transform .18s ease, visibility 0s; }
.admin-acct__head { padding: 10px 12px 12px; border-bottom: 1px solid var(--border-color, #e5e7eb); margin-bottom: 6px; }
.admin-acct__head strong { display: block; font-size: 13.5px; }
.admin-acct__head span { display: block; font-size: 11.5px; color: var(--text-muted, #6b7280); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; }
.admin-acct__item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: 8px;
    font-size: 13.5px; font-weight: 600; color: var(--text); text-decoration: none;
    transition: background .16s, color .16s;
}
.admin-acct__item:hover { background: var(--bg-gray, #f4f5f7); }
.admin-acct__item svg { flex-shrink: 0; opacity: .7; }
.admin-acct__item--danger { color: var(--danger, #dc2626); }
.admin-acct__item--danger svg { opacity: .9; }
.admin-acct__sep { height: 1px; background: var(--border-color, #e5e7eb); margin: 6px 4px; }
/* These duplicate controls that already sit in the topbar on desktop. */
.admin-acct__item--mobile { display: none; }

@media (max-width: 768px) {
    /* Hide the standalone controls; the menu carries them instead. */
    .topbar-right .btn-viewstore,
    .topbar-right > .lang-switch { display: none; }
    .admin-acct__item--mobile { display: flex; }
    .admin-acct__name, .admin-acct__chev { display: none; }
    .admin-acct__btn { padding: 3px; }
    .admin-acct__menu { min-width: 224px; }
    .topbar-right { gap: 4px; }
    .topbar-title { max-width: 46vw; }
}
@media (max-width: 380px) { .topbar-title { max-width: 34vw; } }


/* ═══════════════════════════════════════════════════════════════════════════
   SiteDash — the OmniStore admin look applied to the website dashboard.
   admin.css = os/admin.css (the OmniStore stylesheet, untouched) + this file (built by tools/sitedash/bin/build-css.mjs).
   Everything here either styles SiteDash-only screens (editor, pictures, visitors, pages) or maps the older SiteDash
   class names (.btn-sec, .pill, .tbl …) onto OmniStore's components so both dashboards look the same.
   ═══════════════════════════════════════════════════════════════════════════ */
:root { --bg-gray: #F2F1EC; --card-bg: #FFFFFF; --border-color: #E7E2D9; --bg-secondary: #FBFAF7; --sd-ink: #201E24; }
html, body { overflow-x: hidden; }
body { -webkit-font-smoothing: antialiased; }
[dir="rtl"] body, body[dir="rtl"] { font-family: 'Cairo', 'Manrope', sans-serif; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.ico { width: 18px; height: 18px; flex: none; }
h1, h2, h3 { margin: 0; }
small { font-size: 12px; }

/* fixes for rules the OmniStore stylesheet references but never defines */
.btn-secondary { background: #fff; color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--border-hover); box-shadow: var(--shadow); }
.image-upload-area.dragover { border-color: var(--primary); background: var(--primary-light); }

/* ── sign in ─────────────────────────────────────────────────────────────── */
.login-body { display: grid; place-items: center; min-height: 100vh; background: radial-gradient(ellipse at 70% 20%, #4A2058, var(--side-bg) 60%); padding: 20px; }
.login { width: min(400px, 100%); background: #fff; border-radius: 18px; padding: 30px 28px; box-shadow: 0 40px 90px rgba(0,0,0,.4); display: grid; gap: 14px; }
.login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.login-brand img { width: 40px; height: 40px; border-radius: 10px; }
.login-brand span { font-size: 20px; font-weight: 800; color: var(--text); }
.login-brand small { margin-inline-start: auto; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-dim); }
.login label { display: grid; gap: 6px; font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .3px; }
.login input { height: 44px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0 14px; background: var(--bg-input); font-size: 14px; text-transform: none; letter-spacing: 0; }
.login input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.login button { height: 44px; border: 0; border-radius: var(--radius-sm); background: var(--primary); color: #fff; font-weight: 700; margin-top: 4px; }
.login button:hover { background: var(--primary-hover); }
.login-err { background: var(--danger-bg); color: var(--danger); padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13px; margin: 0; }
.login-ok { background: var(--success-bg); color: var(--success); padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13px; margin: 0; }
.login-links { font-size: 13px; color: var(--text-muted); text-align: center; margin: 0; }

/* ── frame bits SiteDash adds ────────────────────────────────────────────── */
.sidebar-logo .site-name { color: #fff; font-weight: 800; font-size: 16px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; }
.sidebar-logo img.site-logo { max-height: 36px; width: auto; max-width: 160px; }
.sidebar-logo .site-sub { display: block; font-size: 10.5px; color: var(--side-text-dim); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; margin-top: 2px; }
.sidebar-nav a .ico { width: 18px; height: 18px; opacity: .7; }
.sidebar-nav a.active .ico { opacity: 1; }
.sidebar-nav a.nav-studio { background: linear-gradient(135deg, #5E296D, #E4572E); color: #fff; border-radius: 8px; margin: 8px 12px 0; padding: 9px 12px; }
.sidebar-nav a.nav-studio:hover { color: #fff; filter: brightness(1.08); }
.sidebar-nav a.nav-studio .ico { opacity: 1; }
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 45; }
.sidebar-overlay.show { display: block; }
.topbar-right .lang-switch { text-decoration: none; }
.build-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; }
.build-pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.build-pill[data-state="building"], .build-pill[data-state="queued"] { animation: sd-pulse 1.2s ease-in-out infinite; }
@keyframes sd-pulse { 50% { opacity: .45; } }
.page-hint { display: none; align-items: flex-start; gap: 8px; background: #f0f9ff; border: 1px solid #bae6fd; color: #075985; font-size: 12.5px; line-height: 1.7; border-radius: 10px; padding: 9px 13px; margin: 0 0 16px; }
.page-hint.show { display: flex; }
.page-hint span:first-child { flex: none; }
.page-hint span:nth-child(2) { flex: 1; }
.page-hint a { flex: none; color: #0284c7; text-decoration: none; font-weight: 700; font-size: 14px; line-height: 1; }
.page-header .ed-help { color: var(--text-muted); font-size: 13px; margin-top: 4px; max-width: 760px; }
.page-header h1 small { font-size: 13px; font-weight: 600; color: var(--text-muted); margin-inline-start: 6px; }
.ed-back { display: inline-block; font-size: 12.5px; color: var(--text-muted); margin-bottom: 4px; }
.ed-back:hover { color: var(--primary); }
.ed-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ed-langs { display: inline-flex; background: #fff; border: 1px solid var(--border); border-radius: 999px; padding: 3px; }
.ed-langs button { padding: 5px 12px; border: 0; border-radius: 999px; background: none; font-size: 12px; font-weight: 700; color: var(--text-muted); }
.ed-langs button.on { background: var(--primary); color: #fff; }

/* ── legacy SiteDash buttons → OmniStore buttons ─────────────────────────── */
.btn-save, .btn-pri, .btn-sec, .btn-del, .add { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 18px; border: none; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; line-height: 1.4; text-decoration: none; transition: all var(--transition); }
.btn-save, .btn-pri { background: var(--primary); color: #fff; box-shadow: 0 1px 2px rgba(179,39,31,0.28), 0 6px 16px -8px rgba(215,52,44,0.45); }
.btn-save:hover, .btn-pri:hover { background: var(--primary-hover); color: #fff; transform: translateY(-1px); }
.btn-save[disabled] { background: #E9E5DF; color: #9A93A3; box-shadow: none; cursor: default; transform: none; }
.btn-save.busy { opacity: .7; }
.btn-sec { background: #fff; color: var(--text); border: 1px solid var(--border); }
.btn-sec:hover { border-color: var(--border-hover); color: var(--text); box-shadow: var(--shadow); transform: translateY(-1px); }
.btn-del { background: var(--danger-bg); color: var(--danger); border: 1px solid rgba(248,113,113,0.2); padding: 7px 13px; font-size: 12.5px; }
.btn-del:hover { background: var(--danger); color: #fff; }
.add { background: var(--primary-light); color: var(--primary); justify-self: start; }
.add:hover { background: var(--primary); color: #fff; }
.mini { width: 30px; height: 30px; border: 0; border-radius: 8px; background: none; color: var(--text-muted); font-size: 15px; }
.mini:hover { background: var(--bg-gray); color: var(--text); }

/* ── badges / pills / tabs / tables ──────────────────────────────────────── */
.pill { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; background: rgba(32,30,36,0.07); color: var(--text-muted); white-space: nowrap; }
.pill.ok, .pill.st-won, .pill.s-delivered, .pill.s-confirmed { background: var(--success-bg); color: var(--success); }
.pill.off, .pill.st-lost, .pill.st-spam, .pill.s-cancelled { background: rgba(32,30,36,0.07); color: var(--text-muted); }
.pill.st-new, .pill.s-new { background: var(--danger-bg); color: var(--danger); }
.pill.st-contacted, .pill.s-preparing, .pill.s-shipped { background: var(--info-bg); color: var(--info); }
.page-tabs b { font-weight: 700; margin-inline-start: 4px; opacity: .8; }
.page-tabs .page-tab.active b { opacity: 1; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl td small { display: block; color: var(--text-muted); font-size: 12px; }
.tbl-main { display: flex; align-items: center; gap: 12px; color: var(--text); }
.tbl-main img { width: 56px; height: 40px; object-fit: cover; border-radius: var(--radius-sm); background: var(--bg); border: 1px solid var(--border); }
.tbl-main small { color: var(--text-muted); }
.tbl-act { text-align: end; white-space: nowrap; }
.tbl-act > * + * { margin-inline-start: 6px; }
.tbl input, .tbl select { height: 34px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0 8px; font: inherit; font-size: 13px; width: 100%; min-width: 60px; background: var(--bg-input); }
.lead-row { cursor: pointer; }
.card > h2, .card h2.card-title { font-size: 15px; font-weight: 600; margin-bottom: 14px; }
.card > h2 + .ed-help { margin: -8px 0 12px; }
.card h2 small { font-size: 12px; color: var(--text-muted); font-weight: 600; margin-inline-start: 6px; }
.card .card + h2, .card form + h2, .card table + h2, .card ul + h2 { margin-top: 22px; }
.empty { color: var(--text-muted); padding: 24px 0; text-align: center; font-size: 13px; }
.warn { margin: 0 0 16px; padding: 12px 16px; border-radius: var(--radius-sm); background: var(--warning-bg); color: var(--warning); font-size: 13px; }
.ov-list { list-style: none; display: grid; margin: 0 0 12px; padding: 0; }
.ov-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.ov-list li:last-child { border-bottom: 0; }
.ov-list li a { color: var(--text); display: grid; min-width: 0; }
.ov-list li a:hover strong { color: var(--primary); }
.ov-list small { color: var(--text-muted); font-size: 12px; }
.ov-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.ov-cols.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ov-cols > .card { margin-bottom: 0; }
.forms-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.sw { position: relative; display: inline-block; width: 40px; height: 22px; vertical-align: middle; }
.sw input { position: absolute; opacity: 0; inset: 0; cursor: pointer; z-index: 1; margin: 0; }
.sw i { position: absolute; inset: 0; border-radius: 22px; background: #D5D0C8; transition: background .2s; }
.sw i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.sw input:checked + i { background: var(--success); }
.sw input:checked + i::after { transform: translateX(18px); }
.sw input:disabled + i { opacity: .35; }
[dir="rtl"] .sw i::after { left: auto; right: 3px; }
[dir="rtl"] .sw input:checked + i::after { transform: translateX(-18px); }
.search-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.search-bar input[type=search], .search-bar input[type=text] { flex: 1; min-width: 180px; }
.search-bar select { width: auto; min-width: 150px; }
.add-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.add-row input { flex: 1; min-width: 160px; }

/* ── dashboard home ──────────────────────────────────────────────────────── */
.period-bar { margin-bottom: 18px; }
.period-btn { display: inline-flex; align-items: center; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border); background: #fff; color: var(--text-muted); font-size: 12.5px; font-weight: 600; }
.period-btn:hover { border-color: var(--border-hover); color: var(--text); }
.period-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.dash-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; min-width: 0; overflow: hidden; color: inherit; text-decoration: none; display: block; box-shadow: var(--shadow); }
a.kpi:hover { border-color: var(--border-hover); }
.kpi .l { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.kpi .v { font-size: clamp(18px, 4.6vw, 26px); font-weight: 800; margin-top: 4px; color: var(--text); line-height: 1.15; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.kpi .s { font-size: 12px; color: var(--text-muted); margin-top: 2px; overflow-wrap: anywhere; }
.dash-sum { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 20px; align-items: start; }
.dash-sum > .card { margin-bottom: 0; }
.sum-table { width: 100%; border-collapse: collapse; }
.sum-table th, .sum-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: start; font-size: 13px; }
.sum-table th { font-size: 11px; text-transform: uppercase; color: var(--text-muted); }
.sum-table td.num, .sum-table th.num { text-align: end; font-variant-numeric: tabular-nums; }
.card-head-link { font-size: 12px; color: var(--primary); text-decoration: none; }
.site-status { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ── editor (SDEditor draws these) ───────────────────────────────────────── */
.ed, .bare { display: grid; gap: 14px; }
.grp { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.grp > summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 14px 20px; cursor: pointer; font-weight: 600; color: var(--text); font-size: 14.5px; }
.grp > summary::-webkit-details-marker { display: none; }
.grp > summary::before { content: ''; width: 8px; height: 8px; border-right: 2px solid var(--primary); border-bottom: 2px solid var(--primary); transform: rotate(-45deg); transition: transform .2s; flex: none; }
.grp[open] > summary::before { transform: rotate(45deg); }
[dir="rtl"] .grp > summary::before { transform: rotate(135deg); }
[dir="rtl"] .grp[open] > summary::before { transform: rotate(45deg); }
.grp > summary .cnt { margin-inline-start: auto; font-size: 11px; font-weight: 700; color: var(--text-muted); background: var(--bg-gray); padding: 3px 8px; border-radius: 6px; }
.grp-body { padding: 4px 20px 20px; display: grid; gap: 16px; border-top: 1px solid var(--border); }
.grp .grp { box-shadow: none; }
.grp .grp > summary { font-size: 13.5px; padding: 12px 16px; }
.grp .grp .grp-body { padding: 4px 16px 16px; }
.grp.loose { padding: 16px 20px; }
.grp-help { color: var(--text-muted); font-size: 12.5px; padding-top: 12px; }
.fld { display: grid; gap: 6px; }
.fld-l { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .3px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.fld-h { font-size: 12px; color: var(--text-dim); font-weight: 400; text-transform: none; letter-spacing: 0; }
.fld input[type=text], .fld input[type=number], .fld input[type=password], .fld input[type=date], .fld input[type=time], .fld input[type=url], .fld input[type=email], .fld textarea, .fld select, .fld-l select, .fld-l textarea, .fld-l input {
  width: 100%; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px; background: var(--bg-input); font-size: 14px; color: var(--text); transition: border-color .2s, box-shadow .2s; text-transform: none; letter-spacing: 0; font-weight: 400; }
.fld textarea { resize: vertical; min-height: 74px; line-height: 1.5; }
.fld input:focus, .fld textarea:focus, .fld select:focus, .fld-l input:focus, .fld-l textarea:focus, .fld-l select:focus { outline: none; border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px var(--primary-light); }
.fld input::placeholder, .fld textarea::placeholder { color: var(--text-dim); }
.fld select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%237A7A96' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
[dir="rtl"] .fld select { background-position: left 12px center; padding-right: 14px; padding-left: 32px; }
.cc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 8px; }
.cc-chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 4px 4px 11px; border-radius: 999px; background: var(--primary-light); color: var(--primary); font-size: 13px; line-height: 1.2; }
.cc-chip button { width: 22px; height: 22px; border: 0; border-radius: 50%; background: transparent; color: inherit; font-size: 16px; line-height: 1; }
.cc-chip button:hover { background: rgba(94,41,109,.18); }
.cc-none { font-size: 13px; color: var(--text-muted); }
.cc-add { max-width: 320px; }
.tr-set { display: grid; gap: 8px; }
.tr { display: flex; align-items: flex-start; gap: 8px; }
.tr > input, .tr > textarea, .tr > .rte { flex: 1; min-width: 0; }
.tr-tag { flex: none; width: 30px; height: 30px; margin-top: 6px; display: grid; place-items: center; border-radius: 8px; background: var(--bg-gray); color: var(--text-muted); font-size: 11px; font-weight: 700; }
.tr.miss .tr-tag { background: var(--warning-bg); color: var(--warning); }
.ed[data-lang="en"] .tr:not([data-l="en"]), .ed[data-lang="de"] .tr:not([data-l="de"]), .ed[data-lang="es"] .tr:not([data-l="es"]), .ed[data-lang="ar"] .tr:not([data-l="ar"]) { display: none; }
.ed:not([data-lang="all"]) .tr-tag { display: none; }
.ed:not([data-lang="all"]) .tr.miss > input, .ed:not([data-lang="all"]) .tr.miss > textarea { border-color: #F0C9AE; }
.cnt-chars { font-size: 11px; font-weight: 600; color: var(--text-muted); margin-inline-start: auto; text-transform: none; letter-spacing: 0; }
.cnt-chars.over { color: var(--danger); }
.inline-grp { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 10px 14px; padding: 14px; border-radius: var(--radius); background: var(--bg-secondary); border: 1px solid var(--border); }
.inline-grp > .fld-l { grid-column: 1 / -1; }
.items { display: grid; gap: 8px; }
.items.is-off { opacity: .5; }
.item { border-radius: var(--radius); background: var(--bg-secondary); border: 1px solid var(--border); }
.item > summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer; }
.item > summary::-webkit-details-marker { display: none; }
.item-n { font-size: 11px; font-weight: 700; color: var(--text-muted); min-width: 24px; }
.item-t { flex: 1; min-width: 0; font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.item-t em { color: var(--text-muted); font-style: italic; font-weight: 400; }
.item-x { display: flex; gap: 2px; }
.item-body { padding: 4px 14px 16px; display: grid; gap: 14px; border-top: 1px solid var(--border); }
.item[open] { background: #fff; border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.rows { display: grid; gap: 6px; }
.row { display: flex; align-items: flex-start; gap: 6px; }
.row > .tr-set, .row > input { flex: 1; min-width: 0; }
.row .opt-def { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-muted); white-space: nowrap; padding-top: 10px; }
.row-x { display: flex; padding-top: 2px; }
.fld-toggle { padding: 4px 0 12px; margin-bottom: 10px; border-bottom: 1px solid var(--border); }
.off-badge { margin-inline-start: 10px; font-size: 11px; font-weight: 700; color: var(--warning); background: var(--warning-bg); padding: 3px 9px; border-radius: 99px; }
.off-badge[hidden] { display: none; }
.keep-note { font-size: 12.5px; color: var(--text-muted); background: var(--bg-secondary); border: 1px dashed var(--border); border-radius: var(--radius-sm); padding: 8px 12px; }
.img-fld, .pic-fld { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.img-fld .thumb, .pic-fld .thumb { width: 168px; aspect-ratio: 16/9; border-radius: var(--radius-sm); background: var(--bg-gray) center/cover; border: 1px solid var(--border); display: grid; place-items: center; color: var(--text-muted); font-size: 12px; }
.pic-fld .thumb { width: 120px; aspect-ratio: 3/2; }
.img-fld .btns, .pic-fld .btns { display: flex; flex-wrap: wrap; gap: 6px; }
.img-fld.busy .thumb { opacity: .5; }
.vid-fld { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.vid-fld video { width: 168px; aspect-ratio: 16/9; border-radius: var(--radius-sm); background: #000; object-fit: cover; }
.vid-fld input { flex: 1; min-width: 200px; }
.icon-btn { display: inline-flex; align-items: center; gap: 10px; height: 42px; padding: 0 14px 0 6px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: #fff; justify-self: start; }
.icon-btn span { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: var(--side-bg); color: #fff; }
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; max-height: 60vh; overflow: auto; }
.icon-grid button { display: grid; justify-items: center; gap: 4px; padding: 10px 4px; border: 0; border-radius: 10px; background: none; font-size: 10.5px; color: var(--text-muted); }
.icon-grid button:hover, .icon-grid button.on { background: var(--primary-light); color: var(--text); }
.icon-grid .ico { width: 22px; height: 22px; color: var(--text); }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; max-height: 64vh; overflow: auto; }
.lib-grid button { aspect-ratio: 16/9; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-gray) center/cover; padding: 0; }
.lib-grid button:hover { outline: 3px solid var(--primary-light); border-color: var(--primary); }
.lib-grid button.on { outline: 3px solid var(--primary); }
.lib-grid figcaption { font-size: 11px; word-break: break-all; }
.rte { border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; overflow: hidden; }
.rte:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.rte-bar { display: flex; flex-wrap: wrap; gap: 2px; padding: 6px; border-bottom: 1px solid var(--border); background: var(--bg-secondary); }
.rte-bar button { min-width: 32px; height: 30px; padding: 0 8px; border: 0; border-radius: 7px; background: none; font-size: 13px; font-weight: 600; color: var(--text); }
.rte-bar button:hover { background: var(--bg-gray); }
.rte-bar i { width: 1px; background: var(--border); margin: 4px 4px; }
.rte-area { min-height: 260px; max-height: 70vh; overflow-y: auto; padding: 14px 18px; font-size: 15px; line-height: 1.7; outline: none; }
.rte-area h2 { font-size: 22px; margin: 18px 0 8px; }
.rte-area h3 { font-size: 18px; margin: 16px 0 6px; }
.rte-area p { margin: 0 0 12px; }
.rte-area ul, .rte-area ol { margin: 0 0 12px; padding-inline-start: 24px; }
.rte-area blockquote { margin: 0 0 12px; padding: 12px 16px; border-inline-start: 4px solid var(--primary); background: var(--bg-secondary); border-radius: 8px; }
.rte-area[dir="rtl"] { font-family: 'Cairo', sans-serif; }
.extra { margin-top: 18px; }
.res-list { list-style: none; display: grid; gap: 6px; margin-top: 12px; font-size: 13px; padding: 0; }
.res-list li { display: flex; gap: 10px; align-items: baseline; }
.log { background: #201E24; color: #D9D4DE; font: 12.5px/1.5 ui-monospace, Menlo, Consolas, monospace; padding: 14px 16px; border-radius: var(--radius-sm); white-space: pre-wrap; max-height: 420px; overflow: auto; direction: ltr; text-align: left; }
table.log { white-space: normal; }
.log td:first-child { white-space: nowrap; color: var(--text-muted); }

/* ── dialogs + toast ─────────────────────────────────────────────────────── */
.dlg { margin: auto; border: 0; border-radius: 16px; padding: 0; width: min(760px, calc(100vw - 32px)); box-shadow: 0 40px 100px rgba(0,0,0,.35); color: var(--text); }
.dlg::backdrop { background: rgba(32,30,36,.55); }
.dlg-in { padding: 22px; display: grid; gap: 14px; }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dlg-head h2 { font-size: 16px; }
.dlg-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0; }
.dlg-actions span { flex: 1; }
.fld-l select, .fld-l textarea, .fld-l input { margin-top: 6px; }
.lead-dl { display: grid; grid-template-columns: 170px 1fr; gap: 8px 16px; font-size: 13.5px; }
.lead-dl dt { color: var(--text-muted); }
.lead-dl dd { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }
.rev-list { list-style: none; display: grid; gap: 6px; max-height: 55vh; overflow: auto; padding: 0; }
.rev-list button { width: 100%; text-align: start; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; }
.rev-list button:hover { border-color: var(--primary); }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translate(-50%, 40px); opacity: 0; z-index: 1000; background: var(--side-bg); color: #fff; padding: 12px 20px; border-radius: 12px; font-weight: 500; box-shadow: 0 20px 40px rgba(0,0,0,.3); transition: opacity .25s, transform .3s; pointer-events: none; max-width: calc(100vw - 32px); font-size: 13.5px; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: var(--danger); }

/* ── pictures / films ────────────────────────────────────────────────────── */
.pic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.pic-card { margin: 0; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; display: grid; gap: 8px; }
.pic-thumb { aspect-ratio: 4 / 3; border-radius: var(--radius-sm); background: var(--bg-gray) center / cover no-repeat; position: relative; overflow: hidden; }
.pic-card.is-logo .pic-thumb { background-size: contain; background-color: #2A1130; }
.pic-thumb video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pic-card figcaption { display: grid; font-size: 12px; }
.pic-card figcaption strong { font-weight: 600; word-break: break-all; }
.pic-card figcaption small { color: var(--text-muted); }
.pic-card .btn-sec { justify-self: start; font-size: 12px; padding: 6px 10px; }
.pic-card.busy { opacity: .5; pointer-events: none; }

/* ── forms + account ─────────────────────────────────────────────────────── */
.reply-box { display: grid; gap: 12px; margin-top: 10px; }
.reply-box textarea { width: 100%; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; font: inherit; background: var(--bg-input); }
.acct { max-width: 640px; }
.acct h2 { font-size: 15px; margin: 22px 0 12px; }
.acct-who { display: grid; gap: 10px; margin: 0; }
.acct-who div { display: grid; grid-template-columns: 110px 1fr; gap: 12px; }
.acct-who dt { color: var(--text-muted); font-size: 13px; }
.acct-who dd { font-weight: 600; margin: 0; }
.acct-form { display: grid; gap: 14px; }
.acct-form label { display: grid; gap: 6px; font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .3px; }
.acct-form small { font-weight: 400; color: var(--text-dim); text-transform: none; }
.acct-form input { height: 42px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0 14px; font: inherit; font-weight: 400; background: var(--bg-input); text-transform: none; }
.acct-form button { justify-self: start; }
.acct-form.inline { display: flex; gap: 8px; align-items: center; }
.acct-form.inline input { height: 36px; min-width: 220px; }
.mk-card .btn-save { display: inline-flex; }
.big { font-size: 22px; }
.inline { display: inline; }
.danger { margin-top: 14px; }
.st-pick { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.st-pick .chk, .chk { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; font-size: 13px; font-weight: 500; }
.st-pick .chk { border: 1px solid var(--border); border-radius: 999px; padding: 6px 12px; background: #fff; }
.st-pick .chk:has(input:checked) { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }

/* ── visitors ────────────────────────────────────────────────────────────── */
.st-tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.st-tile { background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); padding: 16px 18px; display: grid; gap: 4px; min-width: 0; }
.st-tile b { font-size: 26px; font-weight: 800; color: var(--text); line-height: 1.1; font-variant-numeric: tabular-nums; }
.st-tile span { font-size: 12px; color: var(--text-muted); display: grid; gap: 2px; }
.st-tile small { color: var(--primary); font-weight: 600; }
.st-lead { background: var(--side-bg); border-color: var(--side-bg); } .st-lead b { color: #fff; } .st-lead span { color: var(--side-text); } .st-lead small { color: #FF9B94; }
.st-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.st-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.st-cols > .card { margin-bottom: 0; }
.st-tbl td { font-size: 13px; } .st-tbl td small { display: block; }
.bar { display: inline-block; vertical-align: middle; width: 90px; height: 6px; border-radius: 3px; background: var(--bg-gray); margin-inline-end: 8px; overflow: hidden; }
.bar b { display: block; height: 100%; background: var(--primary); border-radius: 3px; }
.st-row { cursor: pointer; }

/* ── pages (sections) ────────────────────────────────────────────────────── */
.pg-list { display: grid; gap: 12px; }
.pg-page { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.pg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); background: var(--bg-secondary); }
.pg-head h2 { font-size: 15px; font-weight: 700; margin: 0; }
.pg-head small { color: var(--text-muted); font-size: 12px; margin-inline-start: 8px; }
.pg-secs { list-style: none; margin: 0; padding: 0; }
.pg-sec { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-bottom: 1px solid var(--border); }
.pg-sec:last-child { border-bottom: 0; }
.pg-n { width: 26px; height: 26px; border-radius: 50%; background: var(--primary-light); color: var(--primary); font-size: 12px; font-weight: 800; display: grid; place-items: center; flex: none; }
.pg-t { flex: 1; min-width: 0; display: grid; }
.pg-t strong { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pg-t small { color: var(--text-muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pg-sec .btn { flex: none; }
/* hide / show a section (2026-11-15) */
.pg-acts { display: flex; align-items: center; gap: 6px; flex: none; flex-wrap: wrap; justify-content: flex-end; }
.pg-sec.is-hidden .pg-n, .pg-sec.is-hidden .pg-t small { opacity: .5; }
.pg-sec.is-hidden { background: var(--bg-secondary); }
.pg-sec .badge { font-size: 10.5px; vertical-align: 1px; margin-inline-start: 4px; }
.sd-vis { min-width: 64px; justify-content: center; }
@media (max-width: 640px) { .pg-sec { flex-wrap: wrap; } .pg-acts { width: 100%; justify-content: flex-start; padding-inline-start: 38px; } }
.lpv-card { border: 1px solid var(--border); border-radius: var(--radius); background: #fff; overflow: hidden; margin-bottom: 16px; box-shadow: var(--shadow); }
.lpv-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 9px 12px; border-bottom: 1px solid var(--border); background: var(--bg-secondary); }
.lpv-bar-title { font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 7px; }
.lpv-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.lpv-btn { border: 1px solid var(--border); background: #fff; border-radius: 7px; padding: 5px 11px; font-size: 12px; cursor: pointer; color: var(--text); text-decoration: none; display: inline-flex; align-items: center; gap: 5px; line-height: 1.4; }
.lpv-btn:hover { border-color: var(--primary); color: var(--primary); }
.lpv-btn.is-on { background: var(--primary); border-color: var(--primary); color: #fff; }
.lpv-stage { background: #ececf1; padding: 14px; display: flex; justify-content: center; }
.lpv-frame-wrap { background: #fff; border-radius: 8px; box-shadow: 0 6px 24px rgba(0,0,0,.10); overflow: hidden; transition: max-width .25s ease; width: 100%; }
.lpv-frame-wrap.is-mobile { max-width: 390px; border-radius: 22px; border: 6px solid #1c1c1e; }
.lpv-frame-wrap.is-desktop { max-width: 100%; }
.lpv-frame-wrap iframe { display: block; width: 100%; border: 0; background: #fff; }
.lpv-toggle { margin-bottom: 14px; }

/* ── shop screens ────────────────────────────────────────────────────────── */
.prod-thumb { width: 44px; height: 44px; border-radius: var(--radius-sm); object-fit: cover; background: var(--bg); border: 1px solid var(--border); display: block; }
.no-thumb { width: 44px; height: 44px; border-radius: var(--radius-sm); background: var(--bg); border: 1px solid var(--border); display: grid; place-items: center; color: var(--text-dim); font-size: 16px; }
.prod-name { font-weight: 600; color: var(--text); display: block; }
.prod-name:hover { color: var(--primary); }
.prod-sub { font-size: 12px; color: var(--text-muted); display: block; }
.tbl-shop tr.off td { opacity: .6; }
.price-was { color: var(--text-dim); text-decoration: line-through; font-size: 12px; margin-inline-start: 4px; }
.no-price { color: var(--danger); font-weight: 600; }
.pf-savebar { position: sticky; bottom: 0; z-index: 20; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 6px; padding: 12px 16px; background: rgba(255,255,255,.95); backdrop-filter: blur(8px); border: 1px solid var(--border); border-top: 2px solid var(--primary); box-shadow: 0 -6px 16px rgba(15,23,42,.08); border-radius: 0 0 12px 12px; }
.pf-savebar__hint { margin-inline-end: auto; font-size: 12.5px; color: var(--text-muted); }
.img-item-sort { cursor: grab; }
.image-item.dragging { opacity: .4; }
.image-item .btn-move { background: rgba(0,0,0,0.7); color: #fff; }
.opt-group { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px; background: var(--bg-secondary); }
.opt-group__head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.opt-group__head .form-control { flex: 1; min-width: 140px; }
.opt-values { display: grid; gap: 6px; }
.opt-value { display: grid; grid-template-columns: 1fr 1fr auto; gap: 6px; align-items: center; }
.var-table td input { width: 100%; }
.var-table .var-label { font-weight: 600; }
.stock-pill { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--success-bg); color: var(--success); }
.stock-pill.out { background: var(--danger-bg); color: var(--danger); }
.stock-pill.low { background: var(--warning-bg); color: var(--warning); }
.form-check input[type=radio] { width: 16px; height: 16px; accent-color: var(--primary); }
.radio-cards { display: flex; gap: 12px; flex-wrap: wrap; }
.radio-card { flex: 1; min-width: 220px; display: flex; gap: 10px; align-items: flex-start; border: 1.5px solid var(--border); border-radius: var(--radius); padding: 12px 14px; cursor: pointer; background: #fff; font-size: 13px; }
.radio-card:has(input:checked) { border-color: var(--primary); background: var(--primary-light); }
.radio-card strong { display: block; font-size: 13.5px; }
.radio-card span { color: var(--text-muted); font-size: 12.5px; }

/* ── small screens ───────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .st-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ov-cols.three { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .ov-cols, .ov-cols.three, .forms-grid, .st-cols, .st-3, .dash-sum { grid-template-columns: 1fr; }
  .inline-grp { grid-template-columns: 1fr; }
  .lead-dl { grid-template-columns: 1fr; }
  .tbl-leads th:nth-child(3), .tbl-leads td:nth-child(3) { display: none; }
}
@media (max-width: 768px) {
  .st-tiles { grid-template-columns: 1fr 1fr; }
  .st-tbl, .tbl-wrap { display: block; overflow-x: auto; }
  .page-header .ed-actions { width: 100%; }
  .page-header .ed-actions .btn, .page-header .ed-actions .btn-save, .page-header .ed-actions .btn-sec { flex: 1; }
  .ed-langs { width: 100%; justify-content: center; }
  .opt-value { grid-template-columns: 1fr 1fr auto; }
  .pf-savebar__hint { display: none; }
  .pf-savebar .btn { flex: 1; }
  table.tbl { min-width: 0; }
  .page-hint { margin: 0 0 12px; }
}

/* Pictures: the ones no page shows, folded away (2026-11-17) */
.pic-spare{margin-top:16px}
.pic-spare>summary{cursor:pointer;font-weight:600;padding:2px 0;list-style-position:inside}
.pic-spare>summary small{font-weight:400;opacity:.7}
.pic-spare[open]>summary{margin-bottom:8px}
.pic-spare .pic-grid{margin-top:12px}
