/* Super Chat — nền trắng, xanh dương; màu trạng thái luôn đi cùng chữ. */
:root {
  --bg: #fff;
  --canvas: #ffffff;
  --soft: #f1f4f8;
  --rail: #f7f9fc;
  --line: #dfe5ee;
  --text: #17243b;
  --muted: #526078;
  --brand: #075bd3;
  --brand-hover: #064aa9;
  --brand-text: #fff;
  --selected: #eaf3ff;
  --in: #f0f2f5;
  --out: #e1efff;
  --ok: #386448;
  --ok-bg: #eaf1e5;
  --warn: #856021;
  --warn-bg: #faf1d9;
  --danger: #ac3936;
  --danger-bg: #fbeceb;
  --control-line: #cbd5e3;
  --radius: 12px;
  --tap: 44px;
  --shadow: 0 12px 50px #142a4b24;
  --fs-xs: 12px;
  --fs-sm: 14px;
  --fs-base: 14px;
  --fs-input: 16px;
  --fs-title: 20px;
  --fs-display: 28px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  color-scheme: light;
}
:root[data-theme='dark'] {
  --bg: #181d25;
  --canvas: #11151c;
  --soft: #242c39;
  --rail: #151a23;
  --line: #354052;
  --text: #ecf1fa;
  --muted: #adb9cc;
  --brand: #8dbbff;
  --brand-hover: #b1d1ff;
  --brand-text: #101d31;
  --selected: #1c304e;
  --in: #242c39;
  --out: #193a61;
  --ok: #b2d3ac;
  --ok-bg: #2b402d;
  --warn: #eed19c;
  --warn-bg: #493c22;
  --danger: #f3aaa3;
  --danger-bg: #4a2a29;
  --control-line: #48566a;
  --shadow: 0 12px 50px #0006;
  color-scheme: dark;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
}
body {
  font:
    var(--fs-base)/1.6 -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
  color: var(--text);
  background: var(--canvas);
  overflow: hidden;
  -webkit-text-size-adjust: 100%;
  font-variant-numeric: tabular-nums;
  text-wrap: pretty;
}
[hidden] {
  display: none !important;
}
button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button {
  min-width: 44px;
  min-height: 44px;
  border: 0;
  background: var(--soft);
  border-radius: 8px;
  padding: 9px 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition:
    background 0.15s,
    color 0.15s;
}
button:hover {
  background: var(--line);
}
button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
}
a {
  color: var(--brand);
  text-decoration: none;
}
input,
textarea,
select {
  min-height: 44px;
  font-size: 16px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 12px;
  width: 100%;
}
input::placeholder,
textarea::placeholder {
  color: var(--muted);
}
input:focus,
textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 10%, transparent);
}
input[type='checkbox'],
input[type='radio'] {
  width: 20px;
  height: 20px;
  min-height: 20px;
  accent-color: var(--brand);
  flex: none;
}
input[type='search']::-webkit-search-cancel-button {
  cursor: pointer;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1,
h2,
h3 {
  font-weight: 600;
  line-height: 1.5;
}
h1 {
  font-size: var(--fs-display);
  letter-spacing: -1px;
}
h2 {
  font-size: var(--fs-title);
  letter-spacing: -0.4px;
}
h3 {
  font-size: var(--fs-input);
}
.ico {
  width: 20px;
  height: 20px;
  flex: none;
  vertical-align: middle;
}
[data-icon] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.primary {
  background: var(--brand);
  color: var(--brand-text);
  font-weight: 550;
}
.primary:hover {
  background: var(--brand-hover);
}
.secondary {
  background: var(--bg);
  border: 1px solid var(--line);
}
.danger {
  color: var(--danger);
  background: var(--danger-bg);
}
.icon-btn {
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 10px;
  background: transparent;
  color: var(--muted);
}
.text-btn {
  background: transparent;
  color: var(--brand);
  padding: 8px;
}
.muted {
  color: var(--muted);
}
.grow {
  flex: 1;
  min-width: 0;
}
.err {
  color: var(--danger);
  background: var(--danger-bg);
  border-radius: 8px;
  padding: 10px 12px;
}
.eyebrow {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 1.65px;
  color: var(--muted);
}
.status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ok);
  flex: none;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 550;
  color: var(--warn);
  background: var(--warn-bg);
  padding: 2px 8px;
  border-radius: 5px;
  white-space: nowrap;
}
.badge.ok {
  color: var(--ok);
  background: var(--ok-bg);
}
.badge.error {
  color: var(--danger);
  background: var(--danger-bg);
}
.badge.neutral {
  color: var(--muted);
  background: var(--soft);
}
.badge .ico {
  width: 13px;
  height: 13px;
}
/* Khung làm việc */
.app {
  display: flex;
  height: var(--app-h, 100dvh);
  padding-top: env(safe-area-inset-top);
}
.nav-rail {
  width: 80px;
  flex: none;
  border-right: 1px solid var(--line);
  background: var(--rail);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 10px 20px;
  padding-bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 3;
}
.rail-logo {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: var(--brand-text);
  background: var(--brand);
  border-radius: 14px;
}
.rail-logo .ico {
  width: 27px;
  height: 27px;
}
.nav-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  margin-top: 38px;
}
.nav-item {
  position: relative;
  flex-direction: column;
  background: transparent;
  gap: 3px;
  border-radius: 10px;
  min-height: 58px;
  padding: 8px 3px;
  color: var(--muted);
}
.nav-item .ico {
  width: 21px;
  height: 21px;
}
.nav-label {
  font-size: 12px;
  white-space: nowrap;
}
.nav-item.active {
  background: var(--selected);
  color: var(--brand);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: -10px;
  height: 25px;
  width: 3px;
  background: var(--brand);
  border-radius: 0 3px 3px 0;
}
.rail-count {
  position: absolute;
  right: 3px;
  top: 1px;
  font-size: 12px;
  background: var(--warn-bg);
  color: var(--warn);
  border: 2px solid var(--rail);
  border-radius: 10px;
  padding: 0 5px;
}
.rail-bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.rail-bottom .nav-item {
  min-height: 44px;
}
.account-avatar {
  border-radius: 50%;
  background: var(--selected);
  color: var(--brand);
  width: 36px;
  min-height: 44px;
  font-size: 14px;
  padding: 0;
  border: 4px solid var(--rail);
  box-shadow: 0 0 0 1px var(--line);
}
.workspace {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.workspace-bar {
  height: 85px;
  flex: none;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 28px;
}
.workspace-identity {
  display: flex;
  align-items: center;
  gap: 12px;
}
.workspace-identity strong {
  font-size: 16px;
  font-weight: 600;
}
.workspace-caption {
  display: block;
  font-size: 12px;
  letter-spacing: 1.4px;
  color: var(--muted);
  margin-top: 2px;
}
.workspace-emblem {
  background: var(--selected);
  color: var(--brand);
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border-radius: 18px;
}
.workspace-emblem .ico {
  width: 30px;
  height: 30px;
}
.workspace-emblem.small {
  width: 38px;
  height: 38px;
  border-radius: 11px;
}
.workspace-emblem.small .ico {
  width: 23px;
  height: 23px;
}
.workspace-divider {
  height: 26px;
  width: 1px;
  background: var(--line);
  margin: 0 7px;
}
.workspace-plan {
  font-size: 12px;
  color: var(--muted);
}
.workspace-right {
  display: flex;
  align-items: center;
  gap: 20px;
}
.connection-btn {
  background: transparent;
  color: var(--ok);
  font-size: 12px;
  padding: 8px 0;
  gap: 7px;
}
.connection-btn .ico {
  width: 14px;
  height: 14px;
}
.connection-btn.warn {
  color: var(--warn);
}
.connection-btn.error {
  color: var(--danger);
}
.connection-btn.error .status-dot {
  background: var(--danger);
}
.connection-btn.warn .status-dot {
  background: var(--warn);
}
.today {
  color: var(--muted);
  font-size: 12px;
  border-left: 1px solid var(--line);
  padding-left: 20px;
}
.demo-badge {
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 3px 7px;
  border-radius: 4px;
}
.inbox-layout {
  flex: 1;
  min-height: 0;
  display: flex;
}
.list {
  width: 365px;
  flex: none;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--line);
  background: var(--bg);
}
.list-heading {
  padding: 25px 22px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.list-heading h1 {
  font-size: 28px;
  margin-top: 3px;
  letter-spacing: -0.7px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.heading-count {
  font-size: 12px;
  background: var(--warn-bg);
  color: var(--warn);
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  letter-spacing: 0;
}
.list-heading .eyebrow {
  font-size: 12px;
  letter-spacing: 1.6px;
}
.list-heading > .icon-btn {
  margin-right: -9px;
}
.search-field {
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  margin: 0 22px 14px;
  padding: 0 11px;
  background: var(--soft);
  color: var(--muted);
  height: 45px;
}
.search-field .ico {
  width: 17px;
  height: 17px;
}
.search-field input {
  border: none;
  box-shadow: none;
  background: transparent;
  padding: 10px 0;
  width: 100%;
  min-width: 0;
  font-size: 16px;
}
.search-field kbd {
  font: 11px/1.5 inherit;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0 5px;
}
.filters {
  display: flex;
  gap: 4px;
  margin: 0 22px 15px;
  border-bottom: 1px solid var(--line);
}
.filters button {
  min-width: 44px;
  min-height: 44px;
  font-size: 12px;
  padding: 8px 9px;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  white-space: nowrap;
  position: relative;
}
.filters button:first-child {
  padding-left: 2px;
  padding-right: 10px;
}
.filters button.on {
  color: var(--brand);
  font-weight: 650;
}
.filters button.on::after {
  content: '';
  height: 2px;
  background: var(--brand);
  position: absolute;
  bottom: -1px;
  left: 8px;
  right: 8px;
}
.filters button:first-child.on::after {
  left: 0;
}
.filters button span {
  font-size: 12px;
  color: var(--warn);
  background: var(--warn-bg);
  border-radius: 4px;
  padding: 0 4px;
}
.list-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px 10px;
  min-height: 36px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 1px;
}
.channel-select select {
  width: auto;
  max-width: 135px;
  padding: 0 20px 0 4px;
  font-size: 12px;
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--muted);
}
.convs {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  list-style: none;
  margin: 0;
  padding: 0 10px 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.conv {
  width: 100%;
  display: flex;
  gap: 11px;
  align-items: flex-start;
  text-align: left;
  border-radius: 10px;
  padding: 16px 12px;
  background: transparent;
  position: relative;
  min-height: 104px;
}
.conv:hover {
  background: var(--soft);
}
.conv.on {
  background: var(--selected);
}
.conv.on::before {
  content: '';
  position: absolute;
  left: 0;
  top: 22px;
  bottom: 22px;
  width: 3px;
  border-radius: 3px;
  background: var(--brand);
}
.avatar-wrap {
  position: relative;
  flex: none;
}
.avatar {
  width: 43px;
  height: 43px;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 550;
  color: #34557f;
  background: #e5efff;
  letter-spacing: 0.2px;
}
.avatar.tone-1 {
  background: #fbe6ec;
  color: #863c59;
}
.avatar.tone-2 {
  background: #eee8ff;
  color: #634599;
}
.avatar.tone-3 {
  background: #e7eef7;
  color: #405575;
}
.avatar.tone-4 {
  background: #fff0d9;
  color: #775326;
}
.avatar.tone-5 {
  background: #dff4fb;
  color: #2e6076;
}
.avatar-platform {
  position: absolute;
  right: -3px;
  bottom: -2px;
  width: 18px;
  height: 18px;
  border: 2px solid var(--bg);
  border-radius: 5px;
  background: #075bd3;
  color: #fff;
  font-size: 12px;
  display: grid;
  place-items: center;
  font-weight: 650;
}
.avatar-platform.fb {
  background: #1959b8;
}
.avatar-platform.tiktok {
  background: #202735;
}
.line {
  display: flex;
  gap: 7px;
  align-items: center;
  min-width: 0;
}
.name {
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.time {
  font-size: 12px;
  color: var(--muted);
  flex: none;
}
.last {
  display: block;
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin: 3px 0 5px;
  font-weight: 400;
}
.conv.unanswered .last {
  color: var(--text);
}
.conv-bottom {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: space-between;
}
.ch-tag {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 4px;
}
.ch-tag .ico {
  width: 12px;
  height: 12px;
}
.conv .badge {
  font-size: 12px;
  padding: 1px 6px;
}
.conv .badge .ico {
  width: 10px;
  height: 10px;
}
.list-footer {
  min-height: 45px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--muted);
  padding: 10px 22px;
}
.list-footer > .ico {
  width: 12px;
  height: 12px;
  margin-left: auto;
}
/* Hội thoại: chỉ vùng tin được cuộn, ô soạn luôn ở đáy. */
.thread {
  flex: 1;
  min-width: 0;
  min-height: 0;
  position: relative;
  display: flex;
  background: var(--canvas);
}
.thread-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  min-height: 0;
}
.thread-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 17px 28px;
  min-height: 87px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.thread-header h2 {
  font-size: 16px;
  letter-spacing: 0;
}
.thread-header .avatar {
  width: 42px;
  height: 42px;
}
.thread-channel {
  color: var(--muted);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}
.thread-channel .platform-pill {
  font-size: 12px;
  color: var(--brand);
  background: var(--selected);
  border-radius: 4px;
  padding: 0 4px;
}
.thread-header .back {
  display: none;
}
.conversation-done {
  align-self: flex-end;
  flex-shrink: 0;
  margin: 8px 16px 0;
}
.thread-notice {
  font-size: 12px;
  padding: 8px 28px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.thread-notice .ico {
  width: 13px;
  height: 13px;
}
.msgs {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 15px 32px 24px;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.older {
  display: flex;
  margin: 0 auto 8px;
  font-size: 12px;
  color: var(--muted);
}
.date-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-size: 12px;
  color: var(--muted);
  padding: 8px 0 17px;
}
.date-divider::before,
.date-divider::after {
  content: '';
  height: 1px;
  background: var(--line);
  width: 60px;
}
.msg {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin: 0 0 16px;
  padding-left: 35px;
  position: relative;
}
.msg.out {
  align-items: flex-end;
  padding-left: 0;
  padding-right: 0;
}
.msg-avatar {
  position: absolute;
  left: 0;
  top: 2px;
}
.msg-avatar .avatar {
  width: 26px;
  height: 26px;
  font-size: 12px;
}
.bubble {
  max-width: min(85%, 540px);
  border: 1px solid var(--line);
  background: var(--in);
  border-radius: 0 13px 13px 13px;
  padding: 11px 15px;
  font-size: 14px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.msg.out .bubble {
  background: var(--out);
  border-color: transparent;
  border-radius: 13px 0 13px 13px;
}
.bubble p {
  white-space: pre-wrap;
}
.meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
  display: flex;
  gap: 5px;
  align-items: center;
}
.meta .ico {
  width: 13px;
  height: 13px;
}
.st-sent {
  color: var(--ok);
}
.st-sending {
  color: var(--muted);
}
.st-failed {
  color: var(--danger);
  font-weight: 600;
}
.st-unknown {
  color: var(--warn);
  font-weight: 600;
}
.bubble.sending {
  opacity: 0.6;
}
.bubble.failed {
  border: 1px solid var(--danger);
}
.bubble.unknown {
  border: 1px solid var(--warn);
}
.send-note {
  max-width: 85%;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--warn-bg);
  color: var(--warn);
  font-size: 12px;
  margin-top: 6px;
}
.send-note.error {
  background: var(--danger-bg);
  color: var(--danger);
}
.retry {
  color: var(--danger);
  background: transparent;
  text-decoration: underline;
}
.group-author {
  font-size: 12px;
  font-weight: 600;
  color: var(--brand);
  margin-bottom: 4px;
}
.msg.grouped {
  margin-top: -13px;
}
.bubble.bare {
  background: none !important;
  border: 0;
  padding: 0;
}
.bubble img,
.bubble video {
  display: block;
  max-width: 100%;
  max-height: 300px;
  border-radius: 8px;
}
.bubble .sticker {
  width: 120px;
  height: 120px;
  object-fit: contain;
}
.media-button {
  padding: 0;
  background: transparent;
  min-height: 44px;
}
.unsupported {
  color: var(--muted);
  font-size: 14px;
  display: flex;
  gap: 7px;
  align-items: center;
}
.composer {
  padding: 0 27px 14px;
  padding-bottom: max(14px, env(safe-area-inset-bottom));
  background: var(--canvas);
  flex: none;
}
.composer-input {
  border: 1px solid var(--control-line);
  background: var(--bg);
  border-radius: 12px;
  padding: 6px 8px 7px;
  box-shadow: 0 3px 9px #142a4b08;
}
.composer-input:focus-within {
  border-color: var(--brand);
}
.composer textarea {
  border: 0;
  box-shadow: none;
  min-height: 50px;
  max-height: 140px;
  padding: 10px 7px;
  background: transparent;
  resize: none;
  display: block;
  line-height: 1.5;
}
.composer textarea:focus {
  box-shadow: none;
}
.composer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.compose-tools {
  display: flex;
  align-items: center;
  gap: 1px;
}
.compose-tools .icon-btn {
  width: 36px;
  min-width: 44px;
}
.composer-tip {
  font-size: 12px;
  color: var(--muted);
  margin-left: 6px;
}
.composer-actions .primary {
  min-height: 38px;
  height: 44px;
  font-size: 12px;
  padding: 8px 15px;
  border-radius: 7px;
}
.composer-actions .primary .ico {
  width: 15px;
  height: 15px;
}
.composer-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
  padding: 9px 1px 0;
}
.composer-foot > span:first-child {
  display: flex;
  align-items: center;
  gap: 5px;
}
.composer-foot .status-dot {
  width: 5px;
  height: 5px;
}
kbd {
  font: inherit;
}
.keyboard-tip kbd {
  color: var(--text);
}
.composer-disabled {
  padding: 20px;
  text-align: center;
  background: var(--soft);
  color: var(--muted);
  border-top: 1px solid var(--line);
}
.new-messages {
  position: absolute;
  bottom: 180px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--brand);
  color: var(--brand-text);
  box-shadow: var(--shadow);
  font-size: 12px;
  z-index: 2;
}
.thread-empty {
  margin: auto;
  padding: 32px;
  text-align: center;
}
.thread-empty h2 {
  font-size: 28px;
  margin: 10px 0;
}
.thread-empty p {
  color: var(--muted);
  font-size: 14px;
}
.empty-art {
  width: 140px;
  height: 130px;
  position: relative;
  margin: 0 auto 32px;
  display: grid;
  place-items: center;
  background: var(--selected);
  border-radius: 48% 52% 60% 40%;
}
.empty-art > .ico {
  width: 65px;
  height: 65px;
  color: var(--brand);
  stroke-width: 1;
}
.empty-leaf {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 47px;
  height: 47px;
  border-radius: 50%;
  color: var(--brand);
  background: var(--canvas);
  border: 6px solid var(--canvas);
}
.empty-secure {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 40px;
  color: var(--muted);
  font-size: 12px;
}
.empty-secure .ico {
  width: 13px;
  height: 13px;
}
.empty {
  padding: 32px 20px;
  text-align: center;
  flex: 1;
  color: var(--muted);
}
.empty > .ico {
  width: 40px;
  height: 40px;
  margin-bottom: 12px;
  stroke-width: 1;
}
.empty h3 {
  margin-bottom: 8px;
  color: var(--text);
}
.empty p {
  font-size: 14px;
}
/* Informations, gestion et dialogues. */
.thread-info {
  width: 290px;
  flex: none;
  background: var(--bg);
  border-left: 1px solid var(--line);
  overflow-y: auto;
  padding: 20px;
}
.info-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}
.info-heading h3 {
  font-size: 14px;
}
.contact-profile {
  text-align: center;
  padding: 0 0 24px;
}
.contact-profile .avatar {
  width: 68px;
  height: 68px;
  font-size: 20px;
  margin: 0 auto 12px;
}
.contact-profile p {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}
.info-section {
  padding: 20px 0;
  border-top: 1px solid var(--line);
}
.info-section h3 {
  font-size: 14px;
  margin-bottom: 9px;
}
.info-section p {
  color: var(--muted);
  font-size: 12px;
  margin: 5px 0 10px;
}
.check-row {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
}
.check-row > span {
  flex: 1;
}
.toggle {
  appearance: none;
  width: 36px !important;
  height: 22px !important;
  border: 0;
  border-radius: 20px;
  padding: 3px;
  background: var(--line);
  cursor: pointer;
  position: relative;
}
.toggle::before {
  content: '';
  display: block;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.15s;
}
.toggle:checked {
  background: var(--brand);
}
.toggle:checked::before {
  transform: translateX(14px);
}
.toggle:disabled {
  opacity: 0.5;
}
.check-row:has(.toggle) {
  justify-content: space-between;
}
.small-note {
  font-size: 12px;
  color: var(--muted);
}
.info-save {
  width: 100%;
}
.management {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 36px 5%;
}
.page-intro {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 28px;
}
.page-intro h1 {
  font-size: 28px;
  margin: 3px 0;
}
.page-intro p {
  color: var(--muted);
  font-size: 14px;
}
.management-content {
  max-width: 1100px;
  margin: auto;
}
.preview-note {
  background: var(--warn-bg);
  color: var(--warn);
  padding: 10px 16px;
  border-radius: 9px;
  display: flex;
  gap: 9px;
  align-items: center;
  margin-bottom: 20px;
  font-size: 12px;
}
.channel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 18px;
}
.ch-card {
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 13px;
  padding: 22px;
}
.ch-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.platform-logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--selected);
  color: var(--brand);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
}
.platform-logo.facebook {
  color: var(--brand);
}
.platform-logo.tiktok {
  color: var(--text);
  background: var(--soft);
}
.ch-card p {
  font-size: 12px;
  color: var(--muted);
  margin: 9px 0;
}
.ch-card h3 {
  font-size: 16px;
}
.row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.row button {
  font-size: 12px;
}
.ch-card .row .danger {
  margin-left: auto;
}
.future-platforms {
  margin-top: 28px;
  border-top: 1px solid var(--line);
  padding-top: 22px;
  display: flex;
  gap: 12px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}
.future-platforms button {
  border: 1px dashed var(--line);
  background: transparent;
  opacity: 0.7;
}
.future-platforms .badge {
  font-size: 12px;
}
.qr {
  width: 240px;
  height: 240px;
  display: block;
  margin: 20px auto;
  image-rendering: pixelated;
}
.qr-instruction {
  text-align: center;
}
.qr-countdown {
  font-size: 12px;
  color: var(--warn);
  text-align: center;
}
.version {
  color: var(--muted);
  font-size: 12px;
  margin-top: 24px;
  text-align: center;
}
.staff-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.staff-row {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--bg);
  padding: 18px 22px;
}
.staff-row .grow p {
  font-size: 12px;
  color: var(--muted);
}
.staff-scope {
  width: 180px;
  font-size: 12px;
  color: var(--muted);
}
.staff-role {
  width: 110px;
}
.staff-row .row {
  margin: 0;
}
.staff-row .row button {
  padding: 8px;
}
.bot-card {
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 14px;
  padding: 24px;
  max-width: 650px;
}
.bot-card-header {
  display: flex;
  gap: 14px;
  align-items: center;
}
.bot-card h3 {
  font-size: 20px;
}
.bot-card .ico.bot-icon {
  width: 44px;
  height: 44px;
  padding: 10px;
  background: var(--selected);
  color: var(--brand);
  border-radius: 12px;
}
.bot-card p {
  color: var(--muted);
  margin: 8px 0 20px;
}
.bot-modes {
  display: flex;
  gap: 12px;
  margin: 15px 0;
}
.mode-card {
  flex: 1;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  cursor: pointer;
  display: flex;
  gap: 9px;
  align-items: flex-start;
}
.mode-card:has(:checked) {
  border-color: var(--brand);
  background: var(--selected);
}
.mode-card small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}
.bot-draft {
  margin: 0 27px 12px;
  padding: 15px;
  background: var(--selected);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 14px;
}
.bot-draft h3 {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--brand);
  margin-bottom: 8px;
}
.bot-draft .row {
  margin-top: 8px;
}
.sheet {
  width: min(660px, calc(100vw - 40px));
  max-height: 85dvh;
  padding: 28px;
  background: var(--canvas);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow-y: auto;
  box-shadow: var(--shadow);
}
.sheet::backdrop,
.image-dialog::backdrop {
  background: #14243b60;
  backdrop-filter: blur(3px);
}
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}
.dialog-head h2 {
  margin-top: 3px;
}
.dialog-head .icon-btn {
  margin-right: -9px;
}
.sheet .ch-card {
  margin-bottom: 12px;
}
.action-sheet {
  width: min(490px, calc(100vw - 32px));
}
.action-sheet label.field {
  display: grid;
  gap: 6px;
  margin: 17px 0;
  font-size: 14px;
  font-weight: 550;
}
.action-sheet > p {
  color: var(--muted);
  font-size: 14px;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 24px;
}
.action-sheet fieldset {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  margin: 15px 0;
}
.action-sheet legend {
  padding: 0 5px;
  font-size: 14px;
  font-weight: 600;
}
.password-once {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 20px 0;
}
.password-once code {
  font-size: 20px;
  letter-spacing: 1px;
}
.banner {
  background: var(--warn-bg);
  color: var(--warn);
  padding: 10px 15px;
  font-size: 12px;
}
.danger-banner {
  color: var(--danger);
  background: var(--danger-bg);
}
.banner button {
  padding: 0 5px;
  min-height: 44px;
  background: transparent;
  color: inherit;
  text-decoration: underline;
}
.toast {
  position: fixed;
  bottom: 185px;
  left: calc(50% + 120px);
  transform: translateX(-50%);
  max-width: 480px;
  width: max-content;
  background: var(--text);
  color: var(--bg);
  box-shadow: var(--shadow);
  border-radius: 10px;
  padding: 12px 18px;
  font-size: 14px;
  z-index: 30;
}
.account-menu {
  position: fixed;
  z-index: 5;
  bottom: 20px;
  left: 90px;
  width: 280px;
  background: var(--bg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 12px;
  border-radius: 13px;
}
.account-heading {
  padding: 8px 10px 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}
.account-heading span {
  display: block;
  font-size: 12px;
}
.account-menu button {
  display: flex;
  justify-content: flex-start;
  width: 100%;
  background: transparent;
  font-size: 14px;
}
.account-menu small {
  display: block;
  padding: 10px;
}
.appearance {
  padding: 8px 4px 12px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--line);
}
.appearance > span {
  display: block;
  margin: 0 6px 8px;
  font-size: 13px;
  font-weight: 600;
}
.theme-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.theme-options button {
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  text-align: left;
  line-height: 1.4;
}
.theme-options button:hover {
  background: var(--soft);
}
.theme-options button[aria-pressed='true'] {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--selected);
}
.theme-options small {
  padding: 0;
  color: var(--muted);
  font-size: 11px;
}
.theme-swatch {
  flex: none;
  width: 23px;
  height: 19px;
  border: 1px solid var(--control-line);
  border-radius: 5px;
  background: #ffffff;
  box-shadow: inset -8px 0 #e1efff;
}
.theme-swatch-dark {
  background: #11151c;
  box-shadow: inset -8px 0 #193a61;
}
.image-dialog {
  background: var(--bg);
  border: 0;
  padding: 12px;
  border-radius: 12px;
  max-width: 94vw;
  max-height: 90dvh;
}
.image-dialog img {
  display: block;
  max-width: 85vw;
  max-height: 78dvh;
  object-fit: contain;
}
.image-dialog .icon-btn {
  display: flex;
  margin-left: auto;
}
/* Connexion */
.login-page {
  height: var(--app-h, 100dvh);
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.login-story {
  background: var(--selected);
  color: var(--text);
  padding: 44px 9%;
  display: flex;
  flex-direction: column;
}
.brand {
  display: flex;
  align-items: center;
  color: var(--brand);
  font-size: 28px;
  font-weight: 650;
  letter-spacing: -1px;
}
.brand-mark {
  margin-right: 10px;
}
.brand-mark .ico {
  width: 30px;
  height: 30px;
}
.brand-period {
  color: var(--brand);
}
.login-story-copy {
  margin: auto 0;
  padding: 40px 0;
}
.login-story-copy h1 {
  font-size: 40px;
  line-height: 1.5;
  margin: 14px 0 20px;
  font-weight: 500;
  letter-spacing: -1.5px;
}
.login-story-copy p {
  font-size: 16px;
  max-width: 350px;
  color: var(--muted);
}
.story-illustration {
  margin: 45px 0 0;
  width: 160px;
  height: 130px;
  background: var(--bg);
  border-radius: 60% 35% 50% 45%;
}
.story-illustration .ico {
  width: 80px;
  height: 80px;
  stroke-width: 0.8;
  color: var(--brand);
}
.login-story > p {
  font-size: 12px;
}
.login-form {
  width: min(365px, calc(100% - 48px));
  margin: auto;
}
.login-form .workspace-emblem {
  margin-bottom: 24px;
}
.login-form h2 {
  font-size: 28px;
  margin: 8px 0;
}
.login-form > p.muted {
  font-size: 14px;
  margin-bottom: 28px;
}
.login-form > label {
  display: grid;
  gap: 7px;
  font-size: 14px;
  font-weight: 550;
  margin-bottom: 18px;
}
.login-form input {
  min-height: 49px;
}
.password-wrap {
  position: relative;
  display: block;
}
.password-wrap input {
  padding-right: 50px;
}
.password-wrap button {
  position: absolute;
  right: 3px;
  top: 3px;
}
.login-submit {
  width: 100%;
  margin-top: 8px;
  min-height: 48px;
  justify-content: space-between;
}
.login-help {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  margin-top: 19px;
}
.demo-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 32px;
  font-size: 12px;
  min-height: 44px;
}
.demo-link .ico {
  width: 14px;
  height: 14px;
}
.login-footer {
  display: block;
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--muted);
  text-align: center;
  margin-top: 38px;
}
@media (min-width: 1600px) {
  .list {
    width: 380px;
  }
  .msgs {
    padding-left: 55px;
    padding-right: 55px;
  }
  .composer {
    padding-left: 50px;
    padding-right: 50px;
  }
}
@media (max-width: 1200px) {
  .workspace-plan,
  .workspace-divider {
    display: none;
  }
  .workspace-right {
    gap: 12px;
  }
  .thread-info {
    position: absolute;
    right: 0;
    top: 85px;
    bottom: 0;
    z-index: 4;
    box-shadow: var(--shadow);
  }
  .composer-tip {
    display: none;
  }
  .staff-scope {
    width: 140px;
  }
  .workspace-bar {
    padding: 0 22px;
  }
  .thread-header {
    padding-left: 22px;
    padding-right: 22px;
  }
}
@media (max-width: 1000px) {
  .today {
    display: none;
  }
  .list {
    width: 340px;
  }
  .search-field,
  .filters {
    margin-left: 18px;
    margin-right: 18px;
  }
  .filters button {
    padding: 8px;
  }
  .workspace-caption {
    font-size: 12px;
  }
  .staff-row {
    flex-wrap: wrap;
  }
  .staff-scope {
    display: none;
  }
  .staff-row .row {
    margin-left: auto;
  }
  .keyboard-tip {
    display: none;
  }
}
@media (max-width: 767px) {
  .app {
    padding-top: env(safe-area-inset-top);
    padding-bottom: calc(65px + env(safe-area-inset-bottom));
  }
  .nav-rail {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: calc(65px + env(safe-area-inset-bottom));
    padding: 0 10px env(safe-area-inset-bottom);
    border-right: 0;
    border-top: 1px solid var(--line);
    background: var(--bg);
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .rail-logo,
  .rail-bottom #help {
    display: none;
  }
  .nav-links {
    flex-direction: row;
    gap: 4px;
    margin: 0;
    flex: 1;
  }
  .nav-item {
    flex: 1;
    min-height: 58px;
    padding: 5px;
    gap: 2px;
  }
  .nav-item.active {
    background: transparent;
  }
  .nav-item.active::before {
    display: none;
  }
  .nav-label {
    font-size: 12px;
  }
  .nav-links .nav-item.active .ico {
    color: var(--brand);
  }
  .nav-links .nav-item.active > span:first-child {
    background: var(--selected);
    border-radius: 7px;
    padding: 5px 15px;
    margin-top: -5px;
  }
  .rail-count {
    right: 15%;
    top: 0;
  }
  .rail-bottom {
    margin: 0;
    padding: 0 9px;
  }
  .account-avatar {
    width: 40px;
    height: 44px;
    border-color: var(--bg);
  }
  .workspace-bar {
    height: 70px;
    padding: 0 18px;
    gap: 8px;
  }
  .workspace-identity {
    gap: 9px;
  }
  .workspace-identity strong {
    font-size: 14px;
  }
  .workspace-caption {
    font-size: 12px;
    letter-spacing: 0.75px;
  }
  .workspace-emblem.small {
    width: 33px;
    height: 33px;
    border-radius: 9px;
  }
  .workspace-emblem.small .ico {
    width: 21px;
    height: 21px;
  }
  .workspace-right {
    gap: 5px;
  }
  .connection-btn {
    font-size: 12px;
    max-width: 130px;
    line-height: 1.5;
    gap: 5px;
  }
  .connection-btn > .ico {
    display: none;
  }
  .demo-badge {
    display: none;
  }
  .list {
    width: 100%;
    border: 0;
  }
  .list-heading {
    padding: 21px 22px 17px;
  }
  .list-heading h1 {
    font-size: 28px;
  }
  .list-heading .eyebrow {
    font-size: 12px;
  }
  .search-field,
  .filters {
    margin-left: 22px;
    margin-right: 22px;
  }
  .filters {
    justify-content: space-between;
    margin-bottom: 11px;
  }
  .filters button {
    font-size: 14px;
    padding: 8px 10px;
  }
  .list-caption {
    font-size: 12px;
  }
  .convs {
    padding: 0 10px 8px;
  }
  .conv {
    padding: 17px 12px;
    min-height: 112px;
    gap: 13px;
  }
  .avatar {
    width: 47px;
    height: 47px;
    font-size: 16px;
  }
  .name {
    font-size: 16px;
  }
  .time {
    font-size: 12px;
  }
  .last {
    font-size: 14px;
    margin: 3px 0 6px;
  }
  .ch-tag {
    font-size: 12px;
  }
  .conv .badge {
    font-size: 12px;
  }
  .list-footer {
    display: none;
  }
  .thread {
    display: none;
  }
  .thread-open .list {
    display: none;
  }
  .thread-open .thread {
    display: flex;
  }
  .thread-open .nav-rail,
  .thread-open .workspace-bar {
    display: none;
  }
  .thread-open.app,
  body.thread-open .app {
    padding-bottom: 0;
  }
  .thread-header {
    min-height: 76px;
    padding: 12px 14px 12px 6px;
    gap: 7px;
  }
  .thread-header .back {
    display: flex;
    width: 44px;
  }
  .thread-header h2 {
    font-size: 16px;
  }
  .thread-header .avatar {
    width: 40px;
    height: 40px;
    margin-right: 4px;
  }
  .thread-channel {
    font-size: 12px;
  }
  .thread-notice {
    padding: 8px 18px;
    font-size: 12px;
  }
  .msgs {
    padding: 15px 16px 20px;
  }
  .msg {
    padding-left: 31px;
    margin-bottom: 20px;
  }
  .msg-avatar .avatar {
    width: 24px;
    height: 24px;
    font-size: 12px;
  }
  .bubble {
    max-width: 94%;
    font-size: 16px;
    padding: 10px 13px;
  }
  .msg.out .bubble {
    max-width: 88%;
  }
  .meta {
    font-size: 12px;
  }
  .date-divider {
    padding-bottom: 23px;
  }
  .composer {
    padding: 0 10px 10px;
    padding-bottom: max(10px, env(safe-area-inset-bottom));
  }
  .composer textarea {
    min-height: 47px;
  }
  .composer-actions .primary {
    font-size: 14px;
    padding: 7px 16px;
  }
  .composer-foot {
    padding-top: 6px;
    font-size: 12px;
  }
  .new-messages {
    bottom: 160px;
  }
  .thread-info {
    position: fixed;
    top: auto;
    left: 0;
    width: 100%;
    max-height: 85dvh;
    border: 1px solid var(--line);
    border-radius: 20px 20px 0 0;
    padding: 20px 24px max(20px, env(safe-area-inset-bottom));
    z-index: 7;
  }
  .management {
    padding: 24px 18px;
  }
  .page-intro {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 22px;
  }
  .page-intro h1 {
    font-size: 28px;
  }
  .page-intro p {
    font-size: 14px;
  }
  .page-intro > .primary {
    width: 100%;
  }
  .channel-grid {
    grid-template-columns: 1fr;
  }
  .ch-card {
    padding: 18px;
  }
  .future-platforms {
    flex-wrap: wrap;
    gap: 8px;
  }
  .future-platforms > span {
    width: 100%;
  }
  .staff-row {
    padding: 14px;
    gap: 10px;
  }
  .staff-role {
    width: auto;
  }
  .staff-row .row {
    width: 100%;
    justify-content: flex-end;
    border-top: 1px solid var(--line);
    padding-top: 6px;
  }
  .staff-row .avatar {
    width: 40px;
    height: 40px;
  }
  .sheet {
    position: fixed;
    inset: auto 0 0;
    width: 100%;
    max-height: 90dvh;
    margin: 0;
    padding: 24px 20px max(24px, env(safe-area-inset-bottom));
    border-radius: 20px 20px 0 0;
  }
  .action-sheet {
    width: 100%;
  }
  .dialog-head .eyebrow {
    font-size: 12px;
  }
  .dialog-head h2 {
    font-size: 20px;
  }
  .toast {
    left: 16px;
    right: 16px;
    width: auto;
    max-width: none;
    transform: none;
    bottom: calc(85px + env(safe-area-inset-bottom));
  }
  .thread-open .toast {
    bottom: 180px;
  }
  .account-menu {
    left: 12px;
    right: 12px;
    bottom: calc(75px + env(safe-area-inset-bottom));
    width: auto;
  }
  .login-page {
    display: flex;
    overflow-y: auto;
    padding: 36px 0 max(30px, env(safe-area-inset-bottom));
  }
  .login-story {
    display: none;
  }
  .login-form {
    margin: auto;
    padding: 10px 0;
  }
  .login-form h2 {
    font-size: 28px;
  }
  .login-footer {
    font-size: 12px;
  }
  .bot-modes {
    flex-direction: column;
  }
  .bot-draft {
    margin: 0 10px 10px;
  }
  .channel-select select {
    max-width: 150px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
.help-content h3 {
  margin: 20px 0 7px;
  font-size: 14px;
}
.help-content p {
  color: var(--muted);
  font-size: 14px;
}
.state-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 20px;
}
.state-grid button {
  font-size: 14px;
  padding: 10px;
}
.qr-countdown {
  margin-top: 10px;
}
@media (min-width: 768px) {
  .thread-open .workspace-bar {
    display: flex;
  }
}

/* Six tailles de texte : 12, 14, 16, 20, 28, 40. */
.workspace-caption {
  letter-spacing: 0.7px;
  font-size: 12px;
  text-transform: none;
}
.workspace-identity strong {
  font-size: 16px;
}
.account-avatar {
  width: 44px;
}
.rail-count {
  min-width: 18px;
}
@media (max-width: 767px) {
  .workspace-caption {
    letter-spacing: 0;
    font-size: 12px;
  }
  .workspace-identity strong {
    font-size: 14px;
  }
  .workspace-right .connection-btn {
    font-size: 12px;
    max-width: 125px;
  }
  .nav-label {
    font-size: 12px;
  }
  .nav-item {
    padding-left: 0;
    padding-right: 0;
  }
  .rail-bottom {
    padding: 0 0 0 4px;
  }
  .filters {
    margin-left: 18px;
    margin-right: 18px;
  }
  .filters button {
    padding-left: 5px;
    padding-right: 5px;
  }
  .conv .badge {
    font-size: 12px;
  }
  .conv-bottom {
    gap: 4px;
  }
  .ch-tag {
    font-size: 12px;
  }
  .channel-select select {
    font-size: 12px;
  }
  .login-footer {
    letter-spacing: 0;
  }
}

.channel-select select {
  font-size: 16px;
}

/* Vai trò dùng chung và gán vai trò cho nhân viên. */
.team-tabs {
  display: flex;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
}
.team-tabs button {
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  padding: 12px 2px;
  border-bottom: 2px solid transparent;
}
.team-tabs button.on {
  color: var(--brand);
  border-bottom-color: var(--brand);
  font-weight: 600;
}
.team-tabs button span {
  background: var(--soft);
  border-radius: 5px;
  padding: 0 7px;
  font-size: 12px;
}
.team-demo-note {
  color: var(--muted);
  font-size: 12px;
  margin: -6px 0 20px;
}
.role-note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 14px 16px;
  background: var(--selected);
  border-radius: 10px;
  margin-bottom: 22px;
  font-size: 14px;
}
.role-note .ico {
  color: var(--brand);
  margin-top: 2px;
}
.role-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 18px;
}
.role-card {
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 13px;
  padding: 22px;
}
.role-card-head {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 15px;
}
.role-card h3 {
  font-size: 16px;
}
.role-card > p {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 18px;
}
.role-emblem {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--selected);
  color: var(--brand);
  flex: none;
}
.role-rights {
  display: grid;
  gap: 9px;
  margin: 18px 0;
  font-size: 14px;
}
.role-rights > span {
  display: flex;
  align-items: center;
  gap: 8px;
}
.role-rights .enabled {
  color: var(--brand);
}
.role-rights .ico {
  width: 16px;
  height: 16px;
}
.role-scope {
  display: flex;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
  border-top: 1px solid var(--line);
  padding-top: 15px;
}
.role-scope .ico {
  width: 16px;
  height: 16px;
}
.role-permission {
  align-items: flex-start;
  padding: 8px 0;
}
.role-permission input {
  margin-top: 4px;
}
.role-permission strong {
  font-size: 14px;
  font-weight: 550;
}
.role-permission small {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.role-assignment-summary {
  padding: 15px;
  background: var(--selected);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.role-assignment-summary p {
  font-size: 14px;
  color: var(--muted);
  margin-top: 6px;
}
.staff-role {
  width: auto;
  max-width: 180px;
  white-space: normal;
}
.staff-scope {
  overflow-wrap: anywhere;
}
@media (max-width: 767px) {
  .role-grid {
    grid-template-columns: 1fr;
  }
  .role-card {
    padding: 18px;
  }
  .team-tabs {
    gap: 20px;
  }
  .role-note {
    font-size: 14px;
  }
  .staff-role {
    max-width: 130px;
  }
}

/* Hai tab chính luôn ở đáy, kể cả khi đang đọc hội thoại. */
.app-update {
  order: 1;
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  color: var(--text);
  background: var(--warn-bg);
  border-bottom: 1px solid var(--line);
}
.app-update span { flex: 1; }
.app-update button { min-height: 44px; flex: none; }
.app {
  flex-direction: column-reverse;
  padding-bottom: 0;
}
.workspace {
  min-height: 0;
}
.nav-rail {
  position: static;
  width: 100%;
  height: auto;
  flex-direction: row;
  border-right: 0;
  border-top: 1px solid var(--line);
  background: var(--bg);
  padding: 4px 16px max(4px, env(safe-area-inset-bottom));
}
.nav-links {
  flex-direction: row;
  justify-content: center;
  margin: 0 auto;
  max-width: 640px;
  gap: 8px;
}
.nav-item {
  flex: 1;
  min-height: 56px;
  padding: 4px 12px;
}
.nav-item.active::before {
  display: none;
}
.nav-label {
  font-size: 14px;
}
.rail-count {
  right: 20%;
}
.settings-content {
  max-width: 720px;
}
.settings-links,
.settings-account {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg);
  margin-bottom: 24px;
  padding: 12px;
}
.settings-links button {
  display: flex;
  justify-content: flex-start;
  text-align: left;
  width: 100%;
  background: transparent;
  padding: 14px 10px;
  gap: 12px;
}
.settings-links button > .ico:last-child {
  margin-left: auto;
  color: var(--muted);
}
.settings-account .appearance {
  padding: 12px 10px;
}
.settings-account .theme-options button {
  justify-content: flex-start;
}
.settings-account #logout {
  color: var(--danger);
  background: transparent;
}
.settings-account > small {
  display: block;
  padding: 10px;
}
.push-prompt {
  flex-shrink: 0;
}
.push-prompt .text-btn {
  display: block;
  margin-top: 4px;
}
.settings-back {
  margin-bottom: 16px;
}
@media (max-width: 767px) {
  body.thread-open .app {
    padding-bottom: 0;
  }
  .thread-open .nav-rail {
    display: flex;
  }
  .nav-links .nav-item.active > span:first-child {
    margin-top: 0;
    padding: 0;
    background: transparent;
  }
  .nav-item.active {
    background: var(--selected);
  }
  .thread-header {
    min-height: 64px;
  }
}

.reaction-observations { font-size: 11px; color: var(--muted); margin: 3px 0 8px; }
.media-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin:16px 0; }
.media-grid img,.media-grid video { width:100%; max-height:240px; object-fit:contain; border-radius:8px; }

/* Server-paged inbox and the shared tag taxonomy. */
.filters { flex-wrap: nowrap; overflow-x: auto; flex-shrink: 0; }
.filters button { flex-shrink: 0; }
.tag-filter { display: flex; align-items: center; gap: 8px; padding: 4px 20px; font-size: 12px; color: var(--muted); }
.tag-filter select { min-width: 0; flex: 1; }
.inbox-more { margin: 8px 20px; flex-shrink: 0; }
.inbox-status { margin: 2px 20px; text-align: center; flex-shrink: 0; }
.tag-editor { border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 12px; display: grid; gap: 12px; }
.tag-editor .field { margin: 0; }
.tag-editor .row { flex-wrap: wrap; }

/* Owner response-time report */
.report-range { display:flex; flex-wrap:wrap; gap:12px; align-items:end; margin:24px 0 12px; }
.report-range label { display:grid; gap:6px; flex:1; min-width:140px; }
.report-range input { width:100%; min-width:0; box-sizing:border-box; }
.report-table-wrap { overflow-x:auto; }
.report-table { width:100%; border-collapse:collapse; margin:20px 0; }
.report-table th,.report-table td { text-align:left; padding:14px 8px; border-bottom:1px solid var(--line); }
.report-table td small { display:block; margin-top:4px; color:var(--muted); }
.report-table th:first-child { width:52%; }
@media(max-width:600px) { .report-range button { width:100%; } .report-table th,.report-table td { padding:12px 5px; font-size:13px; } }

.spa-link-info { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.spa-profile-link { text-decoration: none; display: inline-flex; padding: 9px 14px; border-radius: 8px; }
