/* Claude reference: shell and non-chat views only. Chat core is intentionally untouched. */
@media (min-width: 761px) {
  #app-screen { padding-left: 56px; }
  #app-screen > .sidebar { width: 288px; min-width: 288px; background: var(--ux-surface); border-right: 1px solid var(--ux-border); box-shadow: none; font-size: var(--ux-fs); color: var(--ux-text); }
  #shell-nav { position: fixed; inset: 60px auto 0 0; width: 56px; margin: 0; padding: 0 8px; gap: 6px; background: var(--shell-rail-bg); z-index: 20; }
  #shell-nav::before { content: 'Z'; position: fixed; top: 12px; left: 12px; width: 32px; height: 32px; border-radius: 9px; background: var(--shell-rail-logo-bg); color: var(--shell-rail-logo-fg); display: grid; place-items: center; font-weight: 700; }
  #shell-nav::after { content: ''; position: fixed; left: 0; top: 0; height: 60px; width: 56px; background: var(--shell-rail-bg-top); z-index: -1; }
  #shell-nav button { width: 40px; height: 40px; padding: 10px; border: 0; border-radius: 10px; box-shadow: none; background: transparent; color: var(--shell-rail-fg); backdrop-filter: none; }
  #shell-nav button span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  #shell-nav { overflow: visible; }
  #shell-nav button[data-view] { color: var(--shell-rail-fg); }
  #shell-nav button[data-view]:hover { background: var(--shell-rail-hover); color: var(--shell-rail-fg-strong); transform: none; box-shadow: none; }
  #shell-nav button[data-view].active {
    background: var(--shell-rail-active-bg); color: var(--shell-rail-fg-strong); transform: none;
    box-shadow: inset 3px 0 0 var(--shell-rail-fg-strong); width: 40px; border-radius: 10px;
  }
  #shell-nav button.active::before { display: none; }
  .sidebar-hero { background: var(--bg-surface); color: var(--text-primary); box-shadow: none; border-radius: 0; padding-bottom: 0; }
  .sidebar-hero::before, .sidebar-hero::after { display: none; }
  .sidebar-header { padding: 14px; min-height: 60px; }
  .sidebar-header .brand-mark { background: #2854ff; border-radius: 50%; box-shadow: none; color: #fff; width: 38px; height: 38px; }
  .sidebar-user strong { color: var(--text-primary); }
  .sidebar-user .muted { color: var(--text-muted); }
  .sidebar-header-actions .icon-btn { color: var(--text-muted); background: transparent; border: 0; }
  .sidebar-search { margin: 2px 14px 10px; background: var(--shell-search-bg); border: 1px solid var(--border-default, var(--dash-border)); box-shadow: none; color: var(--text-muted); }
  .sidebar-search input { color: var(--text-primary); }
  .sidebar-search input::placeholder { color: var(--text-muted); }
  #app-screen .ai-trigger { background: #f1eeff; color: #4940b4; border: 1px solid #dcdfff; box-shadow: none; border-radius: 12px; padding: 12px; }
  .ai-trigger-text small { color: #7787a1; }
  .sidebar-tools { display: none; }
  .context-nav { padding: 4px 8px 14px; }
  .context-title { margin: 10px 6px 8px; color: var(--shell-nav-title); font-size: 12px; font-weight: 700; text-transform: uppercase; border-left: 3px solid var(--shell-nav-active-bar); padding-left: 8px; }
  .context-nav button { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; border-radius: 12px; padding: 10px 12px; background: transparent; color: var(--shell-nav-fg); text-align: left; font: inherit; font-weight: 600; cursor: pointer; }
  .context-nav button.active { color: var(--shell-nav-active-fg); background: var(--shell-nav-active-bg); box-shadow: inset 3px 0 var(--shell-nav-active-bar); }
  .context-nav button:hover { background: var(--shell-nav-hover-bg); }
  #app-screen .workspace { padding: 0 20px 32px; background: var(--dash-bg, var(--bg-app)); }
  .workspace .page-head { background: var(--bg-surface); margin: 0 -20px 14px; padding: 12px 20px; min-height: 56px; border-bottom: 1px solid var(--border-default, var(--dash-border)); align-items: center; color: var(--text-primary); }
  .workspace .page-head h2 { font-size: 18px; margin: 0 0 3px; }
  .workspace .page-head p { margin: 0; color: var(--text-muted); font-size: 13px; }
  .people-page { max-width: none; }
  #app-screen[data-view='ai'] .workspace { display: none; }
  body.role-user #app-screen[data-view='ai'] .workspace { display: block; }
  #app-screen[data-view='ai'] #ai-panel { position: relative; flex: 1; width: auto; max-width: none; min-width: 0; margin: 16px 20px 20px; height: calc(100% - 36px); border: 1px solid var(--border-default, var(--dash-border, #e0e6f2)); border-radius: 14px; box-shadow: none; overflow: hidden; }
  body.role-user #app-screen[data-view='ai'] #ai-panel { position: fixed; }
}
@media (max-width: 760px) { .context-nav { display: none; } }
.workspace .panel, .workspace .dash-block, .workspace .people-card, .workspace .table-wrap { border: 1px solid var(--dash-border, var(--border-default)); border-radius: 12px; box-shadow: none; background: var(--bg-surface); color: var(--text-primary); }
.workspace button:focus-visible, .context-nav button:focus-visible, #shell-nav button:focus-visible { outline: 2px solid var(--shell-nav-active-fg); outline-offset: 3px; }
.workspace .filters input, .workspace .filters select { min-height: 35px; border-color: var(--border-strong); background: var(--bg-surface); color: var(--text-primary); }
.workspace .filters input { flex: 1; }
.workspace .data-table th, .workspace .person-head { background: var(--bg-surface-muted); color: var(--text-muted); }
.workspace .data-table td { padding-top: 16px; padding-bottom: 16px; }
.workspace .person-avatar { background: var(--accent-soft); color: var(--dash-primary, var(--accent)); }
.workspace .person-row { min-height: 68px; }
.workspace .badge-disconnected { color: var(--danger); background: var(--danger-soft); }
.workspace .product-dash {
  /* Inherit global --dash-* bridge; do not re-pin light hex here */
  max-width: none;
  color: var(--dash-text);
  display: grid;
  grid-template-columns: minmax(0, 1.62fr) minmax(260px, 0.9fr);
  grid-template-areas:
    "head head"
    "hero hero"
    "summary summary"
    "attention system"
    "group unassigned"
    "activity org";
  gap: 8px 12px;
  align-content: start;
  padding-bottom: 4px;
}
body[data-shell-view="overview"] #app-screen .workspace { padding-top: 0; padding-bottom: 8px; background: var(--dash-bg, var(--bg-app)); }
.product-dash > .page-head { grid-area: head; }
.product-dash > .dash-hero { grid-area: hero; }
.product-dash > .dash-summary,
.product-dash > #dash-mi-error { grid-area: summary; }
.product-dash > #dash-attention { grid-area: attention; }
.product-dash > #dash-system { grid-area: system; }
.product-dash > #dash-group { grid-area: group; }
.product-dash > #dash-unassigned { grid-area: unassigned; }
.product-dash > #dash-activity { grid-area: activity; }
.product-dash > #dash-org { grid-area: org; }
.workspace .product-dash .dash-block {
  align-self: start; padding: 8px 10px;
  background: var(--dash-card); color: var(--dash-text); border: 1px solid var(--dash-border); border-radius: var(--dash-radius);
}
.workspace .dash-hero {
  display: flex; align-items: flex-start; gap: 10px;
  border-radius: var(--dash-radius); border: 1px solid #dfe4ff;
  box-shadow: none; background: var(--dash-lavender); color: var(--dash-text);
  padding: 10px 12px; min-height: 0; position: relative;
}
.workspace .dash-hero[data-ai-state="unconfigured"],
.workspace .dash-hero[data-ai-state="off"] {
  background: #fff; border-style: dashed; border-color: #cfd6e6;
}
.workspace .dash-kicker { color: var(--dash-muted); text-transform: none; font-size: 12px; margin: 0 0 2px; }
.workspace .dash-hero-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.workspace #dash-hero-text { font-size: 14px; font-weight: 700; margin: 0; color: var(--dash-text); }
.workspace #dash-hero-text strong { font-weight: 700; }
.workspace .dash-hero-sub { margin: 2px 0 0; color: var(--dash-muted); font-size: 12px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.workspace .dash-hero-icon {
  flex: 0 0 32px; width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(135deg, #2854ff, #6a4dff); color: #fff;
  display: grid; place-items: center;
}
.workspace .dash-hero[data-ai-state="unconfigured"] .dash-hero-icon,
.workspace .dash-hero[data-ai-state="off"] .dash-hero-icon { background: #fff4e5; color: #c2410c; }
.workspace .dash-hero-copy { flex: 1; min-width: 0; }
.workspace #dash-hero-action { position: static; margin: 0; flex: 0 0 auto; }
.workspace .dash-ai-findings { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.workspace .dash-ai-pill {
  border: 1px solid #d8dff5; background: #fff; color: #475569;
  border-radius: 999px; padding: 3px 9px; font-size: 11px; font-weight: 600;
}
.workspace .ai-primary-btn, #ai-panel .ai-primary-btn { background: linear-gradient(110deg,#2854ff,#6947e9); box-shadow: 0 3px 8px #3445c32b; }
#ai-panel .ai-panel-header { background: linear-gradient(110deg,#2854ff,#6947e9); }
#ai-panel .ai-welcome { background: #fff; }
.settings-grid .ai-primary-btn { width: auto; padding: 10px 18px; }
.workspace .queue-details { margin: 8px 0; color: #7787a1; font-size: 12px; }
.queue-details summary { cursor: pointer; padding: 6px 0; }
.queue-details h4 { margin: 10px 0 3px; }
.queue-details p { margin: 0; padding: 4px 0; }
#ai-panel .ai-empty { text-align: left; margin: 16px 0; padding: 14px; }
#ai-panel .ai-empty > .ai-empty-orb { display: none; }
#ai-panel .ai-empty h3 { font-size: 18px; color: var(--text-primary, #172033); background: none; -webkit-text-fill-color: currentColor; }
#ai-panel .ai-empty p { margin: 8px 0; max-width: none; color: var(--text-secondary, var(--muted)); }
#ai-panel .ai-empty-know { font-size: 13px; color: var(--text-muted, #7787a1); }
#ai-panel .ai-empty-label { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted, #7787a1); margin: 16px 0 8px; width: 100%; }
#ai-panel .ai-warning { background: var(--bg-surface, #fff); border: 1px solid var(--border-default, #e0e6f2); color: var(--text-secondary, #536176); padding: 16px; border-radius: 12px; }
#ai-panel .ai-suggestions, #ai-panel .ai-report-shortcuts { display: flex; flex-wrap: wrap; gap: 8px; }
#ai-panel .ai-suggestion { border-radius: 24px; background: var(--accent-soft, #f6f7ff); color: var(--accent, #4940b4); border-color: var(--border-default, #dcdfff); box-shadow: none; }
#ai-panel .ai-context-banner { background: var(--accent-soft, #f6f7ff); border-bottom-color: var(--border-default, #e0e6f2); }
#ai-panel .ai-context-title { color: var(--text-primary, #172033); }
#ai-panel .ai-context-kicker,
#ai-panel .ai-context-account { color: var(--text-muted, #7787a1); }
#ai-panel .ai-context-btn { background: var(--bg-surface, #fff); color: var(--dash-primary, var(--accent, #2854ff)); border-color: var(--border-strong, #d8e0ef); }
#ai-panel .ai-context-btn.ghost { color: var(--text-secondary, #536176); }
#ai-panel .ai-answer-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
#ai-panel .ai-action-link { border: 1px solid var(--border-strong, #d8e0ef); background: var(--bg-surface, #fff); color: var(--dash-primary, var(--accent, #2854ff)); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 12.5px; cursor: pointer; }
@media (min-width: 761px) {
  .sidebar-hero .sidebar-brand .brand-mark.sm { display: grid; place-items: center; flex: 0 0 38px; background: #2854ff; color: #fff; border: 0; box-shadow: none; opacity: 1; }
  .sidebar-header-actions { gap: 0; }
  #shell-intelligence { margin: 20px; padding: 20px; border: 1px solid #e0e6f2; border-radius: 12px; }
}
.focus-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.focus-grid .panel { margin: 0; min-height: 108px; }
.focus-grid[data-focus='ai'] .panel { min-height: 220px; }
.focus-grid[data-focus='ai'] .panel:last-child { grid-column: 1/-1; min-height: 105px; }
.focus-grid[data-focus='alerts'], .focus-grid[data-focus='tasks'] { grid-template-columns: 1fr; }
.focus-grid p { color: var(--text-muted, var(--dash-muted, #7787a1)); line-height: 1.65; }
.settings-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 12px; }
.settings-grid .panel { margin-top: 0; }
.settings-grid .ai-settings-view { padding: 20px; overflow: visible; }
.settings-grid input:not([type='checkbox']), .settings-grid select { width: 100%; min-height: 36px; }
.settings-grid h4 { margin-top: 0; font-size: 16px; }
.queue-row { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid #edf0f7; }
.queue-row .queue-copy { flex: 1; min-width: 0; }
.queue-row strong { display: block; }
.queue-row small { display: block; margin-top: 4px; color: #7787a1; }
.queue-row button { border: 1px solid #d8e0ef; border-radius: 9px; background: #fff; color: #475569; padding: 6px 12px; cursor: pointer; }
.qr-steps { display: flex; gap: 6px; flex-wrap: wrap; margin: 20px 0; }
.qr-steps span { border-radius: 20px; padding: 5px 10px; background: #f1f5f9; color: #536176; font-size: 12px; }
.qr-steps span.active { color: #2854ff; background: #eaf0ff; }
#qr-modal .modal-box { width: min(540px,92vw); border-radius: 14px; }
#qr-image-wrap:not(:empty) { padding: 12px; border: 1px dashed var(--border); border-radius: 14px; background: var(--surface-2); text-align: center; margin-top: 8px; }
@media (max-width: 760px) { .focus-grid, .settings-grid { grid-template-columns: 1fr; } }
html:not([data-theme="dark"]) .product-dash .dash-block,
html:not([data-theme="dark"]) .product-dash .dash-summary,
html:not([data-theme="dark"]) .product-dash .dash-summary-cell,
html:not([data-theme="dark"]) .product-dash .page-head,
html:not([data-theme="dark"]) .product-dash .dash-activity-strip > * {
  background: var(--dash-card);
  color: var(--dash-text);
}

/* Ownership: one navigation and one primary action per work surface. */
#manage-zalo-btn { display: none !important; }
#app-screen[data-shell-inbox='filtered'] .workspace { display: block !important; }
#app-screen[data-shell-inbox='filtered'] .chat-panel,
#app-screen[data-shell-inbox='filtered'] .conv-section,
#app-screen[data-shell-inbox='filtered'] #info-panel { display: none !important; }
body:not(.role-user) #app-screen[data-view='ai'] #ai-tabs { display: flex; }
body.role-user #ai-tabs { display: none; }
#app-screen[data-view='ai'] #ai-close-btn { display: none; }
#open-ai-btn { display: none !important; }
body:not(.role-user) #app-screen[data-view='ai'] { overflow-x: hidden; }
body:not(.role-user) #app-screen[data-view='ai'] #ai-panel { width: auto !important; max-width: none; min-width: 0; }
.workspace .page-head { flex-wrap: wrap; }
.workspace .page-head > div { min-width: 0; flex: 1 1 250px; }
.workspace .page-head button { flex: 0 0 auto; white-space: normal; }
.workspace .page-head button.ghost, .workspace button.ghost { background: var(--bg-surface); color: var(--text-secondary); border: 1px solid var(--border-strong); box-shadow: none; border-radius: 8px; padding: 8px 12px; font: inherit; cursor: pointer; }
.workspace [data-primary] { background: #2854ff; color: #fff; border: 0; border-radius: 8px; padding: 9px 14px; font: inherit; font-weight: 600; }
.workspace .filters { align-items: center; }
.workspace .filters > * { min-width: 0; max-width: 100%; }
.workspace .filters input[type='search'] { flex: 1 1 240px; }
.workspace .filters select { flex: 0 1 190px; }
.workspace .filters label { display: flex; align-items: center; gap: 6px; }
.workspace .block-heading { display: flex; justify-content: space-between; gap: 8px; align-items: center; flex-wrap: wrap; }
.workspace .block-heading h3 { margin-bottom: 0; }
.workspace .text-action, .workspace .highlight-link { border: 0; background: transparent; color: var(--dash-primary, var(--accent)); font: inherit; cursor: pointer; padding: 8px 0; text-align: left; }
.workspace .highlight-link { display: block; width: 100%; border-top: 1px solid var(--border-subtle, #edf0f7); }
.workspace .metric-link { display: flex; flex-direction: column; gap: 7px; background: transparent; border: 0; font: inherit; color: var(--dash-primary, var(--accent)); padding: 0; text-align: left; cursor: pointer; }
.workspace .metric-link span { font-size: 12px; }
.workspace .metric-link strong { font-size: 24px; color: var(--dash-text, var(--text-primary)); }
.workspace .dash-metrics { align-items: start; }
.workspace .dash-metrics div { min-width: 0; padding: 12px 8px; }
.workspace .drill-pagination, .workspace .settings-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 14px; }
.workspace .queue-row { flex-wrap: wrap; }
.workspace .queue-copy { min-width: 160px; overflow-wrap: anywhere; }
.workspace .data-table td { overflow-wrap: anywhere; }
.workspace .data-table td button { white-space: normal; }
.workspace .table-wrap { max-width: 100%; }
.workspace .table-wrap details p { max-width: 260px; }
.workspace .people-toolbar { justify-content: flex-end; }
.workspace .empty-state button.ghost { background: var(--bg-surface); color: var(--text-secondary); border: 1px solid var(--border-strong); }
@media (max-width: 1100px) {
  .workspace .product-dash {
    grid-template-columns: 1fr;
    grid-template-areas:
      "head" "hero" "summary" "attention" "system" "group" "unassigned" "activity" "org";
  }
  .workspace .dash-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workspace .dash-activity-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.people-panel .check-list label { display: grid; grid-template-columns: 18px minmax(0,1fr); gap: 4px 8px; align-items: start; }
.people-panel .check-list input[type='checkbox'] { width: 16px; height: 16px; min-width: 16px; padding: 0; margin: 3px 0; }
.people-panel .check-list label > .dash-muted { grid-column: 2; }
.people-grid .full { grid-column: 1 / -1; }

/* ===== Approved refine: rail + inbox pane + scope (chat CSS untouched) ===== */
@media (min-width: 761px) {
  #shell-nav { display: flex; flex-direction: column; align-items: center; inset: 0 auto 0 0; width: 56px; padding: 10px 0 12px; gap: 6px; overflow: visible; }
  #shell-nav::before, #shell-nav::after { display: none !important; }
  #shell-nav > .rail-z-btn {
    width: 32px; height: 32px; padding: 0; border: 0; border-radius: 9px;
    background: var(--shell-rail-logo-bg); color: var(--shell-rail-logo-fg); font: inherit; font-weight: 700; font-size: 15px;
    cursor: pointer; margin: 2px 0 10px; flex: 0 0 auto; display: grid; place-items: center;
    box-shadow: none; box-sizing: border-box;
  }
  #shell-nav > .rail-z-btn span { position: static !important; width: auto !important; height: auto !important; overflow: visible !important; clip-path: none !important; }
  #shell-nav > .rail-z-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
  #shell-nav > .rail-z-btn:hover { background: var(--shell-rail-logo-bg); color: var(--shell-rail-logo-fg); }
  #shell-nav > button[data-view] { margin: 0; color: var(--shell-rail-fg); }
  #shell-nav button[data-view].active {
    background: var(--shell-rail-active-bg); color: var(--shell-rail-fg-strong); box-shadow: inset 3px 0 0 var(--shell-rail-fg-strong); width: 40px; border-radius: 10px;
  }
  #shell-nav button[data-view]:hover { background: var(--shell-rail-hover); color: var(--shell-rail-fg-strong); }
  #shell-nav button[data-view].active:hover { background: var(--shell-rail-active-bg); color: var(--shell-rail-fg-strong); }
  #shell-nav #rail-utils .icon-btn { color: var(--shell-rail-fg); }
  /* Rail dark polish lives in dark.css (loaded last); keep light rail rules here. */
  body[data-shell-view="conversations"] .conv-section > .section-title { display: none; }
  body[data-shell-view="conversations"] .sidebar-hero { padding-bottom: 0; }
  body[data-shell-view="conversations"] .inbox-chrome {
    position: relative; display: flex; flex-direction: column; gap: 6px; padding: 8px 12px 8px; overflow-x: hidden;
  }
  body[data-shell-view="conversations"] .inbox-scope-row { display: flex; align-items: center; gap: 4px; min-width: 0; }
  body[data-shell-view="conversations"] .scope-selector-btn { padding: 6px 10px; gap: 8px; border-radius: var(--ux-radius); min-width: 0; min-height: 44px; border-color: var(--ux-border-strong); background: var(--ux-surface); }
  body[data-shell-view="conversations"] .scope-selector-btn:hover { background: var(--ux-hover); border-color: var(--ux-border-strong); }
  body[data-shell-view="conversations"] .scope-selector-copy strong { font-size: 13px; font-weight: 700; line-height: 1.25; color: var(--ux-text); }
  body[data-shell-view="conversations"] .scope-selector-copy small { font-size: 11.5px; margin-top: 1px; line-height: 1.25; color: var(--ux-muted); }
  body[data-shell-view="conversations"] .scope-chevron { color: var(--ux-muted); }
  body[data-shell-view="conversations"] .inbox-search-slot { min-width: 0; max-width: 100%; }
  body[data-shell-view="conversations"] .inbox-chrome .sidebar-search,
  body[data-shell-view="conversations"] .inbox-chrome .search-trigger {
    width: 100%; max-width: 100%; margin: 0; padding: 0 10px; min-height: 34px; height: 34px; box-sizing: border-box;
    background: var(--ux-input); border: 1px solid var(--ux-border-strong); border-radius: var(--ux-radius-sm); color: var(--ux-muted);
    backdrop-filter: none; box-shadow: none; display: flex; align-items: center;
  }
  body[data-shell-view="conversations"] .inbox-chrome .sidebar-search:hover {
    background: var(--ux-input); border-color: var(--ux-muted); box-shadow: none;
  }
  body[data-shell-view="conversations"] .inbox-chrome .sidebar-search:focus-within {
    background: var(--ux-input); border-color: var(--ux-sel-bar); color: var(--ux-sel-bar); box-shadow: 0 0 0 1px var(--ux-sel-bar);
  }
  body[data-shell-view="conversations"] .inbox-chrome .sidebar-search #sidebar-search-input {
    font-size: 13px; color: var(--ux-text); padding: 6px 0;
  }
  body[data-shell-view="conversations"] .inbox-chrome .sidebar-search input::placeholder { color: var(--ux-muted); }
  body[data-shell-view="conversations"] .inbox-chrome .sidebar-search-clear { background: var(--surface-2); color: var(--muted); }
  body[data-shell-view="conversations"] .inbox-filter-slot { margin: 0; min-width: 0; }
  body[data-shell-view="conversations"] .inbox-chrome .conv-toolbar,
  body[data-shell-view="conversations"] .conv-toolbar {
    display: grid !important; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px; align-items: center;
    margin: 0; flex-wrap: nowrap;
  }
  body[data-shell-view="conversations"] .conv-toolbar .select-wrap { margin: 0; width: 100%; min-width: 0; }
  body[data-shell-view="conversations"] .conv-toolbar .tag-filter-select {
    max-width: none; width: 100%; height: 34px; padding: 0 26px 0 10px; font-size: 13px; font-weight: 500;
    border-radius: var(--ux-radius-sm); background: var(--ux-input); border-color: var(--ux-border-strong); color: var(--ux-text);
  }
  body[data-shell-view="conversations"] .conv-toolbar .select-icon { display: none; }
  body[data-shell-view="conversations"] .conv-toolbar .select-chevron { right: 8px; }
  body[data-shell-view="conversations"] .conv-toolbar .select-wrap[data-cap] { flex-direction: column; align-items: stretch; gap: 2px; }
  body[data-shell-view="conversations"] .conv-toolbar .select-wrap[data-cap]::before { content: attr(data-cap); padding-left: 2px; font-size: 11px; font-weight: 600; line-height: 14px; color: var(--ux-muted); }
  body[data-shell-view="conversations"] .conv-toolbar .select-wrap[data-cap] .select-chevron { top: 26px; }
  body[data-shell-view="conversations"] #conv-filter-label { display: none; }
  body[data-shell-view="conversations"] .sidebar-scroll { padding-top: 0; }
  body[data-shell-view="conversations"] .sidebar-section.conv-section { padding: 0 0 8px; border-top: 1px solid var(--ux-border); }
  body[data-shell-view="conversations"] .inbox-conn-banner { margin-top: 2px; padding: 6px 8px; border-radius: 8px; font-size: 12px; min-height: 0; }
  body[data-shell-view="conversations"] .inbox-back-result { padding: 4px 2px; font-size: 12.5px; }
  .rail-utils { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; padding-top: 10px; }
  .rail-util-btn, #rail-utils .icon-btn { width: 40px; height: 40px; border: 0; border-radius: 10px; background: transparent; color: var(--shell-rail-fg); position: relative; cursor: pointer; display: grid; place-items: center; padding: 0; }
  .rail-util-btn:hover, #rail-utils .icon-btn:hover { background: var(--shell-rail-hover); color: var(--shell-rail-fg-strong); }
  .rail-util-btn:focus-visible, #rail-utils .icon-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
  .rail-dot { position: absolute; top: 8px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--warning); box-shadow: 0 0 0 2px var(--shell-rail-dot-ring); }
  .rail-z-popover { position: fixed; z-index: 320; width: min(228px, calc(100vw - 72px)); padding: 8px; background: var(--bg-surface); border: 1px solid var(--border-default, var(--dash-border)); border-radius: 14px; box-shadow: var(--shadow-lg); }
  .rail-z-popover-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--border-subtle); margin-bottom: 4px; }
  .rail-z-popover-head strong { display: block; font-size: 14px; font-weight: 700; color: var(--text-primary); line-height: 1.25; }
  .rail-z-popover-head small { display: block; margin-top: 3px; font-size: 12px; color: var(--text-muted); line-height: 1.2; }
  .rail-z-popover-item { width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--text-primary); font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; }
  .rail-z-popover-item:hover { background: var(--shell-menu-hover); color: var(--shell-nav-active-fg); }
  .rail-z-popover-item.danger { color: var(--danger); }
  .rail-z-popover-item.danger:hover { background: var(--danger-soft); color: var(--dash-danger, var(--danger)); }
  .rail-z-popover-item svg { flex: 0 0 18px; width: 18px; height: 18px; color: currentColor; }
  .rail-z-popover-item > span:not(.rail-z-help) { flex: 1; min-width: 0; }
  .rail-z-help {
    margin-left: auto; width: 18px; height: 18px; border-radius: 50%; border: 1px solid #d0d7e6;
    display: inline-grid; place-items: center; font-size: 11px; font-weight: 700; color: #7787a1; flex: 0 0 18px;
  }
  .rail-z-popover-backdrop { position: fixed; inset: 0; z-index: 310; background: transparent; }
  .identity-compat, .compat-hidden { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip-path: inset(50%) !important; pointer-events: none !important; }
  body[data-shell-view="conversations"] .sidebar-header,
  body[data-shell-view="conversations"] .ai-trigger,
  body[data-shell-view="conversations"] .context-nav,
  body[data-shell-view="conversations"] .sidebar-scroll > .sidebar-section:first-child .section-title,
  body[data-shell-view="conversations"] #account-list { display: none !important; }
  body[data-shell-view="conversations"] .sidebar-scroll > .sidebar-section:first-child { display: none !important; }
  body[data-shell-view="conversations"] .inbox-chrome { display: flex; flex-direction: column; }
  body:not([data-shell-view="conversations"]) .inbox-chrome { display: none !important; }
  body[data-shell-view="zalo"] .inbox-chrome { display: none !important; }
  body[data-shell-view="overview"] .sidebar-header,
  body[data-shell-view="personnel"] .sidebar-header,
  body[data-shell-view="settings"] .sidebar-header,
  body[data-shell-view="ai"] .sidebar-header,
  body[data-shell-view="tasks"] .sidebar-header,
  body[data-shell-view="alerts"] .sidebar-header { display: none !important; }
  body[data-shell-view="overview"] .ai-trigger,
  body[data-shell-view="personnel"] .ai-trigger,
  body[data-shell-view="settings"] .ai-trigger,
  body[data-shell-view="zalo"] .ai-trigger { display: none !important; }
}
.inbox-chrome { position: relative; padding: 0 14px 8px; }
body[data-shell-view="conversations"] .inbox-chrome {
  display: flex; flex-direction: column; gap: 6px; padding: 8px 12px 8px; overflow-x: hidden;
}
body:not([data-shell-view="conversations"]) .inbox-chrome { display: none !important; }
body[data-shell-view="conversations"] .inbox-chrome .sidebar-search,
body[data-shell-view="conversations"] .inbox-chrome .search-trigger {
  width: 100%; max-width: 100%; margin: 0; padding: 0 10px; min-height: 34px; box-sizing: border-box;
  background: var(--ux-input); border: 1px solid var(--ux-border-strong); border-radius: var(--ux-radius-sm); color: var(--ux-muted);
  backdrop-filter: none; box-shadow: none;
}
body[data-shell-view="conversations"] .inbox-chrome .sidebar-search #sidebar-search-input { color: var(--ux-text); }
body[data-shell-view="conversations"] .inbox-chrome .sidebar-search #sidebar-search-input::placeholder { color: var(--ux-muted); opacity: 1; }
body[data-shell-view="conversations"] .inbox-chrome .conv-toolbar,
body[data-shell-view="conversations"] .conv-toolbar {
  display: grid !important; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px; margin: 0;
}
body[data-shell-view="conversations"] .conv-toolbar .select-wrap { margin: 0; width: 100%; min-width: 0; }
body[data-shell-view="conversations"] .conv-toolbar .tag-filter-select {
  max-width: none; width: 100%; border-radius: var(--ux-radius-sm);
}
@media (max-width: 420px) {
  body[data-shell-view="conversations"] .conv-toolbar { grid-template-columns: minmax(0, 1fr); }
}
.inbox-scope-row { display: flex; align-items: center; gap: 4px; min-width: 0; }
.inbox-scope-row .scope-selector-btn { flex: 1; }
#inbox-overflow-btn { width: 28px; height: 28px; flex: 0 0 28px; border: 0; border-radius: 8px; background: transparent; color: var(--shell-nav-fg); font-size: 18px; line-height: 1; cursor: pointer; }
#inbox-overflow-btn:hover { background: var(--shell-nav-hover-bg); }
#inbox-overflow-btn:focus-visible, .scope-selector-btn:focus-visible {
  outline: 2px solid var(--primary); outline-offset: 2px;
}
.scope-selector-btn { display: flex; align-items: center; gap: 10px; width: 100%; border: 1px solid var(--border-default, var(--dash-border)); border-radius: 12px; background: var(--bg-surface); padding: 8px 10px; text-align: left; cursor: pointer; font: inherit; color: var(--text-primary); }
.scope-selector-btn:hover { border-color: var(--border-strong); background: var(--bg-surface-elevated); }
.scope-selector-copy { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.scope-selector-copy strong { font-size: 14px; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scope-selector-copy small { color: var(--text-muted); font-size: 12px; margin-top: 2px; }
.scope-chevron { color: var(--text-muted); flex: 0 0 auto; }
.inbox-search-slot, .inbox-filter-slot { min-width: 0; }
.inbox-back-result { display: block; width: 100%; border: 0; background: transparent; color: #2854ff; font: inherit; font-weight: 600; text-align: left; padding: 6px 2px; cursor: pointer; }
.inbox-conn-banner { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin-top: 8px; padding: 8px 10px; border-radius: 10px; background: var(--danger-soft, #ffeded); color: var(--danger, #b42318); font-size: 12.5px; }
.inbox-conn-banner button { border: 0; background: transparent; color: inherit; font: inherit; font-weight: 700; cursor: pointer; white-space: nowrap; }
.inbox-overflow-backdrop { position: fixed; inset: 0; z-index: 310; background: transparent; }
.inbox-overflow-menu {
  position: fixed; z-index: 320; min-width: 220px; padding: 6px; background: var(--bg-surface); border: 1px solid var(--border-default, var(--dash-border));
  border-radius: 12px; box-shadow: var(--shadow-lg);
}
.inbox-overflow-item {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 0; border-radius: 8px;
  background: transparent; color: var(--text-primary); font: inherit; font-size: 13.5px; text-align: left; cursor: pointer;
}
.inbox-overflow-item:hover { background: var(--shell-menu-hover); color: var(--shell-nav-active-fg); }
.inbox-overflow-item svg { flex: 0 0 18px; }
.inbox-overflow-sep { height: 1px; margin: 4px 6px; background: var(--border-subtle); }
.scope-backdrop { position: fixed; inset: 0; z-index: 60; background: var(--shell-overlay); }
.scope-popup { position: absolute; left: 68px; top: 120px; width: min(360px, calc(100vw - 80px)); max-height: min(560px, calc(100vh - 140px)); display: flex; flex-direction: column; background: var(--bg-surface); border: 1px solid var(--border-default, var(--dash-border)); border-radius: 14px; box-shadow: var(--shadow-lg); overflow: hidden; color: var(--text-primary); }
.scope-sticky { padding: 10px 12px; border-bottom: 1px solid var(--border-subtle); background: var(--bg-surface); }
.scope-head { display: flex; align-items: center; gap: 8px; }
.scope-title { margin: 0; flex: 1; font-size: 13px; font-weight: 700; color: var(--text-primary); }
.scope-close { flex: 0 0 auto; width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--text-muted); font-size: 22px; line-height: 1; cursor: pointer; }
.scope-close:hover, .scope-close:focus-visible { background: var(--shell-menu-hover); color: var(--text-primary); }
.scope-sticky:has(.scope-search) .scope-head { margin-bottom: 10px; }
.scope-search { display: flex; align-items: center; gap: 8px; background: var(--shell-search-bg); border: 1px solid var(--border-default, var(--dash-border)); border-radius: 10px; padding: 8px 10px; color: var(--text-muted); }
.scope-search input { flex: 1; border: 0; background: transparent; font: inherit; outline: none; color: var(--text-primary); min-width: 0; }
.scope-list { list-style: none; margin: 0; padding: 4px 0; overflow: auto; flex: 1; min-height: 0; display: flex; flex-direction: column; }
button.scope-row { display: flex; align-items: center; gap: 10px; width: 100%; margin: 0; padding: 9px 12px; border: 0; border-radius: 0; background: transparent; cursor: pointer; color: var(--text-primary); font: inherit; text-align: left; }
.scope-row:hover { background: var(--shell-menu-hover); }
.scope-row.active { background: var(--shell-menu-hover); }
.scope-row:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; z-index: 1; }
.scope-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.scope-row-main strong, .scope-row-main small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scope-row-main strong { font-size: 13.5px; font-weight: 650; }
.scope-row-main small { color: var(--text-muted); font-size: 12px; }
.scope-overview-mark { width: 9px; height: 9px; border: 2px solid var(--text-muted); border-radius: 50%; flex-shrink: 0; background: transparent; box-sizing: border-box; }
.scope-row .status-dot { width: 9px; height: 9px; }
.scope-health-healthy { background: var(--success); }
.scope-health-recovering { background: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent); }
.scope-health-action { background: var(--warning); box-shadow: 0 0 0 3px color-mix(in srgb, var(--warning) 22%, transparent); }
.scope-check { color: var(--primary); font-size: 13px; font-weight: 700; flex: 0 0 auto; }
.scope-count { margin: 4px 12px 8px; font-size: 12px; color: var(--text-muted); }
.scope-empty { padding: 24px 16px; text-align: center; color: var(--text-muted); }
.scope-foot { display: flex; justify-content: flex-end; align-items: center; gap: 8px; padding: 8px 12px 10px; border-top: 1px solid var(--border-subtle); background: var(--bg-surface); font-size: 12px; color: var(--text-muted); }
.scope-foot .text-action { border: 0; background: transparent; color: var(--primary); font: inherit; font-weight: 650; cursor: pointer; padding: 4px 0; }

/* UX S02 — bộ chọn tài khoản Phòng ban › Tài khoản › Người dùng */
.scope-tabs { display: flex; gap: 2px; margin-top: 8px; padding: 2px; border: 1px solid var(--ux-border); border-radius: 10px; background: var(--ux-surface-2); }
.scope-tab { flex: 1; height: 30px; border: 0; border-radius: 8px; background: transparent; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--ux-text-2); cursor: pointer; }
.scope-tab[aria-selected="true"] { background: var(--ux-surface); color: var(--ux-text); box-shadow: 0 0 0 1px var(--ux-border-strong); }
.scope-tab:focus-visible, .scope-more:focus-visible { outline: 2px solid var(--ux-sel-bar); outline-offset: -2px; }
.scope-tab-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--ux-warn-soft); color: var(--ux-warn); font-size: 11px; }
.scope-group { display: flex; align-items: center; gap: 6px; margin: 10px 12px 2px; font-size: 11.5px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; color: var(--ux-muted); }
.scope-group-person { font-size: 12.5px; letter-spacing: 0; text-transform: none; color: var(--ux-text); }
.scope-group small { font-weight: 500; color: var(--ux-muted); }
.scope-person { display: flex; align-items: center; gap: 8px; padding: 0 12px 6px 33px; font-size: 12px; color: var(--ux-text-2); }
.scope-avatar { display: inline-grid; place-items: center; flex: 0 0 auto; width: 20px; height: 20px; border-radius: 50%; background: var(--ux-sel); color: var(--ux-link); font-size: 10.5px; font-weight: 700; }
.scope-unread { display: inline-grid; place-items: center; flex: 0 0 auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--ux-primary); color: var(--ux-on-primary); font-size: 11px; font-weight: 700; }
.scope-more { padding: 4px 12px 8px 33px; border: 0; background: transparent; font: inherit; font-size: 12.5px; font-weight: 600; text-align: left; color: var(--ux-link); cursor: pointer; }
.scope-foot { justify-content: space-between; }
.scope-hint { color: var(--ux-muted); }
/* Ô tìm luôn hiện từ S02: bỏ viền input chung lồng trong khung tìm. */
.scope-search input#scope-q { height: auto; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; font-size: 13px; color: var(--ux-text); }
.scope-search { background: var(--ux-input); border-color: var(--ux-border-strong); }
@media (max-width: 480px) {
  .scope-popup {
    left: 8px; right: 8px; top: auto; bottom: 8px; width: auto;
    max-height: min(80vh, 560px); border-radius: 16px;
  }
  button.scope-row { min-height: 52px; padding: 12px 16px; }
}
/* ===== Claude MI dashboard tokens (light-mode primary; chat untouched) ===== */
.product-dash .page-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 0 -20px 0; padding: 6px 20px; min-height: 44px;
  background: var(--bg-surface); color: var(--text-primary); border-bottom: 1px solid var(--dash-border, var(--border-default));
}
.product-dash .page-head h2 { font-size: 18px; font-weight: 700; margin: 0 0 1px; color: var(--text-primary); }
.product-dash .page-head p { margin: 0; color: var(--text-muted); font-size: 12.5px; }
.product-dash .page-head [data-primary] {
  background: #2854ff; color: #fff; border: 0; border-radius: 8px;
  padding: 8px 14px; min-height: 34px; font: inherit; font-weight: 600; cursor: pointer;
  box-shadow: 0 1px 2px rgba(40, 84, 255, .2);
}
.product-dash .page-head [data-primary]:hover { background: #1f46e0; }
.product-dash .page-head [data-primary]:focus-visible { outline: 2px solid #6c81ff; outline-offset: 2px; }
.dash-summary {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0; border: 1px solid #e0e6f2; border-radius: 12px; overflow: hidden; background: #fff;
}
.dash-summary-cell {
  display: grid; grid-template-columns: 26px 1fr; grid-template-rows: auto auto; column-gap: 8px; row-gap: 1px;
  align-items: center; padding: 8px 10px; border: 0; border-right: 1px solid #edf0f7;
  background: #fff; color: #172033; font: inherit; text-align: left; cursor: pointer; min-height: 56px;
}
.dash-summary-cell:last-child { border-right: 0; }
.dash-summary-cell:hover { background: #f8faff; }
.dash-summary-cell.is-danger { background: #fff8f8; }
.dash-summary-icon {
  grid-row: 1 / span 2; width: 28px; height: 28px; border-radius: 8px;
  display: grid; place-items: center; background: #eaf0ff; color: #2854ff; font-size: 13px; font-weight: 700;
}
.dash-summary-cell.is-danger .dash-summary-icon { background: #ffeded; color: #b42318; }
.dash-summary-cell strong { font-size: 18px; font-weight: 700; line-height: 1.1; color: #172033; }
.dash-summary-cell > span:last-child { grid-column: 2; color: #667085; font-size: 11.5px; font-weight: 600; }
.dash-heading-muted { color: #7787a1; font-weight: 500; font-size: 12.5px; }
.dash-count-badge {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px;
  margin-left: 6px; border-radius: 999px; background: var(--dash-ai-soft, var(--accent-soft)); color: var(--dash-ai-fg, var(--dash-primary)); font-size: 11px; font-weight: 700; vertical-align: middle;
}
.dash-count-badge.is-danger { background: var(--dash-danger-bg); color: var(--dash-danger); }
.product-dash .block-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.product-dash .block-heading h3 { margin: 0; font-size: 14px; font-weight: 700; color: var(--dash-text, var(--text-primary)); }
.product-dash .text-action { color: var(--dash-primary); font-weight: 600; font-size: 12.5px; padding: 2px 0; border: 0; background: transparent; cursor: pointer; }
.dash-queue-row {
  width: 100%; display: flex; align-items: center; gap: 8px;
  padding: 6px 2px; border: 0; border-top: 1px solid #edf0f7;
  background: transparent; color: #172033; font: inherit; text-align: left; cursor: pointer;
}
.dash-queue-row:first-child { border-top: 0; }
.dash-queue-row:hover { background: #f8faff; }
.dash-queue-row .person-avatar {
  flex: 0 0 32px; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; background: #2854ff; color: #fff; font-weight: 700; font-size: 12px;
}
.dash-queue-row .queue-copy { flex: 1; min-width: 0; }
.dash-queue-row .queue-copy strong {
  display: block; font-size: 13px; color: #172033; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dash-queue-row .queue-copy small {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 3px; color: #7787a1; font-size: 11.5px;
}
.dash-queue-meta { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; color: #7787a1; font-size: 12px; }
.dash-wait { white-space: nowrap; font-weight: 600; color: #475569; }
.dash-account-tag {
  display: inline-flex; align-items: center; border-radius: 6px; padding: 1px 6px;
  background: #f4f6fb; color: #536176; font-size: 11px; font-weight: 600;
}
.dash-unread-badge {
  display: inline-flex; align-items: center; border-radius: 999px;
  background: #fff1e6; color: #c2410c; padding: 1px 7px; font-size: 10.5px; font-weight: 700; white-space: nowrap;
}
.dash-owner-badge {
  display: inline-flex; align-items: center; border-radius: 999px; padding: 1px 7px;
  background: #f4f6fb; color: #536176; font-size: 10.5px; font-weight: 700;
}
.dash-owner-badge.is-open { background: #fff1e6; color: #c2410c; }
.dash-kind-badge {
  display: inline-flex; align-items: center; border-radius: 999px; padding: 1px 8px;
  font-size: 10.5px; font-weight: 700; white-space: nowrap;
}
.dash-kind-mention { background: #eaf0ff; color: #2854ff; }
.dash-kind-reply { background: #f1eeff; color: #4940b4; }
.dash-chevron { color: #98a2b3; font-size: 16px; line-height: 1; }
.dash-empty { margin: 8px 0; color: #7787a1; font-size: 13px; }
.dash-positive-empty {
  display: flex; align-items: center; gap: 8px; margin: 6px 0; padding: 8px 0; color: #067647; font-size: 13px;
}
.dash-positive-empty p { margin: 0; color: #067647; font-weight: 600; }
.dash-health-row {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 8px 2px; border: 0; background: transparent; font: inherit; text-align: left; cursor: pointer; color: #172033;
}
.dash-health-row:hover { background: #f8faff; }
.dash-health-row .queue-copy { flex: 1; min-width: 0; }
.dash-health-row .queue-copy strong { display: block; font-size: 13px; color: #172033; }
.dash-health-row .queue-copy small { display: block; margin-top: 3px; }
.dash-health-avatar {
  flex: 0 0 32px; width: 32px; height: 32px; border-radius: 8px;
  display: grid; place-items: center; background: #f79009; color: #fff; font-weight: 700; font-size: 12px;
}
.dash-state-pill {
  display: inline-flex; align-items: center; border-radius: 999px; padding: 2px 8px;
  font-size: 11px; font-weight: 700;
}
.dash-state-pill.is-conflict { background: #ffeded; color: #b42318; }
.dash-state-pill.is-auth { background: #fff1e6; color: #c2410c; }
.dash-state-pill.is-error { background: #fff1e6; color: #c2410c; }
.dash-state-pill.is-reconnect { background: #fff8e6; color: #a15c07; }
.dash-state-pill.is-connecting { background: #eaf0ff; color: #2854ff; }
.dash-state-pill.is-connected { background: #ecfdf3; color: #067647; }
.dash-health-bar {
  height: 6px; border-radius: 999px; background: var(--dash-health-track, #abefc6);
  margin: 8px 0 4px; overflow: hidden;
}
.dash-health-bar i { display: block; height: 100%; background: var(--dash-health-fill, var(--success)); border-radius: 999px; }
.dash-health-foot { margin: 6px 0 0; padding-top: 8px; border-top: 1px solid var(--border-subtle, #edf0f7); color: var(--dash-muted); font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
.dash-health-ok { width: 18px; height: 18px; border-radius: 50%; background: var(--dash-ok-soft); color: var(--dash-ok); display: inline-grid; place-items: center; font-size: 11px; font-weight: 700; flex: 0 0 auto; }
.dash-org-links { display: flex; flex-direction: column; gap: 2px; }
.dash-org-link {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; border: 0; border-radius: 8px; background: transparent; padding: 8px 6px;
  font: inherit; color: #172033; cursor: pointer; text-align: left;
}
.dash-org-link:hover { background: #f8faff; }
.dash-org-link span { color: #475569; font-size: 13px; font-weight: 600; }
.dash-org-link strong { color: #172033; font-size: 14px; }
.dash-org-note { margin: 6px 0 0; color: #7787a1; font-size: 11.5px; line-height: 1.4; }
.dash-activity-strip {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin-top: 2px;
  border: 1px solid var(--dash-border, #edf0f7); border-radius: 10px; overflow: hidden; background: var(--dash-card, #fff);
}
.dash-activity-strip > * {
  display: flex; flex-direction: column; gap: 2px; align-items: flex-start;
  padding: 10px 12px; border-right: 1px solid var(--dash-row, #edf0f7); background: var(--dash-card, #fff); min-width: 0;
}
.dash-activity-strip > *:last-child { border-right: 0; }
.dash-activity-strip .metric-link {
  border: 0; border-right: 1px solid var(--dash-row, #edf0f7); font: inherit; cursor: pointer; text-align: left; color: inherit; background: var(--dash-card, #fff);
}
.dash-activity-strip .metric-link:hover { background: var(--dash-hover, #f8faff); }
.dash-activity-strip strong { font-size: 18px; font-weight: 700; color: var(--dash-text, #172033); line-height: 1.1; }
.dash-activity-strip span { font-size: 11.5px; font-weight: 600; color: var(--dash-meta, #667085); }
.dash-activity-strip .metric-static { background: var(--bg-surface-muted, #f8faff); cursor: default; pointer-events: none; }
.product-dash .dash-metrics {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin: 4px 0 0;
  border: 1px solid #edf0f7; border-radius: 10px; overflow: hidden;
}
.product-dash .dash-metrics > * {
  display: flex; flex-direction: column; gap: 4px; align-items: flex-start;
  padding: 10px 12px; border-right: 1px solid #edf0f7; background: #fff; min-width: 0;
}
.product-dash .dash-metrics > *:last-child { border-right: 0; }
.product-dash .dash-metrics .metric-link {
  border: 0; border-right: 1px solid #edf0f7; font: inherit; cursor: pointer; text-align: left; color: #2854ff;
}
.product-dash .dash-metrics .metric-link:hover { background: #f8faff; }
.product-dash .dash-metrics strong { font-size: 18px; font-weight: 700; color: #172033; letter-spacing: -.02em; line-height: 1.1; }
.product-dash .dash-metrics span { font-size: 12px; font-weight: 600; color: #475569; }
.product-dash .dash-metrics .metric-static {
  background: #f8faff; color: #172033; cursor: default !important; pointer-events: none;
}
.product-dash .dash-metrics .metric-static, .product-dash .dash-metrics .metric-static * { cursor: default !important; }
.activity-note { margin: 0; font-size: 12px; }
/* Skeleton */
.product-dash .sk {
  display: block;
  background: linear-gradient(90deg, var(--dash-row, #eef1f7), var(--bg-surface-muted, #f7f9fc), var(--dash-row, #eef1f7));
  background-size: 200% 100%;
  animation: dash-sk 1.2s linear infinite;
  border-radius: 8px;
}
.product-dash .sk-title { width: 120px; height: 18px; margin-bottom: 6px; }
.product-dash .sk-line { width: 100%; height: 12px; margin-top: 6px; }
.product-dash .sk-line.w60 { width: 60%; }
.product-dash .sk-btn { width: 110px; height: 34px; }
.product-dash .sk-icon { width: 28px; height: 28px; border-radius: 8px; }
.product-dash .sk-num { width: 28px; height: 18px; }
.product-dash .sk-avatar { width: 32px; height: 32px; border-radius: 50%; flex: 0 0 32px; }
.product-dash .sk-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.product-dash .sk-line.grow { flex: 1; }
.product-dash .sk-card { min-height: 72px; }
@keyframes dash-sk { to { background-position: -200% 0; } }
.context-nav .context-badge {
  margin-left: auto; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px;
  display: inline-grid; place-items: center; background: var(--shell-nav-active-bg); color: var(--shell-nav-active-fg);
  font-size: 11px; font-weight: 700;
}
.context-nav .context-badge.is-danger { background: var(--danger-soft); color: var(--dash-danger, var(--danger)); }
.context-nav .context-stamp {
  margin-top: auto; padding: 10px 12px; border-radius: 10px; background: var(--shell-search-bg);
  color: var(--text-muted); font-size: 12px; line-height: 1.35;
}
body[data-shell-view="overview"] .sidebar { display: flex; flex-direction: column; }
body[data-shell-view="overview"] .sidebar-hero {
  flex: 1; display: flex; flex-direction: column; min-height: 0; padding-bottom: 12px;
}
body[data-shell-view="overview"] .context-nav {
  flex: 1; display: flex; flex-direction: column; gap: 4px; padding: 8px 10px 12px; min-height: 0;
}
body[data-shell-view="overview"] .context-nav button { gap: 10px; }
body[data-shell-view="overview"] .context-nav button:focus-visible {
  outline: 2px solid var(--shell-nav-active-fg); outline-offset: 2px;
}
.people-foot button[type="submit"], .people-foot #user-save, .people-foot #dept-save { background: var(--accent); color: var(--text-inverse); border: 0; border-radius: 8px; padding: 9px 14px; font: inherit; font-weight: 600; }
.people-panel input, .people-panel select { text-overflow: ellipsis; max-width: 100%; }
.people-panel .field-error:not(:empty) + input,
.people-panel input:user-invalid, .people-panel .field:has(.field-error:not(:empty)) input { border-color: var(--danger); }
.people-panel .server-error { margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; background: var(--danger-soft); color: var(--danger); font-size: 13px; }
.people-foot button[type="submit"]:disabled { background: var(--accent-soft); color: var(--text-muted); }
.org-summary { margin: 8px 0; padding-left: 18px; color: var(--text-muted); }
@media (max-height: 600px) {
  /* Artboard A variant 8: keep bell + … ; collapse lock/theme into … menu */
  #rail-utils #lock-btn,
  #rail-utils #theme-toggle-btn { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .context-nav button, .scope-selector-btn, #shell-nav button { transition: none !important; }
}

/* Admin control plane — Zalo / AI / audit */
.admin-zalo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.admin-zalo-card,
.admin-zalo-detail .panel,
.settings-grid .panel {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  box-shadow: none;
}
.admin-zalo-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
}
.admin-zalo-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.admin-zalo-card-head strong { font-size: 15px; }
.admin-zalo-recovery {
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--warning-soft);
  color: var(--warning);
  font-size: 13px;
}
.admin-zalo-assign,
.admin-zalo-diag { margin: 0; font-size: 13px; }
.admin-zalo-detail {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}
.admin-zalo-empty { text-align: left; padding: 20px; }
.admin-danger {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}
.admin-danger h4 { margin: 0 0 6px; color: var(--danger); font-size: 13px; }
.settings-grid input:not([type="checkbox"]),
.settings-grid select,
.admin-audit-table + .dash-muted {
  color: var(--text-primary);
}
.settings-grid input:not([type="checkbox"]),
.settings-grid select {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--text-primary);
}
.settings-grid input[readonly] {
  background: var(--bg-surface-muted);
  color: var(--text-secondary);
}
.settings-grid .field-label,
.settings-grid .switch-label { color: var(--text-secondary); }
.ai-config-status { font-weight: 600; }
.admin-audit-table { overflow-x: auto; }
.admin-audit-table .data-table { min-width: 860px; }
.admin-audit-table details summary { cursor: pointer; color: var(--text-secondary); }
#qr-modal .qr-modal-box {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
  box-shadow: none;
}
#qr-modal .qr-stage { align-items: center; }
#qr-modal #qr-label-input,
#qr-modal #qr-proxy-input {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
}
#confirm-modal .modal-box {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
  box-shadow: none;
}

/* Admin/Manager overview and other empty-rail views: no contextual pane at all. */
.context-nav[hidden] { display: none !important; }
#network-form { display: flex; flex-direction: column; align-items: stretch; gap: 8px; max-width: 560px; margin: 16px; padding: 16px 18px; }
#network-form h4, #network-form p { margin: 0; }
#network-form .field-label { display: block; font-weight: 600; }
#network-form textarea { width: 100%; box-sizing: border-box; min-height: 120px; resize: vertical; font: inherit; font-family: ui-monospace, Consolas, monospace; padding: 8px 10px; border: 1px solid var(--border-default, #d0d7e6); border-radius: 10px; }
#network-form .field-error:empty, #network-form #network-save-status:empty { display: none; }
#network-form .field-error { color: #b42318; }
#network-form .settings-actions { margin-top: 4px; }
/* Admin/Manager overview: no contextual pane, so the white column collapses and the dashboard uses the full width.
   The fixed icon rail (#shell-nav) stays. */
#app-screen[data-context-pane="none"] > .sidebar { width: 0; min-width: 0; padding: 0; border-right: 0; overflow: visible; }
#app-screen[data-context-pane="none"] .sidebar-hero > :not(#shell-nav),
#app-screen[data-context-pane="none"] .sidebar-scroll { display: none !important; }
