/* Base reset + shared layout primitives. Editorial, calm, content-first
   (PRD §82/§53) -- no gradients, no big shadows, no dashboard chrome. */

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; overflow-x: hidden; }
/* Disable the browser's native pull-to-refresh gesture on mobile (it
   fought with swipe-based interactions like the timeline's own scrolling). */
@media (max-width: 640px) {
    html { overscroll-behavior-y: contain; }
}
/* Safety net: an <img>/<video> with hardcoded intrinsic width/height
   attributes (e.g. a full-resolution photo) would otherwise be able to
   force the whole page wider than the viewport on mobile before any
   more specific sizing rule applies. */
img, video { max-width: 100%; height: auto; }

/* Global checkbox styling -- every checkbox across the site (admin lists,
   bulk-select, filters, forms) was plain unstyled browser chrome. Using
   the standard `accent-color` property (not a hand-built custom checkbox)
   keeps native semantics/keyboard behavior/accessibility intact while
   matching the theme's accent color, everywhere at once. */
input[type="checkbox"] {
    accent-color: var(--color-accent);
    width: 16px;
    height: 16px;
    cursor: pointer;
    vertical-align: middle;
}

/* Item: text-like inputs already theme their border/background wherever
   they're individually styled, but almost none of them override :focus --
   so focusing any input not wrapped in .field (which has had its own
   focus rule for a while) fell through to the browser's native focus ring,
   clashing with the theme. One global rule for every text-like control,
   everywhere, so this can't be missed again per-component. */
input[type="text"], input[type="search"], input[type="email"], input[type="password"],
input[type="url"], input[type="tel"], input[type="number"], input[type="date"],
input[type="datetime-local"], input[type="month"], input[type="week"], input[type="time"],
input:not([type]), textarea, select {
    accent-color: var(--color-accent);
    /* Đợt BH mục 175: hình dáng chung cho MỌI ô nhập, ở mọi trang.
       Trước đây mỗi component tự style ô nhập của mình, nên chỗ nào lỡ quên là
       ra thẳng ô mặc định của trình duyệt: viền 2px inset xám, bo góc vuông,
       cao 21px, đứng cạnh một ô cao 34px bo tròn. Rà lại đợt này thấy 19 ô như
       vậy nằm rải rác ở /admin, /admin/users và /admin/settings.
       Đặt ở đây, dùng bộ chọn theo THẺ nên độ ưu tiên thấp nhất: component nào
       đã có style riêng vẫn thắng, còn component nào quên thì có sẵn cái đúng.
       Từ nay quên cũng không ra ô xấu được nữa. */
    font: inherit;
    font-size: 14px;
    line-height: 1.35;
    color: var(--color-input-text);
    background: var(--color-input-background);
    border: 1px solid var(--color-input-border);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    box-sizing: border-box;
    transition: border-color .15s ease, box-shadow .15s ease;
}
select {
    /* Mũi tên riêng: mũi tên mặc định của từng trình duyệt mỗi nơi một kiểu,
       và trên macOS nó kéo theo cả nền xám không tắt được. */
    appearance: none;
    -webkit-appearance: none;
    padding-right: 30px;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath fill='%23888' d='M0 0h10L5 6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 11px center;
}
textarea { min-height: 72px; resize: vertical; }
input:disabled, textarea:disabled, select:disabled { opacity: .55; cursor: not-allowed; }
input::placeholder, textarea::placeholder { color: var(--color-text-secondary); opacity: .75; }
input[type="text"]:focus, input[type="search"]:focus, input[type="email"]:focus, input[type="password"]:focus,
input[type="url"]:focus, input[type="tel"]:focus, input[type="number"]:focus, input[type="date"]:focus,
input[type="datetime-local"]:focus, input[type="month"]:focus, input[type="week"]:focus, input[type="time"]:focus,
input:not([type]):focus, textarea:focus, select:focus {
    outline: 2px solid var(--color-accent);
    outline-offset: -1px;
}
body {
    margin: 0;
    background: var(--color-background);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}

a { color: var(--color-link); text-decoration: none; }
a:hover { color: var(--color-link-hover); text-decoration: underline; }

::selection { background: var(--color-selection-background); color: var(--color-selection-text); }

h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 0.5em; font-weight: 600; }

.container {
    max-width: 720px;
    margin-inline: auto;
    padding-inline: 20px;
}

.surface {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

/* Đợt BH mục 175: MỘT định nghĩa duy nhất cho nút.
   Trước đây .btn ra bốn năm cỡ khác nhau ngay trên cùng một trang: 38px ở
   thanh trên (do .admin-topbar .btn ghi đè), 39px ở chỗ khác, rồi 26px, 43px,
   42.8px ở những nơi call site tự dán style="padding:...;font-size:..." vào.
   Ba con số ở đây (38px / 14px / 0 16px) lấy theo cỡ đang dùng nhiều nhất là
   thanh trên, nên đổi mà giao diện không xô lệch.
   Cần nút nhỏ hơn thì dùng .btn-sm hoặc .btn-xs, ĐỪNG dán style vào thẻ. */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 38px;
    padding: 0 16px;
    box-sizing: border-box;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    background: var(--color-accent);
    color: var(--color-accent-foreground);
    transition: background-color 120ms ease;
}
.btn-sm { height: 30px; padding: 0 12px; font-size: 13px; }
.btn-xs { height: 26px; padding: 0 10px; font-size: 12px; }
/* Nút chiếm hết bề ngang một cột (hay gặp trong panel bên phải). */
.btn-block { width: 100%; }
.btn:hover { background: var(--color-accent-hover); color: var(--color-accent-foreground); text-decoration: none; }
.btn:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.btn.btn-secondary {
    background: transparent;
    color: var(--color-text);
    border-color: var(--color-border);
}
.btn.btn-secondary:hover { background: var(--color-surface-muted); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.btn-danger { background: transparent; color: var(--color-danger); border-color: color-mix(in srgb, var(--color-danger) 40%, transparent); }
.btn.btn-danger:hover { background: color-mix(in srgb, var(--color-danger) 12%, transparent); color: var(--color-danger); }

.field { margin-bottom: 16px; }
.field label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-secondary);
}
.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="url"],
.field input[type="datetime-local"],
.field textarea,
.field select {
    width: 100%;
    padding: 10px 12px;
    font-size: 15px;
    font-family: inherit;
    color: var(--color-input-text);
    background: var(--color-input-background);
    border: 1px solid var(--color-input-border);
    border-radius: var(--radius-sm);
}
.field input:focus, .field textarea:focus, .field select:focus {
    outline: 2px solid var(--color-accent);
    outline-offset: -1px;
}

.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 14px;
    border: 1px solid transparent;
}
.alert-error { background: color-mix(in srgb, var(--color-danger) 12%, var(--color-surface)); color: var(--color-danger); border-color: color-mix(in srgb, var(--color-danger) 30%, transparent); }
.alert-success { background: color-mix(in srgb, var(--color-success) 12%, var(--color-surface)); color: var(--color-success); border-color: color-mix(in srgb, var(--color-success) 30%, transparent); }

.muted { color: var(--color-text-muted); }
.text-secondary { color: var(--color-text-secondary); }

.checklist { list-style: none; padding: 0; margin: 0 0 16px; }
.checklist li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: 14px;
    border-bottom: 1px solid var(--color-border-subtle);
}
.checklist .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.checklist .dot.ok { background: var(--color-success); }
.checklist .dot.fail { background: var(--color-danger); }

/* Persistent /admin sidebar (admin-nav.php). Present on every admin page --
   shift the page over for it wherever it appears, without needing to touch
   each page's own wrapper class. */
.admin-sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 220px;
    background: var(--color-surface);
    border-right: 1px solid var(--color-border);
    padding: 18px 12px 20px;
    overflow-y: auto;
    z-index: 40;
    display: flex;
    flex-direction: column;
}
body:has(.admin-sidebar) { padding-left: 220px; }

.admin-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: 17px;
    color: var(--color-text);
    padding: 6px 10px;
}
.admin-sidebar-logo-img { width: 28px; height: 28px; object-fit: cover; border-radius: var(--radius-sm); }
.admin-sidebar-logo-emoji { font-size: 20px; line-height: 1; }
/* Đợt K mục 6: full-text logo replacing the title -- scale to the sidebar
   column, keep some air. */
.admin-sidebar-logo-full { display: block; width: 100%; max-width: 118px; height: auto; }
.admin-sidebar-description { font-size: 12px; color: var(--color-text-muted); padding: 0 10px 6px; margin-top: -4px; }
.admin-sidebar-homepage-row {
    display: flex; align-items: center; gap: 6px;
    padding: 0 10px 16px; font-size: 12px;
}
.admin-sidebar-homepage-sep { color: var(--color-text-muted); opacity: .6; }
.admin-sidebar-homepage-link {
    display: block;
    font-size: 12px;
    color: var(--color-text-muted);
}
.admin-sidebar-homepage-row .admin-sidebar-homepage-link { padding: 0; }
.admin-sidebar-homepage-link:hover { color: var(--color-text); }
/* Đợt AO: Admin/Workspace pill trắng, sáng ở đúng không gian đang đứng --
   admin (navy) sáng pill Admin, workspace (xanh) sáng pill Workspace. */
.admin-sidebar-space-pill { border-radius: 999px; padding: 2px 10px !important; font-weight: 700; }
.admin-sidebar:not(.ws-sidebar) .admin-sidebar-space-pill[data-space="admin"],
.ws-sidebar .admin-sidebar-space-pill[data-space="workspace"] { background: #fff; }
.admin-sidebar:not(.ws-sidebar) .admin-sidebar-space-pill[data-space="admin"] { color: var(--cm-ink, #000) !important; }
.ws-sidebar .admin-sidebar-space-pill[data-space="workspace"] { color: #1553B8 !important; }
.admin-sidebar-brand-only { padding-bottom: 20px; }
.admin-sidebar-nav { display: flex; flex-direction: column; gap: 1px; }
.admin-sidebar-nav a {
    display: flex; align-items: center; gap: 9px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--color-text-secondary);
    background: none; border: none; cursor: pointer; text-align: left; width: 100%; font-family: inherit;
}
.admin-sidebar-nav a:hover { background: var(--color-surface-muted); text-decoration: none; }
.admin-sidebar-nav a.active { background: var(--color-accent); color: var(--color-accent-foreground); }
.admin-sidebar-nav a i { width: 16px; text-align: center; font-size: 13px; flex-shrink: 0; opacity: .85; }

/* Hovering a nav row reveals a quick "New" link on the right (item: sidebar
   quick-create). The row's own <a> keeps its normal width via flex:1 so the
   hover background/highlight still spans the whole row as before. */
.admin-sidebar-nav-item { position: relative; display: flex; align-items: center; }
.admin-sidebar-nav-item > a[data-nav] { flex: 1; min-width: 0; }
/* Item: the generic ".admin-sidebar-nav a" rule (width:100%, display:flex,
   padding:8px 10px) has higher specificity (class+tag beats one class
   alone) than a single ".admin-sidebar-nav-new" selector, so it was
   winning and stretching this into a full-row block that hid the item's
   own label/icon entirely instead of a small pill pinned to the right.
   Re-qualified as ".admin-sidebar-nav a.admin-sidebar-nav-new" to safely
   out-specificity it, plus explicit width/flex overrides. */
.admin-sidebar-nav a.admin-sidebar-nav-new {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    width: auto; flex: none; display: inline-flex; align-items: center;
    font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 999px;
    background: var(--color-accent); color: var(--color-accent-foreground);
    opacity: 0; pointer-events: none; transition: opacity .12s ease;
    text-decoration: none;
}
.admin-sidebar-nav-item:hover .admin-sidebar-nav-new { opacity: 1; pointer-events: auto; }
/* Đợt M mục 2: Users has TWO quick-create buttons on hover. */
.admin-sidebar-nav-item-two-new .admin-sidebar-nav-new-2 { right: 60px; }

/* Theme/Profile buttons pinned to the bottom of the sidebar. */
.admin-sidebar-footer { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--color-border); display: flex; flex-direction: column; gap: 1px; }
.admin-sidebar-footer-btn {
    display: flex; align-items: center; gap: 9px;
    padding: 8px 10px; border-radius: var(--radius-sm);
    font-size: 14px; color: var(--color-text-secondary);
    background: none; border: none; cursor: pointer; text-align: left; width: 100%; font-family: inherit; text-decoration: none;
}
.admin-sidebar-footer-btn:hover { background: var(--color-surface-muted); text-decoration: none; }
.admin-sidebar-footer-btn i { width: 16px; text-align: center; font-size: 13px; flex-shrink: 0; opacity: .85; }

/* Theme popover: everything from partials/theme-manager.php, lazily
   AJAX-loaded on first open. */
.theme-popover {
    position: fixed; left: 226px; bottom: 20px; z-index: 60;
    width: min(420px, calc(100vw - 250px));
    max-height: min(640px, calc(100vh - 40px));
    overflow-y: auto;
    background: var(--color-surface-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 32px rgba(0, 0, 0, .18);
    padding: 16px;
}
.theme-popover-panel .theme-gallery-group { grid-template-columns: repeat(auto-fill, 120px); justify-content: start; }
/* Matches the sidebar's own off-canvas breakpoint (app.css's "Mobile: the
   sidebar becomes a slide-in..." rule) -- below that, the sidebar itself is
   an overlay taking the full width, so the popover can't anchor beside it. */
@media (max-width: 768px) {
    .theme-popover { left: 12px; right: 12px; width: auto; bottom: 70px; }
}

/* Item: a standalone floating theme button on every front-end page (not
   inside a full sidebar) -- same idea/position as the admin sidebar's own
   Theme footer button, just not attached to a sidebar column here. */
.theme-float-btn {
    position: fixed; left: 16px; bottom: 20px; z-index: 50;
    width: 44px; height: 44px; border-radius: 50%;
    background: var(--color-surface-elevated); border: 1px solid var(--color-border);
    color: var(--color-text-secondary); font-size: 16px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .15); cursor: pointer;
}
.theme-float-btn:hover { color: var(--color-text); border-color: var(--color-accent); }
/* /admin and /compose pages already have their own Theme button in their
   own sidebar -- this floating one is for front-end pages only, same
   :has() exclusion pattern as .mobile-bottom-nav above. */
body:has(.admin-sidebar) .theme-float-btn,
body:has(.admin-sidebar) #site-theme-popover,
body:has(> #composer-root) .theme-float-btn,
body:has(> #composer-root) #site-theme-popover {
    display: none;
}
#site-theme-popover { left: 16px; }
/* Item: front-end-only footer, same page-type exclusion as above. */
.site-footer {
    max-width: 1000px; margin: 32px auto 24px; padding: 16px 20px;
    border-top: 1px solid var(--color-border);
    font-size: 13px; color: var(--color-text-muted); text-align: center;
}
.site-footer p { margin: 0; }
.site-footer a { color: inherit; text-decoration: underline; }
body:has(.admin-sidebar) .site-footer,
body:has(> #composer-root) .site-footer {
    display: none;
}
@media (max-width: 768px) {
    #site-theme-popover { left: 12px; right: 12px; width: auto; }
}
@media (max-width: 640px) {
    /* Clear the mobile bottom-nav bar (58px + safe-area) that sits on top
       of this same edge on the pages that have one. */
    .theme-float-btn { bottom: 70px; }
    /* Item: the base .theme-popover's max-height assumes bottom:20px
       (min(640px, 100vh - 40px)) -- moved up to bottom:126px here without
       also shrinking max-height, the panel could still reach that same
       tall height, pushing its *top* edge off the top of a short mobile
       viewport (cropped). Recompute against the real available space. */
    #site-theme-popover { bottom: 126px; max-height: min(640px, calc(100vh - 146px)); }
}
.admin-sidebar-sub { padding-left: 22px !important; font-size: 13px; }

.admin-sidebar-hamburger {
    display: none;
    position: fixed;
    top: 12px; left: 12px;
    z-index: 55;
    width: 40px; height: 40px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    color: var(--color-text);
    font-size: 18px;
    cursor: pointer;
}
.admin-sidebar-backdrop {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, .35);
    z-index: 50;
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity .18s ease, visibility .18s ease;
}
.admin-sidebar-backdrop.open { opacity: 1; visibility: visible; pointer-events: auto; }

/* Mobile: the sidebar becomes a slide-in off-canvas panel (toggled by the
   hamburger button) instead of a horizontal-wrapping strip that used to eat
   a lot of vertical space at the top of every admin page. */
@media (max-width: 768px) {
    body:has(.admin-sidebar) { padding-left: 0; padding-top: 56px; }
    .admin-sidebar-hamburger { display: block; }
    .admin-sidebar:not(.admin-sidebar-brand-only) {
        width: min(260px, 82vw);
        transform: translateX(-100%);
        transition: transform .2s ease;
        z-index: 56;
        box-shadow: 2px 0 12px rgba(0, 0, 0, .15);
    }
    .admin-sidebar:not(.admin-sidebar-brand-only).open { transform: translateX(0); }
    /* /compose has only the brand link (no nav to collapse) -- keep it as a
       plain top strip on mobile instead, matching the public site header. */
    .admin-sidebar.admin-sidebar-brand-only { position: static; width: auto; border-right: none; border-bottom: 1px solid var(--color-border); }
    body:has(.admin-sidebar.admin-sidebar-brand-only) { padding-top: 0; }
}

/* Mobile app-shell bottom nav (logged-in author only -- base.php only
   renders it then). Hidden on desktop, and on /admin & /compose even on
   mobile since those already have their own hamburger nav / are full-editor
   surfaces where a bottom bar would just eat vertical space. */
.mobile-bottom-nav { display: none; }
@media (max-width: 640px) {
    body:not(:has(.admin-sidebar)):not(:has(> #composer-root)) .mobile-bottom-nav {
        display: flex;
        align-items: center;
        justify-content: space-around;
        position: fixed;
        left: 0; right: 0; bottom: 0;
        height: 58px;
        background: var(--color-surface-elevated);
        border-top: 1px solid var(--color-border);
        z-index: 50;
        padding-bottom: env(safe-area-inset-bottom, 0);
    }
    /* Leave room so page content never sits underneath the fixed bar. */
    body:not(:has(.admin-sidebar)):not(:has(> #composer-root)) { padding-bottom: 58px; }
}
.mobile-bottom-nav a {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    color: var(--color-text-secondary); font-size: 10px; flex: 1;
    padding: 6px 0;
}
.mobile-bottom-nav a:hover { text-decoration: none; color: var(--color-text); }
.mobile-bottom-nav .mbn-icon { font-size: 19px; line-height: 1; }
.mobile-bottom-nav .mbn-new {
    flex-shrink: 0;
    width: 46px; height: 46px; margin: 0 4px;
    border-radius: 50%;
    background: var(--color-accent); color: var(--color-accent-foreground);
    border: none; font-size: 24px; line-height: 1;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
    cursor: pointer;
    transform: translateY(-6px);
}

/* Item: site-wide styled alert/confirm/prompt replacement (dialogs.js) --
   z-index above everything else (composer modal 95, link-insert popup 97)
   since these can be triggered from inside any of those. */
.hotbot-dialog-backdrop {
    position: fixed; inset: 0; background: rgba(0, 0, 0, .45);
    /* Đợt AV: dialog alert/confirm phải NỔI TRÊN mọi popup khác (compose
       modal 11500, lightbox 2000, chuông 3000...) -- từng bị chìm sau. */
    display: flex; align-items: center; justify-content: center; z-index: 20000;
    padding: 20px;
    opacity: 0; transition: opacity .15s ease;
}
.hotbot-dialog-backdrop.open { opacity: 1; }
.hotbot-dialog-panel {
    background: var(--color-surface-elevated); color: var(--color-text);
    border-radius: var(--radius-lg); padding: 20px;
    width: min(360px, 100%); box-shadow: 0 8px 28px rgba(0, 0, 0, .2);
    transform: translateY(-10px); transition: transform .15s ease;
}
.hotbot-dialog-backdrop.open .hotbot-dialog-panel { transform: translateY(0); }
.hotbot-dialog-title { margin: 0 0 8px; font-size: 16px; }
.hotbot-dialog-message { margin: 0 0 14px; font-size: 14px; color: var(--color-text-secondary); white-space: pre-wrap; }
.hotbot-dialog-danger .hotbot-dialog-message { color: var(--color-text); }
.hotbot-dialog-input {
    width: 100%; padding: 8px 10px; margin-bottom: 14px; font: inherit;
    border-radius: var(--radius-sm); border: 1px solid var(--color-input-border);
    background: var(--color-input-background); color: var(--color-input-text);
}
.hotbot-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* Media crop overlay (spec 6.1) */
.media-crop-overlay { cursor: crosshair; background: rgba(0,0,0,.25); z-index: 5; touch-action: none; }
.media-crop-rect {
    position: absolute; display: none; box-sizing: border-box;
    border: 2px dashed #fff; outline: 1px solid rgba(0,0,0,.6);
    background: rgba(255,255,255,.15); pointer-events: none;
}
.media-crop-bar {
    display: flex; align-items: center; gap: 10px; margin-top: 8px;
    font-size: 13px; color: var(--color-text-secondary);
}
.media-crop-bar span { margin-right: auto; }

/* Live-search dropdown (spec 8) -- admin/composer surfaces. */
.cmb-livesearch-results {
    position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 60;
    background: var(--color-surface-elevated, #fff);
    border: 1px solid var(--color-border, #ddd);
    border-radius: var(--radius-sm, 4px);
    box-shadow: 0 6px 20px rgba(0,0,0,.14);
    max-height: 320px; overflow-y: auto;
}
.cmb-livesearch-item { display: flex; flex-direction: column; gap: 2px; padding: 9px 12px; text-decoration: none; color: var(--color-text, #111); }
.cmb-livesearch-item:hover { background: var(--color-surface-muted, #f4f4f4); }
.cmb-livesearch-title { font-size: 13.5px; line-height: 1.4; }
.cmb-livesearch-meta { font-size: 11.5px; color: var(--color-text-muted, #888); }
.cmb-livesearch-empty { padding: 10px 12px; font-size: 13px; color: var(--color-text-muted, #888); }

/* Đợt R: skin sidebar admin (navy) -- chuyển từ admin-list.css để trang
   composer (không load admin-list.css) có sidebar giống hệt /admin. */
/* Navy sidebar; grey working canvas everywhere else (same grey the public
   site uses), instead of the all-white UG look. */
body:has(.admin-page), body:has(.composer-page) { background: #f6f7f9; }

.admin-sidebar {
    background: var(--cm-ink, #000);
    border-right: 0;
}
.admin-sidebar .admin-sidebar-brand,
.admin-sidebar .admin-sidebar-homepage-link,
.admin-sidebar .admin-sidebar-description { color: rgba(255,255,255,.85); }
.admin-sidebar .admin-sidebar-brand { color: #fff; }
.admin-sidebar-nav a { color: rgba(255,255,255,.82); }
.admin-sidebar-nav a:hover { background: rgba(255,255,255,.1); color: #fff; }
.admin-sidebar-nav a.active { background: rgba(255,255,255,.16); color: #fff; }
.admin-sidebar-nav a.admin-sidebar-nav-new {
    background: rgba(255,255,255,.12); color: #fff; border-color: transparent;
}
.admin-sidebar-footer-btn { background: transparent; color: rgba(255,255,255,.8); border-color: rgba(255,255,255,.25); }
/* Đợt AF: hover trên sidebar navy phải sáng chữ chứ không đổ nền sáng
   (nền sáng + chữ trắng nhạt = mất chữ). */
.admin-sidebar .admin-sidebar-footer-btn:hover,
.admin-sidebar-footer .admin-sidebar-footer-btn:hover { background: rgba(255,255,255,.14); color: #fff; }
.admin-sidebar-footer-btn:hover { color: #fff; border-color: rgba(255,255,255,.5); }

/* Đợt T: Ctrl+K quick search cho admin (admin-quick-search.js). */
.admin-qsearch-overlay {
    position: fixed; inset: 0; z-index: 600;
    background: rgba(255, 255, 255, .82);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    display: flex; justify-content: center; align-items: flex-start;
    padding: 14vh 20px 40px;
}
.admin-qsearch-box { width: 100%; max-width: 560px; }
.admin-qsearch-box > input {
    width: 100%; padding: 13px 16px; font-size: 17px; font-family: var(--font-body);
    border: 2px solid var(--cm-ink, #000); border-radius: 8px;
    background: var(--color-surface); color: var(--color-text);
    box-shadow: 0 10px 34px rgba(0, 0, 0, .14);
}
.admin-qsearch-box > input:focus { outline: none; }
.admin-qsearch-results {
    margin-top: 10px; background: var(--color-surface);
    border: 1px solid var(--color-border); border-radius: 8px;
    box-shadow: 0 10px 34px rgba(0, 0, 0, .14);
    max-height: 60vh; overflow-y: auto;
}
.admin-qsearch-results a {
    display: block; padding: 10px 14px; border-bottom: 1px solid var(--color-border);
    text-decoration: none; color: var(--color-text);
}
.admin-qsearch-results a:last-child { border-bottom: 0; }
.admin-qsearch-results a:hover, .admin-qsearch-results a.is-active { background: var(--color-surface-muted, #f2f3f5); }
.admin-qsearch-title { display: block; font-size: 14px; font-weight: 600; line-height: 1.35; }
.admin-qsearch-meta { display: block; font-size: 11.5px; color: var(--color-text-muted); margin-top: 2px; }
.admin-qsearch-kicker { display: block; font-size: 10.5px; font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase; color: var(--color-text-muted); margin-bottom: 2px; }
.admin-qsearch-none { padding: 12px; font-size: 13px; color: var(--color-text-muted); }

/* Đợt V: nhãn loại item trong Ctrl+K + hàng badge lọc theo loại. */
.admin-qsearch-kind {
    display: inline-block; margin-left: 8px; padding: 1px 7px;
    font-size: 10px; font-weight: 600; letter-spacing: .06em;
    text-transform: uppercase; border-radius: 999px;
    background: var(--color-surface); color: var(--color-text-secondary);
    border: 1px solid var(--color-border, rgba(0,0,0,.12));
    vertical-align: 2px; white-space: nowrap;
}
.admin-qsearch-kinds {
    display: flex; flex-wrap: wrap; gap: 6px;
    padding: 10px 14px; border-bottom: 1px solid var(--color-border, rgba(0,0,0,.08));
}
.admin-qsearch-kinds button {
    padding: 3px 11px; font-size: 12px; border-radius: 999px;
    border: 1px solid var(--color-border, rgba(0,0,0,.15));
    background: var(--color-surface, #fff); color: var(--color-text, #222);
    cursor: pointer;
}
.admin-qsearch-kinds button.active {
    background: var(--color-accent, var(--cm-ink, #000)); color: #fff;
    border-color: var(--color-accent, var(--cm-ink, #000));
}

/* Đợt AQ: fade-in khi chuyển trang trong admin + workspace. CHỈ opacity --
   transform/filter trên container biến nó thành containing block và kéo
   sidebar/chuông position:fixed bên trong đi theo (sidebar admin nằm trong
   .admin-page). */
/* Đợt BD item 100: MỘT hiệu ứng chuyển trang duy nhất cho frontend, admin
   và workspace -- cùng tên keyframes, cùng thời lượng, cùng đường cong.
   Chỉ đổi opacity: transform hay filter trên container sẽ biến nó thành
   containing block và kéo theo sidebar/chuông position:fixed bên trong. */
@media (prefers-reduced-motion: no-preference) {
    body:has(.admin-sidebar) .admin-page,
    body:has(.admin-sidebar) .ws-page,
    body:has(.admin-sidebar) .settings-page:not(.profile-panel-content),
    body:has(.composer-page) .composer-page { animation: cmb-page-fade .35s ease-out both; }
}
@keyframes cmb-page-fade { from { opacity: 0; } to { opacity: 1; } }

/* Đợt AZ: avatar thật (emoji/ảnh/chữ cái) thay icon person ở footer sidebar. */
.sidebar-foot-avatar { width: 18px; height: 18px; border-radius: 50%; object-fit: cover; display: inline-flex; align-items: center; justify-content: center; vertical-align: -4px; margin-right: 2px; }
.sidebar-foot-avatar-emoji { font-size: 13px; background: rgba(255,255,255,.18); }
.sidebar-foot-avatar-initial { font-size: 10px; font-weight: 700; color: #fff; }
