/* [project]/src/app/globals.css [app-client] (css) */
:root {
  --bg: #000;
  --surface: #1c1c1e;
  --surface-2: #2c2c2e;
  --primary: #0074e8;
  --primary-on: #fff;
  --primary-hover: #0062c4;
  --accent: #4da3ff;
  --text-primary: #fff;
  --text-secondary: #ebebf599;
  --text-tertiary: #ebebf58c;
  --border: #545458a6;
  --border-soft: #54545866;
  --border-strong: #787880cc;
  --radius: 14px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --screen-px: 28px;
  --green: #30db5b;
  --amber: #ffd426;
  --orange: #ffb340;
  --red: #ff8680;
  --gray: #b1b1b4;
  --blue: #6ac4ff;
  --green-fill: #1e8839;
  --amber-fill: #8c7500;
  --orange-fill: #aa6700;
  --red-fill: #ed0d00;
  --kh-vang: #e09b00;
  --kh-vang-on: #1d1d1f;
  --kh-vang-fg: #9e6d00;
  --header-bg: #000000b8;
  --thead-bg: var(--surface-2);
  --row-hover: #7676801a;
  --hover-bg: #7676802e;
  --chip-bg: #7676803d;
  --scrollbar-thumb: #76768066;
  --overlay: #0009;
  --shadow-modal: 0 24px 64px #0009, 0 2px 8px #0006;
  --shadow-card: 0 1px 2px #00000080;
  --shadow-pop: 0 10px 32px #0000008c, 0 1px 3px #0006;
  --tint-primary: #0074e82e;
  --tint-primary-soft: #0074e81a;
  --tint-primary-border: #0074e852;
  --tint-green: #30db5b29;
  --tint-amber: #ffd42629;
  --tint-gray: #b1b1b42e;
  --tint-red: #ff868029;
  --tint-red-border: #ff86805c;
  --danger-border: #ff868073;
  --ok-border: #30db5b73;
  --tint-orange: #ffb34029;
  --tint-orange-border: #ffb3405c;
  --tint-blue: #6ac4ff29;
  --tint-blue-border: #6ac4ff66;
  --badge-expired-fg: #b1b1b4;
  --form-error-fg: #ff8680;
  --nav-active-fg: #fff;
  --swatch-blue: #0074e8;
  --swatch-indigo: #5e5ce6;
  --swatch-violet: #b137ef;
  --swatch-teal: #00a2bf;
  --swatch-green: #00ac2b;
  --swatch-pink: #ff375f;
  --swatch-orange: #d48100;
}

[data-theme="light"] {
  --bg: #f2f2f7;
  --surface: #fff;
  --surface-2: #f2f2f7;
  --primary: #0072ef;
  --primary-on: #fff;
  --primary-hover: #0061cb;
  --accent: #0040dd;
  --text-primary: #1d1d1f;
  --text-secondary: #636366;
  --text-tertiary: #6e6e73;
  --border: #3c3c432e;
  --border-soft: #3c3c431a;
  --border-strong: #3c3c435c;
  --green: #1e7333;
  --amber: #a34900;
  --orange: #bc3100;
  --red: #c90014;
  --gray: #646468;
  --blue: #0062b0;
  --green-fill: #1e7333;
  --amber-fill: #a34900;
  --orange-fill: #bc3100;
  --red-fill: #c90014;
  --kh-vang: #e09b00;
  --kh-vang-on: #1d1d1f;
  --kh-vang-fg: #9e6d00;
  --header-bg: #f2f2f7b8;
  --thead-bg: #f2f2f7;
  --row-hover: #7676800f;
  --hover-bg: #7676801a;
  --chip-bg: #7676801f;
  --scrollbar-thumb: #3c3c434d;
  --overlay: #0006;
  --shadow-modal: 0 24px 60px #00000029, 0 2px 8px #0000000f;
  --shadow-card: 0 1px 2px #0000000f;
  --shadow-pop: 0 10px 32px #0000001f, 0 1px 3px #0000000f;
  --tint-primary: #0072ef1f;
  --tint-primary-soft: #0072ef0f;
  --tint-primary-border: #0072ef3d;
  --tint-green: #1e73331f;
  --tint-amber: #a349001f;
  --tint-gray: #6464681f;
  --tint-red: #c900141a;
  --tint-red-border: #c900144d;
  --danger-border: #c9001466;
  --ok-border: #1e733366;
  --tint-orange: #bc31001a;
  --tint-orange-border: #bc31004d;
  --tint-blue: #0062b01a;
  --tint-blue-border: #0062b052;
  --badge-expired-fg: #646468;
  --form-error-fg: #c90014;
  --nav-active-fg: var(--accent);
  --swatch-blue: #0072ef;
  --swatch-indigo: #5856d6;
  --swatch-violet: #aa47dc;
  --swatch-teal: #00a2bf;
  --swatch-green: #00ac2b;
  --swatch-pink: #ff2d55;
  --swatch-orange: #d97f00;
}

:root[data-accent="indigo"] {
  --primary: #5e5ce6;
  --primary-on: #fff;
  --primary-hover: #3f3de1;
  --accent: #9795ff;
  --tint-primary: #5e5ce62e;
  --tint-primary-soft: #5e5ce61a;
  --tint-primary-border: #5e5ce652;
}

[data-theme="light"][data-accent="indigo"] {
  --primary: #5856d6;
  --primary-on: #fff;
  --primary-hover: #3c39cf;
  --accent: #3634a3;
  --tint-primary: #5856d61f;
  --tint-primary-soft: #5856d60f;
  --tint-primary-border: #5856d63d;
}

:root[data-accent="violet"] {
  --primary: #b137ef;
  --primary-on: #fff;
  --primary-hover: #a416ec;
  --accent: #da8fff;
  --tint-primary: #b137ef2e;
  --tint-primary-soft: #b137ef1a;
  --tint-primary-border: #b137ef52;
}

[data-theme="light"][data-accent="violet"] {
  --primary: #aa47dc;
  --primary-on: #fff;
  --primary-hover: #9c29d6;
  --accent: #8944ab;
  --tint-primary: #aa47dc1f;
  --tint-primary-soft: #aa47dc0f;
  --tint-primary-border: #aa47dc3d;
}

:root[data-accent="teal"] {
  --primary: #00a2bf;
  --primary-on: #fff;
  --primary-hover: #00849b;
  --accent: #70d7ff;
  --tint-primary: #00a2bf2e;
  --tint-primary-soft: #00a2bf1a;
  --tint-primary-border: #00a2bf52;
}

[data-theme="light"][data-accent="teal"] {
  --primary: #00a2bf;
  --primary-on: #fff;
  --primary-hover: #00849b;
  --accent: #006b9c;
  --tint-primary: #00a2bf1f;
  --tint-primary-soft: #00a2bf0f;
  --tint-primary-border: #00a2bf3d;
}

:root[data-accent="green"] {
  --primary: #00ac2b;
  --primary-on: #fff;
  --primary-hover: #082;
  --accent: #30db5b;
  --tint-primary: #00ac2b2e;
  --tint-primary-soft: #00ac2b1a;
  --tint-primary-border: #00ac2b52;
}

[data-theme="light"][data-accent="green"] {
  --primary: #00ac2b;
  --primary-on: #fff;
  --primary-hover: #082;
  --accent: #1e7433;
  --tint-primary: #00ac2b1f;
  --tint-primary-soft: #00ac2b0f;
  --tint-primary-border: #00ac2b3d;
}

:root[data-accent="pink"] {
  --primary: #ff375f;
  --primary-on: #fff;
  --primary-hover: #ff1342;
  --accent: #ff748f;
  --tint-primary: #ff375f2e;
  --tint-primary-soft: #ff375f1a;
  --tint-primary-border: #ff375f52;
}

[data-theme="light"][data-accent="pink"] {
  --primary: #ff2d55;
  --primary-on: #fff;
  --primary-hover: #ff0938;
  --accent: #c10e3f;
  --tint-primary: #ff2d551f;
  --tint-primary-soft: #ff2d550f;
  --tint-primary-border: #ff2d553d;
}

:root[data-accent="orange"] {
  --primary: #d48100;
  --primary-on: #fff;
  --primary-hover: #b06b00;
  --accent: #ffb340;
  --tint-primary: #d481002e;
  --tint-primary-soft: #d481001a;
  --tint-primary-border: #d4810052;
}

[data-theme="light"][data-accent="orange"] {
  --primary: #d97f00;
  --primary-on: #fff;
  --primary-hover: #b56a00;
  --accent: #bd3100;
  --tint-primary: #d97f001f;
  --tint-primary-soft: #d97f000f;
  --tint-primary-border: #d97f003d;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
}

:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI Variable Text", "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  --fw-normal: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --fw-heavy: 800;
  --lh-title: 1.3;
  --lh-body: 1.45;
  --lh-comfortable: 1.5;
  --lh-relaxed: 1.6;
  --fs-input: 16px;
  --fs-2xs: 11px;
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-base: 14px;
  --fs-md: 15px;
  --fs-lg: 17px;
  --fs-xl: 20px;
  --fs-2xl: 22px;
  --fs-3xl: 28px;
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;
  --control-h: 36px;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg);
  color: var(--text-primary);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizelegibility;
}

h1, h2, h3, .modal-head h3, .topbar-left h1, .stat-card-value, .oee-card .oee-value {
  letter-spacing: -.012em;
}

a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible, [tabindex]:focus-visible, [role="button"]:focus-visible, [contenteditable="true"]:focus-visible {
  outline-offset: 2px;
  outline: 2px solid var(--accent) !important;
}

.field input:focus, .field select:focus, .field textarea:focus, .field .date-input:focus-within, .date-input:focus-within, .search-box:focus-within, .kh-picker input:focus, tbody td input:focus, tbody td select:focus, tbody td textarea:focus, select.filter-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--tint-primary);
}

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

a {
  color: inherit;
  text-decoration: none;
}

h1, h2, h3, h4 {
  font-weight: var(--fw-semibold);
  line-height: var(--lh-title);
}

code, kbd, pre {
  font-family: var(--font-mono);
}

button {
  cursor: pointer;
  font-family: inherit;
}

input, select, textarea {
  font-family: inherit;
}

input[type="number"] {
  -moz-appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.app-shell {
  min-height: 100vh;
  display: flex;
}

[data-region="sidebar"] {
  background: var(--surface);
  border-right: 1px solid var(--border-soft);
  flex-direction: column;
  flex-shrink: 0;
  width: 232px;
  height: 100vh;
  transition: width .2s cubic-bezier(.25, .46, .45, .94);
  display: flex;
  position: sticky;
  top: 0;
  overflow-y: auto;
}

[data-region="sidebar"] > * {
  flex-shrink: 0;
}

[data-region="sidebar"].collapsed {
  width: 68px;
  overflow-x: hidden;
}

[data-region="sidebar"].collapsed .brand {
  flex-direction: column;
  justify-content: center;
  padding: 18px 8px;
}

[data-region="sidebar"].collapsed .brand-name {
  display: none;
}

[data-region="sidebar"].collapsed .nav-list {
  padding: 0 8px;
}

[data-region="sidebar"].collapsed .nav-group-label {
  text-indent: -999px;
  border-radius: 50%;
  width: 8px;
  height: 8px;
  margin: 14px auto 6px;
  padding: 0;
  overflow: hidden;
}

[data-region="sidebar"].collapsed .nav-item {
  justify-content: center;
  padding: 9px 0;
}

[data-region="sidebar"].collapsed .nav-item .nav-item-label, [data-region="sidebar"].collapsed .nav-item .num, [data-region="sidebar"].collapsed .nav-item .chat-unread {
  display: none;
}

.sidebar-collapse-btn {
  border: 1px solid var(--border);
  background: var(--surface-2);
  width: 26px;
  height: 26px;
  color: var(--text-tertiary);
  border-radius: 6px;
  flex-shrink: 0;
  justify-content: center;
  align-items: center;
  margin-left: auto;
  display: flex;
}

.sidebar-collapse-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
}

[data-region="sidebar"].collapsed .sidebar-collapse-btn {
  margin-left: 0;
}

.brand {
  border-bottom: 1px solid var(--border-soft);
  align-items: center;
  gap: 10px;
  padding: 18px 16px;
  display: flex;
}

.brand-mark {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  width: 28px;
  height: 28px;
  font-weight: var(--fw-bold);
  font-size: var(--fs-sm);
  color: #fff;
  border-radius: 7px;
  flex-shrink: 0;
  justify-content: center;
  align-items: center;
  display: flex;
  overflow: hidden;
}

.brand-mark img {
  object-fit: cover;
  width: 100%;
  height: 100%;
}

.brand-name {
  font-weight: var(--fw-semibold);
  font-size: var(--fs-base);
  line-height: 1.2;
}

.brand-name span {
  font-size: var(--fs-2xs);
  color: var(--text-tertiary);
  font-weight: var(--fw-normal);
  display: block;
}

.nav-group-label {
  font-size: var(--fs-2xs);
  letter-spacing: .02em;
  color: var(--accent);
  font-weight: var(--fw-bold);
  background: var(--tint-primary);
  border-radius: 10px;
  margin: 14px 0 6px 8px;
  padding: 3px 10px;
  display: block;
}

.nav-list {
  padding: 0 0 0 8px;
  list-style: none;
}

.nav-item {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  border-radius: 6px;
  align-items: center;
  gap: 10px;
  margin-bottom: 1px;
  padding: 7px 10px;
  display: flex;
}

.nav-item:hover {
  background: var(--hover-bg);
  color: var(--text-primary);
}

.nav-item .dot {
  background: var(--text-tertiary);
  border-radius: 50%;
  flex-shrink: 0;
  width: 6px;
  height: 6px;
}

.nav-item .nav-icon {
  opacity: .82;
  color: var(--text-tertiary);
  flex-shrink: 0;
  transition: opacity .15s, color .15s;
}

.nav-item:hover .nav-icon {
  opacity: 1;
  color: var(--text-primary);
}

.nav-item.active .nav-icon {
  opacity: 1;
  color: var(--nav-active-fg);
}

.nav-item.active {
  background: var(--tint-primary);
  color: var(--nav-active-fg);
  font-weight: var(--fw-semibold);
}

.nav-item.active .dot {
  background: var(--accent);
}

.nav-item .num {
  font-size: var(--fs-2xs);
  color: var(--text-secondary);
  background: var(--chip-bg);
  border-radius: 10px;
  margin-left: auto;
  padding: 1px 6px;
}

.nav-item.active .num {
  background: none;
}

.nav-item.disabled {
  opacity: .45;
  cursor: not-allowed;
}

.nav-item-row {
  align-items: center;
  gap: 2px;
  margin-bottom: 1px;
  display: flex;
}

.nav-item-row .nav-item {
  flex: auto;
  min-width: 0;
  margin-bottom: 0;
}

.nav-toggle {
  width: 24px;
  height: 24px;
  color: var(--text-tertiary);
  background: none;
  border: none;
  border-radius: 6px;
  flex-shrink: 0;
  justify-content: center;
  align-items: center;
  display: flex;
}

.nav-toggle:hover {
  background: var(--hover-bg);
  color: var(--text-primary);
}

.nav-toggle .nav-toggle-icon {
  transition: transform .15s;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-icon {
  transform: rotate(180deg);
}

.nav-sublist {
  margin-bottom: 2px;
  padding: 0 8px 2px 20px;
  list-style: none;
}

.nav-subitem {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  border-radius: 6px;
  align-items: center;
  gap: 8px;
  margin-bottom: 1px;
  padding: 6px 10px;
  display: flex;
}

.nav-subitem-icon {
  color: var(--text-tertiary);
  opacity: .85;
  flex-shrink: 0;
}

.nav-subitem:hover .nav-subitem-icon {
  color: var(--text-primary);
  opacity: 1;
}

.nav-subitem.active .nav-subitem-icon {
  color: var(--nav-active-fg);
  opacity: 1;
}

.nav-subitem-label {
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  overflow: hidden;
}

.nav-subitem:hover {
  background: var(--hover-bg);
  color: var(--text-primary);
}

.nav-subitem.active {
  background: var(--tint-primary);
  color: var(--nav-active-fg);
  font-weight: var(--fw-semibold);
}

.nav-subitem .tol-tag {
  flex-shrink: 0;
  margin-left: auto;
}

.sidebar-footer {
  border-top: 1px solid var(--border-soft);
  font-size: var(--fs-xs);
  color: var(--text-tertiary);
  margin-top: auto;
  padding: 12px 16px;
}

.sidebar-version {
  font-size: var(--fs-2xs);
  opacity: .8;
  font-variant-numeric: tabular-nums;
  margin-top: 6px;
}

[data-region="main"] {
  flex: 1;
  min-width: 0;
  height: 100vh;
  overflow-y: auto;
}

[data-region="header"] {
  z-index: 5;
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border-soft);
  justify-content: space-between;
  align-items: center;
  padding: 14px 28px;
  display: flex;
  position: sticky;
  top: 0;
}

.topbar-left {
  border-left: 3px solid var(--primary);
  padding-left: 14px;
}

.topbar-left h1 {
  font-size: var(--fs-xl);
  font-weight: var(--fw-semibold);
  letter-spacing: -.02em;
  line-height: 1.25;
}

.topbar-left p {
  font-size: var(--fs-xs);
  color: var(--text-tertiary);
  margin-top: 2px;
}

.topbar-left .topbar-eyebrow {
  font-size: var(--fs-2xs);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-tertiary);
  margin: 0 0 2px;
}

.topbar-right, .topbar-controls-inline {
  align-items: center;
  gap: 10px;
  display: flex;
}

.header-more-menu {
  display: none;
  position: relative;
}

.header-more-btn {
  border: 1px solid var(--border);
  background: var(--surface-2);
  width: 30px;
  height: 30px;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 50%;
  justify-content: center;
  align-items: center;
  display: flex;
}

.header-more-btn:hover {
  background: var(--tint-primary);
  color: var(--text-primary);
}

.header-refresh-btn, .header-back-mobile-btn {
  display: none;
}

.header-refresh-btn .spin {
  transform-origin: 50%;
  animation: .8s linear infinite sync-spin;
}

.header-more-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  min-width: 190px;
  box-shadow: var(--shadow-pop);
  z-index: 45;
  border-radius: 10px;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  display: flex;
  position: absolute;
  top: 38px;
  right: 0;
}

.header-more-row {
  text-align: left;
  cursor: pointer;
  width: 100%;
  font-size: var(--fs-sm);
  color: var(--text-primary);
  background: none;
  border: none;
  border-radius: 8px;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  display: flex;
}

.header-more-row:hover {
  background: var(--surface-2);
}

.header-more-row.logout {
  color: var(--red);
}

.header-more-row.logout:hover {
  background: var(--tint-red);
}

.header-more-panel .theme-toggle.wide {
  width: 100%;
  font-size: var(--fs-sm);
  background: none;
  border: none;
  border-radius: 8px;
  justify-content: flex-start;
  gap: 9px;
  padding: 8px 10px;
}

.header-more-panel .theme-toggle.wide:hover {
  background: var(--surface-2);
}

.avatar-btn {
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  line-height: 0;
}

.screen {
  padding: var(--sp-5) var(--screen-px, 28px) var(--sp-8);
}

.screen .screen {
  padding-inline: 0;
}

.toolbar-tabs {
  padding: 0 var(--screen-px, 28px);
}

.screen .toolbar-tabs {
  padding-inline: 0;
}

.toolbar-tabs .btn-sm {
  padding-left: 14px;
}

@media (max-width: 860px) {
  :root {
    --screen-px: 14px;
  }

  [data-region="header"] {
    padding: 10px var(--screen-px, 14px);
    gap: 8px;
  }

  [data-region="header"] .topbar-left h1 {
    font-size: var(--fs-sm);
    max-width: none;
    text-overflow: unset;
    white-space: normal;
    line-height: 1.25;
    overflow: visible;
  }

  [data-region="header"] .topbar-left .topbar-eyebrow {
    font-size: var(--fs-2xs);
  }

  [data-region="header"] .topbar-left .topbar-subtitle, [data-region="header"] .topbar-right .cell-sub {
    display: none;
  }

  [data-region="header"] .topbar-right {
    gap: 6px;
  }

  .screen {
    padding: 14px var(--screen-px, 14px) 40px;
  }

  .topbar-controls-inline {
    display: none;
  }

  .header-more-menu {
    display: inline-block;
  }

  .header-refresh-btn, .header-back-mobile-btn {
    display: flex;
  }

  [data-region="sidebar"] {
    overflow-x: hidden;
    width: 68px !important;
  }

  [data-region="sidebar"] .brand-name, [data-region="sidebar"] .nav-item .nav-item-label, [data-region="sidebar"] .nav-item .num, [data-region="sidebar"] .nav-item .chat-unread, [data-region="sidebar"] .sidebar-footer, [data-region="sidebar"] .sidebar-collapse-btn, [data-region="sidebar"] .nav-toggle, [data-region="sidebar"] .nav-sublist {
    display: none;
  }

  [data-region="sidebar"] .brand {
    justify-content: center;
    padding: 18px 8px;
  }

  [data-region="sidebar"] .nav-group-label {
    text-indent: -999px;
    border-radius: 50%;
    width: 8px;
    height: 8px;
    margin: 14px auto 6px;
    padding: 0;
    overflow: hidden;
  }

  [data-region="sidebar"] .nav-item {
    justify-content: center;
    padding: 9px 0;
  }
}

.mobile-global-nav {
  z-index: 40;
  background: var(--surface);
  border-top: 1px solid var(--border);
  height: 60px;
  box-shadow: var(--shadow-modal);
  justify-content: space-around;
  align-items: center;
  padding: 0 4px;
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
}

.mobile-global-nav-item {
  cursor: pointer;
  color: var(--text-tertiary);
  font-size: var(--fs-2xs);
  background: none;
  border: none;
  flex-direction: column;
  flex: 1;
  align-items: center;
  gap: 2px;
  padding: 6px 0;
  text-decoration: none;
  display: flex;
}

.mobile-global-nav-item.active {
  color: var(--accent);
}

.mobile-global-nav-qr {
  background: var(--primary);
  width: 52px;
  height: 52px;
  color: var(--primary-on);
  border: 3px solid var(--surface);
  box-shadow: var(--shadow-modal);
  cursor: pointer;
  border-radius: 50%;
  flex-shrink: 0;
  justify-content: center;
  align-items: center;
  margin-top: -26px;
  display: flex;
}

.mobile-global-nav-qr:hover {
  background: var(--primary-hover);
}

@media (max-width: 860px) {
  .mobile-global-nav {
    display: flex;
  }

  [data-region="main"] {
    padding-bottom: 60px;
  }

  [data-region="sidebar"] {
    display: none;
  }
}

.modal-overlay.sheet-bottom {
  align-items: flex-end;
  padding: 0;
}

.sx-menu-sheet {
  background: var(--surface);
  width: 100%;
  max-height: 82vh;
  box-shadow: var(--shadow-modal);
  border-radius: 16px 16px 0 0;
  flex-direction: column;
  display: flex;
}

.sx-menu-sheet-handle {
  background: var(--border-strong);
  border-radius: 2px;
  flex-shrink: 0;
  width: 36px;
  height: 4px;
  margin: 10px auto 4px;
}

.sx-menu-sheet-head {
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  justify-content: space-between;
  align-items: center;
  padding: 6px 16px 10px;
  display: flex;
}

.sx-menu-sheet-head h3 {
  font-size: var(--fs-md);
  margin: 0;
}

.sx-menu-sheet-body {
  padding: 14px 16px 24px;
  overflow-y: auto;
}

.mobile-menu-grid {
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 16px 6px;
  padding: 2px 2px 18px;
  display: flex;
}

.mobile-menu-grid .icon-label-btn {
  width: 72px;
}

.mobile-menu-grid .icon-label-btn .icon-label-circle, .mobile-menu-grid .icon-label-btn:hover .icon-label-circle {
  background: none;
  border-color: #0000;
}

.mobile-menu-back {
  width: 100%;
  min-height: 44px;
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  cursor: pointer;
  background: none;
  border: none;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  padding: 6px 4px;
  display: flex;
}

.mobile-menu-back:hover, .mobile-menu-back:active {
  color: var(--accent);
}

.sx-menu-group + .sx-menu-group {
  margin-top: 20px;
}

.sx-menu-group-label {
  font-size: var(--fs-2xs);
  font-weight: var(--fw-bold);
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin: 0 0 10px;
}

.btn {
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  background: var(--chip-bg);
  color: var(--text-primary);
  white-space: nowrap;
  border: 1px solid #0000;
  border-radius: 10px;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 8px 14px;
  display: inline-flex;
}

.btn:hover {
  background: var(--hover-bg);
  border-color: var(--border);
}

.btn:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-on);
}

.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.btn-ghost {
  color: var(--accent);
  background: none;
  border-color: #0000;
}

.btn-ghost:hover {
  background: var(--tint-primary-soft);
  color: var(--accent);
}

.btn-danger {
  border-color: var(--danger-border);
  color: var(--red);
  background: none;
}

.btn-danger:hover {
  border-color: var(--red);
}

.btn-sm {
  font-size: var(--fs-xs);
  padding: 5px 10px;
}

.toolbar {
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
  flex-wrap: wrap;
  display: flex;
}

.search-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  min-width: 240px;
  color: var(--text-tertiary);
  font-size: var(--fs-sm);
  border-radius: 10px;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  display: flex;
}

.search-box input {
  color: var(--text-primary);
  font-size: var(--fs-sm);
  background: none;
  border: none;
  outline: none;
  width: 100%;
}

select.filter-select, input.filter-select {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: var(--fs-sm);
  border-radius: 10px;
  outline: none;
  padding: 7px 10px;
}

select.filter-select option {
  background: var(--surface);
  color: var(--text-primary);
}

.toolbar .spacer {
  flex: 1;
}

.toolbar > .search-box, .toolbar > select.filter-select, .toolbar > input.filter-select, .toolbar > .filter-select-btn, .toolbar > .date-range-filter, .toolbar > .btn {
  min-height: var(--control-h);
  border-radius: 10px;
}

.toolbar > .search-box {
  padding-top: 0;
  padding-bottom: 0;
}

@media (max-width: 860px) {
  .toolbar {
    flex-wrap: wrap;
    overflow-x: visible;
  }

  .toolbar::-webkit-scrollbar {
    display: none;
  }

  .toolbar > * {
    flex-shrink: 1;
    order: 3;
  }

  .toolbar > .date-range-filter, .toolbar > .filter-select-btn, .toolbar > select.filter-select, .toolbar > .filter-quick-btn, .toolbar > .filter-date, .toolbar > input.filter-select, .toolbar > .sep {
    flex-shrink: 0;
    order: 1;
  }

  .toolbar > .search-box {
    flex: 100%;
    order: 2;
    min-width: 0;
  }
}

.table-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.table-scroll {
  max-height: 65vh;
  overflow: auto;
}

table {
  border-collapse: collapse;
  width: 100%;
}

thead th {
  text-align: left;
  font-size: var(--fs-xs);
  letter-spacing: .02em;
  color: var(--primary-on);
  font-weight: var(--fw-bold);
  border-bottom: 1px solid var(--border-soft);
  background: var(--primary);
  white-space: nowrap;
  z-index: 2;
  box-shadow: 0 1px 0 var(--border-soft), 0 4px 10px -6px #00000059;
  padding: 11px 14px;
  position: sticky;
  top: 0;
}

.th-resizable {
  position: sticky;
}

.th-resize-handle {
  cursor: col-resize;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  width: 6px;
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
}

.th-resize-handle:hover {
  background: #ffffff59;
}

.th-sort-btn {
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  cursor: pointer;
  background: none;
  border: none;
  align-items: center;
  gap: 4px;
  padding: 0;
  display: inline-flex;
}

.th-sort-icon {
  font-size: var(--fs-2xs);
  opacity: .75;
}

tbody td {
  border-bottom: 1px solid var(--border-soft);
  font-size: var(--fs-sm);
  vertical-align: middle;
  padding: 14px 16px;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr {
  transition: background .12s;
}

tbody tr:hover {
  background: var(--hover-bg);
}

tbody tr.dim {
  opacity: .55;
}

tbody td input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]), tbody td select, tbody td textarea {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: var(--fs-sm);
  border-radius: 8px;
  outline: none;
  width: 100%;
  padding: 6px 10px;
}

tbody td select option {
  background: var(--surface);
  color: var(--text-primary);
}

tbody td input:focus, tbody td select:focus, tbody td textarea:focus {
  border-color: var(--primary);
}

tbody td input:disabled, tbody td select:disabled {
  opacity: .6;
}

.cell-main {
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  display: -webkit-box;
  overflow: hidden;
}

.cell-sub {
  font-size: var(--fs-xs);
  color: var(--text-tertiary);
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  margin-top: 1px;
  display: -webkit-box;
  overflow: hidden;
}

.cell-clamp2 {
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  display: -webkit-box;
  overflow: hidden;
}

.payload-cell {
  text-align: left;
  width: 100%;
  max-width: 420px;
  color: inherit;
  font: inherit;
  cursor: pointer;
  background: none;
  border: 0;
  margin: 0;
  padding: 0;
  display: block;
}

.payload-cell:hover {
  color: var(--accent);
}

td.cell-main, td.cell-sub, td.cell-clamp2 {
  white-space: nowrap;
  text-overflow: ellipsis;
  display: table-cell;
  overflow: hidden;
}

.cell-nowrap {
  white-space: nowrap;
}

.mono {
  font-variant-numeric: tabular-nums;
}

.num-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

td.num-cell {
  white-space: nowrap;
}

.badge {
  font-size: var(--fs-2xs);
  font-weight: var(--fw-semibold);
  white-space: nowrap;
  border-radius: 20px;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  display: inline-flex;
}

.badge .dot {
  border-radius: 50%;
  width: 6px;
  height: 6px;
}

.badge-active {
  background: var(--tint-green);
  color: var(--green);
}

.badge-active .dot {
  background: var(--green);
}

.badge-expired {
  background: var(--tint-gray);
  color: var(--badge-expired-fg);
}

.badge-expired .dot {
  background: var(--gray);
}

.badge-pending {
  background: var(--tint-amber);
  color: var(--amber);
}

.badge-pending .dot {
  background: var(--amber);
}

td.o-sua-tay {
  background: var(--tint-amber);
  box-shadow: inset 0 -2px 0 var(--amber);
}

.nhan-dong-luong {
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
  display: flex;
}

.badge-info {
  background: var(--tint-primary);
  color: var(--accent);
}

.badge-info .dot {
  background: var(--accent);
}

.badge-danger {
  background: var(--tint-red);
  color: var(--red);
}

.badge-danger .dot {
  background: var(--red);
}

.loai-inline-btn {
  cursor: pointer;
  background: none;
  border: none;
  border-radius: 20px;
  padding: 0;
}

.loai-inline-btn:hover .badge {
  filter: brightness(1.15);
}

.loai-inline-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.loai-inline-select {
  font-size: var(--fs-2xs);
  font-weight: var(--fw-semibold);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
  border-radius: 6px;
  padding: 3px 6px;
}

.meter {
  background: var(--tint-gray);
  border-radius: 4px;
  height: 7px;
  overflow: hidden;
}

.meter-fill {
  background: var(--primary);
  border-radius: 4px;
  height: 100%;
}

.meter-fill.green {
  background: var(--green);
}

.meter-fill.amber {
  background: var(--amber);
}

.meter-fill.red {
  background: var(--red);
}

.oee-grid {
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 22px;
  display: grid;
}

.oee-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 16px;
}

.oee-card .oee-label {
  font-size: var(--fs-2xs);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: .03em;
  margin-bottom: 8px;
}

.oee-card .oee-value {
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  margin-bottom: 10px;
}

.oee-card.total {
  background: linear-gradient(135deg, var(--tint-primary), transparent);
  border-color: var(--primary);
}

@media (max-width: 900px) {
  .oee-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

div.row-actions {
  justify-content: center;
  align-items: center;
  gap: 6px;
  display: flex;
}

td.row-actions {
  text-align: center;
  white-space: nowrap;
}

td.row-actions .icon-label-btn {
  vertical-align: middle;
  margin: 0 3px;
  display: inline-flex;
}

.icon-btn {
  width: 26px;
  height: 26px;
  color: var(--text-tertiary);
  font-size: var(--fs-sm);
  background: none;
  border: 1px solid #0000;
  border-radius: 6px;
  justify-content: center;
  align-items: center;
  display: flex;
}

.icon-btn:hover {
  background: var(--surface-2);
  color: var(--text-primary);
  border-color: var(--border);
}

.icon-btn.danger:hover {
  color: var(--red);
  border-color: var(--danger-border);
}

.ma-ten-nv {
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  display: -webkit-box;
  overflow: hidden;
}

.ma-nv {
  font-weight: var(--fw-semibold);
}

.ten-nv {
  color: var(--text-secondary);
  font-weight: var(--fw-normal);
}

th.th-chon-in {
  text-align: center;
  white-space: nowrap;
  width: 44px;
}

td.cell-chon-in {
  text-align: center;
  white-space: nowrap;
}

.chon-in-btn {
  vertical-align: middle;
  background: var(--tint-primary-soft);
  border: 1px solid var(--tint-primary-border);
  width: 28px;
  height: 28px;
  color: var(--accent);
  cursor: pointer;
  border-radius: 50%;
  justify-content: center;
  align-items: center;
  display: inline-flex;
}

.chon-in-btn:hover:not(:disabled) {
  background: var(--tint-primary-border);
}

.chon-in-btn:disabled {
  opacity: .45;
  cursor: default;
}

.chon-in-btn[aria-pressed="false"] {
  border-color: var(--border);
  color: var(--text-tertiary);
  background: none;
}

.cell-icon-btn {
  vertical-align: middle;
  background: var(--tint-primary-soft);
  border: 1px solid var(--tint-primary-border);
  width: 26px;
  height: 26px;
  color: var(--accent);
  cursor: pointer;
  border-radius: 50%;
  flex: none;
  justify-content: center;
  align-items: center;
  display: inline-flex;
}

.cell-icon-btn:hover {
  background: var(--tint-primary-border);
}

.cell-icon-btn.dang-bat {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.cell-icon-btn.dang-bat:hover {
  background: var(--primary);
  opacity: .85;
}

.cell-icon-btn:disabled {
  opacity: .45;
  cursor: progress;
}

.cell-icon-btn.xanh-duong {
  background: var(--tint-blue);
  border-color: var(--tint-blue-border);
  color: var(--blue);
}

.cell-icon-btn.xanh-duong:hover {
  background: var(--tint-blue-border);
}

.col-chooser {
  display: inline-flex;
  position: relative;
}

.col-chooser-pop {
  z-index: 60;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-pop);
  border-radius: 10px;
  min-width: 220px;
  max-height: 340px;
  padding: 8px;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  overflow-y: auto;
}

.col-chooser-pop .cc-title {
  font-size: var(--fs-2xs);
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-tertiary);
  padding: 4px 6px 8px;
}

.col-chooser-pop .cc-hint {
  font-size: var(--fs-2xs);
  color: var(--text-tertiary);
  padding: 0 6px 6px;
}

.col-chooser-pop label {
  font-size: var(--fs-sm);
  cursor: pointer;
  color: var(--text-secondary);
  border-radius: 6px;
  align-items: center;
  gap: 8px;
  padding: 5px 6px;
  display: flex;
}

.col-chooser-pop label:hover {
  background: var(--surface-2);
  color: var(--text-primary);
}

.col-chooser-pop label.cc-row.dragging {
  opacity: .4;
}

.check-list {
  border: 1px solid var(--border);
  border-radius: 8px;
  flex-direction: column;
  gap: 2px;
  padding: 4px;
  display: flex;
}

.check-list label {
  font-size: var(--fs-sm);
  cursor: pointer;
  color: var(--text-secondary);
  border-radius: 6px;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  display: flex;
}

.check-list label:hover {
  background: var(--surface-2);
  color: var(--text-primary);
}

.check-list label .check-count {
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
  margin-left: auto;
}

@media (max-width: 860px) {
  .check-list label {
    min-height: 44px;
  }
}

.col-chooser-pop .cc-drag-handle {
  color: var(--text-tertiary);
  cursor: grab;
  flex-shrink: 0;
  display: inline-flex;
}

.col-chooser-pop .cc-foot {
  border-top: 1px solid var(--border-soft);
  gap: 6px;
  margin-top: 6px;
  padding-top: 8px;
  display: flex;
}

.col-chooser-pop .cc-foot button {
  flex: 1;
}

.filter-select-pop {
  z-index: 60;
  flex-direction: column;
  gap: 2px;
  max-height: 260px;
  display: flex;
}

.filter-select-opt {
  text-align: left;
  cursor: pointer;
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  background: none;
  border: none;
  border-radius: 6px;
  padding: 7px 10px;
}

.filter-select-opt:hover {
  background: var(--surface-2);
  color: var(--text-primary);
}

.filter-select-opt.active {
  background: var(--tint-primary-soft);
  color: var(--accent);
  font-weight: var(--fw-semibold);
}

.table-footer {
  font-size: var(--fs-xs);
  color: var(--text-tertiary);
  border-top: 1px solid var(--border-soft);
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  display: flex;
}

.pager {
  gap: 4px;
  display: flex;
}

.pager button {
  border: 1px solid var(--border);
  background: var(--surface-2);
  min-width: 26px;
  height: 26px;
  color: var(--text-secondary);
  font-size: var(--fs-xs);
  border-radius: 6px;
  padding: 0 6px;
}

.pager button.active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-on);
}

.pager button:disabled {
  opacity: .35;
  cursor: not-allowed;
}

.tol-tag {
  font-size: var(--fs-2xs);
  background: var(--chip-bg);
  color: var(--text-secondary);
  border-radius: 5px;
  padding: 2px 7px;
}

.tol-note {
  align-items: center;
  gap: 6px;
  display: flex;
}

.tol-note-btn {
  border: 1px solid var(--border);
  width: 24px;
  height: 24px;
  color: var(--text-tertiary);
  cursor: pointer;
  background: none;
  border-radius: 50%;
  flex-shrink: 0;
  justify-content: center;
  align-items: center;
  display: flex;
}

.tol-note-btn:hover, .tol-note-btn[aria-expanded="true"] {
  background: var(--tint-primary-soft);
  border-color: var(--tint-primary-border);
  color: var(--accent);
}

.stat-card-row {
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
  flex-wrap: wrap;
  display: flex;
}

.stat-card {
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--sp-2);
  max-width: 320px;
  padding: var(--sp-4);
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-card);
  flex: 180px;
  display: flex;
}

.stat-card-label {
  font-size: var(--fs-xs);
  color: var(--text-tertiary);
  margin-bottom: 4px;
}

.stat-card-value {
  font-size: var(--fs-3xl);
  font-weight: var(--fw-bold);
  color: var(--text-primary);
  letter-spacing: -.022em;
  line-height: 1.15;
}

.stat-card-icon {
  color: var(--tint-primary-border);
  flex-shrink: 0;
}

thead tr.th-nhom th {
  font-size: var(--fs-xs);
  padding-top: 6px;
  padding-bottom: 6px;
  position: static;
}

@media (max-width: 860px) {
  .stat-card-row.gon {
    gap: var(--sp-2);
    grid-template-columns: 1fr 1fr;
    display: grid;
  }

  .stat-card-row.gon .stat-card {
    max-width: none;
    padding: var(--sp-3);
  }

  .stat-card-row.gon .stat-card-value {
    font-size: var(--fs-xl);
  }

  .stat-card-row.gon .stat-card-icon {
    display: none;
  }
}

.date-range-filter {
  align-items: center;
  gap: 6px;
  display: inline-flex;
}

.date-range-filter-pop {
  z-index: 60;
  flex-direction: column;
  gap: 8px;
  min-width: 270px;
  max-width: calc(100vw - 32px);
  max-height: none;
  padding: 10px;
  display: flex;
}

.date-range-filter-apply {
  justify-content: center;
  margin-top: 2px;
}

.date-range-filter-fields {
  gap: 6px;
  display: flex;
}

.date-range-filter-field {
  text-align: left;
  background: var(--surface-2);
  border: 1px solid var(--border);
  cursor: pointer;
  border-radius: 6px;
  flex-direction: column;
  flex: 1;
  gap: 2px;
  padding: 6px 8px;
  display: flex;
}

.date-range-filter-field.active {
  background: var(--tint-primary-soft);
  border-color: var(--primary);
}

.date-range-filter-field-label {
  font-size: var(--fs-2xs);
  color: var(--text-tertiary);
}

.date-range-filter-field-value {
  font-size: var(--fs-sm);
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.date-range-filter-cal {
  padding-top: 2px;
}

.date-input-cal-day.in-range {
  background: var(--tint-primary-soft);
  border-radius: 0;
}

.date-range-filter-chip {
  font-size: var(--fs-2xs);
  font-weight: var(--fw-semibold);
  color: var(--accent);
  background: var(--tint-primary-soft);
  border: 1px solid var(--tint-primary-border);
  white-space: nowrap;
  border-radius: 999px;
  flex-shrink: 0;
  align-items: center;
  gap: 4px;
  padding: 4px 6px 4px 10px;
  display: inline-flex;
}

.date-range-filter-chip button {
  color: var(--accent);
  cursor: pointer;
  background: none;
  border: none;
  justify-content: center;
  align-items: center;
  padding: 2px;
  display: inline-flex;
}

.date-range-filter-chip button:hover {
  color: var(--danger, var(--red));
}

.icon-label-btn.active .icon-label-circle {
  background: var(--tint-primary);
  border-color: var(--primary);
}

.icon-label-btn.active .icon-label-text {
  color: var(--accent);
  font-weight: var(--fw-semibold);
}

@media (min-width: 861px) {
  .toolbar {
    align-items: center;
  }

  .toolbar .icon-label-btn {
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 9px;
    flex-direction: row;
    flex-shrink: 0;
    gap: 7px;
    width: auto;
    height: 36px;
    padding: 0 12px;
    transition: background .15s, border-color .15s;
  }

  .toolbar .icon-label-btn:not(.cta) .icon-label-circle {
    width: auto;
    height: auto;
    color: var(--accent);
    background: none;
    border: none;
    border-radius: 0;
    flex-shrink: 0;
  }

  .toolbar .icon-label-btn:not(.cta):hover .icon-label-circle {
    background: none;
  }

  .toolbar .icon-label-btn:not(.cta):hover {
    background: var(--surface-2);
    border-color: var(--text-tertiary);
  }

  .toolbar .icon-label-btn:not(.cta) .icon-label-text {
    white-space: nowrap;
    font-size: var(--fs-sm);
    color: var(--text-secondary);
    word-break: normal;
    text-align: left;
    max-width: none;
  }

  .toolbar .icon-label-btn.filter-quick-btn.cta, .toolbar .icon-label-btn.active {
    background: var(--tint-primary-soft);
    border-color: var(--tint-primary-border);
  }

  .toolbar .icon-label-btn.filter-quick-btn.cta .icon-label-text, .toolbar .icon-label-btn.active .icon-label-text {
    color: var(--accent);
    font-weight: var(--fw-semibold);
  }

  .toolbar .filter-select, .toolbar .search-box, .toolbar .btn.btn-sm, .toolbar .icon-label-btn.cta {
    height: 36px;
  }
}

.role-chip {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-secondary);
  border-radius: 10px;
  padding: 3px 10px;
  text-decoration: line-through;
}

.role-chip.active {
  background: var(--tint-primary);
  border-color: var(--tint-primary-border);
  color: var(--accent);
  text-decoration: none;
}

.role-chip:disabled {
  cursor: default;
  opacity: .7;
}

.role-chip.active.vo-hieu {
  background: var(--tint-red);
  border-color: var(--tint-red-border);
  color: var(--danger, #b42318);
  text-underline-offset: 2px;
  -webkit-text-decoration: underline dashed;
  text-decoration: underline dashed;
}

.quyen-chip {
  text-align: left;
  cursor: pointer;
  max-width: 100%;
  font-family: inherit;
  font-size: var(--fs-xs);
  border: 1px solid #0000;
  border-radius: 10px;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  line-height: 1.35;
  display: inline-flex;
}

.quyen-chip.duoc {
  background: var(--tint-primary);
  border-color: var(--tint-primary-border);
  color: var(--accent);
}

.quyen-chip.cam {
  background: var(--tint-red);
  border-color: var(--tint-red-border);
  color: var(--danger, var(--red));
  text-decoration: line-through;
}

.quyen-chip.mac-dinh, .quyen-chip.chua-cau-hinh {
  border-style: dashed;
}

.quyen-chip:hover {
  filter: brightness(1.08);
}

.quyen-chip.view {
  width: 100%;
  font-size: var(--fs-sm);
  padding: 5px 10px;
  display: flex;
}

.quyen-chip-ly-do {
  color: var(--text-tertiary);
  font-size: var(--fs-xs);
  font-weight: var(--fw-normal);
  text-decoration: none;
}

.quyen-chip-list {
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 5px;
  margin-left: 18px;
  display: flex;
}

.quyen-chip.hai-lop {
  background: var(--tint-amber);
  border-color: var(--amber);
  color: var(--amber-fill);
  border-width: 2px;
}

.quyen-view-row.cum-hai-lop {
  border-left: 3px solid var(--amber);
  background: var(--tint-amber);
  border-radius: 8px;
  padding: 6px 8px 8px;
}

.quyen-chip.view.hai-lop {
  border-color: var(--amber);
  border-width: 2px;
}

.quyen-thu-tu-2lop {
  color: var(--amber-fill);
  margin: 6px 0 2px 18px;
}

.quyen-badge-2lop {
  background: var(--tint-amber);
  border: 1px solid var(--amber);
  color: var(--amber-fill);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  white-space: nowrap;
  border-radius: 999px;
  margin-left: auto;
  padding: 1px 8px;
  text-decoration: none;
}

@keyframes dong-nhay-toi-fade {
  0%, 60% {
    background: var(--tint-amber);
  }

  100% {
    background: none;
  }
}

.dong-nhay-toi > td {
  animation: 4s ease-out forwards dong-nhay-toi-fade;
}

.dong-nhay-toi > td:first-child {
  box-shadow: inset 3px 0 0 var(--amber);
}

.quyen-view-row {
  border-top: 1px solid var(--border-soft);
  padding: 8px 14px;
}

.quyen-phanhe-head {
  cursor: pointer;
  width: 100%;
  font-family: inherit;
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  text-align: left;
  background: none;
  border: none;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  display: flex;
}

.quyen-phanhe-head:hover {
  background: var(--surface-2);
}

.quyen-phanhe-caret {
  color: var(--text-tertiary);
  flex-shrink: 0;
  width: 12px;
}

.quyen-phanhe-ten {
  flex: 1;
  min-width: 0;
}

.quyen-dem {
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  white-space: nowrap;
  border-radius: 999px;
  padding: 2px 8px;
}

.quyen-dem.duoc {
  background: var(--tint-primary);
  color: var(--accent);
}

.quyen-dem.cam {
  background: var(--tint-red);
  color: var(--danger, var(--red));
}

.ma-tran-quyen .mtq-col-ten {
  min-width: 260px;
}

.ma-tran-quyen .mtq-col-role {
  min-width: 58px;
}

.ma-tran-quyen td.o-chua-cau-hinh {
  background: var(--tint-red);
}

.ma-tran-quyen td.o-chua-cau-hinh .cell-sub {
  color: var(--danger, var(--red));
  font-weight: var(--fw-bold);
}

@media (max-width: 860px) {
  .quyen-chip-list {
    gap: 5px;
    margin-left: 8px;
  }

  .quyen-chip {
    white-space: normal;
    overflow-wrap: anywhere;
    max-width: 100%;
  }

  .quyen-chip.view {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

  .quyen-view-row {
    padding: 8px 10px;
  }

  .toolbar.toolbar-tabs {
    scrollbar-width: none;
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .toolbar.toolbar-tabs::-webkit-scrollbar {
    display: none;
  }

  .toolbar.toolbar-tabs > * {
    flex: none;
    order: 0;
  }

  .role-chip {
    font-size: var(--fs-2xs);
    border-radius: 8px;
    padding: 1px 6px;
  }

  :is(td:has( > .role-chip), td:has(.role-chip)) {
    line-height: var(--lh-comfortable);
  }

  .screen-block table:has(.role-chip) {
    table-layout: fixed;
    width: 100%;
  }

  .screen-block table:has(.role-chip) td {
    overflow-wrap: anywhere;
  }

  .ma-tran-quyen {
    font-size: var(--fs-2xs);
    table-layout: fixed;
    width: max-content;
  }

  .ma-tran-quyen thead th:first-child {
    z-index: 4;
    position: sticky;
    left: 0;
  }

  .ma-tran-quyen .mtq-col-role {
    width: 34px;
    min-width: 34px;
    padding: 4px 2px;
  }

  .ma-tran-quyen td:not(:first-child) {
    padding: 4px 2px;
  }

  .ma-tran-quyen .mtq-col-ten, .ma-tran-quyen td:first-child {
    width: 130px;
    min-width: 130px;
    max-width: 130px;
    padding-right: 6px;
  }

  .ma-tran-quyen td:first-child > * {
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

.catalog-note {
  margin-top: 20px;
}

.catalog-note .callout {
  margin-top: 10px;
}

.callout {
  background: var(--tint-primary-soft);
  border: 1px solid var(--tint-primary-border);
  border-radius: var(--radius);
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  gap: 10px;
  margin-top: 20px;
  padding: 12px 14px;
  display: flex;
}

.callout b {
  color: var(--text-primary);
}

.callout.warn {
  background: var(--tint-red);
  border-color: var(--tint-red-border);
}

.empty-state {
  text-align: center;
  color: var(--text-tertiary);
  font-size: var(--fs-sm);
  padding: 40px 14px;
}

.bao-cao-grid {
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
  display: grid;
}

.bao-cao-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  align-items: flex-start;
  gap: 12px;
  min-height: 96px;
  padding: 14px 16px;
  transition: border-color .15s, box-shadow .15s;
  display: flex;
  position: relative;
}

.bao-cao-card:hover {
  border-color: var(--tint-primary-border);
  box-shadow: var(--shadow-card);
}

.bao-cao-card-mo {
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  min-width: 0;
  margin: 0;
  padding: 0;
}

.bao-cao-card-mo:after {
  content: "";
  border-radius: inherit;
  position: absolute;
  inset: 0;
}

.bao-cao-card-actions, .bao-cao-quyen {
  z-index: 1;
  position: relative;
}

.bao-cao-card-mo:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

@supports selector(:has(*)) {
  .bao-cao-card-mo:focus-visible {
    outline: none;
  }

  .bao-cao-card:has(.bao-cao-card-mo:focus-visible) {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
  }
}

.bao-cao-card.is-hidden {
  opacity: .6;
}

.bao-cao-card-icon {
  background: var(--tint-primary-soft);
  border: 1px solid var(--tint-primary-border);
  width: 38px;
  height: 38px;
  color: var(--primary);
  border-radius: 50%;
  flex-shrink: 0;
  justify-content: center;
  align-items: center;
  display: flex;
}

.bao-cao-card-body {
  flex: 1;
  min-width: 0;
}

.bao-cao-card-body .cell-main {
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  display: flex;
}

.bao-cao-card-head {
  align-items: flex-start;
  gap: 8px;
  display: flex;
}

.bao-cao-card-head .cell-main {
  flex: 1;
}

.bao-cao-card-actions {
  flex-shrink: 0;
  gap: 4px;
  display: flex;
}

.bao-cao-quyen {
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
  display: flex;
}

.bao-cao-quyen-chip {
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  max-width: 100%;
  font-size: var(--fs-2xs);
  color: var(--text-secondary);
  border-radius: 999px;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  display: inline-flex;
}

.bao-cao-quyen-chip.dem {
  background: var(--tint-primary-soft);
  border-color: var(--tint-primary-border);
  color: var(--text-primary);
}

.bao-cao-quyen-chip.dem svg {
  color: var(--primary);
}

.bao-cao-quyen-chip.canh-bao {
  background: var(--tint-amber);
  border-color: var(--tint-amber-border, var(--border));
  color: var(--amber);
}

.bao-cao-quyen-chip {
  white-space: nowrap;
  overflow: hidden;
}

.bao-cao-quyen-chip > span {
  align-items: baseline;
  min-width: 0;
  max-width: 220px;
  display: inline-flex;
}

.bao-cao-quyen-chip .ma-nv {
  font-weight: var(--fw-semibold);
  flex-shrink: 0;
}

.bao-cao-quyen-chip .ten-nv {
  color: var(--text-tertiary);
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline;
  overflow: hidden;
}

@media (max-width: 720px) {
  .bao-cao-grid {
    grid-template-columns: 1fr;
  }
}

@media (hover: none) {
  .bao-cao-card-actions .icon-label-btn {
    min-width: 44px;
    padding-left: 8px;
    padding-right: 8px;
  }
}

.bao-cao-list {
  flex-direction: column;
  display: flex;
}

.bao-cao-row {
  border-bottom: 1px solid var(--border-soft);
  cursor: pointer;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  display: flex;
}

.bao-cao-row:last-child {
  border-bottom: none;
}

.bao-cao-row:hover {
  background: var(--surface-2);
}

.bao-cao-row.active {
  background: var(--tint-primary-soft);
}

.bao-cao-row.is-hidden {
  opacity: .6;
}

.bao-cao-row .bao-cao-row-main {
  min-width: 0;
}

.bao-cao-row .bao-cao-row-main .cell-main {
  align-items: center;
  gap: 8px;
  display: flex;
}

.bao-cao-drilldown-head {
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  display: flex;
}

.bao-cao-drilldown-head h2 {
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
}

.bao-cao-drilldown-head .spacer {
  flex: 1;
}

@media (max-width: 720px) {
  .bao-cao-drilldown-head {
    flex-wrap: wrap;
  }

  .bao-cao-drilldown-head h2 {
    flex-basis: 100%;
    order: -1;
  }
}

.bao-cao-iframe-wrap {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--surface);
  margin-bottom: 16px;
  overflow: hidden;
}

.bao-cao-iframe-wrap iframe {
  width: 100%;
  min-height: var(--bc-chieu-cao, 480px);
  border: none;
  display: block;
}

@media (max-width: 720px) {
  .bao-cao-iframe-wrap iframe {
    min-height: max(360px, 100dvh - 250px);
  }
}

.bao-cao-iframe-wrap.toan-man-hinh {
  z-index: 60;
  border: none;
  border-radius: 0;
  margin: 0;
  position: fixed;
  inset: 0;
}

.bao-cao-iframe-wrap.toan-man-hinh iframe {
  height: 100dvh;
  min-height: 100dvh;
}

.bao-cao-thoat-toan-man-hinh {
  top: calc(env(safe-area-inset-top, 0px) + 10px);
  z-index: 61;
  position: fixed;
  right: 10px;
}

.bao-cao-error-banner {
  text-align: center;
  min-height: 480px;
  color: var(--amber);
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 20px;
  display: flex;
}

@media (max-width: 720px) {
  .bao-cao-error-banner {
    min-height: 360px;
  }
}

.bao-cao-error-banner p {
  color: var(--text-secondary);
  font-size: var(--fs-sm);
  max-width: 420px;
}

.hdsd-title {
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  margin-bottom: 10px;
}

.hdsd-content, .ProseMirror {
  font-size: var(--fs-base);
  line-height: var(--lh-relaxed);
  color: var(--text-primary);
}

.hdsd-content h1, .ProseMirror h1 {
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  margin: 14px 0 8px;
}

.hdsd-content h2, .ProseMirror h2 {
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  margin: 12px 0 6px;
}

.hdsd-content h3, .ProseMirror h3 {
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
  margin: 10px 0 6px;
}

.hdsd-content p, .ProseMirror p {
  text-align: justify;
  margin: 0 0 10px;
}

.hdsd-content ul, .hdsd-content ol, .ProseMirror ul, .ProseMirror ol {
  margin: 0 0 10px;
  padding-left: 22px;
}

.hdsd-content li, .ProseMirror li {
  text-align: justify;
  margin-bottom: 4px;
}

.hdsd-content img, .ProseMirror img {
  border-radius: 6px;
  max-width: 100%;
  margin: 6px auto;
  display: block;
}

.hdsd-content a, .ProseMirror a {
  color: var(--accent);
}

.hdsd-content code, .ProseMirror code {
  font-family: var(--font-mono);
  background: var(--chip-bg);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: .92em;
}

.hdsd-content thead th, .ProseMirror thead th {
  font-weight: var(--fw-bold);
  border-bottom: 1px solid var(--border-soft);
}

.hdsd-content table, .ProseMirror table {
  border-collapse: collapse;
  table-layout: auto;
  width: 100%;
  margin: 0 0 10px;
}

.hdsd-content td, .hdsd-content th, .ProseMirror td, .ProseMirror th {
  text-align: left;
  vertical-align: top;
  border: none;
  padding: 3px 10px 3px 0;
}

.hdsd-content td:last-child, .hdsd-content th:last-child, .ProseMirror td:last-child, .ProseMirror th:last-child {
  padding-right: 0;
}

.hdsd-content td p, .hdsd-content th p, .ProseMirror td p, .ProseMirror th p {
  margin: 0 0 4px;
}

.ProseMirror td, .ProseMirror th {
  border: 1px dashed var(--border-soft);
  padding: 6px 10px;
}

.print-sheet h1 {
  text-align: center;
  font-size: var(--fs-2xl);
  margin: 4px 0 14px;
}

.ProseMirror:focus {
  outline: none;
}

.hdsd-layout {
  align-items: flex-start;
  gap: 20px;
  display: flex;
}

.hdsd-layout .hdsd-main {
  flex: auto;
  min-width: 0;
}

.hdsd-toc {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  flex: 0 0 230px;
  max-width: 260px;
  max-height: calc(100vh - 48px);
  padding: 12px;
  position: sticky;
  top: 24px;
  overflow-y: auto;
}

.hdsd-toc-header {
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  display: flex;
}

.hdsd-toc ul {
  flex-direction: column;
  gap: 1px;
  list-style: none;
  display: flex;
}

.hdsd-toc li.hdsd-toc-lv2 {
  padding-left: 8px;
}

.hdsd-toc li.hdsd-toc-lv3 {
  padding-left: 18px;
}

.hdsd-toc button {
  text-align: left;
  cursor: pointer;
  width: 100%;
  font-family: inherit;
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  background: none;
  border: none;
  border-radius: 6px;
  padding: 5px 8px;
  line-height: 1.4;
  display: block;
}

.hdsd-toc li.hdsd-toc-lv3 button {
  font-size: var(--fs-xs);
  color: var(--text-tertiary);
}

.hdsd-toc button:hover {
  background: var(--surface-2);
  color: var(--text-primary);
}

.hdsd-toc button.active {
  background: var(--tint-primary-soft);
  color: var(--accent);
  font-weight: var(--fw-semibold);
}

@media (max-width: 1100px) {
  .hdsd-layout {
    flex-direction: column;
  }

  .hdsd-toc {
    flex-basis: auto;
    max-width: none;
    max-height: 260px;
    position: static;
  }
}

.sync-box, .excel-box {
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding: 10px 14px;
  display: flex;
}

.sync-box .src-label, .sync-meta {
  font-size: var(--fs-xs);
  color: var(--text-tertiary);
}

.sync-box .src-label code {
  background: var(--chip-bg);
  border-radius: 4px;
  padding: 1px 5px;
}

.sync-meta {
  margin-left: auto;
}

.sync-btn {
  justify-content: center;
  align-items: center;
  gap: 6px;
  min-width: 176px;
  display: inline-flex;
}

.sync-btn .ic.spin {
  animation: .8s linear infinite sync-spin;
  display: inline-block;
}

@keyframes sync-spin {
  to {
    transform: rotate(360deg);
  }
}

.icon-spin {
  transform-origin: 50%;
  animation: 1.8s linear infinite sync-spin;
}

@media (prefers-reduced-motion: reduce) {
  .icon-spin {
    animation: none;
  }
}

.badge.badge-dang-chay {
  align-items: center;
  gap: 4px;
  display: inline-flex;
}

.map-side-row .sr-sub.sr-dang-chay {
  color: var(--green);
  font-weight: var(--fw-semibold);
  align-items: center;
  gap: 4px;
  display: inline-flex;
}

.sync-result {
  font-size: var(--fs-xs);
  color: var(--green);
  align-items: center;
  gap: 5px;
  display: inline-flex;
}

.btn-excel-tmpl, .btn-excel-upload {
  color: var(--text-secondary);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  cursor: pointer;
  white-space: nowrap;
  border: 1px solid var(--border);
  background: none;
  border-radius: 6px;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-family: inherit;
  display: inline-flex;
}

.btn-excel-upload {
  border-style: dashed;
}

.btn-excel-tmpl:hover, .btn-excel-upload:hover {
  border-color: var(--primary);
  color: var(--text-primary);
}

.btn-excel-upload:disabled {
  cursor: wait;
  opacity: .7;
}

.excel-result {
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  border-radius: 8px;
  flex-direction: column;
  gap: 3px;
  max-width: 420px;
  padding: 5px 12px;
  display: flex;
}

.excel-result.ok {
  color: var(--green);
  background: #22c55e1f;
  border: 1px solid #22c55e59;
}

.excel-result.err {
  background: var(--tint-red);
  color: var(--red);
  border: 1px solid var(--tint-red-border);
}

.toast-host {
  z-index: 60;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-card);
  color: var(--green);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  border-radius: 8px;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  display: flex;
  position: fixed;
  bottom: 20px;
  right: 20px;
}

.toast-host span {
  color: var(--text-primary);
}

.modal-overlay {
  background: var(--overlay);
  z-index: 70;
  justify-content: center;
  align-items: center;
  padding: 20px;
  display: flex;
  position: fixed;
  inset: 0;
}

.detail-panel-backdrop {
  z-index: 55;
}

.modal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 760px;
  max-width: 96vw;
  max-height: 92vh;
  box-shadow: var(--shadow-modal);
  flex-direction: column;
  display: flex;
}

.modal-card.narrow {
  width: 460px;
}

.modal-card.wide {
  width: min(920px, 96vw);
}

.modal-card.xl {
  width: min(1320px, 96vw);
}

.qr-scanner-overlay {
  z-index: 60;
  background: #000000d9;
  justify-content: center;
  align-items: center;
  display: flex;
  position: fixed;
  inset: 0;
}

.qr-scanner-card {
  background: #000;
  border-radius: 12px;
  width: min(90vw, 400px);
  overflow: hidden;
}

.qr-scanner-head {
  color: #fff;
  background: #ffffff1a;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  display: flex;
}

.qr-scanner-head span {
  font-weight: var(--fw-semibold);
  font-size: var(--fs-sm);
  align-items: center;
  gap: 6px;
  display: inline-flex;
}

.qr-scanner-head button {
  color: #fff;
  cursor: pointer;
  background: none;
  border: none;
  padding: 2px;
  display: flex;
}

.qr-scanner-video-wrap {
  aspect-ratio: 4 / 3;
  background: #111;
  position: relative;
}

.qr-scanner-video-wrap video {
  object-fit: cover;
  width: 100%;
  height: 100%;
}

.qr-scanner-frame {
  pointer-events: none;
  justify-content: center;
  align-items: center;
  display: flex;
  position: absolute;
  inset: 0;
}

.qr-scanner-frame div {
  aspect-ratio: 1;
  border: 2px solid #fffc;
  border-radius: 8px;
  width: 60%;
  box-shadow: 0 0 0 9999px #0006;
}

.qr-scanner-detected {
  color: #fff;
  background: #00b4004d;
  justify-content: center;
  align-items: center;
  font-size: 42px;
  display: flex;
  position: absolute;
  inset: 0;
}

.qr-scanner-fallback {
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 14px;
  padding: 16px;
  display: flex;
  position: absolute;
  inset: 0;
}

.qr-scanner-fallback p {
  color: #f88;
  text-align: center;
  font-size: var(--fs-xs);
  margin: 0;
}

.qr-scanner-hint {
  text-align: center;
  color: #fff9;
  font-size: var(--fs-xs);
  padding: 10px 14px;
}

.search-box-icon-btn {
  cursor: pointer;
  color: var(--text-tertiary);
  background: none;
  border: none;
  flex-shrink: 0;
  align-items: center;
  padding: 0;
  display: flex;
}

.search-box-icon-btn:hover {
  color: var(--text-primary);
}

.mirror-map-split {
  grid-template-columns: 1fr 1fr;
  align-items: start;
  gap: 16px;
  display: grid;
}

@media (max-width: 1100px) {
  .mirror-map-split {
    grid-template-columns: 1fr;
  }
}

.mirror-map-split .table-card {
  margin: 0;
}

.split-layout {
  align-items: flex-start;
  gap: 20px;
  display: flex;
}

.split-layout .split-main {
  flex: auto;
  min-width: 0;
}

.detail-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 46vw;
  box-shadow: var(--shadow-modal);
  flex-direction: column;
  flex: 0 0 460px;
  max-height: calc(100vh - 48px);
  animation: .18s detailPanelIn;
  display: flex;
  position: sticky;
  top: 24px;
  overflow: hidden;
}

.detail-panel .modal-body {
  flex: auto;
  overflow-y: auto;
}

@keyframes detailPanelIn {
  from {
    opacity: .4;
    transform: translateX(12px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (max-width: 1100px) {
  .split-layout {
    flex-direction: column;
  }

  .detail-panel, .detail-panel.expanded {
    box-shadow: none;
    z-index: 55;
    border: none;
    border-radius: 0;
    flex-basis: auto;
    width: 100% !important;
    max-width: none !important;
    height: 100% !important;
    max-height: none !important;
    position: fixed !important;
    inset: 0 !important;
    transform: none !important;
  }

  .split-main {
    display: none;
  }

  .modal-head h3 .detail-title-sub {
    margin-top: 3px;
    display: block;
  }
}

.detail-panel-resizer {
  cursor: col-resize;
  z-index: 5;
  background: none;
  justify-content: center;
  align-items: center;
  width: 12px;
  display: flex;
  position: absolute;
  top: 0;
  bottom: 0;
  left: -6px;
}

.detail-panel-resizer:before {
  content: "";
  background: var(--border);
  border-radius: 3px;
  width: 3px;
  height: 40px;
  transition: background .12s;
}

.detail-panel-resizer:hover:before, .detail-panel-resizer.resizing:before {
  background: var(--primary);
}

.detail-panel-expand-btn {
  flex-shrink: 0;
}

@media (max-width: 1100px) {
  .detail-panel-resizer, .detail-panel .modal-head .close-x.detail-panel-expand-btn {
    display: none;
  }
}

.detail-panel .modal-head .close-x {
  width: 34px;
  height: 34px;
  color: var(--accent);
  background: var(--tint-primary-soft);
  border: 1px solid var(--tint-primary-border);
  border-radius: 50%;
  justify-content: center;
  align-items: center;
  transition: background .15s, border-color .15s, color .15s;
  display: flex;
}

.detail-panel .modal-head .close-x:hover {
  background: var(--tint-primary);
  border-color: var(--tint-primary-border);
}

.detail-panel.expanded {
  z-index: 60;
  flex-basis: auto;
  width: 92vw;
  max-width: 1400px;
  height: 88vh;
  max-height: 88vh;
  left: 50%;
  transform: translate(-50%, -50%);
  position: fixed !important;
  top: 50% !important;
}

.detail-panel.expanded .detail-panel-resizer {
  display: none;
}

.modal-head {
  border-bottom: 1px solid var(--border-soft);
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  display: flex;
}

.modal-head h3 {
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
  letter-spacing: -.015em;
  border-left: 3px solid var(--primary);
  padding-left: 10px;
}

.modal-head h3 .detail-title-sub {
  font-weight: var(--fw-normal);
  font-size: var(--fs-sm);
  color: var(--text-secondary);
}

.modal-head h3 .detail-title-hen {
  margin-top: 6px;
  display: block;
}

.modal-head .close-x {
  color: var(--text-tertiary);
  font-size: var(--fs-lg);
  background: none;
  border: none;
}

.modal-head.has-quick-actions {
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}

.modal-head-top {
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  display: flex;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
}

.modal-head-left {
  align-items: center;
  gap: 12px;
  min-width: 0;
  display: flex;
}

.modal-head-left h3 {
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

.avatar-circle {
  object-fit: cover;
  border-radius: 50%;
  flex-shrink: 0;
}

.avatar-fallback {
  background: var(--primary);
  color: var(--primary-on);
  font-weight: var(--fw-semibold);
  border-radius: 50%;
  flex-shrink: 0;
  justify-content: center;
  align-items: center;
  display: flex;
}

.quick-actions {
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 14px 10px;
  display: flex;
}

.quick-actions.grid-actions {
  grid-template-columns: repeat(auto-fit, minmax(52px, 1fr));
  justify-items: center;
  gap: 10px 8px;
  display: grid;
}

.quick-actions.grid-actions .icon-label-btn {
  width: 100%;
  max-width: 66px;
}

.icon-label-btn {
  cursor: pointer;
  background: none;
  border: none;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  width: 66px;
  padding: 0;
  display: flex;
}

.icon-label-btn .icon-label-circle {
  width: 40px;
  height: 40px;
  color: var(--accent);
  background: var(--tint-primary-soft);
  border: 1px solid var(--tint-primary-border);
  border-radius: 50%;
  flex-shrink: 0;
  justify-content: center;
  align-items: center;
  transition: background .15s, border-color .15s, color .15s;
  display: flex;
}

.icon-label-btn:hover .icon-label-circle {
  background: var(--tint-primary);
  border-color: var(--tint-primary-border);
}

.icon-label-btn .icon-label-circle svg {
  display: block;
}

.icon-label-btn .icon-label-text {
  font-size: var(--fs-2xs);
  color: var(--text-secondary);
  text-align: center;
  word-break: break-word;
  max-width: 66px;
  line-height: 1.25;
}

.icon-label-btn:hover .icon-label-text {
  color: var(--text-primary);
}

.icon-label-btn:disabled {
  opacity: .4;
  cursor: not-allowed;
}

.icon-label-btn:disabled:hover .icon-label-circle {
  background: var(--tint-primary-soft);
  border-color: var(--tint-primary-border);
}

.icon-label-btn:disabled:hover .icon-label-text {
  color: var(--text-secondary);
}

.row-actions .icon-label-btn.danger:disabled:hover .icon-label-circle {
  background: var(--tint-red);
  border-color: var(--danger-border);
}

.row-actions .icon-label-btn.danger:disabled:hover .icon-label-text {
  color: var(--text-secondary);
}

.icon-label-btn.disabled {
  opacity: .4;
  cursor: not-allowed;
  pointer-events: none;
}

.day-strip {
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
  padding: 10px 12px;
  display: flex;
}

.day-strip-label {
  color: var(--text-tertiary);
  font-size: var(--fs-2xs);
  margin-right: 2px;
}

.day-chip {
  border: 1px solid var(--border);
  min-width: 34px;
  height: 32px;
  color: var(--text-secondary);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  cursor: pointer;
  background: none;
  border-radius: 7px;
  justify-content: center;
  align-items: center;
  padding: 0 7px;
  display: inline-flex;
  position: relative;
}

.day-chip.has {
  border-color: var(--tint-primary-border);
  background: var(--tint-primary-soft);
  color: var(--text-primary);
}

.day-chip.empty {
  opacity: .35;
}

.day-chip:hover {
  border-color: var(--primary);
}

.day-chip.on {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.day-chip.on small {
  color: #fffc;
}

.day-chip small {
  font-size: var(--fs-2xs);
  font-weight: var(--fw-medium);
  opacity: .75;
  position: absolute;
  bottom: 1px;
  right: 3px;
}

.day-chip.clear {
  min-width: auto;
  font-weight: var(--fw-medium);
  padding: 0 12px;
}

@media (max-width: 860px) {
  .day-strip {
    gap: 5px;
    padding: 8px 9px;
  }

  .day-chip {
    min-width: 38px;
    height: 38px;
    padding: 0 4px;
  }
}

.row-actions .icon-label-btn, .cccd-mask .icon-label-btn {
  gap: 3px;
  width: auto;
}

.row-actions .icon-label-btn .icon-label-circle, .cccd-mask .icon-label-btn .icon-label-circle {
  width: 28px;
  height: 28px;
}

.row-actions .icon-label-btn .icon-label-text, .cccd-mask .icon-label-btn .icon-label-text {
  font-size: var(--fs-2xs);
  white-space: nowrap;
  max-width: none;
}

.row-actions .icon-label-btn.danger .icon-label-circle {
  color: var(--red);
  background: var(--tint-red);
  border-color: var(--danger-border);
}

.row-actions .icon-label-btn.danger:hover .icon-label-circle {
  color: var(--red);
  border-color: var(--danger-border);
}

.row-actions .icon-label-btn.danger:hover .icon-label-text {
  color: var(--red);
}

.quick-actions .icon-label-btn.danger .icon-label-circle {
  color: var(--red);
  background: var(--tint-red);
  border-color: var(--danger-border);
}

.quick-actions .icon-label-btn.danger:hover .icon-label-circle {
  color: var(--red);
  border-color: var(--danger-border);
}

.quick-actions .icon-label-btn.danger:hover .icon-label-text {
  color: var(--red);
}

.quick-actions .icon-label-btn.ok .icon-label-circle, .row-actions .icon-label-btn.ok .icon-label-circle {
  color: var(--green);
  background: var(--tint-green);
  border-color: var(--ok-border);
}

.quick-actions .icon-label-btn.ok:hover .icon-label-circle, .row-actions .icon-label-btn.ok:hover .icon-label-circle {
  color: var(--green);
  border-color: var(--ok-border);
}

.quick-actions .icon-label-btn.ok .icon-label-text, .row-actions .icon-label-btn.ok .icon-label-text {
  color: var(--green);
  font-weight: var(--fw-semibold);
}

.row-actions {
  gap: 4px 12px;
}

.icon-label-btn.compact {
  gap: 3px;
  width: auto;
}

.icon-label-btn.compact .icon-label-circle {
  width: 28px;
  height: 28px;
}

.icon-label-btn.compact .icon-label-text {
  font-size: var(--fs-2xs);
  white-space: nowrap;
  max-width: none;
}

.icon-label-btn.cta {
  gap: 3px;
  width: auto;
}

.icon-label-btn.cta .icon-label-circle {
  background: var(--primary);
  border-color: var(--primary);
  width: 28px;
  height: 28px;
  color: var(--primary-on);
}

.icon-label-btn.cta:hover .icon-label-circle {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.icon-label-btn.cta .icon-label-text {
  font-size: var(--fs-2xs);
  white-space: nowrap;
  max-width: none;
  color: var(--text-primary);
  font-weight: var(--fw-semibold);
}

.icon-label-btn.pdf .icon-label-circle {
  color: var(--red);
  background: var(--tint-red);
  border-color: var(--danger-border);
}

.icon-label-btn.pdf:hover .icon-label-circle {
  background: var(--tint-red);
  border-color: var(--red);
}

.icon-label-btn.pdf:hover .icon-label-text {
  color: var(--red);
}

.icon-label-btn.excel .icon-label-circle {
  color: var(--orange);
  background: var(--tint-orange);
  border-color: var(--tint-orange-border);
}

.icon-label-btn.excel:hover .icon-label-circle {
  background: var(--tint-orange);
  border-color: var(--orange);
}

.icon-label-btn.excel:hover .icon-label-text {
  color: var(--orange);
}

.mat-tien-hero {
  text-align: center;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 48px 16px;
  display: flex;
}

.mat-tien-scan-btn {
  cursor: pointer;
  width: 132px;
  height: 132px;
  color: var(--accent);
  background: var(--tint-primary-soft);
  border: 1px solid var(--tint-primary-border);
  border-radius: 50%;
  flex-shrink: 0;
  justify-content: center;
  align-items: center;
  transition: background .15s, border-color .15s;
  display: flex;
}

.mat-tien-scan-btn:hover, .mat-tien-scan-btn:active {
  background: var(--tint-primary);
  border-color: var(--primary);
}

.mat-tien-hero-label {
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  margin-top: 18px;
}

.mat-tien-hero-hint {
  font-size: var(--fs-sm);
  color: var(--text-tertiary);
  max-width: 320px;
}

.mat-tien-result {
  text-align: center;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: 420px;
  margin: 0 auto;
  padding: 32px 16px;
  display: flex;
}

.mat-tien-result .quick-actions {
  justify-content: center;
}

.qe-preview {
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  display: flex;
}

.qe-preview img {
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 8px;
  width: 96px;
  height: 96px;
}

.qe-preview-btn {
  cursor: zoom-in;
  background: none;
  border: 0;
  border-radius: 8px;
  padding: 0;
  line-height: 0;
}

.qe-preview-btn:hover img, .qe-preview-btn:focus-visible img {
  border-color: var(--primary);
  filter: brightness(1.04);
}

.qe-preview-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.qe-preview .qe-noimg {
  border: 1px dashed var(--border);
  text-align: center;
  width: 96px;
  height: 96px;
  font-size: var(--fs-2xs);
  color: var(--text-tertiary);
  border-radius: 8px;
  justify-content: center;
  align-items: center;
  padding: 4px;
  display: flex;
}

.modal-foot {
  border-top: 1px solid var(--border-soft);
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  padding: 18px 24px;
  display: flex;
}

.modal-foot .spacer {
  flex: 1;
}

.form-section {
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: var(--sp-5);
  margin-bottom: var(--sp-5);
}

.form-section:last-child {
  margin-bottom: 0;
}

.form-section-title {
  font-size: var(--fs-2xs);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  font-weight: var(--fw-bold);
  margin-bottom: 16px;
}

.form-section .form-grid:last-child, .form-section .table-card:last-child {
  margin-bottom: 0;
}

.form-group-label {
  font-size: var(--fs-2xs);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  font-weight: var(--fw-semibold);
  border-bottom: 1px solid var(--border-soft);
  margin: 26px 0 8px;
  padding-bottom: 6px;
}

.form-group-label:first-child {
  margin-top: 0;
}

.form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 20px;
  display: grid;
}

@media (max-width: 720px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

.field {
  flex-direction: column;
  gap: 6px;
  display: flex;
}

.field.wide {
  grid-column: 1 / -1;
}

.field label {
  font-size: var(--fs-xs);
  color: var(--text-secondary);
  font-weight: var(--fw-medium);
}

.field label .req {
  color: var(--amber);
}

.field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]), .field select, .field textarea {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: var(--fs-base);
  border-radius: 10px;
  outline: none;
  width: 100%;
  padding: 10px 14px;
}

.field select option {
  background: var(--surface);
  color: var(--text-primary);
}

.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--primary);
}

.field input:disabled {
  opacity: .6;
}

.field textarea {
  resize: vertical;
  min-height: 64px;
}

.cong-tac {
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  align-items: center;
  gap: 10px;
  min-height: 32px;
  display: inline-flex;
}

.cong-tac input {
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
  position: absolute;
}

.cong-tac .ranh {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  flex: none;
  width: 40px;
  height: 22px;
  transition: background .15s, border-color .15s;
  position: relative;
}

.cong-tac .ranh:after {
  content: "";
  background: var(--surface);
  border-radius: 50%;
  width: 16px;
  height: 16px;
  transition: transform .15s;
  position: absolute;
  top: 2px;
  left: 2px;
  box-shadow: 0 1px 3px #0000004d;
}

.cong-tac input:checked + .ranh {
  background: var(--primary);
  border-color: var(--primary);
}

.cong-tac input:checked + .ranh:after {
  transform: translateX(18px);
}

.cong-tac input:focus-visible + .ranh {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.cong-tac input:disabled + .ranh {
  opacity: .5;
}

.cong-tac .chu {
  font-size: var(--fs-base);
  color: var(--text-primary);
}

.cong-tac input:not(:checked) ~ .chu {
  color: var(--text-secondary);
}

.luoi-cong-tac {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px 20px;
  display: grid;
}

@media (max-width: 860px) {
  .luoi-cong-tac {
    grid-template-columns: 1fr;
  }

  .dung-agent {
    grid-template-columns: 1fr !important;
  }
}

.field .hint {
  font-size: var(--fs-2xs);
  color: var(--text-tertiary);
}

.field label .hint {
  text-transform: none;
  font-weight: var(--fw-normal);
  letter-spacing: 0;
  margin-top: 2px;
  display: block;
}

.date-input {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  align-items: center;
  gap: 2px;
  padding: 0 6px 0 14px;
  display: flex;
  position: relative;
}

.date-input:focus-within {
  border-color: var(--primary);
}

.date-input.disabled {
  opacity: .6;
}

.date-input-text {
  min-width: 0;
  color: var(--text-primary);
  font-size: var(--fs-base);
  font-variant-numeric: tabular-nums;
  background: none;
  border: none;
  outline: none;
  flex: 1;
  padding: 10px 0;
}

.date-input-icon-btn {
  cursor: pointer;
  color: var(--text-tertiary);
  background: none;
  border: none;
  flex-shrink: 0;
  align-items: center;
  padding: 4px;
  display: flex;
}

.date-input-icon-btn:hover {
  color: var(--text-primary);
}

.date-input-cal {
  z-index: 30;
  background: var(--surface);
  border: 1px solid var(--border);
  width: 232px;
  box-shadow: var(--shadow-pop);
  border-radius: 8px;
  padding: 8px;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
}

.date-input-cal-head {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  display: flex;
}

.date-input-cal-head button {
  cursor: pointer;
  color: var(--text-tertiary);
  background: none;
  border: none;
  padding: 3px;
  display: flex;
}

.date-input-cal-head button:hover {
  color: var(--text-primary);
}

.date-input-cal-grid {
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  display: grid;
}

.date-input-cal-weekday {
  font-size: var(--fs-2xs);
  color: var(--text-tertiary);
  text-align: center;
  padding: 3px 0;
}

.date-input-cal-day {
  font-size: var(--fs-xs);
  color: var(--text-primary);
  cursor: pointer;
  text-align: center;
  font-variant-numeric: tabular-nums;
  background: none;
  border: none;
  border-radius: 5px;
  padding: 5px 0;
}

.date-input-cal-day:hover {
  background: var(--tint-primary-soft);
}

.date-input-cal-day.active {
  background: var(--primary);
  color: var(--primary-on);
  font-weight: var(--fw-semibold);
}

.field.checkbox {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.field.checkbox input {
  width: 15px;
  height: 15px;
  accent-color: var(--primary);
}

.field.checkbox label {
  font-size: var(--fs-sm);
}

.kh-select {
  position: relative;
}

.kh-select-input {
  width: 100%;
}

.kh-select-dropdown {
  z-index: 30;
  background: var(--surface);
  border: 1px solid var(--border);
  max-height: 260px;
  box-shadow: var(--shadow-pop);
  border-radius: 8px;
  padding: 4px;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  overflow-y: auto;
}

.kh-select-dropdown .empty-state {
  font-size: var(--fs-sm);
  padding: 14px 10px;
}

.kh-select-dropdown-portal {
  z-index: 160;
}

.nv-multiselect {
  flex-direction: column;
  gap: 8px;
  display: flex;
}

.nv-multiselect-search {
  width: 100%;
  min-width: 0;
}

.nv-multiselect-list {
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 6px;
  max-height: 220px;
  overflow-y: auto;
}

.nv-multiselect-list .empty-state, .nv-multiselect-list .form-error {
  padding: 14px 10px;
}

.nv-multiselect-row {
  font-size: var(--fs-sm);
  color: var(--text-primary);
  cursor: pointer;
  border-bottom: 1px solid var(--border-soft);
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  display: flex;
}

.nv-multiselect-row:last-child {
  border-bottom: none;
}

.nv-multiselect-row:hover {
  background: var(--tint-primary-soft);
}

.nv-multiselect-row input {
  width: 15px;
  height: 15px;
  accent-color: var(--primary);
  flex: none;
}

.nv-multiselect-name {
  flex-direction: column;
  gap: 1px;
  display: flex;
}

.nv-multiselect-hint {
  font-size: var(--fs-2xs);
  color: var(--text-tertiary);
}

.nv-single-row {
  text-align: left;
  background: none;
  border: none;
  justify-content: flex-start;
  width: 100%;
}

.nv-single-check {
  color: var(--accent);
  flex: none;
  margin-left: auto;
}

.nv-single-selected {
  background: var(--tint-primary-soft);
  border: 1px solid var(--tint-primary-border);
  border-radius: 6px;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  display: flex;
}

.nv-single-selected .nv-multiselect-name {
  flex: 1;
  min-width: 0;
}

.sodo-canvas .react-flow__handle {
  background: var(--primary);
  border: 2px solid var(--surface);
  width: 10px;
  height: 10px;
}

.sodo-canvas .react-flow__handle:hover {
  background: var(--primary-hover);
  width: 14px;
  height: 14px;
}

.sodo-canvas .sodo-drag-handle:hover {
  background: var(--tint-primary-soft);
  color: var(--accent);
  border-color: var(--primary) !important;
}

.sodo-canvas .sodo-drag-handle:active {
  cursor: grabbing;
}

.sodo-node-tooltip {
  z-index: 20;
  background: var(--primary);
  width: max-content;
  max-width: 280px;
  color: var(--primary-on);
  font-size: var(--fs-xs);
  text-align: left;
  box-shadow: var(--shadow-pop);
  pointer-events: none;
  white-space: normal;
  border-radius: 8px;
  padding: 8px 10px;
  line-height: 1.4;
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
}

.sodo-minimap {
  box-shadow: var(--shadow-card);
  border-radius: 8px;
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
}

@media (max-width: 860px) {
  .sodo-minimap {
    display: none !important;
  }
}

.form-error {
  background: var(--tint-red);
  border: 1px solid var(--tint-red-border);
  color: var(--form-error-fg);
  font-size: var(--fs-sm);
  border-radius: 6px;
  margin-bottom: 12px;
  padding: 9px 12px;
}

.theme-toggle {
  background: var(--surface-2);
  border: 1px solid var(--border);
  width: 30px;
  height: 30px;
  color: var(--text-secondary);
  font-size: var(--fs-base);
  border-radius: 6px;
  justify-content: center;
  align-items: center;
  gap: 6px;
  line-height: 1;
  display: inline-flex;
}

.theme-toggle:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.theme-toggle.wide {
  width: auto;
  font-size: var(--fs-xs);
  padding: 0 10px;
}

.accent-picker {
  align-items: center;
  gap: 6px;
  display: inline-flex;
}

.accent-swatch {
  width: 16px;
  height: 16px;
  box-shadow: 0 0 0 1px var(--border);
  cursor: pointer;
  border: 2px solid #0000;
  border-radius: 50%;
  flex-shrink: 0;
  padding: 0;
}

.accent-swatch:hover {
  box-shadow: 0 0 0 1px var(--border-strong);
}

.accent-swatch.active {
  border-color: var(--surface);
  box-shadow: 0 0 0 2px var(--text-primary);
}

.accent-dropdown {
  position: relative;
}

.accent-dropdown-btn {
  border: 1px solid var(--border);
  background: var(--surface-2);
  cursor: pointer;
  border-radius: 50%;
  justify-content: center;
  align-items: center;
  width: 30px;
  height: 30px;
  display: flex;
  position: relative;
}

.accent-dropdown-btn:hover {
  background: var(--tint-primary);
}

.accent-dropdown-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  min-width: 160px;
  box-shadow: var(--shadow-pop);
  z-index: 40;
  border-radius: 10px;
  padding: 6px;
  position: absolute;
  top: 38px;
  right: 0;
}

.accent-dropdown-item {
  text-align: left;
  cursor: pointer;
  width: 100%;
  font-size: var(--fs-sm);
  color: var(--text-primary);
  background: none;
  border: none;
  border-radius: 8px;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  display: flex;
}

.accent-dropdown-item:hover {
  background: var(--surface-2);
}

.accent-dropdown-item.active {
  background: var(--tint-primary);
  font-weight: var(--fw-semibold);
}

.login-wrap {
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
  display: flex;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  width: 380px;
  max-width: 100%;
  box-shadow: var(--shadow-card);
  border-radius: 10px;
  padding: 28px 26px;
}

.login-card .brand {
  border-bottom: none;
  padding: 0 0 18px;
}

.login-card .login-head {
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  display: flex;
}

.login-card h2 {
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
  margin-bottom: 4px;
}

.login-card .sub {
  font-size: var(--fs-sm);
  color: var(--text-tertiary);
  margin-bottom: 20px;
}

.login-card .field {
  margin-bottom: 14px;
}

.login-card .btn {
  justify-content: center;
  width: 100%;
}

.login-version {
  text-align: center;
  font-size: var(--fs-2xs);
  color: var(--text-tertiary);
  margin-top: 16px;
}

.login-quen-mk {
  color: var(--primary);
  font-size: var(--fs-sm);
  cursor: pointer;
  background: none;
  border: 0;
  margin: 12px auto 0;
  padding: 6px 8px;
  display: block;
}

.login-quen-mk:hover {
  text-decoration: underline;
}

.login-quen-mk-box {
  border-top: 1px solid var(--border);
  margin-top: 16px;
  padding-top: 14px;
}

@supports not selector(::-webkit-scrollbar) {
  * {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) transparent;
  }
}

::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  background-clip: content-box;
  border: 2px solid #0000;
  border-radius: 8px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-strong);
  background-clip: content-box;
}

::-webkit-scrollbar-corner {
  background: none;
}

::-webkit-scrollbar-track {
  background: none;
}

@media (max-width: 860px) {
  ::-webkit-scrollbar {
    width: 0;
    height: 0;
  }
}

.screen-switcher {
  background: var(--thead-bg);
  border-bottom: 1px solid var(--border-soft);
  z-index: 4;
  scrollbar-width: none;
  -ms-overflow-style: none;
  background-repeat: no-repeat;
  background-image: linear-gradient(to right, var(--thead-bg) 30%, #fff0),
    linear-gradient(to left, var(--thead-bg) 30%, #fff0),
    linear-gradient(to right, #0000002e, #0000),
    linear-gradient(to left, #0000002e, #0000);
  background-position: 0, 100%, 0, 100%;
  background-size: 36px 100%, 36px 100%, 12px 100%, 12px 100%;
  background-attachment: local, local, scroll, scroll;
  flex-wrap: nowrap;
  gap: 4px;
  padding: 10px 28px;
  display: flex;
  position: sticky;
  top: 0;
  overflow-x: auto;
}

.screen-switcher::-webkit-scrollbar {
  display: none;
}

.screen-switcher a, .screen-switcher button {
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  white-space: nowrap;
  background: none;
  border-radius: 6px;
  flex: none;
  padding: 6px 12px;
  scroll-margin-inline: 28px;
}

.screen-switcher a.active, .screen-switcher button.active {
  background: var(--tint-primary);
  border-color: var(--tint-primary-border);
  color: var(--accent);
}

.screen-switcher .tag {
  font-size: var(--fs-2xs);
  color: var(--text-tertiary);
  white-space: nowrap;
  flex: none;
  align-items: center;
  margin-left: 12px;
  display: flex;
}

.info-grid {
  background: var(--border-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin-bottom: 20px;
  display: grid;
  overflow: hidden;
}

@media (max-width: 900px) {
  .info-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.info-cell {
  background: var(--surface);
  padding: 12px 16px;
}

.info-cell .label {
  font-size: var(--fs-2xs);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: .03em;
  margin-bottom: 5px;
}

.info-cell .value {
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
}

.info-cell .value.sub {
  font-size: var(--fs-xs);
  color: var(--text-secondary);
  font-weight: var(--fw-normal);
  margin-top: 2px;
}

.field .value {
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
}

.view-grid {
  background: var(--border-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  flex-direction: column;
  gap: 1px;
  margin-bottom: 4px;
  display: flex;
  overflow: hidden;
}

.view-row {
  background: var(--surface);
  grid-template-columns: 180px 1fr;
  align-items: start;
  gap: 4px 16px;
  padding: 9px 14px;
  display: grid;
}

@media (max-width: 560px) {
  .view-row {
    grid-template-columns: 1fr;
  }
}

.view-row .vlabel {
  font-size: var(--fs-xs);
  color: var(--text-secondary);
  font-weight: var(--fw-medium);
}

.view-row .vvalue {
  font-size: var(--fs-sm);
  color: var(--text-primary);
  word-break: break-word;
}

.section-title {
  justify-content: space-between;
  align-items: center;
  margin: 22px 0 10px;
  display: flex;
}

.section-title h3 {
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
}

.section-title .hint {
  font-size: var(--fs-xs);
  color: var(--text-tertiary);
}

.group-row td {
  background: var(--tint-primary-soft);
  font-weight: var(--fw-bold);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--accent);
  padding: 8px 14px;
}

.lo-tag {
  font-size: var(--fs-2xs);
  color: var(--text-tertiary);
  font-family: var(--font-mono);
}

tr.dong-da-nha > td {
  opacity: .55;
  text-decoration: line-through;
}

tr.dong-da-nha > td:last-child, tr.dong-da-nha > td .badge {
  text-decoration: none;
}

.summary-bar {
  background: var(--surface-2);
  border-top: 1px solid var(--border-soft);
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  display: flex;
}

.summary-bar b {
  color: var(--text-primary);
}

.signature-box {
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 12px 14px;
  display: flex;
}

.signature-box .sig-mark {
  background: var(--tint-green);
  width: 40px;
  height: 40px;
  color: var(--green);
  font-size: var(--fs-lg);
  border-radius: 6px;
  flex-shrink: 0;
  justify-content: center;
  align-items: center;
  display: flex;
}

.signature-box .sig-mark.pending {
  background: var(--tint-amber);
  color: var(--amber);
}

.signature-box .sig-text b {
  color: var(--text-primary);
}

.signature-box .sig-text div {
  font-size: var(--fs-xs);
  color: var(--text-secondary);
}

.sig-canvas-wrap {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  touch-action: none;
  background: #fff;
  overflow: hidden;
}

.sig-canvas-hint {
  font-size: var(--fs-xs);
  color: var(--text-tertiary);
  text-align: center;
  margin-top: 8px;
}

.kiemke-field {
  margin-bottom: 14px;
}

.kiemke-field label {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--text-secondary);
  margin-bottom: 6px;
  display: block;
}

.kiemke-field input, .kiemke-field select {
  background: var(--surface-2);
  border: 1px solid var(--border);
  width: 100%;
  color: var(--text-primary);
  font-family: inherit;
  font-size: var(--fs-sm);
  border-radius: 6px;
  padding: 8px 10px;
}

.kiemke-field input[readonly] {
  color: var(--text-tertiary);
}

.kiemke-field textarea {
  background: var(--surface-2);
  border: 1px solid var(--border);
  width: 100%;
  min-height: 64px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: var(--fs-sm);
  resize: vertical;
  border-radius: 6px;
  padding: 8px 10px;
}

.warn-box {
  font-size: var(--fs-xs);
  color: var(--amber);
  background: var(--tint-amber);
  border: 1px solid var(--tint-amber);
  border-radius: 7px;
  gap: 8px;
  margin-top: 16px;
  padding: 10px 12px;
  display: flex;
}

.file-drop {
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  text-align: center;
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  background: var(--surface-2);
  cursor: pointer;
  padding: 18px 16px;
  transition: border-color .12s, background .12s;
}

.file-drop:hover, .file-drop.dragover {
  border-color: var(--primary);
}

.file-drop.dragover {
  background: var(--tint-primary-soft);
  color: var(--text-primary);
}

.tabs {
  border-bottom: 1px solid var(--border-soft);
  flex-wrap: wrap;
  gap: 2px;
  margin-bottom: 16px;
  display: flex;
}

.tab-btn {
  color: var(--text-tertiary);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  background: none;
  border: none;
  border-bottom: 2px solid #0000;
  margin-right: 22px;
  padding: 9px 4px;
  position: relative;
  top: 1px;
}

.tab-btn.active {
  color: var(--text-primary);
  border-bottom-color: var(--primary);
}

.tabs.tabs-pill {
  background: var(--surface-2);
  border-bottom: none;
  border-radius: 10px;
  gap: 4px;
  max-width: 100%;
  margin-bottom: 14px;
  padding: 4px;
  display: inline-flex;
}

.tabs.tabs-pill .tab-btn {
  white-space: nowrap;
  border-bottom: none;
  border-radius: 8px;
  margin-right: 0;
  padding: 7px 14px;
  transition: background .15s, color .15s;
  top: 0;
}

.tabs.tabs-pill .tab-btn:hover {
  color: var(--text-primary);
  background: var(--tint-gray);
}

.tabs.tabs-pill .tab-btn.active {
  background: var(--surface);
  color: var(--primary);
  font-weight: var(--fw-semibold);
  box-shadow: 0 1px 2px #00000014;
}

@media (max-width: 860px) {
  .tabs.tabs-pill {
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap;
    display: flex;
    overflow-x: auto;
  }

  .tabs.tabs-pill::-webkit-scrollbar {
    display: none;
  }
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

.breadcrumb {
  font-size: var(--fs-sm);
  color: var(--text-tertiary);
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
  display: flex;
}

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

.breadcrumb a:hover {
  color: var(--accent);
}

.detail-header {
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
  display: flex;
}

.detail-title {
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  display: flex;
}

.detail-title h2 {
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
}

.detail-title .code {
  font-size: var(--fs-sm);
  color: var(--text-tertiary);
  font-weight: var(--fw-normal);
  margin-top: 3px;
}

.detail-actions {
  flex-wrap: wrap;
  gap: 8px;
  display: flex;
}

.kh-picker {
  position: relative;
}

.kh-picker input {
  background: var(--surface-2);
  border: 1px solid var(--border);
  width: 100%;
  color: var(--text-primary);
  font-family: inherit;
  font-size: var(--fs-sm);
  border-radius: 6px;
  outline: none;
  padding: 8px 10px;
}

.kh-picker input:focus {
  border-color: var(--accent);
}

.kh-picker-list {
  z-index: 20;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-pop);
  border-radius: 8px;
  max-height: 220px;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  overflow-y: auto;
}

.kh-picker-item {
  cursor: pointer;
  border-bottom: 1px solid var(--border-soft);
  padding: 9px 12px;
}

.kh-picker-item:last-child {
  border-bottom: none;
}

.kh-picker-item:hover {
  background: var(--surface-2);
}

.kh-picker-item .kname {
  font-weight: var(--fw-semibold);
  font-size: var(--fs-sm);
}

.kh-picker-item .ksub {
  font-size: var(--fs-2xs);
  color: var(--text-tertiary);
}

.kh-picked {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding: 9px 12px;
  display: flex;
}

.kh-picked .kname {
  font-weight: var(--fw-semibold);
  font-size: var(--fs-base);
}

.kh-picked .ksub {
  font-size: var(--fs-xs);
  color: var(--text-tertiary);
}

.timeline {
  padding-left: 22px;
  position: relative;
}

.timeline:before {
  content: "";
  background: var(--border);
  width: 1px;
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 5px;
}

.tl-item {
  padding-bottom: 22px;
  position: relative;
}

.tl-item:before {
  content: "";
  background: var(--surface);
  border: 2px solid var(--gray);
  border-radius: 50%;
  width: 11px;
  height: 11px;
  position: absolute;
  top: 3px;
  left: -22px;
}

.tl-item.current:before {
  border-color: var(--green);
  background: var(--green);
}

.tl-item.pending:before {
  border-color: var(--amber);
  background: var(--amber);
}

.tl-head {
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 3px;
  display: flex;
}

.tl-head .v {
  font-weight: var(--fw-bold);
  font-size: var(--fs-base);
}

.tl-meta {
  font-size: var(--fs-xs);
  color: var(--text-tertiary);
}

.tl-desc {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  max-width: 620px;
  margin-top: 4px;
}

.ship-detail-card {
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  margin-bottom: 18px;
  padding: 12px 14px;
}

.ship-detail-product {
  font-weight: var(--fw-semibold);
  font-size: var(--fs-base);
  margin-bottom: 10px;
}

.ship-detail-grid {
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px 16px;
  display: grid;
}

.ship-detail-field {
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  display: flex;
}

.ship-detail-label {
  font-size: var(--fs-2xs);
  font-weight: var(--fw-bold);
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.ship-detail-value {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
}

.ship-detail-value.strong {
  color: var(--accent);
}

.ship-detail-link {
  border-top: 1px dashed var(--border-soft);
  width: 100%;
  color: var(--accent);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  cursor: pointer;
  background: none;
  border-bottom: none;
  border-left: none;
  border-right: none;
  align-items: center;
  gap: 4px;
  margin-top: 12px;
  padding-top: 10px;
  display: inline-flex;
}

.ship-detail-link:hover {
  text-decoration: underline;
}

.ship-tracker {
  flex-direction: column;
  display: flex;
}

.ship-step {
  gap: 12px;
  display: flex;
}

.ship-rail {
  flex-direction: column;
  flex-shrink: 0;
  align-items: center;
  width: 26px;
  display: flex;
}

.ship-dot {
  z-index: 1;
  color: var(--text-tertiary);
  background: var(--surface);
  border: 2px solid var(--border);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  flex-shrink: 0;
  justify-content: center;
  align-items: center;
  display: flex;
}

.ship-line {
  flex: 1;
  width: 2px;
  min-height: 26px;
  margin: 2px 0;
}

.ship-line.solid {
  background: var(--green);
}

.ship-line.dashed {
  background-image: linear-gradient(var(--border) 60%, transparent 40%);
  background-repeat: repeat-y;
  background-size: 2px 9px;
}

.ship-body {
  flex: 1;
  min-width: 0;
  padding-bottom: 20px;
}

.ship-step:last-child .ship-body {
  padding-bottom: 0;
}

.ship-title {
  font-weight: var(--fw-semibold);
  font-size: var(--fs-base);
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  display: flex;
}

.ship-sub {
  font-size: var(--fs-xs);
  color: var(--text-tertiary);
  margin-top: 2px;
}

.ship-sub.late {
  color: var(--red);
}

.ship-tag {
  font-size: var(--fs-2xs);
  font-weight: var(--fw-bold);
  letter-spacing: .02em;
  text-transform: uppercase;
  background: var(--tint-primary-soft);
  color: var(--accent);
  border-radius: 20px;
  padding: 1px 7px;
}

.ship-tag.late {
  background: var(--tint-red);
  color: var(--red);
}

.ship-step.done .ship-dot {
  background: var(--green-fill);
  border-color: var(--green-fill);
  color: #fff;
}

.ship-step.done .ship-title {
  color: var(--text-primary);
}

.ship-step.current .ship-dot {
  background: var(--tint-primary-soft);
  border-color: var(--primary);
  color: var(--accent);
  box-shadow: 0 0 0 4px var(--tint-primary-soft);
}

.ship-step.current .ship-title {
  color: var(--accent);
}

.ship-step.current-late .ship-dot {
  background: var(--tint-red);
  border-color: var(--red);
  color: var(--red);
  box-shadow: 0 0 0 4px var(--tint-red);
}

.ship-step.current-late .ship-title {
  color: var(--red);
}

.ship-step.upcoming .ship-title, .ship-step.upcoming .ship-sub {
  color: var(--text-tertiary);
}

.avatar-thumb {
  background: var(--surface-2);
  border: 1px solid var(--border);
  width: 34px;
  height: 34px;
  font-size: var(--fs-2xs);
  font-weight: var(--fw-bold);
  color: #fff;
  border-radius: 8px;
  flex-shrink: 0;
  justify-content: center;
  align-items: center;
  display: inline-flex;
  position: relative;
  overflow: hidden;
}

.avatar-thumb img {
  object-fit: cover;
  width: 100%;
  height: 100%;
}

.cell-thumb-text {
  align-items: center;
  gap: 8px;
  min-width: 0;
  display: flex;
}

.cell-thumb-text > .cell-thumb-text-noidung {
  flex: 1;
  min-width: 0;
}

.avatar-thumb .eye-btn {
  color: #fff;
  font-size: var(--fs-xs);
  opacity: 0;
  cursor: pointer;
  background: #00000073;
  border: none;
  justify-content: center;
  align-items: center;
  transition: all .12s;
  display: flex;
  position: absolute;
  inset: 0;
}

.avatar-thumb:hover .eye-btn {
  opacity: 1;
}

@media (hover: none) {
  .avatar-thumb .eye-btn {
    opacity: 1;
    background: #00000040;
  }
}

.vt-eye-btn {
  background: var(--tint-green);
  width: 24px;
  height: 24px;
  color: var(--green);
  border: 1px solid var(--tint-green);
  cursor: pointer;
  border-radius: 50%;
  flex-shrink: 0;
  justify-content: center;
  align-items: center;
  transition: background .15s, color .15s, border-color .15s;
  display: inline-flex;
}

.vt-eye-btn:hover {
  background: var(--green-fill);
  color: #fff;
  border-color: var(--green-fill);
}

.vt-eye-btn.khong-anh {
  background: var(--tint-red);
  color: var(--red);
  border-color: var(--tint-red);
  cursor: not-allowed;
  opacity: .85;
}

.vt-eye-btn.khong-anh:hover {
  background: var(--tint-red);
  color: var(--red);
  border-color: var(--tint-red);
}

.vt-eye-btn svg {
  display: block;
}

.status-cell {
  cursor: default;
}

.status-cell.clickable {
  cursor: pointer;
}

.color-dot {
  border: 1.5px solid var(--border-strong);
  vertical-align: middle;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  display: inline-block;
}

.color-pick-wrap {
  align-items: center;
  gap: 8px;
  display: inline-flex;
  position: relative;
}

.color-pick-wrap input[type="color"] {
  opacity: 0;
  cursor: pointer;
  border: none;
  width: 16px;
  height: 16px;
  padding: 0;
  position: absolute;
  inset: 0;
}

.color-pick-wrap.readonly input[type="color"] {
  cursor: default;
  pointer-events: none;
}

.process-note {
  font-size: var(--fs-xs);
  color: var(--accent);
  background: var(--tint-primary-soft);
  border: 1px solid var(--tint-primary-border);
  border-radius: 5px;
  padding: 2px 8px;
  display: inline-block;
}

.mini-toolbar {
  justify-content: flex-end;
  margin-bottom: 8px;
  display: flex;
}

.diff-row {
  border-bottom: 1px dashed var(--border-soft);
  font-size: var(--fs-sm);
  grid-template-columns: 140px 1fr 1fr;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  display: grid;
}

.diff-row:last-child {
  border-bottom: none;
}

.diff-label {
  color: var(--text-tertiary);
}

.diff-old {
  color: var(--text-tertiary);
  text-decoration: line-through;
}

.diff-new {
  color: var(--green);
  font-weight: var(--fw-semibold);
}

.diff-headers {
  font-size: var(--fs-2xs);
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-tertiary);
  border-bottom: 1px solid var(--border-soft);
  grid-template-columns: 140px 1fr 1fr;
  gap: 10px;
  margin-bottom: 4px;
  padding-bottom: 6px;
  display: grid;
}

.approver-note textarea {
  background: var(--surface-2);
  border: 1px solid var(--border);
  width: 100%;
  min-height: 64px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: var(--fs-sm);
  resize: vertical;
  border-radius: 6px;
  margin-top: 8px;
  padding: 8px 10px;
}

.field-label {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--text-secondary);
  margin-top: 16px;
  display: block;
}

.lightbox-body {
  background: var(--bg);
  justify-content: center;
  align-items: center;
  padding: 20px;
  display: flex;
}

.anh-lightbox-card {
  width: auto;
  max-width: 96vw;
}

.anh-lightbox-body {
  background: #111827;
  border-radius: 10px;
  justify-content: center;
  align-items: center;
  margin: 0 14px;
  padding: 10px;
  display: flex;
}

.anh-lightbox-body img {
  object-fit: contain;
  border-radius: 6px;
  max-width: 92vw;
  max-height: 88vh;
}

.anh-lightbox-loi {
  color: #e5e7eb;
  font-size: var(--fs-sm);
  padding: 40px 20px;
}

@media (max-width: 860px) {
  .anh-lightbox-body {
    margin: 0 8px;
  }

  .anh-lightbox-body img {
    max-width: calc(100vw - 32px);
    max-height: 70vh;
  }
}

.lightbox-placeholder {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  width: 100%;
  min-height: 220px;
  max-height: 65vh;
  font-size: var(--fs-md);
  font-weight: var(--fw-bold);
  text-align: center;
  border-radius: 12px;
  justify-content: center;
  align-items: center;
  padding: 10px;
  display: flex;
  overflow: hidden;
}

.lightbox-placeholder img {
  object-fit: contain;
  border-radius: 6px;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 65vh;
}

.bando-layout {
  grid-template-columns: 1fr 300px;
  align-items: start;
  gap: 16px;
  display: grid;
}

@media (max-width: 900px) {
  .bando-layout {
    grid-template-columns: 1fr;
  }
}

.map-toolbar {
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  display: flex;
}

.map-toolbar .spacer {
  flex: 1;
}

.map-legend {
  font-size: var(--fs-xs);
  color: var(--text-secondary);
  align-items: center;
  gap: 14px;
  display: flex;
}

.map-legend .lg-item {
  align-items: center;
  gap: 5px;
  display: flex;
}

.map-legend .lg-dot {
  border-radius: 3px;
  width: 8px;
  height: 8px;
}

.mapcanvas-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  cursor: grab;
  width: 100%;
  height: 72vh;
  min-height: 300px;
  max-height: 72vh;
  position: relative;
  overflow: hidden;
}

.mapcanvas-wrap:active {
  cursor: grabbing;
}

.mapcanvas-wrap.chi-xem {
  touch-action: none;
  cursor: default;
}

@media (max-width: 860px) {
  .mapcanvas-wrap {
    height: 76vh;
    min-height: 300px;
    max-height: 76vh;
  }
}

.mapcanvas-stage {
  transform-origin: 0 0;
  background-color: var(--surface);
  background-image: linear-gradient(#7f7f7f24 1px, #0000 1px), linear-gradient(90deg, #7f7f7f24 1px, #0000 1px);
  background-size: 20px 20px;
  position: absolute;
  top: 0;
  left: 0;
  box-shadow: 0 2px 16px #00000040;
}

.mapcanvas-wrap.drawing {
  box-shadow: 0 0 0 2px var(--tint-primary-border) inset;
}

.mapcanvas-empty {
  pointer-events: none;
  text-align: center;
  color: var(--text-secondary);
  font-size: var(--fs-sm);
  justify-content: center;
  align-items: center;
  padding: 16px;
  display: flex;
  position: absolute;
  inset: 0;
}

.map-zoom-ctl {
  z-index: 3;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  align-items: center;
  gap: 2px;
  padding: 3px;
  display: flex;
  position: absolute;
  bottom: 10px;
  right: 10px;
  box-shadow: 0 2px 10px #00000038;
}

.map-zoom-ctl .mz-btn, .map-zoom-ctl .mz-pct {
  min-width: 32px;
  height: 32px;
  color: var(--text-secondary);
  cursor: pointer;
  background: none;
  border: none;
  border-radius: 999px;
  justify-content: center;
  align-items: center;
  padding: 0 6px;
  display: inline-flex;
}

.map-zoom-ctl .mz-pct {
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  font-variant-numeric: tabular-nums;
  min-width: 46px;
}

.map-zoom-ctl .mz-btn:hover, .map-zoom-ctl .mz-pct:hover {
  background: var(--tint-primary-soft);
  color: var(--accent);
}

@media (max-width: 860px) {
  .map-zoom-ctl {
    top: 10px;
    bottom: auto;
  }
}

.bando-canvas-col {
  min-width: 0;
}

.map-huong-dan {
  font-size: var(--fs-2xs);
  color: var(--text-tertiary);
  margin: 6px 2px 0;
  line-height: 1.35;
}

.map-side-act {
  padding: 8px 10px 0;
}

.map-side-act .btn {
  justify-content: center;
  width: 100%;
}

.map-chuyen {
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  z-index: 2;
  text-align: center;
  box-sizing: border-box;
  border: 2px solid #ffffffd9;
  border-radius: 7px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 1px;
  padding: 2px 4px;
  transition: box-shadow .15s, transform .15s;
  display: flex;
  position: absolute;
  box-shadow: 0 2px 8px #00000059;
}

.mapcanvas-wrap.drawing .map-chuyen {
  cursor: move;
}

.mapcanvas-wrap.drawing .map-chuyen:active {
  cursor: grabbing;
  z-index: 6;
}

.map-chuyen.running {
  background: linear-gradient(150deg, #34d17a, var(--green));
}

.map-chuyen.stopped {
  background: linear-gradient(150deg, #7c8697, #6b7280);
}

.map-chuyen.highlighted {
  box-shadow: 0 0 0 3px var(--tint-primary-border), 0 2px 10px #0006;
  z-index: 7;
  transform: translate(-50%, -50%)scale(1.05);
}

.map-chuyen .chuyen-name {
  font-size: var(--fs-2xs);
  font-weight: var(--fw-bold);
  color: #fff;
  text-shadow: 0 1px 2px #00000080;
  line-height: 1.15;
}

.map-chuyen .chuyen-status {
  font-size: var(--fs-2xs);
  color: #ffffffd9;
  align-items: center;
  gap: 3px;
  display: inline-flex;
}

.map-chuyen .chuyen-gio {
  font-size: var(--fs-2xs);
  font-weight: var(--fw-bold);
  color: #fff;
  background: #00000042;
  border-radius: 4px;
  padding: 0 4px;
  line-height: 1.1;
}

.map-chuyen.co-ca {
  border-color: var(--amber, #f59e0b);
}

.map-chuyen.ca-qua-han {
  border-color: var(--danger, #ef4444);
  box-shadow: 0 0 0 2px #ef444459, 0 2px 8px #00000059;
}

.map-chuyen .chuyen-ca {
  font-size: var(--fs-2xs);
  font-weight: var(--fw-semibold);
  color: #fff;
  white-space: nowrap;
  text-overflow: ellipsis;
  background: #00000057;
  border-radius: 4px;
  max-width: 100%;
  padding: 0 4px;
  line-height: 1.1;
  overflow: hidden;
}

.map-chuyen .chuyen-ca.qua-han {
  background: #ef4444d9;
}

.map-chuyen .chuyen-kh-count {
  background: var(--surface);
  min-width: 18px;
  height: 18px;
  color: var(--text-primary);
  font-size: var(--fs-2xs);
  font-weight: var(--fw-bold);
  text-align: center;
  border: 2px solid #ffffffe6;
  border-radius: 9px;
  padding: 0 4px;
  line-height: 14px;
  position: absolute;
  top: -8px;
  left: -8px;
  box-shadow: 0 1px 4px #00000059;
}

.map-chuyen .chuyen-resize {
  background: var(--surface);
  cursor: nwse-resize;
  border: 2px solid #ffffffe6;
  border-radius: 4px;
  width: 16px;
  height: 16px;
  position: absolute;
  bottom: -6px;
  right: -6px;
  box-shadow: 0 1px 4px #00000059;
}

.map-chuyen .chuyen-resize:after {
  content: "";
  border-right: 2px solid var(--text-tertiary);
  border-bottom: 2px solid var(--text-tertiary);
  position: absolute;
  inset: 3px;
}

.map-chuyen .chuyen-del {
  background: var(--red-fill);
  color: #fff;
  width: 18px;
  height: 18px;
  font-size: var(--fs-2xs);
  text-align: center;
  cursor: pointer;
  border: 2px solid var(--bg);
  border-radius: 50%;
  line-height: 18px;
  position: absolute;
  top: -8px;
  right: -8px;
}

.map-side-panel {
  flex-direction: column;
  gap: 14px;
  display: flex;
}

.map-side-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  overflow: hidden;
}

.map-side-head {
  border-bottom: 1px solid var(--border-soft);
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  justify-content: space-between;
  align-items: center;
  padding: 11px 14px;
  display: flex;
}

.map-side-head .cnt {
  font-weight: var(--fw-normal);
  color: var(--text-tertiary);
}

.map-side-search {
  border-bottom: 1px solid var(--border-soft);
  padding: 8px 10px;
}

.map-side-search input {
  background: var(--surface-2);
  border: 1px solid var(--border);
  width: 100%;
  color: var(--text-primary);
  font-size: var(--fs-xs);
  border-radius: 6px;
  padding: 6px 8px;
}

.map-side-list {
  max-height: 260px;
  overflow-y: auto;
}

.map-side-row {
  border-bottom: 1px solid var(--border-soft);
  cursor: pointer;
  font-size: var(--fs-sm);
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  display: flex;
}

.map-side-row:last-child {
  border-bottom: none;
}

.map-side-row:hover {
  background: var(--surface-2);
}

.map-side-row.active {
  background: var(--tint-primary-soft);
}

.map-side-row .sr-name {
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
}

.map-side-row .sr-sub {
  font-size: var(--fs-2xs);
  color: var(--text-tertiary);
}

.map-popover-backdrop {
  z-index: 100;
  background: var(--overlay);
  position: fixed;
  inset: 0;
}

.modal-overlay.vt-lightbox-overlay {
  z-index: 150;
}

.map-popover {
  z-index: 101;
  background: var(--surface-2);
  border: 1px solid var(--border);
  width: 480px;
  max-width: 92vw;
  max-height: 86vh;
  box-shadow: var(--shadow-modal);
  font-size: var(--fs-base);
  border-radius: 10px;
  padding: 16px;
  position: fixed;
  top: 50%;
  left: 50%;
  overflow-y: auto;
  transform: translate(-50%, -50%);
}

.map-popover .pop-head {
  justify-content: space-between;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 10px;
  display: flex;
}

.map-popover .pop-name {
  font-weight: var(--fw-bold);
  font-size: var(--fs-lg);
  margin-bottom: 2px;
}

.map-popover .pop-status {
  font-size: var(--fs-sm);
  color: var(--text-tertiary);
}

.map-popover .pop-kehoach-title {
  border-top: 1px solid var(--border-soft);
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: .03em;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 4px;
  margin-top: 14px;
  padding-top: 12px;
  display: flex;
}

.map-popover .pop-kehoach-title .hint {
  text-transform: none;
  font-weight: var(--fw-normal);
  font-size: var(--fs-2xs);
  letter-spacing: 0;
}

.map-popover .pop-log-title {
  border-top: 1px solid var(--border-soft);
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: .03em;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  padding-top: 12px;
  display: flex;
}

.map-popover .pop-log-list {
  flex-direction: column;
  gap: 9px;
  max-height: 170px;
  margin-top: 8px;
  display: flex;
  overflow-y: auto;
}

.map-popover .pop-log-row {
  align-items: flex-start;
  gap: 8px;
  display: flex;
}

.map-popover .pop-log-icon {
  font-size: var(--fs-sm);
  opacity: .8;
  flex-shrink: 0;
}

.map-popover .pop-log-main {
  font-size: var(--fs-sm);
  color: var(--text-primary);
}

.map-popover .pop-log-meta {
  font-size: var(--fs-xs);
  color: var(--text-tertiary);
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 3px;
  display: flex;
}

.map-popover .pop-log-tb {
  font-size: var(--fs-xs);
  color: var(--amber);
  margin-top: 3px;
}

.map-popover .pop-log-empty {
  font-size: var(--fs-sm);
  color: var(--text-tertiary);
  font-style: italic;
}

.map-popover .pop-kh-deck {
  flex-direction: column;
  gap: 7px;
  margin-top: 8px;
  display: flex;
}

.map-popover .pop-kh-card {
  border: 1px solid var(--border-soft);
  background: var(--surface);
  cursor: default;
  border-radius: 9px;
  padding: 9px 11px;
  transition: opacity .15s, border-color .15s;
}

.map-popover .pop-kh-card.dim {
  opacity: .65;
}

.map-popover .pop-kh-card.active {
  opacity: 1;
  border-color: var(--green-fill);
  background: var(--green-fill);
}

.map-popover .pop-kh-card.ready {
  opacity: 1;
  border-color: var(--kh-vang);
  background: var(--kh-vang);
}

.map-popover .pop-kh-card.blocked {
  opacity: 1;
  border-color: var(--red-fill);
  background: var(--red-fill);
}

.map-popover .pop-kh-card.active, .map-popover .pop-kh-card.ready, .map-popover .pop-kh-card.blocked, .map-popover .pop-kh-card.active :is(.pop-kh-sp, .pop-kh-sl, .pop-kh-sub, .pop-kh-lenh, .pop-kh-lenh span), .map-popover .pop-kh-card.ready :is(.pop-kh-sp, .pop-kh-sl, .pop-kh-sub, .pop-kh-lenh, .pop-kh-lenh span), .map-popover .pop-kh-card.blocked :is(.pop-kh-sp, .pop-kh-sl, .pop-kh-sub, .pop-kh-lenh, .pop-kh-lenh span) {
  color: #fff;
}

.map-popover .pop-kh-card.active :is(.badge, .pop-kh-nvl, .pop-kh-chenlen-btn), .map-popover .pop-kh-card.ready :is(.badge, .pop-kh-nvl, .pop-kh-chenlen-btn), .map-popover .pop-kh-card.blocked :is(.badge, .pop-kh-nvl, .pop-kh-chenlen-btn) {
  color: #fff;
  background: #ffffff38;
  border-color: #ffffff73;
}

.map-popover .pop-kh-card.active .badge .dot, .map-popover .pop-kh-card.ready .badge .dot, .map-popover .pop-kh-card.blocked .badge .dot {
  background: #fff;
}

.map-popover .pop-kh-card.ready, .map-popover .pop-kh-card.ready :is(.pop-kh-sp, .pop-kh-sl, .pop-kh-sub, .pop-kh-lenh, .pop-kh-lenh span) {
  color: var(--kh-vang-on);
}

.map-popover .pop-kh-card.ready :is(.badge, .pop-kh-nvl, .pop-kh-chenlen-btn) {
  color: var(--kh-vang-on);
  border-color: #00000047;
}

.map-popover .pop-kh-card.ready .badge .dot {
  background: var(--kh-vang-on);
}

.map-popover .pop-kh-card.active :is(.pop-kh-ibtn, .pop-kh-ibtn-wide), .map-popover .pop-kh-card.ready :is(.pop-kh-ibtn, .pop-kh-ibtn-wide), .map-popover .pop-kh-card.blocked :is(.pop-kh-ibtn, .pop-kh-ibtn-wide) {
  background: #fff;
  border-color: #ffffffd9;
}

.map-popover .pop-kh-card.active .vt-eye-btn, .map-popover .pop-kh-card.ready .vt-eye-btn, .map-popover .pop-kh-card.blocked .vt-eye-btn {
  color: var(--kh-vang-fg);
  background: #fff;
  border-color: #fff;
}

.map-popover .pop-kh-card.active .vt-eye-btn:hover, .map-popover .pop-kh-card.ready .vt-eye-btn:hover, .map-popover .pop-kh-card.blocked .vt-eye-btn:hover {
  background: var(--kh-vang);
  color: var(--kh-vang-on);
  border-color: var(--kh-vang);
}

.map-popover .pop-kh-card.active :is(.pop-kh-ibtn, .pop-kh-ibtn-wide):disabled, .map-popover .pop-kh-card.ready :is(.pop-kh-ibtn, .pop-kh-ibtn-wide):disabled, .map-popover .pop-kh-card.blocked :is(.pop-kh-ibtn, .pop-kh-ibtn-wide):disabled {
  opacity: .6;
  background: #ffffff8c;
}

.map-popover .pop-kh-card.done {
  opacity: .9;
}

.map-popover .pop-kh-card.collapsed {
  cursor: pointer;
  padding: 8px 11px;
}

.map-popover .pop-kh-card.collapsed:hover {
  border-color: var(--border);
}

.map-popover .pop-kh-collapsed-row {
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  display: flex;
}

.map-popover .pop-kh-collapsed-row .cname {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--text-secondary);
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

.map-popover .pop-kh-collapsed-row .ctime {
  font-size: var(--fs-2xs);
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.map-popover .pop-kh-lenh {
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: var(--fw-bold);
  letter-spacing: .02em;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
  display: flex;
}

.map-popover .pop-kh-lenh.xuat-ok {
  color: var(--green);
}

.map-popover .pop-kh-lenh.xuat-bad {
  color: var(--red);
}

.map-popover .pop-kh-chenlen-btn {
  font-family: var(--font-sans, inherit);
  font-size: var(--fs-2xs);
  font-weight: var(--fw-semibold);
  letter-spacing: normal;
  background: var(--tint-primary-soft);
  color: var(--accent);
  border: 1px solid var(--tint-primary-border);
  cursor: pointer;
  border-radius: 20px;
  flex-shrink: 0;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  transition: background .15s, border-color .15s;
  display: inline-flex;
}

.map-popover .pop-kh-chenlen-btn:hover {
  border-color: var(--primary);
}

.map-popover .pop-kh-chenlen-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.map-popover .pop-kh-chenlen-btn.active {
  background: var(--primary);
  color: var(--primary-on);
  border-color: var(--primary);
}

.map-popover .pop-kh-top {
  align-items: baseline;
  gap: 8px;
  display: flex;
}

.map-popover .pop-kh-sp {
  min-width: 0;
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  color: var(--text-primary);
  line-height: var(--lh-title);
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  flex: 1;
  display: -webkit-box;
  overflow: hidden;
}

.map-popover .pop-kh-sl {
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  color: var(--text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
}

.map-popover .pop-kh-meta {
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  display: flex;
}

.map-popover .pop-kh-card .badge {
  font-size: var(--fs-2xs);
  flex-shrink: 0;
  padding: 1px 7px;
}

.map-popover .pop-kh-sub {
  min-width: 0;
  font-size: var(--fs-2xs);
  color: var(--text-tertiary);
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  overflow: hidden;
}

.map-popover .pop-kh-sub.doi-to {
  cursor: pointer;
  text-underline-offset: 2px;
  -webkit-text-decoration: underline dotted;
  text-decoration: underline dotted;
}

.map-popover .pop-kh-nvl {
  font-size: var(--fs-2xs);
  cursor: pointer;
  border-radius: 6px;
  margin-top: 6px;
  padding: 4px 8px;
}

.map-popover .pop-kh-nvl.ok {
  background: var(--tint-green);
  color: var(--green);
}

.map-popover .pop-kh-nvl.warn {
  background: var(--tint-amber);
  color: var(--amber);
}

.map-popover .pop-kh-nvl.bad {
  background: var(--tint-red);
  color: var(--red);
}

.map-popover .pop-kh-btnrow {
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 8px;
  display: grid;
}

.map-popover .pop-kh-ibtn {
  min-height: 52px;
  font-size: var(--fs-md);
  text-align: center;
  border: 1px solid var(--border);
  background: var(--surface-2);
  cursor: pointer;
  border-radius: 8px;
  justify-content: center;
  align-items: center;
  padding: 12px 0;
  line-height: 1;
  display: flex;
}

.map-popover .pop-kh-ibtn:disabled {
  opacity: .35;
  cursor: not-allowed;
}

.map-popover .pop-kh-ibtn.i-stop {
  background: var(--tint-gray);
  color: var(--text-secondary);
  border-color: var(--border);
}

.map-popover .pop-kh-ibtn.i-run {
  background: var(--tint-green);
  color: var(--green);
  border-color: #22c55e4d;
}

.map-popover .pop-kh-ibtn.i-end {
  background: var(--tint-primary);
  color: var(--accent);
  border-color: var(--tint-primary-border);
}

.map-popover .pop-kh-ibtn.i-team {
  background: var(--tint-orange);
  color: var(--orange);
  border-color: var(--tint-orange-border);
}

.map-popover .pop-kh-ibtn-wide {
  width: 100%;
  min-height: 52px;
  font-size: var(--fs-base);
  font-weight: var(--fw-bold);
  cursor: pointer;
  background: var(--tint-red);
  color: var(--red);
  border: 1px solid var(--tint-red-border);
  border-radius: 8px;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 12px 0;
  display: flex;
}

.map-popover .pop-kh-ibtn-wide:disabled {
  opacity: .35;
  cursor: not-allowed;
}

.map-popover-backdrop .modal-overlay {
  z-index: 150;
}

.kpi-grid {
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
  display: grid;
}

@media (max-width: 900px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 14px 16px;
}

.kpi-card .kpi-label {
  font-size: var(--fs-2xs);
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-tertiary);
  font-weight: var(--fw-semibold);
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  display: flex;
}

.kpi-card .kpi-value {
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  font-variant-numeric: tabular-nums;
}

.kpi-card .kpi-value.red {
  color: var(--red);
}

.kpi-card .kpi-value.amber {
  color: var(--amber);
}

.kpi-card .kpi-sub {
  font-size: var(--fs-xs);
  color: var(--text-tertiary);
  margin-top: 4px;
}

.rl-wrap {
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 18px;
  display: grid;
}

@media (max-width: 900px) {
  .rl-wrap {
    grid-template-columns: 1fr;
  }
}

.rl-col {
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  max-height: 420px;
  padding: 12px;
  overflow-y: auto;
}

.rl-col .rl-head {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  display: flex;
}

.rl-col .rl-head .cnt {
  color: var(--text-tertiary);
  font-size: var(--fs-2xs);
  background: #ffffff14;
  border-radius: 9px;
  padding: 1px 7px;
}

.rl-row {
  border-bottom: 1px solid var(--border-soft);
  border-radius: 6px;
  flex-direction: column;
  gap: 3px;
  padding: 8px 6px;
  display: flex;
}

.rl-row:last-child {
  border-bottom: none;
}

.rl-row.clickable {
  cursor: pointer;
}

.rl-row.clickable:hover {
  background: var(--surface);
}

.rl-row .rl-note {
  font-size: var(--fs-2xs);
}

.rl-row .rl-note.tinh {
  color: var(--green);
}

.rl-row .rl-note.chua {
  color: var(--text-tertiary);
}

.rl-row .rl-main {
  font-size: var(--fs-sm);
  color: var(--text-primary);
}

.rl-row .rl-sub {
  font-size: var(--fs-2xs);
  color: var(--text-tertiary);
  flex-wrap: wrap;
  gap: 10px;
  display: flex;
}

.rl-group-body {
  padding-left: 10px;
}

.tt-pick-table {
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  max-height: 260px;
  overflow-y: auto;
}

.tt-pick-table table {
  border-collapse: collapse;
  width: 100%;
}

.tt-pick-table th, .tt-pick-table td {
  font-size: var(--fs-xs);
  border-bottom: 1px solid var(--border-soft);
  text-align: left;
  padding: 7px 10px;
}

.tt-pick-table th {
  background: var(--surface-2);
  color: var(--text-tertiary);
  font-weight: var(--fw-semibold);
  position: sticky;
  top: 0;
}

.tt-summary-grid {
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 14px;
  display: grid;
}

@media (max-width: 900px) {
  .tt-summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.tt-summary-tile {
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 10px 12px;
}

.tt-summary-tile .lbl {
  font-size: var(--fs-2xs);
  color: var(--text-tertiary);
}

.tt-summary-tile .val {
  font-size: var(--fs-md);
  font-weight: var(--fw-bold);
  font-family: var(--font-mono);
  margin-top: 3px;
}

.huong-dan-steps {
  font-size: var(--fs-base);
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding-left: 20px;
  line-height: 1.55;
  display: flex;
}

.huong-dan-steps li {
  padding-left: 2px;
}

.huong-dan-steps code {
  background: var(--tint-primary-soft);
  border: 1px solid var(--tint-primary-border);
  font-size: var(--fs-sm);
  border-radius: 4px;
  padding: 1px 5px;
}

.link-btn {
  font: inherit;
  color: var(--accent);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  text-decoration: underline;
}

.link-btn:hover {
  opacity: .8;
}

@media print {
  .no-print, .nut-hoi-ai, .khung-hoi-ai {
    display: none !important;
  }

  html, body {
    height: auto !important;
    overflow: visible !important;
  }

  .app-shell {
    min-height: 0 !important;
    display: block !important;
  }

  [data-region="main"] {
    height: auto !important;
    max-height: none !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  .screen {
    padding: 0 !important;
  }

  .table-card {
    overflow: visible !important;
  }

  .table-scroll {
    max-height: none !important;
    overflow: visible !important;
  }

  .print-sheet {
    box-shadow: none !important;
    border: none !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  [data-region="sidebar"], [data-region="header"], .mobile-global-nav, .mobile-global-nav-qr {
    display: none !important;
  }

  .cell-main, .cell-sub, .cell-clamp2 {
    -webkit-line-clamp: unset !important;
    white-space: normal !important;
    display: block !important;
    overflow: visible !important;
  }

  td.cell-main, td.cell-sub, td.cell-clamp2 {
    white-space: normal !important;
    text-overflow: clip !important;
    display: table-cell !important;
    overflow: visible !important;
  }
}

@page {
  size: A4;
  margin: 1cm 1cm 1cm 1.5cm;
}

.print-sheet {
  --surface: #fff;
  --surface-2: #f2f2f7;
  --text-primary: #1d1d1f;
  --text-secondary: #636366;
  --text-tertiary: #6e6e73;
  --border: #3c3c432e;
  --border-soft: #3c3c431a;
  --border-strong: #3c3c435c;
  color: var(--text-primary);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: #fff;
  max-width: 780px;
  margin: 0 auto;
  padding: 32px;
}

.print-sheet h2 {
  text-align: center;
  margin-bottom: 4px;
}

.print-sheet .print-sub {
  text-align: center;
  color: var(--text-tertiary);
  margin-bottom: 20px;
}

.print-sheet .print-filterline {
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  font-size: var(--fs-xs);
  color: var(--text-secondary);
  border-radius: 4px;
  margin: 10px 0 2px;
  padding: 6px 9px;
}

.print-sheet tr.print-grp > td {
  background: var(--surface-2);
  line-height: var(--lh-comfortable);
  border-top: 2px solid var(--border);
  border-bottom: 1px solid var(--border-soft);
  padding: 7px 5px;
}

.print-sheet .print-grp-no {
  background: var(--text-primary);
  color: #fff;
  font-weight: var(--fw-bold);
  font-size: var(--fs-xs);
  border-radius: 4px;
  margin-right: 6px;
  padding: 1px 7px;
  display: inline-block;
}

.print-sheet .print-grp-ml {
  font-size: var(--fs-base);
  font-weight: var(--fw-bold);
}

.print-sheet .print-grp-meta {
  font-weight: var(--fw-normal);
  color: var(--text-secondary);
  font-size: var(--fs-xs);
}

.print-sheet .print-tick {
  border: 1.3px solid var(--text-secondary);
  border-radius: 2px;
  width: 12px;
  height: 12px;
  display: inline-block;
}

.print-sheet .print-sign {
  text-align: center;
  font-size: var(--fs-sm);
  justify-content: space-between;
  margin-top: 28px;
  display: flex;
}

.print-sheet .print-sign > div {
  width: 31%;
}

.print-sheet .print-sign small {
  color: var(--text-tertiary);
  font-size: var(--fs-xs);
  margin-top: 2px;
  display: block;
}

.print-sheet .print-sign-line {
  height: 48px;
}

.print-sheet.print-landscape {
  max-width: 1240px;
}

@media screen {
  .print-sheet.print-landscape {
    overflow-x: auto;
  }
}

.print-bl-table {
  border-collapse: collapse;
  width: 100%;
  font-size: var(--fs-2xs);
  margin-top: 12px;
}

.print-bl-table th {
  text-align: left;
  border-bottom: 2px solid var(--border-strong);
  font-weight: var(--fw-bold);
  vertical-align: bottom;
  padding: 5px 4px;
}

.print-bl-table td {
  border-bottom: 1px solid var(--border-soft);
  padding: 4px;
}

.print-bl-table th.num-cell, .print-bl-table td.num-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.print-bl-table tfoot td {
  border-top: 2px solid var(--border-strong);
  font-weight: var(--fw-bold);
  background: var(--surface-2);
  border-bottom: none;
  padding-top: 6px;
}

@media print {
  .print-bl-table thead {
    display: table-header-group;
  }

  .print-bl-table tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}

.print-sheet .ps-head {
  flex-wrap: wrap;
  gap: 4px 26px;
  display: flex;
}

.print-sheet .ps-head > div {
  min-width: 46%;
}

.ps-table {
  border-collapse: collapse;
  width: 100%;
  font-size: var(--fs-xs);
  margin-top: 12px;
}

.ps-table td {
  border-bottom: 1px dotted var(--border);
  padding: 4px;
}

.ps-table td.lbl {
  color: var(--text-secondary);
}

.ps-table td.num-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ps-table tr.ps-grp > td {
  background: var(--surface-2);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  font-size: var(--fs-2xs);
  letter-spacing: .04em;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 5px 4px;
}

.ps-table tr.ps-sum > td {
  border-top: 1.5px solid var(--border-strong);
  font-weight: var(--fw-bold);
  border-bottom: none;
}

.ps-table tr.ps-final > td {
  background: var(--text-primary);
  color: #fff;
  font-weight: var(--fw-bold);
  font-size: var(--fs-sm);
  border: none;
  padding: 7px 4px;
}

.print-sheet .print-ky-o {
  border-bottom: 1px dotted var(--border-strong);
  height: 34px;
}

.print-sheet.print-to-page {
  margin-top: 24px;
}

@media print {
  .print-sheet.print-to-page {
    break-before: page;
    page-break-before: always;
    margin-top: 0;
  }

  .print-sheet tr.print-grp {
    break-after: avoid;
    page-break-after: avoid;
  }

  .print-sheet tr, .print-sheet .print-sign {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}

.print-sheet .print-row {
  border-bottom: 1px dashed var(--border-soft);
  font-size: var(--fs-sm);
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  display: flex;
}

.print-sheet .print-row .k {
  color: var(--text-tertiary);
}

.print-sheet .print-row .v {
  font-weight: var(--fw-semibold);
}

.print-qr {
  justify-content: center;
  margin: 20px 0;
  display: flex;
}

.print-qr img {
  width: 120px;
  height: 120px;
}

.anh-upload-actions {
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  display: flex;
}

.anh-upload-actions .btn {
  align-items: center;
  gap: 6px;
  display: inline-flex;
}

.anh-upload-preview {
  display: inline-block;
  position: relative;
}

.anh-upload-preview img {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  max-width: 100%;
  max-height: 220px;
  display: block;
}

.anh-upload-preview .icon-btn {
  background: var(--surface);
  border-color: var(--border);
  position: absolute;
  top: 6px;
  right: 6px;
}

.tem-qr-list {
  flex-wrap: wrap;
  gap: 8mm;
  display: flex;
}

.tem-qr {
  box-sizing: border-box;
  text-align: center;
  border: 1px dashed var(--border);
  color: #000;
  background: #fff;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 1.5mm;
  width: 54mm;
  height: 54mm;
  padding: 2mm;
  display: flex;
  overflow: hidden;
}

.tem-qr-img {
  width: 34mm;
  height: 34mm;
  display: block;
}

.tem-qr-ma {
  font-family: var(--font-mono);
  font-size: 3.4mm;
  font-weight: var(--fw-bold);
  letter-spacing: .3mm;
}

.tem-qr-ten {
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-size: 2.8mm;
  line-height: 1.2;
  display: -webkit-box;
  overflow: hidden;
}

.tem-qr-vitri {
  color: #444;
  font-size: 2.4mm;
}

@media print {
  .tem-qr-list {
    gap: 0;
    display: block;
  }

  .tem-qr {
    page-break-after: always;
    break-after: page;
    border: none;
    width: 100%;
    height: auto;
    min-height: 0;
  }

  .tem-qr:last-child {
    page-break-after: auto;
    break-after: auto;
  }
}

.qt-sheet {
  max-width: 900px;
  font-size: var(--fs-xs);
  color: #111;
}

.qt-head {
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
  display: flex;
}

.qt-head-left {
  text-align: center;
  flex: 0 0 150px;
}

.qt-kho {
  font-weight: var(--fw-heavy);
  font-size: var(--fs-md);
  margin-bottom: 6px;
}

.qt-qr {
  width: 96px;
  height: 96px;
}

.qt-head-right {
  flex: 1;
}

.qt-title {
  color: #111;
  font-weight: var(--fw-heavy);
  font-size: var(--fs-xl);
  text-align: center;
  background: #ef8a1f;
  border-radius: 3px;
  padding: 10px;
}

.qt-meta {
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
  display: flex;
}

.qt-meta-k {
  color: #2a6fd4;
  font-weight: var(--fw-semibold);
}

.qt-meta-v {
  font-weight: var(--fw-bold);
}

.qt-subtitle {
  text-align: center;
  font-size: var(--fs-2xs);
  color: #666;
  margin-top: 2px;
}

.qt-print-actions {
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  display: flex;
}

.qt-print-actions-label {
  font-weight: var(--fw-semibold);
  color: var(--text-secondary);
  margin-right: 2px;
}

.qt-table-scroll {
  overflow-x: auto;
}

@media print {
  .qt-table-scroll {
    overflow-x: visible;
  }
}

.qt-band {
  color: #111;
  font-weight: var(--fw-bold);
  background: #ef8a1f;
  border-radius: 2px;
  padding: 4px 10px;
}

.qt-info {
  border: 1px solid #ddd;
  border-top: none;
  padding: 8px 10px;
}

.qt-info-row {
  padding: 2px 0;
}

.qt-info-k {
  color: #666;
}

.qt-table {
  border-collapse: collapse;
  width: 100%;
  margin-top: 14px;
}

.qt-table th {
  color: #111;
  font-size: var(--fs-2xs);
  text-align: center;
  background: #ef8a1f;
  border: 1px solid #d9d9d9;
  padding: 6px 4px;
}

.qt-table td {
  vertical-align: middle;
  border: 1px solid #d9d9d9;
  padding: 5px 4px;
}

.qt-table tfoot td {
  background: #faf3ea;
}

.qt-lo {
  font-size: var(--fs-2xs);
  color: #555;
  word-break: break-word;
}

.qt-sign {
  text-align: center;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 22px;
  display: grid;
}

.qt-sign-title {
  font-size: var(--fs-base);
  margin-bottom: 6px;
}

.qt-sign-by {
  font-size: var(--fs-2xs);
  font-weight: var(--fw-bold);
  line-height: 1.35;
}

.qt-sign-img {
  object-fit: contain;
  max-width: 130px;
  max-height: 60px;
}

.qt-sign-empty {
  color: #6e6e73;
  font-size: var(--fs-2xs);
  padding: 12px 0;
}

.qt-foot {
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 24px;
  display: grid;
}

.qt-foot-title {
  font-weight: var(--fw-bold);
  text-align: center;
  margin-bottom: 8px;
}

.qt-log {
  font-size: var(--fs-2xs);
  line-height: var(--lh-comfortable);
}

.qt-hinh {
  object-fit: contain;
  max-width: 100%;
  max-height: 300px;
  margin: 0 auto;
  display: block;
}

.qt-note {
  font-size: var(--fs-2xs);
  color: #a15c00;
  margin-top: 14px;
}

.print-sign-grid {
  text-align: center;
  font-size: var(--fs-sm);
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 40px;
  display: grid;
}

.sla-ok {
  color: var(--green);
  font-weight: var(--fw-semibold);
}

.sla-warn {
  color: var(--amber);
  font-weight: var(--fw-semibold);
}

.ma-lenh-da-xuat-kho {
  color: var(--green);
}

.sla-late {
  color: var(--red);
  font-weight: var(--fw-semibold);
}

.clickable-row {
  cursor: pointer;
}

.clickable-row:hover {
  background: var(--surface-2);
}

.chat-shell {
  height: calc(100vh - 65px);
  min-height: 420px;
  display: flex;
}

.chat-hop-thu {
  background: var(--surface);
  border-right: 1px solid var(--border-soft);
  flex-direction: column;
  flex-shrink: 0;
  gap: 2px;
  width: 208px;
  height: 100%;
  padding: 14px 10px;
  display: flex;
  overflow-y: auto;
}

.chat-hop-thu h2 {
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  padding: 0 8px 10px;
}

.chat-ht-nhom {
  font-size: var(--fs-2xs);
  font-weight: var(--fw-bold);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  padding: 14px 8px 5px;
}

.chat-ht-muc {
  color: var(--text-secondary);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  text-align: left;
  background: none;
  border: 0;
  border-radius: 8px;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 34px;
  padding: 7px 9px;
  display: flex;
}

.chat-ht-muc:hover {
  background: var(--hover-bg);
  color: var(--text-primary);
}

.chat-ht-muc.active {
  background: var(--tint-primary);
  color: var(--primary);
  font-weight: var(--fw-bold);
}

.chat-ht-muc .ic {
  text-align: center;
  opacity: .8;
  flex-shrink: 0;
  justify-content: center;
  align-items: center;
  width: 16px;
  display: inline-flex;
}

.chat-ht-muc .ic svg {
  fill: var(--text-tertiary);
}

.chat-ht-muc.active .ic svg {
  fill: var(--primary);
}

.chat-ht-muc .ten {
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.chat-ht-muc .dem {
  font-size: var(--fs-2xs);
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.chat-ht-muc .dem.nhan-manh {
  color: var(--primary);
  font-weight: var(--fw-bold);
}

.chat-ht-muc.active .dem {
  color: var(--primary);
}

@media (max-width: 1180px) {
  .chat-hop-thu {
    display: none;
  }
}

.chat-kenh-dau {
  border-bottom: 1px solid var(--border-soft);
  flex-direction: column;
  gap: 8px;
  padding: 12px 10px 8px;
  display: flex;
}

.chat-kenh-loc-dang-bat {
  font-size: var(--fs-2xs);
  color: var(--primary);
  background: var(--tint-primary);
  border: 1px solid var(--tint-primary-border);
  text-align: left;
  border-radius: 999px;
  padding: 4px 10px;
}

.chat-kenh-loc-dang-bat:hover {
  background: var(--tint-primary-border);
}

.chat-kenh-ava {
  width: 34px;
  height: 34px;
  font-size: var(--fs-input);
  background: var(--tint-primary);
  border-radius: 50%;
  flex-shrink: 0;
  justify-content: center;
  align-items: center;
  margin-top: 1px;
  display: flex;
}

.chat-kenh-ava svg {
  fill: var(--primary);
}

.chat-kenh-ph {
  font-size: var(--fs-2xs);
  font-weight: var(--fw-semibold);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: .03em;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

.chat-kenh-item.active .chat-kenh-ph {
  color: var(--primary);
}

.chat-kenh-sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border-soft);
  flex-direction: column;
  flex-shrink: 0;
  width: 264px;
  height: 100%;
  display: flex;
}

.chat-kenh-back-all {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-soft);
  flex-shrink: 0;
  padding: 10px 14px;
  text-decoration: none;
  display: block;
}

.chat-kenh-back-all:hover {
  color: var(--accent);
  background: var(--hover-bg);
}

.chat-kenh-scroll {
  flex: 1;
  padding: 10px 8px 16px;
  overflow-y: auto;
}

.chat-kenh-group {
  margin-bottom: 4px;
}

.chat-kenh-group-head {
  font-size: var(--fs-2xs);
  font-weight: var(--fw-bold);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  align-items: center;
  gap: 6px;
  padding: 9px 8px 5px;
  display: flex;
}

.chat-kenh-item {
  text-align: left;
  width: 100%;
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  background: none;
  border: none;
  border-radius: 7px;
  align-items: center;
  gap: 9px;
  margin-bottom: 1px;
  padding: 7px 9px;
  display: flex;
}

.chat-kenh-item .hash {
  color: var(--text-tertiary);
  font-size: var(--fs-sm);
  text-align: center;
  flex-shrink: 0;
  width: 14px;
}

.chat-kenh-item {
  align-items: flex-start;
}

.chat-kenh-item .hash {
  line-height: var(--lh-body);
}

.chat-kenh-item .giua {
  flex-direction: column;
  flex: 1;
  gap: 1px;
  min-width: 0;
  display: flex;
}

.chat-kenh-item .name {
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

.chat-kenh-item .tin-cuoi {
  font-size: var(--fs-2xs);
  color: var(--text-tertiary);
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

.chat-kenh-item .phai {
  flex-shrink: 0;
  align-items: center;
  gap: 6px;
  padding-top: 1px;
  display: flex;
}

.chat-kenh-item .gio {
  font-size: var(--fs-2xs);
  color: var(--text-tertiary);
  white-space: nowrap;
}

.chat-kenh-item.co-tin-moi .name {
  font-weight: var(--fw-bold);
  color: var(--text-primary);
}

.chat-kenh-item.co-tin-moi .tin-cuoi {
  color: var(--text-secondary);
}

.chat-kenh-item:hover {
  background: var(--hover-bg);
  color: var(--text-primary);
}

.chat-kenh-item.active {
  background: var(--tint-primary);
  color: var(--text-primary);
  font-weight: var(--fw-semibold);
}

.chat-kenh-item.active .hash {
  color: var(--accent);
}

.chat-kenh-add {
  width: 100%;
  font-size: var(--fs-sm);
  color: var(--text-tertiary);
  text-align: left;
  background: none;
  border: none;
  border-radius: 7px;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  display: flex;
}

.chat-kenh-add:hover {
  color: var(--text-secondary);
  background: var(--hover-bg);
}

.chat-kenh-add .hash {
  text-align: center;
  width: 14px;
}

.chat-unread {
  font-size: var(--fs-2xs);
  font-weight: var(--fw-bold);
  color: var(--primary-on);
  background: var(--primary);
  border-radius: 9px;
  flex-shrink: 0;
  padding: 1px 6px;
}

.chat-kenh-item .unread {
  font-size: var(--fs-2xs);
  font-weight: var(--fw-bold);
  color: #fff;
  background: var(--red-fill);
  text-align: center;
  border-radius: 9px;
  flex-shrink: 0;
  min-width: 18px;
  padding: 1px 6px;
}

.chat-main-col {
  flex-direction: column;
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  position: relative;
}

.chat-header {
  border-bottom: 1px solid var(--border-soft);
  flex-shrink: 0;
  align-items: center;
  gap: 12px;
  padding: 13px 22px;
  display: flex;
}

.chat-header .hash-big {
  font-size: var(--fs-lg);
  color: var(--text-tertiary);
}

.chat-header h1 {
  font-size: var(--fs-md);
  font-weight: var(--fw-bold);
}

.chat-header .sub {
  font-size: var(--fs-xs);
  color: var(--text-tertiary);
  margin-top: 1px;
}

.chat-header .spacer {
  flex: 1;
}

.chat-search-box {
  min-width: 220px;
}

@media (max-width: 600px) {
  .chat-header {
    flex-wrap: wrap;
  }

  .chat-search-box {
    flex: 100%;
    order: 3;
    min-width: 0;
  }
}

.chat-thread-banner {
  background: var(--tint-primary-soft);
  border-bottom: 1px solid var(--tint-primary-border);
  font-size: var(--fs-xs);
  color: var(--text-secondary);
  flex-shrink: 0;
  align-items: center;
  gap: 8px;
  padding: 8px 22px;
  display: flex;
}

.chat-thread-banner b {
  color: var(--text-primary);
}

.chat-thread-banner a {
  color: var(--accent);
  margin-left: auto;
}

.chat-feed {
  flex-direction: column;
  flex: 1;
  gap: 10px;
  padding: 18px 22px 8px;
  display: flex;
  overflow-y: auto;
}

.chat-day-sep {
  color: var(--text-tertiary);
  font-size: var(--fs-2xs);
  align-items: center;
  gap: 10px;
  margin: 14px 0 10px;
  display: flex;
}

.chat-day-sep:before, .chat-day-sep:after {
  content: "";
  background: var(--border-soft);
  flex: 1;
  height: 1px;
}

.chat-msg {
  border-radius: 8px;
  gap: 10px;
  max-width: min(760px, 82%);
  padding: 3px 2px;
  display: flex;
  position: relative;
}

.chat-msg.cua-minh {
  flex-direction: row-reverse;
  align-self: flex-end;
}

.chat-msg.co-bieu-do {
  width: min(760px, 100%);
  max-width: 100%;
}

.chat-msg:hover .chat-msg-reply-btn {
  display: inline-flex;
}

.chat-bong {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-card);
  border-radius: 14px;
  min-width: 0;
  padding: 9px 13px;
}

.chat-msg.cua-minh .chat-bong {
  background: var(--tint-primary);
  border-color: var(--tint-primary-border);
}

.chat-meta-duoi {
  font-size: var(--fs-2xs);
  color: var(--text-tertiary);
  margin-top: 4px;
  padding: 0 4px;
}

.chat-msg.cua-minh .chat-meta-duoi {
  text-align: right;
}

.chat-msg .chat-avatar {
  width: 34px;
  height: 34px;
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  color: #fff;
  background: var(--primary);
  border-radius: 9px;
  flex-shrink: 0;
  justify-content: center;
  align-items: center;
  margin-top: 2px;
  display: flex;
  overflow: hidden;
}

.chat-msg .chat-avatar img {
  object-fit: cover;
  width: 100%;
  height: 100%;
}

.chat-msg .chat-body {
  flex-direction: column;
  flex: 1;
  min-width: 0;
  display: flex;
}

.chat-msg .chat-row1 {
  align-items: baseline;
  gap: 8px;
  display: flex;
}

.chat-msg .chat-sender {
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
}

.chat-msg .chat-time {
  font-size: var(--fs-2xs);
  color: var(--text-tertiary);
}

.chat-msg .chat-text {
  font-size: var(--fs-base);
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
  margin-top: 2px;
  line-height: 1.55;
}

.chat-mention-tag {
  color: var(--accent);
  background: var(--tint-primary-soft);
  font-weight: var(--fw-semibold);
  border-radius: 5px;
  padding: 0 4px;
}

.chat-msg-reply-btn {
  font-size: var(--fs-2xs);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-tertiary);
  border-radius: 6px;
  padding: 3px 8px;
  display: none;
  position: absolute;
  top: 4px;
  right: 8px;
}

.chat-msg-reply-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.chat-reply-quote {
  background: var(--surface-2);
  border-left: 2px solid var(--primary);
  font-size: var(--fs-xs);
  color: var(--text-tertiary);
  cursor: pointer;
  border-radius: 4px;
  align-items: center;
  gap: 6px;
  max-width: 380px;
  margin-top: 5px;
  padding: 5px 9px;
  display: flex;
}

.chat-reply-quote b {
  color: var(--text-secondary);
}

.chat-reply-quote {
  border: none;
  border-left: 2px solid var(--primary);
  font: inherit;
  text-align: left;
  width: fit-content;
}

.chat-reply-quote:hover {
  background: var(--hover-bg);
}

.chat-msg-nhay {
  animation: 2.5s ease-out chatNhayTin;
}

@keyframes chatNhayTin {
  0% {
    box-shadow: 0 0 0 3px var(--tint-primary-border);
    background: var(--tint-primary);
  }

  30% {
    box-shadow: 0 0 10px 3px var(--tint-primary-soft);
    background: var(--tint-primary-soft);
  }

  100% {
    box-shadow: none;
    background: none;
  }
}

.chat-attach-chip {
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: var(--fs-xs);
  cursor: pointer;
  border-radius: 8px;
  align-items: center;
  gap: 7px;
  max-width: 340px;
  margin-top: 7px;
  padding: 7px 11px;
  display: inline-flex;
}

.chat-attach-chip:hover {
  border-color: var(--primary);
  background: var(--tint-primary-soft);
}

.chat-attach-chip.chet {
  cursor: default;
  opacity: .6;
}

.chat-attach-chip.chet:hover {
  border-color: var(--border);
  background: var(--surface-2);
}

.chat-attach-chip .meta .t1 {
  font-weight: var(--fw-bold);
  color: var(--text-primary);
  font-size: var(--fs-xs);
}

.chat-attach-chip .meta .t2 {
  color: var(--text-tertiary);
  font-size: var(--fs-2xs);
}

.chat-media-img {
  cursor: zoom-in;
  border-radius: 8px;
  max-width: 320px;
  max-height: 260px;
  margin-top: 7px;
  display: block;
}

.chat-media-file {
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: var(--fs-sm);
  border-radius: 8px;
  align-items: center;
  gap: 8px;
  margin-top: 7px;
  padding: 8px 12px;
  display: inline-flex;
}

.chat-media-audio {
  max-width: 320px;
  margin-top: 7px;
}

.chat-task-card {
  border: 1px solid var(--tint-amber);
  background: #f59e0b0f;
  border-radius: 9px;
  max-width: 420px;
  margin-top: 8px;
  padding: 10px 13px;
}

.chat-task-card .head {
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  color: var(--amber);
  text-transform: uppercase;
  letter-spacing: .03em;
  align-items: center;
  gap: 7px;
  display: flex;
}

.chat-task-card .who-when {
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  margin-top: 7px;
  display: flex;
}

.chat-task-card .han {
  font-size: var(--fs-2xs);
  color: var(--text-tertiary);
  margin-top: 7px;
}

.chat-task-card .han.warn {
  color: var(--red);
}

.chat-sla-pill {
  font-size: var(--fs-2xs);
  font-weight: var(--fw-bold);
  white-space: nowrap;
  border-radius: 20px;
  align-items: center;
  gap: 5px;
  padding: 2.5px 9px;
  display: inline-flex;
}

.chat-sla-pill.dang-lam {
  background: var(--tint-primary);
  color: var(--accent);
}

.chat-sla-pill.qua-han {
  background: var(--tint-red);
  color: var(--red);
}

.chat-sla-pill.hoan-thanh {
  background: var(--tint-green);
  color: var(--green);
}

.chat-sla-pill.da-nhan-viec {
  background: var(--tint-amber);
  color: var(--amber);
}

.chat-sla-pill.bao-spam {
  background: var(--tint-red);
  color: var(--red);
}

.chat-sla-pill .dot {
  background: currentColor;
  border-radius: 50%;
  width: 5px;
  height: 5px;
}

.chat-sys-msg {
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  max-width: min(620px, 86%);
  font-size: var(--fs-xs);
  color: var(--text-secondary);
  text-align: center;
  border-radius: 999px;
  align-self: center;
  align-items: center;
  gap: 9px;
  padding: 7px 16px;
  display: flex;
}

.kenh-info-card {
  border: 1px solid var(--border-soft);
  background: var(--surface);
  border-radius: 14px;
  margin-bottom: 14px;
  padding: 13px 14px;
}

.kenh-info-head {
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  align-items: center;
  gap: 6px;
  margin-bottom: 9px;
  display: flex;
}

.kenh-info-head .dem {
  color: var(--text-tertiary);
  font-weight: var(--fw-medium);
}

details.kenh-info-card > summary.kenh-info-head {
  cursor: pointer;
  margin-bottom: 0;
  list-style: none;
}

details.kenh-info-card > summary.kenh-info-head::-webkit-details-marker {
  display: none;
}

details.kenh-info-card > summary.kenh-info-head:after {
  content: "";
  border-right: 2px solid var(--text-tertiary);
  border-bottom: 2px solid var(--text-tertiary);
  width: 7px;
  height: 7px;
  margin-left: auto;
  transition: transform .15s;
  transform: rotate(45deg)translateY(-2px);
}

details.kenh-info-card[open] > summary.kenh-info-head {
  margin-bottom: 9px;
}

details.kenh-info-card[open] > summary.kenh-info-head:after {
  transform: rotate(-135deg)translateY(-2px);
}

.kenh-info-row {
  border-bottom: 1px solid var(--border-soft);
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  display: flex;
}

.kenh-info-row:last-child {
  border-bottom: 0;
}

.kenh-info-row .nhan {
  color: var(--text-secondary);
  font-size: var(--fs-xs);
  flex: 1;
}

.kenh-info-row .gt {
  font-weight: var(--fw-semibold);
  font-size: var(--fs-xs);
}

.kenh-tv {
  align-items: center;
  gap: 9px;
  padding: 6px 0;
  display: flex;
}

.kenh-tv .ava {
  background: var(--primary);
  color: #fff;
  width: 28px;
  height: 28px;
  font-size: var(--fs-2xs);
  font-weight: var(--fw-bold);
  border-radius: 50%;
  flex-shrink: 0;
  justify-content: center;
  align-items: center;
  display: flex;
  overflow: hidden;
}

.kenh-tv .ava img {
  object-fit: cover;
  width: 100%;
  height: 100%;
}

.kenh-tv .ten {
  min-width: 0;
  font-size: var(--fs-xs);
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  overflow: hidden;
}

.kenh-tv .vai {
  font-size: var(--fs-3xs, 10px);
  font-weight: var(--fw-bold);
  background: var(--tint-primary);
  color: var(--primary);
  border-radius: 999px;
  flex-shrink: 0;
  padding: 1px 6px;
}

.kenh-tv .ma {
  font-size: var(--fs-2xs);
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.chat-tai-them {
  font-size: var(--fs-2xs);
  color: var(--text-tertiary);
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  align-self: center;
  margin-bottom: 4px;
  padding: 4px 12px;
}

.chat-tai-them.het {
  opacity: .75;
}

.chat-feed-wrap {
  flex-direction: column;
  flex: 1;
  min-height: 0;
  display: flex;
  position: relative;
}

.chat-feed-wrap > .chat-feed {
  flex: 1;
  min-height: 0;
}

.chat-tin-moi-pill {
  z-index: 20;
  background: var(--primary);
  color: var(--primary-on);
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  min-height: 34px;
  box-shadow: var(--shadow-pop);
  border: 0;
  border-radius: 999px;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  display: flex;
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
}

.chat-tin-moi-pill:hover {
  background: var(--primary-hover);
}

.chat-composer-wrap {
  flex-shrink: 0;
  padding: 12px 22px 16px;
  position: relative;
}

.chat-composer {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  border-radius: 20px;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  display: flex;
}

.chat-composer:focus-within {
  border-color: var(--primary);
}

.chat-composer textarea {
  resize: none;
  width: 100%;
  color: var(--text-primary);
  font-family: inherit;
  font-size: var(--fs-base);
  line-height: var(--lh-comfortable);
  background: none;
  border: none;
  outline: none;
  min-height: 22px;
  max-height: 100px;
}

.chat-attach-preview {
  background: var(--tint-primary-soft);
  border: 1px solid var(--tint-primary-border);
  font-size: var(--fs-xs);
  color: var(--text-secondary);
  border-radius: 8px;
  align-items: center;
  gap: 8px;
  padding: 6px 9px;
  display: flex;
}

.chat-attach-preview .x {
  color: var(--text-tertiary);
  background: none;
  border: none;
  margin-left: auto;
}

.chat-composer-toolbar {
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  display: flex;
}

.chat-composer-toolbar .spacer {
  flex: 1;
}

.chat-icon-btn {
  width: 30px;
  height: 30px;
  color: var(--text-tertiary);
  font-size: var(--fs-base);
  background: none;
  border: 1px solid #0000;
  border-radius: 7px;
  justify-content: center;
  align-items: center;
  display: flex;
}

.chat-icon-btn:hover {
  background: var(--surface);
  color: var(--text-primary);
  border-color: var(--border);
}

.chat-icon-btn:disabled {
  opacity: .4;
}

.chat-toggle-task {
  font-size: var(--fs-xs);
  color: var(--text-tertiary);
  border: 1px solid var(--border);
  background: none;
  border-radius: 20px;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  display: inline-flex;
}

.chat-toggle-task:hover {
  color: var(--text-secondary);
  border-color: var(--border-strong);
}

.chat-toggle-task.on {
  color: var(--amber);
  background: #f59e0b14;
  border-color: #f59e0b66;
}

.chat-send-btn {
  background: var(--primary);
  width: 40px;
  height: 40px;
  color: var(--primary-on);
  font-size: var(--fs-base);
  border: none;
  border-radius: 50%;
  flex-shrink: 0;
  justify-content: center;
  align-items: center;
  margin-left: auto;
  display: flex;
}

.chat-send-btn:hover {
  background: var(--primary-hover);
}

.chat-send-btn:disabled {
  opacity: .5;
}

.chat-task-fields {
  border-top: 1px solid var(--border-soft);
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding-top: 8px;
  display: flex;
}

.chat-task-fields label {
  font-size: var(--fs-2xs);
  color: var(--text-tertiary);
  align-items: center;
  gap: 6px;
  display: flex;
}

.chat-task-fields select, .chat-task-fields input {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-family: inherit;
  font-size: var(--fs-xs);
  border-radius: 6px;
  outline: none;
  padding: 5px 9px;
}

.chat-task-nguoinhan {
  flex-direction: column;
  gap: 4px;
  min-width: 220px;
  display: flex;
}

.chat-task-nguoinhan label {
  font-size: var(--fs-2xs);
  color: var(--text-tertiary);
}

.chat-mention-pop {
  z-index: 10;
  background: var(--surface);
  border: 1px solid var(--border);
  width: 240px;
  max-height: 260px;
  box-shadow: var(--shadow-modal);
  border-radius: 10px;
  margin-bottom: 8px;
  position: absolute;
  bottom: 100%;
  left: 22px;
  overflow-y: auto;
}

.chat-mention-pop .hd {
  font-size: var(--fs-2xs);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 8px 12px 4px;
}

.chat-mention-opt {
  font-size: var(--fs-sm);
  text-align: left;
  width: 100%;
  color: var(--text-primary);
  background: none;
  border: none;
  align-items: center;
  gap: 9px;
  padding: 7px 12px;
  display: flex;
}

.chat-mention-opt:hover {
  background: var(--tint-primary);
}

.chat-mention-opt .role {
  font-size: var(--fs-2xs);
  color: var(--text-tertiary);
  margin-left: auto;
}

.chat-right-panel {
  background: var(--surface);
  border-left: 1px solid var(--border-soft);
  flex-direction: column;
  flex-shrink: 0;
  width: 310px;
  height: 100%;
  padding: 14px 14px 0;
  display: flex;
  overflow-y: auto;
}

.chat-right-panel .chat-task-panel {
  border-left: 0;
  flex: auto;
  width: auto;
  height: auto;
  min-height: 0;
}

@media (max-width: 1180px) {
  .chat-right-panel {
    display: none;
  }
}

.chat-task-panel {
  background: var(--surface);
  border-left: 1px solid var(--border-soft);
  flex-direction: column;
  flex-shrink: 0;
  width: 300px;
  height: 100%;
  display: flex;
}

.chat-task-panel-head {
  border-bottom: 1px solid var(--border-soft);
  padding: 15px 16px 12px;
}

.chat-task-panel-head h2 {
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
}

.chat-task-panel-head .sub {
  font-size: var(--fs-2xs);
  color: var(--text-tertiary);
  margin-top: 2px;
}

.chat-tp-tabs {
  gap: 4px;
  padding: 10px 12px 0;
  display: flex;
}

.chat-tp-tab {
  font-size: var(--fs-2xs);
  color: var(--text-tertiary);
  background: none;
  border: 1px solid #0000;
  border-radius: 20px;
  padding: 5px 10px;
}

.chat-tp-tab.active {
  background: var(--tint-primary);
  color: var(--text-primary);
}

.chat-tp-list {
  flex-direction: column;
  flex: 1;
  gap: 8px;
  padding: 10px 12px 16px;
  display: flex;
  overflow-y: auto;
}

.chat-tp-card {
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  cursor: pointer;
  border-radius: 9px;
  padding: 10px 12px;
}

.chat-tp-card.done {
  opacity: .6;
}

.chat-tp-card .txt {
  font-size: var(--fs-xs);
  color: var(--text-primary);
  line-height: var(--lh-body);
}

.chat-tp-card .meta-row {
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  display: flex;
}

.chat-tp-card .chan {
  font-size: var(--fs-2xs);
  color: var(--text-tertiary);
}

.chat-tp-card .han {
  font-size: var(--fs-2xs);
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  display: flex;
}

.chat-tp-card .han.warn {
  color: var(--red);
}

.chat-tp-card .han.ok {
  color: var(--text-tertiary);
}

.chat-tp-card .who {
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  display: flex;
}

.chat-tp-card .who .name {
  font-size: var(--fs-2xs);
  color: var(--text-tertiary);
}

.chat-tp-card .who .arrow {
  color: var(--text-tertiary);
  font-size: var(--fs-2xs);
}

.chat-tp-card .actions {
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-top: 8px;
  display: flex;
}

@media (max-width: 1180px) {
  .chat-task-panel {
    display: none;
  }
}

.chat-mo-ds-mobile, .chat-dong-ds-mobile {
  display: none;
}

@media (max-width: 860px) {
  .chat-kenh-sidebar {
    display: none;
  }

  .chat-kenh-sidebar.mo-mobile {
    z-index: 50;
    width: auto;
    box-shadow: var(--shadow-pop);
    border-right: 0;
    display: flex;
    position: absolute;
    inset: 0;
  }

  .chat-mo-ds-mobile {
    width: 44px;
    height: 44px;
    color: var(--text-secondary);
    font-size: var(--fs-xl);
    background: none;
    border: 0;
    border-radius: 50%;
    flex-shrink: 0;
    justify-content: center;
    align-items: center;
    display: flex;
  }

  .chat-mo-ds-mobile:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
  }

  .chat-kenh-sidebar.mo-mobile .chat-dong-ds-mobile {
    text-align: left;
    border: 0;
    border-bottom: 1px solid var(--border-soft);
    width: 100%;
    min-height: 44px;
    color: var(--text-secondary);
    font-size: var(--fs-xs);
    font-weight: var(--fw-semibold);
    background: none;
    padding: 12px 14px;
    display: block;
  }
}

.chat-shell {
  position: relative;
}

.cccd-mask {
  align-items: center;
  gap: 6px;
  display: inline-flex;
}

.cccd-mask .icon-btn {
  color: var(--amber);
}

.cccd-mask .icon-btn:hover {
  color: var(--amber);
  border-color: var(--tint-amber);
  background: var(--tint-amber);
}

.cccd-mask .icon-label-btn .icon-label-circle {
  color: var(--amber);
  background: var(--tint-amber);
  border-color: var(--tint-amber);
}

.cccd-mask .icon-label-btn:hover .icon-label-circle {
  color: var(--amber);
  border-color: var(--tint-amber);
  background: var(--tint-amber);
}

.cccd-mask .icon-label-btn:hover .icon-label-text {
  color: var(--amber);
}

.cccd-reveal {
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  letter-spacing: .04em;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  margin: 6px 0 2px;
}

.header-bell {
  position: relative;
}

.header-bell-btn {
  border: 1px solid var(--border);
  background: var(--surface-2);
  width: 30px;
  height: 30px;
  font-size: var(--fs-md);
  cursor: pointer;
  color: var(--text-secondary);
  border-radius: 50%;
  justify-content: center;
  align-items: center;
  display: flex;
  position: relative;
}

.header-bell-btn:hover {
  background: var(--tint-primary);
}

.header-bell-badge {
  position: absolute;
  top: -3px;
  right: -3px;
}

.header-bell-dropdown {
  z-index: 60;
  position: fixed;
}

.header-bell-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  width: 340px;
  max-height: 420px;
  box-shadow: var(--shadow-pop);
  border-radius: 10px;
  padding: 6px;
  overflow-y: auto;
}

@media (max-width: 860px) {
  .header-bell-dropdown {
    background: var(--overlay);
    justify-content: center;
    align-items: center;
    padding: 20px;
    display: flex;
    inset: 0 !important;
  }

  .header-bell-panel {
    width: 100%;
    max-width: 360px;
    max-height: 78vh;
  }
}

.header-bell-head {
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  color: var(--text-secondary);
  padding: 8px 10px 6px;
}

.header-bell-item {
  text-align: left;
  cursor: pointer;
  width: 100%;
  font-size: var(--fs-xs);
  color: var(--text-primary);
  background: none;
  border: none;
  border-radius: 8px;
  padding: 9px 10px;
  display: block;
}

.header-bell-item:hover {
  background: var(--surface-2);
}

.header-bell-item.unread {
  background: var(--tint-primary);
}

.header-bell-item .t1 {
  font-weight: var(--fw-semibold);
}

.header-bell-item .t2 {
  color: var(--text-tertiary);
  font-size: var(--fs-2xs);
  margin-top: 2px;
}

.header-bell-foot {
  text-align: center;
  font-size: var(--fs-xs);
  color: var(--accent);
  cursor: pointer;
  padding: 8px;
}

.header-bell-empty {
  text-align: center;
  color: var(--text-tertiary);
  font-size: var(--fs-xs);
  padding: 24px 10px;
}

.canhan-wrap {
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 20px;
  display: flex;
}

.canhan-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  text-align: center;
  border-radius: 12px;
  flex-shrink: 0;
  width: 260px;
  padding: 22px 18px;
}

.canhan-avatar-wrap {
  width: 72px;
  margin: 0 auto 12px;
  position: relative;
}

.canhan-avatar {
  background: var(--tint-primary);
  width: 72px;
  height: 72px;
  color: var(--accent);
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  border-radius: 50%;
  justify-content: center;
  align-items: center;
  display: flex;
  overflow: hidden;
}

.canhan-avatar img {
  object-fit: cover;
  width: 100%;
  height: 100%;
}

.canhan-avatar-edit {
  background: var(--primary);
  border: 2px solid var(--surface);
  width: 24px;
  height: 24px;
  color: var(--primary-on);
  cursor: pointer;
  border-radius: 50%;
  justify-content: center;
  align-items: center;
  display: flex;
  position: absolute;
  bottom: -2px;
  right: -2px;
}

.canhan-avatar-edit:hover {
  background: var(--primary-hover);
}

.canhan-avatar-edit input[type="file"] {
  display: none;
}

.canhan-name {
  font-size: var(--fs-md);
  font-weight: var(--fw-bold);
}

.canhan-role {
  font-size: var(--fs-xs);
  color: var(--text-tertiary);
  margin-top: 3px;
}

.canhan-status {
  font-size: var(--fs-2xs);
  font-weight: var(--fw-semibold);
  color: var(--green);
  align-items: center;
  gap: 5px;
  margin-top: 10px;
  display: inline-flex;
}

.canhan-status .dot {
  background: currentColor;
  border-radius: 50%;
  width: 6px;
  height: 6px;
}

.canhan-actions {
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 10px;
  margin-top: 14px;
  display: flex;
}

.canhan-kv {
  text-align: left;
  border-top: 1px solid var(--border-soft);
  margin-top: 16px;
  padding-top: 12px;
}

.canhan-kv .row {
  font-size: var(--fs-xs);
  justify-content: space-between;
  gap: 8px;
  padding: 4px 0;
  display: flex;
}

.canhan-kv .lbl {
  color: var(--text-tertiary);
}

.canhan-kv .val {
  color: var(--text-primary);
  font-weight: var(--fw-medium);
  text-align: right;
}

.canhan-main {
  flex-direction: column;
  flex: 1;
  gap: 22px;
  min-width: 280px;
  display: flex;
}

.canhan-cot-trai {
  flex-direction: column;
  flex-shrink: 0;
  gap: 18px;
  width: 260px;
  display: flex;
}

.canhan-cot-trai .callout {
  display: block;
}

.canhan-cot-trai .section-title {
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  margin-top: 0;
}

.canhan-cot-trai .section-title .hint {
  line-height: var(--lh-title);
}

.canhan-cot-trai .canhan-card, .canhan-luong {
  width: 100%;
}

.canhan-luong .section-title {
  margin-bottom: 8px;
}

@media (max-width: 860px) {
  .canhan-cot-trai {
    width: 100%;
  }
}

.cv-list {
  flex-direction: column;
  gap: 8px;
  display: flex;
}

.cv-card {
  border: 1px solid var(--border-soft);
  background: var(--surface);
  cursor: pointer;
  border-radius: 10px;
  padding: 11px 14px;
  transition: border-color .12s, background .12s;
}

.cv-card:hover {
  border-color: var(--primary);
  background: var(--tint-primary-soft);
}

.cv-top {
  align-items: flex-start;
  gap: 10px;
  display: flex;
}

.cv-noi-dung {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  flex: 1;
}

.cv-meta {
  font-size: var(--fs-xs);
  color: var(--text-tertiary);
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  margin-top: 7px;
  display: flex;
}

.cv-meta .cv-kenh {
  font-family: var(--font-mono);
  white-space: nowrap;
}

.cv-meta .cv-nguoi {
  align-items: baseline;
  gap: 4px;
  min-width: 0;
  display: inline-flex;
}

.cv-meta .cv-nguoi .ma-nv {
  font-size: var(--fs-2xs);
}

.cv-meta .cv-nguoi .ten-nv {
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline;
  overflow: hidden;
}

.cv-meta .spacer {
  flex: 1;
}

@media (max-width: 860px) {
  .cv-meta {
    gap: 3px 10px;
  }

  .cv-meta .spacer {
    display: none;
  }

  .cv-meta .cv-han {
    flex-basis: 100%;
  }
}

.cv-doan {
  align-items: flex-start;
  gap: 8px;
  display: flex;
}

.cv-doan + .cv-doan {
  margin-top: 8px;
}

.cv-doan.dap {
  flex-direction: row-reverse;
}

.cv-bong {
  background: var(--tint-primary);
  border-left: 3px solid var(--primary);
  border-radius: 10px;
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
}

.cv-doan.dap .cv-bong {
  background: var(--tint-green);
  border-left: none;
  border-right: 3px solid var(--green);
}

.cv-bong-dau {
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
  margin-bottom: 3px;
  display: flex;
}

.cv-doan.dap .cv-bong-dau {
  flex-direction: row-reverse;
}

.cv-bong-dau .ten {
  font-weight: var(--fw-semibold);
  font-size: var(--fs-xs);
  color: var(--text-primary);
}

.cv-bong-dau .ma-nv {
  font-size: var(--fs-2xs);
}

.cv-bong-dau .luc {
  font-size: var(--fs-2xs);
  color: var(--text-tertiary);
}

.cv-bong-dau .spacer {
  flex: 1;
}

.cv-chip {
  font-size: var(--fs-2xs);
  font-weight: var(--fw-bold);
  letter-spacing: .3px;
  background: var(--tint-gray);
  color: var(--text-secondary);
  white-space: nowrap;
  border-radius: 999px;
  padding: 1px 6px;
}

.cv-doan.dap .cv-chip {
  background: var(--tint-green);
  color: var(--green);
}

.cv-bong-lien-mach {
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 7px;
  display: flex;
}

.cv-bong-lien-mach .cv-bong-ai {
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  font-size: var(--fs-xs);
  flex-shrink: 0;
}

.cv-bong-lien-mach .cv-bong-ai .ten-nv {
  font-weight: var(--fw-normal);
  display: inline;
}

.cv-bong-lien-mach .cv-bong-noi-dung {
  flex: 240px;
  min-width: 0;
}

.cv-bong-lien-mach .cv-chip {
  margin-left: auto;
}

.cv-bong-lien-mach .luc {
  font-size: var(--fs-2xs);
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.cv-bong-noi-dung {
  font-size: var(--fs-sm);
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
}

.cv-bong-trong {
  font-size: var(--fs-xs);
  color: var(--text-tertiary);
  font-style: italic;
}

.cv-doan .cv-ava-wrap {
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 36px;
  display: flex;
}

.cv-doan .cv-ava-nhan {
  font-size: var(--fs-2xs);
  color: var(--text-tertiary);
}

.cv-actions {
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  display: flex;
}

.cv-actions .icon-label-btn {
  border-radius: 999px;
  flex-direction: row;
  gap: 5px;
  width: auto;
  height: 32px;
  padding: 0 10px;
}

.cv-actions .icon-label-btn .icon-label-text {
  font-size: var(--fs-xs);
  white-space: nowrap;
}

.cv-actions .spacer {
  flex: 1;
}

.cv-them-phan-hoi {
  font-size: var(--fs-xs);
  color: var(--text-tertiary);
  margin-top: 6px;
}

.cv-card.cv-gon {
  cursor: pointer;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  display: flex;
}

.cv-card.cv-gon .cv-kenh {
  flex-shrink: 0;
}

.cv-card.cv-gon .cv-gon-nguoi {
  white-space: nowrap;
  text-overflow: ellipsis;
  flex-shrink: 0;
  max-width: 170px;
  overflow: hidden;
}

.cv-card.cv-gon .cv-gon-noi-dung {
  min-width: 0;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  flex: 2 1 0;
}

.cv-card.cv-gon .cv-gon-tra-loi {
  min-width: 0;
  font-size: var(--fs-xs);
  color: var(--text-secondary);
  flex: 1 1 0;
}

.cv-card.cv-gon .cv-han {
  white-space: nowrap;
  flex-shrink: 0;
}

.cv-card.cv-gon .chat-sla-pill {
  flex-shrink: 0;
}

@media (max-width: 860px) {
  .cv-card.cv-gon .cv-gon-tra-loi, .cv-card.cv-gon .cv-han {
    display: none;
  }

  .cv-card.cv-gon .cv-gon-nguoi {
    max-width: 110px;
  }

  .cv-doan .cv-ava-wrap {
    width: 30px;
  }

  .cv-actions .spacer {
    display: none;
  }
}

.canhan-payroll-row {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  cursor: pointer;
  border-radius: 9px;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  padding: 12px 14px;
  display: flex;
}

.canhan-payroll-row:hover {
  border-color: var(--border-strong);
}

.canhan-payroll-row .ky {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
}

.canhan-payroll-row .sub {
  font-size: var(--fs-2xs);
  color: var(--text-tertiary);
  margin-top: 2px;
}

.canhan-payroll-row .amt {
  font-size: var(--fs-base);
  font-weight: var(--fw-bold);
  color: var(--accent);
}

@media (max-width: 860px) {
  .canhan-card {
    border-top: none;
    border-left: none;
    border-right: none;
    border-radius: 0;
    width: calc(100% + 24px);
    margin: -14px -12px 0;
  }

  .canhan-main {
    width: 100%;
    min-width: 0;
  }
}

.formula-group {
  margin-bottom: 26px;
}

.formula-group-title {
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  color: var(--text-primary);
  margin-bottom: 10px;
}

.formula-group-title .count {
  color: var(--text-tertiary);
  font-weight: var(--fw-medium);
}

.formula-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  margin-bottom: 14px;
  padding: 16px 18px;
}

.formula-card-warning {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--amber);
  background: var(--tint-amber);
  border: 1px solid var(--tint-amber-border, var(--border));
  border-radius: 8px;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 8px 12px;
  display: flex;
}

.formula-card-head {
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  display: flex;
}

.formula-card-name {
  font-family: var(--font-mono);
  font-weight: var(--fw-bold);
  font-size: var(--fs-base);
  color: var(--text-primary);
}

.formula-card-loc {
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  color: var(--text-tertiary);
}

.formula-card-desc {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  margin-top: 6px;
}

.formula-card-why {
  font-size: var(--fs-xs);
  color: var(--text-tertiary);
  margin-top: 4px;
}

.formula-card-why b {
  color: var(--text-secondary);
}

.formula-code-wrap {
  margin-top: 12px;
  position: relative;
}

.formula-code-wrap.collapsed {
  max-height: 320px;
  overflow: hidden;
}

.formula-code-wrap.collapsed:after {
  content: "";
  background: linear-gradient(to bottom, transparent, var(--surface));
  pointer-events: none;
  height: 60px;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
}

.formula-code-block {
  border: 1px solid var(--border-soft);
  font-size: var(--fs-xs);
  border-radius: 8px;
  overflow: auto;
}

.formula-code-block pre {
  margin: 0;
  padding: 12px 14px;
}

.formula-code-actions {
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
  display: flex;
}

.formula-code-block .shiki, .formula-code-block .shiki span {
  color: var(--shiki-dark);
}

.formula-code-block pre.shiki {
  background-color: var(--shiki-dark-bg) !important;
}

[data-theme="light"] .formula-code-block .shiki, [data-theme="light"] .formula-code-block .shiki span {
  color: var(--shiki-light);
}

[data-theme="light"] .formula-code-block pre.shiki {
  background-color: var(--shiki-light-bg) !important;
}

.tem-a5 {
  border: 1px dashed var(--border);
  box-sizing: border-box;
  color: #000;
  background: #fff;
  border-radius: 6px;
  align-items: center;
  gap: 12mm;
  min-height: 130mm;
  padding: 10mm 12mm;
  display: flex;
}

.tem-a5 + .tem-a5 {
  margin-top: 6mm;
}

.tem-a5 .tem-qr {
  flex: none;
  width: 46mm;
  height: 46mm;
}

.tem-a5 .tem-fields {
  flex: auto;
  min-width: 0;
}

.tem-a5 .tem-masp {
  font-size: 30pt;
  font-weight: var(--fw-heavy);
  letter-spacing: .5px;
  line-height: 1.1;
}

.tem-a5 .tem-tensp {
  margin-top: 3mm;
  font-size: 13pt;
  line-height: 1.35;
}

.tem-a5 .tem-meta {
  flex-direction: column;
  gap: 2mm;
  margin-top: 6mm;
  font-size: 13pt;
  display: flex;
}

.tem-a5 .tem-meta b {
  font-size: 15pt;
}

.tem-a5 .tem-meta .k {
  color: #444;
  margin-right: 3mm;
}

.tem-60 {
  box-sizing: border-box;
  border: 1px dashed var(--border);
  color: #000;
  background: #fff;
  border-radius: 4px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2mm;
  width: 60mm;
  height: 60mm;
  padding: 3mm;
  display: flex;
}

.tem-60 .tem-qr {
  width: 38mm;
  height: 38mm;
}

.tem-60 .tem-masp {
  font-size: 12pt;
  font-weight: var(--fw-heavy);
  letter-spacing: .5px;
  text-align: center;
}

.tem-60 .tem-kcs-label {
  letter-spacing: 1px;
  color: #444;
  text-transform: uppercase;
  font-size: 8pt;
}

@media print {
  .tem-a5, .tem-60 {
    border-color: #999;
  }

  .tem-a5 + .tem-a5 {
    page-break-inside: avoid;
  }

  .tem-60 {
    border: none;
  }
}

.line-cards {
  display: none;
}

.line-card {
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 12px;
  padding: 12px 14px;
}

.line-card + .line-card {
  margin-top: 10px;
}

.line-card-head {
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  display: flex;
}

.line-card-title {
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  color: var(--text-secondary);
  letter-spacing: .02em;
}

.line-card-tools {
  align-items: center;
  gap: 8px;
  display: flex;
}

.line-card-tools .icon-btn {
  border-color: var(--border);
  border-radius: 10px;
  width: 40px;
  height: 40px;
}

.line-card-body {
  flex-direction: column;
  gap: 10px;
  display: flex;
}

.line-card-row {
  gap: 10px;
  display: flex;
}

.line-card-row > .field {
  flex: 1;
  min-width: 0;
}

.line-card-readonly {
  border: 1px dashed var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: var(--fs-base);
  border-radius: 10px;
  align-items: center;
  min-height: 44px;
  padding: 10px 14px;
  display: flex;
}

.line-card-add {
  border: 1px dashed var(--border);
  width: 100%;
  min-height: 44px;
  color: var(--text-secondary);
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
  cursor: pointer;
  background: none;
  border-radius: 10px;
  margin-top: 10px;
  padding: 11px 14px;
}

.line-card-add:hover {
  border-color: var(--primary);
  color: var(--accent);
}

.line-card-hint {
  font-size: var(--fs-2xs);
  color: var(--text-tertiary);
  margin-top: 8px;
}

@media (max-width: 860px) {
  .line-table-wrap {
    display: none;
  }

  .line-cards {
    display: block;
  }

  .table-scroll {
    -webkit-overflow-scrolling: touch;
  }

  .table-scroll table {
    font-size: var(--fs-sm);
  }

  .table-scroll thead th {
    font-size: var(--fs-2xs);
    padding: 7px 8px;
  }

  .table-scroll tbody td {
    white-space: nowrap;
    padding: 6px 8px;
  }

  .table-scroll tbody td .cell-clamp2, .table-scroll tbody td .cell-main, .table-scroll tbody td .cell-sub {
    white-space: normal;
  }

  .modal-overlay {
    padding: 0;
  }

  .modal-card:not(.narrow) {
    border: none;
    border-radius: 0;
    width: 100%;
    max-width: 100%;
    height: 100dvh;
    max-height: 100dvh;
  }

  .modal-card.narrow {
    max-height: 88dvh;
  }

  .modal-head {
    padding: 14px 16px;
  }

  .modal-body {
    padding: 16px 14px;
  }

  .form-section {
    margin-bottom: 14px;
    padding: 14px;
  }

  .modal-foot {
    padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
    background: var(--surface);
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 10px;
  }

  .modal-foot .btn {
    justify-content: center;
    width: 100%;
    min-height: 44px;
  }

  .modal-foot .spacer {
    display: none;
  }

  .field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]), .field select, .field textarea {
    font-size: var(--fs-input);
    min-height: 44px;
  }
}

td .cell-clamp2, td .cell-main > .cell-clamp2, .line-card-readonly .cell-clamp2 {
  min-width: 0;
}

tbody td > div:not(.cell-main):not(.cell-sub):not([class*="badge"]):not(.row-actions):not(.cell-thumb-text):not(.cell-thumb-text-noidung) {
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  display: -webkit-box;
  overflow: hidden;
}

.form-grid > .form-group-label {
  grid-column: 1 / -1;
}

.khong-phai-admin .hint, .khong-phai-admin .tol-note, .khong-phai-admin .catalog-note, .khong-phai-admin .callout:not(.warn):not(.trang-thai) {
  display: none;
}

.sotay-layout {
  grid-template-columns: 232px minmax(0, 1fr);
  align-items: start;
  gap: 20px;
  display: grid;
}

.sotay-noi-dung {
  flex-direction: column;
  gap: 22px;
  min-width: 0;
  display: flex;
}

.sotay-muc-luc {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 12px 10px;
  position: sticky;
  top: 8px;
}

.sotay-muc-luc-dau {
  font-size: var(--fs-2xs);
  font-weight: var(--fw-bold);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin: 0 0 8px;
}

.sotay-muc-luc ol {
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
}

.sotay-muc-luc a {
  color: var(--text-secondary);
  font-size: var(--fs-sm);
  line-height: var(--lh-title);
  border-radius: 8px;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  text-decoration: none;
  display: flex;
}

.sotay-muc-luc a:hover {
  background: var(--tint-primary-soft);
  color: var(--primary);
}

.sotay-ml-so {
  width: 20px;
  height: 20px;
  font-size: var(--fs-2xs);
  font-weight: var(--fw-bold);
  background: var(--tint-primary-soft);
  border: 1px solid var(--tint-primary-border);
  color: var(--primary);
  border-radius: 50%;
  flex: none;
  justify-content: center;
  align-items: center;
  display: inline-flex;
}

.sotay-doc-nhanh, .sotay-muc {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 16px 18px;
}

.sotay-doc-nhanh h2, .sotay-muc h2 {
  font-size: var(--fs-lg);
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  display: flex;
}

.sotay-muc-so {
  width: 24px;
  height: 24px;
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  background: var(--primary);
  color: var(--primary-on);
  border-radius: 50%;
  justify-content: center;
  align-items: center;
  display: inline-flex;
}

.sotay-muc-dem {
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  color: var(--text-tertiary);
}

.sotay-dan {
  color: var(--text-secondary);
  font-size: var(--fs-base);
  margin: 0 0 14px;
  line-height: 1.55;
}

.sotay-2-nhanh {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  display: grid;
}

.sotay-nhanh {
  border: 1px solid var(--tint-primary-border);
  background: var(--tint-primary-soft);
  border-radius: 10px;
  padding: 12px 14px;
}

.sotay-nhanh h3 {
  font-size: var(--fs-base);
  color: var(--primary);
  margin: 0 0 8px;
}

.sotay-chuoi {
  font-size: var(--fs-sm);
  margin: 0 0 6px;
  line-height: 1.9;
}

.sotay-chuoi span {
  color: var(--primary);
  font-weight: var(--fw-bold);
  padding: 0 2px;
}

.sotay-ghi {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  margin: 0;
}

.sotay-dong-chay {
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  display: flex;
}

.sotay-dong-chay span {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  padding: 6px 12px;
}

.sotay-dong-chay i {
  color: var(--text-tertiary);
  font-style: normal;
}

.sotay-dong-chay-cuoi {
  color: var(--primary-on);
  background: var(--primary) !important;
  border-color: var(--primary) !important;
}

.sotay-chu-giai {
  gap: 6px;
  margin-top: 14px;
  display: grid;
}

.sotay-chu-giai > div {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  align-items: flex-start;
  gap: 8px;
  display: flex;
}

.sotay-the-luoi {
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 12px;
  display: grid;
}

.sotay-the {
  border: 1px solid var(--border-soft);
  background: var(--surface-2);
  border-radius: 10px;
  padding: 12px 14px;
  scroll-margin-top: 12px;
}

.sotay-the-dau {
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  display: flex;
}

.sotay-the-dau h3 {
  font-size: var(--fs-md);
  margin: 0;
}

.sotay-the-badges {
  flex-wrap: wrap;
  gap: 4px;
  display: flex;
}

.sotay-badge {
  font-size: var(--fs-2xs);
  font-weight: var(--fw-bold);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  white-space: nowrap;
  border-radius: 999px;
  padding: 2px 8px;
}

.sotay-badge-tinh-tu-nguon {
  background: var(--tint-primary-soft);
  border-color: var(--tint-primary-border);
  color: var(--primary);
}

.sotay-badge-snapshot {
  background: var(--tint-amber);
  border-color: var(--tint-amber-border);
}

.sotay-badge-nhap-tay {
  background: var(--surface);
  border-style: dashed;
}

.sotay-badge-dinh-danh {
  opacity: .75;
}

.sotay-badge-track {
  background: var(--surface);
  font-weight: var(--fw-semibold);
}

.sotay-field {
  font-size: var(--fs-xs);
  color: var(--text-tertiary);
  margin: 8px 0 0;
}

.sotay-field code, .sotay-the code {
  font-size: var(--fs-xs);
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  padding: 1px 5px;
}

.sotay-y-nghia {
  font-size: var(--fs-sm);
  line-height: var(--lh-comfortable);
  margin: 8px 0 0;
}

.sotay-khoi {
  margin-top: 10px;
}

.sotay-khoi-nhan {
  font-size: var(--fs-2xs);
  font-weight: var(--fw-bold);
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 4px;
  display: block;
}

.sotay-cong-thuc {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  font-size: var(--fs-xs);
  line-height: var(--lh-relaxed);
  white-space: pre-wrap;
  word-break: break-word;
  border-radius: 8px;
  margin: 0;
  padding: 8px 10px;
  overflow-x: auto;
}

.sotay-nguon {
  font-size: var(--fs-sm);
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding-left: 16px;
  display: flex;
}

.sotay-link {
  color: var(--primary);
  align-items: center;
  gap: 4px;
  text-decoration: none;
  display: inline-flex;
}

.sotay-link:hover {
  text-decoration: underline;
}

.sotay-tu-kiem {
  border-left: 3px solid var(--primary);
  padding-left: 10px;
}

.sotay-tu-kiem dl {
  font-size: var(--fs-sm);
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 2px 8px;
  margin: 0;
  display: grid;
}

.sotay-tu-kiem dt {
  font-weight: var(--fw-bold);
  color: var(--primary);
}

.sotay-tu-kiem dd {
  line-height: var(--lh-comfortable);
  margin: 0;
}

.sotay-luu-y {
  font-size: var(--fs-sm);
  line-height: var(--lh-comfortable);
  color: var(--text-secondary);
  margin: 10px 0 0;
}

.sotay-trong {
  color: var(--text-tertiary);
  font-size: var(--fs-sm);
}

.sotay-bang {
  border-collapse: collapse;
  width: 100%;
  font-size: var(--fs-sm);
}

.sotay-bang th, .sotay-bang td {
  border: 1px solid var(--border-soft);
  text-align: left;
  vertical-align: top;
  line-height: var(--lh-body);
  padding: 7px 9px;
}

.sotay-bang thead th {
  background: var(--thead-bg);
  font-size: var(--fs-xs);
}

.sotay-bang td.num-cell, .sotay-bang th.num-cell {
  text-align: right;
  white-space: nowrap;
}

.sotay-cau-hinh {
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 14px;
  display: grid;
}

.sotay-ch-khoi {
  border: 1px solid var(--border-soft);
  background: var(--surface-2);
  border-radius: 10px;
  padding: 12px 14px;
}

.sotay-ch-rong {
  grid-column: 1 / -1;
}

.sotay-ch-khoi h3 {
  font-size: var(--fs-base);
  margin: 0 0 10px;
}

.sotay-dl {
  font-size: var(--fs-sm);
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 12px;
  margin: 0;
  display: grid;
}

.sotay-dl dt {
  color: var(--text-secondary);
}

.sotay-dl dd {
  font-weight: var(--fw-semibold);
  text-align: right;
  margin: 0;
}

.sotay-dl em {
  font-weight: var(--fw-normal);
  font-size: var(--fs-xs);
  color: var(--text-tertiary);
  font-style: normal;
  display: block;
}

.sotay-muc.callout {
  color: var(--text-primary);
  font-size: inherit;
  margin-top: 0;
  display: block;
}

.sotay-ra-soat {
  font-size: var(--fs-sm);
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding-left: 18px;
  display: flex;
}

.sotay-ra-soat p {
  line-height: var(--lh-comfortable);
  color: var(--text-secondary);
  margin: 4px 0;
}

.sotay-may-tinh {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
  gap: 16px;
  display: grid;
}

.sotay-mt-form .form-grid {
  margin: 0;
}

.sotay-mt-track {
  font-size: var(--fs-sm);
  align-items: center;
  gap: 8px;
  display: flex;
}

.sotay-mt-ket-qua h3 {
  font-size: var(--fs-base);
  margin: 0 0 8px;
}

.sotay-mt-ngat td {
  background: var(--surface-2);
  font-weight: var(--fw-bold);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.sotay-mt-cuoi td {
  background: var(--tint-primary-soft);
  font-weight: var(--fw-heavy);
  font-size: var(--fs-base);
  color: var(--primary);
}

@media (max-width: 1100px) {
  .sotay-may-tinh {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 860px) {
  .sotay-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .sotay-muc-luc {
    position: static;
  }

  .sotay-muc-luc ol {
    flex-flow: row;
    gap: 6px;
    padding-bottom: 2px;
    overflow-x: auto;
  }

  .sotay-muc-luc a {
    white-space: nowrap;
    border: 1px solid var(--border-soft);
  }

  .sotay-the-luoi {
    grid-template-columns: minmax(0, 1fr);
  }

  .sotay-doc-nhanh, .sotay-muc {
    padding: 14px;
  }
}

@media print {
  .sotay-layout, .sotay-the-luoi, .sotay-cau-hinh, .sotay-2-nhanh {
    display: block;
  }

  .sotay-the, .sotay-ch-khoi {
    break-inside: avoid;
    page-break-inside: avoid;
    margin-bottom: 8px;
  }

  .sotay-muc, .sotay-doc-nhanh {
    break-before: page;
    page-break-before: always;
    box-shadow: none;
    border: 0;
    padding: 0;
  }

  .sotay-doc-nhanh {
    break-before: auto;
    page-break-before: auto;
  }

  .sotay-bang {
    font-size: 10.5px;
  }
}

.nut-hoi-ai {
  z-index: 40;
  cursor: pointer;
  background: var(--primary);
  color: var(--primary-on);
  box-shadow: var(--shadow-modal);
  font-weight: var(--fw-semibold);
  font-size: var(--fs-sm);
  border: none;
  border-radius: 999px;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  display: flex;
  position: fixed;
  bottom: 20px;
  right: 20px;
}

.nut-hoi-ai:hover {
  background: var(--primary-hover);
}

.khung-hoi-ai {
  z-index: 55;
  background: var(--surface);
  border: 1px solid var(--border);
  width: min(440px, 100vw - 32px);
  height: min(640px, 100vh - 100px);
  box-shadow: var(--shadow-modal);
  border-radius: 14px;
  flex-direction: column;
  display: flex;
  position: fixed;
  bottom: 16px;
  right: 16px;
  overflow: hidden;
}

.khung-hoi-ai .dau {
  border-bottom: 1px solid var(--border-soft);
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  display: flex;
}

.khung-hoi-ai .than {
  flex: 1;
  padding: 10px 12px;
  overflow-y: auto;
}

.khung-hoi-ai .chan {
  border-top: 1px solid var(--border-soft);
  padding: 8px 10px 10px;
}

@media (max-width: 860px) {
  .nut-hoi-ai {
    bottom: calc(72px + env(safe-area-inset-bottom));
    padding: 10px;
    right: 12px;
  }

  .nut-hoi-ai .chu {
    display: none;
  }

  .khung-hoi-ai {
    border-radius: 0;
    width: auto;
    height: auto;
    inset: 0;
  }
}

.kn-list {
  gap: var(--sp-3);
  flex-direction: column;
  display: flex;
}

.kn-card {
  align-items: flex-start;
  gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  display: flex;
}

.kn-empty {
  align-items: center;
  gap: var(--sp-2);
  text-align: center;
  color: var(--text-secondary);
  font-size: var(--fs-sm);
  flex-direction: column;
}

.kn-empty-title {
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
}

.kn-dot {
  background: var(--gray);
  border-radius: 50%;
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  margin-top: 6px;
}

.kn-dot-ok {
  background: var(--green);
}

.kn-dot-loi {
  background: var(--red);
}

.kn-main {
  flex: 1;
  min-width: 0;
}

.kn-title {
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-2);
  flex-wrap: wrap;
  display: flex;
}

.kn-ten {
  font-weight: var(--fw-bold);
  font-size: var(--fs-md);
  color: var(--text-primary);
}

.kn-info {
  column-gap: var(--sp-2);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  grid-template-columns: auto 1fr;
  row-gap: 2px;
  margin: 0;
  display: grid;
}

.kn-info dt {
  color: var(--text-secondary);
}

.kn-info dd {
  color: var(--text-primary);
  overflow-wrap: anywhere;
  margin: 0;
}

.kn-meta {
  margin-top: var(--sp-2);
  font-size: var(--fs-2xs);
  color: var(--text-tertiary);
}

.kn-test {
  margin-top: var(--sp-2);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  overflow-wrap: anywhere;
  align-items: flex-start;
  gap: 6px;
  padding: 6px 10px;
  display: flex;
}

.kn-test svg {
  flex-shrink: 0;
  margin-top: 1px;
}

.kn-test-ok {
  background: var(--tint-green);
  color: var(--green);
}

.kn-test-loi {
  background: var(--tint-red);
  color: var(--red);
}

.kn-actions {
  gap: var(--sp-1);
  flex-shrink: 0;
  display: flex;
}

.kn-actions .spin {
  transform-origin: 50%;
  animation: .8s linear infinite sync-spin;
}

.kn-pass {
  position: relative;
}

.kn-pass input {
  width: 100%;
  padding-right: 40px;
}

.kn-pass-eye {
  width: 32px;
  height: 32px;
  color: var(--text-secondary);
  cursor: pointer;
  background: none;
  border: 0;
  justify-content: center;
  align-items: center;
  display: inline-flex;
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
}

.kn-pass-eye:hover {
  color: var(--primary);
}

.field .hint-inline {
  font-weight: var(--fw-normal);
  color: var(--text-tertiary);
}

@media (max-width: 860px) {
  .kn-card {
    padding: var(--sp-3) var(--sp-4);
    gap: var(--sp-3);
    flex-wrap: wrap;
  }

  .kn-main {
    flex-basis: calc(100% - 30px);
  }

  .kn-actions {
    justify-content: flex-end;
    width: 100%;
  }
}

.den-mcp {
  background: var(--text-tertiary);
  border-radius: 50%;
  flex: none;
  width: 10px;
  height: 10px;
  display: inline-block;
}

.den-mcp.song {
  background: var(--green-fill);
  animation: 1.6s ease-in-out infinite den-mcp-nhap;
}

@keyframes den-mcp-nhap {
  0%, 100% {
    box-shadow: 0 0 #22c55e8c;
  }

  50% {
    box-shadow: 0 0 0 6px #22c55e00;
  }
}

@media (prefers-reduced-motion: reduce) {
  .den-mcp.song {
    animation: none;
  }
}

.lthcv-pop {
  z-index: 60;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-height: 360px;
  box-shadow: var(--shadow-pop);
  flex-direction: column;
  gap: 2px;
  padding: 8px;
  display: flex;
  position: fixed;
  overflow-y: auto;
}

.lthcv-tim {
  z-index: 1;
  border: 0;
  border-bottom: 1px solid var(--border-soft);
  background: var(--surface);
  font-size: var(--fs-sm);
  color: var(--text-primary);
  outline: none;
  margin: -8px -8px 4px;
  padding: 10px 12px;
  position: sticky;
  top: -8px;
}

.lthcv-opt {
  text-align: left;
  cursor: pointer;
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  background: none;
  border: none;
  border-radius: 6px;
  padding: 7px 10px;
}

.lthcv-opt:hover {
  background: var(--surface-2);
  color: var(--text-primary);
}

.lthcv-opt.active {
  background: var(--tint-primary-soft);
  color: var(--accent);
  font-weight: var(--fw-semibold);
}

.lthcv-rong {
  font-size: var(--fs-sm);
  color: var(--text-tertiary);
  padding: 7px 10px;
}

@media (max-width: 860px) {
  .lthcv-tim {
    font-size: var(--fs-input);
  }
}

.gui-di-bar {
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  display: flex;
}

.gui-di-btn {
  border: 1px solid var(--tint-primary-border);
  background: var(--tint-primary-soft);
  min-height: 32px;
  color: var(--primary);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  cursor: pointer;
  border-radius: 999px;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  text-decoration: none;
  transition: background .15s, border-color .15s;
  display: inline-flex;
}

.gui-di-btn:hover {
  background: var(--tint-primary);
  border-color: var(--primary);
}

.gui-di-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.gui-di-btn:disabled {
  opacity: .5;
  cursor: progress;
}

.gui-di-btn[aria-pressed="true"] {
  background: var(--primary);
  color: var(--surface);
  border-color: var(--primary);
}

.gui-di-bang {
  max-height: 260px;
  margin-top: 6px;
  overflow: auto;
}

.gui-di-bang table {
  font-size: var(--fs-xs);
}

@media (max-width: 860px) {
  .gui-di-btn {
    min-height: 40px;
  }
}

.vp-chat {
  background: var(--surface);
  flex-direction: column;
  height: 100%;
  min-height: 0;
  display: flex;
}

.vp-chat-head {
  border-bottom: 1px solid var(--border-soft);
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  display: flex;
}

.vp-chat-head-act {
  gap: 4px;
  display: inline-flex;
}

.vp-chat-ngu-canh {
  border-radius: var(--radius-sm);
  background: var(--tint-primary-soft);
  border: 1px solid var(--tint-primary-border);
  color: var(--primary);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  align-items: center;
  gap: 6px;
  margin: 8px 10px 0;
  padding: 6px 10px;
  line-height: 1.35;
  display: flex;
}

.vp-chat-ngu-canh span {
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  display: -webkit-box;
  overflow: hidden;
}

.vp-chat-tin {
  flex: 1;
  min-height: 0;
  padding: 10px;
  overflow-y: auto;
}

.vp-chat-trong {
  text-align: center;
  color: var(--text-tertiary);
  font-size: var(--fs-sm);
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 24px 8px;
  display: flex;
}

.vp-chat-loi {
  margin: 0 10px 6px;
}

.vp-chat-goi-y {
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 10px 6px;
  display: flex;
}

.vp-chat-chip {
  border: 1px solid var(--border);
  background: var(--surface-2);
  min-height: 30px;
  color: var(--text-secondary);
  font-size: var(--fs-xs);
  cursor: pointer;
  border-radius: 999px;
  padding: 4px 10px;
}

.vp-chat-chip:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}

.vp-chat-chip:disabled {
  opacity: .5;
}

.vp-chat-nhap {
  border-top: 1px solid var(--border-soft);
  align-items: flex-end;
  gap: 6px;
  padding: 8px 10px;
  display: flex;
}

.vp-chat-nhap textarea {
  resize: none;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  min-width: 0;
  color: var(--text-primary);
  font: inherit;
  font-size: var(--fs-sm);
  flex: 1;
  padding: 7px 9px;
}

.vp-chat-nhap .btn {
  min-height: 38px;
}

@media (max-width: 860px) {
  .vp-chat-nhap textarea {
    font-size: var(--fs-input);
    min-height: 44px;
  }

  .vp-chat-chip {
    min-height: 40px;
  }
}

.vp-cong-cu-luoi {
  margin-bottom: var(--sp-4);
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 10px;
  max-width: 820px;
  display: grid;
}

.vp-cong-cu {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 6px 10px;
  display: flex;
}

.vp-cong-cu:hover {
  border-color: var(--tint-primary-border);
  background: var(--tint-primary-soft);
}

.vp-cong-cu:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.vp-cong-cu-icon {
  color: #fff;
  border-radius: 12px;
  justify-content: center;
  align-items: center;
  width: 44px;
  height: 44px;
  display: inline-flex;
}

.vp-cong-cu-ten {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  text-align: center;
}

.vp-ten-o {
  align-items: center;
  gap: 8px;
  min-width: 180px;
  display: inline-flex;
}

.vp-icon-loai {
  flex-shrink: 0;
  display: inline-flex;
}

.vp-workspace {
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  display: flex;
}

.vp-workspace-loi {
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  display: flex;
}

.vp-topbar {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  padding: 8px 10px;
  display: flex;
}

.vp-topbar .spacer {
  flex: 1;
}

.vp-topbar .btn {
  align-items: center;
  gap: 4px;
  display: inline-flex;
}

.vp-loai-cham {
  border-radius: 50%;
  flex-shrink: 0;
  width: 10px;
  height: 10px;
}

.vp-ten-tep {
  border-radius: var(--radius-sm);
  max-width: min(520px, 60vw);
  font-weight: var(--fw-bold);
  font-size: var(--fs-md);
  color: var(--text-primary);
  cursor: text;
  text-align: left;
  background: none;
  border: 1px solid #0000;
  align-items: center;
  gap: 6px;
  padding: 3px 6px;
  display: inline-flex;
}

.vp-ten-tep:hover {
  border-color: var(--border);
}

.vp-ten-form {
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  display: inline-flex;
}

.vp-ten-form input {
  min-width: 220px;
}

.vp-badge-pb {
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  background: var(--tint-primary-soft);
  color: var(--primary);
  border: 1px solid var(--tint-primary-border);
  border-radius: 999px;
  padding: 2px 8px;
}

.vp-lich-su-wrap {
  position: relative;
}

.vp-lich-su-pop {
  z-index: 60;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: min(420px, 92vw);
  max-height: 60vh;
  box-shadow: var(--shadow-pop);
  padding: 8px;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  overflow-y: auto;
}

.vp-lich-su-pop ol {
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
}

.vp-lich-su-pop li {
  border-radius: var(--radius);
  background: var(--surface-2);
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  display: flex;
}

.vp-ls-dau, .vp-ls-cuoi {
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  display: flex;
}

.vp-ls-cuoi .spacer {
  flex: 1;
}

.vp-ls-nguon {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--primary);
}

.vp-tin {
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  display: flex;
}

.vp-tin > span {
  flex: 1;
}

.vp-than {
  align-items: stretch;
  gap: 0;
  min-width: 0;
  display: flex;
}

.vp-editor {
  flex: auto;
  min-width: 0;
}

.vp-khung-chat {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  flex-direction: column;
  flex: none;
  min-width: 300px;
  height: calc(100vh - 170px);
  min-height: 480px;
  margin-left: 12px;
  display: flex;
  position: sticky;
  top: 8px;
  overflow: hidden;
}

.vp-khung-chat-keo {
  cursor: col-resize;
  z-index: 2;
  width: 6px;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
}

.vp-khung-chat-keo:hover {
  background: var(--tint-primary-soft);
}

.vp-khung-chat-dau {
  border-bottom: 1px solid var(--border-soft);
  align-items: center;
  gap: 8px;
  padding: 6px 8px 6px 14px;
  display: flex;
}

.vp-khung-chat-dau .spacer {
  flex: 1;
}

.vp-khung-chat-than {
  flex-direction: column;
  flex: 1;
  min-height: 0;
  display: flex;
}

.vp-khung-chat-than > * {
  flex: 1;
  min-height: 0;
}

.vp-editor-khung {
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  display: flex;
}

.vp-editor-bar {
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  display: flex;
}

.vp-editor-bar .spacer {
  flex: 1;
}

.vp-editor-bar .btn {
  align-items: center;
  gap: 4px;
  display: inline-flex;
}

.vp-ghi-chu {
  margin: 0;
}

.vp-univer {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: #fff;
  height: calc(100vh - 200px);
  min-height: 460px;
  overflow: hidden;
}

.vp-seg {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: inline-flex;
  overflow: hidden;
}

.vp-seg button {
  font-size: var(--fs-xs);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  border: none;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  display: inline-flex;
}

.vp-seg button + button {
  border-left: 1px solid var(--border);
}

.vp-seg button.active {
  background: var(--tint-primary-soft);
  color: var(--primary);
  font-weight: var(--fw-semibold);
}

.vp-fmt-bar {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--surface);
  z-index: 3;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  padding: 4px;
  display: flex;
  position: sticky;
  top: 0;
}

.vp-fmt-btn {
  border-radius: var(--radius-sm);
  width: 32px;
  height: 32px;
  color: var(--text-secondary);
  cursor: pointer;
  background: none;
  border: 1px solid #0000;
  justify-content: center;
  align-items: center;
  display: inline-flex;
}

.vp-fmt-btn:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--text-primary);
}

.vp-fmt-btn.active {
  background: var(--tint-primary-soft);
  color: var(--primary);
  border-color: var(--tint-primary-border);
}

.vp-fmt-btn:disabled {
  opacity: .35;
  cursor: default;
}

.vp-fmt-sep {
  background: var(--border);
  width: 1px;
  height: 20px;
  margin: 0 4px;
}

.vp-doc-giay {
  background: var(--surface-2);
  border-radius: var(--radius);
  min-height: calc(100vh - 260px);
  padding: 16px;
}

.vp-doc-giay .ProseMirror {
  color: #111;
  max-width: 820px;
  min-height: calc(100vh - 300px);
  box-shadow: var(--shadow-card);
  background: #fff;
  border-radius: 4px;
  margin: 0 auto;
  padding: 40px 48px;
}

.vp-doc-giay .ProseMirror td, .vp-doc-giay .ProseMirror th {
  border: 1px solid #c8c8cc;
}

.vp-trang {
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
  display: flex;
}

.vp-trang-nho {
  flex-direction: column;
  flex-shrink: 0;
  gap: 8px;
  width: 150px;
  max-height: calc(100vh - 220px);
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  overflow-y: auto;
}

.vp-trang-nho button {
  background: var(--surface);
  border: 2px solid var(--border-soft);
  border-radius: var(--radius);
  cursor: pointer;
  width: 100%;
  font-size: var(--fs-xs);
  color: var(--text-secondary);
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px;
  display: flex;
}

.vp-trang-nho button.active {
  border-color: var(--primary);
  color: var(--primary);
}

.vp-trang-nho img {
  background: #fff;
  width: 100%;
  height: auto;
  display: block;
}

.vp-trang-lon {
  flex-direction: column;
  flex: 1;
  gap: 6px;
  min-width: 0;
  display: flex;
}

.vp-trang-lon > img {
  max-width: 100%;
  height: auto;
  box-shadow: var(--shadow-card);
  background: #fff;
  border-radius: 4px;
  align-self: center;
}

.vp-slide-chu {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--surface);
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  display: flex;
}

.vp-slide-chu textarea {
  resize: vertical;
  width: 100%;
}

.vp-html-chia {
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  height: calc(100vh - 230px);
  min-height: 420px;
  display: grid;
}

.vp-html-chia.vp-html-ma, .vp-html-chia.vp-html-xem {
  grid-template-columns: 1fr;
}

.vp-html-ma {
  resize: none;
  width: 100%;
  height: 100%;
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  line-height: var(--lh-comfortable);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-primary);
  tab-size: 2;
  padding: 10px;
}

.vp-html-xem {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  width: 100%;
  height: 100%;
}

.vp-pdf-chu pre {
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--surface-2);
  border-radius: var(--radius);
  max-height: calc(100vh - 260px);
  font-size: var(--fs-sm);
  margin: 0;
  padding: 12px;
  overflow-y: auto;
}

@media (max-width: 1100px) {
  .vp-than {
    flex-direction: column;
    gap: 12px;
  }

  .vp-khung-chat {
    width: 100%;
    min-width: 0;
    height: 70vh;
    min-height: 420px;
    margin-left: 0;
    position: relative;
    top: auto;
    flex-basis: auto !important;
  }

  .vp-khung-chat-keo {
    display: none;
  }

  .vp-trang {
    flex-direction: column;
  }

  .vp-trang-nho {
    flex-direction: row;
    width: 100%;
    max-height: none;
    overflow: auto hidden;
  }

  .vp-trang-nho li {
    flex: 0 0 110px;
  }

  .vp-univer {
    height: 65vh;
    min-height: 380px;
  }

  .vp-html-chia {
    grid-template-rows: 1fr 1fr;
    grid-template-columns: 1fr;
    height: auto;
  }

  .vp-html-chia > * {
    min-height: 320px;
  }

  .vp-doc-giay {
    padding: 8px;
  }

  .vp-doc-giay .ProseMirror {
    padding: 20px 16px;
  }
}

@media (max-width: 860px) {
  .vp-cong-cu-luoi {
    grid-template-columns: repeat(3, 1fr);
  }

  .vp-ten-tep {
    max-width: 100%;
  }

  .vp-fmt-btn {
    width: 40px;
    height: 40px;
  }
}

.dh-ai-khung {
  align-items: flex-start;
  gap: 12px;
  display: flex;
}

.dh-ai-so-do {
  flex-direction: column;
  flex: 0 0 260px;
  gap: 2px;
  max-height: calc(100vh - 220px);
  padding: 8px;
  display: flex;
  overflow: auto;
}

.dh-ai-nut {
  color: var(--text);
  text-align: left;
  cursor: pointer;
  font-size: var(--fs-sm);
  background: none;
  border: 0;
  border-radius: 8px;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  display: flex;
}

.dh-ai-nut:hover {
  background: var(--surface-2);
}

.dh-ai-nut.on {
  background: var(--tint-primary-soft);
  color: var(--primary);
  font-weight: var(--fw-semibold);
}

.dh-ai-nut.cap-1 {
  padding-left: 20px;
}

.dh-ai-nut.cap-2 {
  font-size: var(--fs-xs);
  padding-left: 34px;
}

.dh-ai-ten {
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.dh-ai-ca {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  display: grid;
}

.dh-ai-cot-ca {
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  display: flex;
}

.dh-ai-cot-ca > header {
  flex-direction: column;
  gap: 2px;
  display: flex;
}

.dh-ai-the {
  background: var(--surface-2);
  border-radius: 8px;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  display: flex;
}

.dh-ai-the-ten {
  text-align: left;
  font-weight: var(--fw-semibold);
  color: var(--text);
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}

@media (max-width: 860px) {
  .dh-ai-khung {
    flex-direction: column;
  }

  .dh-ai-so-do {
    flex: none;
    width: 100%;
    max-height: 240px;
  }
}

.qtb {
  gap: var(--sp-5);
  padding: var(--sp-4) var(--screen-px, 20px) var(--sp-8);
  grid-template-columns: 300px minmax(0, 1fr);
  align-items: start;
  display: grid;
}

.qtb-list {
  gap: var(--sp-3);
  padding: var(--sp-3);
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  flex-direction: column;
  display: flex;
  position: sticky;
  top: 12px;
}

.qtb-list-top {
  gap: var(--sp-2);
  align-items: center;
  display: flex;
}

.qtb-search {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  min-width: 0;
  color: var(--text-tertiary);
  flex: 1;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  display: flex;
}

.qtb-search input {
  min-width: 0;
  color: var(--text-primary);
  background: none;
  border: 0;
  outline: none;
  flex: 1;
  padding: 8px 0;
}

.qtb-items {
  flex-direction: column;
  gap: 4px;
  display: flex;
}

.qtb-item {
  text-align: left;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  background: none;
  border: 1px solid #0000;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  display: grid;
}

.qtb-item:hover {
  background: var(--hover-bg);
}

.qtb-item[aria-current="true"] {
  background: var(--tint-primary-soft);
  border-color: var(--tint-primary-border);
}

.qtb-item-ico {
  background: var(--surface-2);
  width: 32px;
  height: 32px;
  color: var(--primary);
  border-radius: 50%;
  place-items: center;
  display: grid;
}

.qtb-item-ten {
  font-weight: var(--fw-semibold);
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

.qtb-item-so {
  font-size: var(--fs-2xs);
  color: var(--text-secondary);
  background: var(--surface-2);
  font-variant-numeric: tabular-nums;
  border-radius: 20px;
  padding: 1px 8px;
}

.qtb-detail {
  min-width: 0;
  padding: var(--sp-5);
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
}

.qtb-head {
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
  display: flex;
}

.qtb-head h2 {
  min-width: 200px;
  font-size: var(--fs-xl);
  text-wrap: balance;
  flex: 1;
  margin: 0;
}

.qtb-acts {
  flex-wrap: wrap;
  gap: 4px;
  display: flex;
}

.qtb-meta {
  margin: 4px 0 var(--sp-4);
  font-size: var(--fs-xs);
  color: var(--text-tertiary);
}

.qtb-steps {
  flex-direction: column;
  gap: 26px;
  max-width: 880px;
  margin: 0 auto;
  display: flex;
}

.qtb-step {
  --c: var(--swatch-teal);
  border-radius: var(--radius);
  grid-template-columns: 250px minmax(0, 1fr);
  align-items: center;
  display: grid;
}

.qtb-step[data-mau="2"] {
  --c: var(--swatch-violet);
}

.qtb-step[data-mau="3"] {
  --c: var(--swatch-pink);
}

.qtb-step[data-mau="4"] {
  --c: var(--swatch-blue);
}

.qtb-step[data-mau="5"] {
  --c: var(--swatch-indigo);
}

.qtb-step[data-mau="6"] {
  --c: var(--swatch-orange);
}

.qtb-step[data-mau="7"] {
  --c: var(--swatch-green);
}

.qtb-step.rev {
  grid-template-columns: minmax(0, 1fr) 250px;
}

.qtb-step.rev .qtb-side {
  order: 2;
  justify-content: flex-end;
  padding: 0 78px 0 0;
}

.qtb-step.rev .qtb-card {
  text-align: right;
  order: 1;
  padding: 18px 30px 18px 20px;
}

.qtb-step.dang-keo {
  opacity: .45;
}

.qtb-step.keo-toi {
  outline: 2px dashed var(--primary);
  outline-offset: 6px;
}

.qtb-side {
  justify-content: flex-start;
  align-items: center;
  min-height: 128px;
  padding-left: 78px;
  display: flex;
  position: relative;
}

.qtb-num {
  background: var(--c);
  color: #fff;
  width: 120px;
  height: 46px;
  font-size: var(--fs-2xl);
  font-weight: var(--fw-heavy);
  font-variant-numeric: tabular-nums;
  border-radius: 24px 0 0 24px;
  align-items: center;
  padding-left: 16px;
  display: flex;
  position: absolute;
  top: 16px;
  left: 0;
}

.qtb-step.rev .qtb-num {
  border-radius: 0 24px 24px 0;
  justify-content: flex-end;
  padding: 0 16px 0 0;
  left: auto;
  right: 0;
}

.qtb-ring {
  z-index: 1;
  background: var(--surface);
  width: 116px;
  height: 116px;
  box-shadow: var(--shadow-card);
  border-radius: 50%;
  place-items: center;
  display: grid;
  position: relative;
}

.qtb-ring:before {
  content: "";
  border: 4px solid #0000;
  border-top-color: var(--c);
  border-right-color: var(--c);
  border-radius: 50%;
  position: absolute;
  inset: -6px;
  transform: rotate(30deg);
}

.qtb-step.rev .qtb-ring:before {
  transform: rotate(-120deg);
}

.qtb-ring-in {
  background: var(--c);
  color: #fff;
  border-radius: 50%;
  place-items: center;
  width: 84px;
  height: 84px;
  display: grid;
}

.qtb-card {
  background: var(--surface);
  border-radius: var(--radius);
  min-width: 0;
  min-height: 96px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-soft);
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 18px 20px 18px 30px;
  display: flex;
  position: relative;
}

.qtb-card:before {
  content: "";
  background: var(--c);
  border-radius: 50%;
  width: 13px;
  height: 13px;
  margin-top: -6px;
  position: absolute;
  top: 50%;
  left: -7px;
}

.qtb-card:after {
  content: "";
  background: var(--c);
  border-radius: 2px;
  height: 2px;
  position: absolute;
  top: -10px;
  left: 12px;
  right: 30%;
}

.qtb-step.rev .qtb-card:before {
  left: auto;
  right: -7px;
}

.qtb-step.rev .qtb-card:after {
  left: 30%;
  right: 12px;
}

.qtb-card h3 {
  color: var(--c);
  font-size: var(--fs-md);
  font-weight: var(--fw-heavy);
  letter-spacing: .03em;
  text-transform: uppercase;
  text-wrap: balance;
  margin: 0;
}

.qtb-card p {
  color: var(--text-secondary);
  font-size: var(--fs-sm);
  white-space: pre-line;
  margin: 0;
}

.qtb-who {
  background: var(--surface-2);
  max-width: 100%;
  font-size: var(--fs-xs);
  color: var(--text-secondary);
  border-radius: 20px;
  align-self: flex-start;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 3px;
  display: inline-flex;
}

.qtb-who b {
  color: var(--text-primary);
}

.qtb-who.chua {
  color: var(--red);
  padding-left: 8px;
}

.qtb-ra {
  flex-wrap: wrap;
  gap: 6px;
  display: flex;
}

.qtb-step.rev .qtb-ra {
  justify-content: flex-end;
}

.qtb-ra-chip {
  font-size: var(--fs-xs);
  background: var(--tint-primary-soft);
  border: 1px solid var(--tint-primary-border);
  color: var(--primary);
  border-radius: 20px;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  display: inline-flex;
}

.qtb-ra-chip.song-song {
  background: var(--surface-2);
  color: var(--text-secondary);
  border-style: dashed;
}

.qtb-tool.bat {
  color: var(--primary);
}

.qtb-step.rev .qtb-who {
  align-self: flex-end;
}

.qtb-tools {
  gap: 4px;
  margin-top: 4px;
  display: flex;
}

.qtb-step.rev .qtb-tools {
  justify-content: flex-end;
}

.qtb-tool {
  border: 1px solid var(--border);
  background: var(--surface-2);
  width: 30px;
  height: 30px;
  color: var(--text-secondary);
  border-radius: 50%;
  place-items: center;
  display: grid;
}

.qtb-tool:disabled {
  opacity: .35;
  cursor: not-allowed;
}

.qtb-tool.xoa {
  color: var(--red);
}

.qtb-keo {
  cursor: grab;
}

.qtb-add {
  border: 1.5px dashed var(--primary);
  color: var(--primary);
  font-weight: var(--fw-semibold);
  background: none;
  border-radius: 24px;
  align-self: center;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  display: inline-flex;
}

.qtb-icon-grid {
  flex-wrap: wrap;
  gap: 6px;
  display: flex;
}

.qtb-icon-pick {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  width: 40px;
  height: 40px;
  color: var(--text-secondary);
  place-items: center;
  display: grid;
}

.qtb-icon-pick[aria-pressed="true"] {
  border-color: var(--primary);
  background: var(--tint-primary-soft);
  color: var(--primary);
}

@media (max-width: 860px) {
  .qtb {
    padding: var(--sp-3) var(--screen-px, 14px);
    grid-template-columns: minmax(0, 1fr);
  }

  .qtb-list {
    position: static;
  }

  .qtb-detail {
    padding: var(--sp-3);
  }

  .qtb-step, .qtb-step.rev {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 12px;
  }

  .qtb-step.rev .qtb-side, .qtb-step.rev .qtb-card {
    order: 0;
  }

  .qtb-side, .qtb-step.rev .qtb-side {
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    min-height: 0;
    padding: 0;
  }

  .qtb-num, .qtb-step.rev .qtb-num {
    width: auto;
    height: auto;
    font-size: var(--fs-base);
    border-radius: 12px;
    justify-content: center;
    padding: 2px 10px;
    position: static;
  }

  .qtb-ring {
    width: 62px;
    height: 62px;
  }

  .qtb-ring:before {
    border-width: 3px;
    inset: -4px;
  }

  .qtb-ring-in {
    width: 44px;
    height: 44px;
  }

  .qtb-ring-in svg {
    width: 24px !important;
    height: 24px !important;
  }

  .qtb-card, .qtb-step.rev .qtb-card {
    text-align: left;
    padding: 14px 16px 14px 22px;
  }

  .qtb-step.rev .qtb-card:before {
    left: -7px;
    right: auto;
  }

  .qtb-step.rev .qtb-card:after {
    left: 12px;
    right: 30%;
  }

  .qtb-step.rev .qtb-who {
    align-self: flex-start;
  }

  .qtb-step.rev .qtb-tools {
    justify-content: flex-start;
  }

  .qtb-keo {
    display: none;
  }
}

.chat-rieng {
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  display: flex;
}

.chat-sys-the {
  align-self: center;
  width: min(620px, 92%);
}

.chat-can-kiem {
  border: 1px solid var(--tint-orange-border);
  background: var(--tint-orange);
  font-size: var(--fs-xs);
  color: var(--text-secondary);
  overflow-wrap: anywhere;
  border-radius: 8px;
  align-items: flex-start;
  gap: 6px;
  margin-top: 7px;
  padding: 6px 9px;
  display: flex;
}

.chat-can-kiem svg {
  flex: none;
  margin-top: 1px;
}

.chat-the-hanh-dong {
  border: 1px solid var(--tint-primary-border);
  background: var(--tint-primary-soft);
  font-size: var(--fs-xs);
  border-radius: 10px;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  margin-top: 8px;
  padding: 9px 12px;
  display: flex;
}

.chat-the-hanh-dong .the-dong {
  overflow-wrap: anywhere;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
  display: flex;
}

.chat-the-hanh-dong .the-nut {
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  display: flex;
}

.chat-the-hanh-dong code {
  font-size: var(--fs-2xs);
}

.chat-the-hanh-dong.gon {
  background: none;
  border: none;
  margin-top: 0;
  padding: 0;
}

.chat-the-hanh-dong.gon .the-nut {
  margin-top: 0;
}

.table-scroll .chat-the-hanh-dong.gon .the-nut {
  flex-wrap: nowrap;
}

@media (min-width: 601px) {
  .chat-ai-shell .chat-search-box {
    flex: 0 240px;
    min-width: 0;
  }
}

.lich-cong-thang {
  margin-bottom: var(--sp-3);
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  display: flex;
}

.lich-cong-thang .nhan-thang {
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  text-align: center;
  min-width: 140px;
}

.lich-cong-thang .ghi {
  font-size: var(--fs-xs);
  color: var(--text-tertiary);
  margin-left: auto;
}

.lich-cong-chu-thich {
  font-size: var(--fs-xs);
  color: var(--text-secondary);
  margin-bottom: var(--sp-3);
  flex-wrap: wrap;
  gap: 6px 14px;
  display: flex;
}

.lich-cong-chu-thich span {
  align-items: center;
  gap: 6px;
  display: inline-flex;
}

.lich-cong-chu-thich i {
  border: 1px solid var(--border);
  border-radius: 4px;
  width: 13px;
  height: 13px;
  display: inline-block;
}

.lich-cong {
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  display: grid;
}

.lich-cong .thu {
  font-size: var(--fs-xs);
  color: var(--text-tertiary);
  text-align: center;
  font-weight: var(--fw-semibold);
  padding: 2px 0;
}

.lich-o {
  border: 1px solid var(--border-soft);
  background: var(--surface);
  text-align: left;
  min-height: 88px;
  font: inherit;
  color: var(--text-primary);
  cursor: pointer;
  border-radius: 8px;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 6px 7px;
  display: flex;
  position: relative;
}

.lich-o:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

.lich-o.trong-luoi {
  visibility: hidden;
  cursor: default;
}

.lich-o .so-ngay {
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  color: var(--text-secondary);
}

.lich-o .gia-tri {
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  line-height: 1.15;
}

.lich-o .phu {
  font-size: var(--fs-2xs);
  color: var(--text-secondary);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.lich-o .tc {
  font-size: var(--fs-2xs);
  font-weight: var(--fw-bold);
  color: var(--primary);
  position: absolute;
  top: 6px;
  right: 7px;
}

.lich-o .nut-bs {
  font-size: var(--fs-2xs);
  font-weight: var(--fw-semibold);
  background: var(--red);
  color: #fff;
  border-radius: 999px;
  align-self: flex-start;
  margin-top: auto;
  padding: 1px 8px;
}

.lich-o.DU {
  background: var(--tint-green);
  border-color: var(--ok-border);
}

.lich-o.DU .gia-tri {
  color: var(--green);
}

.lich-o.THIEU {
  background: var(--tint-red);
  border-color: var(--tint-red-border);
}

.lich-o.THIEU .gia-tri, .lich-o.THIEU .phu {
  color: var(--red);
}

.lich-o.CHO_DUYET {
  background: var(--tint-orange);
  border: 1px dashed var(--orange);
}

.lich-o.CHO_DUYET .gia-tri, .lich-o.CHO_DUYET .phu {
  color: var(--orange);
}

.lich-o.PHEP {
  background: var(--tint-blue);
  border-color: var(--tint-blue-border);
}

.lich-o.PHEP .gia-tri {
  color: var(--blue);
  font-size: var(--fs-md);
}

.lich-o.LE, .lich-o.NGHI {
  background: var(--tint-gray);
  border-color: #0000;
}

.lich-o.LE .gia-tri, .lich-o.NGHI .gia-tri {
  color: var(--text-tertiary);
  font-size: var(--fs-sm);
}

.lich-o.KHOAN {
  background: var(--tint-primary-soft);
  border-color: var(--tint-primary-border);
}

.lich-o.KHOAN .gia-tri {
  color: var(--primary);
  font-size: var(--fs-md);
}

.lich-o.TUONG_LAI {
  opacity: .4;
}

.lich-o.dang-chon {
  box-shadow: 0 0 0 2px var(--primary);
}

.lich-cong-chi-tiet .dong-nguon {
  background: var(--surface-2);
  font-size: var(--fs-sm);
  border-radius: 6px;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  padding: 6px 8px;
  display: flex;
}

@media (max-width: 860px) {
  .lich-cong {
    gap: 3px;
  }

  .lich-o {
    justify-content: center;
    align-items: center;
    min-height: 48px;
    padding: 3px;
  }

  .lich-o .so-ngay {
    font-size: var(--fs-2xs);
    position: absolute;
    top: 2px;
    left: 4px;
  }

  .lich-o .gia-tri {
    font-size: var(--fs-sm);
    margin-top: 8px;
  }

  .lich-o .phu, .lich-o .tc, .lich-o .nut-bs {
    display: none;
  }

  .lich-cong-thang .ghi {
    flex-basis: 100%;
    margin-left: 0;
  }
}

.modal-overlay.add-enum-overlay {
  z-index: 155;
}

.col-chooser-pop.tren-modal {
  z-index: 75;
}

tr.tong-nhom-row > td {
  font-weight: var(--fw-bold);
  background: var(--tint-primary-soft);
  border-top: 1px solid var(--tint-primary-border);
}

tr.tong-nhom-row > td .cell-sub {
  font-weight: var(--fw-medium);
}

.nv-chi-tiet {
  grid-template-columns: 220px minmax(0, 1fr);
  align-items: start;
  gap: 20px;
  display: grid;
}

.nv-menu {
  border-right: 1px solid var(--border-soft);
  flex-direction: column;
  gap: 2px;
  padding-right: 12px;
  display: flex;
  position: sticky;
  top: 12px;
}

.nv-menu-nhom {
  font-size: var(--fs-2xs);
  font-weight: var(--fw-bold);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin: 12px 8px 4px;
}

.nv-menu-nhom:first-child {
  margin-top: 0;
}

.nv-menu-muc {
  width: 100%;
  color: var(--text-secondary);
  font: inherit;
  font-size: var(--fs-sm);
  text-align: left;
  cursor: pointer;
  background: none;
  border: none;
  border-radius: 8px;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 10px;
  display: flex;
}

.nv-menu-muc:hover {
  background: var(--tint-gray);
  color: var(--text-primary);
}

.nv-menu-muc[aria-current="page"] {
  background: var(--tint-primary);
  color: var(--text-primary);
  font-weight: var(--fw-semibold);
}

.nv-menu-muc:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

.nv-dau {
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  display: flex;
}

.nv-avatar {
  background: var(--tint-primary-soft);
  color: var(--primary);
  border-radius: 12px;
  flex: none;
  place-items: center;
  display: grid;
}

.nv-dau-nut {
  flex: 0 auto;
  justify-content: flex-end;
  margin: 0;
  padding: 0;
}

.nv-the-luoi {
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 12px;
  display: grid;
}

.nv-the .view-row {
  grid-template-columns: minmax(120px, 38%) 1fr;
}

.nv-the {
  padding: 14px 16px;
}

.nv-the h3 {
  font-size: var(--fs-md);
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  display: flex;
}

.nv-the h3 .spacer {
  flex: 1;
}

.nv-chip-ds {
  flex-wrap: wrap;
  gap: 6px;
  display: flex;
}

.nv-chip {
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  font-size: var(--fs-xs);
  border-radius: 999px;
  padding: 3px 10px;
}

button.nav-item.nv-ghim-task-moi {
  cursor: pointer;
  width: 100%;
  font: inherit;
  text-align: left;
  color: var(--text-secondary);
  background: none;
  border: none;
}

button.nav-item.nv-ghim-task-moi:hover {
  background: var(--hover-bg);
  color: var(--text-primary);
}

.nav-item.nv-ghim-nhom {
  cursor: default;
}

.nav-item.nv-ghim-nhom:hover {
  color: var(--text-secondary);
  background: none;
}

.modal-card.task-moi {
  max-width: 640px;
}

.task-moi-o {
  resize: vertical;
  width: 100%;
  min-height: 140px;
  font-size: var(--fs-md);
  line-height: var(--lh-comfortable);
}

.modal-foot.task-moi-chan {
  align-items: center;
}

.modal-foot.task-moi-chan .spacer {
  flex: 1;
}

.task-dau {
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  display: flex;
}

.task-trang {
  grid-template-columns: minmax(0, 1fr) 320px;
  align-items: start;
  gap: 16px;
  display: grid;
}

.task-luong {
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  max-width: 820px;
  display: flex;
}

.task-muc {
  flex-direction: column;
  gap: 4px;
  display: flex;
}

.task-muc-dau {
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  display: flex;
}

.task-bong {
  border: 1px solid var(--border-soft);
  background: var(--surface);
  overflow-wrap: anywhere;
  border-radius: 10px;
  padding: 10px 14px;
}

.task-muc.nguoi .task-bong {
  background: var(--tint-primary-soft);
  border-color: var(--tint-primary-border);
}

.task-su-kien {
  border-left: 2px solid var(--border-soft);
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  margin: 0;
  padding-left: 12px;
}

.task-su-kien.loi {
  border-left-color: var(--red);
}

.task-dang-lam {
  align-items: center;
  gap: 6px;
  display: flex;
}

.task-tra-loi, .task-the-duyet {
  border: 1px solid var(--border-soft);
  background: var(--surface);
  border-radius: 10px;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  display: flex;
}

.task-the-duyet {
  border-color: var(--tint-primary-border);
}

.task-tra-loi textarea, .task-the-duyet textarea {
  resize: vertical;
  width: 100%;
}

.task-tra-loi-chan {
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  display: flex;
}

.task-tra-loi-chan .spacer {
  flex: 1;
}

.task-thuoc-tinh {
  border: 1px solid var(--border-soft);
  background: var(--surface);
  border-radius: 10px;
  max-height: calc(100vh - 24px);
  padding: 12px 14px;
  position: sticky;
  top: 12px;
  overflow-y: auto;
}

.task-tt-dau {
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
  display: flex;
}

.task-tt-nhom {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin: 12px 0 4px;
}

.task-tt .view-row {
  grid-template-columns: minmax(96px, 36%) minmax(0, 1fr);
}

.task-tt .view-row .vvalue {
  min-width: 0;
}

.task-tt .filter-select, .task-tt .view-row select, .task-tt .view-row input {
  min-width: 0;
  max-width: 100%;
}

.task-the {
  border: 1px solid var(--border-soft);
  background: var(--surface);
  border-radius: 10px;
  flex-direction: column;
  gap: 8px;
  padding: 10px 14px;
  display: flex;
}

.task-the.cho {
  border-color: var(--tint-primary-border);
  box-shadow: inset 3px 0 0 var(--primary);
}

.task-the textarea {
  resize: vertical;
  width: 100%;
}

.task-the-cau {
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding-left: 20px;
  display: flex;
}

.task-the-cau textarea {
  margin-top: 4px;
}

.task-the-lua-chon {
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
  display: flex;
}

.qd-nhom {
  flex-direction: column;
  gap: 10px;
  max-width: 900px;
  margin: 16px 0;
  display: flex;
}

.qd-nhom-ten {
  font-size: var(--fs-md);
  align-items: baseline;
  gap: 8px;
  margin: 0;
  display: flex;
}

.qd-the {
  border: 1px solid var(--border-soft);
  background: var(--surface);
  border-radius: 10px;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  display: flex;
}

.qd-the textarea {
  resize: vertical;
  width: 100%;
}

.qd-the > .task-the {
  box-shadow: none;
  border: none;
  padding: 0;
}

.qd-trich {
  max-height: 220px;
  overflow-y: auto;
}

.qd-chan {
  border-top: 1px solid var(--border-soft);
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-top: 8px;
  display: flex;
}

.qd-chan .spacer {
  flex: 1;
}

.task-canh-form {
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  display: flex;
}

.task-canh-form label {
  flex-direction: column;
  gap: 2px;
  display: flex;
}

.task-canh-form textarea, .task-canh-form input {
  width: 100%;
}

.task-tep {
  border: 1px dashed var(--border-soft);
  border-radius: 10px;
  flex-direction: column;
  gap: 8px;
  padding: 10px 14px;
  display: flex;
}

.task-tep-ds {
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
}

.task-tep-ds li {
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  display: flex;
}

.kq-nhom {
  margin: 16px 0;
}

.kq-luoi {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
  display: grid;
}

.kq-the {
  border: 1px solid var(--border-soft);
  background: var(--surface);
  border-radius: 10px;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  display: flex;
}

.kq-trich {
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  margin: 0;
  display: -webkit-box;
  overflow: hidden;
}

.bd-o-so {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
  display: grid;
}

.bd-o {
  color: inherit;
  flex-direction: column;
  gap: 2px;
  padding: 14px 16px;
  text-decoration: none;
  display: flex;
}

.bd-o b {
  font-size: var(--fs-xl);
}

.bd-o:hover {
  border-color: var(--tint-primary-border);
}

.bd-chu-giai {
  font-size: var(--fs-xs);
  color: var(--text-secondary);
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 6px;
  display: flex;
}

.bd-chu-giai i {
  vertical-align: -1px;
  border-radius: 2px;
  width: 10px;
  height: 10px;
  margin-right: 4px;
  display: inline-block;
}

.bd-cot-khung {
  border-bottom: 1px solid var(--border-soft);
  align-items: flex-end;
  gap: 4px;
  height: 140px;
  padding-top: 4px;
  display: flex;
}

.bd-cot {
  flex-direction: column;
  flex: 1;
  justify-content: flex-end;
  align-items: stretch;
  min-width: 0;
  height: 100%;
  display: flex;
  position: relative;
}

.bd-cot-chong {
  border-radius: 4px 4px 0 0;
  flex-direction: column-reverse;
  gap: 2px;
  min-height: 0;
  display: flex;
  overflow: hidden;
}

.bd-cot-chong span {
  min-height: 2px;
  display: block;
}

.bd-cot-nhan {
  font-size: var(--fs-2xs);
  color: var(--text-tertiary);
  white-space: nowrap;
  position: absolute;
  bottom: -18px;
  left: 50%;
  transform: translateX(-50%);
}

.bd-cot:nth-child(odd) .bd-cot-nhan {
  visibility: hidden;
}

.bd-bieu-do details {
  margin-top: 24px;
}

.bd-dong {
  border-bottom: 1px solid var(--border-soft);
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  display: flex;
}

.task-chua-doc {
  background: var(--primary);
  border-radius: 50%;
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  margin-left: 4px;
  display: inline-block;
}

tr.task-dong-moi td {
  font-weight: var(--fw-semibold);
}

.nv-chip.task-dang-quyet {
  border-color: var(--tint-primary-border);
  background: var(--tint-primary-soft);
}

.task-nut-thuoc-tinh, .task-nen-thuoc-tinh {
  display: none;
}

@media (max-width: 860px) {
  .task-trang {
    grid-template-columns: minmax(0, 1fr);
  }

  .task-nut-thuoc-tinh {
    display: inline-flex;
  }

  .task-nen-thuoc-tinh {
    display: block;
  }

  .task-thuoc-tinh {
    z-index: 55;
    border-radius: 0;
    width: min(360px, 92vw);
    max-height: none;
    display: none;
    position: fixed;
    inset: 0 0 0 auto;
  }

  .task-thuoc-tinh.mo {
    display: block;
  }

  .nv-chi-tiet {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .nv-menu {
    border-right: none;
    border-bottom: 1px solid var(--border-soft);
    flex-direction: row;
    padding: 0 0 6px;
    position: static;
    overflow-x: auto;
  }

  .nv-menu-nhom {
    display: none;
  }

  .nv-menu-muc {
    white-space: nowrap;
    flex: none;
    width: auto;
    min-height: 44px;
  }

  .nv-the-luoi {
    grid-template-columns: minmax(0, 1fr);
  }
}

.sk-chu {
  font-weight: var(--fw-bold);
  color: var(--text-primary);
  border-radius: 10px;
  flex: none;
  place-items: center;
  display: grid;
}

.sk-trang {
  grid-template-columns: minmax(0, 1fr) 300px;
  align-items: start;
  gap: 16px;
  display: grid;
}

.sk-rail {
  flex-direction: column;
  gap: 12px;
  display: flex;
  position: sticky;
  top: 12px;
}

.sk-rail .nv-the h3 {
  font-size: var(--fs-sm);
}

.sk-mo-ta {
  max-width: 820px;
  color: var(--text-secondary);
  margin: 0;
}

.sk-mo-ta.gon {
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  display: -webkit-box;
  overflow: hidden;
}

.sk-avatar-ds {
  align-items: center;
  display: flex;
}

.sk-avatar-ds .nv-avatar {
  border: 2px solid var(--surface);
  width: 30px;
  height: 30px;
  margin-left: -6px;
}

.sk-avatar-ds .nv-avatar:first-child {
  margin-left: 0;
}

.sk-tep {
  grid-template-columns: 230px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  display: grid;
}

.sk-cay {
  border: 1px solid var(--border-soft);
  background: var(--surface);
  border-radius: 10px;
  flex-direction: column;
  gap: 1px;
  padding: 6px;
  display: flex;
}

.sk-cay-thu-muc {
  font-size: var(--fs-2xs);
  font-weight: var(--fw-semibold);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 6px 8px 2px;
}

.sk-cay-tep {
  color: var(--text-secondary);
  text-align: left;
  cursor: pointer;
  font-size: var(--fs-sm);
  background: none;
  border: none;
  border-radius: 6px;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 6px 8px;
  display: flex;
}

.sk-cay-tep span {
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

.sk-cay-tep:hover {
  background: var(--tint-gray);
  color: var(--text-primary);
}

.sk-cay-tep[aria-current="true"] {
  background: var(--tint-primary);
  color: var(--text-primary);
  font-weight: var(--fw-semibold);
}

.sk-cay-chon {
  display: none;
}

.sk-noi-dung {
  border: 1px solid var(--border-soft);
  background: var(--surface);
  border-radius: 10px;
  min-width: 0;
}

.sk-noi-dung-dau {
  border-bottom: 1px solid var(--border-soft);
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  display: flex;
}

.sk-noi-dung-dau .spacer {
  flex: 1;
}

.sk-noi-dung-than {
  overflow-wrap: anywhere;
  padding: 12px 16px;
}

.sk-ma {
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  margin: 0;
  line-height: 1.55;
}

.sk-soan {
  resize: vertical;
  width: 100%;
  min-height: 420px;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  line-height: 1.55;
}

.sk-chua-luu {
  z-index: 4;
  border: 1px solid var(--tint-primary-border);
  background: var(--surface);
  border-radius: 10px;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 12px;
  display: flex;
  position: sticky;
  bottom: 0;
  box-shadow: 0 -4px 14px #00000014;
}

.sk-chua-luu input {
  flex: 220px;
  min-width: 0;
}

.sk-diff {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  line-height: var(--lh-comfortable);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  max-height: 560px;
  overflow: auto;
}

.sk-diff-dong {
  white-space: pre-wrap;
  word-break: break-word;
  grid-template-columns: 42px 42px 16px minmax(0, 1fr);
  display: grid;
}

.sk-diff-dong > span:not(:last-child) {
  color: var(--text-tertiary);
  text-align: right;
  -webkit-user-select: none;
  user-select: none;
  padding-right: 6px;
}

.sk-diff-dong.them {
  background: var(--tint-green);
}

.sk-diff-dong.bot {
  background: var(--tint-red);
}

.sk-diff-gon {
  color: var(--text-tertiary);
  background: var(--surface-2);
  padding: 2px 8px;
}

.studio {
  grid-template-columns: minmax(0, 1.25fr) minmax(0, .85fr) minmax(0, 1.25fr);
  align-items: start;
  gap: 12px;
  display: grid;
}

.studio-cot {
  border: 1px solid var(--border-soft);
  background: var(--surface);
  border-radius: 10px;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  display: flex;
}

.studio-cot > h3 {
  font-size: var(--fs-md);
  align-items: center;
  gap: 8px;
  margin: 0;
  display: flex;
}

.studio-cot > h3 .spacer {
  flex: 1;
}

.studio-cot textarea {
  resize: vertical;
  width: 100%;
}

.studio-tab {
  display: none;
}

.studio-luot {
  flex-direction: column;
  gap: 6px;
  max-height: 360px;
  display: flex;
  overflow-y: auto;
}

.studio-luot-dong {
  border: 1px solid var(--border-soft);
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  color: inherit;
  border-radius: 8px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px;
  display: grid;
}

.studio-luot-dong[aria-current="true"] {
  border-color: var(--tint-primary-border);
  background: var(--tint-primary-soft);
}

.studio-ket-qua {
  border-top: 1px solid var(--border-soft);
  overflow-wrap: anywhere;
  padding-top: 10px;
}

.studio-so-sanh {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  display: grid;
}

.studio-so-sanh > div {
  border: 1px solid var(--border-soft);
  overflow-wrap: anywhere;
  border-radius: 8px;
  min-width: 0;
  padding: 10px;
}

@media (max-width: 1280px) {
  .studio {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .studio > .studio-cot:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 860px) {
  .sk-trang {
    grid-template-columns: minmax(0, 1fr);
  }

  .sk-rail {
    position: static;
  }

  .sk-tep {
    grid-template-columns: minmax(0, 1fr);
  }

  .sk-cay {
    display: none;
  }

  .sk-cay-chon {
    width: 100%;
    display: block;
  }

  .sk-diff-dong {
    grid-template-columns: 30px 30px 14px minmax(0, 1fr);
  }

  .studio {
    grid-template-columns: minmax(0, 1fr);
  }

  .studio > .studio-cot:last-child {
    grid-column: auto;
  }

  .studio-tab {
    display: flex;
  }

  .studio > .studio-cot:not(.mo) {
    display: none;
  }

  .studio-so-sanh {
    grid-template-columns: minmax(0, 1fr);
  }
}

.chat-shell, .vp-workspace {
  margin-inline: var(--screen-px, 28px);
  min-width: 0;
}

.sodo-canvas {
  margin-inline: var(--screen-px, 28px);
  max-width: calc(100% - 2 * var(--screen-px, 28px));
}

.screen .chat-shell, .screen .vp-workspace, .screen .sodo-canvas {
  max-width: 100%;
  margin-inline: 0;
}

.screen .qtb {
  padding-inline: 0;
}

@media screen {
  .screen:has([data-table-viewport]) {
    padding-bottom: 12px;
  }

  .screen .screen:has([data-table-viewport]) {
    padding-bottom: 0;
  }

  .table-card[data-table-viewport] {
    height: var(--table-viewport-height, 65dvh);
    flex-direction: column;
    min-height: 220px;
    display: flex;
  }

  .table-card[data-table-viewport] > .table-scroll {
    overscroll-behavior: contain;
    flex: 1;
    min-height: 0;
    max-height: none;
  }

  .table-card[data-table-viewport] > .table-footer {
    background: var(--surface);
    flex-shrink: 0;
  }

  .table-card[data-table-viewport] > .table-scroll:has( > .empty-state) {
    flex-direction: column;
    display: flex;
  }

  .table-card[data-table-viewport] > .table-scroll:has( > .empty-state) > table {
    flex-shrink: 0;
  }

  .table-card[data-table-viewport] > .table-scroll > .empty-state {
    flex: 1;
    justify-content: center;
    align-items: center;
    min-height: 80px;
    padding: 24px 14px;
    display: flex;
    position: sticky;
    left: 0;
  }
}

[data-region="sidebar"] {
  height: 100dvh;
  overflow: hidden;
}

[data-region="sidebar"] > .brand {
  height: var(--app-header-height, 60px);
  min-height: var(--app-header-height, 60px);
  padding: 0 16px;
}

[data-region="sidebar"] > .sidebar-scroll {
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  display: flex;
  overflow: hidden auto;
}

[data-region="sidebar"].collapsed > .brand {
  gap: 2px;
  padding: 4px 8px;
}

[data-region="sidebar"].collapsed > .brand .brand-mark {
  width: 24px;
  height: 24px;
}

@media print {
  [data-region="sidebar"] {
    display: none !important;
  }
}

.sidebar-scroll > * {
  flex-shrink: 0;
}

/*# sourceMappingURL=src_app_globals_162hn9o.css.map*/