/* ============================================================================
   style.css — the entire design system.
   RULES FOR FUTURE PAGES:
   - Never hard-code colors. Use the CSS variables below.
   - --primary is injected per-user by header.php; everything brand-colored
     must reference var(--primary).
   - RTL is automatic: layout uses logical properties (inline-start/end).
     Only add [dir="rtl"] overrides for things logical props can't express.
   ========================================================================== */

/* ---------------------------------------------------------------- variables */
:root {
    --primary:        #8B1420;   /* Qanawat brand red — overridden inline by header.php */
    --primary-contrast: #ffffff;

    --bg:             #f1f5f9;
    --surface:        #ffffff;
    --surface-2:      #f8fafc;
    --text:           #0f172a;
    --text-muted:     #64748b;
    --border:         #e2e8f0;

    --success:        #16a34a;
    --danger:         #dc2626;
    --warning:        #d97706;
    --info:           #0284c7;

    --success-bg:     #dcfce7;
    --danger-bg:      #fee2e2;
    --warning-bg:     #fef3c7;
    --info-bg:        #e0f2fe;

    --radius:         10px;
    --radius-sm:      7px;
    --shadow:         0 1px 3px rgba(15, 23, 42, .08), 0 4px 14px rgba(15, 23, 42, .06);
    --shadow-lg:      0 10px 40px rgba(15, 23, 42, .18);

    --topbar-h:       58px;
    --sidebar-w:      248px;
    --sidebar-w-mini: 64px;

    --font: "Segoe UI", Tahoma, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

[data-theme="dark"] {
    --bg:             #0b1120;
    --surface:        #151e31;
    --surface-2:      #1c2740;
    --text:           #e2e8f0;
    --text-muted:     #94a3b8;
    --border:         #2b3a55;

    --success-bg:     rgba(22, 163, 74, .18);
    --danger-bg:      rgba(220, 38, 38, .18);
    --warning-bg:     rgba(217, 119, 6, .18);
    --info-bg:        rgba(2, 132, 199, .18);

    --shadow:         0 1px 3px rgba(0, 0, 0, .4), 0 4px 14px rgba(0, 0, 0, .3);
    --shadow-lg:      0 10px 40px rgba(0, 0, 0, .55);
}

/* ------------------------------------------------------------------- reset */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.55;
    min-height: 100vh;
    transition: background .25s, color .25s;
    -webkit-tap-highlight-color: transparent;
}
img { max-width: 100%; }
a { color: var(--primary); text-decoration: none; }
button { font-family: inherit; }
::placeholder { color: var(--text-muted); opacity: .7; }

/* ------------------------------------------------------------------ topbar */
.topbar {
    position: fixed;
    top: 0; inset-inline: 0;
    height: var(--topbar-h);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 14px;
    padding-top: env(safe-area-inset-top);
    z-index: 60;
}
.topbar-brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
/* Square card — shows the full logo uncropped, same style as the
   profile-page upload preview */
.topbar-logo {
    height: 42px; width: auto; max-width: 150px;
    object-fit: contain;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 4px 9px;
}
.topbar-title { font-weight: 700; font-size: 17px; letter-spacing: .2px; }
.topbar-spacer { flex: 1; }

.icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px;
    border: none; border-radius: 50%;
    background: transparent; color: var(--text);
    cursor: pointer;
    transition: background .15s;
}
.icon-btn:hover { background: var(--surface-2); }
.lang-btn { font-size: 15px; font-weight: 700; width: auto; min-width: 40px; padding: 0 10px; border-radius: 20px; }

/* theme toggle shows the icon of the mode you'd switch TO */
[data-theme="light"] .icon-sun  { display: none; }
[data-theme="dark"]  .icon-moon { display: none; }

/* --------------------------------------------------------------- dropdown */
.dropdown { position: relative; }
.avatar-btn {
    width: 38px; height: 38px; border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--primary); color: var(--primary-contrast);
    cursor: pointer; overflow: hidden;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 16px;
}
.avatar-img { width: 100%; height: 100%; object-fit: cover; }
.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    inset-inline-end: 0;
    min-width: 220px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 6px;
    display: none;
    z-index: 80;
}
.dropdown.open .dropdown-menu { display: block; animation: pop .12s ease-out; }
.dropdown-header { padding: 10px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; display: flex; flex-direction: column; }
.dropdown-header small { color: var(--text-muted); }
.dropdown-item {
    display: flex; align-items: center; gap: 10px;
    width: 100%;
    padding: 9px 12px;
    border: none; border-radius: var(--radius-sm);
    background: transparent; color: var(--text);
    font-size: 14px; text-align: start;
    cursor: pointer;
}
.dropdown-item:hover { background: var(--surface-2); }
.dropdown-danger { color: var(--danger); }
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ----------------------------------------------------------------- sidebar */
.sidebar {
    position: fixed;
    top: var(--topbar-h); bottom: 0;
    inset-inline-start: 0;
    width: var(--sidebar-w);
    background: var(--surface);
    border-inline-end: 1px solid var(--border);
    overflow-y: auto;
    z-index: 50;
    transition: transform .25s ease, width .2s ease;
}
.sidebar-nav { padding: 12px 10px; }
.menu { list-style: none; }
.menu > li { margin-bottom: 2px; }
.menu-link {
    display: flex; align-items: center; gap: 12px;
    width: 100%;
    padding: 11px 12px;
    border: none; border-radius: var(--radius-sm);
    background: transparent; color: var(--text);
    font-size: 14.5px; text-align: start;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.menu-link:hover { background: var(--surface-2); color: var(--text); }
.menu-link.active {
    background: var(--primary);
    color: var(--primary-contrast);
    font-weight: 600;
}
.menu-icon { flex-shrink: 0; }
.menu-text { flex: 1; white-space: nowrap; overflow: hidden; }
.menu-chevron { transition: transform .2s; flex-shrink: 0; }
.menu-group.open > .menu-toggle .menu-chevron { transform: rotate(180deg); }

.submenu { list-style: none; overflow: hidden; max-height: 0; transition: max-height .25s ease; }
.menu-group.open > .submenu { max-height: 400px; }
.submenu-link {
    display: flex; align-items: center; gap: 8px;
    padding: 9px 12px;
    margin-inline-start: 32px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 14px;
}
.submenu-link:hover { background: var(--surface-2); color: var(--text); }
.submenu-link.active { color: var(--primary); font-weight: 600; }
.submenu-link.disabled { opacity: .55; cursor: default; }

.sidebar-backdrop {
    position: fixed; inset: 0;
    top: var(--topbar-h);
    background: rgba(15, 23, 42, .5);
    z-index: 45;
    opacity: 0; pointer-events: none;
    transition: opacity .25s;
}

/* Desktop collapsed (mini) sidebar */
@media (min-width: 992px) {
    body.sidebar-collapsed .sidebar { width: var(--sidebar-w-mini); }
    body.sidebar-collapsed .menu-text,
    body.sidebar-collapsed .menu-chevron,
    body.sidebar-collapsed .submenu { display: none; }
    body.sidebar-collapsed .menu-link { justify-content: center; }
    body.sidebar-collapsed .content { margin-inline-start: var(--sidebar-w-mini); }
}

/* Mobile: off-canvas */
@media (max-width: 991px) {
    .sidebar { transform: translateX(-100%); box-shadow: none; }
    [dir="rtl"] .sidebar { transform: translateX(100%); }
    body.sidebar-open .sidebar { transform: translateX(0); box-shadow: var(--shadow-lg); }
    body.sidebar-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }
    .topbar-title { display: none; }
}

/* ----------------------------------------------------------------- content */
.content {
    margin-top: var(--topbar-h);
    margin-inline-start: var(--sidebar-w);
    min-height: calc(100vh - var(--topbar-h));
    transition: margin .2s ease;
}
@media (max-width: 991px) { .content { margin-inline-start: 0; } }
.page { padding: 22px; max-width: 1280px; margin: 0 auto; }
@media (max-width: 600px) { .page { padding: 14px; } }

.page-title { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.page-subtitle { color: var(--text-muted); margin-bottom: 20px; font-size: 14px; }

/* -------------------------------------------------------------------- cards */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}
.card-header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    font-weight: 600; font-size: 15px;
    display: flex; align-items: center; gap: 10px;
}
.card-body { padding: 18px; }

/* Simple responsive grid for dashboards */
.grid { display: grid; gap: 18px; grid-template-columns: repeat(12, 1fr); }
.col-12 { grid-column: span 12; }
.col-6  { grid-column: span 6; }
.col-4  { grid-column: span 4; }
.col-3  { grid-column: span 3; }
@media (max-width: 991px) { .col-6, .col-4, .col-3 { grid-column: span 6; } }
@media (max-width: 600px) { .col-6, .col-4, .col-3 { grid-column: span 12; } }

/* ------------------------------------------------------------------ buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 18px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 14.5px; font-weight: 600;
    cursor: pointer;
    transition: filter .15s, background .15s, transform .05s;
    position: relative;
    text-decoration: none;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .65; cursor: not-allowed; }

.btn-primary   { background: var(--primary); color: var(--primary-contrast); }
.btn-primary:hover:not(:disabled) { filter: brightness(.92); }
.btn-secondary { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn-secondary:hover:not(:disabled) { filter: brightness(.97); }
.btn-danger    { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { filter: brightness(.9); }
.btn-outline   { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover:not(:disabled) { background: var(--primary); color: var(--primary-contrast); }
.btn-ghost     { background: transparent; color: var(--text-muted); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }

.btn-sm    { padding: 6px 12px; font-size: 13px; }
.btn-lg    { padding: 13px 24px; font-size: 16px; }
.btn-block { width: 100%; }

/* Square icon-only button, matches .form-control height (44px) — for putting
   a compact action (e.g. export) inline next to an input. */
.btn-icon-square {
    flex: 0 0 auto;
    width: 44px; height: 44px;
    padding: 0;
}

/* Input + trailing action button on one line (see reports.php search box). */
.input-with-action { display: flex; gap: 8px; align-items: stretch; }
.input-with-action .form-control { flex: 1 1 auto; min-width: 0; }

/* Lookup field: a <select> with inline Add / Edit / Delete action buttons
   (Products module — inline lookup CRUD). Buttons wrap under on narrow screens. */
.lookup-field { display: flex; gap: 6px; align-items: stretch; flex-wrap: nowrap; }
.lookup-field .form-control { flex: 1 1 auto; min-width: 0; }
.lookup-actions { display: flex; gap: 4px; flex: 0 0 auto; }
.lookup-btn {
    width: 40px; height: 44px;
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    color: var(--text);
    cursor: pointer;
    transition: filter .15s, background .15s, color .15s;
}
.lookup-btn:hover { filter: brightness(.97); }
.lookup-btn.lookup-add    { color: var(--success); }
.lookup-btn.lookup-edit   { color: var(--info); }
.lookup-btn.lookup-delete { color: var(--danger); }
@media (max-width: 480px) {
    .lookup-btn { width: 36px; }
}

/* Image dropzone (brand cover upload — modern, clickable) */
.image-dropzone {
    position: relative;
    display: flex; align-items: center; justify-content: center;
    min-height: 150px;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    background: var(--surface-2);
    cursor: pointer;
    overflow: hidden;
    transition: border-color .15s, background .15s;
}
.image-dropzone:hover,
.image-dropzone:focus { border-color: var(--primary); outline: none; }
.image-dropzone-ph {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    color: var(--text-muted); font-size: 13.5px; text-align: center; padding: 12px;
}
.image-dropzone-img {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: contain;
    background: var(--surface);
}

/* Scrollable product-selection table (pricing catalog form) with sticky head */
.selection-scroll { max-height: 460px; overflow-y: auto; }
.selection-scroll thead th {
    position: sticky; top: 0; z-index: 1;
}
.selection-scroll .price-input { padding: 6px 10px; font-size: 14px; }

/* Brand cover preview under the field — the shape reused later for cards */
.brand-cover {
    margin-top: 8px;
    height: 96px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface-2);
}
.brand-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Button loading state — applied by App.btnLoading(btn, true) */
.btn.loading { color: transparent !important; pointer-events: none; }
.btn.loading::after {
    content: "";
    position: absolute;
    width: 18px; height: 18px;
    border: 2px solid rgba(255, 255, 255, .4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
.btn-secondary.loading::after,
.btn-ghost.loading::after,
.btn-outline.loading::after {
    border-color: var(--border);
    border-top-color: var(--primary);
}

/* ----------------------------------------------------------------- spinners */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
    width: 26px; height: 26px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin .7s linear infinite;
    display: inline-block;
}
.spinner-lg { width: 44px; height: 44px; border-width: 4px; }

.global-overlay {
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, .45);
    display: flex; align-items: center; justify-content: center;
    z-index: 200;
    backdrop-filter: blur(2px);
}
.global-overlay[hidden] { display: none; }

/* -------------------------------------------------------------------- forms */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 6px; }
.form-control {
    width: 100%;
    padding: 10px 13px;
    font-size: 15px;
    font-family: inherit;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: border-color .15s, box-shadow .15s;
    -webkit-appearance: none;
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent);
}
select.form-control {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-inline-end: 34px;
}
[dir="rtl"] select.form-control { background-position: left 12px center; }
textarea.form-control { min-height: 100px; resize: vertical; }
.form-hint { font-size: 12.5px; color: var(--text-muted); margin-top: 5px; }
input[type="color"].form-control { padding: 4px; height: 44px; cursor: pointer; }

/* checkbox / radio / switch */
.form-check { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; cursor: pointer; font-size: 14.5px; }
.form-check input[type="checkbox"],
.form-check input[type="radio"] { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; }
.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider {
    position: absolute; inset: 0;
    background: var(--border);
    border-radius: 24px;
    transition: background .2s;
    cursor: pointer;
}
.switch-slider::before {
    content: "";
    position: absolute;
    width: 18px; height: 18px;
    inset-inline-start: 3px; top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform .2s;
}
.switch input:checked + .switch-slider { background: var(--primary); }
.switch input:checked + .switch-slider::before { transform: translateX(20px); }
[dir="rtl"] .switch input:checked + .switch-slider::before { transform: translateX(-20px); }

/* -------------------------------------------------------------------- table */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td {
    padding: 12px 14px;
    text-align: start;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
/* Center-aligned table variant — add `table-center` alongside `table`.
   Placed AFTER the base rule so it wins on equal specificity. Used by the
   Products list, Catalogs list and the catalog product-selection table. */
.table-center th,
.table-center td { text-align: center; }
.table-center td .price-input,
.table-center td input[type="number"] { text-align: center; }
.table th {
    background: var(--surface-2);
    font-weight: 600; font-size: 13px;
    color: var(--text-muted);
    text-transform: uppercase; letter-spacing: .4px;
}
.table tbody tr:hover { background: var(--surface-2); }
.table .empty-row td { text-align: center; padding: 34px; color: var(--text-muted); white-space: normal; }

/* -------------------------------------------------------------------- badge */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px; 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: var(--surface-2);  color: var(--text-muted); }

/* -------------------------------------------------------------------- alert */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-bottom: 16px;
    border: 1px solid transparent;
}
.alert-success { background: var(--success-bg); color: var(--success); }
.alert-danger  { background: var(--danger-bg);  color: var(--danger); }
.alert-warning { background: var(--warning-bg); color: var(--warning); }
.alert-info    { background: var(--info-bg);    color: var(--info); }

/* -------------------------------------------------------------------- modal */
.modal-backdrop {
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, .55);
    display: none;
    align-items: center; justify-content: center;
    padding: 16px;
    z-index: 150;
}
.modal-backdrop.open { display: flex; }
.modal {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%; max-width: 460px;
    max-height: 90vh; overflow-y: auto;
    animation: pop .15s ease-out;
}
.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    font-weight: 700; font-size: 16px;
    display: flex; align-items: center; justify-content: space-between;
}
.modal-body { padding: 20px; }
.modal-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    display: flex; justify-content: flex-end; gap: 10px;
}

/* -------------------------------------------------------------------- toast */
.toast-container {
    position: fixed;
    top: calc(var(--topbar-h) + 12px);
    inset-inline-end: 16px;
    z-index: 300;
    display: flex; flex-direction: column; gap: 10px;
    max-width: calc(100vw - 32px);
}
.toast {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-inline-start: 4px solid var(--info);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    padding: 12px 18px;
    font-size: 14px;
    min-width: 240px;
    animation: toast-in .25s ease-out;
}
.toast-success { border-inline-start-color: var(--success); }
.toast-error   { border-inline-start-color: var(--danger); }
.toast-warning { border-inline-start-color: var(--warning); }
.toast.hide { opacity: 0; transform: translateY(-8px); transition: all .3s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }

/* -------------------------------------------------------------- pagination */
.pagination { display: flex; align-items: center; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.pagination-info { color: var(--text-muted); font-size: 13.5px; margin-inline-end: auto; }

/* -------------------------------------------------------------- auth pages */
.auth-wrap {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    background: var(--bg);
}
.auth-card {
    width: 100%; max-width: 420px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    padding: 34px 30px;
}
.auth-logo { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 22px; }
.auth-logo img { height: 56px; border-radius: 14px; }
.auth-logo h1 { font-size: 20px; }
.auth-logo p { color: var(--text-muted); font-size: 13.5px; }
.auth-divider {
    display: flex; align-items: center; gap: 12px;
    color: var(--text-muted); font-size: 13px;
    margin: 18px 0;
}
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.auth-footer { text-align: center; margin-top: 18px; font-size: 14px; color: var(--text-muted); }
.auth-topright { position: fixed; top: 14px; inset-inline-end: 14px; display: flex; gap: 6px; }

.btn-google {
    background: var(--surface); color: var(--text);
    border: 1px solid var(--border);
}
.btn-google:hover:not(:disabled) { background: var(--surface-2); }

/* --------------------------------------------------------------- utilities */
.text-muted   { color: var(--text-muted); }
.text-center  { text-align: center; }
.text-end     { text-align: end; }
.mt-1 { margin-top: 6px; }  .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 20px; }
.mb-1 { margin-bottom: 6px; } .mb-2 { margin-bottom: 12px; } .mb-3 { margin-bottom: 20px; }
.d-flex { display: flex; } .align-center { align-items: center; } .gap-2 { gap: 12px; }
.flex-wrap { flex-wrap: wrap; }
.w-100 { width: 100%; }
.hidden { display: none !important; }

/* filter bar (reports pattern) */
.filter-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    align-items: end;
}
.filter-bar .form-group { margin-bottom: 0; }

/* logo preview on profile page */
.logo-preview {
    height: 56px; max-width: 200px;
    object-fit: contain;
    background: var(--surface-2);
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    padding: 8px;
}

/* color swatch presets */
.color-presets { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.color-swatch {
    width: 32px; height: 32px;
    border-radius: 50%;
    border: 2px solid var(--border);
    cursor: pointer;
    transition: transform .1s;
}
.color-swatch:hover { transform: scale(1.12); }

/* docs page */
.docs pre {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px;
    overflow-x: auto;
    font-size: 13px;
    line-height: 1.6;
    direction: ltr; text-align: left;   /* code is always LTR */
    margin: 10px 0;
}
.docs code {
    background: var(--surface-2);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    direction: ltr; unicode-bidi: embed;
}
.docs pre code { background: none; padding: 0; }
.docs h2 { margin: 28px 0 10px; font-size: 19px; padding-bottom: 6px; border-bottom: 2px solid var(--primary); display: inline-block; }
.docs h3 { margin: 20px 0 8px; font-size: 16px; }
.docs table { margin: 10px 0; }
.docs td { white-space: normal; }
.docs ul, .docs ol { padding-inline-start: 22px; margin: 8px 0; }
.docs li { margin-bottom: 4px; }
