/* Focused admin refinements for media-heavy catalogue editing. */
.navbar-brand-box .logo { display: flex; align-items: center; justify-content: center; }
.ascbd-admin-logo-lg,
.ascbd-admin-logo-sm,
.ascbd-login-brand {
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 10px;
    background: #090d16;
}
.ascbd-admin-logo-lg { width: 182px; height: 52px; margin: 0 auto; padding: 7px 12px; }
.ascbd-admin-logo-sm { width: 48px; height: 42px; margin: 0 auto; padding: 7px 5px; }
.ascbd-admin-logo-lg img,
.ascbd-admin-logo-sm img,
.ascbd-login-brand img { width: 100%; height: 100%; object-fit: contain; display: block; }
.ascbd-login-brand { display: inline-flex; width: min(100%, 280px); height: 86px; padding: 14px 22px; box-shadow: 0 12px 30px rgba(9, 13, 22, .14); }
.product-editor-form > .card {
    border: 1px solid #e7eaf0;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(35, 48, 74, .045);
    margin-bottom: 18px;
}
.product-editor-form > .card > .card-body { padding: 24px; }
.admin-upload-grid {
    display: grid;
    grid-template-columns: minmax(260px, .8fr) minmax(300px, 1.2fr);
    gap: 20px;
    align-items: start;
}
.admin-upload-zone {
    position: relative;
    min-height: 152px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 22px;
    border: 1.5px dashed #9eb9df;
    border-radius: 12px;
    background: #f7faff;
    color: #3b5f8f;
    text-align: center;
    cursor: pointer;
    transition: border-color .16s ease, background .16s ease;
}
.admin-upload-zone:hover { border-color: #5156be; background: #f2f4ff; }
.admin-upload-zone > svg { width: 27px; height: 27px; }
.admin-upload-zone small { color: #74788d; }
.admin-upload-zone input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.admin-media-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
    gap: 12px;
    max-height: 410px;
    overflow: auto;
    padding: 3px 5px 8px 3px;
}
.admin-media-option {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    padding: 8px;
    border: 1px solid #e2e5eb;
    border-radius: 11px;
    background: #fff;
    cursor: pointer;
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.admin-media-option:hover { border-color: #a9addd; transform: translateY(-1px); }
.admin-media-option:has(input:checked) { border-color: #5156be; box-shadow: 0 0 0 2px rgba(81, 86, 190, .13); }
.admin-media-option > input[type="radio"],
.admin-media-option > input[type="checkbox"] { position: absolute; top: 13px; right: 13px; z-index: 2; width: 18px; height: 18px; accent-color: #5156be; }
.admin-media-option > img,
.admin-media-placeholder { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; background: #f3f4f7; }
.admin-media-placeholder { display: grid; place-items: center; color: #a1a5b7; }
.admin-media-option > span:not(.admin-media-placeholder) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; font-weight: 600; color: #343a40; }
.admin-media-option > small { color: #74788d; font-size: 11px; }
.admin-media-option.is-disabled { opacity: .45; cursor: not-allowed; }
.admin-media-caption { position: relative; z-index: 3; }
.admin-local-preview { display: flex; align-items: center; gap: 10px; margin-top: 12px; color: #198754; font-size: 13px; font-weight: 600; }
.admin-local-preview img { width: 58px; height: 58px; object-fit: cover; border-radius: 9px; border: 1px solid #d8dce4; }
.admin-catalog-image-preview {
    width: 100%;
    max-width: 190px;
    height: 116px;
    padding: 8px;
    border: 1px solid #dfe3e9;
    border-radius: 10px;
    object-fit: contain;
    background: #f6f7f9;
}
.admin-catalog-list-thumb {
    width: 42px;
    height: 42px;
    padding: 3px;
    border: 1px solid #e1e4e9;
    border-radius: 9px;
    object-fit: contain;
    background: #f6f7f9;
}
.admin-catalog-list-icon {
    width: 42px;
    height: 42px;
    border-radius: 9px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    background: #f0f2f8;
    color: #5156be;
    font-size: 21px;
}
.blog-editor-page-head > div:first-child { min-width: 0; }
.blog-editor-form .card {
    border: 1px solid #e7eaf0;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(35, 48, 74, .045);
}
.blog-editor-card > .card-body { padding: 24px; }
.blog-editor-layout .blog-editor-card:last-child { margin-bottom: 0; }
.blog-editor-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}
.blog-editor-section-head > div { min-width: 0; }
.blog-content-source { min-height: 500px; }
.blog-content-card {
    --ck-border-radius: 10px;
    --ck-color-base-border: #dfe3ea;
    --ck-color-focus-border: #7b80d1;
    --ck-color-shadow-drop: rgba(35, 48, 74, .08);
    --ck-color-shadow-inner: rgba(35, 48, 74, .04);
}
.blog-content-card .ck.ck-editor { width: 100%; }
.blog-content-card .ck.ck-toolbar {
    padding: 8px 10px;
    border-radius: 11px 11px 0 0;
    background: #f8f9fc;
}
.blog-content-card .ck.ck-toolbar > .ck-toolbar__items { flex-wrap: wrap; }
.blog-content-card .ck.ck-editor__main > .ck-editor__editable {
    min-height: clamp(430px, 52vh, 650px);
    max-height: 72vh;
    overflow-y: auto;
    padding: 28px clamp(22px, 3vw, 40px);
    border-radius: 0 0 11px 11px;
    color: #2f3542;
    font-size: 15px;
    line-height: 1.75;
}
.blog-content-card .ck.ck-editor__main > .ck-editor__editable.ck-focused {
    box-shadow: 0 0 0 3px rgba(81, 86, 190, .11);
}
.blog-content-card .ck-content h2,
.blog-content-card .ck-content h3,
.blog-content-card .ck-content h4 { margin: 1.6em 0 .55em; color: #202533; line-height: 1.3; }
.blog-content-card .ck-content h2:first-child,
.blog-content-card .ck-content h3:first-child,
.blog-content-card .ck-content h4:first-child { margin-top: 0; }
.blog-content-card .ck-content p { margin: 0 0 1em; }
.blog-content-card .ck-content ul,
.blog-content-card .ck-content ol { padding-left: 1.45em; }
.blog-content-card .ck-content blockquote {
    margin: 1.5em 0;
    padding: 14px 18px;
    border-left: 3px solid #5156be;
    background: #f6f7fc;
    color: #4f5668;
}
.blog-media-existing {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 190px;
    gap: 20px;
    align-items: end;
    padding: 18px;
    border: 1px solid #e7eaf0;
    border-radius: 12px;
    background: #f8f9fc;
}
.blog-media-selected-preview {
    min-height: 116px;
    display: grid;
    place-items: center;
    padding: 8px;
    border: 1px solid #dfe3e9;
    border-radius: 10px;
    background: #fff;
    color: #8a91a3;
    font-size: 12px;
    text-align: center;
}
.blog-media-selected-preview img {
    width: 100%;
    height: 100px;
    object-fit: contain;
    border-radius: 7px;
}
.blog-save-bar { margin-bottom: 48px; }
.product-save-bar {
    position: sticky;
    bottom: 14px;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin: 24px 0 42px;
    padding: 13px 16px 13px 20px;
    border: 1px solid rgba(81, 86, 190, .18);
    border-radius: 13px;
    background: rgba(255, 255, 255, .95);
    box-shadow: 0 10px 30px rgba(35, 48, 74, .13);
    backdrop-filter: blur(12px);
    color: #74788d;
    font-size: 13px;
}
@media (max-width: 767px) {
    .admin-upload-grid { grid-template-columns: 1fr; }
    .admin-media-picker { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .product-editor-form > .card > .card-body { padding: 18px; }
    .product-save-bar span { display: none; }
    .product-save-bar .btn { width: 100%; }
    .blog-editor-card > .card-body { padding: 18px; }
    .blog-editor-section-head { gap: 12px; }
    .blog-content-card .ck.ck-editor__main > .ck-editor__editable {
        min-height: 360px;
        max-height: none;
        padding: 20px 18px;
    }
    .blog-media-existing { grid-template-columns: 1fr; }
    .blog-media-selected-preview { min-height: 140px; }
    .blog-media-selected-preview img { height: 124px; }
}
@media (prefers-reduced-motion: reduce) {
    .admin-upload-zone, .admin-media-option { transition: none; }
    .admin-media-option:hover { transform: none; }
}

:root {
    --admin-sidebar-width: 272px;
    --admin-sidebar-collapsed-width: 76px;
    --admin-sidebar-surface: #f7f9fc;
    --admin-sidebar-border: #e8edf5;
    --admin-sidebar-ink: #56637a;
    --admin-sidebar-muted: #94a0b4;
    --admin-sidebar-accent: #5156be;
    --admin-sidebar-accent-soft: rgba(81, 86, 190, .11);
}

#page-topbar {
    box-shadow: 0 1px 0 rgba(15, 23, 42, .03), 0 8px 24px rgba(15, 23, 42, .035);
}

/* Keep every Bootstrap dialog above the fixed admin header and mobile sidebar. */
.modal {
    --bs-modal-zindex: 1110;
}

.modal-backdrop {
    --bs-backdrop-zindex: 1100;
}

.navbar-header {
    padding-right: 18px;
}

.navbar-brand-box {
    width: var(--admin-sidebar-width);
    height: 70px;
    padding: 0 18px;
    background: #0b1220;
    border-right: 1px solid rgba(255, 255, 255, .08);
    box-shadow: none;
    display: flex;
    align-items: center;
}

.navbar-brand-box .logo.logo-dark {
    display: flex !important;
    width: 100%;
    height: 70px;
    align-items: center;
    line-height: normal;
}

.navbar-brand-box .logo.logo-light {
    display: none !important;
}

.ascbd-admin-logo-lg {
    display: flex;
    width: 208px;
    height: 48px;
    margin: 0 auto;
    padding: 6px 14px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 13px;
    background: rgba(255, 255, 255, .045);
}

.ascbd-admin-logo-sm {
    display: none;
    width: 44px;
    height: 44px;
    margin: 0 auto;
    padding: 7px 5px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 12px;
    background: rgba(255, 255, 255, .045);
}

body:not([data-sidebar-size=sm]) #vertical-menu-btn {
    margin-left: 10px;
    margin-right: 10px;
}

/* The only bordered control in an otherwise borderless topbar read as a
   stray empty box against the white bar. The 44px target and the rounded
   shape stay — they are what make it comfortable to hit — but the border and
   fill now belong to the hover/focus state, like every other header item. */
#vertical-menu-btn {
    width: 44px;
    height: 44px;
    margin-top: 0;
    padding: 0 !important;
    border: 1px solid transparent;
    border-radius: 12px;
    color: #69768c;
    background: transparent;
    transition: color .2s ease, border-color .2s ease, background .2s ease, box-shadow .2s ease;
}

#vertical-menu-btn:hover,
#vertical-menu-btn:focus-visible {
    color: var(--admin-sidebar-accent);
    border-color: rgba(81, 86, 190, .28);
    background: #f5f6ff;
    box-shadow: 0 5px 14px rgba(81, 86, 190, .12);
}

#vertical-menu-btn svg,
#vertical-menu-btn i {
    width: 18px;
    height: 18px;
    margin: 0;
}

.vertical-menu {
    width: var(--admin-sidebar-width);
    top: 70px;
    background: linear-gradient(180deg, #fbfcfe 0%, var(--admin-sidebar-surface) 100%);
    border-right: 1px solid var(--admin-sidebar-border);
    box-shadow: 10px 0 30px rgba(15, 23, 42, .035);
    transition: width .24s ease, transform .24s ease;
}

.main-content {
    margin-left: var(--admin-sidebar-width);
    transition: margin-left .24s ease;
}

#sidebar-menu {
    padding: 16px 12px 28px;
}

#sidebar-menu > ul {
    margin: 0;
}

#sidebar-menu .menu-title {
    margin: 18px 0 7px;
    padding: 0 12px !important;
    color: var(--admin-sidebar-muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .14em;
    line-height: 1.4;
    text-transform: uppercase;
}

#sidebar-menu .menu-title:first-child {
    margin-top: 2px;
}

#sidebar-menu ul li:not(.menu-title) {
    margin: 3px 0;
}

#sidebar-menu ul li a {
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 13px;
    border: 1px solid transparent;
    border-radius: 12px;
    color: var(--admin-sidebar-ink);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .005em;
    transition: color .2s ease, background .2s ease, border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}

#sidebar-menu ul li a svg {
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    margin: 0;
    color: #8995a9;
    fill: none;
    stroke-width: 1.8;
    transition: color .2s ease, transform .2s ease;
}

#sidebar-menu ul li a:hover {
    color: #2e3a54;
    background: rgba(255, 255, 255, .78);
    border-color: #edf0f6;
    transform: translateX(2px);
    box-shadow: 0 5px 16px rgba(15, 23, 42, .035);
}

#sidebar-menu ul li a:hover svg {
    color: var(--admin-sidebar-accent);
    transform: scale(1.05);
}

#sidebar-menu ul li.mm-active > a,
#sidebar-menu ul li > a.active {
    color: #4247ab !important;
    background: linear-gradient(100deg, var(--admin-sidebar-accent-soft), rgba(81, 86, 190, .045));
    border-color: rgba(81, 86, 190, .12);
    box-shadow: inset 3px 0 0 var(--admin-sidebar-accent), 0 6px 16px rgba(81, 86, 190, .06);
}

#sidebar-menu ul li.mm-active > a svg,
#sidebar-menu ul li > a.active svg {
    color: var(--admin-sidebar-accent) !important;
}

#admin-sidebar .simplebar-scrollbar:before {
    background: #c4cada;
}

#admin-sidebar .simplebar-track.simplebar-vertical {
    width: 7px;
    right: 2px;
}

.admin-sidebar-backdrop {
    display: none;
}

body[data-sidebar-size=sm] .navbar-brand-box {
    width: var(--admin-sidebar-collapsed-width) !important;
    padding: 0;
}

body[data-sidebar-size=sm] .ascbd-admin-logo-lg {
    display: none;
}

body[data-sidebar-size=sm] .ascbd-admin-logo-sm {
    display: flex;
}

body[data-sidebar-size=sm] .vertical-menu {
    width: var(--admin-sidebar-collapsed-width) !important;
}

body[data-sidebar-size=sm] .main-content {
    margin-left: var(--admin-sidebar-collapsed-width);
}

body[data-sidebar-size=sm] #sidebar-menu {
    padding-right: 9px;
    padding-left: 9px;
}

body[data-sidebar-size=sm] #sidebar-menu ul li a {
    justify-content: center;
    gap: 0;
    padding: 12px 0;
    border-radius: 11px;
}

body[data-sidebar-size=sm] #sidebar-menu ul li a svg {
    margin: 0;
}

body[data-sidebar-size=sm] #sidebar-menu ul li.mm-active > a,
body[data-sidebar-size=sm] #sidebar-menu ul li > a.active {
    box-shadow: inset 3px 0 0 var(--admin-sidebar-accent);
}

@media (max-width: 991.98px) {
    .navbar-header {
        padding-right: 10px;
    }

    .navbar-brand-box {
        width: 216px;
        padding: 0 12px;
    }

    .ascbd-admin-logo-lg {
        width: 176px;
        height: 46px;
    }

    body:not([data-sidebar-size=sm]) #vertical-menu-btn {
        margin-left: 8px;
        margin-right: 8px;
    }

    .vertical-menu {
        width: min(320px, 86vw) !important;
        transform: translateX(-105%);
        z-index: 1090;
        box-shadow: 18px 0 44px rgba(15, 23, 42, .16);
    }

    body[data-sidebar-size=sm] .vertical-menu {
        width: min(320px, 86vw) !important;
        position: fixed !important;
    }

    body.sidebar-enable .vertical-menu {
        display: block;
        transform: translateX(0);
    }

    .main-content,
    body[data-sidebar-size=sm] .main-content {
        margin-left: 0 !important;
    }

    .admin-sidebar-backdrop {
        position: fixed;
        inset: 70px 0 0;
        z-index: 1089;
        background: rgba(15, 23, 42, .38);
        opacity: 0;
        pointer-events: none;
        display: block;
        transition: opacity .24s ease;
    }

    body.sidebar-enable .admin-sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    #sidebar-menu {
        padding: 18px 14px 32px;
    }

    body[data-sidebar-size=sm] .navbar-brand-box {
        width: 216px !important;
        padding: 0 12px;
    }

    body[data-sidebar-size=sm] .ascbd-admin-logo-lg {
        display: flex;
    }

    body[data-sidebar-size=sm] .ascbd-admin-logo-sm {
        display: none;
    }
}

@media (max-width: 575.98px) {
    .navbar-brand-box {
        width: 188px;
    }

    .ascbd-admin-logo-lg {
        width: 154px;
        padding-right: 9px;
        padding-left: 9px;
    }

    .navbar-header .dropdown .header-item {
        padding-right: 10px;
        padding-left: 10px;
    }

    .navbar-header .dropdown .header-item .header-profile-user {
        margin: 0;
    }

    #vertical-menu-btn {
        width: 40px;
        height: 40px;
        margin-top: 0;
    }

    body:not([data-sidebar-size=sm]) #vertical-menu-btn {
        margin-left: 5px;
        margin-right: 5px;
    }
}

@media (prefers-reduced-motion: reduce) {
    #vertical-menu-btn,
    .vertical-menu,
    .main-content,
    #sidebar-menu ul li a,
    #sidebar-menu ul li a svg,
    .admin-sidebar-backdrop {
        transition: none;
    }
}

/* ---------- Dashboard stat cards ----------
   These were already links to a filtered list, but nothing on them said so:
   no hover, no cursor cue, no direction. The affordance is what was missing,
   not the behaviour. */

.ascbd-stat-card {
    position: relative;
    overflow: hidden;
    border: 1px solid #eef1f6;
    color: inherit;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.ascbd-stat-card:hover,
.ascbd-stat-card:focus-visible {
    transform: translateY(-3px);
    border-color: rgba(81, 86, 190, .30);
    box-shadow: 0 10px 26px rgba(20, 28, 60, .10);
}

.ascbd-stat-card:focus-visible {
    outline: 2px solid var(--admin-sidebar-accent, #5156be);
    outline-offset: 2px;
}

.ascbd-stat-value {
    font-variant-numeric: tabular-nums;  /* digits keep their column while counting */
}

.ascbd-stat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    color: #8a94a6;
    background: #f5f6fa;
    transition: color .18s ease, background .18s ease;
}

.ascbd-stat-card:hover .ascbd-stat-icon,
.ascbd-stat-card:focus-visible .ascbd-stat-icon {
    color: var(--admin-sidebar-accent, #5156be);
    background: rgba(81, 86, 190, .10);
}

/* The arrow only appears on hover: a permanent one on every card would add
   twelve competing pointers to a screen that is meant to be scanned. */
.ascbd-stat-go {
    position: absolute;
    right: 14px;
    bottom: 10px;
    display: inline-flex;
    color: var(--admin-sidebar-accent, #5156be);
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity .18s ease, transform .18s ease;
}

.ascbd-stat-go svg { width: 16px; height: 16px; }

.ascbd-stat-card:hover .ascbd-stat-go,
.ascbd-stat-card:focus-visible .ascbd-stat-go {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    .ascbd-stat-card,
    .ascbd-stat-icon,
    .ascbd-stat-go { transition: none; }
    .ascbd-stat-card:hover,
    .ascbd-stat-card:focus-visible { transform: none; }
    .ascbd-stat-go { transform: none; }
}
