/* =========================================================
   OSACI CRM — giao diện sáng, mềm, kiểu iOS
   Nền trắng · sidebar xám nhạt · bo tròn lớn · không viền đậm
   ========================================================= */
:root {
    --bg: #ffffff;
    --bg-soft: #f0f4f9;          /* sidebar, ô nhập, thẻ */
    --bg-soft-2: #e9eef6;        /* hover trên nền soft */
    --surface: #ffffff;
    --ink: #1f1f1f;
    --ink-2: #444746;
    --ink-3: #5f6368;
    --ink-4: #8e918f;
    --line: #e3e7ed;
    --accent: #0b57d0;
    --accent-ink: #041e49;
    --accent-soft: #d3e3fd;
    --accent-soft-2: #c2d7fb;
    --red: #b3261e;      --red-soft: #fce8e6;
    --green: #146c2e;    --green-soft: #e6f4ea;
    --amber: #8a5300;    --amber-soft: #fef3dc;
    --violet: #6b3fc4;   --violet-soft: #efe7fd;
    --grad: linear-gradient(90deg, #4b7bec 0%, #8e6be8 38%, #d6607a 72%, #e5875a 100%);
    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow-pop: 0 2px 6px rgba(60, 64, 67, .10), 0 10px 30px rgba(60, 64, 67, .14);
    --sidebar-w: 280px;
    --rail-w: 72px;
    --topbar-h: 64px;
    --ease: cubic-bezier(.2, .8, .2, 1);
    --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI Variable Display", "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font: 15px/1.55 var(--font);
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: none; }
h1, h2, h3 { margin: 0; line-height: 1.25; font-family: var(--font-display); font-weight: 600; letter-spacing: -.01em; }
h2 { font-size: 22px; }
h3 { font-size: 16px; display: flex; align-items: center; gap: 8px; }
p { margin: 0; }
code { font: 12.5px/1.4 ui-monospace, "SF Mono", Consolas, monospace; background: var(--bg-soft); padding: 3px 8px; border-radius: 8px; color: var(--ink-2); }
.icon { flex: none; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.t-right { text-align: right; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
::selection { background: var(--accent-soft); }

/* =============== Shell =============== */
.shell { min-height: 100vh; }

.sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 40;
    width: var(--sidebar-w);
    display: flex; flex-direction: column;
    background: var(--bg-soft);
    transform: translateX(-100%);
    transition: transform .28s var(--ease), width .28s var(--ease);
}
.shell.nav-open .sidebar { transform: none; box-shadow: var(--shadow-pop); }
.backdrop {
    position: fixed; inset: 0; z-index: 30;
    background: rgba(31, 31, 31, .32);
    opacity: 0; pointer-events: none; transition: opacity .25s;
}
.shell.nav-open .backdrop { opacity: 1; pointer-events: auto; }

.sidebar__top { display: flex; align-items: center; gap: 4px; height: var(--topbar-h); padding: 0 12px; }
.sidebar__close { margin-left: auto; }

.sidebar__new {
    display: flex; align-items: center; gap: 12px;
    margin: 4px 12px 8px; padding: 0 16px; height: 44px; width: max-content;
    border-radius: 999px; background: var(--bg-soft-2); color: var(--ink-2);
    font-weight: 500; font-size: 14px; white-space: nowrap;
    transition: background .2s;
}
.sidebar__new:hover { background: #dde3ea; }

.nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 4px 12px 20px; scrollbar-width: thin; }
.nav__section {
    margin: 18px 16px 6px; font-size: 12.5px; font-weight: 600;
    color: var(--ink-3); white-space: nowrap;
}
.nav__link {
    display: flex; align-items: center; gap: 14px;
    height: 40px; padding: 0 16px; border-radius: 999px;
    color: var(--ink-2); font-size: 14px; white-space: nowrap;
    transition: background .15s;
}
.nav__link span { overflow: hidden; text-overflow: ellipsis; }
.nav__link:hover { background: var(--bg-soft-2); }
.nav__link.is-active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.nav__link.is-soon { color: var(--ink-4); cursor: default; }
.nav__link.is-soon:hover { background: none; }
.nav__link .badge { margin-left: auto; }

.recent { margin-top: 6px; }
.recent__item {
    display: flex; align-items: center; gap: 14px; width: 100%;
    height: 36px; padding: 0 16px; border: 0; border-radius: 999px; background: none;
    font: 14px var(--font); color: var(--ink-2); cursor: pointer; text-align: left;
}
.recent__item:hover { background: var(--bg-soft-2); }
.recent__item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent__empty { padding: 4px 16px; font-size: 13px; color: var(--ink-4); }

.sidebar__foot { padding: 10px 12px 16px; }
.sidebar__foot .nav__link { color: var(--ink-3); }

.main { min-width: 0; transition: margin-left .28s var(--ease); }
.topbar {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; gap: 8px;
    height: var(--topbar-h); padding: 0 12px;
    background: rgba(255, 255, 255, .86);
    backdrop-filter: saturate(1.6) blur(14px);
    -webkit-backdrop-filter: saturate(1.6) blur(14px);
}
.topbar__brand { display: flex; align-items: center; gap: 8px; font-size: 19px; font-weight: 500; color: var(--ink-2); font-family: var(--font-display); white-space: nowrap; }
.topbar__brand small { font-size: 12px; font-weight: 600; color: var(--accent); background: var(--accent-soft); padding: 2px 8px; border-radius: 999px; }
.topbar__title { font-size: 19px; font-weight: 500; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--font-display); }
.topbar__right { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.content { padding: 8px 16px 48px; max-width: 1200px; margin: 0 auto; }
.content--home { max-width: 860px; }

.icon-btn {
    display: inline-grid; place-items: center;
    width: 44px; height: 44px; border: 0; border-radius: 50%;
    background: transparent; color: var(--ink-2); cursor: pointer;
    transition: background .15s;
}
.icon-btn:hover { background: rgba(68, 71, 70, .08); }

.brand-mark {
    display: inline-grid; place-items: center;
    width: 30px; height: 30px; border-radius: 10px;
    background: var(--grad); color: #fff; font-weight: 700; font-size: 15px;
}
.brand-mark--lg { width: 48px; height: 48px; border-radius: 16px; font-size: 22px; }

/* Desktop: sidebar luôn hiện, thu gọn thành rail */
@media (min-width: 1024px) {
    .sidebar { transform: none; }
    .backdrop, .sidebar__close, .topbar__menu { display: none; }
    .main { margin-left: var(--sidebar-w); }
    .topbar { padding: 0 20px; }
    .content { padding: 8px 32px 56px; }

    .shell.is-collapsed .sidebar { width: var(--rail-w); }
    .shell.is-collapsed .main { margin-left: var(--rail-w); }
    .shell.is-collapsed .nav__link,
    .shell.is-collapsed .recent__item { width: 48px; padding: 0 14px; }
    .shell.is-collapsed .nav__link span,
    .shell.is-collapsed .nav__link .badge,
    .shell.is-collapsed .nav__section,
    .shell.is-collapsed .recent,
    .shell.is-collapsed .sidebar__new span { display: none; }
    .shell.is-collapsed .sidebar__new { width: 44px; padding: 0 12px; }
    .shell.is-collapsed .nav { overflow-y: auto; }
}
@media (max-width: 1023px) { .sidebar__toggle { display: none; } }

/* user menu */
.usermenu { position: relative; }
.usermenu summary { list-style: none; cursor: pointer; border-radius: 50%; padding: 4px; display: block; }
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu summary:hover { background: rgba(68, 71, 70, .08); }
.usermenu__panel {
    position: absolute; right: 0; top: calc(100% + 6px); width: 300px;
    background: var(--bg-soft); border-radius: var(--radius-xl);
    box-shadow: var(--shadow-pop); padding: 8px; z-index: 50;
    animation: pop .18s var(--ease);
}
.usermenu__head { display: grid; justify-items: center; gap: 4px; padding: 18px 12px 16px; text-align: center; }
.usermenu__head strong { font-size: 18px; font-weight: 500; margin-top: 6px; }
.usermenu__head small { color: var(--ink-3); }
.usermenu__group { background: var(--surface); border-radius: var(--radius-lg); overflow: hidden; }
.usermenu__panel a, .usermenu__panel button {
    display: flex; align-items: center; gap: 12px; width: 100%;
    padding: 14px 18px; border: 0; background: none;
    font: 14px var(--font); color: var(--ink); cursor: pointer; text-align: left;
}
.usermenu__group > * + * { border-top: 1px solid var(--bg-soft); }
.usermenu__panel a:hover, .usermenu__panel button:hover { background: #f7f9fc; }
.usermenu__panel form { margin: 0; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }

/* =============== Avatar / person =============== */
.avatar {
    display: inline-grid; place-items: center; flex: none;
    width: 40px; height: 40px; border-radius: 50%;
    background: linear-gradient(135deg, #e8f0fe, #f3e8fd); color: var(--accent-ink);
    font-weight: 600; font-size: 15px;
}
.avatar--sm { width: 34px; height: 34px; font-size: 14px; background: var(--grad); color: #fff; }
.avatar--lg { width: 64px; height: 64px; font-size: 26px; }
.avatar--xl { width: 80px; height: 80px; font-size: 32px; background: var(--grad); color: #fff; }
.person { display: flex; align-items: center; gap: 12px; min-width: 0; }
.person strong { display: block; font-weight: 600; }
.person small { display: block; color: var(--ink-3); font-size: 13px; }
.person--lg strong { font-size: 18px; }

/* =============== Home: quầng sáng xanh + ô nhập nổi =============== */
.page-home { background: #f8f9fb; }
.page-home .topbar { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
.page-home .content { position: relative; z-index: 1; }

.glow { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.glow__blob { position: absolute; border-radius: 50%; filter: blur(60px); opacity: 1; will-change: transform; }
.glow__blob--a {
    width: 72vw; height: 58vh; left: 50%; top: 46%;
    background: radial-gradient(closest-side, rgba(96, 165, 250, .62), rgba(147, 197, 253, .55) 45%, rgba(191, 219, 254, .25) 75%, transparent);
    transform: translate(-50%, -30%);
    animation: glow-a 14s ease-in-out infinite alternate;
}
.glow__blob--b {
    width: 40vw; height: 36vh; left: 62%; top: 26%;
    background: radial-gradient(closest-side, rgba(129, 140, 248, .38), transparent);
    animation: glow-b 18s ease-in-out infinite alternate;
}
.glow__blob--c {
    width: 34vw; height: 30vh; left: 22%; top: 18%;
    background: radial-gradient(closest-side, rgba(125, 211, 252, .45), transparent);
    animation: glow-c 16s ease-in-out infinite alternate;
}
@keyframes glow-a { to { transform: translate(-46%, -24%) scale(1.08); } }
@keyframes glow-b { to { transform: translate(-6vw, 6vh) scale(1.12); } }
@keyframes glow-c { to { transform: translate(5vw, 4vh) scale(.92); } }
@media (max-width: 760px) {
    .glow__blob--a { width: 150vw; height: 52vh; top: 44%; }
    .glow__blob--b { width: 90vw; height: 34vh; left: 40%; top: 20%; }
    .glow__blob--c { width: 80vw; height: 30vh; left: -10%; top: 30%; }
}
@media (min-width: 1024px) { .page-home .glow { left: var(--sidebar-w); } .page-home .shell.is-collapsed .glow { left: var(--rail-w); } }

.hero {
    position: relative;
    min-height: calc(100vh - var(--topbar-h) - 8px);
    min-height: calc(100dvh - var(--topbar-h) - 8px);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 0 0 12vh; text-align: center;
}
.hero__hello {
    font: 500 18px/1.3 var(--font-display);
    background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
    margin-bottom: 10px; animation: rise .6s var(--ease) both;
}
.hero__title {
    font: 400 clamp(28px, 4.4vw, 42px)/1.2 var(--font-display);
    letter-spacing: -.02em; color: var(--ink); margin: 0 0 36px;
    animation: rise .6s .05s var(--ease) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

.ask { position: relative; z-index: 5; width: 100%; max-width: 820px; text-align: left; animation: rise .6s .1s var(--ease) both; }
.ask__box {
    display: flex; align-items: center; gap: 2px;
    height: 72px; padding: 0 12px 0 10px;
    background: rgba(255, 255, 255, .96); border-radius: 36px;
    box-shadow: 0 1px 2px rgba(60, 64, 67, .08), 0 6px 24px rgba(60, 64, 67, .10);
    transition: box-shadow .25s var(--ease), transform .25s var(--ease);
}
.ask__box:focus-within { box-shadow: 0 1px 2px rgba(60, 64, 67, .08), 0 10px 36px rgba(37, 99, 235, .16); }
.ask__btn {
    display: grid; place-items: center; width: 48px; height: 48px; border: 0; border-radius: 50%;
    background: transparent; color: var(--ink); cursor: pointer; transition: background .15s, color .15s;
}
.ask__btn:hover, .ask__btn[aria-expanded="true"] { background: rgba(31, 31, 31, .06); }
.ask__input {
    flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent;
    font: 18px/1.4 var(--font); color: var(--ink); padding: 0 8px;
}
.ask__input::placeholder { color: #80868b; }
.ask__input::-webkit-search-cancel-button { display: none; }
.ask__scope {
    display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px 0 16px;
    border: 0; border-radius: 999px; background: transparent; color: var(--ink);
    font: 500 15px var(--font); cursor: pointer; white-space: nowrap;
}
.ask__scope:hover, .ask__scope[aria-expanded="true"] { background: rgba(31, 31, 31, .06); }
.ask__mic.is-listening { color: #fff; background: #e5484d; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(229, 72, 77, .45); } 50% { box-shadow: 0 0 0 10px rgba(229, 72, 77, 0); } }
.ask__send {
    display: none; place-items: center; width: 48px; height: 48px; border: 0; border-radius: 50%;
    background: var(--accent); color: #fff; cursor: pointer; margin-left: 4px;
    animation: pop .2s var(--ease);
}
.ask.is-typing .ask__send { display: grid; }
.ask.is-typing .ask__mic { display: none; }
@media (max-width: 640px) {
    .ask__box { height: 60px; border-radius: 30px; padding: 0 8px 0 6px; }
    .ask__input { font-size: 16px; }
    .ask__scope { padding: 0 6px 0 10px; font-size: 14px; }
    .ask__scope span { display: none; }
    .ask__btn, .ask__send { width: 44px; height: 44px; }
}

/* popover dùng chung */
.pop-wrap { position: relative; }
.pop {
    position: absolute; top: calc(100% + 10px); z-index: 30; min-width: 240px;
    background: #fff; border-radius: 20px; padding: 8px;
    box-shadow: 0 2px 6px rgba(60, 64, 67, .12), 0 12px 40px rgba(60, 64, 67, .16);
    animation: pop .16s var(--ease);
}
.pop[hidden] { display: none; }
.pop--left { left: -4px; }
.pop--right { right: -4px; min-width: 280px; }
.pop a, .pop button {
    display: flex; align-items: center; gap: 14px; width: 100%;
    padding: 11px 14px; border: 0; border-radius: 12px; background: none;
    font: 14.5px var(--font); color: var(--ink); text-align: left; cursor: pointer;
}
.pop a:hover, .pop button:hover { background: var(--bg-soft); }
.pop .icon { color: var(--ink-2); }
.pop__title { padding: 8px 14px 4px; font-size: 13px; color: var(--ink-3); }
.pop button span { flex: 1; display: grid; }
.pop button b { font-weight: 500; }
.pop button small { color: var(--ink-3); font-size: 12.5px; }
.pop__check { visibility: hidden; color: var(--accent) !important; }
.pop [aria-checked="true"] .pop__check { visibility: visible; }

/* kết quả tìm kiếm: thẻ nổi tách khỏi ô nhập */
.ask__results {
    position: absolute; left: 0; right: 0; top: calc(100% + 10px); z-index: 25;
    background: rgba(255, 255, 255, .98); border-radius: 26px;
    box-shadow: 0 2px 6px rgba(60, 64, 67, .10), 0 16px 48px rgba(60, 64, 67, .16);
    max-height: min(58vh, 520px); overflow-y: auto; padding: 8px;
    animation: pop .18s var(--ease);
}
.ask__results[hidden] { display: none; }
.ask__group { padding: 10px 14px 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-3); }
.ask__group + .ask__item { margin-top: 0; }
.ask__item + .ask__group { border-top: 1px solid #eef1f5; margin-top: 6px; padding-top: 14px; }
.ask__item { display: flex; align-items: center; gap: 14px; padding: 10px 14px; border-radius: 16px; color: var(--ink); }
.ask__item:hover, .ask__item.is-active { background: var(--bg-soft); }
.ask__item-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--bg-soft); color: var(--accent); flex: none; }
.ask__item:hover .ask__item-icon, .ask__item.is-active .ask__item-icon { background: var(--accent-soft); }
.ask__item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.ask__item-title { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ask__item-meta { display: block; font-size: 13px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ask__item-value { font-size: 14px; font-weight: 600; color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ask__item-ext { color: var(--ink-4); }
@media (max-width: 560px) { .ask__item { padding: 10px; gap: 12px; } .ask__item-ext { display: none; } .ask__item-value { font-size: 13px; } }
.ask__empty, .ask__loading { padding: 18px 16px; color: var(--ink-3); font-size: 14px; }
.ask__loading::after { content: ""; display: inline-block; width: 14px; height: 14px; margin-left: 8px; vertical-align: -2px; border: 2px solid var(--accent-soft); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.hero__chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 22px; animation: rise .6s .15s var(--ease) both; }
.chip {
    display: inline-flex; align-items: center; gap: 8px;
    height: 38px; padding: 0 16px; border-radius: 999px;
    background: var(--surface); border: 1px solid #dadce0; color: var(--ink-2);
    font: 14px var(--font); white-space: nowrap;
}
.chip--glass { background: rgba(255, 255, 255, .6); border-color: rgba(255, 255, 255, .8); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.chip .icon { color: var(--accent); }
.chip b { color: var(--ink); font-weight: 600; }

.hero__more {
    position: absolute; bottom: 3vh; left: 50%; transform: translateX(-50%);
    display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
    color: var(--ink-3); background: rgba(255, 255, 255, .6); backdrop-filter: blur(8px);
    animation: bob 2.4s ease-in-out infinite;
}
.hero__more:hover { color: var(--ink); background: #fff; }
@keyframes bob { 50% { transform: translate(-50%, 4px); } }

.overview { padding-bottom: 24px; scroll-margin-top: var(--topbar-h); }
.card--glass { background: rgba(255, 255, 255, .8); border-color: rgba(255, 255, 255, .9); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.page-home .stat { background: rgba(255, 255, 255, .72); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.page-home .stat__icon { background: var(--bg-soft); }
.section-title { font-size: 15px; font-weight: 600; color: var(--ink-2); margin: 8px 4px 12px; }
html { scroll-behavior: smooth; }

/* =============== Stats =============== */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 760px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stat {
    display: flex; flex-direction: column; gap: 14px;
    background: var(--bg-soft); border-radius: var(--radius-lg); padding: 16px 18px;
}
.stat__icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; flex: none; background: var(--surface); }
.stat__icon--green { color: var(--green); }
.stat__icon--blue { color: var(--accent); }
.stat__icon--amber { color: var(--amber); }
.stat__icon--violet { color: var(--violet); }
.stat__label { font-size: 13px; color: var(--ink-3); }
.stat__value { white-space: nowrap; font: 600 26px/1.2 var(--font-display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: 2px; }

/* =============== Cards =============== */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px; }
.card + .card, .stats + .card { margin-top: 16px; }
.card--soft { background: var(--bg-soft); border-color: transparent; }
.card--soft h3 { margin-bottom: 6px; }
.card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.card__head .muted { font-size: 13px; margin-top: 2px; }
.stack { display: grid; gap: 16px; align-content: start; }
.grid-2 { display: grid; gap: 16px; }
.grid-2 > .card + .card { margin-top: 0; }
@media (min-width: 960px) { .grid-2 { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; } }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 8px 4px 20px; flex-wrap: wrap; }
.page-head h2 { font-size: 28px; font-weight: 500; letter-spacing: -.02em; }
.page-head p { color: var(--ink-3); margin-top: 4px; }

/* chart */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 200px; padding-top: 18px; }
.bars__col { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; }
.bars__bar { width: 100%; max-width: 30px; border-radius: 8px; background: var(--accent-soft); transition: background .15s; }
.bars__bar.is-today { background: var(--accent); }
.bars__col:hover .bars__bar { background: var(--accent-soft-2); }
.bars__col:hover .bars__bar.is-today { background: #0842a0; }
.bars__val { font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; min-height: 14px; }
.bars__label { font-size: 11px; color: var(--ink-4); white-space: nowrap; }
@media (max-width: 560px) { .bars__col:nth-child(odd) .bars__label { visibility: hidden; } .bars__val { display: none; } .bars { gap: 3px; } }

/* =============== Buttons =============== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 40px; padding: 0 20px;
    border: 0; border-radius: 999px;
    background: var(--bg-soft); color: var(--accent);
    font: 500 14px/1 var(--font); cursor: pointer; white-space: nowrap;
    transition: background .15s, box-shadow .15s, transform .08s;
}
.btn:hover { background: var(--bg-soft-2); }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .55; cursor: progress; }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: #0842a0; box-shadow: 0 1px 3px rgba(11, 87, 208, .3); }
.btn--tonal { background: var(--accent-soft); color: var(--accent-ink); }
.btn--tonal:hover { background: var(--accent-soft-2); }
.btn--ghost { background: transparent; color: var(--accent); }
.btn--ghost:hover { background: rgba(11, 87, 208, .07); }
.btn--danger { color: var(--red); }
.btn--danger:hover { background: var(--red-soft); }
.btn--sm { height: 34px; padding: 0 14px; font-size: 13px; }
.btn--lg { height: 52px; font-size: 15px; }
.btn--block { width: 100%; }

/* =============== Forms =============== */
.form { display: grid; gap: 16px; }
.form-grid { display: grid; gap: 16px; }
@media (min-width: 640px) { .form-grid { grid-template-columns: 1fr 1fr; } .span-2 { grid-column: span 2; } }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 4px; flex-wrap: wrap; }
.field { display: grid; gap: 6px; }
.field__label { font-size: 13px; font-weight: 500; color: var(--ink-2); padding-left: 4px; }
.req { color: var(--red); }
.field__hint { font-size: 12.5px; color: var(--ink-3); padding-left: 4px; }
.field__error { font-size: 12.5px; color: var(--red); font-weight: 500; padding-left: 4px; }
.input {
    width: 100%; min-height: 48px; padding: 12px 16px;
    border: 1.5px solid transparent; border-radius: var(--radius);
    background: var(--bg-soft); color: var(--ink);
    font: 15px/1.4 var(--font);
    transition: background .15s, border-color .15s, box-shadow .15s;
}
.input:hover { background: var(--bg-soft-2); }
textarea.input { resize: vertical; min-height: 92px; }
select.input { appearance: none; padding-right: 40px; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235f6368' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center; }
.input:focus { outline: none; background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 4px rgba(11, 87, 208, .10); }
.input:disabled { color: var(--ink-4); cursor: not-allowed; }
.has-error .input { background: var(--red-soft); border-color: transparent; }
.has-error .input:focus { border-color: var(--red); box-shadow: 0 0 0 4px rgba(179, 38, 30, .10); }
.input-wrap { position: relative; display: block; }
.input-wrap .input { padding-right: 52px; }
.input-wrap__btn {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    display: grid; place-items: center; width: 40px; height: 40px; border: 0; background: none; color: var(--ink-3); cursor: pointer; border-radius: 50%;
}
.input-wrap__btn:hover { background: rgba(68, 71, 70, .08); }
.check { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--ink-2); cursor: pointer; padding-left: 2px; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }

/* =============== Toolbar / filters =============== */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; flex: 1; min-width: 0; }
.filters .input { width: auto; flex: 1 1 160px; min-height: 44px; padding-top: 10px; padding-bottom: 10px; border-radius: 999px; }
.search { position: relative; flex: 2 1 260px; display: block; }
.search .icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.search .input { padding-left: 46px; width: 100%; }
.toolbar > .btn { flex: none; height: 44px; }
@media (max-width: 640px) { .toolbar > .btn { width: 100%; } }
.back-link { display: inline-flex; align-items: center; gap: 4px; margin: 0 0 14px; padding: 6px 12px 6px 6px; border-radius: 999px; font-size: 14px; color: var(--ink-2); }
.back-link:hover { background: var(--bg-soft); }

/* =============== Table =============== */
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 14px 18px; text-align: left; vertical-align: middle; }
.table th { font-size: 12.5px; font-weight: 600; color: var(--ink-3); background: transparent; border-bottom: 1px solid var(--line); }
.table td { border-bottom: 1px solid #eef1f5; font-size: 14px; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: #f8fafd; }
.table tr.is-muted td { color: var(--ink-4); }
.table th.t-right, .table td.t-right { text-align: right; }
.row-actions { display: inline-flex; gap: 2px; flex-wrap: wrap; justify-content: flex-end; }
.row-actions form { margin: 0; }
.ua { display: inline-block; max-width: 300px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }

@media (max-width: 760px) {
    .table-wrap { background: none; border: 0; border-radius: 0; }
    .table--cards thead { display: none; }
    .table--cards, .table--cards tbody, .table--cards tr, .table--cards td { display: block; width: 100%; }
    .table--cards tr { background: var(--bg-soft); border-radius: var(--radius-lg); padding: 8px 6px; margin-bottom: 10px; }
    .table--cards tbody tr:hover { background: var(--bg-soft); }
    .table--cards td { border: 0; padding: 7px 12px; display: flex; gap: 12px; justify-content: space-between; align-items: center; text-align: right; }
    .table--cards td::before { content: attr(data-label); font-size: 12.5px; font-weight: 500; color: var(--ink-3); text-align: left; flex: none; }
    .table--cards td[data-label=""]::before, .table--cards td:first-child::before { display: none; }
    .table--cards td:first-child { text-align: left; padding-bottom: 10px; }
    .table--cards td.t-right { justify-content: flex-end; padding-top: 6px; }
    .ua { max-width: 55vw; }
}

/* =============== Badges / alerts / toasts =============== */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; font-style: normal; white-space: nowrap; }
.badge--green { background: var(--green-soft); color: var(--green); }
.badge--red { background: var(--red-soft); color: var(--red); }
.badge--amber { background: var(--amber-soft); color: var(--amber); }
.badge--blue { background: var(--accent-soft); color: var(--accent-ink); }
.badge--muted { background: transparent; color: var(--ink-4); font-size: 11px; padding: 2px 0; }
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius); font-size: 14px; margin-bottom: 16px; }
.alert .icon { margin-top: 1px; }
.alert--error { background: var(--red-soft); color: #8c1d18; }
.alert--success { background: var(--green-soft); color: #0d5224; }

.toasts { position: fixed; z-index: 60; left: 50%; transform: translateX(-50%); bottom: 24px; display: grid; gap: 8px; width: min(440px, calc(100% - 24px)); }
.toast {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 20px; border-radius: 16px;
    background: #303030; color: #f2f2f2; font-size: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
    animation: toast-in .3s var(--ease);
}
.toast--success .icon { color: #8fdca6; }
.toast--error .icon { color: #f2b8b5; }
.toast.is-leaving { opacity: 0; transform: translateY(8px); transition: all .25s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } }

.empty { display: grid; justify-items: center; gap: 10px; padding: 56px 16px; color: var(--ink-3); text-align: center; background: var(--bg-soft); border-radius: var(--radius-lg); }

.pager { display: flex; justify-content: center; gap: 4px; margin-top: 20px; flex-wrap: wrap; }
.pager a, .pager span { display: inline-grid; place-items: center; min-width: 40px; height: 40px; padding: 0 10px; border-radius: 999px; font-size: 14px; font-weight: 500; color: var(--ink-2); }
.pager a:hover { background: var(--bg-soft); }
.pager .is-current { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.pager .is-disabled { opacity: .35; }
.pager .gap { min-width: 20px; }

.meta { margin: 18px 0 0; display: grid; background: var(--bg-soft); border-radius: var(--radius); padding: 4px 16px; }
.meta div { display: flex; justify-content: space-between; padding: 11px 0; font-size: 14px; }
.meta div + div { border-top: 1px solid #e1e6ee; }
.meta dt { color: var(--ink-3); }
.meta dd { margin: 0; font-weight: 500; }

/* =============== Auth =============== */
.auth-body {
    background:
        radial-gradient(900px 520px at 8% -10%, rgba(75, 123, 236, .14), transparent 60%),
        radial-gradient(800px 560px at 105% 110%, rgba(214, 96, 122, .12), transparent 60%),
        #fff;
}
.auth { min-height: 100vh; display: grid; place-items: center; padding: 32px 18px; }
.auth__panel {
    width: 100%; max-width: 440px; padding: 40px 32px 32px;
    background: rgba(255, 255, 255, .78);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-radius: 32px;
    box-shadow: 0 1px 2px rgba(60, 64, 67, .06), 0 20px 60px rgba(60, 64, 67, .12);
}
@media (max-width: 480px) { .auth__panel { padding: 32px 20px 24px; border-radius: 28px; box-shadow: none; background: transparent; backdrop-filter: none; } }
.auth__brand { display: flex; justify-content: center; margin-bottom: 20px; }
.auth__title { text-align: center; font: 500 30px/1.2 var(--font-display); letter-spacing: -.02em; }
.auth__title span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth__sub { text-align: center; color: var(--ink-3); margin: 8px 0 28px; }
.auth__note { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 20px; font-size: 13px; color: var(--ink-3); }
.auth__art { display: none; }

.error-page { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 12px; text-align: center; padding: 24px; }
.error-page__code { font: 600 80px/1 var(--font-display); letter-spacing: -.04em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.error-page h1 { font-size: 22px; font-weight: 500; }
.error-page .btn { margin-top: 12px; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* =========================================================
   Quy trình chung (Tư liệu công ty)
   ========================================================= */
.tone-blue   { --tone: #0b57d0; --tone-soft: #e8f0fe; }
.tone-green  { --tone: #137333; --tone-soft: #e6f4ea; }
.tone-violet { --tone: #6b3fc4; --tone-soft: #f1eafd; }
.eyebrow { font-size: 13px; font-weight: 600; color: var(--accent); letter-spacing: .02em; margin-bottom: 4px; }
.icon-btn--sm { width: 34px; height: 34px; }
.hint-line { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-4); margin: 0 4px 10px; }

.kb-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 12px 4px 20px; }
.kb-hero h2 { font: 500 34px/1.15 var(--font-display); letter-spacing: -.025em; }
.kb-hero .muted { margin-top: 6px; max-width: 620px; }

/* ô tìm */
.kb-search {
    position: relative; z-index: 6; display: flex; align-items: center; gap: 10px;
    height: 60px; padding: 0 16px 0 20px; margin-bottom: 18px;
    background: var(--bg-soft); border-radius: 30px; transition: background .2s, box-shadow .2s;
}
.kb-search > .icon { color: var(--ink-3); }
.kb-search:focus-within { background: #fff; box-shadow: 0 1px 2px rgba(60,64,67,.08), 0 8px 28px rgba(60,64,67,.12); }
.kb-search__input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; font: 16.5px var(--font); color: var(--ink); }
.kb-search__input::-webkit-search-cancel-button { display: none; }
.kb-search__results {
    position: absolute; left: 0; right: 0; top: calc(100% + 8px); max-height: 60vh; overflow: auto;
    background: #fff; border-radius: 24px; padding: 8px; box-shadow: 0 2px 6px rgba(60,64,67,.1), 0 16px 48px rgba(60,64,67,.16);
    animation: pop .16s var(--ease);
}
.kb-search__results[hidden] { display: none; }
.kb-hit { display: grid; gap: 2px; padding: 12px 16px; border-radius: 16px; color: var(--ink); }
.kb-hit:hover, .kb-hit.is-active { background: var(--bg-soft); }
.kb-hit__cat { font-size: 12px; color: var(--ink-3); }
.kb-hit__title { font-weight: 600; }
.kb-hit__snip { font-size: 13.5px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kb-hit-all { display: block; width: 100%; margin-top: 4px; padding: 12px; border: 0; border-top: 1px solid #eef1f5; background: none; color: var(--accent); font: 500 14px var(--font); cursor: pointer; border-radius: 0 0 16px 16px; }
mark { background: #fde68a; color: inherit; border-radius: 3px; padding: 0 1px; }

/* thanh chọn loại kiểu iOS */
.segmented { display: inline-flex; gap: 2px; padding: 4px; margin: 0 0 18px; background: var(--bg-soft); border-radius: 14px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.segmented__item { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 10px; color: var(--ink-2); font-size: 14px; font-weight: 500; white-space: nowrap; transition: background .15s, box-shadow .15s; }
.segmented__item span { font-size: 12px; color: var(--ink-4); font-weight: 600; }
.segmented__item:hover { color: var(--ink); }
.segmented__item.is-active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(60,64,67,.16); }

/* lưới danh mục */
.kb-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.kb-card {
    position: relative; display: flex; flex-direction: column; gap: 12px; min-height: 168px;
    padding: 18px; border-radius: 22px; background: #fff; border: 1px solid var(--line);
    transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s;
}
.kb-card:hover { transform: translateY(-2px); border-color: transparent; box-shadow: 0 2px 6px rgba(60,64,67,.08), 0 12px 32px rgba(60,64,67,.12); }
.kb-card__link { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.kb-card__top { display: flex; align-items: flex-start; justify-content: space-between; }
.kb-card__icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 16px; background: var(--tone-soft); color: var(--tone); }
.kb-card__tools { position: relative; z-index: 2; display: flex; align-items: center; gap: 2px; opacity: .55; transition: opacity .15s; }
.kb-card:hover .kb-card__tools, .kb-card__tools:focus-within { opacity: 1; }
.kb-card__title { font: 600 17px/1.35 var(--font-display); letter-spacing: -.01em; flex: 1; }
.kb-card__meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--ink-3); }
.kb-chip { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; background: var(--tone-soft, var(--bg-soft)); color: var(--tone, var(--ink-2)); font-size: 12px; font-weight: 600; }
.drag-handle { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; color: var(--ink-4); cursor: grab; }
.drag-handle:hover { background: var(--bg-soft); color: var(--ink-2); }
.is-dragging { opacity: .45; }
.pop .is-danger { color: var(--red); }
.pop .is-danger .icon { color: var(--red); }
.pop form { margin: 0; }

/* kết quả tìm */
.kb-results__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 4px 4px 12px; }
.kb-results__head h3 { font-size: 16px; font-weight: 600; }
.hit-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.hit { display: flex; align-items: flex-start; gap: 14px; padding: 16px 18px; border-radius: 20px; background: #fff; border: 1px solid var(--line); color: var(--ink); transition: box-shadow .2s, border-color .2s; }
.hit:hover { border-color: transparent; box-shadow: 0 2px 6px rgba(60,64,67,.08), 0 10px 28px rgba(60,64,67,.10); }
.hit__icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 13px; background: var(--tone-soft); color: var(--tone); flex: none; }
.hit__body { flex: 1; min-width: 0; display: grid; gap: 3px; }
.hit__cat { font-size: 12.5px; color: var(--ink-3); }
.hit__title { font-weight: 600; font-size: 15.5px; }
.hit__snippet { font-size: 14px; color: var(--ink-2); line-height: 1.6; }
.hit__go { color: var(--ink-4); margin-top: 10px; }

/* breadcrumb + chuyển danh mục */
.crumbs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 6px 0 16px; font-size: 14px; color: var(--ink-4); }
.crumbs > a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; color: var(--ink-2); }
.crumbs > a:hover { background: var(--bg-soft); }
.cat-switch__btn { display: inline-flex; align-items: center; gap: 6px; max-width: 70vw; padding: 6px 10px 6px 12px; border: 0; border-radius: 999px; background: var(--bg-soft); color: var(--ink); font: 600 14px var(--font); cursor: pointer; }
.cat-switch__btn:hover, .cat-switch__btn[aria-expanded="true"] { background: var(--bg-soft-2); }
.cat-switch__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-switch__menu { min-width: 320px; max-height: 60vh; overflow: auto; }
.cat-switch__menu a { gap: 12px; }
.cat-switch__menu a span:not(.mini-icon) { flex: 1; }
.cat-switch__menu a small { color: var(--ink-4); }
.cat-switch__menu a.is-current { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.mini-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: var(--tone-soft); color: var(--tone) !important; flex: none; }
.mini-icon .icon { color: var(--tone) !important; }

/* bố cục đọc: mục lục + tài liệu */
.reader { display: grid; gap: 20px; align-items: start; }
@media (min-width: 901px) { .reader { grid-template-columns: 300px minmax(0, 1fr); gap: 28px; } }
.toc { position: sticky; top: calc(var(--topbar-h) + 8px); }
@media (max-width: 900px) { .toc { position: static; } }
.toc__box { background: var(--bg-soft); border-radius: 22px; padding: 8px; }
.toc__head { display: flex; align-items: center; gap: 10px; padding: 8px 10px; list-style: none; cursor: pointer; border-radius: 14px; }
.toc__head::-webkit-details-marker { display: none; }
.toc__icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: #fff; color: var(--tone); }
.toc__title { flex: 1; font-weight: 600; font-size: 14px; color: var(--ink-2); }
.toc__chev { color: var(--ink-3); transition: transform .2s; }
.toc__box:not([open]) .toc__chev { transform: rotate(-90deg); }
@media (min-width: 901px) { .toc__chev { display: none; } .toc__head { cursor: default; pointer-events: none; } }
.toc__filter { display: flex; align-items: center; gap: 8px; height: 40px; margin: 4px 4px 6px; padding: 0 12px; background: #fff; border-radius: 12px; color: var(--ink-3); }
.toc__filter input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: 14px var(--font); color: var(--ink); }
.toc__list { list-style: none; margin: 0; padding: 0; max-height: calc(100vh - 260px); overflow-y: auto; scrollbar-width: thin; }
@media (max-width: 900px) { .toc__list { max-height: none; } }
.toc__list li { position: relative; display: flex; align-items: center; }
.toc__list li .drag-handle { position: absolute; right: 4px; opacity: 0; }
.toc__list li:hover .drag-handle { opacity: 1; }
.toc__item { flex: 1; display: flex; align-items: flex-start; gap: 12px; padding: 10px 36px 10px 12px; border-radius: 14px; color: var(--ink-2); font-size: 14px; line-height: 1.4; }
.toc__item:hover { background: rgba(255,255,255,.7); }
.toc__item.is-active { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(60,64,67,.12); }
.toc__num { font: 600 12px/1.6 ui-monospace, "SF Mono", Consolas, monospace; color: var(--ink-4); flex: none; }
.toc__item.is-active .toc__num { color: var(--accent); }
.toc__add { display: flex; align-items: center; gap: 10px; margin-top: 4px; padding: 10px 12px; border-radius: 14px; color: var(--accent); font-size: 14px; font-weight: 500; }
.toc__add:hover { background: rgba(255,255,255,.7); }

.doc { min-width: 0; background: #fff; border: 1px solid var(--line); border-radius: 26px; padding: clamp(20px, 4vw, 44px) clamp(18px, 5vw, 56px); }
.doc__head { padding-bottom: 20px; margin-bottom: 24px; border-bottom: 1px solid #eef1f5; }
.doc__kicker { margin-bottom: 10px; }
.doc__title { font: 600 clamp(24px, 3.2vw, 32px)/1.25 var(--font-display); letter-spacing: -.02em; }
.doc__meta { display: flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 13.5px; color: var(--ink-3); }
.doc__actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.doc__actions form { margin: 0; }
.btn.is-done { background: var(--green-soft); color: var(--green); }

/* typography nội dung */
.prose { font-size: 16px; line-height: 1.75; color: #262a2e; overflow-wrap: anywhere; }
.prose > :first-child { margin-top: 0; }
.prose p { margin: 0 0 .9em; }
.prose h1, .prose h2 { font: 600 22px/1.35 var(--font-display); margin: 1.6em 0 .6em; letter-spacing: -.01em; }
.prose h3 { font: 600 18px/1.4 var(--font-display); margin: 1.4em 0 .5em; display: block; }
.prose h4, .prose h5, .prose h6 { font-size: 16px; font-weight: 600; margin: 1.2em 0 .4em; }
.prose ul, .prose ol { margin: 0 0 1em; padding-left: 1.4em; }
.prose li { margin: .3em 0; padding-left: .2em; }
.prose li::marker { color: var(--accent); font-weight: 600; }
.prose blockquote { margin: 1.2em 0; padding: 14px 18px; border-radius: 16px; background: #fff8e1; border-left: 4px solid #f9ab00; color: #3c2f00; }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.prose img { max-width: 100%; height: auto; border-radius: 14px; margin: .4em 0; }
.prose audio { width: 100%; max-width: 480px; margin: .3em 0; }
.prose video, .prose iframe { width: 100%; max-width: 720px; aspect-ratio: 16 / 9; height: auto; border: 0; border-radius: 14px; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 1em 0; font-size: 14.5px; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; vertical-align: top; }
.prose th { background: var(--bg-soft); font-weight: 600; }
.prose strong, .prose b { font-weight: 650; color: var(--ink); }
.prose--sm { font-size: 15px; line-height: 1.65; }

.pager-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 40px; padding-top: 24px; border-top: 1px solid #eef1f5; }
.pager-card { display: grid; gap: 4px; padding: 14px 18px; border-radius: 18px; border: 1px solid var(--line); color: var(--ink); }
.pager-card:hover { background: var(--bg-soft); border-color: transparent; }
.pager-card small { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-3); font-size: 12.5px; }
.pager-card span { font-weight: 600; font-size: 14.5px; }
.pager-card--next { text-align: right; grid-column: 2; }
.pager-card--next small { justify-content: flex-end; }
@media (max-width: 560px) { .pager-cards { grid-template-columns: 1fr; } .pager-card--next { grid-column: 1; } }

/* mẫu trả lời */
.answers-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 0 4px 18px; }
.answers-head h2 { font: 500 28px/1.2 var(--font-display); letter-spacing: -.02em; }
.answers-head .muted { margin-top: 4px; }
.answers-head__tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.answers-filter { margin: 0; width: 320px; max-width: 100%; height: 44px; background: var(--bg-soft); border-radius: 999px; padding: 0 16px; }
.answers { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); align-items: start; }
@media (max-width: 420px) { .answers { grid-template-columns: 1fr; } }
.answer { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 22px; padding: 16px 18px 12px; transition: box-shadow .2s, border-color .2s; }
.answer:hover { border-color: transparent; box-shadow: 0 2px 6px rgba(60,64,67,.08), 0 10px 28px rgba(60,64,67,.10); }
.answer[hidden] { display: none; }
.answer__head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.answer__num { display: grid; place-items: center; min-width: 28px; height: 28px; border-radius: 9px; background: var(--green-soft); color: var(--green); font-size: 13px; font-weight: 700; }
.answer__title { flex: 1; font-size: 15.5px; font-weight: 600; line-height: 1.4; padding-top: 3px; }
.answer__body.is-clamped { max-height: 11.5em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.answer__foot { display: flex; justify-content: flex-end; gap: 4px; margin-top: 8px; padding-top: 8px; border-top: 1px solid #f1f3f6; }
.answer__more { margin-right: auto; }

/* hộp thoại */
.dialog { width: min(560px, calc(100% - 24px)); border: 0; border-radius: 28px; padding: 22px 24px; box-shadow: 0 24px 80px rgba(0,0,0,.24); color: var(--ink); }
.dialog::backdrop { background: rgba(31,31,31,.36); backdrop-filter: blur(2px); }
.dialog[open] { animation: pop .2s var(--ease); }
.dialog__head { display: flex; align-items: center; justify-content: space-between; }
.dialog__head h3 { font-size: 20px; font-weight: 600; }
.type-pick { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.type-pick__item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--bg-soft); cursor: pointer; border: 2px solid transparent; }
.type-pick__item:has(input:checked) { background: #fff; border-color: var(--tone); }
.type-pick__item input { position: absolute; opacity: 0; pointer-events: none; }
.type-pick__icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--tone-soft); color: var(--tone); flex: none; }
.type-pick__item b { display: block; font-weight: 600; font-size: 14.5px; }
.type-pick__item small { color: var(--ink-3); font-size: 12.5px; }

/* trang soạn bài */
.editor-page { display: grid; gap: 20px; align-items: start; }
@media (min-width: 1000px) { .editor-page { grid-template-columns: minmax(0, 1fr) 300px; } }
.editor-page__side { display: grid; gap: 14px; position: sticky; top: calc(var(--topbar-h) + 8px); }
@media (max-width: 999px) { .editor-page__side { position: static; } }
.form-actions--stack { flex-direction: column; margin-top: 14px; }
.tips h3 { font-size: 14px; margin-bottom: 8px; }
.tips ul { margin: 0; padding-left: 18px; font-size: 13.5px; color: var(--ink-2); display: grid; gap: 6px; }
.title-input { width: 100%; border: 0; outline: 0; background: transparent; font: 600 clamp(24px, 3.2vw, 32px)/1.25 var(--font-display); letter-spacing: -.02em; color: var(--ink); padding: 6px 4px 12px; }
.title-input::placeholder { color: #c4c7c5; }
.title-input.has-error { box-shadow: inset 0 -2px 0 var(--red); }
.editor { background: #fff; border: 1px solid var(--line); border-radius: 22px; transition: box-shadow .2s, border-color .2s; }
.editor:focus-within { border-color: #c6d3e6; box-shadow: 0 8px 28px rgba(60,64,67,.10); }
.editor.has-error { border-color: var(--red); }
.editor.is-drop { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(11,87,208,.12); }
.editor.is-busy .editor__area { opacity: .7; }
.editor__bar { position: sticky; top: var(--topbar-h); z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 8px; background: rgba(255,255,255,.95); backdrop-filter: blur(8px); border-bottom: 1px solid #eef1f5; border-radius: 22px 22px 0 0; }
.editor__bar > button, .editor__bar .pop-wrap > button { display: grid; place-items: center; min-width: 34px; height: 36px; padding: 0 6px; border: 0; border-radius: 10px; background: transparent; color: var(--ink-2); font: 15px var(--font); cursor: pointer; }
.editor__bar > button:hover, .editor__bar .pop-wrap > button:hover, .editor__bar .pop-wrap > button[aria-expanded="true"] { background: var(--bg-soft); color: var(--ink); }
.editor__block { height: 36px; max-width: 150px; padding: 0 28px 0 10px; border: 0; border-radius: 10px; background: var(--bg-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235f6368' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 8px center; appearance: none; font: 500 13.5px var(--font); color: var(--ink); cursor: pointer; }
.editor__sep { width: 1px; height: 22px; background: var(--line); margin: 0 3px; }
.swatch-a { font-weight: 700; border-bottom: 3px solid #b3261e; line-height: 1.1; }
.swatch-mark { background: #fef08a; padding: 0 4px; border-radius: 4px; font-weight: 600; }
.swatches { display: flex; gap: 6px; padding: 10px; min-width: 0; }
.swatches button { width: 28px !important; height: 28px; padding: 0 !important; border-radius: 50% !important; background: var(--c) !important; border: 2px solid #fff !important; box-shadow: 0 0 0 1px var(--line); }
.swatches .swatch-none { background: #fff !important; display: grid !important; place-items: center; }
.editor__area { min-height: 420px; padding: 24px clamp(16px, 4vw, 36px); outline: 0; }
.editor__area:empty::before { content: attr(data-placeholder); color: #a0a4a8; pointer-events: none; }
.editor__area img { cursor: default; }
.editor__status { min-height: 0; padding: 0 20px 10px; font-size: 13px; color: var(--ink-3); }
.editor__status:empty { display: none; }

/* in ấn: chỉ in nội dung bài */
@media print {
    .sidebar, .topbar, .toc, .crumbs, .doc__actions, .pager-cards, .toasts, .backdrop { display: none !important; }
    .main { margin: 0 !important; }
    .content { padding: 0 !important; max-width: none; }
    .reader { display: block; }
    .doc { border: 0; padding: 0; }
    .prose { font-size: 12pt; }
}

/* =========================================================
   Sidebar theo nghiệp vụ: nhóm, tìm chức năng, ghim
   ========================================================= */
.nav__search { position: relative; display: flex; align-items: center; gap: 8px; height: 38px; margin: 2px 4px 6px; padding: 0 12px; border-radius: 999px; background: rgba(255,255,255,.7); color: var(--ink-3); }
.nav__search:focus-within { background: #fff; box-shadow: 0 0 0 2px var(--accent-soft); }
.nav__search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: 13.5px var(--font); color: var(--ink); }
.nav__search input::-webkit-search-cancel-button { display: none; }
.nav__block + .nav__block { margin-top: 2px; }
.nav__block .nav__section { margin-top: 14px; }
.nav__row { position: relative; }
.nav__row .nav__link { padding-right: 14px; }
.nav__row.is-pinned .nav__link { padding-right: 36px; }
.nav__ext { margin-left: auto; color: var(--ink-4); opacity: 0; transition: opacity .15s; flex: none; }
.nav__link:hover .nav__ext { opacity: 1; }
.nav__pin {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    display: grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 50%;
    background: transparent; color: var(--ink-4); cursor: pointer; opacity: 0; transition: opacity .15s, background .15s;
}
.nav__row:hover .nav__pin, .nav__pin:focus-visible { opacity: 1; }
.nav__pin:hover { background: rgba(68,71,70,.1); color: var(--ink); }
.nav__row.is-pinned .nav__pin { opacity: 1; color: var(--accent); }
.nav__row:hover .nav__link .nav__ext { opacity: 0; }
.nav__row:hover .nav__link { padding-right: 36px; }

.nav__group > summary { list-style: none; cursor: pointer; user-select: none; }
.nav__group > summary::-webkit-details-marker { display: none; }
.nav__chev { margin-left: auto; color: var(--ink-4); transition: transform .2s var(--ease); flex: none; }
.nav__group[open] > summary .nav__chev { transform: rotate(180deg); }
.nav__link.is-within { color: var(--accent-ink); font-weight: 600; }
.nav__sub { position: relative; margin: 2px 0 6px 27px; padding-left: 8px; border-left: 1px solid #d5dbe3; }
.nav__link--sub { height: 36px; padding-left: 12px; gap: 10px; font-size: 13.5px; }
.nav__dot { width: 5px; height: 5px; border-radius: 50%; background: #b8bfc8; flex: none; }
.nav__link--sub.is-active .nav__dot { background: var(--accent); }
.nav__pins .nav__link .nav__ext { display: none; }
.nav__empty { padding: 10px 16px; font-size: 13px; color: var(--ink-4); }
.nav mark { background: #fde68a; border-radius: 3px; }

@media (min-width: 1024px) {
    .shell.is-collapsed .nav__search,
    .shell.is-collapsed .nav__sub,
    .shell.is-collapsed .nav__chev,
    .shell.is-collapsed .nav__ext,
    .shell.is-collapsed .nav__pin,
    .shell.is-collapsed .nav__pins,
    .shell.is-collapsed .nav__empty { display: none !important; }
    .shell.is-collapsed .nav__group > summary { width: 48px; padding: 0 14px; }
    .shell.is-collapsed .nav__group > summary span { display: none; }
    .shell.is-collapsed .nav__block .nav__section { display: block; height: 1px; margin: 10px 14px; overflow: hidden; color: transparent; background: #d5dbe3; }
}

/* =========================================================
   Đơn hàng
   ========================================================= */
.orders-head { align-items: center; }
.orders-head .segmented { margin: 0; }
.orders-filters { margin: 0 0 18px; align-items: center; }
.orders-filters .input { flex: 0 1 190px; }
.pill-field { display: inline-flex; align-items: center; gap: 6px; background: var(--bg-soft); border-radius: 999px; padding-left: 16px; flex: 0 1 220px; }
.pill-field span { font-size: 13px; color: var(--ink-3); font-weight: 500; }
.pill-field .input { background: transparent; flex: 1; min-width: 0; padding-left: 4px; }
.day-nav { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; }
.orders-stats { margin-bottom: 16px; }
.stats--3 { margin-bottom: 18px; }
@media (min-width: 760px) { .stats--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.stat > div { min-width: 0; }
.stat__foot { font-size: 12.5px; color: var(--ink-3); margin-top: 6px; }
.stat--inline { flex-direction: row; align-items: center; padding: 12px 18px; }
.orders-stats .stat, .stats--3 .stat { flex-direction: row; align-items: center; }
.txt-red { color: var(--red); }

.orders-grid { display: grid; gap: 16px; }
@media (min-width: 1560px) { .orders-grid { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; } }
@media (min-width: 900px) and (max-width: 1559px) { .orders-side { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }
.orders-main > .card + .card, .orders-main > .card + .grid-2 { margin-top: 16px; }
.orders-side { display: grid; gap: 16px; }
.orders-side .card + .card { margin-top: 0; }
.orders-lower { margin-top: 16px; }

.queue { padding: 16px; }
.queue__bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.queue__tabs { margin: 0; }
.queue__tabs .segmented__item span { background: rgba(68,71,70,.08); color: var(--ink-2); border-radius: 999px; padding: 1px 8px; min-width: 24px; text-align: center; }
.queue__tabs .segmented__item.is-active span { background: var(--accent); color: #fff; }
.queue__tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.search--sm { position: relative; display: block; }
.search--sm .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-3); }
.search--sm .input { min-height: 38px; padding: 8px 14px 8px 38px; border-radius: 999px; width: 220px; font-size: 14px; }
.queue__sub { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; background: var(--bg-soft); border-radius: var(--radius); padding: 8px 12px; margin-bottom: 10px; }
.queue__sub .muted { display: inline-flex; align-items: center; gap: 6px; }
.input--sm { min-height: 36px; padding: 6px 36px 6px 12px; font-size: 13px; width: auto; border-radius: 10px; }
.queue__body { min-height: 120px; transition: opacity .15s; }
.queue__body.is-loading, [data-checked-body].is-loading { opacity: .5; pointer-events: none; }
.queue__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 4px 0; min-height: 20px; }
.pager-btns { display: inline-flex; gap: 4px; }
.table-skeleton { height: 160px; border-radius: var(--radius); background: linear-gradient(90deg, var(--bg-soft) 0%, #f7f9fc 50%, var(--bg-soft) 100%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.empty--sm { padding: 28px 16px; }

.table-wrap--flat { border: 0; border-radius: var(--radius); overflow-x: auto; }
@media (min-width: 761px) { .table--orders { min-width: 820px; } .table--orders th:first-child { width: 190px; } .table--orders th:last-child { width: 112px; } .table--orders .row-actions { flex-wrap: nowrap; } }
.table--orders th { white-space: nowrap; }
.table--orders th, .table--orders td { padding: 10px 12px; vertical-align: top; }
.table--orders td { font-size: 13.5px; }
.table--orders .person small { font-size: 12px; }
.table--orders tr.is-reported td { background: #f4f8ff; }
.cell { display: block; line-height: 1.4; }
.cell b { font-weight: 600; }
.cell-sub { display: flex; align-items: center; gap: 4px; color: var(--ink-3); font-size: 12px; margin-top: 2px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tick { width: 34px; height: 34px; border-radius: 10px; border: 0; display: grid; place-items: center; background: var(--red-soft); color: var(--red); cursor: pointer; transition: transform .08s, background .15s; }
.tick:hover { transform: scale(1.06); }
.tick.is-on { background: var(--green-soft); color: var(--green); }
.tick.is-busy, .btn.is-busy, .tag-pill.is-busy { opacity: .55; cursor: progress; }

.note-chips { display: flex; flex-direction: column; gap: 4px; }
.note-chip { position: relative; }
.note-chip > summary { list-style: none; display: inline-flex; align-items: center; gap: 5px; max-width: 150px; padding: 3px 9px; border-radius: 8px; background: var(--bg-soft); font-size: 12px; color: var(--ink-2); cursor: pointer; }
.note-chip > summary::-webkit-details-marker { display: none; }
.note-chip > summary span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-chip[open] > summary { background: var(--accent-soft); color: var(--accent-ink); }
.note-chip__pop { position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; width: min(320px, 80vw); max-height: 260px; overflow: auto; padding: 10px 12px; background: #1f1f1f; color: #fff; border-radius: 12px; font-size: 12.5px; line-height: 1.5; box-shadow: var(--shadow-pop); }

.tagbar { border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; overflow: hidden; }
.tagbar__row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px 10px; background: var(--bg-soft); }
.tagbar__row--sub { background: #fff; border-top: 1px dashed var(--line); }
.tagbar__label { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--ink-2); margin-right: 2px; }
.tag-pill { --tone: var(--accent); display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); font: 500 12px/1.2 var(--font); cursor: pointer; transition: background .12s, color .12s, border-color .12s; }
.tag-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--tone); }
.tag-pill span { font-size: 11px; font-weight: 600; padding: 0 6px; border-radius: 999px; background: rgba(68,71,70,.08); }
.tag-pill:hover { border-color: var(--tone); }
.tag-pill.is-active { background: var(--tone); border-color: var(--tone); color: #fff; }
.tag-pill.is-active i { background: #fff; }
.tag-pill.is-active span { background: rgba(255,255,255,.25); }
.tag-pill--sm { padding: 4px 9px; }
.tag-pill--warn { --tone: #d97706; }

.fund-card { display: flex; gap: 14px; align-items: center; background: linear-gradient(135deg, #fff4ef 0%, #fdeef5 100%); border-color: #fadfd6; }
.fund-card__icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: #fff; color: #d6607a; flex: none; box-shadow: 0 2px 10px rgba(214,96,122,.15); }
.fund-card .stat__value { font-size: 24px; }

.rank { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.rank li { display: flex; align-items: center; gap: 10px; }
.rank__n { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--bg-soft); font-size: 12px; font-weight: 700; color: var(--ink-2); flex: none; }
.rank li:first-child .rank__n { background: #fff1c2; color: #8a5300; }
.rank__name { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 500; }
.rank__name small { display: block; color: var(--ink-3); font-size: 12px; font-weight: 400; }
.rank b { font-size: 13px; white-space: nowrap; }

.week__days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 12px; }
.week__day { border: 0; background: var(--bg-soft); border-radius: 12px; padding: 6px 0; display: grid; justify-items: center; cursor: pointer; color: var(--ink-2); }
.week__day small { font-size: 11px; color: var(--ink-3); }
.week__day b { font-size: 15px; }
.week__day.is-active { background: var(--accent); color: #fff; }
.week__day.is-active small { color: rgba(255,255,255,.8); }
.shift { padding: 8px 0; border-top: 1px solid #eef1f5; }
.shift:first-child { border-top: 0; }
.shift__head { display: flex; justify-content: space-between; font-size: 13px; }
.shift__head small { color: var(--ink-3); }
.shift__people { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.shift__people .avatar--sm { width: 28px; height: 28px; font-size: 11px; }

.notes { display: grid; gap: 6px; }
.note-item { background: var(--bg-soft); border-radius: var(--radius); padding: 10px 12px; }
.note-item summary { cursor: pointer; list-style: none; display: grid; gap: 2px; }
.note-item summary::-webkit-details-marker { display: none; }
.note-item summary b { font-size: 13.5px; }
.note-item summary small { color: var(--ink-3); font-size: 11.5px; }
.note-item__body { font-size: 13px; color: var(--ink-2); padding-top: 8px; display: grid; gap: 8px; }
.note-item__foot { display: flex; justify-content: space-between; align-items: center; }
.note-item__foot a { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; }

.mini-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.mini-list__item { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px; border: 0; background: transparent; border-radius: 12px; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.mini-list__item:hover { background: var(--bg-soft); }
.mini-list__item > span:nth-child(2) { flex: 1; min-width: 0; }
.mini-list__item b { display: block; font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-list__item small { display: block; color: var(--ink-3); font-size: 12px; }
.mini-list__item em { font-style: normal; font-size: 13px; font-weight: 600; white-space: nowrap; }
.mini-title { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--amber); margin: 14px 0 6px; }
.bars--sm { height: 160px; }

/* hộp thoại đơn */
.dialog--wide { width: min(920px, calc(100% - 24px)); max-height: calc(100dvh - 32px); }
.dialog--wide[open] { display: flex; flex-direction: column; }
.dialog--wide > .od, .dialog--wide > .pc, .dialog--wide > form { overflow-y: auto; min-height: 0; }
.dialog__head { gap: 12px; margin-bottom: 14px; align-items: flex-start; }
.od { display: grid; gap: 16px; }
.od__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.od__who { display: flex; gap: 12px; align-items: center; min-width: 0; }
.od__who b { font-size: 18px; }
.od__phone { font-size: 14px; margin: 4px 0 2px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.avatar--lg { width: 52px; height: 52px; font-size: 18px; background: var(--grad); color: #fff; }
.callbox { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius-lg); background: var(--accent-soft); }
.callbox > div { flex: 1; min-width: 0; }
.callbox small { display: block; color: var(--ink-3); font-size: 12.5px; }
.callbox.is-live { background: #e8f7ec; }
.callbox__dot { width: 12px; height: 12px; border-radius: 50%; background: #1e8e3e; box-shadow: 0 0 0 0 rgba(30,142,62,.5); animation: live 1.4s infinite; flex: none; }
.callbox [data-call-timer] { font: 600 20px/1.2 var(--font-display); color: var(--green); font-variant-numeric: tabular-nums; }
@keyframes live { 70% { box-shadow: 0 0 0 10px rgba(30,142,62,0); } 100% { box-shadow: 0 0 0 0 rgba(30,142,62,0); } }
.btn--red { background: var(--red); color: #fff; }
.btn--red:hover { background: #8c1d18; }
.od__grid { display: grid; gap: 16px; }
@media (min-width: 720px) { .od__grid { grid-template-columns: 1.2fr 1fr; } }
.od h4, .pc h4 { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-3); margin: 0 0 8px; text-transform: uppercase; letter-spacing: .04em; }
.od__items { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 4px; }
.od__items li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 12px; background: var(--bg-soft); border-radius: 10px; font-size: 14px; }
.od__total { display: flex; justify-content: space-between; padding: 4px 12px; font-size: 14px; }
.od__total b { font-size: 16px; }
.od__total--soft { color: var(--green); }
.od__meta { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: 14px; }
.od__meta dt { color: var(--ink-3); }
.od__meta dd { margin: 0; font-weight: 500; }
.od__notes { display: grid; gap: 6px; }
.od-note { display: flex; gap: 10px; padding: 10px 12px; background: var(--bg-soft); border-radius: 12px; font-size: 13.5px; }
.od-note .icon { margin-top: 3px; color: var(--ink-3); }
.od-note p { color: var(--ink-2); margin-top: 2px; }
.od-care { background: var(--bg-soft); border-radius: var(--radius); padding: 10px 14px; }
.od-care summary { cursor: pointer; display: flex; align-items: center; gap: 6px; font-size: 14px; }
.od-care form { margin-top: 12px; }
.od__actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }

/* form đơn */
.order-form__grid { display: grid; gap: 14px; }
@media (min-width: 860px) { .order-form__grid { grid-template-columns: 1fr 1fr; } .order-form__grid .span-all { grid-column: 1 / -1; } }
.form-block { border: 0; margin: 0; padding: 14px; border-radius: var(--radius-lg); background: #fafbfd; border: 1px solid #eef1f5; min-width: 0; }
.form-block legend { font-size: 13px; font-weight: 600; color: var(--ink-2); padding: 0 6px; }
.form-block .form-grid { gap: 12px; }
.form-block .input { min-height: 44px; padding: 10px 14px; font-size: 14px; background: #fff; border-color: var(--line); }
.form-error { color: var(--red); background: var(--red-soft); border-radius: 12px; padding: 10px 14px; font-size: 14px; font-weight: 500; }
.order-form__sum { margin-right: auto; align-self: center; font-size: 13px; color: var(--ink-3); }
.products-pick { display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.pp { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 8px 8px 12px; border-radius: 12px; background: #fff; border: 1px solid var(--line); transition: border-color .12s, background .12s; }
.pp.is-on { border-color: var(--accent); background: #f3f7ff; }
.pp__name { font-size: 13.5px; font-weight: 500; min-width: 0; }
.pp__name small { display: block; color: var(--ink-3); font-weight: 400; font-size: 12px; }
.pp__qty { display: inline-flex; align-items: center; background: var(--bg-soft); border-radius: 10px; flex: none; }
.pp__qty button { width: 30px; height: 32px; border: 0; background: transparent; font-size: 18px; color: var(--accent); cursor: pointer; border-radius: 10px; }
.pp__qty button:hover { background: var(--bg-soft-2); }
.pp__qty input { width: 40px; border: 0; background: transparent; text-align: center; font: 600 14px var(--font); -moz-appearance: textfield; }
.pp__qty input::-webkit-outer-spin-button, .pp__qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.phone-hit { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--accent-soft); font-size: 13.5px; }
.phone-hit small { display: block; color: var(--ink-2); margin-top: 2px; }
.hint-line { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-3); }

/* sau cuộc gọi */
.pc { display: grid; gap: 18px; }
.pc__tags { display: grid; gap: 8px; }
.pc__group { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px 10px; border-radius: 12px; background: var(--bg-soft); --tone: var(--accent); }
.pc__group .tag-pill { --tone: inherit; }
.pc__gname { font-size: 12px; font-weight: 700; color: var(--tone); min-width: 120px; }
.pc__choices { margin: 0 0 12px; }
.pc h5 { font-size: 13px; margin: 6px 0 8px; color: var(--ink-2); }

/* đơn tháng */
.month-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 6px 4px 12px; flex-wrap: wrap; }
.month-bar__tools { display: flex; gap: 6px; }
.day-card { border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fff; margin-bottom: 10px; overflow: hidden; }
.day-card > summary { list-style: none; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 14px 16px; cursor: pointer; }
.day-card > summary::-webkit-details-marker { display: none; }
.day-card > summary:hover { background: #fafbfd; }
.day-card__date { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14.5px; margin-right: 4px; }
.day-card__chev { margin-left: auto; color: var(--ink-3); transition: transform .2s; }
.day-card[open] .day-card__chev { transform: rotate(180deg); }
.day-card [data-day-body] { padding: 0 8px 8px; }
.day-card--accent { background: #fafbfd; }
button.segmented__item { border: 0; background: transparent; font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; }
button.segmented__item.is-active { background: #fff; }
.queue__tools { flex: 1 1 auto; justify-content: flex-end; }
.queue__tools .search--sm { margin-right: auto; }
.segmented--sm { margin: 0; }
.segmented--sm .segmented__item { height: 30px; padding: 0 12px; font-size: 13px; }
dialog[data-locked] .dialog__head [data-dialog-close] { visibility: hidden; }
.orders-main, .orders-side, .queue, .queue__bar > * { min-width: 0; }
.queue__tabs { flex: 0 1 auto; }
@media (max-width: 640px) {
    .orders-filters .input, .orders-filters .pill-field { flex: 1 1 100%; }
    .day-nav { margin-left: 0; width: 100%; justify-content: space-between; }
    .queue { padding: 12px; }
    .search--sm .input { width: 100%; }
    .queue__tools .search--sm { flex: 1 1 100%; }
    .orders-head .segmented { max-width: 100%; }
    .table--orders td .cell-sub { max-width: 180px; }
    .dialog--wide { padding: 18px 16px; }
}
.orders-lower > *, .orders-main > * { min-width: 0; } .bars--sm { overflow: hidden; }
.table--orders b, .od__items b { white-space: nowrap; }

/* =====================================================================
   Đơn ngày — giao diện giống bản cũ (theme Cuba: Tahoma, tím #7366ff)
   ===================================================================== */
.main:has(.lg) { background: #f7f8f9; }
.content:has(.lg) { max-width: none; padding-top: 4px; }
.lg {
    --lg-primary: #7366ff; --lg-primary-soft: rgba(115, 102, 255, .1);
    --lg-ink: #404040; --lg-ink-2: #2f2f3b; --lg-head: #333; --lg-muted: #8a8a8a; --lg-light: #c3c3c3;
    --lg-line: #e9edf1; --lg-thead: #f5f6f9; --lg-shadow: 0 9px 20px rgba(46, 35, 94, .07);
    --lg-success: #54ba4a; --lg-warning: #ffaa05; --lg-danger: #fc4438; --lg-info: #16c7f9; --lg-secondary: #838383;
    font-family: Tahoma, "Segoe UI", Roboto, sans-serif; font-size: 14px; color: var(--lg-ink); line-height: 1.45;
}
.lg button, .lg input, .lg select, .lg textarea { font-family: inherit; }
.lg h3, .lg h4, .lg h5, .lg h6 { font-family: Tahoma, "Segoe UI", sans-serif; font-weight: 700; color: var(--lg-head); margin: 0; letter-spacing: 0; }
.lg .txt-red { color: var(--lg-danger); }
.lg .txt-green { color: #2e9e3a; }

.lg-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 4px 18px; flex-wrap: wrap; }
.lg-title h3 { font-size: 20px; }
.lg-crumb { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--lg-ink); }
.lg-crumb a { color: var(--lg-ink); display: inline-flex; }
.lg-crumb span { color: #9b9b9b; }
.lg-crumb b { color: var(--lg-primary); font-weight: 400; }

.lg-card { background: #fff; border-radius: 15px; box-shadow: var(--lg-shadow); margin-bottom: 24px; min-width: 0; }
.lg-card__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 20px 20px 12px; }
.lg-card__head h5 { font-size: 18px; }
.lg-pad { padding: 20px; }
.lg-pad-x { padding: 0 20px 12px; }
.lg-empty { padding: 14px 20px; text-align: center; color: var(--lg-ink-2); }
.lg-loading { padding: 18px 20px; color: var(--lg-muted); }
.lg-strong { color: var(--lg-ink-2); font-weight: 700; font-size: 13px; }

.lg-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 18px;
    background: var(--lg-primary); color: #fff; border: 1px solid var(--lg-primary); border-radius: 6px; font-size: 14px; cursor: pointer; white-space: nowrap; text-decoration: none;
}
.lg-btn:hover { background: #5f51f5; border-color: #5f51f5; color: #fff; }
.lg-btn--icon { width: 34px; padding: 0; opacity: .9; }
.lg-btn--outline { background: #fff; color: var(--lg-ink-2); border-color: #dcdfe6; height: 32px; padding: 0 12px; }
.lg-btn--outline:hover { background: var(--lg-primary-soft); color: var(--lg-primary); border-color: var(--lg-primary); }
.lg-link { background: none; border: 0; padding: 0; color: inherit; font: inherit; cursor: pointer; text-align: left; }
.lg-link:hover { color: var(--lg-primary); }
.lg-link--danger { color: var(--lg-danger); }

.lg-input {
    width: 100%; height: 38px; padding: 6px 34px 6px 12px; border: 1px solid var(--lg-line); border-radius: 6px; background-color: #fff;
    font-size: 14px; color: #212529; outline: none;
}
.lg-input[type="date"] { padding-right: 12px; }
.lg-input:focus { border-color: #b9b2ff; box-shadow: 0 0 0 .2rem rgba(115, 102, 255, .15); }
.lg-input--sm { height: 32px; width: auto; min-width: 200px; font-size: 13px; }
select.lg-input { appearance: none; background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e"); background-repeat: no-repeat; background-position: right 12px center; background-size: 14px 10px; }

/* --- Khối thống kê đầu trang --- */
.lg-top { display: grid; gap: 24px; grid-template-columns: 1fr; margin-bottom: 24px; }
@media (min-width: 760px) { .lg-top { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1280px) { .lg-top { grid-template-columns: minmax(300px, 1.15fr) minmax(360px, 1.3fr) minmax(260px, 1fr); } }
.lg-top .lg-card { margin: 0; }
.lg-welcome {
    position: relative; overflow: hidden; display: flex; align-items: stretch; min-height: 186px; border-radius: 15px; color: #fff;
    background: linear-gradient(135deg, #5a8bff 0%, #7366ff 60%, #8f6bff 100%); box-shadow: var(--lg-shadow);
}
.lg-welcome__text { position: relative; z-index: 1; padding: 22px 0 22px 22px; flex: 1 1 60%; }
.lg-welcome__text h4 { color: #fff; font-size: 22px; margin-bottom: 8px; }
.lg-welcome__text p { margin: 0 0 22px; font-size: 13.5px; opacity: .95; max-width: 260px; }
.lg-welcome__btn { display: inline-block; padding: 8px 22px; border: 1px solid rgba(255,255,255,.75); border-radius: 6px; color: #fff; font-size: 14px; text-decoration: none; }
.lg-welcome__btn:hover { background: rgba(255,255,255,.15); color: #fff; }
.lg-welcome__art { position: relative; flex: 0 0 40%; display: flex; align-items: flex-end; justify-content: center; }
.lg-welcome__desk { width: 100%; max-width: 170px; margin-bottom: 6px; }
.lg-welcome__clock { position: absolute; top: 14px; right: 16px; display: grid; justify-items: center; gap: 4px; color: #fff; }
.lg-welcome__clock small { font-size: 10px; font-weight: 700; }

.lg-counts { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.lg-count { display: flex; align-items: center; gap: 14px; padding: 18px 18px; background: #fff; border-radius: 15px; box-shadow: var(--lg-shadow); min-width: 0; }
.lg-count b { display: block; font-size: 20px; color: var(--lg-head); line-height: 1.2; overflow-wrap: anywhere; }
.lg-count small { display: block; font-size: 13.5px; color: var(--lg-muted); margin-top: 2px; }
.lg-ring {
    --c: var(--lg-primary); flex: none; position: relative; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%;
    color: var(--c); background: conic-gradient(var(--c) 0 72%, #eef0f4 72% 100%);
}
.lg-ring::before { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: #fff; }
.lg-ring svg { position: relative; }
.lg-ring--violet { --c: #7366ff; }
.lg-ring--green { --c: #54ba4a; }
.lg-ring--gray { --c: #8a8a8a; }
.lg-ring--amber { --c: #ffaa05; }

.lg-fund { padding: 20px; display: flex; flex-direction: column; }
.lg-fund h5 { font-size: 18px; margin-bottom: 10px; }
.lg-fund__amount { background: #f4f4f7; border-radius: 8px; padding: 6px 10px; font-weight: 700; font-size: 17px; color: var(--lg-head); }
.lg-fund__line { width: 100%; height: 64px; margin-top: 8px; }
.lg-fund__axis { display: flex; justify-content: space-between; font-size: 11px; color: #8d8d8d; font-weight: 700; }

/* --- Lưới 9/3 --- */
.lg-grid { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1100px) { .lg-grid { grid-template-columns: minmax(0, 3fr) minmax(280px, 1fr); } }
.lg-main, .lg-side { min-width: 0; }

.lg-filter { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; padding: 20px; align-items: end; }
.lg-field { display: grid; gap: 6px; font-size: 14px; color: #212529; min-width: 0; }
.lg-field--btn { justify-items: start; }

.lg-crm { display: flex; justify-content: center; flex-wrap: wrap; gap: 14px; margin: 8px 0 24px; }
.lg-crm__btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 160px; height: 42px; padding: 0 22px;
    border-radius: 30px; border: 1px solid #6c757d; background: #fff; color: #6c757d; font-weight: 700; font-size: 15px; text-decoration: none;
    box-shadow: 0 2px 4px rgba(0,0,0,.05);
}
.lg-crm__btn:hover { background: #6c757d; color: #fff; }
.lg-crm__btn.is-active { background: var(--lg-primary); border-color: var(--lg-primary); color: #fff; }

/* --- Hàng chờ --- */
.lg-queue__head { padding: 20px 20px 8px; display: grid; gap: 14px; }
.lg-queue__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.lg-tabs { display: flex; flex-wrap: wrap; gap: 6px 0; }
.lg-tab {
    display: inline-flex; align-items: flex-start; gap: 6px; padding: 2px 22px 6px 0; background: none; border: 0; cursor: pointer;
    color: #3f475a; font-size: 14.5px; text-align: left; line-height: 1.35;
}
.lg-tab svg { margin-top: 2px; flex: none; }
.lg-tab b { font-weight: 700; }
.lg-tab:hover, .lg-tab.is-active { color: var(--lg-primary); }
.lg-tab.is-active span { text-decoration: underline; text-underline-offset: 4px; }
.lg-sub { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 20px 10px; padding: 8px 12px; background: #f8f7ff; border: 1px dashed #c9c3ff; border-radius: 8px; font-size: 13px; color: #4f46e5; }
.lg-sub span { display: inline-flex; align-items: center; gap: 6px; }

.lg-tagbar { margin: 0 20px 12px; border: 1px solid #e2e8f0; border-radius: 8px; background: #f8fafc; overflow: hidden; }
.lg-tagbar__row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; flex-wrap: wrap; }
.lg-tagbar__row--sub { background: #fff; border-top: 1px dashed #e2e8f0; justify-content: flex-start; }
.lg-tagbar__pills { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.lg-tagbar__label { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; color: #334155; margin-right: 4px; }
.lg-tagbar__label svg { color: #2563eb; }
.lg-tagbar__sublabel { font-size: 11.5px; font-weight: 700; color: var(--tone, #334155); margin-right: 4px; }
.lg-pill {
    --tone: #64748b; display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 6px; cursor: pointer;
    border: 1px solid #e2e8f0; background: #fff; color: #334155; font-size: 11px; white-space: nowrap;
}
.lg-pill i { width: 6px; height: 6px; border-radius: 50%; background: var(--tone); }
.lg-pill span { background: rgba(0,0,0,.07); border-radius: 10px; padding: 0 5px; font-size: 9.5px; }
.lg-pill:hover { border-color: var(--tone); }
.lg-pill.is-active { background: var(--tone); border-color: var(--tone); color: #fff; font-weight: 700; }
.lg-pill.is-active i { background: #fff; }
.lg-pill.is-active span { background: rgba(255,255,255,.25); }
.lg-pill--all.is-active { background: #1e293b; border-color: #1e293b; }
.lg-tagbar__row--sub .lg-pill { --tone: inherit; }
.lg-pill--sub { border-color: color-mix(in srgb, var(--tone) 35%, #fff); color: var(--tone); }
.lg-pill--sub.is-active { background: var(--tone); color: #fff; }
.lg-pill--close { margin-left: auto; color: #64748b; }
.lg-pill--close svg { color: var(--lg-danger); }
.lg-untouched { height: 26px; padding: 0 10px; border-radius: 6px; border: 1px solid #fcd34d; background: #fffbeb; color: #92400e; font-size: 11px; font-weight: 700; cursor: pointer; }
.lg-untouched b { margin-left: 6px; padding: 1px 7px; border-radius: 4px; background: #fde68a; }
.lg-untouched.is-active { background: #f59e0b; color: #fff; border-color: #f59e0b; }

/* --- Bảng --- */
.lg-table-wrap { overflow-x: auto; }
.lg-table { width: 100%; border-collapse: collapse; font-size: 14px; color: var(--lg-ink-2); }
.lg-table thead { background: var(--lg-thead); }
.lg-table th { padding: 14px 16px 14px 20px; text-align: left; font-size: 14px; font-weight: 700; color: var(--lg-ink-2); white-space: nowrap; border-left: 1px solid var(--lg-line); }
.lg-table th:first-child, .lg-table td:first-child { border-left: 0; }
.lg-table td { padding: 12px 8px 12px 16px; vertical-align: middle; border-left: 1px solid var(--lg-line); border-top: 1px solid var(--lg-line); }
.lg-table tbody tr:hover td { background: #fbfbfe; }
.lg-table tr.is-muted td { opacity: .55; }
.lg-table--sm th { padding: 12px 10px; font-size: 13px; }
.lg-table--sm td { padding: 10px; font-size: 13.5px; }

.lg-code { display: flex; align-items: center; gap: 8px; }
.lg-code h6 { font-size: 14px; font-weight: 700; color: var(--lg-ink-2); }
.lg-code small { display: block; font-size: 12px; color: var(--lg-light); }
.lg-code strong { display: block; font-size: 12px; }
.lg-av {
    position: relative; flex: none; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; overflow: hidden;
    background: linear-gradient(135deg, #a89fff, #7366ff); color: #fff; font-size: 13px;
}
.lg-av b { font-weight: 700; }
.lg-av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #fff; }
.lg-av--sm { width: 30px; height: 30px; font-size: 10.5px; border: 2px solid #fff; }
.lg-av--logo { background: #fff; color: #1e1e1e; font-size: 8px; font-weight: 700; letter-spacing: .5px; border: 1px solid var(--lg-line); }

.lg-cust { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 1px; }
.lg-cust__name { display: flex; align-items: center; justify-content: center; gap: 4px; flex-wrap: wrap; color: var(--lg-ink-2); }
.lg-cust__phone { font-size: 12px; color: var(--lg-light); }
.lg-buys { display: inline-flex; align-items: center; gap: 2px; padding: 1px 6px; border-radius: 10px; background: rgba(252, 86, 74, .15); color: #fc564a; font-size: 11px; font-weight: 700; text-decoration: none; }
.lg-cskh { color: #4f46e5; font-size: 11.5px; font-weight: 700; display: inline-flex; align-items: center; gap: 3px; }
.lg-chip { display: inline-flex; align-items: center; gap: 3px; padding: 1px 7px; border-radius: 6px; font-size: 11px; font-weight: 700; }
.lg-chip--sky { background: #e0f2fe; color: #0369a1; border: 1px solid #bae6fd; }
.lg-mini { font-size: 10.5px; color: var(--lg-muted); display: inline-flex; gap: 3px; align-items: center; }
.lg-claim { margin-top: 3px; padding: 3px 8px; border: 1px solid #4f46e5; border-radius: 4px; background: #6366f1; color: #fff; font-size: 11px; font-weight: 700; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
.lg-calling { margin: 6px auto; display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 4px; background: #ffaa05; color: #fff; font-size: 12px; }
.lg-lastcall { width: 100%; margin-top: 4px; padding: 3px 4px; border-top: 1px solid #f0f0f0; background: #f7f7f7; color: #999; font-size: 11.5px; border-radius: 3px; }
.lg-tagbox { margin-top: 4px; display: inline-flex; flex-direction: column; align-items: center; max-width: 200px; padding: 2px 7px 3px; border-radius: 6px; border: 1px solid #cbd5e1; background: #f1f5f9; cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.lg-tagbox span { display: inline-flex; align-items: center; gap: 3px; max-width: 100%; padding: 1px 6px; margin-bottom: 2px; border-radius: 4px; background: #64748b; color: #fff; font-size: 10px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lg-tagbox em { font-style: normal; font-size: 11px; font-weight: 700; color: #475569; line-height: 1.25; }
.lg-tagbox--a { background: #ecfdf5; border-color: #a7f3d0; } .lg-tagbox--a span { background: #10b981; } .lg-tagbox--a em { color: #047857; }
.lg-tagbox--b { background: #f0f9ff; border-color: #bae6fd; } .lg-tagbox--b span { background: #0284c7; } .lg-tagbox--b em { color: #0369a1; }
.lg-tagbox--u { background: #fffbeb; border-color: #fde68a; } .lg-tagbox--u span { background: #f59e0b; } .lg-tagbox--u em { color: #b45309; }
.lg-tagbox--d { background: #f8fafc; } 
.lg-tagbox--dnc { background: #fef2f2; border-color: #fecaca; } .lg-tagbox--dnc span { background: #ef4444; } .lg-tagbox--dnc em { color: #b91c1c; }

.lg-addr { max-width: 160px; }
.lg-price { margin: 0; white-space: nowrap; cursor: help; }
.lg-notesc { display: flex; flex-direction: column; gap: 4px; min-width: 96px; }
.lg-note { position: relative; }
.lg-note summary { list-style: none; cursor: pointer; padding: 4px 6px; border-radius: 4px; background: #ebebeb; color: #2d2d37; font-size: 11px; text-align: center; line-height: 1.3; }
.lg-note summary::-webkit-details-marker { display: none; }
.lg-note summary svg { vertical-align: -1px; }
.lg-note.is-green summary { background: rgba(101, 193, 92, .12); }
.lg-note__pop { position: absolute; z-index: 20; left: calc(100% + 6px); top: 0; width: 300px; max-width: 70vw; max-height: 260px; overflow: auto; padding: 8px 10px; border-radius: 5px; background: #000; color: #fff; font-size: 12px; text-align: left; }
.lg-source { font-size: 14px; color: var(--lg-ink-2); }
.lg-source__time { color: #888; font-size: 12px; }
.lg-src { display: inline-block; width: 14px; height: 14px; margin-right: 4px; vertical-align: -2px; border-radius: 3px; background: #111 center / 10px no-repeat; }
.lg-src--tts { background-color: #111; background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5'%3e%3cpath d='M5 8h14l-1 12H6z'/%3e%3cpath d='M9 8V6a3 3 0 0 1 6 0v2'/%3e%3c/svg%3e"); }
.lg-src--tiktok { background-color: #111; background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.6' stroke-linecap='round'%3e%3cpath d='M13 4v11a3 3 0 1 1-3-3M13 4c0 3 2 5 5 5'/%3e%3c/svg%3e"); }
.lg-src--shopee { background-color: #ee4d2d; background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5'%3e%3cpath d='M5 8h14l-1 12H6z'/%3e%3cpath d='M9 8V6a3 3 0 0 1 6 0v2'/%3e%3c/svg%3e"); }
.lg-src--lazada { background-color: #0f146d; background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3e%3cpath d='M12 4 3 9l9 5 9-5z'/%3e%3c/svg%3e"); }
.lg-src--facebook { background-color: #1877f2; background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3e%3cpath d='M14 8h3V4h-3a4 4 0 0 0-4 4v2H8v4h2v8h4v-8h3l1-4h-4V8z'/%3e%3c/svg%3e"); }

.lg-manage { display: flex; gap: 4px; justify-content: center; align-items: center; }
.lg-sq { display: grid; place-items: center; width: 35px; height: 35px; border: 1px solid #ccc; border-radius: 3px; background: #fff; color: #3a3a3a; cursor: pointer; }
.lg-sq:hover { border-color: var(--lg-primary); color: var(--lg-primary); }
.lg-tick { color: #fff; background: #e53935; border-color: #e53935; }
.lg-tick.is-on { background: #2e9e3a; border-color: #2e9e3a; }
.lg-tick:hover { color: #fff; filter: brightness(1.08); }

.lg-status { display: inline-block; padding: 6px 14px; border-radius: 5px; font-size: 13px; white-space: nowrap; }
.lg-status--success { background: rgba(84, 186, 74, .12); color: #54ba4a; }
.lg-status--info { background: rgba(22, 199, 249, .12); color: #0fa9d6; }
.lg-status--warning { background: rgba(255, 170, 5, .14); color: #e09400; }
.lg-status--danger { background: rgba(252, 68, 56, .12); color: #fc4438; }
.lg-status--secondary { background: rgba(131, 131, 131, .14); color: #6c6c6c; }

.lg-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 14px 20px 18px; }
.lg-foot:empty { display: none; }
.lg-info { color: var(--lg-ink); font-size: 14px; }
.lg-pager { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.lg-pager--end { justify-content: flex-end; padding: 12px 20px 18px; }
.lg-pager button { min-width: 24px; height: 24px; padding: 0 6px; border: 0; border-radius: 4px; background: #f1f1f5; color: #555; font-size: 12px; cursor: pointer; }
.lg-pager button:hover:not(:disabled) { background: #e4e2ff; }
.lg-pager button.is-active { background: var(--lg-primary); color: #fff; }
.lg-pager button:disabled { opacity: .45; cursor: default; }
.lg-pager span { color: #999; font-size: 12px; }
.lg-switch { display: inline-flex; border: 1px solid #dcdfe6; border-radius: 6px; overflow: hidden; }
.lg-switch button { padding: 5px 12px; border: 0; background: #fff; font-size: 13px; cursor: pointer; color: var(--lg-ink-2); }
.lg-switch button.is-active { background: var(--lg-primary); color: #fff; }

/* --- Đơn hôm nay + delay --- */
.lg-split { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .lg-split { grid-template-columns: minmax(0, 2fr) minmax(240px, 1fr); } }
.lg-split > .lg-card { margin-bottom: 0; }
.lg-split { margin-bottom: 24px; }
.lg-time { display: inline-block; width: 74px; padding: 3px 0; border-radius: 4px; text-align: center; font-size: 11px; font-weight: 700; background: rgba(84, 186, 74, .14); color: #54ba4a; }
.lg-time.is-new { background: rgba(252, 86, 74, .15); color: #fc564a; }
.lg-delay {
    align-self: start; display: grid; justify-items: center; gap: 14px; padding: 22px 18px; border-radius: 15px; color: #fff; text-align: center;
    background: linear-gradient(160deg, #8f6bff, #6a5cf6); box-shadow: var(--lg-shadow);
}
.lg-delay h5 { color: #fff; font-size: 18px; }
.lg-delay__track { position: relative; width: 100%; min-height: 150px; display: grid; align-items: center; grid-template-columns: 26px 1fr 26px; }
.lg-delay__nav { width: 24px; height: 24px; border: 0; border-radius: 4px; background: rgba(255,255,255,.2); color: #fff; cursor: pointer; font-size: 16px; line-height: 1; }
.lg-delay__nav:last-child { grid-column: 3; }
.lg-delay__slide { grid-column: 2; grid-row: 1; display: none; flex-direction: column; align-items: center; gap: 6px; }
.lg-delay__slide.is-active { display: flex; }
.lg-delay__logo { position: relative; display: grid; place-items: center; width: 90px; height: 90px; border-radius: 50%; background: #fff; color: #1e1e1e; font-size: 14px; font-weight: 700; letter-spacing: 1px; }
.lg-delay__logo i { position: absolute; right: 4px; bottom: 6px; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: #54ba4a; color: #fff; border: 2px solid #fff; }
.lg-delay__slide b { display: inline-flex; align-items: center; gap: 4px; font-size: 18px; }
.lg-delay__slide small { font-size: 14px; font-weight: 700; }
.lg-delay__code, .lg-delay__copy { background: none; border: 0; color: #fff; font: inherit; cursor: pointer; padding: 0; }
.lg-delay__more { display: inline-flex; align-items: center; gap: 10px; padding: 10px 18px; border-radius: 4px; background: rgba(255,255,255,.18); color: #fff; font-size: 14px; text-decoration: none; }
.lg-delay__more:hover { background: rgba(255,255,255,.28); color: #fff; }

/* --- Biểu đồ đơn hàng gần đây --- */
.lg-chart__stats { display: flex; flex-wrap: wrap; gap: 10px 0; padding: 0 20px 14px; }
.lg-chart__stats div { padding: 6px 14px; background: #f4f4f7; border-radius: 6px; margin-right: 14px; position: relative; }
.lg-chart__stats div + div::before { content: ""; position: absolute; left: -8px; top: 12px; bottom: 12px; border-left: 1px solid #9a9a9a; }
.lg-chart__stats b { display: block; font-size: 17px; color: var(--lg-head); }
.lg-chart__stats small { font-size: 13px; color: #6d6d6d; }
.lg-bars { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 6px; padding: 0 20px 20px; height: 300px; }
.lg-bars__y { display: flex; flex-direction: column; justify-content: space-between; padding-bottom: 20px; font-size: 11px; color: #6d6d6d; text-align: right; }
.lg-bars__plot { position: relative; display: flex; align-items: stretch; gap: 4px; padding-bottom: 20px;
    background: repeating-linear-gradient(to top, transparent 0 calc((100% - 20px) / 5 - 1px), #ececf2 calc((100% - 20px) / 5 - 1px) calc((100% - 20px) / 5)) top / 100% calc(100% - 20px) no-repeat; }
.lg-bars__col { position: relative; flex: 1 1 0; min-width: 0; display: flex; align-items: flex-end; justify-content: center; }
.lg-bars__bar { position: relative; width: min(60%, 18px); background: var(--lg-primary); border-radius: 2px 2px 0 0; }
.lg-bars__bar i { position: absolute; left: 50%; top: 4px; transform: translateX(-50%); font-style: normal; font-size: 9.5px; font-weight: 700; color: #fff; }
.lg-bars__col small { position: absolute; bottom: -20px; font-size: 10px; color: #6d6d6d; white-space: nowrap; }
.lg-bars__col:nth-child(even) small { visibility: hidden; }

/* --- Cột phải --- */
.lg-topp th { padding: 12px 10px; font-size: 13px; text-align: center; }
.lg-topp td { padding: 10px; text-align: center; border-left: 0; }
.lg-topp td:first-child { text-align: left; }
.lg-topp__p { display: flex; align-items: center; gap: 8px; }
.lg-topp__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; font-weight: 700; max-width: 120px; }
.lg-topp td b { font-size: 12.5px; color: var(--lg-ink-2); overflow-wrap: anywhere; }
.lg-rank { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 1px solid currentColor; font-size: 13px; color: #7366ff; background: rgba(115,102,255,.08); }
.lg-rank--2 { color: #16c7f9; background: rgba(22,199,249,.08); }
.lg-rank--3 { color: #ffaa05; background: rgba(255,170,5,.08); }
.lg-rank--4 { color: #fc4438; background: rgba(252,68,56,.08); }
.lg-rank--5 { color: #838383; background: rgba(131,131,131,.08); }
.lg-qty { display: inline-block; min-width: 48px; padding: 3px 8px; border-radius: 4px; font-size: 12px; background: rgba(115,102,255,.12); color: #7366ff; }
.lg-qty--2 { background: rgba(22,199,249,.12); color: #0fa9d6; }
.lg-qty--3 { background: rgba(255,170,5,.14); color: #e09400; }
.lg-qty--4 { background: rgba(252,68,56,.12); color: #fc4438; }
.lg-qty--5 { background: rgba(131,131,131,.14); color: #6c6c6c; }

.lg-week { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px 4px; padding: 4px 20px 14px; }
.lg-week__day { display: grid; justify-items: center; gap: 1px; padding: 6px 2px; border: 0; border-radius: 10px; background: none; cursor: pointer; color: var(--lg-ink-2); }
.lg-week__day b { font-size: 14px; }
.lg-week__day small { font-size: 11px; color: var(--lg-muted); }
.lg-week__day.is-active { background: var(--lg-primary); color: #fff; }
.lg-week__day.is-active small { color: #fff; }
.lg-shifts { padding: 0 20px 18px; display: grid; }
.lg-shift { --t: #7366ff; display: flex; justify-content: space-between; gap: 8px; padding: 10px 0 10px 10px; border-top: 1px solid var(--lg-line); position: relative; }
.lg-shift::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--t); }
.lg-shift--amber { --t: #ffaa05; } .lg-shift--green { --t: #54ba4a; } .lg-shift--red { --t: #fc4438; }
.lg-shift__body { min-width: 0; }
.lg-shift__body > b { display: block; font-size: 14px; color: var(--lg-ink-2); margin-bottom: 4px; }
.lg-shift__none { font-size: 13px; color: var(--lg-ink-2); }
.lg-shift__people { display: flex; flex-wrap: wrap; }
.lg-shift__people .lg-av { margin-right: -6px; margin-bottom: 3px; }
.lg-shift__time { flex: none; display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--lg-ink-2); }
.lg-shift__time i { width: 6px; height: 6px; border-radius: 50%; background: var(--t); }

.lg-notes { list-style: none; margin: 0; padding: 4px 20px 18px; }
.lg-notes li { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 10px; position: relative; padding-bottom: 12px; }
.lg-notes li::before { content: ""; position: absolute; left: 50px; top: 8px; bottom: 0; border-left: 1px solid var(--lg-line); }
.lg-notes__date { font-size: 13px; color: var(--lg-ink-2); padding-top: 4px; }
.lg-notes__card { margin-left: 18px; background: #f4f4f7; border-radius: 6px; padding: 8px 10px; position: relative; }
.lg-notes__card::before { content: ""; position: absolute; left: -22px; top: 8px; width: 7px; height: 7px; border-radius: 50%; background: #54ba4a; }
.lg-notes__card summary { cursor: pointer; font-size: 13.5px; color: var(--lg-ink-2); list-style: none; }
.lg-notes__card summary::-webkit-details-marker { display: none; }
.lg-notes__card p { margin: 6px 0; font-size: 13px; }
.lg-notes__foot { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--lg-muted); }

@media (max-width: 640px) {
    .lg-counts { grid-template-columns: 1fr; }
    .lg-welcome__art { display: none; }
    .lg-crm__btn { min-width: 0; flex: 1 1 100%; }
    .lg-title h3 { font-size: 18px; }
}
.lg-count { padding: 14px; gap: 10px; }
.lg-count b { font-size: 18px; white-space: nowrap; overflow-wrap: normal; }
.lg-count small { font-size: 13px; }
.lg-ring { width: 46px; height: 46px; }
.lg-card__head h5 { white-space: nowrap; }
@media (min-width: 1280px) { .lg-top { grid-template-columns: minmax(280px, 1fr) minmax(400px, 1.45fr) minmax(240px, .9fr); } }
.lg-topp { table-layout: fixed; }
.lg-topp th:nth-child(1) { width: 48%; }
.lg-topp th:nth-child(2) { width: 22%; }
.lg-topp th, .lg-topp td { padding: 10px 6px; }
.lg-topp th { font-size: 12.5px; white-space: normal; }
.lg-topp th:first-child, .lg-topp td:first-child { padding-left: 14px; }
.lg-topp__name { max-width: none; }
.lg-topp td b { font-size: 11.5px; }
.lg-qty { min-width: 0; padding: 3px 6px; }
.lg-welcome__btn { white-space: nowrap; }
.lg-welcome__text { padding-right: 8px; }
.lg .lg { font-size: inherit; }
.main:has(.lg-table-wrap.lg):not(:has([data-orders])) { background: inherit; }

/* Bảng đơn: cột cố định như DataTables bản cũ, chữ dài (địa chỉ ****…) tự xuống dòng, không tràn cột */
.lg-table td { overflow-wrap: anywhere; word-break: break-word; }
.lg-table--orders { table-layout: fixed; min-width: 940px; }
.lg-table--orders .c-code { width: 170px; }
.lg-table--orders .c-cust { width: 210px; }
.lg-table--orders .c-addr { width: auto; min-width: 140px; }
.lg-table--orders .c-price { width: 112px; }
.lg-table--orders .c-note { width: 150px; }
.lg-table--orders .c-status { width: 130px; }
.lg-table--orders .c-src { width: 160px; }
.lg-table--orders .c-act { width: 96px; }
.lg-table--wait { min-width: 760px; }
.lg-table--wait .c-note { width: auto; }
.lg-table--orders th { white-space: normal; }
.lg-addr { max-width: none; }
.lg-code { min-width: 0; }
.lg-code > div { min-width: 0; }
.lg-code h6 { overflow-wrap: anywhere; }
.lg-note summary { overflow-wrap: anywhere; }
.lg-table-wrap { -webkit-overflow-scrolling: touch; }

/* Màn hình hẹp */
@media (max-width: 1099px) {
    .lg-side { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0 24px; align-items: start; }
}
@media (max-width: 760px) {
    .lg-counts { grid-template-columns: 1fr 1fr; gap: 12px; }
    .lg-count { flex-direction: column; align-items: flex-start; }
    .lg-top, .lg-grid, .lg-split { gap: 16px; }
    .lg-card { margin-bottom: 16px; }
    .lg-filter { grid-template-columns: 1fr; padding: 16px; }
    .lg-crm { gap: 8px; }
    .lg-crm__btn { min-width: 0; height: 38px; padding: 0 14px; font-size: 13.5px; flex: 1 1 auto; }
    .lg-queue__head { padding: 16px 16px 8px; }
    .lg-tab { padding-right: 14px; font-size: 13.5px; }
    .lg-tagbar, .lg-sub { margin-left: 12px; margin-right: 12px; }
    .lg-foot { padding: 12px 16px; }
    .lg-bars { height: 220px; padding: 0 12px 16px; }
    .lg-bars__col small { display: none; }
    .lg-chart__stats { padding: 0 16px 12px; }
}
/* ---- Bố cục theo đúng lưới Bootstrap của bản cũ ---- */
/* Hàng đầu: chào (col-xxl-4) | 2 cột thẻ số (col-xxl-auto) | Bếp nhà — tỷ lệ 3 : 2 : 2 : 2 */
@media (min-width: 1400px) {
    .lg-top { grid-template-columns: 3fr 4fr 2fr; }
}
@media (min-width: 1200px) and (max-width: 1399px) {
    .lg-top { grid-template-columns: 1fr 1fr; }
    .lg-fund { grid-column: 1 / -1; }
}
.lg-welcome, .lg-fund { min-height: 238px; }
.lg-counts { grid-template-rows: 1fr 1fr; }
.lg-count { padding: 20px 22px; }

/* Thân trang: col-lg-9 | col-lg-3 */
.lg-grid { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 992px) { .lg-grid { grid-template-columns: minmax(0, 3fr) minmax(0, 1fr); } }
.lg-side { display: block; }
@media (max-width: 991px) {
    .lg-side { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0 24px; align-items: start; }
}

/* Bộ lọc: 4 cột bằng nhau (col-xl), nút Xem nằm ở cột thứ 4 */
.lg-filter { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 1200px) { .lg-filter { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 575px) { .lg-filter { grid-template-columns: 1fr; } }

/* Tab hàng chờ trải đều cả hàng như nav-fill */
.lg-tabs { justify-content: space-between; gap: 8px 16px; }
.lg-tab { padding-right: 0; flex: 0 1 auto; }
@media (max-width: 760px) { .lg-tabs { justify-content: flex-start; } .lg-tab { padding-right: 12px; } }

/* Bảng đơn: chia cột theo % như DataTables bản cũ, cố định để chữ dài không đẩy lệch cột */
.lg-table--orders { min-width: 900px; }
.lg-table--orders .c-code { width: 15%; }
.lg-table--orders .c-cust { width: 19%; }
.lg-table--orders .c-addr { width: 17%; min-width: 0; }
.lg-table--orders .c-price { width: 10%; }
.lg-table--orders .c-note { width: 14%; }
.lg-table--orders .c-status { width: 12%; }
.lg-table--orders .c-src { width: 15%; }
.lg-table--orders .c-act { width: 10%; }
.lg-table--orders:has(.c-status) .c-addr { width: 15%; }
.lg-table--orders:has(.c-status) .c-code { width: 17%; }
.lg-table--wait { min-width: 720px; }
.lg-table--wait .c-code { width: 20%; }
.lg-table--wait .c-cust { width: 26%; }
.lg-table--wait .c-note { width: 24%; }
.lg-table--wait .c-src { width: 18%; }
.lg-table--wait .c-act { width: 12%; }
.lg-note summary { max-width: 220px; margin: 0 auto; }
.lg-notesc { align-items: stretch; }
@media (min-width: 992px) { .lg-grid { grid-template-columns: minmax(0, 3fr) minmax(300px, 1fr); } }
@media (min-width: 1400px) and (max-width: 1699px) { .lg-top { grid-template-columns: 1fr 1fr; } .lg-fund { grid-column: 1 / -1; min-height: 0; } }
.lg-week { grid-template-columns: repeat(auto-fit, minmax(54px, 1fr)); }
/* Tab hàng chờ: dồn về góc phải, cùng hàng với nút Thêm đơn hàng */
.lg-queue__head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 24px; }
.lg-queue__actions { flex: none; }
.lg-tabs { justify-content: flex-end; gap: 8px 28px; margin-left: auto; }
.lg-tab { padding: 6px 0; }
@media (max-width: 760px) {
    .lg-queue__head { display: grid; }
    .lg-tabs { justify-content: flex-start; margin-left: 0; gap: 6px 16px; }
}

/* ---------------- AI Agent ---------------- */
.ai-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ai-title { margin: 28px 4px 12px; }
.ai-brain { display: flex; align-items: center; gap: 16px; color: inherit; transition: box-shadow .2s var(--ease), transform .2s var(--ease); }
.ai-brain:hover { transform: translateY(-1px); box-shadow: 0 2px 6px rgba(60,64,67,.08), 0 12px 32px rgba(60,64,67,.12); }
.ai-brain .kb-card__icon { flex: none; }
.ai-brain__body { flex: 1; min-width: 0; display: grid; gap: 6px; }
.ai-clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ai-progress { height: 6px; border-radius: 999px; background: var(--bg-soft); overflow: hidden; }
.ai-progress span { display: block; height: 100%; border-radius: inherit; background: var(--tone, var(--accent)); }
.ai-roadmap { margin: 0; padding-left: 1.3em; display: grid; gap: 8px; line-height: 1.55; }
.ai-info { margin-bottom: 18px; }
.ai-info h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.ai-pre { white-space: pre-wrap; }
.ai-textarea { width: 100%; min-height: 420px; margin-top: 12px; font: 14.5px/1.65 ui-monospace, SFMono-Regular, Consolas, monospace; resize: vertical; }
.ai-item-link { color: inherit; }
.ai-item-link:hover b { color: var(--accent); }
.ai-agent-chip { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); }

/* AI Agent — tác vụ đang chạy tự động */
.ai-auto { margin-bottom: 18px; border: 1px solid color-mix(in srgb, var(--green, #1e8e3e) 25%, transparent); }
.ai-auto h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.ai-auto__row { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-top: 1px solid var(--line, #e5e7eb); color: inherit; }
.ai-auto__row:first-of-type { border-top: 0; }
.ai-auto__row:hover b { color: var(--accent); }
.ai-auto__body { flex: 1; min-width: 0; display: grid; gap: 2px; }
.ai-auto__dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: #1e8e3e; box-shadow: 0 0 0 4px rgba(30,142,62,.15); animation: ai-pulse 2s infinite; }
@keyframes ai-pulse { 50% { box-shadow: 0 0 0 7px rgba(30,142,62,.05); } }
@media (prefers-reduced-motion: reduce) { .ai-auto__dot { animation: none; } }

.ai-conn { margin: 0 0 8px; padding-left: 1.1em; display: grid; gap: 4px; font-size: 14px; line-height: 1.5; }
.ai-info h3 .badge { margin-left: auto; }

/* =====================================================================
   Đơn tháng — giống donhang/donthang.php bản cũ
   ===================================================================== */
.lg .t-c { text-align: center; }
.lg .txt-info { color: #0fa9d6; }
.lg .muted { color: #8a8a8a; }
.lg .small { font-size: 12px; }
.lg-mstats { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin-bottom: 24px; }
.lg-mstat { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; padding: 20px 22px 16px; background: #fff; border-radius: 15px; box-shadow: var(--lg-shadow); }
.lg-mstat small { display: block; font-size: 12px; font-weight: 700; color: #6d6d6d; letter-spacing: .3px; }
.lg-mstat b { display: block; margin-top: 6px; font-size: 22px; color: var(--lg-head); }
.lg-mstat p b { display: inline; margin: 0; font-size: inherit; }
.lg-mstat p { grid-column: 1 / -1; margin: 8px 0 0; padding-top: 12px; border-top: 1px solid var(--lg-line); font-size: 11px; color: #6d6d6d; }
.lg-mstat__ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; color: #fff; }
.lg-mstat__ic--red { background: #e55353; }
.lg-mstat__ic--green { background: #54ba4a; }
.lg-mfilter { display: grid; gap: 14px; padding: 20px; align-items: end; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 900px) { .lg-mfilter { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1300px) { .lg-mfilter { grid-template-columns: 1fr 1.3fr 1fr 1.3fr 1.3fr .7fr .8fr auto; } }
.lg-mfilter .lg-input { height: 36px; font-size: 13.5px; }
.lg-mfilter .lg-field span { font-size: 13px; }

.lg-mbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 6px 0 14px; }
.lg-mbar h5 { font-size: 18px; }
.lg-mbar__tools { display: flex; gap: 8px; flex-wrap: wrap; }
.lg-pillbtn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 8px; border: 1px solid #dcdfe6; background: #fff; color: #555; font-size: 13px; cursor: pointer; white-space: nowrap; }
.lg-pillbtn b { font-weight: 700; }
.lg-pillbtn--green { background: #ecf8ea; border-color: #c4e8bf; color: #3c9a33; }
.lg-pillbtn--red { background: #fdecec; border-color: #f6c3c3; color: #d94141; }
.lg-pillbtn--violet { border-color: #b9b2ff; color: var(--lg-primary); }
.lg-pillbtn:hover { filter: brightness(.97); }

.lg-day { background: #fff; border: 1px solid #edf0f4; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.04); margin-bottom: 12px; overflow: hidden; }
.lg-day > summary { list-style: none; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 14px 16px; cursor: pointer; }
.lg-day > summary::-webkit-details-marker { display: none; }
.lg-day[open] > summary { border-bottom: 1px solid #edf0f4; }
.lg-day__date { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 5px; background: var(--lg-primary); color: #fff; font-size: 13px; font-weight: 600; }
.lg-day__count { padding: 3px 8px; border-radius: 5px; background: #f8f9fa; border: 1px solid #e3e6ea; font-size: 12px; }
.lg-day__count b { color: var(--lg-primary); }
.lg-tagc { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 5px; font-size: 12px; border: 1px solid; }
.lg-tagc--green { background: #ecf8ea; border-color: #c4e8bf; color: #3c9a33; }
.lg-tagc--red { background: #fdecec; border-color: #f6c3c3; color: #d94141; }
.lg-day__more { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: #555; }
.lg-day[open] .lg-day__more svg { transform: rotate(180deg); }
.lg-day__body { padding: 0; }
.lg-day--view { border-color: #c4e8bf; }
.lg-day--view[data-view="da_hoan"] { border-color: #f6c3c3; }
.lg-info-line { display: flex; align-items: center; gap: 6px; padding: 14px 16px; color: #0fa9d6; font-size: 13.5px; }

.lg-table--month { min-width: 1180px; table-layout: fixed; font-size: 13px; }
.lg-table--month thead { background: #f8f9fa; }
.lg-table--month th { padding: 10px 8px; font-size: 12px; text-align: center; white-space: nowrap; }
.lg-table--month td { padding: 10px 8px; vertical-align: top; }
.lg-table--month th:nth-child(1) { width: 4.5%; }
.lg-table--month th:nth-child(2) { width: 10%; }
.lg-table--month th:nth-child(3) { width: 12%; }
.lg-table--month th:nth-child(4) { width: 14.5%; }
.lg-table--month th:nth-child(5) { width: 13%; }
.lg-table--month th:nth-child(6) { width: 10%; }
.lg-table--month th:nth-child(7) { width: 9%; }
.lg-table--month th:nth-child(8) { width: 8%; }
.lg-table--month th:nth-child(9) { width: 11%; }
.lg-table--month th:nth-child(10) { width: 8%; }
.lg-tplcol { display: grid; justify-items: center; gap: 6px; }
.lg-sq--sm { width: 28px; height: 28px; border-radius: 4px; }
.lg-zns { font-size: 9px; font-weight: 700; padding: 1px 4px; border-radius: 4px; border: 1px solid #c9d6ff; color: #8aa2ff; }
.lg-zns.is-sent { background: #0068ff; border-color: #0068ff; color: #fff; }
.lg-code-link { background: none; border: 0; padding: 0; color: var(--lg-primary); font: inherit; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.lg-code-link:hover { text-decoration: underline; }
.lg-mini-line { margin-top: 3px; font-size: 11.5px; line-height: 1.35; }
.lg-mini-line a { color: #0fa9d6; }
.lg-wholesale { display: inline-block; margin-top: 4px; padding: 2px 6px; border-radius: 4px; background: #ffc107; color: #222; font-size: 11px; }
.lg-mname { font-weight: 700; color: var(--lg-ink-2); text-transform: uppercase; }
.lg-mphone { margin-top: 3px; }
.lg-mphone b { color: var(--lg-primary); }
.lg-mphone small { color: #8a8a8a; font-size: 11px; }
.lg-maddr { font-size: 12px; color: #6c757d; line-height: 1.4; }
.lg-prov { display: inline-flex; align-items: center; gap: 3px; margin-top: 4px; padding: 2px 6px; border-radius: 4px; background: #f8f9fa; border: 1px solid #e3e6ea; font-size: 11px; color: #333; }
.lg-prov svg { color: #dc3545; }
.lg-mitems { list-style: none; margin: 0; padding: 0; font-size: 12px; }
.lg-mitems li { padding: 3px 0; border-bottom: 1px solid #f3f3f3; }
.lg-mitems li svg { color: #54ba4a; }
.lg-mtotal { font-weight: 700; color: #dc3545; font-size: 14px; }
.lg-mnote { max-width: 100%; margin-bottom: 4px; padding: 2px 6px; border-radius: 4px; border: 1px solid #e3e6ea; background: #f8f9fa; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: help; }
.lg-mnote--care { color: var(--lg-primary); }
.lg-mnote--post { color: #a06a00; }
.lg-mnote--shop { color: #6c757d; }
.lg-msrc { display: inline-block; padding: 2px 6px; border-radius: 4px; background: #e7f7fd; border: 1px solid #bfeaf8; color: #0b8fb8; font-size: 11px; }
.lg-msrc .lg-src { width: 12px; height: 12px; background-size: 9px; }
.lg-btngroup { display: inline-flex; }
.lg-btngroup button { display: grid; place-items: center; width: 30px; height: 28px; border: 1px solid; background: #fff; cursor: pointer; margin-left: -1px; }
.lg-btngroup button:first-child { border-radius: 4px 0 0 4px; margin-left: 0; }
.lg-btngroup button:last-child { border-radius: 0 4px 4px 0; }
.lg-btngroup .is-blue { color: var(--lg-primary); border-color: var(--lg-primary); }
.lg-btngroup .is-amber { color: #e0a800; border-color: #ffc107; }
.lg-btngroup .is-red { color: #dc3545; border-color: #dc3545; }
.lg-btngroup button:hover { filter: brightness(.95); background: #fafafa; }
.lg-btngroup { flex-wrap: nowrap; }

/* Đơn trả hàng + Tìm đơn — kiểu bản cũ */
.lg-mstats--one { grid-template-columns: minmax(260px, 420px); }
.lg-mstats--one .lg-mstat { padding-bottom: 20px; }
.lg-retfilter { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 16px 20px; }
.lg-retfilter .lg-input { width: 240px; }
.lg-retfilter .lg-btn--amber { margin-left: auto; }
.lg-btn--amber { background: #ffaa05; border-color: #ffaa05; color: #fff; font-weight: 700; letter-spacing: .3px; }
.lg-btn--amber:hover { background: #f09d00; border-color: #f09d00; }
.lg-retsec .lg-card__head h5 { font-size: 15px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lg-count-pill { padding: 1px 9px; border-radius: 10px; background: var(--lg-primary-soft); color: var(--lg-primary); font-size: 12px; }
.lg-table--ret th:nth-child(1) { width: 11%; }
.lg-table--ret th:nth-child(2) { width: 12%; }
.lg-table--ret th:nth-child(3) { width: 16%; }
.lg-table--ret th:nth-child(4) { width: 13%; }
.lg-table--ret th:nth-child(5) { width: 10%; }
.lg-table--ret th:nth-child(6) { width: 9%; }
.lg-table--ret th:nth-child(7) { width: 9%; }
.lg-table--ret th:nth-child(8) { width: 11%; }
.lg-table--ret th:nth-child(9) { width: 9%; }
.lg-table--ret { min-width: 1100px; }
.lg-table--retp { min-width: 760px; }
.lg-table--retp th:nth-child(1) { width: 16%; }
.lg-table--retp th:nth-child(2) { width: 26%; }
.lg-table--retp th:nth-child(3) { width: 22%; }
.lg-table--retp th:nth-child(4) { width: 12%; }
.lg-table--retp th:nth-child(5) { width: 12%; }
.lg-table--retp th:nth-child(6) { width: 12%; }
.lg-retact { display: grid; justify-items: center; gap: 6px; }
.lg-act { width: 100%; max-width: 130px; padding: 5px 8px; border-radius: 4px; border: 1px solid; background: #fff; font-size: 11.5px; cursor: pointer; line-height: 1.3; }
.lg-act--green { color: #3c9a33; border-color: #8fd486; background: #ecf8ea; }
.lg-act--amber { color: #b47500; border-color: #ffd27a; background: #fff7e6; }
.lg-act:hover { filter: brightness(.96); }

.lg-searchcard__body { display: grid; gap: 14px; padding: 4px 20px 20px; }
.lg-searchcard__body .lg-field { max-width: 420px; }
.lg-searchcard__body .lg-input { padding-right: 12px; }
.lg-searchcard__btn { display: flex; justify-content: flex-end; }
.lg-check { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; }
.lg-crmb { display: inline-block; padding: 1px 6px; border-radius: 4px; background: #6c757d; color: #fff; font-size: 10px; }
.lg-crmb--astraclair { background: var(--lg-primary); }
.lg-crmb--dermapad { background: #0fa9d6; }
.lg-table tr.is-muted td { opacity: 1; background: #fff1ec; }
.lg-table td .lg-status { white-space: normal; max-width: 100%; padding: 5px 8px; line-height: 1.3; text-align: center; }

/* =====================================================================
   Thanh công cụ trên cùng — giống bản cũ (ngôn ngữ, toàn màn hình,
   tìm kiếm, sáng/tối, thông báo, hồ sơ)
   ===================================================================== */
.topnav { margin: 0 0 0 auto; padding: 0; list-style: none; display: flex; align-items: center; gap: 2px; }
.topnav > li { display: flex; align-items: center; }
.topnav .icon-btn { width: 40px; height: 40px; color: #3f475a; }
.topnav__lang { gap: 6px; padding: 0 10px; font: 600 13px Tahoma, "Segoe UI", sans-serif; color: #3f475a; cursor: default; }
.flag-vn { border-radius: 3px; box-shadow: 0 0 0 1px rgba(0,0,0,.06); }
.theme-ico--light { display: none; }
html.dark .theme-ico--dark { display: none; }
html.dark .theme-ico--light { display: inline; }
.topnav span[data-fs-on], .topnav span[data-fs-off], .theme-ico--dark, .theme-ico--light { line-height: 0; }

.notify summary.icon-btn { position: relative; padding: 0; border-radius: 50%; display: grid; }
.notify__badge {
    position: absolute; top: 3px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px;
    border-radius: 999px; background: #ffaa05; color: #fff; font: 700 11px/18px Tahoma, sans-serif; text-align: center;
}
.notify__panel { width: 340px; max-width: calc(100vw - 24px); padding: 0; background: #fff; border-radius: 10px; overflow: hidden; }
.notify__title { margin: 0; padding: 14px 18px; font: 700 18px Tahoma, "Segoe UI", sans-serif; color: #2f2f3b; border-bottom: 1px solid #e9edf1; }
.notify__list { list-style: none; margin: 0; padding: 8px; max-height: 60vh; overflow: auto; display: grid; gap: 8px; }
.notify__list li { padding: 10px 12px; border-left: 4px solid #7366ff; border-radius: 6px; background: #f8f8fb; font: 13px/1.45 Tahoma, "Segoe UI", sans-serif; color: #3f475a; }
.notify__list li.is-danger { border-color: #fc4438; } .notify__list li.is-warning { border-color: #ffaa05; }
.notify__list li.is-success { border-color: #54ba4a; } .notify__list li.is-secondary { border-color: #838383; }
.notify__list li a { color: #fc4438; font-weight: 700; display: inline; padding: 0; }
.notify__list li a:hover { background: none; text-decoration: underline; }
.notify__list li.notify__empty { border: 0; background: none; text-align: center; color: #8a8a8a; }

.topnav__profile .usermenu summary.profile-media { display: flex; align-items: center; gap: 10px; padding: 4px 8px 4px 4px; border-radius: 10px; margin-left: 6px; }
.profile-media__img { position: relative; width: 35px; height: 35px; flex: none; }
.profile-media__img > * { position: absolute; inset: 0; width: 35px; height: 35px; border-radius: 10px; }
.profile-media__img img { object-fit: cover; background: #fff; }
.profile-media__body { display: grid; line-height: 1.25; text-align: left; font-family: Tahoma, "Segoe UI", sans-serif; max-width: 190px; }
.profile-media__name { font-weight: 700; font-size: 14px; color: #2f2f3b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-media__level { display: flex; align-items: center; gap: 4px; font-size: 12px; color: #8a8a8a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-dropdown { width: 200px; padding: 6px; background: #fff; border-radius: 10px; }
.profile-dropdown a, .profile-dropdown button { padding: 10px 12px; border-radius: 8px; font-family: Tahoma, "Segoe UI", sans-serif; }

.topsearch {
    position: absolute; inset: 0; z-index: 30; display: flex; align-items: center; gap: 10px;
    padding: 0 16px; background: #fff; color: #3f475a;
}
.topsearch input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; font: 15px Tahoma, "Segoe UI", sans-serif; color: inherit; }

@media (max-width: 900px) {
    .topnav > li.topnav__lang, .topnav > li:has([data-fullscreen]) { display: none; }
    .notify__panel { position: fixed; left: 12px; right: 12px; top: calc(var(--topbar-h) - 4px); width: auto; max-width: none; }
    .profile-media__body { display: none; }
}
@media (max-width: 520px) {
    .topnav .icon-btn { width: 36px; height: 36px; }
    .topbar__title { font-size: 16px; }
}

/* =====================================================================
   Nạp data sàn TMĐT — giống phong-ban/sale/nap-data của bản cũ
   ===================================================================== */
.nd-head { padding: 20px 20px 6px; border-bottom: 1px solid var(--lg-line); }
.nd-head h5 { font-size: 18px; margin-bottom: 4px; }
.nd-head p { color: var(--lg-muted); font-size: 13.5px; padding-bottom: 12px; }
.nd-body { padding: 16px 20px 20px; }
.nd-search { display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 12px; border: 1px solid var(--lg-line); border-radius: 8px; background: #fff; margin-bottom: 14px; color: var(--lg-muted); }
.nd-search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; font: inherit; color: #212529; }
.nd-search:focus-within { border-color: #b9b2ff; box-shadow: 0 0 0 .2rem rgba(115, 102, 255, .15); }
.nd-search__x { display: inline-flex; color: var(--lg-muted); }
.nd-search em { font-style: normal; font-size: 12.5px; white-space: nowrap; }
.nd-search--sm { height: 38px; max-width: 520px; margin: 10px 0 14px; border-color: #d1fae5; }

.nd-utils { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; padding: 6px 0 12px; border-bottom: 1px dashed #e5e7eb; margin-bottom: 14px; }
.nd-util { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; font-size: 13px; font-weight: 500; color: #6b7280; background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; box-shadow: 0 1px 2px rgba(0,0,0,.05); transition: .2s; }
.nd-util:hover { color: #4f46e5; background: #eef2ff; border-color: #c7d2fe; }
.nd-util.is-active { color: #fff; background: linear-gradient(135deg, #6366f1, #8b5cf6); border-color: #6366f1; }
.nd-util--violet:not(.is-active) { color: #7c3aed; border-color: #c4b5fd; background: #f5f3ff; }
.nd-util--grad { color: #fff; background: linear-gradient(135deg, #6366f1, #8b5cf6); border-color: #6366f1; font-weight: 600; }
.nd-util--grad:hover { color: #fff; filter: brightness(1.06); background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.nd-util--rose:not(.is-active) { color: #e11d48; border-color: #fecdd3; background: #fff1f2; font-weight: 600; }

.nd-tabs { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px; background: #f8f8fb; border-radius: 10px; margin-bottom: 16px; }
.nd-tab { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 8px; color: var(--lg-ink-2); font-size: 14px; border: 1px solid transparent; }
.nd-tab:hover { background: var(--lg-primary-soft); color: var(--lg-primary); }
.nd-tab.is-active { background: var(--lg-primary); color: #fff; }
.nd-tab--pink:not(.is-active) { background: #fdf2f8; color: #be185d; border: 1px dashed #f472b6; }
.nd-tab--violet:not(.is-active) { background: #f5f3ff; color: #7c3aed; border: 1px dashed #c4b5fd; }
.nd-badge { display: inline-block; min-width: 22px; padding: 1px 7px; border-radius: 999px; background: #fc4438; color: #fff; font-size: 12px; font-weight: 700; text-align: center; }
.nd-tab--pink .nd-badge { background: #ec4899; } .nd-tab--violet .nd-badge { background: #8b5cf6; } .nd-tab--gray .nd-badge { background: #838383; }
.nd-tab.is-active .nd-badge { background: rgba(255,255,255,.28); }

.nd-cats { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px; margin-bottom: 16px; background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 8px; }
.nd-cats--sub { background: #fff; padding: 8px 0; border: 0; margin-top: -8px; }
.nd-cat { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border: 1px solid #d1d5db; border-radius: 6px; background: #fff; color: #374151; font-size: 13.5px; font-weight: 500; transition: .2s; }
.nd-cat:hover { border-color: #6366f1; background: #eef2ff; color: #4f46e5; }
.nd-cat > span:last-child { background: rgba(99, 102, 241, .1); padding: 1px 8px; border-radius: 10px; font-size: 12px; font-weight: 600; }
.nd-cat.is-active { background: linear-gradient(135deg, #667eea, #764ba2); border-color: #667eea; color: #fff; box-shadow: 0 4px 6px rgba(102, 126, 234, .35); }
.nd-cat.is-active > span:last-child { background: rgba(255,255,255,.35); }
.nd-cat--warn:not(.is-active) { border-color: #f59e0b; color: #92400e; background: #fffbeb; }
.nd-cat .lg-src { margin-right: 0; }

.nd-banner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border-radius: 12px; margin-bottom: 16px; border: 1.5px solid; }
.nd-banner > div:nth-child(2) { flex: 1; min-width: 220px; display: grid; gap: 2px; }
.nd-banner strong { font-size: 14.5px; }
.nd-banner small { color: #6b7280; }
.nd-banner__ic { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; color: #fff; flex: none; }
.nd-banner__total { color: #fff; padding: 7px 14px; border-radius: 8px; font-size: 13px; display: inline-flex; gap: 6px; align-items: center; }
.nd-banner__act { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.nd-banner--pink { background: linear-gradient(135deg, #fdf2f8, #fce7f3); border-color: #fbcfe8; } .nd-banner--pink strong { color: #9d174d; } .nd-banner--pink .nd-banner__ic, .nd-banner--pink .nd-banner__total { background: #db2777; }
.nd-banner--violet { background: linear-gradient(135deg, #f5f3ff, #ede9fe); border-color: #ddd6fe; } .nd-banner--violet strong { color: #5b21b6; } .nd-banner--violet .nd-banner__ic, .nd-banner--violet .nd-banner__total { background: #7c3aed; }
.nd-banner--amber { background: linear-gradient(135deg, #fffbeb, #fef3c7); border-color: #fde68a; } .nd-banner--amber strong { color: #92400e; } .nd-banner--amber .nd-banner__ic { background: #f59e0b; }
.nd-tagpill { display: inline-flex; align-items: center; gap: 3px; margin-left: 6px; padding: 2px 8px; border-radius: 20px; background: #d97706; color: #fff; font-size: 11px; font-weight: 600; }
.nd-limit { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; background: #fff; border: 1px solid #fde68a; border-radius: 8px; font-size: 12.5px; color: #6b7280; }
.nd-limit input { width: 52px; border: 0; outline: 0; text-align: center; font-weight: 700; color: #dc2626; background: transparent; font-size: 14px; }

.nd-btn { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 30px; padding: 4px 10px; border: 1px solid transparent; border-radius: 6px; font: 600 12.5px Tahoma, "Segoe UI", sans-serif; cursor: pointer; white-space: nowrap; color: #fff; transition: filter .15s; }
.nd-btn:hover:not(:disabled) { filter: brightness(.94); }
.nd-btn:disabled { opacity: .55; cursor: default; }
.nd-btn--primary { background: var(--lg-primary); } .nd-btn--green { background: #54ba4a; } .nd-btn--sky { background: #16c7f9; }
.nd-btn--amber { background: #fbbf24; color: #3b2a00; border-color: #f59e0b; } .nd-btn--orange { background: linear-gradient(135deg, #f59e0b, #d97706); }
.nd-btn--red { background: #fc4438; } .nd-btn--gray { background: #838383; } .nd-btn--blue { background: #3b82f6; }
.nd-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-top: 4px; }
.nd-btns--center { display: inline-flex; flex-wrap: wrap; justify-content: center; }

.nd-bulk { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 16px; margin-bottom: 14px; border: 1px solid #f5a623; border-radius: 8px; background: linear-gradient(135deg, #ffecd2, #fcb69f); color: #8b5a00; animation: pop .2s var(--ease); }
.nd-bulk b { font-size: 17px; color: #d35400; }
.nd-copybar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 14px; background: #f0f9ff; border: 1px solid #bae6fd; border-radius: 8px; font-size: 13.5px; }
.nd-copybar > span:first-child { flex: 1; min-width: 220px; display: inline-flex; gap: 6px; align-items: center; }
.nd-copybar .nd-limit { border-color: #bae6fd; }

.nd-table { font-size: 13.5px; }
.nd-table td { vertical-align: middle; }
.nd-col-cb { width: 36px; } .nd-col-src { min-width: 180px; } .nd-col-eye { width: 52px; } .nd-col-act { width: 196px; }
.nd-table th { padding: 12px 8px; white-space: nowrap; }
.nd-table td { padding: 10px 8px; }
.nd-act .nd-btn { padding: 4px 6px; font-size: 12px; }
.nd-table td .nd-src small span { word-break: break-all; }
.nd-table input[type="checkbox"], .nd-pendbar input[type="checkbox"] { width: 18px; height: 18px; accent-color: #667eea; cursor: pointer; }
.nd-table tr.is-picked td { background: #fff9ef; }
.nd-table tr.is-checking td { background: #fff9ef; }
.nd-table tr.is-gone { opacity: .35; transition: opacity .35s; }
.nd-src { display: flex; gap: 8px; align-items: flex-start; }
.nd-src__ic { padding: 4px; border-radius: 10px; border: 1px solid #ebebeb; background: #f5f5f5; line-height: 0; margin-top: 2px; }
.nd-src__ic .lg-src { width: 22px; height: 22px; margin: 0; border-radius: 5px; }
.nd-src small { display: block; color: var(--lg-muted); font-size: 12.5px; line-height: 1.5; }
.nd-src small span { color: var(--lg-ink-2); }
.nd-st { display: inline-block; margin-top: 3px; padding: 2px 8px; border-radius: 5px; font-size: 11px; font-weight: 600; }
.nd-st--danger { background: #fee2e2; color: #dc2626; } .nd-st--success { background: #d1fae5; color: #059669; } .nd-st--info { background: #dbeafe; color: #2563eb; }
.nd-st--warning { background: #fef3c7; color: #d97706; } .nd-st--pink { background: #fce7f3; color: #db2777; } .nd-st--secondary { background: #e5e7eb; color: #374151; }
.nd-eye { width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(22, 199, 249, .12); color: #007bff; cursor: pointer; display: inline-grid; place-items: center; }
.nd-eye:hover { background: rgba(22, 199, 249, .22); }
.nd-in { background: #f9f9f9; }
.nd-in input, .nd-in select, .nd-mini-select { width: 100%; min-width: 92px; height: 34px; padding: 4px 8px; border: 1px solid #d1d5db; border-radius: 6px; background: #fff; font: 13px Tahoma, "Segoe UI", sans-serif; color: #212529; outline: none; }
.nd-in input:focus, .nd-in select:focus { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99, 102, 241, .12); }
.nd-in input.is-filled { background: #bbf7d0; transition: background .5s; }
.nd-in select.is-changed { border-color: #f59e0b; background: #fffbeb; }
.nd-act select { font-size: 12px; height: 30px; }
.nd-items { display: grid; border-radius: 4px; overflow: hidden; min-width: 120px; }
.nd-items > div { padding: 3px 8px; background: #f9f9f9; font-size: 13px; }
.nd-items > div + div { border-top: 1px solid #e5e5e5; }
.nd-raw { font-size: 12.5px; color: var(--lg-muted); max-width: 200px; }
.nd-items { max-width: 170px; }
.nd-money { font-weight: 700; white-space: nowrap; }
.nd-none { text-align: center; padding: 30px !important; color: #17a2b8; }
.nd-x { display: inline-block; margin-right: 5px; padding: 0 7px; border-radius: 4px; background: #3b82f6; color: #fff; font-size: 12px; font-weight: 600; }
.nd-sku small { color: #6b7280; font-size: 11px; }
.nd-sku div { font-size: 12.5px; word-break: break-all; }

.nd-pager { display: flex; justify-content: center; gap: 6px; padding: 16px 0 4px; flex-wrap: wrap; }
.nd-pager a { min-width: 32px; height: 32px; padding: 0 8px; display: inline-grid; place-items: center; border-radius: 6px; background: #f1f1f5; color: #555; font-size: 13px; }
.nd-pager a:hover { background: #e4e2ff; }
.nd-pager a.is-active { background: var(--lg-primary); color: #fff; }
.nd-pager a.is-off { opacity: .45; pointer-events: none; }
.nd-pager span { align-self: center; color: #999; }

.nd-detail__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
.nd-detail__row { padding: 8px 0; border-bottom: 1px solid #eee; font-size: 14px; }
.nd-detail__row > div { margin-top: 4px; padding: 8px 12px; background: #f8f9fa; border-radius: 4px; word-break: break-word; }
.nd-jt-summary { padding: 10px 14px; margin: 4px 0 12px; border-left: 4px solid #f59e0b; border-radius: 8px; background: #fffbeb; font-size: 13.5px; }
.nd-jt-scroll { max-height: 420px; overflow: auto; }
.nd-mini { font-size: 12.5px; }
.nd-hint { color: var(--lg-muted); font-size: 13.5px; margin: 4px 0 12px; }
.nd-note { padding: 10px 14px; margin-bottom: 12px; border-radius: 8px; background: #fffbeb; border: 1px solid #fde68a; color: #92400e; font-size: 13px; display: flex; gap: 6px; align-items: flex-start; }
.nd-ta-label { display: flex; justify-content: space-between; font-weight: 700; font-size: 13.5px; margin-bottom: 6px; }
.nd-ta-label span { font-weight: 600; font-size: 12px; padding: 2px 8px; border-radius: 6px; background: #e0f2fe; color: #0369a1; }
.nd-ta { width: 100%; padding: 10px 12px; border: 1.5px solid #cbd5e1; border-radius: 8px; background: #fafafa; font: 13.5px/1.6 Consolas, "Courier New", monospace; resize: vertical; }
.nd-chips { display: flex; flex-wrap: wrap; gap: 4px; max-height: 140px; overflow: auto; margin-top: 8px; }
.nd-chip { display: inline-block; margin: 1px 3px 1px 0; padding: 2px 8px; border-radius: 6px; background: #eef2ff; color: #4338ca; font-size: 12px; }

.nd-shifts { margin-bottom: 14px; border: 1px solid #e5e7eb; border-radius: 10px; overflow: hidden; }
.nd-shifts summary { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: #f8fafc; cursor: pointer; font-weight: 700; font-size: 14px; list-style: none; }
.nd-shifts summary::-webkit-details-marker { display: none; }
.nd-shifts summary .muted { font-weight: 400; font-size: 12.5px; margin-left: auto; }
.nd-shifts table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.nd-shifts td { padding: 7px 14px; border-top: 1px solid #f1f5f9; }
.nd-shifts__ca { width: 110px; font-weight: 600; white-space: nowrap; }
.nd-shifts__n { width: 90px; font-weight: 700; color: var(--lg-primary); white-space: nowrap; }
.nd-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
.nd-dot--0 { background: #f0ad4e; } .nd-dot--1 { background: #17a2b8; } .nd-dot--2 { background: #6f42c1; }
.nd-crmbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 8px 10px; margin-bottom: 14px; border: 1px solid #e5e7eb; border-radius: 10px; font-size: 13px; font-weight: 600; }
.nd-crmbar > span { display: inline-flex; align-items: center; gap: 6px; color: #374151; }
.nd-crmbar small { margin-left: auto; font-weight: 400; }
.nd-crmpill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 20px; border: 1px solid #d1d5db; color: #374151; }
.nd-crmpill b { padding: 0 7px; border-radius: 10px; background: #838383; color: #fff; font-size: 11.5px; }
.nd-crmpill.is-active { background: var(--lg-primary); border-color: var(--lg-primary); color: #fff; } .nd-crmpill.is-active b { background: #fff; color: var(--lg-primary); }
.nd-crmpill--green { border-color: #54ba4a; } .nd-crmpill--green b { background: #54ba4a; }
.nd-crmpill--green.is-active { background: #54ba4a; border-color: #54ba4a; } .nd-crmpill--green.is-active b { color: #54ba4a; }
.nd-pendbar { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 10px 14px; border-radius: 10px; background: #f0fdf4; border: 1px solid #bbf7d0; font-size: 13.5px; }
.nd-check, .nd-assign { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.nd-assign select { height: 32px; min-width: 220px; border: 1px solid #d1d5db; border-radius: 6px; padding: 0 8px; background: #fff; font: inherit; font-weight: 400; }
.nd-pendtotal { margin-left: auto; color: var(--lg-muted); display: inline-flex; gap: 5px; align-items: center; }
.nd-emptybox { display: grid; justify-items: center; gap: 6px; padding: 40px 10px; color: #54ba4a; text-align: center; }
.nd-emptybox h5 { font-size: 17px; }

.nd-section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.nd-section-head h5 { font-size: 16px; display: inline-flex; align-items: center; gap: 8px; }
.nd-section-head .nd-badge { background: var(--lg-primary); }
.nd-grid2, .nd-grid3 { display: grid; gap: 12px; grid-template-columns: 1fr; }
.nd-plist { display: grid; gap: 4px; max-height: 300px; overflow: auto; padding: 8px; border: 1px solid var(--lg-line); border-radius: 8px; }
.nd-plist--cols { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); max-height: 240px; }
.nd-prow { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 6px; cursor: pointer; font-size: 13.5px; }
.nd-prow:hover { background: #f5f3ff; }
.nd-prow span { flex: 1; }
.nd-prow input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--lg-primary); }
.nd-qty { width: 64px; height: 28px; border: 1px solid #d1d5db; border-radius: 6px; text-align: center; }
.nd-qty:disabled { opacity: .4; }
.nd-filter { margin-bottom: 8px; }
.nd-grip { cursor: grab; color: #9ca3af; }
.nd-order { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; background: var(--lg-primary-soft); color: var(--lg-primary); font-weight: 700; font-size: 12px; }
tr.is-dragging td { background: #eef2ff; opacity: .7; }
.nd-addsku { display: flex; gap: 8px; margin-bottom: 14px; max-width: 560px; }
.nd-addsku .lg-input { padding-right: 12px; }
.nd-logfilter { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 14px; align-items: end; }
.nd-gap { display: inline-block; padding: 2px 8px; border-radius: 5px; font-size: 12px; background: #f3f4f6; color: #374151; }
.nd-gap--g { background: #dcfce7; color: #166534; } .nd-gap--b { background: #dbeafe; color: #1e40af; } .nd-gap--y { background: #fef9c3; color: #713f12; }
.nd-perms { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; max-height: 60vh; overflow: auto; margin-bottom: 14px; }
.nd-perm { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid #e5e7eb; border-radius: 10px; cursor: pointer; }
.nd-perm.is-on { border-color: #a7f3d0; background: #f0fdf4; }
.nd-perm input { width: 17px; height: 17px; accent-color: #54ba4a; }
.nd-perm__av { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--lg-primary-soft); color: var(--lg-primary); font-weight: 700; flex: none; }
.nd-perm__name { display: grid; min-width: 0; font-size: 13.5px; }
.nd-perm__name code { font-size: 12px; background: none; padding: 0; color: #64748b; }
.t-r { text-align: right; }
.nd-nw { white-space: nowrap; }
@media (min-width: 700px) {
    .nd-grid2 { grid-template-columns: 1fr 1fr; }
    .nd-grid3 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 700px) {
    .nd-body { padding: 12px; }
    .nd-detail__grid { grid-template-columns: 1fr; }
    .nd-utils { justify-content: flex-start; }
    .nd-tab { flex: 1 1 calc(50% - 8px); justify-content: center; font-size: 13px; padding: 8px; }
    .nd-pendtotal, .nd-crmbar small { margin-left: 0; }
    .nd-table { min-width: 1000px; }
}

/* ===================== CSKH theo thương hiệu (cs-*) ===================== */
.cs-muted { color: #94a3b8; font-size: 12px; }
.cs-c { text-align: center !important; }
.cs-head { display: flex; align-items: center; gap: 10px; margin: 0 2px 14px; font-size: 15px; font-weight: 800; color: #1e293b; letter-spacing: .3px; }
.cs-head__icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: #eef2ff; color: #4f46e5; }

.cs-kpis { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); margin-bottom: 16px; }
@media (min-width: 1280px) { .cs-kpis--7 { grid-template-columns: repeat(7, minmax(0, 1fr)); } }
.cs-kpi { --c: #64748b; --bg: #f8fafc; position: relative; display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: 12px; background: #fff; border: 1px solid #e9edf3;
    color: inherit; text-decoration: none; box-shadow: 0 1px 2px rgba(15, 23, 42, .04); transition: transform .15s, box-shadow .15s, border-color .15s; min-width: 0; }
.cs-kpi:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(15, 23, 42, .07); border-color: var(--c); }
.cs-kpi.is-active { background: var(--bg); border-color: var(--c); box-shadow: 0 0 0 1px var(--c) inset; }
.cs-kpi.is-locked { opacity: .4; filter: grayscale(1); pointer-events: none; }
.cs-kpi__icon { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--bg); color: var(--c); }
.cs-kpi.is-active .cs-kpi__icon { background: #fff; }
.cs-kpi__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cs-kpi__label { display: flex; align-items: flex-start; justify-content: space-between; gap: 4px; min-height: 26px; font-size: 10.5px; font-weight: 700; color: #64748b; line-height: 1.25; }
.cs-kpi__count { font-size: 20px; font-weight: 800; color: #0f172a; line-height: 1.2; white-space: nowrap; }
.cs-kpi--amber { --c: #f59e0b; --bg: #fffbeb; } .cs-kpi--sky { --c: #0ea5e9; --bg: #f0f9ff; } .cs-kpi--violet { --c: #7366ff; --bg: #f5f3ff; }
.cs-kpi--green { --c: #10b981; --bg: #ecfdf5; } .cs-kpi--gray { --c: #64748b; --bg: #f1f5f9; } .cs-kpi--red { --c: #ef4444; --bg: #fef2f2; } .cs-kpi--pink { --c: #ec4899; --bg: #fdf2f8; }
.cs-tip { position: relative; flex: none; display: inline-grid; place-items: center; width: 14px; height: 14px; border-radius: 50%; background: #e2e8f0; color: #475569; font-size: 9px; font-style: normal; cursor: help; }
.cs-tip > span { position: absolute; z-index: 20; bottom: calc(100% + 6px); right: -6px; width: min(220px, 70vw); padding: 8px 10px; border-radius: 8px;
    background: #1e293b; color: #fff; font-size: 11.5px; font-weight: 500; line-height: 1.4; text-align: left; display: none; pointer-events: none; }
.cs-tip:hover > span, .cs-tip:focus > span { display: block; }

.cs-dash { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); margin-bottom: 16px; }
@media (min-width: 900px) { .cs-dash { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); } }
.cs-dash__col { display: flex; flex-direction: column; justify-content: space-between; gap: 10px; padding: 16px 18px; border-radius: 14px; background: #fff; border: 1px solid #e9edf3; }
.cs-dash__col h6 { font-size: 14px; font-weight: 700; color: #1e293b; }
.cs-pct { font-size: 30px; font-weight: 800; color: #0f172a; line-height: 1; }
.cs-seg { display: flex; gap: 3px; margin-top: 8px; }
.cs-seg i { flex: 1; height: 8px; border-radius: 3px; background: #e2e8f0; }
.cs-seg i.is-on { background: linear-gradient(90deg, #7366ff, #a78bfa); }
.cs-chart__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.cs-legend { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: #64748b; }
.cs-legend i { width: 8px; height: 8px; border-radius: 50%; margin-left: 6px; }
.cs-chart { width: 100%; height: auto; overflow: visible; }
.cs-chart text { fill: #94a3b8; font-size: 9px; font-weight: 600; }
.cs-chart text.is-today { fill: #4f46e5; font-weight: 800; }

.cs-filter { position: relative; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 10px 12px; margin-bottom: 12px; border-radius: 12px; background: #fff; border: 1px solid #e9edf3; }
.cs-chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 8px; border-radius: 8px; border: 1px solid #e2e8f0; background: #f8fafc; font-size: 12px; }
.cs-chip > span:first-child, .cs-sp__toggle > span { display: inline-flex; align-items: center; gap: 4px; color: #475569; font-weight: 700; white-space: nowrap; }
.cs-chip.is-on { border-color: #a5b4fc; background: #eef2ff; }
.cs-chip select, .cs-chip input { height: 26px; border: 1px solid #e2e8f0; border-radius: 6px; background: #fff; font-size: 12px; padding: 0 6px; color: #1e293b; max-width: 160px; }
.cs-chip input[type="number"] { width: 70px; }
.cs-chip input[type="date"] { width: 128px; }
.cs-filter__div { width: 1px; height: 24px; background: #e2e8f0; }
.cs-apply { display: inline-flex; align-items: center; gap: 4px; height: 34px; padding: 0 14px; border: 0; border-radius: 8px; background: #4f46e5; color: #fff; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.cs-apply:hover { background: #4338ca; }
.cs-reset { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid #fecaca; border-radius: 8px; background: #fef2f2; color: #ef4444; cursor: pointer; }
.cs-chip--sp { position: relative; padding: 0; }
.cs-sp__toggle { display: inline-flex; align-items: center; gap: 6px; height: 100%; padding: 0 8px; border: 0; background: none; font: inherit; cursor: pointer; }
.cs-sp__toggle b { font-weight: 600; color: #1e293b; }
.cs-sp { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; width: 300px; border-radius: 10px; background: #fff; border: 1px solid #e2e8f0; box-shadow: 0 12px 30px rgba(15, 23, 42, .14); overflow: hidden; }
.cs-sp__search { width: calc(100% - 20px); margin: 10px; height: 32px; border: 1px solid #e2e8f0; border-radius: 6px; padding: 0 10px; font-size: 12.5px; }
.cs-sp__mode { display: flex; gap: 10px; padding: 6px 12px; background: #f8fafc; border-block: 1px solid #f1f5f9; font-size: 11.5px; color: #64748b; font-weight: 600; }
.cs-sp__mode label { display: inline-flex; align-items: center; gap: 3px; font-weight: 500; color: #334155; cursor: pointer; }
.cs-sp__list { max-height: 260px; overflow-y: auto; padding: 4px 0; }
.cs-sp__list label { display: flex; align-items: center; gap: 8px; padding: 6px 12px; font-size: 12.5px; cursor: pointer; }
.cs-sp__list label:hover { background: #f8fafc; }
.cs-sp__list label[hidden] { display: none; }
.cs-sp__foot { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-top: 1px solid #f1f5f9; font-size: 12px; }
.cs-sp__foot .lg-link { color: #2563eb; }
.cs-sp__foot .lg-link--danger { color: #ef4444; }
.cs-sp__foot .cs-apply { margin-left: auto; height: 28px; padding: 0 10px; }

.cs-search { padding: 12px; margin-bottom: 12px; border-radius: 12px; background: #fff; border: 1px solid #e9edf3; }
.cs-search__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.cs-search__box { flex: 1 1 300px; min-width: 0; display: flex; align-items: center; gap: 6px; height: 38px; padding: 0 4px 0 12px; border: 1px solid #e2e8f0; border-radius: 9px; background: #f8fafc; color: #94a3b8; }
.cs-search__box input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; font-size: 13px; color: #0f172a; outline: none; }
.cs-search__go { display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 12px; border: 0; border-radius: 7px; background: #0f172a; color: #fff; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.cs-search__clear { height: 30px; padding: 0 10px; border: 0; border-radius: 7px; background: none; color: #64748b; font-size: 12.5px; cursor: pointer; }
.cs-search__opts { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cs-pillcheck { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 10px; border: 1px solid #e2e8f0; border-radius: 15px; background: #fff; font-size: 12px; color: #334155; cursor: pointer; }
.cs-pillcheck span { display: inline-flex; align-items: center; gap: 4px; }
.cs-pillcheck:has(input:checked) { border-color: #a5b4fc; background: #eef2ff; color: #3730a3; }
.cs-pillcheck--btn { font: inherit; font-size: 12px; }
.cs-bulkphones { margin-top: 10px; padding: 10px; border-radius: 8px; background: #f8fafc; border: 1px dashed #cbd5e1; font-size: 12.5px; }
.cs-bulkphones label { display: block; font-weight: 600; color: #334155; margin-bottom: 6px; }
.cs-bulkphones textarea { height: auto; padding: 8px 10px; font-size: 12.5px; }
.cs-bulkphones__act { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.cs-showall { display: flex; align-items: center; gap: 10px; padding: 8px 12px; margin-bottom: 12px; border: 1px solid #e2e8f0; border-radius: 8px; background: #f8fafc; flex-wrap: wrap; }
.cs-showall .lg-btn { gap: 6px; }
.cs-showall .lg-btn[aria-pressed="true"] { background: #eef2ff; color: #3730a3; border-color: #a5b4fc; }

.cs-card .lg-card__head h5 { display: inline-flex; align-items: center; gap: 8px; font-size: 16px; }
.cs-total { padding: 3px 10px; border-radius: 12px; background: #eef2ff; color: #4338ca; font-size: 12px; font-weight: 700; }
.cs-total:empty { display: none; }
.cs-tagbar { margin: 0 0 0; border-radius: 0; border-inline: 0; }
.cs-table { min-width: 780px; }
.cs-table td { padding: 10px 8px; }
.cs-table th { padding: 10px 8px; }
.cs-table th { font-size: 11.5px; letter-spacing: .3px; color: #475569; vertical-align: middle; }
.cs-table td { vertical-align: top; font-size: 13px; }
.cs-idx { color: #94a3b8; font-size: 12px; white-space: nowrap; min-width: 34px; }
.cs-sorts { display: inline-flex; gap: 1px; margin-left: 4px; vertical-align: middle; }
.cs-sorts button { padding: 0 2px; border: 0; background: none; color: #cbd5e1; font-size: 8px; cursor: pointer; line-height: 1; }
.cs-sorts button:hover, .cs-sorts button.is-active { color: #4f46e5; }
.cs-cust { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 3px; min-width: 140px; }
.cs-cust__name { display: flex; align-items: center; justify-content: center; gap: 5px; flex-wrap: wrap; color: #1e293b; }
.cs-cust__name .lg-buys { border: 0; cursor: pointer; }
.cs-cust__phone { font-size: 12px; color: #64748b; }
.cs-staff { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; color: #7c3aed; font-weight: 600; }
.cs-callbtn { display: inline-flex; align-items: center; gap: 4px; padding: 3px 12px; border: 0; border-radius: 5px; background: #10b981; color: #fff; font-size: 11.5px; font-weight: 800; cursor: pointer; box-shadow: 0 1px 2px rgba(16, 185, 129, .3); }
.cs-callbtn:hover { background: #059669; }
.cs-callbtn.is-live { background: #f59e0b; animation: cs-pulse 1.4s infinite; }
.cs-callbtn:disabled { opacity: .6; cursor: wait; }
@keyframes cs-pulse { 50% { box-shadow: 0 0 0 4px rgba(245, 158, 11, .25); } }
.cs-busycall { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 5px; background: #fef3c7; color: #92400e; font-size: 11px; font-weight: 700; }
.cs-quicktag { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border: 1px dashed #cbd5e1; border-radius: 5px; background: #fff; color: #64748b; font-size: 10.5px; cursor: pointer; }
.cs-quicktag:hover { border-color: #7366ff; color: #4f46e5; }
.cs-cust .lg-tagbox { font: inherit; }
.cs-addr { display: block; max-width: 110px; color: #334155; }
.cs-skin { display: flex; flex-direction: column; gap: 4px; max-width: 200px; }
.cs-skin > span:first-child { color: #334155; }
.cs-reason { display: inline-flex; align-items: flex-start; gap: 4px; padding: 3px 6px; border-radius: 5px; background: #fff7ed; color: #9a3412; font-size: 11.5px; }
.cs-recv { display: block; font-weight: 600; color: #1e293b; white-space: nowrap; }
.cs-appt { display: inline-block; padding: 2px 7px; border-radius: 5px; background: #f1f5f9; color: #334155; font-weight: 700; font-size: 12px; }
.cs-appt.is-over { background: #fef2f2; color: #dc2626; }
.cs-appt.is-future { background: #ecfdf5; color: #047857; }
.cs-counters { display: flex; gap: 8px; margin-top: 4px; font-size: 11px; color: #64748b; }
.cs-new { display: inline-block; margin-top: 4px; padding: 1px 6px; border-radius: 4px; background: #e0e7ff; color: #4338ca; font-size: 10.5px; font-weight: 700; }
.cs-last { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #475569; min-width: 120px; max-width: 200px; }
.cs-last > span:first-child { display: inline-flex; align-items: center; gap: 4px; }
.cs-last .lg-link { display: inline-flex; align-items: center; gap: 4px; color: #4f46e5; font-size: 12px; font-weight: 600; }
.cs-upsell { padding: 4px 6px; border-radius: 5px; background: #fdf4ff; color: #86198f; font-size: 11.5px; }
.cs-stopped { display: inline-block; padding: 2px 8px; border-radius: 5px; background: #f1f5f9; color: #475569; font-size: 11.5px; font-weight: 700; }
.cs-bulk { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 20px; border-top: 1px solid #f1f5f9; background: #f8fafc; font-size: 12.5px; border-radius: 0 0 15px 15px; }
.cs-bulk__count { display: inline-flex; align-items: center; gap: 4px; padding: 4px 12px; border-radius: 20px; background: #111827; color: #fff; font-weight: 700; }
.cs-bulk label { font-weight: 600; color: #475569; }

/* bảng gọi */
.cs-call { width: min(1160px, 96vw); max-width: 96vw; padding: 0; border-radius: 14px; overflow: hidden; }
.cs-call__head { display: flex; align-items: center; gap: 20px; padding: 14px 20px; background: linear-gradient(135deg, #10b981, #059669); color: #fff; }
.cs-call__name { margin: 0; font-size: 18px; font-weight: 700; }
.cs-call__phone { margin: 0; display: inline-flex; align-items: center; gap: 4px; font-size: 13px; opacity: .92; }
.cs-call__timer { font-size: 26px; font-weight: 700; letter-spacing: 2px; font-variant-numeric: tabular-nums; }
.cs-call__note { flex: 1; text-align: right; font-size: 12px; opacity: .85; }
.cs-call__body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 16px 20px 20px; max-height: calc(92vh - 70px); overflow-y: auto; }
@media (min-width: 900px) { .cs-call__body { grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); } }
.cs-call__tags { padding: 12px; border-radius: 10px; background: #f8fafc; border: 1px solid #e2e8f0; }
.cs-call__tagshead { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; font-size: 13px; }
.cs-call__tagshead b { display: inline-flex; align-items: center; gap: 6px; color: #1e293b; }
.cs-live { padding: 3px 8px; border-radius: 5px; border: 1px solid #cbd5e1; background: #f1f5f9; color: #64748b; font-size: 11px; font-weight: 700; max-width: 50%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-live.is-ok { background: #ecfdf5; border-color: #6ee7b7; color: #047857; }
.cs-call__groups { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 8px; }
.cs-gtab { flex: 1 1 auto; padding: 6px 10px; border: 1px solid #e2e8f0; border-radius: 7px; background: #fff; color: #334155; font-size: 11.5px; font-weight: 700; cursor: pointer; }
.cs-gtab.is-active { background: var(--tone); border-color: var(--tone); color: #fff; }
.cs-call__taglist { display: flex; flex-wrap: wrap; gap: 6px; }
.cs-tagbtn { padding: 6px 10px; border: 1px solid color-mix(in srgb, var(--tone, #64748b) 40%, #fff); border-radius: 7px; background: #fff; color: #1e293b; font-size: 12px; cursor: pointer; text-align: left; }
.cs-tagbtn:hover { border-color: var(--tone); background: color-mix(in srgb, var(--tone) 8%, #fff); }
.cs-tagbtn.is-active { background: var(--tone); border-color: var(--tone); color: #fff; font-weight: 700; }
.cs-call__sub { display: flex; align-items: center; gap: 6px; margin: 14px 0 6px; font-size: 13px; font-weight: 700; color: #1e293b; }
.cs-call__orders { max-height: 220px; overflow-y: auto; border: 1px solid #f1f5f9; border-radius: 8px; }
.cs-call__right { display: flex; flex-direction: column; gap: 10px; }
.cs-call__right .field { display: flex; flex-direction: column; gap: 4px; }
.cs-call__right textarea { height: auto; padding: 8px 10px; resize: vertical; }
.cs-call__picked { padding: 10px; border-radius: 8px; border: 1px solid #e2e8f0; }
.cs-call__pickedhead { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; font-size: 12.5px; }
.cs-req { color: #dc2626; font-size: 10.5px; font-weight: 800; }
.cs-req.is-ok { color: #059669; }
.cs-call__preview { padding: 7px 10px; border-radius: 7px; background: #fffbeb; border: 1px dashed #f59e0b; font-size: 12px; color: #b45309; line-height: 1.35; }
.cs-call__preview.is-ok { display: flex; flex-direction: column; background: #ecfdf5; border-color: #10b981; color: #065f46; }
.cs-saved { margin: 0; min-height: 16px; font-size: 11.5px; color: #059669; }
.cs-call__acts { display: flex; gap: 6px; flex-wrap: wrap; }
.cs-act { flex: 1 1 80px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; height: 34px; padding: 0 8px; border: 0; border-radius: 7px; color: #fff; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.cs-act:disabled { opacity: .4; cursor: not-allowed; }
.cs-act--gray { background: #64748b; } .cs-act--green { background: #10b981; } .cs-act--red { background: #ef4444; } .cs-act--blue { background: #4f46e5; }
.cs-act:not(:disabled):hover { filter: brightness(.93); }
.cs-call__hint { margin: 0; min-height: 16px; }
.cs-endcall { display: inline-flex; align-items: center; justify-content: center; gap: 6px; width: 100%; height: 36px; border: 0; border-radius: 7px; background: #f59e0b; color: #fff; font-size: 13px; font-weight: 700; cursor: pointer; }
.cs-endcall:hover { background: #d97706; }

.cs-confirm { width: min(440px, 94vw); }
.cs-confirm__body { display: flex; flex-direction: column; gap: 12px; padding: 4px 20px 8px; }
.cs-confirm__body p { margin: 0; color: #475569; font-size: 13.5px; }
.cs-confirm__body .field { display: flex; flex-direction: column; gap: 4px; }
.cs-confirm__body textarea { height: auto; padding: 8px 10px; }
.cs-confirm .dialog__foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 18px; }
.cs-hist { width: min(640px, 94vw); }
.cs-hist__body { padding: 0 20px 20px; max-height: 70vh; overflow-y: auto; }
.cs-histlog { font-size: 13px; line-height: 1.5; color: #334155; }
.cs-histlog p { margin: 0 0 6px; }
.cs-olist { list-style: none; margin: 0; padding: 0; }
.cs-olist li { padding: 8px 10px; border-bottom: 1px solid #f1f5f9; font-size: 12.5px; }
.cs-olist li:last-child { border-bottom: 0; }
.cs-olist__top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cs-olist__top .lg-link { color: #4f46e5; }
.cs-olist__money { margin-left: auto; color: #0f172a; }
.cs-olist__items { color: #334155; margin: 2px 0; }
.cs-qt { display: flex; flex-direction: column; gap: 12px; }
.cs-qt h6 { margin: 0 0 6px; font-size: 12.5px; color: var(--tone); }
.cs-qt section > div { display: flex; flex-wrap: wrap; gap: 6px; }
@media (max-width: 640px) {
    .cs-filter { gap: 6px; }
    .cs-chip { flex: 1 1 100%; justify-content: space-between; }
    .cs-chip select, .cs-chip input { max-width: none; flex: 1; }
    .cs-sp { width: calc(100vw - 48px); }
    .cs-filter__div { display: none; }
    .cs-chip input[type="date"] { width: auto; min-width: 0; }
    .cs-search__box { flex-basis: 100%; }
    .cs-search__go { padding: 0 8px; }
    .cs-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cs-call__head { flex-wrap: wrap; gap: 8px 16px; }
    .cs-call__note { flex-basis: 100%; text-align: left; }
}
