:root {
    --ad-primary: #e5342a;
    --ad-primary-dark: #c62a21;
    --ad-primary-soft: rgba(229, 52, 42, .1);
    --ad-ink: #10131a;
    --ad-sidebar: #141821;
    --ad-sidebar-2: #1b2029;
    --ad-sidebar-hover: #232936;
    --ad-sidebar-muted: #7b8498;
    --ad-sidebar-line: rgba(255, 255, 255, .06);
    --ad-bg: #f3f4f6;
    --ad-card: #ffffff;
    --ad-border: #e8eaed;
    --ad-text-muted: #6b7280;
    --ad-sidebar-w: 224px;
    --ad-radius: 11px;
    --ad-shadow-sm: 0 1px 2px rgba(16, 19, 26, .06), 0 1px 3px rgba(16, 19, 26, .04);
    --ad-shadow-md: 0 4px 16px rgba(16, 19, 26, .08);
    --ad-shadow-lg: 0 18px 48px rgba(16, 19, 26, .18);
}

* { -webkit-font-smoothing: antialiased; }

body {
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--ad-ink);
    letter-spacing: -0.01em;
    font-size: 14px;
}

/* Compact form controls */
.admin-body .form-control,
.admin-body .form-select,
.admin-login-body .form-control {
    padding: .45rem .7rem;
    font-size: .875rem;
    border-radius: 8px;
}
.admin-body .btn { border-radius: 8px; font-size: .875rem; }
.admin-body .btn-sm { font-size: .8rem; }
.admin-body .form-label { margin-bottom: .25rem; }
.admin-body .form-text { font-size: .78rem; margin-top: .2rem; }

/* Brand buttons */
.btn-primary {
    --bs-btn-bg: var(--ad-primary);
    --bs-btn-border-color: var(--ad-primary);
    --bs-btn-hover-bg: var(--ad-primary-dark);
    --bs-btn-hover-border-color: var(--ad-primary-dark);
    --bs-btn-active-bg: #b0251d;
    --bs-btn-active-border-color: #b0251d;
    --bs-btn-focus-shadow-rgb: 229, 52, 42;
    font-weight: 600;
    letter-spacing: 0;
}
.btn { border-radius: 10px; }
.form-control, .form-select {
    border-radius: 10px;
    border-color: var(--ad-border);
    padding: .6rem .85rem;
}
.form-control:focus, .form-select:focus {
    border-color: var(--ad-primary);
    box-shadow: 0 0 0 .2rem var(--ad-primary-soft);
}

/* ============================================================
   LOGIN — split screen
   ============================================================ */
.admin-login-body {
    min-height: 100vh;
    margin: 0;
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    background: #fff;
}
.login-aside {
    position: relative;
    overflow: hidden;
    background: radial-gradient(1200px 600px at 15% 10%, #3a1512 0%, transparent 55%),
                linear-gradient(145deg, #171b24 0%, #10131a 60%, #1d0f0d 100%);
    color: #fff;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.login-aside::after {
    content: "";
    position: absolute;
    right: -120px;
    bottom: -120px;
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, rgba(229, 52, 42, .35) 0%, rgba(229, 52, 42, 0) 70%);
}
.login-aside-grid {
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
}
.login-aside > * { position: relative; z-index: 1; }
.login-aside-headline {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    max-width: 420px;
}
.login-aside-sub {
    color: #aeb4c0;
    max-width: 380px;
    margin-top: 1rem;
}
.login-badges { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 2rem; }
.login-badge {
    font-size: .78rem;
    color: #cfd4de;
    background: rgba(255, 255, 255, .07);
    border: 1px solid rgba(255, 255, 255, .09);
    border-radius: 999px;
    padding: .35rem .8rem;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
}
.login-aside-foot { font-size: .8rem; color: #7b8498; }

.login-main {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}
.login-card {
    width: 100%;
    max-width: 380px;
}
.login-logo { height: 42px; width: auto; margin-bottom: 1.75rem; }
.login-title { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em; }
.login-sub { color: var(--ad-text-muted); margin-bottom: 1.75rem; }
.login-label { font-size: .85rem; font-weight: 600; color: #374151; margin-bottom: .35rem; }
.login-input-group { position: relative; }
.login-input-group .bi {
    position: absolute;
    left: .9rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 1rem;
    pointer-events: none;
}
.login-input-group .form-control { padding-left: 2.5rem; }
.login-foot { text-align: center; margin-top: 1.75rem; color: var(--ad-text-muted); font-size: .85rem; }

@media (max-width: 900px) {
    .admin-login-body { grid-template-columns: 1fr; }
    .login-aside { display: none; }
}

/* ============================================================
   SHELL
   ============================================================ */
.admin-body { background: var(--ad-bg); }
.admin-wrapper { display: flex; min-height: 100vh; }
.admin-main {
    flex: 1;
    min-width: 0;
    margin-left: var(--ad-sidebar-w);
    display: flex;
    flex-direction: column;
}

/* ============ SIDEBAR ============ */
.admin-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--ad-sidebar-w);
    background: linear-gradient(180deg, var(--ad-sidebar-2) 0%, var(--ad-sidebar) 100%);
    color: #cfd4de;
    display: flex;
    flex-direction: column;
    z-index: 1045;
    transition: transform .22s ease;
}
.admin-sidebar-brand {
    padding: .85rem 1.1rem;
    border-bottom: 1px solid var(--ad-sidebar-line);
    display: flex;
    align-items: center;
}
.admin-nav { padding: .6rem .6rem; overflow-y: auto; flex: 1; }
.admin-nav-section {
    text-transform: uppercase;
    font-size: .64rem;
    letter-spacing: .12em;
    color: var(--ad-sidebar-muted);
    padding: .8rem .7rem .3rem;
    font-weight: 700;
}
.admin-nav-link {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .5rem .7rem;
    border-radius: 8px;
    color: #c3c9d4;
    text-decoration: none;
    font-size: .875rem;
    font-weight: 500;
    margin-bottom: .1rem;
    position: relative;
    transition: background .14s, color .14s;
}
.admin-nav-link i { font-size: 1rem; width: 18px; text-align: center; }
.admin-nav-link:hover { background: var(--ad-sidebar-hover); color: #fff; }
.admin-nav-link.active {
    background: linear-gradient(90deg, var(--ad-primary) 0%, #d12e24 100%);
    color: #fff;
    box-shadow: 0 6px 16px rgba(229, 52, 42, .35);
}
.admin-nav-link.active::before {
    content: "";
    position: absolute;
    left: -0.6rem;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 18px;
    background: var(--ad-primary);
    border-radius: 0 4px 4px 0;
}
.admin-nav-link.disabled { opacity: .5; pointer-events: none; }
.admin-nav-link .badge { font-weight: 600; font-size: .6rem; }
.admin-sidebar-foot {
    padding: .7rem 1.1rem;
    border-top: 1px solid var(--ad-sidebar-line);
    font-size: .72rem;
    color: var(--ad-sidebar-muted);
}

/* ============ TOPBAR ============ */
.admin-topbar {
    background: rgba(255, 255, 255, .8);
    backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid var(--ad-border);
    padding: .55rem 1.1rem;
    display: flex;
    align-items: center;
    gap: .75rem;
    position: sticky;
    top: 0;
    z-index: 1030;
}
.admin-topbar-title { font-size: 1rem; font-weight: 700; margin: 0; letter-spacing: -0.02em; }
.admin-topbar-sub { font-size: .72rem; color: var(--ad-text-muted); }
.admin-avatar {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--ad-primary) 0%, #ff6a5f 100%);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .95rem;
}
.admin-topbar .btn-light {
    background: #fff;
    border: 1px solid var(--ad-border);
    border-radius: 10px;
}
.admin-topbar .dropdown-menu {
    border: 1px solid var(--ad-border);
    border-radius: 12px;
    box-shadow: var(--ad-shadow-md);
    padding: .4rem;
}
.admin-topbar .dropdown-item { border-radius: 8px; padding: .5rem .7rem; }
.icon-btn {
    width: 38px;
    height: 32px;
    width: 32px;
    border-radius: 8px;
    border: 1px solid var(--ad-border);
    background: #fff;
    color: #4b5563;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    font-size: .9rem;
}
.icon-btn .dot {
    position: absolute;
    top: 6px;
    right: 7px;
    width: 7px;
    height: 7px;
    background: var(--ad-primary);
    border-radius: 50%;
    border: 2px solid #fff;
}

/* ============ CONTENT ============ */
.admin-content { padding: 1.1rem; flex: 1; }
.page-head { margin-bottom: 1rem; }
.page-head h2 { font-size: 1.2rem; font-weight: 700; letter-spacing: -0.02em; margin: 0; }
.page-head p { color: var(--ad-text-muted); margin: .1rem 0 0; font-size: .85rem; }

/* Stat cards */
.stat-card {
    background: var(--ad-card);
    border: 1px solid var(--ad-border);
    border-radius: var(--ad-radius);
    padding: .9rem 1rem;
    box-shadow: var(--ad-shadow-sm);
    height: 100%;
    transition: transform .16s ease, box-shadow .16s ease;
    position: relative;
    overflow: hidden;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--ad-shadow-md); }
.stat-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: .6rem; }
.stat-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}
.stat-trend {
    font-size: .7rem;
    font-weight: 600;
    padding: .15rem .45rem;
    border-radius: 999px;
}
.stat-trend.up { color: #15803d; background: #dcfce7; }
.stat-trend.flat { color: #6b7280; background: #f3f4f6; }
.stat-value { font-size: 1.55rem; font-weight: 800; line-height: 1; letter-spacing: -0.03em; }
.stat-label { color: var(--ad-text-muted); font-size: .8rem; margin-top: .2rem; }

/* Panels */
.panel {
    background: var(--ad-card);
    border: 1px solid var(--ad-border);
    border-radius: var(--ad-radius);
    box-shadow: var(--ad-shadow-sm);
}
.panel-head {
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--ad-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.panel-head h3 { font-size: .92rem; font-weight: 700; margin: 0; letter-spacing: -0.01em; }

.table { font-size: .875rem; }
.table thead th {
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--ad-text-muted);
    font-weight: 700;
    border-bottom: 1px solid var(--ad-border);
    background: #fafbfc;
    padding: .55rem .75rem;
}
.table td { vertical-align: middle; padding: .55rem .75rem; }
.badge-soft {
    font-weight: 600;
    font-size: .7rem;
    padding: .3rem .55rem;
    border-radius: 999px;
}
.avatar-sm {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--ad-primary-soft);
    color: var(--ad-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .78rem;
    flex-shrink: 0;
}

/* Quick action tiles */
.quick-tile {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .7rem .85rem;
    border: 1px solid var(--ad-border);
    border-radius: 10px;
    background: #fff;
    text-decoration: none;
    color: var(--ad-ink);
    transition: border-color .14s, transform .14s, box-shadow .14s;
    height: 100%;
}
.quick-tile:hover { border-color: var(--ad-primary); transform: translateY(-2px); box-shadow: var(--ad-shadow-sm); color: var(--ad-ink); }
.quick-tile .qt-ico {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}
.quick-tile .qt-title { font-weight: 600; font-size: .95rem; }
.quick-tile .qt-sub { font-size: .78rem; color: var(--ad-text-muted); }

/* ============ MOBILE ============ */
.admin-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(16, 19, 26, .45);
    z-index: 1044;
    display: none;
}
.admin-backdrop.show { display: block; }
@media (max-width: 991.98px) {
    .admin-main { margin-left: 0; }
    .admin-sidebar { transform: translateX(-100%); box-shadow: var(--ad-shadow-lg); }
    .admin-sidebar.show { transform: translateX(0); }
}

/* ============================================================
   CATEGORY TREE
   ============================================================ */
.cat-tree { padding: .5rem .5rem; }
.cat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .7rem .85rem;
    border: 1px solid transparent;
    border-radius: 10px;
    margin-left: calc(var(--depth, 0) * 28px);
    transition: background .12s, border-color .12s;
}
.cat-row:hover { background: #fafbfc; border-color: var(--ad-border); }
.cat-row-main { display: flex; align-items: center; gap: .6rem; min-width: 0; }
.cat-indent { color: #c3c9d4; width: 16px; flex-shrink: 0; text-align: center; }
.cat-ico {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: var(--ad-primary-soft);
    color: var(--ad-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}
.cat-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-slug { color: var(--ad-text-muted); font-size: .8rem; }
.cat-level {
    font-size: .66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: .2rem .5rem;
    border-radius: 999px;
    flex-shrink: 0;
}
.cat-level.lvl-1 { color: #e5342a; background: rgba(229,52,42,.1); }
.cat-level.lvl-2 { color: #2563eb; background: rgba(37,99,235,.1); }
.cat-level.lvl-3 { color: #7c3aed; background: rgba(124,58,237,.1); }

.cat-row-meta { display: flex; align-items: center; gap: .5rem; flex-shrink: 0; }
.cat-actions { display: flex; align-items: center; gap: .35rem; }
.cat-actions form { margin: 0; }
.icon-btn.icon-btn-danger { color: #dc2626; }
.icon-btn.icon-btn-danger:hover { background: #fef2f2; border-color: #fecaca; }
.icon-btn:hover { background: #f9fafb; border-color: #d1d5db; }

/* ============ ICON PICKER ============ */
.icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
    gap: .5rem;
}
.icon-pick {
    aspect-ratio: 1;
    border: 1px solid var(--ad-border);
    border-radius: 10px;
    background: #fff;
    color: #4b5563;
    font-size: 1.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all .12s;
}
.icon-pick:hover { border-color: var(--ad-primary); color: var(--ad-primary); }
.icon-pick.active {
    border-color: var(--ad-primary);
    background: var(--ad-primary-soft);
    color: var(--ad-primary);
    box-shadow: 0 0 0 2px var(--ad-primary-soft);
}

/* ============================================================
   SIDEBAR DRAWER (slide-in panel for add/edit)
   ============================================================ */
.cat-drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(16, 19, 26, .45);
    opacity: 0;
    visibility: hidden;
    transition: opacity .22s ease, visibility .22s;
    z-index: 1055;
}
.cat-drawer-backdrop.show { opacity: 1; visibility: visible; }

.cat-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 960px;
    max-width: 96vw;
    background: #fff;
    box-shadow: -18px 0 48px rgba(16, 19, 26, .18);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform .26s cubic-bezier(.4, 0, .2, 1);
    z-index: 1056;
}
.cat-drawer.show { transform: translateX(0); }

.drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.35rem;
    border-bottom: 1px solid var(--ad-border);
    flex-shrink: 0;
}
.drawer-head h3 { font-size: 1.05rem; font-weight: 700; margin: 0; letter-spacing: -0.01em; }

.drawer-content { flex: 1; overflow-y: auto; display: block; }
.drawer-content form { display: flex; flex-direction: column; min-height: 100%; }
.drawer-body { padding: 1.35rem; flex: 1; }
.drawer-foot {
    padding: 1rem 1.35rem;
    border-top: 1px solid var(--ad-border);
    display: flex;
    justify-content: flex-end;
    gap: .6rem;
    background: #fafbfc;
    position: sticky;
    bottom: 0;
    flex-shrink: 0;
}
.drawer-loading {
    display: none;
    flex: 1;
    align-items: center;
    justify-content: center;
}

body.drawer-open { overflow: hidden; }

@media (max-width: 575.98px) {
    .cat-drawer { width: 100vw; max-width: 100vw; }
}

/* ============================================================
   WYSIWYG (Quill) EDITOR
   ============================================================ */
.wysiwyg {
    background: #fff;
    border-radius: 0 0 8px 8px;
}
.ql-toolbar.ql-snow {
    border-color: var(--ad-border);
    border-radius: 8px 8px 0 0;
    background: #fafbfc;
}
.ql-container.ql-snow {
    border-color: var(--ad-border);
    border-radius: 0 0 8px 8px;
    font-family: inherit;
    font-size: .9rem;
}
.ql-editor {
    min-height: 140px;
    max-height: 320px;
    overflow-y: auto;
}
.ql-editor.ql-blank::before { font-style: normal; color: #9ca3af; }
.ql-snow .ql-toolbar button:hover .ql-stroke,
.ql-snow.ql-toolbar button:hover .ql-stroke { stroke: var(--ad-primary); }
.ql-snow .ql-toolbar button.ql-active .ql-stroke,
.ql-snow.ql-toolbar button.ql-active .ql-stroke { stroke: var(--ad-primary); }
.ql-snow .ql-toolbar button.ql-active .ql-fill,
.ql-snow.ql-toolbar button.ql-active .ql-fill { fill: var(--ad-primary); }
.ql-snow .ql-picker.ql-expanded .ql-picker-label { border-color: var(--ad-border); }

/* Rendered rich text (listing / public) */
.rich-text { line-height: 1.6; }
.rich-text h2 { font-size: 1.2rem; font-weight: 700; margin: .5rem 0; }
.rich-text h3 { font-size: 1.05rem; font-weight: 700; margin: .5rem 0; }
.rich-text ul, .rich-text ol { padding-left: 1.25rem; }
.rich-text blockquote {
    border-left: 3px solid var(--ad-primary);
    padding-left: .85rem;
    color: #555;
    margin: .5rem 0;
}

/* ============================================================
   SERVICES
   ============================================================ */
.svc-thumb {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--ad-primary-soft);
    color: var(--ad-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    font-size: 1rem;
}
.svc-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* Media previews */
.media-preview {
    border: 1px solid var(--ad-border);
    border-radius: 10px;
    overflow: hidden;
    background: #fafbfc;
}
.media-preview img { width: 100%; height: 130px; object-fit: cover; display: block; }

/* Spec rows */
.spec-row .form-control { font-size: .85rem; }

/* Gallery grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: .6rem;
}
.gallery-item {
    position: relative;
    border: 1px solid var(--ad-border);
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    display: block;
}
.gallery-item img { width: 100%; height: 90px; object-fit: cover; display: block; }
.gallery-remove {
    position: absolute;
    inset: auto 0 0 0;
    background: rgba(16, 19, 26, .72);
    color: #fff;
    font-size: .7rem;
    padding: .25rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .25rem;
}
.gallery-remove input { accent-color: var(--ad-primary); }
.gallery-item:has(input:checked) { outline: 2px solid var(--ad-primary); opacity: .6; }

/* ============================================================
   IMAGE LIBRARY + PICKER
   ============================================================ */
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: .85rem;
}

/* Library cards */
.media-card {
    position: relative;
    border: 1px solid var(--ad-border);
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    transition: box-shadow .14s, transform .14s;
}
.media-card:hover { box-shadow: var(--ad-shadow-md); transform: translateY(-2px); }
.media-thumb {
    height: 120px;
    background: repeating-conic-gradient(#f1f1f1 0% 25%, #fafafa 0% 50%) 50% / 18px 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.media-thumb img { width: 100%; height: 100%; object-fit: cover; }
.media-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .45rem .55rem;
    gap: .4rem;
}
.media-name {
    font-size: .78rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.media-size { font-size: .7rem; color: var(--ad-text-muted); flex-shrink: 0; }
.media-del {
    position: absolute;
    top: .4rem;
    right: .4rem;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 7px;
    background: rgba(16, 19, 26, .6);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .14s;
}
.media-card:hover .media-del { opacity: 1; }
.media-del:hover { background: #dc2626; }

/* Picker modal */
.media-picker-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(16, 19, 26, .5);
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s, visibility .2s;
    z-index: 1060;
}
.media-picker-backdrop.show { opacity: 1; visibility: visible; }
.media-picker {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -48%) scale(.98);
    width: 920px;
    max-width: 94vw;
    height: 82vh;
    max-height: 760px;
    background: #fff;
    border-radius: 14px;
    box-shadow: var(--ad-shadow-lg);
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s, transform .2s, visibility .2s;
    z-index: 1061;
}
.media-picker.show { opacity: 1; visibility: visible; transform: translate(-50%, -50%) scale(1); }
.media-picker-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .9rem 1.1rem;
    border-bottom: 1px solid var(--ad-border);
    flex-wrap: wrap;
}
.media-picker-head h3 { font-size: 1rem; font-weight: 700; }
.media-picker-body { flex: 1; overflow-y: auto; padding: 1.1rem; }
.media-picker-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .85rem 1.1rem;
    border-top: 1px solid var(--ad-border);
    background: #fafbfc;
    border-radius: 0 0 14px 14px;
}

/* Picker tiles */
.media-pick-tile {
    position: relative;
    border: 2px solid var(--ad-border);
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    padding: 0;
    cursor: pointer;
    transition: border-color .12s, box-shadow .12s;
}
.media-pick-tile img {
    width: 100%;
    height: 110px;
    object-fit: cover;
    display: block;
}
.media-pick-tile:hover { border-color: #cbd5e1; }
.media-pick-tile.selected { border-color: var(--ad-primary); box-shadow: 0 0 0 2px var(--ad-primary-soft); }
.media-pick-check {
    position: absolute;
    top: .4rem;
    right: .4rem;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--ad-primary);
    color: #fff;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: .85rem;
}
.media-pick-tile.selected .media-pick-check { display: inline-flex; }
.media-pick-name {
    display: block;
    font-size: .72rem;
    padding: .3rem .4rem;
    color: #444;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
}

/* Media field widgets (in forms) */
.media-field-single {
    display: flex;
    align-items: center;
    gap: .75rem;
}
.media-field-preview {
    width: 72px;
    height: 72px;
    border-radius: 10px;
    border: 1px solid var(--ad-border);
    background: var(--ad-light);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #c3c9d4;
    flex-shrink: 0;
}
.media-field-preview img { width: 100%; height: 100%; object-fit: cover; }
.media-field-multi {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}
.media-field-multi .mf-item {
    position: relative;
    width: 76px;
    height: 76px;
    border-radius: 9px;
    overflow: hidden;
    border: 1px solid var(--ad-border);
}
.media-field-multi .mf-item img { width: 100%; height: 100%; object-fit: cover; }
.media-field-multi .mf-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    border: 0;
    border-radius: 50%;
    background: rgba(16, 19, 26, .65);
    color: #fff;
    font-size: .65rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ============ SEO SEARCH PREVIEW ============ */
.seo-preview {
    border: 1px solid var(--ad-border);
    border-radius: 10px;
    padding: 1rem 1.1rem;
    background: #fff;
    max-width: 600px;
}
.seo-preview-url { color: #4b5563; font-size: .8rem; margin-bottom: .2rem; }
.seo-preview-title { color: #1a0dab; font-size: 1.15rem; font-weight: 500; line-height: 1.3; }
.seo-preview-desc { color: #4d5156; font-size: .85rem; line-height: 1.5; margin-top: .25rem; }
