:root {
  --bg: #f3f6f8;
  --surface: #ffffff;
  --surface-muted: #eef4f3;
  --line: #d8e2e3;
  --text: #152431;
  --muted: #667586;
  --nav: #142431;
  --nav-2: #1d3342;
  --nav-text: #dce8ec;
  --primary: #0d7f62;
  --primary-2: #0b634f;
  --primary-soft: #dff3ed;
  --blue: #275d9f;
  --blue-soft: #e5eef9;
  --danger: #b42318;
  --danger-soft: #fde7e5;
  --warn: #93630a;
  --warn-soft: #fff2cc;
  --shadow: 0 18px 42px rgba(21, 36, 49, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

.login-page {
  min-height: 100vh;
  background: radial-gradient(circle at 20% 20%, rgba(13, 127, 98, 0.16), transparent 28%),
    linear-gradient(135deg, #f3f6f8 0%, #e8f1ef 52%, #f7faf9 100%);
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(430px, 100%);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.login-logo {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.login-logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.login-brand strong,
.login-brand span {
  display: block;
}

.login-brand strong {
  font-size: 24px;
}

.login-brand span {
  color: var(--muted);
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-form label {
  display: grid;
  gap: 7px;
  margin: 0;
  font-weight: 800;
}

.login-form input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
  font-weight: 600;
}

.login-form input:focus {
  outline: 3px solid rgba(13, 127, 98, 0.16);
  border-color: var(--primary);
}

.login-form small {
  color: var(--danger);
  font-weight: 700;
}

.login-form button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--primary);
  color: #ffffff;
  font-weight: 800;
}

.login-alert {
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid var(--danger-soft);
  border-radius: 8px;
  background: var(--danger-soft);
  color: var(--danger);
  font-weight: 700;
}

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

button {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns 180ms ease;
}

.app-shell.sidebar-collapsed {
  grid-template-columns: 82px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 16px 12px;
  overflow: hidden;
  background: var(--nav);
  color: var(--nav-text);
  border-right: 1px solid #0b161f;
}

.brand-row {
  min-height: 58px;
  display: flex;
  align-items: center;
  padding: 4px;
  margin-bottom: 14px;
}

.brand {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-logo {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: #ffffff;
  padding: 6px;
}

.brand-logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-copy strong,
.brand-copy small {
  display: block;
  white-space: nowrap;
}

.brand-copy strong {
  color: #ffffff;
  font-size: 18px;
  line-height: 1.1;
}

.brand-copy small {
  margin-top: 2px;
  color: #9eb2be;
  font-size: 12px;
}

.nav-menu {
  display: grid;
  flex: 1;
  min-height: 0;
  align-content: start;
  gap: 6px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(158, 178, 190, 0.45) transparent;
}

.sidebar-version {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex: 0 0 auto;
  margin-top: 10px;
  padding: 11px 12px 2px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: #9eb2be;
  font-size: 11px;
  line-height: 1.2;
}

.sidebar-version strong {
  color: #d7e3e9;
  font-size: 12px;
  white-space: nowrap;
}

.nav-link,
.nav-parent {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 7px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--nav-text);
  text-align: left;
  font-weight: 700;
}

.nav-link {
  grid-template-columns: 34px minmax(0, 1fr);
}

.nav-link:hover,
.nav-parent:hover,
.nav-link.active,
.nav-parent.expanded {
  background: var(--nav-2);
  color: #ffffff;
}

.nav-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 30px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #bfeee1;
  font-size: 11px;
  font-weight: 800;
}

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

.nav-caret {
  width: 8px;
  height: 8px;
  border-right: 2px solid #9eb2be;
  border-bottom: 2px solid #9eb2be;
  transform: rotate(45deg);
  transition: transform 160ms ease;
}

.nav-parent.expanded .nav-caret {
  transform: rotate(-135deg);
}

.nav-children {
  display: none;
  gap: 2px;
  padding: 2px 0 6px 54px;
}

.nav-parent:not(:has(+ .nav-children a)),
.nav-children:not(:has(a)) {
  display: none;
}

.nav-children.open {
  display: grid;
}

.nav-children a {
  display: flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 8px;
  color: #b9c8d0;
  font-size: 14px;
  font-weight: 600;
}

.nav-children a:hover,
.nav-children a.active {
  background: rgba(255, 255, 255, 0.07);
  color: #ffffff;
}

.app-shell.sidebar-collapsed .brand {
  grid-template-columns: 44px;
}

.app-shell.sidebar-collapsed .brand-logo {
  width: 44px;
  padding: 7px;
}

.app-shell.sidebar-collapsed .brand-copy,
.app-shell.sidebar-collapsed .nav-text,
.app-shell.sidebar-collapsed .nav-caret,
.app-shell.sidebar-collapsed .nav-children {
  display: none;
}

.app-shell.sidebar-collapsed .nav-link,
.app-shell.sidebar-collapsed .nav-parent {
  grid-template-columns: 34px;
  justify-content: center;
  padding-inline: 8px;
}

.app-shell.sidebar-collapsed .sidebar-version {
  justify-content: center;
  padding-inline: 2px;
}

.app-shell.sidebar-collapsed .sidebar-version span {
  display: none;
}

.content-shell {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 74px;
  padding: 14px 24px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.topbar-left,
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.topbar h1,
.panel h2,
.status-band h2,
.module-strip h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.icon-button,
.round-button,
.account-button,
.panel-button,
.signout-button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 8px;
  font-weight: 800;
}

.icon-button,
.round-button,
.panel-button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
}

.icon-button {
  gap: 4px;
}

.icon-button span {
  width: 17px;
  height: 2px;
  border-radius: 999px;
  background: var(--text);
}

.round-button {
  position: relative;
}

.bell-shape {
  width: 15px;
  height: 17px;
  border: 2px solid var(--text);
  border-radius: 8px 8px 5px 5px;
  border-top-width: 3px;
}

.notify-dot {
  position: absolute;
  top: -5px;
  right: -5px;
  display: grid;
  place-items: center;
  min-width: 19px;
  height: 19px;
  padding-inline: 5px;
  border-radius: 999px;
  background: var(--danger);
  color: #ffffff;
  font-size: 11px;
}

.account-button {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 4px 10px 4px 5px;
}

.avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--primary);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
}

.avatar.large {
  width: 44px;
  height: 44px;
  font-size: 14px;
}

.logo-avatar {
  background: #ffffff;
  border: 1px solid var(--line);
  padding: 4px;
}

.logo-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.popup-wrap {
  position: relative;
}

.popup-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 30;
  width: min(360px, calc(100vw - 32px));
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.popup-header,
.account-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.popup-header span,
.account-card span,
.account-info dt {
  color: var(--muted);
  font-size: 12px;
}

.notification-item {
  display: grid;
  gap: 2px;
  width: 100%;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  color: inherit;
  text-decoration: none;
}

.notification-item small { color: var(--muted); font-size: 11px; }
.notification-view-all { display:block; margin-top:10px; padding:9px 10px; border-top:1px solid var(--line); color:var(--primary); text-align:center; font-weight:800; text-decoration:none; }
.notification-card-real.selected { border-color:var(--primary); box-shadow:0 0 0 3px rgba(0, 131, 100, .14); }

.notification-item:hover,
.notification-item.active {
  border-color: var(--line);
  background: var(--surface-muted);
}

.notification-item span {
  color: var(--muted);
  font-size: 13px;
}

.notification-detail {
  margin-top: 10px;
  padding: 10px;
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary-2);
  font-size: 13px;
  line-height: 1.45;
}

.account-card {
  justify-content: flex-start;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.account-card strong,
.account-card span {
  display: block;
}

.account-name-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.account-card .account-extension {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-2);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.account-info {
  display: grid;
  gap: 8px;
  margin: 0 0 12px;
}

.account-info div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.account-info dd {
  margin: 0;
  font-weight: 700;
}

.signout-button {
  width: 100%;
  min-height: 38px;
  background: var(--nav);
  color: #ffffff;
}

.account-action-button {
  width: 100%;
  min-height: 38px;
  margin-bottom: 8px;
}

main {
  display: grid;
  gap: 18px;
  padding: 22px 24px 32px;
}

.welcome-page {
  display: grid;
  gap: 18px;
}

.welcome-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  min-height: 300px;
  overflow: hidden;
  border: 1px solid #cfe4dd;
  border-radius: 18px;
  background:
    radial-gradient(circle at 84% 18%, rgba(255, 255, 255, 0.2), transparent 24%),
    linear-gradient(125deg, #075b49 0%, #0d7f62 55%, #1b9a76 100%);
  box-shadow: 0 18px 42px rgba(13, 99, 79, 0.16);
  color: #ffffff;
}

.welcome-hero::before,
.welcome-hero::after {
  position: absolute;
  content: "";
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
}

.welcome-hero::before {
  width: 420px;
  height: 420px;
  right: -125px;
  top: -180px;
}

.welcome-hero::after {
  width: 300px;
  height: 300px;
  right: 60px;
  bottom: -220px;
}

.welcome-hero-copy {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 38px 42px;
}

.welcome-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  padding: 7px 11px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 13px;
  font-weight: 800;
}

.welcome-status i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #86efac;
  box-shadow: 0 0 0 4px rgba(134, 239, 172, 0.16);
}

.welcome-hero .eyebrow {
  margin: 0 0 6px;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 0.1em;
}

.welcome-hero h2 {
  margin: 0;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.welcome-lead {
  max-width: 720px;
  margin: 16px 0 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 17px;
  line-height: 1.6;
}

.welcome-session-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.welcome-session-meta span {
  padding: 8px 11px;
  border-radius: 8px;
  background: rgba(5, 56, 44, 0.32);
  color: rgba(255, 255, 255, 0.88);
  font-size: 13px;
}

.welcome-brand-visual {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
}

.welcome-logo-wrap {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 132px;
  height: 132px;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 34px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 22px 48px rgba(0, 49, 37, 0.28);
  transform: rotate(-4deg);
}

.welcome-logo-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.welcome-orbit {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
}

.orbit-one { width: 210px; height: 210px; }
.orbit-two { width: 270px; height: 270px; }

.welcome-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(300px, 0.7fr);
  gap: 18px;
  align-items: start;
}

.welcome-panel,
.welcome-guide {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(21, 36, 49, 0.06);
}

.welcome-panel { padding: 24px; }
.welcome-guide { padding: 24px; }

.welcome-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.welcome-panel .eyebrow,
.welcome-guide .eyebrow {
  margin: 0 0 5px;
  color: var(--primary);
}

.welcome-panel h3,
.welcome-guide h3 {
  margin: 0;
  font-size: 22px;
}

.welcome-panel-badge {
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-2);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.welcome-shortcuts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.welcome-shortcut {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 90px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfdfc;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.welcome-shortcut:hover {
  border-color: #9acdbd;
  box-shadow: 0 12px 26px rgba(13, 127, 98, 0.1);
  transform: translateY(-2px);
}

.welcome-shortcut-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--primary-2);
  font-size: 13px;
  font-weight: 900;
}

.shortcut-tasks .welcome-shortcut-icon { background: #e5eef9; color: #275d9f; }
.shortcut-notifications .welcome-shortcut-icon { background: #fff2cc; color: #93630a; }
.shortcut-zalo .welcome-shortcut-icon { background: #e7f0ff; color: #0b65c2; }
.shortcut-dashboard .welcome-shortcut-icon { background: #eee8ff; color: #6c45a7; }

.welcome-shortcut strong,
.welcome-shortcut small {
  display: block;
}

.welcome-shortcut strong { margin-bottom: 5px; }
.welcome-shortcut small { color: var(--muted); line-height: 1.35; }
.welcome-shortcut > i { color: var(--primary); font-size: 21px; font-style: normal; }

.welcome-empty-access {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px;
  border: 1px dashed #9acdbd;
  border-radius: 12px;
  background: #f4faf8;
}

.welcome-empty-access > span {
  display: grid;
  flex: 0 0 38px;
  place-items: center;
  height: 38px;
  border-radius: 50%;
  background: var(--primary);
  color: #ffffff;
  font-weight: 900;
}

.welcome-empty-access p { margin: 6px 0 0; color: var(--muted); line-height: 1.5; }

.welcome-steps {
  display: grid;
  gap: 18px;
  margin: 22px 0;
  padding: 0;
  list-style: none;
}

.welcome-steps li {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  align-items: flex-start;
}

.welcome-steps li > span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--surface-muted);
  color: var(--primary-2);
  font-weight: 900;
}

.welcome-steps strong,
.welcome-steps small { display: block; }
.welcome-steps small { margin-top: 4px; color: var(--muted); line-height: 1.45; }

.welcome-help-note {
  display: grid;
  gap: 4px;
  padding: 14px;
  border-radius: 10px;
  background: var(--nav);
  color: #ffffff;
}

.welcome-help-note span { color: rgba(255, 255, 255, 0.7); font-size: 13px; line-height: 1.45; }

@media (max-width: 1050px) {
  .welcome-content-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 760px) {
  .welcome-hero { grid-template-columns: minmax(0, 1fr); }
  .welcome-hero-copy { padding: 30px 24px; }
  .welcome-brand-visual { display: none; }
  .welcome-shortcuts { grid-template-columns: minmax(0, 1fr); }
  .welcome-panel-header { display: grid; }
  .welcome-panel-badge { justify-self: start; }
}

.status-band,
.service-background,
.module-strip,
.panel,
.metric-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.status-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  padding: 18px;
}

.status-band span {
  color: var(--muted);
}

.service-background {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(320px, 1fr);
  gap: 16px;
  align-items: center;
  padding: 18px;
}

.service-background h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
}

.service-background span,
.service-background dt,
.service-background p {
  color: var(--muted);
}

.service-background dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(86px, 1fr));
  gap: 10px;
  margin: 0;
}

.service-background div {
  min-width: 0;
}

.service-background dt,
.service-background dd {
  margin: 0;
}

.service-background dt {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.service-background dd {
  margin-top: 3px;
  font-weight: 800;
}

.service-background p {
  grid-column: 1 / -1;
  margin: 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.pipeline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

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

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(138px, 1fr));
  gap: 12px;
}

.metric-card {
  display: grid;
  gap: 7px;
  min-height: 116px;
  padding: 16px;
}

.metric-card span,
.ticket-row span,
td span {
  color: var(--muted);
}

.metric-card strong {
  font-size: 28px;
  line-height: 1;
}

.metric-card em {
  width: fit-content;
  padding: 3px 8px;
  border-radius: 999px;
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
}

.metric-card.good em {
  color: var(--primary);
  background: var(--primary-soft);
}

.metric-card.warn em {
  color: var(--warn);
  background: var(--warn-soft);
}

.metric-card.danger em {
  color: var(--danger);
  background: var(--danger-soft);
}

.work-grid,
.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 18px;
}

.panel {
  min-width: 0;
  padding: 18px;
}

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

.list-count-line {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}

.list-count-line h2 {
  margin: 0;
}

.list-count-line span {
  color: var(--muted);
}

.table-wrap {
  overflow-x: auto;
}

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

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

.sortable-header {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: inherit;
  text-decoration: none;
}

.sortable-header:hover,
.sortable-header.active {
  color: var(--brand);
}

.sort-indicator {
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  padding: 4px 7px;
}

.sortable-header.active .sort-indicator {
  background: var(--brand-soft);
  color: var(--brand);
}

.required-mark {
  color: var(--danger);
}

.validation-summary,
.field-validation {
  color: var(--danger);
  font-size: 13px;
  font-weight: 700;
}

.validation-summary ul {
  margin: 0 0 10px 18px;
  padding: 0;
}

.modal-feedback {
  padding: 10px 12px;
  border-radius: 8px;
  font-weight: 800;
}

.modal-feedback.success {
  border: 1px solid var(--primary-soft);
  background: var(--primary-soft);
  color: var(--primary);
}

.modal-feedback.error {
  border: 1px solid var(--danger-soft);
  background: var(--danger-soft);
  color: var(--danger);
}

.role-picker {
  display: grid;
  gap: 12px;
}

.role-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.role-card {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  min-height: 86px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
}

.role-card input {
  width: 18px;
  height: 18px;
}

.role-card span {
  min-width: 0;
}

.role-card strong,
.role-card small {
  display: block;
}

.role-card small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
}

.detail-role-list {
  display: grid;
  gap: 10px;
  padding-top: 4px;
}

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

.detail-role-item,
.detail-role-empty {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
}

.detail-role-empty {
  background: var(--surface-muted);
  color: var(--muted);
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

td strong,
td span {
  display: block;
}

.badge-soft {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.badge-soft.high,
.badge-soft.urgent {
  background: var(--danger-soft);
  color: var(--danger);
}

.badge-soft.normal {
  background: var(--primary-soft);
  color: var(--primary);
}

.badge-soft.warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.ticket-list {
  display: grid;
  gap: 10px;
}

.ticket-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(86px, 0.42fr) minmax(0, 0.7fr);
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.ticket-row strong,
.ticket-row span,
.ticket-row small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.ticket-row small {
  color: var(--muted);
}

.clickable-row {
  cursor: pointer;
}

.clickable-row:hover {
  background: var(--primary-soft);
}

.module-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
}

.module-tile {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 132px;
  padding: 16px;
  background: #fbfcfd;
}

.module-tile strong,
.module-tile span {
  display: block;
}

.module-tile span {
  color: var(--muted);
  font-size: 13px;
}

.contract-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.contract-list span,
.check-list li {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
}

.check-list {
  display: grid;
  gap: 10px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.empty-state {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.admin-page {
  display: grid;
  gap: 18px;
}

.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.page-heading h2 {
  margin: 0 0 4px;
  font-size: 24px;
}

.page-heading span {
  color: var(--muted);
}

.page-actions,
.detail-actions,
.row-actions,
.segmented-control {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.customer-profile-form .detail-actions {
  margin-top: 18px;
}

.zalo-user-field {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.zalo-user-field input {
  min-width: 0;
  flex: 1;
}

.zalo-user-field button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.primary-button,
.secondary-button,
.row-actions button,
.segmented-control a,
.segmented-control button {
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 800;
}

.primary-button {
  border-color: var(--primary);
  background: var(--primary);
  color: #ffffff;
}

.secondary-button,
.row-actions button,
.segmented-control a,
.segmented-control button,
.table-action {
  background: #ffffff;
  color: var(--text);
}

.table-action {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 800;
}

.customer-row-actions {
  flex-wrap: nowrap;
}

.customer-list-table {
  font-size: 12px;
}

.customer-list-table th,
.customer-list-table td {
  padding: 4px 10px;
}

.customer-list-table th {
  font-size: 11px;
}

.customer-list-table td strong,
.customer-list-table td span {
  line-height: 1.1;
}

.customer-list-table .badge-soft {
  min-height: 16px;
  padding: 1px 7px;
  font-size: 10px;
}

.customer-list-table .customer-select-header,
.customer-list-table .customer-select-cell {
  width: 32px;
  min-width: 32px;
  text-align: center;
}

.customer-list-table .customer-row-check {
  width: 14px;
  height: 14px;
  min-height: 14px;
  margin: 0;
  accent-color: var(--primary);
  cursor: pointer;
}

.customer-list-table .customer-row-actions {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.customer-list-table .inline-action-form {
  display: inline-flex;
  align-items: center;
  margin: 0;
}

.customer-list-table .icon-table-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  min-width: 22px;
  height: 22px;
  min-height: 22px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--text);
}

.customer-list-table .icon-table-action svg {
  display: block;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  stroke: currentColor;
  stroke-width: 2.35;
}

.customer-list-table .icon-table-action:hover,
.customer-list-table .icon-table-action:focus-visible {
  border-color: transparent;
  background: transparent;
  color: var(--primary);
}

.row-actions:has(.icon-table-action),
.document-file-actions,
.calendar-actions {
  flex-wrap: nowrap;
}

.icon-table-action {
  position: relative;
  justify-content: center;
  width: 38px;
  min-width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  color: var(--text);
}

.icon-table-action.danger-button {
  color: var(--danger) !important;
}

.icon-table-action.danger-button:hover,
.icon-table-action.danger-button:focus-visible {
  border-color: var(--danger-soft) !important;
  background: var(--danger-soft) !important;
  color: var(--danger) !important;
}

.icon-table-action svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ticket-action-button.start {
  color: #087f6b;
}

.ticket-action-button.close {
  color: #2563a8;
}

.ticket-action-button.start:hover,
.ticket-action-button.start:focus-visible {
  border-color: #a7e4d8;
  background: #eaf9f5;
}

.ticket-action-button.close:hover,
.ticket-action-button.close:focus-visible {
  border-color: #bdd7f3;
  background: #edf5fd;
}

.icon-table-action::after {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  z-index: 40;
  padding: 6px 9px;
  border-radius: 6px;
  background: var(--text);
  color: #ffffff;
  content: attr(data-tooltip);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(4px);
  transition: opacity 120ms ease, transform 120ms ease;
  white-space: nowrap;
}

.icon-table-action::before {
  position: absolute;
  bottom: calc(100% + 3px);
  left: 50%;
  z-index: 40;
  width: 8px;
  height: 8px;
  background: var(--text);
  content: "";
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) rotate(45deg);
  transition: opacity 120ms ease;
}

.icon-table-action:hover::after,
.icon-table-action:focus-visible::after,
.icon-table-action:hover::before,
.icon-table-action:focus-visible::before {
  opacity: 1;
}

.icon-table-action:hover::after,
.icon-table-action:focus-visible::after {
  transform: translateX(-50%) translateY(0);
}

.table-action.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #ffffff;
}

.table-action.disabled {
  pointer-events: none;
  opacity: 0.45;
}

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 16px;
}

.pagination-info {
  color: var(--muted);
  font-weight: 800;
}

.pagination-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.danger-button {
  border-color: var(--danger-soft) !important;
  background: var(--danger-soft) !important;
  color: var(--danger) !important;
}

.success-alert {
  padding: 12px 14px;
  border: 1px solid var(--primary-soft);
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 800;
}

.import-feedback {
  margin: 12px 0 16px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 800;
}

.import-feedback.success {
  border-color: var(--primary-soft);
  background: #e0f7ef;
  color: var(--primary);
}

.import-feedback.error {
  border-color: var(--danger-soft);
  background: #fde2e2;
  color: var(--danger);
}

.import-submit-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 132px;
}

.import-submit-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.import-submit-spinner,
.import-uploading-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: import-spinner-rotate 0.75s linear infinite;
}

.import-submit-spinner {
  display: none;
}

.is-importing .import-submit-spinner {
  display: inline-block;
}

.import-uploading-status {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid var(--primary-soft);
  border-radius: 8px;
  background: #e0f7ef;
  color: var(--primary);
}

.import-uploading-status[hidden] {
  display: none;
}

.import-uploading-status strong,
.import-uploading-status small {
  display: block;
}

.import-uploading-status small {
  margin-top: 2px;
  color: var(--muted);
}

@keyframes import-spinner-rotate {
  to {
    transform: rotate(360deg);
  }
}

.inline-download-link.disabled {
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.65;
  text-decoration: none;
  pointer-events: none;
}

.crm-toast-host {
  position: fixed;
  top: 86px;
  right: 24px;
  z-index: 3000;
  display: grid;
  gap: 10px;
  width: min(420px, calc(100vw - 32px));
  pointer-events: none;
}

.allocation-toolbar {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  margin-left: auto;
}

.allocation-user-field {
  display: grid;
  gap: 7px;
  min-width: min(360px, 48vw);
}

.allocation-user-field > span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.allocation-user-field select {
  width: 100%;
  min-height: 42px;
  padding: 9px 38px 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background-color: #fff;
  color: var(--text);
}

.transfer-customer-summary {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft, #f8fafc);
}

.transfer-customer-summary strong {
  color: var(--text);
  font-size: 1rem;
}

.transfer-customer-summary span {
  color: var(--muted);
  font-size: 0.9rem;
}

.planning-form { padding: 24px; }
.planning-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-top: 22px; }
.planning-fields label { display: grid; gap: 8px; font-weight: 700; }
.planning-fields input,
.planning-fields select,
.planning-fields textarea {
  width: 100%;
  border: 1px solid #d7e1e6;
  border-radius: 12px;
  background-color: #fff;
  color: #132432;
  font: inherit;
  font-weight: 600;
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}
.planning-fields input,
.planning-fields select { height: 52px; padding: 0 16px; }
.planning-fields textarea { min-height: 120px; padding: 14px 16px; resize: vertical; line-height: 1.5; }
.planning-fields select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 48px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%235f7180' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 15px center;
  background-size: 19px;
}
.planning-fields select:hover,
.planning-fields input:hover,
.planning-fields textarea:hover { border-color: #9fb7b0; }
.planning-fields select:focus,
.planning-fields input:focus,
.planning-fields textarea:focus {
  outline: none;
  border-color: #078364;
  box-shadow: 0 0 0 4px rgba(7, 131, 100, .12);
}
.planning-fields input::placeholder,
.planning-fields textarea::placeholder { color: #82919c; font-weight: 500; }
.planning-content { grid-column: 1 / -1; }
.planning-money-field { position: relative; }
.planning-money-field input { padding-right: 58px; }
.planning-money-field span { position: absolute; top: 50%; right: 16px; transform: translateY(-50%); color: #607480; font-size: 13px; font-weight: 800; pointer-events: none; }
.planning-employee-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 26px 0 14px; }
.planning-employee-header h3 { margin: 0 0 4px; }
.planning-check-all { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.planning-user-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.planning-user-card { display: grid; grid-template-columns: auto 44px minmax(0, 1fr); align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--border-color); border-radius: 12px; cursor: pointer; }
.planning-user-card:has(input:checked) { border-color: var(--primary); background: #effaf6; }
.planning-user-card span:last-child { display: grid; gap: 2px; min-width: 0; }
.planning-user-card small { color: var(--muted); }
.kpi-filter-panel { padding: 24px; }
.kpi-filter-grid { display: grid; grid-template-columns: 1.4fr 1.2fr 1fr auto; gap: 16px; align-items: end; margin-top: 20px; }
.kpi-filter-grid label { display: grid; gap: 8px; font-weight: 700; }
.kpi-filter-grid select, .kpi-filter-grid input { height: 50px; border: 1px solid #d7e1e6; border-radius: 12px; background-color: #fff; color:#132432; font: inherit; font-weight: 600; }
.kpi-filter-grid select { padding: 0 46px 0 15px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%235f7180' stroke-width='2'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
.kpi-employee-search { position:relative; }
.kpi-employee-search input { width:100%; padding:0 40px 0 44px; }
.kpi-employee-search svg { position:absolute; left:15px; top:50%; width:20px; height:20px; transform:translateY(-50%); stroke:#647783; stroke-width:2; pointer-events:none; z-index:1; }
.kpi-filter-grid input::placeholder { color:#82919c; font-weight:500; }
.kpi-filter-grid select:focus, .kpi-filter-grid input:focus { outline: none; border-color: #078364; box-shadow: 0 0 0 4px rgba(7,131,100,.12); }
.kpi-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; }
.kpi-stat-card { display: flex; align-items: center; gap: 12px; padding: 14px 16px; min-height: 108px; }
.kpi-stat-card > div { display: grid; gap: 3px; }
.kpi-stat-card small, .kpi-stat-card span:last-child { color: var(--muted); }
.kpi-stat-card strong { font-size: 26px; line-height: 1; }
.kpi-stat-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-weight: 900; flex: 0 0 42px; }
.kpi-stat-icon.blue { color:#2165c5; background:#eaf2ff; }.kpi-stat-icon.green { color:#078364; background:#e0f6ef; }.kpi-stat-icon.amber { color:#b46a00; background:#fff2d8; }.kpi-stat-icon.red { color:#c43d3d; background:#fde8e8; }
.kpi-overview-grid { display:grid; grid-template-columns: 1.2fr 1fr; gap:12px; }
.kpi-progress-panel, .kpi-revenue-panel { min-height:132px; padding:16px 20px; display:flex; align-items:center; justify-content:space-between; }
.kpi-progress-panel h2, .kpi-revenue-panel h2 { margin:4px 0; font-size:26px; }.kpi-revenue-panel h2 small { font-size:13px; color:var(--muted); }
.kpi-ring { --kpi-value:0; width:88px; aspect-ratio:1; border-radius:50%; display:grid; place-items:center; background:conic-gradient(#078364 calc(var(--kpi-value) * 1%), #e7efec 0); position:relative; }
.kpi-ring::after { content:""; position:absolute; inset:8px; border-radius:50%; background:#fff; }.kpi-ring span { z-index:1; font-size:18px; font-weight:900; }
.kpi-revenue-mark { width:56px; height:56px; border-radius:16px; display:grid; place-items:center; color:#078364; background:#e0f6ef; font-size:28px; font-weight:900; }
.kpi-person { display:flex; align-items:center; gap:10px; }.kpi-person > span:last-child { display:grid; gap:2px; }.kpi-person small { color:var(--muted); }
.kpi-inline-progress { display:flex; align-items:center; gap:10px; min-width:150px; }.kpi-inline-progress > div { height:8px; flex:1; border-radius:20px; background:#e7efec; overflow:hidden; }.kpi-inline-progress > div span { display:block; height:100%; border-radius:inherit; background:#078364; }
.text-success { color:#078364; font-weight:800; }.text-danger { color:#c43d3d; font-weight:800; }
.notification-filter-grid { grid-template-columns: 1.5fr 1fr 1fr auto; }
.notification-list-real { display:grid; gap:8px; }
.notification-card-real { display:grid; grid-template-columns:38px minmax(0,1fr) auto; gap:12px; align-items:center; padding:10px 12px; border:1px solid #dce6e9; border-radius:12px; background:#fff; }
.notification-card-real.unread { border-color:#a9d9cc; background:#f3fbf8; box-shadow:inset 4px 0 #078364; }
.notification-type-icon { width:36px; height:36px; display:grid; place-items:center; border-radius:10px; background:#e0f6ef; color:#078364; font-size:13px; font-weight:900; }
.notification-card-real p { margin:3px 0; color:#536875; line-height:1.35; }.notification-card-real small { color:var(--muted); }
.notification-card-real .secondary-button { padding:8px 12px; min-height:36px; }
.notification-card-title { display:flex; align-items:center; gap:10px; }

@media (max-width: 1100px) {
  .planning-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .planning-user-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-filter-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .kpi-summary-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 760px) {
  .planning-fields, .planning-user-grid { grid-template-columns: 1fr; }
  .kpi-filter-grid, .kpi-summary-grid, .kpi-overview-grid { grid-template-columns: 1fr; }
  .planning-employee-header { align-items: flex-start; flex-direction: column; }
  .allocation-toolbar {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .allocation-user-field {
    min-width: 0;
    width: 100%;
  }
}

.crm-toast {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
  color: var(--text);
  pointer-events: auto;
  animation: toast-slide-in 0.18s ease-out;
}

.crm-toast.success {
  border-color: var(--primary-soft);
  background: #e0f7ef;
}

.crm-toast.error {
  border-color: var(--danger-soft);
  background: #fde2e2;
}

.crm-toast strong {
  font-weight: 900;
}

.crm-toast span {
  grid-column: 1;
  color: var(--muted);
  font-weight: 700;
}

.crm-toast button {
  grid-column: 2;
  grid-row: 1 / span 2;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  font-weight: 900;
}

.crm-toast.closing {
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

@keyframes toast-slide-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.customer-filter-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: end;
}

.customer-filter-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-width: 240px;
}

body.modal-screen-locked {
  overflow: hidden;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.42);
}

.management-report-backdrop{z-index:1200;padding:24px;background:rgba(10,28,39,.68);backdrop-filter:blur(5px)}
.management-report-modal{width:min(1180px,96vw);max-height:94vh;background:#eef3f5;border-radius:20px;box-shadow:0 28px 80px rgba(6,24,35,.32);overflow:hidden;display:flex;flex-direction:column}
.management-report-toolbar{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:18px 22px;background:#fff;border-bottom:1px solid #dce5e9}
.management-report-toolbar h2{margin:2px 0 0;font-size:1.25rem}
.management-report-toolbar-actions{display:flex;align-items:center;gap:10px}.management-report-toolbar-actions form{margin:0}
.management-report-scroll{padding:24px;overflow:auto}
.management-report-paper{max-width:1060px;margin:auto;background:#fff;border-radius:12px;padding:40px 44px;box-shadow:0 8px 26px rgba(27,55,68,.1);color:#172b3a}
.management-report-brand{display:flex;align-items:center;gap:26px;padding-bottom:22px;border-bottom:3px solid #087c68}
.management-report-brand img{width:230px;height:auto;max-height:80px;object-fit:contain}.management-report-brand h3{margin:4px 0 8px;color:#172b3a;font-size:1.35rem}.management-report-brand p{margin:3px 0;color:#60727f;font-size:.9rem}.management-report-brand p span{margin:0 7px;color:#a6b4bc}.management-report-internal-label{display:inline-flex;padding:4px 10px;border-radius:999px;background:#e4f5ef;color:#087c68;font-size:.72rem;font-weight:800;letter-spacing:.12em}
.management-report-heading{text-align:center;padding:30px 0 22px}.management-report-heading p{margin:0;color:#087c68;font-weight:800;letter-spacing:.16em}.management-report-heading h1{margin:7px 0 10px;font-size:2rem}.management-report-heading>span{display:block;margin-top:4px;color:#60727f}
.management-report-scope{display:grid;grid-template-columns:1fr 1fr;margin:0 0 20px;border:1px solid #d7e3e7;border-radius:12px;overflow:hidden;background:#fbfdfd}.management-report-scope div{display:flex;align-items:center;gap:7px;min-height:46px;padding:10px 14px;border-bottom:1px solid #e5edef}.management-report-scope div:nth-child(odd){border-right:1px solid #e5edef}.management-report-scope div:nth-last-child(-n+2){border-bottom:0}.management-report-scope span{color:#647681;font-weight:700}.management-report-scope strong{color:#172b3a}.management-report-scope i{margin:0 4px;color:#91a0a8;font-style:normal}
.management-report-summary{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-bottom:28px}.management-report-summary div{padding:16px;border:1px solid #d9e7e3;border-radius:12px;background:#f4faf8}.management-report-summary span{display:block;color:#667984;font-size:.82rem;font-weight:700;text-transform:uppercase}.management-report-summary strong{display:block;margin-top:7px;color:#087c68;font-size:1.35rem}
.management-report-detail h3{margin:0 0 12px;color:#087c68}.management-report-detail .data-table{font-size:.86rem}.management-report-detail .data-table th{background:#087c68;color:#fff;white-space:nowrap}
.management-report-sign-date{margin:36px 0 0;text-align:right;color:#667984;font-size:.9rem}.management-report-footer{display:grid;grid-template-columns:repeat(3,1fr);gap:32px;margin-top:10px;text-align:center}.management-report-footer div{min-height:190px}.management-report-footer p,.management-report-footer span{display:block;margin:4px 0;color:#667984;font-size:.87rem}.management-report-footer strong{display:block;margin:8px 0}.management-report-footer b{display:block;margin-top:68px;color:#172b3a;font-size:.95rem}
@media(max-width:800px){.management-report-backdrop{padding:0}.management-report-modal{width:100vw;max-height:100vh;border-radius:0}.management-report-toolbar{padding:14px}.management-report-scroll{padding:10px}.management-report-paper{padding:24px 18px}.management-report-brand{align-items:flex-start}.management-report-brand img{width:64px}.management-report-scope{grid-template-columns:1fr}.management-report-scope div,.management-report-scope div:nth-child(odd){border-right:0;border-bottom:1px solid #e5edef}.management-report-scope div:last-child{border-bottom:0}.management-report-summary{grid-template-columns:repeat(2,1fr)}.management-report-footer{grid-template-columns:1fr;gap:20px}}

.modal-panel {
  width: min(760px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
}

.consultation-modal {
  width: min(1080px, 100%);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.modal-header h2 {
  margin: 0;
  font-size: 22px;
}

.modal-close-button {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
}

.modal-close-button span {
  transform: translateY(-1px);
}

.modal-form {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.form-grid {
  display: grid;
  gap: 14px;
}

.form-grid.two-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid.three-columns {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-grid .full-row {
  grid-column: 1 / -1;
}

.field-block {
  display: grid;
  gap: 8px;
}

.field-block > span {
  font-weight: 700;
}

.radio-choice-group {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.radio-choice-group label {
  width: auto;
  min-width: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.radio-choice-group input[type="radio"] {
  appearance: auto;
  width: 14px;
  height: 14px;
  min-width: 14px;
  min-height: 14px;
  max-width: 14px;
  max-height: 14px;
  margin: 0;
  flex: 0 0 auto;
}

.radio-choice-group span {
  display: inline-block;
  line-height: 1;
}

.address-fieldset {
  grid-column: 1 / -1;
  display: grid;
  gap: 12px;
  margin: 2px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.address-fieldset legend {
  width: auto;
  padding: 0 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.compact-grid {
  gap: 12px;
}

.modal-form label {
  display: grid;
  gap: 7px;
  font-weight: 800;
}

.modal-form input,
.modal-form select,
.modal-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  color: var(--text);
  background: #ffffff;
}

.modal-form textarea {
  resize: vertical;
}

.richtext-field {
  align-self: stretch;
}

.richtext-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: #f8fafc;
}

.richtext-toolbar button {
  min-width: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 10px;
  background: #ffffff;
  color: var(--text);
  font-weight: 900;
}

.richtext-editor {
  min-height: 220px;
  max-height: 360px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 0 0 8px 8px;
  padding: 12px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
  line-height: 1.55;
  outline: none;
}

.richtext-editor:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(0, 122, 104, 0.12);
}

.richtext-editor:empty::before {
  content: attr(data-placeholder);
  color: #94a3b8;
  pointer-events: none;
}

.required-symbol {
  color: #dc2626;
}

.lookup-feedback {
  display: block;
  min-height: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.lookup-feedback.success { color: #047857; }
.lookup-feedback.error { color: #dc2626; }
.lookup-feedback:empty { display: none; }

.table-link-button {
  appearance: none;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.table-link-button:hover {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.table-link-button:focus-visible {
  border-radius: 4px;
  outline: 2px solid var(--brand);
  outline-offset: 3px;
}

.calendar-heading {
  align-items: center;
}

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

.month-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(120px, 1fr));
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.calendar-weekday {
  min-height: 42px;
  padding: 12px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.calendar-weekday:nth-child(7n) {
  border-right: 0;
}

.calendar-day {
  min-height: 132px;
  padding: 10px;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.calendar-day:nth-child(7n) {
  border-right: 0;
}

.calendar-day.muted {
  background: #f8fafc;
  color: var(--muted);
}

.calendar-day.today {
  box-shadow: inset 0 0 0 2px var(--brand);
}

.calendar-day:hover {
  background: var(--primary-soft);
}

.calendar-date {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  border-radius: 999px;
  font-weight: 900;
}

.calendar-day.today .calendar-date {
  background: var(--brand);
  color: #ffffff;
}

.calendar-event {
  display: block;
  margin-top: 8px;
  padding: 7px 8px;
  border-radius: 6px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.35;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.segmented-control {
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf9;
}

.segmented-control a,
.segmented-control button {
  min-height: 30px;
  border: 0;
  color: var(--muted);
  text-decoration: none;
}

.segmented-control a.active,
.segmented-control button.active {
  background: var(--primary);
  color: #ffffff;
}

.admin-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
}

.summary-card {
  display: grid;
  gap: 6px;
  min-height: 104px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.summary-card span,
.summary-card em {
  color: var(--muted);
}

.summary-card strong {
  font-size: 28px;
  line-height: 1;
}

.summary-card em {
  font-style: normal;
  font-weight: 800;
  font-size: 12px;
}

.summary-card.good em {
  color: var(--primary);
}

.summary-card.warn em {
  color: var(--warn);
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.filter-grid label {
  display: grid;
  gap: 6px;
  margin: 0;
  font-weight: 800;
}

.filter-grid input,
.filter-grid select,
.role-form input,
.role-form select,
.role-form textarea {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
}

.filter-actions {
  display: flex;
  align-items: end;
  gap: 8px;
  flex-wrap: wrap;
}

.user-management-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  gap: 18px;
  align-items: start;
}

.access-denied-page {
  display: grid;
  min-height: calc(100vh - 130px);
  padding: 24px;
  place-items: center;
}

.access-denied-card {
  width: min(620px, 100%);
  padding: 42px;
  text-align: center;
}

.access-denied-icon {
  display: grid;
  width: 64px;
  height: 64px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: #fee2e2;
  color: #b42318;
  font-size: 2rem;
  font-weight: 900;
  place-items: center;
}

.access-denied-card h2 {
  margin: 8px 0 12px;
}

.access-denied-actions {
  justify-content: center;
  margin-top: 24px;
}

.user-list-panel,
.user-detail-panel {
  min-height: 100%;
}

.user-detail-modal {
  width: min(720px, 100%);
}

.user-detail-body {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.user-table td {
  vertical-align: middle;
}

.user-id-cell {
  white-space: nowrap;
  font-weight: 600;
  color: var(--ink-soft);
}

.user-cell,
.selected-user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 260px;
}

.user-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 900;
}

.user-avatar.large {
  width: 56px;
  height: 56px;
  font-size: 18px;
}

.selected-user-card {
  align-items: center;
  min-width: 0;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.selected-user-card h2 {
  margin: 0 0 3px;
  font-size: 22px;
  line-height: 1.2;
}

.selected-user-card span,
.detail-list dt,
.permission-box span {
  color: var(--muted);
}

.detail-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.detail-list div {
  display: grid;
  gap: 6px;
  align-content: start;
  min-height: 78px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.detail-list dt,
.detail-list dd {
  margin: 0;
}

.detail-list dt {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.detail-list dd {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 800;
  line-height: 1.35;
}

.permission-box {
  display: grid;
  gap: 8px;
  margin: 16px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.role-management-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 380px);
  gap: 18px;
  align-items: start;
}

.org-management-grid {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.org-tree-panel {
  position: sticky;
  top: 84px;
}

.org-tree {
  display: grid;
  gap: 6px;
}

.org-tree-group {
  display: grid;
  gap: 6px;
}

.org-tree-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
}

.org-tree-summary::-webkit-details-marker {
  display: none;
}

.org-tree-summary::before {
  content: "›";
  color: var(--muted);
  font-size: 18px;
  font-weight: 900;
  transform: rotate(0deg);
  transition: transform 0.16s ease;
}

.org-tree-group[open] > .org-tree-summary::before {
  transform: rotate(90deg);
}

.org-tree-summary:hover,
.org-tree-summary.active {
  border-color: var(--line);
  background: var(--surface-muted);
}

.org-tree-summary.active {
  color: var(--brand);
}

.org-tree-children {
  display: grid;
  gap: 6px;
  margin-left: 18px;
  padding-left: 12px;
  border-left: 1px solid var(--line);
}

.org-tree-group.nested {
  margin-left: 0;
}

.org-tree-summary.room {
  padding-left: 10px;
}

.org-tree-node {
  display: grid;
  gap: 3px;
  padding: 10px 12px 10px calc(12px + var(--tree-depth, 0) * 18px);
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
}

.org-tree-node:hover,
.org-tree-node.active {
  border-color: var(--line);
  background: var(--surface-muted);
}

.org-tree-node.active {
  color: var(--brand);
}

.org-tree-node.root {
  margin-bottom: 2px;
}

.org-tree-node.compact {
  padding: 9px 10px;
}

.area-menu {
  gap: 8px;
}

.area-menu-group {
  display: grid;
  gap: 6px;
}

.area-menu-item {
  padding: 12px 14px;
}

.area-menu-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.area-room-list {
  display: grid;
  gap: 6px;
  margin-left: 16px;
  padding-left: 12px;
  border-left: 1px solid var(--line);
}

.room-menu-item {
  padding: 9px 10px;
}

.tree-node-type {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.permission-management-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 440px);
  gap: 18px;
  align-items: start;
}

.role-form-panel h2 {
  margin: 0 0 14px;
  font-size: 20px;
}

.role-form {
  display: grid;
  gap: 12px;
}

.role-form label {
  display: grid;
  gap: 6px;
  margin: 0;
  font-weight: 800;
}

.template-download-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.inline-download-link {
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
  text-align: right;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.inline-download-link.disabled {
  color: var(--muted);
  pointer-events: none;
  text-decoration: none;
}

.role-form textarea {
  resize: vertical;
}

.check-row {
  display: flex !important;
  align-items: center;
  grid-template-columns: none;
}

.check-row input {
  width: 18px;
  min-height: 18px;
}

.row-actions form {
  margin: 0;
}

.customer-search-result {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  color: var(--muted);
}

.customer-search-result strong {
  color: var(--text);
}

.profile-subtable {
  margin-bottom: 18px;
}

.profile-finance-area {
  margin-top: 18px;
}

.profile-finance-area:first-of-type {
  margin-top: 0;
}

.profile-finance-area h3 {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
}

.clickable-row {
  cursor: pointer;
}

.clickable-row.selected,
.clickable-row:hover {
  background: #eef8f5;
}

.document-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.document-current-image {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.document-current-image[hidden] {
  display: none;
}

.document-current-image span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.document-current-image-button {
  width: min(360px, 100%);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
  overflow: hidden;
}

.document-current-image-button img {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  background: #f8fafc;
}

.document-file-viewer {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.document-file-viewer[hidden] {
  display: none;
}

.document-file-viewer span,
.document-file-meta span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.document-file-list {
  display: grid;
  gap: 8px;
}

.document-file-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.document-file-meta {
  min-width: 0;
}

.document-file-meta strong {
  display: block;
  overflow-wrap: anywhere;
}

.document-file-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.document-open-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--primary);
  font-weight: 800;
  text-decoration: none;
}

.document-open-link:hover {
  background: #eef8f5;
}

.document-detail-grid label {
  display: grid;
  gap: 6px;
  min-height: 68px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.document-detail-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.document-detail-grid strong {
  overflow-wrap: anywhere;
}

.document-file-link {
  justify-self: start;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--primary);
  font-weight: 800;
  cursor: pointer;
}

.document-file-url {
  display: block;
  margin-bottom: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: #334155;
  font-family: Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: normal;
}

.document-file-url[hidden] {
  display: none;
}

.document-file-link:hover {
  background: #eef8f5;
}

.document-file-link[hidden] {
  display: none;
}

.document-preview-button {
  white-space: nowrap;
}

.document-preview-modal {
  width: min(1180px, 100%);
}

.document-preview-body {
  display: grid;
  place-items: center;
  min-height: min(72vh, 760px);
  padding: 18px;
  background: #f8fafc;
}

.document-preview-image {
  max-width: 100%;
  max-height: calc(100vh - 180px);
  border-radius: 8px;
  object-fit: contain;
}

.document-preview-frame {
  width: 100%;
  height: calc(100vh - 180px);
  min-height: 560px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 220px;
}

.sync-job-list {
  display: grid;
  gap: 12px;
}

.sync-job-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.sync-job-card > div:first-child {
  display: grid;
  gap: 4px;
}

.sync-job-card strong {
  color: var(--ink);
}

.sync-job-card span,
.sync-job-card dd {
  color: var(--muted);
}

.sync-job-card dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.sync-job-card dl div {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 10px;
}

.sync-job-card dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.sync-job-card dd {
  margin: 0;
  word-break: break-word;
}

.operation-dashboard {
  display: grid;
  gap: 20px;
}

.operation-hero,
.operation-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 16px;
}

.personal-kpi-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.personal-kpi-card h2 {
  font-size: 42px;
  line-height: 1;
  margin: 6px 0;
}

.radial-progress {
  --size: 150px;
  --track: #e6edf1;
  --fill: #078568;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--fill) calc(var(--value) * 1%), var(--track) 0);
  flex: 0 0 auto;
}

.radial-progress::before {
  content: "";
  position: absolute;
}

.radial-progress strong {
  width: calc(var(--size) - 34px);
  height: calc(var(--size) - 34px);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff;
  color: var(--ink);
  font-size: 28px;
}

.kpi-breakdown {
  display: grid;
  gap: 14px;
}

.kpi-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.kpi-line span {
  color: var(--muted);
  font-weight: 800;
}

.kpi-line strong {
  font-size: 26px;
}

.chart-panel {
  min-height: 330px;
}

.bar-chart {
  min-height: 190px;
  display: grid;
  grid-template-columns: repeat(6, minmax(46px, 1fr));
  gap: 12px;
  align-items: end;
  padding: 18px 0 8px;
}

.bar-group {
  display: grid;
  gap: 8px;
  justify-items: center;
}

.bars {
  height: 150px;
  display: flex;
  align-items: end;
  gap: 6px;
}

.bar {
  width: 14px;
  border-radius: 8px 8px 2px 2px;
  display: block;
}

.bar.total {
  background: #b9c8d5;
}

.bar.success {
  background: #078568;
}

.bar-group strong {
  color: var(--ink);
}

.bar-group small {
  color: var(--muted);
  font-weight: 800;
}

.chart-legend {
  display: flex;
  gap: 16px;
  color: var(--muted);
  font-weight: 800;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chart-legend i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.legend-total {
  background: #b9c8d5;
}

.legend-success {
  background: #078568;
}

.revenue-chart {
  display: grid;
  gap: 16px;
  padding-top: 16px;
}

.revenue-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 48px;
  align-items: center;
  gap: 12px;
}

.revenue-row span,
.revenue-row strong {
  font-weight: 900;
}

.progress-track {
  height: 12px;
  border-radius: 999px;
  background: #e6edf1;
  overflow: hidden;
}

.progress-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #078568, #17a889);
}

.overdue-panel {
  overflow: hidden;
}

.overview-chart-panel {
  display: grid;
  gap: 16px;
}

.overview-bars {
  min-height: 220px;
  display: grid;
  grid-template-columns: repeat(4, minmax(90px, 1fr));
  gap: 14px;
  align-items: end;
}

.overview-bar {
  display: grid;
  gap: 8px;
  justify-items: center;
  align-content: end;
}

.overview-bar span {
  width: 46px;
  min-height: 18px;
  border-radius: 8px 8px 2px 2px;
  background: linear-gradient(180deg, #17a889, #078568);
}

.overview-bar strong {
  color: var(--ink);
}

.overview-bar em {
  color: var(--muted);
  font-style: normal;
  font-weight: 800;
  text-align: center;
}

.revenue-overview-bars {
  grid-template-columns: repeat(4, minmax(110px, 1fr));
}

.permission-group {
  display: grid;
  gap: 10px;
}

.permission-group > strong {
  font-size: 13px;
  text-transform: uppercase;
}

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

.check-card {
  display: grid !important;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 8px !important;
  min-height: 52px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.check-card input {
  width: 18px;
  min-height: 18px;
}

.check-card b,
.check-card small {
  display: block;
}

.check-card small {
  color: var(--muted);
}

.permission-matrix {
  display: grid;
  gap: 8px;
  overflow-x: auto;
}

.matrix-row {
  display: grid;
  grid-template-columns: 128px repeat(5, minmax(74px, 1fr));
  gap: 6px;
  align-items: stretch;
  min-width: 540px;
}

.matrix-row > span,
.matrix-row label {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  font-weight: 800;
}

.matrix-row > span {
  background: #f7faf9;
}

.matrix-row label {
  justify-content: center;
  gap: 6px;
  font-size: 12px;
}

.matrix-row input {
  width: 16px;
  min-height: 16px;
}

.zalo-nav-icon { background: #0877e8 !important; color: #fff !important; }
.zalo-page { display: grid; gap: 18px; }
.zalo-sms-action{border-color:#b9dafe!important;background:#eef7ff!important;color:#0877e8!important}.zalo-sms-action:hover{border-color:#0877e8!important;background:#0877e8!important;color:#fff!important}
.customer-zalo-id{display:inline-block;max-width:180px;overflow:hidden;color:#0877e8;font-size:12px;font-weight:700;text-overflow:ellipsis;white-space:nowrap;vertical-align:middle}.customer-zalo-id.empty{padding:3px 7px;border-radius:5px;background:#f1f4f6;color:#788692;font-size:10px;font-weight:600}
.user-filter-panel{position:relative}.zalo-user-sync-form{position:absolute;right:22px;bottom:22px}.zalo-user-sync-button{display:flex;align-items:center;gap:7px;min-height:42px;border-color:#a7cdf5!important;background:#eef7ff!important;color:#0877e8!important;font-weight:800}.zalo-user-sync-button:hover{border-color:#0877e8!important;background:#0877e8!important;color:#fff!important}.zalo-user-sync-button span{font-size:18px}@media(max-width:1100px){.zalo-user-sync-form{position:static;margin:12px 0 0}.zalo-user-sync-button{width:100%;justify-content:center}}
.zalo-page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.zalo-title-row { display:flex;align-items:center;gap:14px;flex-wrap:wrap }
.zalo-page-heading h2 { margin: 2px 0 5px; font-size: 24px;white-space:nowrap }
.zalo-page-heading > div > p:last-child { margin: 0; color: var(--muted); font-size: 14px; }
.zalo-connected-profile { display:flex;align-items:center;gap:8px;padding:5px 9px;border:1px solid #cfe5dc;border-radius:8px;background:#f1faf7;box-shadow:0 3px 10px rgba(13,120,86,.06) }
.zalo-connected-profile>img,.zalo-connected-profile>span { width:30px;height:30px;flex:0 0 30px;border-radius:50%;object-fit:cover }
.zalo-connected-profile>span { display:grid;place-items:center;background:#0877e8;color:#fff;font-size:13px;font-weight:900 }
.zalo-connected-profile>div { display:grid;grid-template-columns:auto auto;column-gap:6px;align-items:center;min-width:0 }
.zalo-connected-profile small { grid-column:1/-1;color:#6c7d89;font-size:8px;font-style:normal;line-height:1.1 }
.zalo-connected-profile strong { max-width:150px;overflow:hidden;color:#152431;font-size:11px;line-height:1.2;text-overflow:ellipsis;white-space:nowrap }
.zalo-connected-profile em { color:#557266;font-size:8px;font-style:normal;white-space:nowrap }
.zalo-connected-profile em i { display:inline-block;width:5px;height:5px;margin-right:2px;border-radius:50%;background:#16a673 }
.zalo-connect-button { display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 16px; border: 0; border-radius: 8px; background: #0877e8; color: #fff; font-weight: 800; cursor: pointer; box-shadow: 0 8px 18px rgba(8,119,232,.2); }
.zalo-connect-button span { font-size: 20px; font-weight: 400; }
.zalo-connection-actions { display:flex;align-items:center;justify-content:flex-end;gap:10px;flex-wrap:wrap }
.zalo-disconnect-button { min-height:42px;padding:0 16px;border:1px solid #efb4b4;border-radius:8px;background:#fff;color:#c52b2b;font-weight:800;cursor:pointer }
.zalo-disconnect-button:hover { background:#fff2f2;border-color:#df7777 }
.zalo-disconnect-button:disabled { cursor:wait;opacity:.65 }
.facebook-page button:disabled,.facebook-page input:disabled,.facebook-page select:disabled{cursor:not-allowed;opacity:.62}
.zalo-summary { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.zalo-summary article { display: flex; align-items: center; gap: 12px; min-height: 78px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.zalo-summary-icon { display: grid; place-items: center; width: 42px; height: 42px; flex: 0 0 auto; border-radius: 10px; font-weight: 900; }
.zalo-summary-icon.blue { background:#e6f1ff;color:#0877e8 }.zalo-summary-icon.green{background:#e4f7ef;color:#07845f}.zalo-summary-icon.orange{background:#fff0df;color:#d66b00}.zalo-summary-icon.violet{background:#f0eaff;color:#7651c9}
.zalo-summary article>div { display:flex;align-items:baseline;gap:8px;min-width:0 }.zalo-summary strong,.zalo-summary small { display:block }.zalo-summary strong{font-size:22px}.zalo-summary small{margin:0;color:var(--muted);font-size:12px;white-space:nowrap}
.zalo-workspace { display: grid; grid-template-columns: 285px minmax(0,1fr); min-height: 570px; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background:#fff; box-shadow: 0 10px 28px rgba(21,36,49,.06); }
.zalo-accounts { padding: 16px 12px; border-right: 1px solid var(--line); background:#fbfcfd; }
.zalo-section-title { display:flex; align-items:center; justify-content:space-between; padding: 2px 7px 13px; }
.zalo-section-title strong,.zalo-section-title small { display:block }.zalo-section-title small{margin-top:4px;color:var(--muted);font-size:11px}
.zalo-section-title button { width:32px;height:32px;border:1px solid var(--line);border-radius:7px;background:#fff;color:#0877e8;font-size:18px;cursor:pointer }
.zalo-section-title button.syncing { animation:zalo-spin .8s linear infinite } @keyframes zalo-spin{to{transform:rotate(360deg)}}
.zalo-account { width:100%;display:grid;grid-template-columns:42px minmax(0,1fr) auto;align-items:center;gap:10px;padding:10px;border:0;border-radius:8px;background:transparent;text-align:left;color:var(--text);cursor:pointer }
.zalo-account:hover{background:#f0f6fb}.zalo-account.active{background:#e9f3ff;color:#075faf}.zalo-account>span:nth-child(2){min-width:0}.zalo-account strong,.zalo-account small{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.zalo-account strong{font-size:13px}.zalo-account small{margin-top:4px;color:var(--muted);font-size:10px}.zalo-account small i,.zalo-chat-header p i,.zalo-contact-head>span i{display:inline-block;width:7px;height:7px;border-radius:50%;background:#16a673}.zalo-account>b{display:grid;place-items:center;min-width:20px;height:20px;padding:0 5px;border-radius:10px;background:#0877e8;color:#fff;font-size:10px}
.zalo-account-avatar,.zalo-contact-avatar{position:relative;display:grid;place-items:center;flex:0 0 auto;border-radius:50%;background:#dcecff;color:#0877e8;font-weight:900}.zalo-account-avatar{width:42px;height:42px;font-size:12px}.zalo-account-avatar.all{border-radius:10px;background:#0877e8;color:#fff;font-size:18px}.zalo-account-avatar.purple{background:#eee7ff;color:#7651c9}.zalo-account-avatar.orange{background:#fff0df;color:#c96508}
.zalo-segment-icon{display:grid;place-items:center;width:42px;height:42px;border-radius:11px;background:#e7f1ff;color:#0877e8;font-size:15px;font-weight:900}.zalo-segment-icon.all{background:#0877e8;color:#fff;font-size:12px}.zalo-segment-icon.cared{background:#e2f6ee;color:#087755}.zalo-segment-icon.unread{background:#fff0df;color:#c96508}.zalo-segment-icon.contacted{background:#eee8ff;color:#7651c9}.zalo-segment-icon.uncontacted{background:#fff0df;color:#c96508}
.zalo-account-note{display:flex;gap:9px;margin:18px 5px 0;padding:11px;border-radius:8px;background:#f0f7ff;color:#34536f}.zalo-account-note>span{display:grid;place-items:center;width:19px;height:19px;flex:0 0 auto;border-radius:50%;background:#d5eaff;color:#0877e8;font-size:11px;font-weight:900}.zalo-account-note p{margin:0;font-size:10px;line-height:1.45}.zalo-account-note strong{display:block;margin-bottom:2px;font-size:11px}
.zalo-contacts-panel{min-width:0}.zalo-toolbar{display:grid;grid-template-columns:minmax(250px,1fr) 190px auto;gap:10px;padding:15px 18px;border-bottom:1px solid var(--line)}
.zalo-search{display:flex;align-items:center;gap:8px;min-height:40px;padding:0 12px;border:1px solid var(--line);border-radius:7px;background:#fff}.zalo-search span{color:#7b8997;font-size:20px}.zalo-search input{width:100%;min-height:36px;border:0;outline:0;font-size:12px}.zalo-toolbar select,.zalo-filter-button{min-height:40px;padding:0 11px;border:1px solid var(--line);border-radius:7px;background:#fff;color:var(--text);font-size:12px}.zalo-filter-button{font-weight:700;cursor:pointer}
.zalo-contact-head{display:flex;align-items:center;justify-content:space-between;padding:14px 18px;background:#fafcfd;border-bottom:1px solid var(--line)}.zalo-contact-head strong,.zalo-contact-head small{display:block}.zalo-contact-head strong{font-size:13px}.zalo-contact-head small,.zalo-contact-head>span{margin-top:3px;color:var(--muted);font-size:10px}.zalo-contact-head>span i{margin-right:4px}
.zalo-contact-columns{display:grid;grid-template-columns:minmax(210px,1fr) 145px 130px 105px 135px 115px;gap:11px;padding:8px 18px 8px 71px;border-bottom:1px solid var(--line);background:#f7f9fb;color:#71808e;font-size:10px;font-weight:700;text-transform:uppercase}.zalo-contact-list{display:grid;transition:opacity .15s ease}.zalo-contact-list.loading{opacity:.45;pointer-events:none}.zalo-contact{display:grid;grid-template-columns:42px minmax(170px,1fr) 145px 130px 105px 135px 115px;align-items:center;gap:11px;min-height:64px;padding:8px 18px;border:0;border-bottom:1px solid #edf1f3;background:#fff;text-align:left;color:var(--text);cursor:pointer}.zalo-contact:hover{background:#f5f9fc}.zalo-contact.unread{background:#f5f9ff}.zalo-contact-avatar{width:40px;height:40px;font-size:12px}.zalo-contact-avatar i{position:absolute;right:0;bottom:1px;width:10px;height:10px;border:2px solid #fff;border-radius:50%;background:#16a673}.zalo-contact-avatar.blue{background:#dcecff;color:#0877e8}.zalo-contact-avatar.purple{background:#eee7ff;color:#7651c9}.zalo-contact-avatar.orange{background:#ffead5;color:#ca6500}.zalo-contact-avatar.green{background:#ddf5e9;color:#087755}.zalo-contact-avatar.pink{background:#ffe3ec;color:#c43f6d}.zalo-contact-avatar.teal{background:#dff5f3;color:#087e77}
.zalo-contact-main{min-width:0}.zalo-contact-main strong,.zalo-contact-main small,.zalo-contact-main em{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.zalo-contact-main strong{font-size:13px}.zalo-contact-main small{margin-top:2px;color:#7b8997;font-size:10px}.zalo-contact-main em{margin-top:4px;color:#52616f;font-size:11px;font-style:normal}.zalo-contact.unread .zalo-contact-main em{color:#1b3346;font-weight:800}.zalo-contact-meta{align-self:stretch;display:flex;flex-direction:column;align-items:flex-end;justify-content:center;gap:5px}.zalo-contact-meta time{color:#7b8997;font-size:10px}.zalo-contact-meta b{display:grid;place-items:center;min-width:18px;height:18px;padding:0 5px;border-radius:9px;background:#0877e8;color:#fff;font-size:9px}.zalo-contact-meta small{max-width:100%;padding:3px 6px;border-radius:4px;background:#e9f6f1;color:#14745a;font-size:9px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.zalo-contact-meta small.unassigned{background:#fff2dc;color:#a96808}.zalo-empty{padding:60px 20px;text-align:center;color:var(--muted)}
.zalo-contact-id,.zalo-contact-phone{color:#34495a;font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.zalo-contact-id{font-family:ui-monospace,SFMono-Regular,Consolas,monospace;color:#526779}.zalo-contact-status{display:flex;align-items:center;gap:6px;color:#788692;font-size:11px;white-space:nowrap}.zalo-contact-status i{width:8px;height:8px;border-radius:50%;background:#aab4bd}.zalo-contact-status.online{color:#087755;font-weight:700}.zalo-contact-status.online i{background:#16a673;box-shadow:0 0 0 3px #dff5ec}
.zalo-contact-sync{display:flex;align-items:center;gap:6px;color:#a96808;font-size:11px;white-space:nowrap}.zalo-contact-sync i{display:grid;place-items:center;width:18px;height:18px;border-radius:50%;background:#fff2dc;font-size:10px;font-style:normal}.zalo-contact-sync.synced{color:#087755;font-weight:700}.zalo-contact-sync.synced i{background:#dff5ec}
.zalo-pagination{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:58px;padding:10px 18px;border-top:1px solid var(--line);background:#fafcfd}.zalo-pagination>span{color:#667586;font-size:11px}.zalo-pagination>div,.zalo-pagination [data-page-numbers]{display:flex;align-items:center;gap:5px}.zalo-pagination a{display:grid;place-items:center;min-width:32px;height:32px;padding:0 9px;border:1px solid #d8e1e8;border-radius:7px;background:#fff;color:#34495a;font-size:12px;font-weight:700;text-decoration:none;cursor:pointer}.zalo-pagination a:hover:not([aria-disabled="true"]),.zalo-pagination a.active{border-color:#0877e8;background:#0877e8;color:#fff}.zalo-pagination a[aria-disabled="true"]{opacity:.4;pointer-events:none;cursor:not-allowed}.zalo-page-dots{padding:0 3px;color:#7b8997}
.zalo-contact-avatar.gateway{overflow:hidden;background:#e8eef3}.zalo-contact-avatar.gateway img{width:100%;height:100%;object-fit:cover}
.zalo-screen-loading{overflow:hidden}.zalo-screen-loader{position:fixed;inset:0;z-index:5000;display:grid;place-items:center;background:rgba(14,29,41,.48);backdrop-filter:blur(2px);cursor:wait;pointer-events:auto}.zalo-screen-loader[hidden]{display:none}.zalo-screen-loader-card{display:grid;place-items:center;min-width:210px;padding:24px 28px;border:1px solid rgba(255,255,255,.65);border-radius:14px;background:#fff;box-shadow:0 24px 70px rgba(5,20,33,.32);color:var(--text);text-align:center}.zalo-screen-loader-spinner{width:42px;height:42px;margin-bottom:14px;border:4px solid #dbe9f7;border-top-color:#0877e8;border-radius:50%;animation:zalo-spin .8s linear infinite}.zalo-screen-loader-card strong{font-size:14px}.zalo-screen-loader-card small{margin-top:6px;color:var(--muted);font-size:10px}
.zalo-chat-backdrop{z-index:1100;align-items:center;justify-content:center;background:rgba(14,29,41,.55)}.zalo-chat{display:grid;grid-template-rows:auto auto minmax(240px,1fr) auto;width:min(700px,calc(100vw - 32px));height:min(760px,calc(100vh - 40px));overflow:hidden;border-radius:12px;background:#fff;box-shadow:0 24px 70px rgba(5,20,33,.32)}
.zalo-chat-header{display:grid;grid-template-columns:46px minmax(0,1fr) auto auto 36px;align-items:center;gap:11px;padding:14px 18px;border-bottom:1px solid var(--line)}.zalo-chat-header h2{margin:0;font-size:15px}.zalo-chat-identity>small{display:block;margin-top:3px;color:#687988;font-size:10px}.zalo-chat-identity>small strong{color:#34495a;font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-weight:700}.zalo-chat-header p{margin:3px 0 0;color:var(--muted);font-size:10px}.zalo-chat-header>button[data-zalo-chat-close]{width:32px;height:32px;border:0;background:transparent;color:#5e6d7a;font-size:24px;cursor:pointer}.zalo-friend-button{min-width:88px;height:34px;padding:0 13px;border:1px solid #0877e8;border-radius:7px;background:#0877e8;color:#fff;font-size:11px;font-weight:800;cursor:pointer}.zalo-friend-button:disabled{border-color:#d8e3ec;background:#eef3f7;color:#71808c;cursor:not-allowed}.zalo-via{padding:7px 10px;border-radius:6px;background:#edf6ff;color:#5f7180;font-size:10px}.zalo-via strong{display:block;margin-top:2px;color:#0877e8;text-align:right}.zalo-chat-context{display:flex;align-items:center;justify-content:flex-end;min-height:43px;padding:9px 18px;border-bottom:1px solid var(--line);background:#fafcfd;font-size:10px}.zalo-chat-context a{color:#0877e8;font-size:10px;font-weight:800;text-decoration:none}.zalo-chat-context a:hover{text-decoration:underline}
.zalo-messages{overflow:auto;padding:20px;background:#f0f4f7}.zalo-date-line{display:flex;align-items:center;gap:10px;margin:0 0 18px;color:#81909c;font-size:9px}.zalo-date-line:before,.zalo-date-line:after{content:"";height:1px;flex:1;background:#dce3e7}.zalo-chat-notice{max-width:88%;margin:10px auto;padding:9px 12px;border:1px solid #b9d8f5;border-radius:9px;background:#eaf5ff;color:#20547d;font-size:11px;line-height:1.45;text-align:center}.zalo-chat-notice.warning{border-color:#f0d799;background:#fff7dc;color:#75570a}.zalo-chat-notice.error{border-color:#efb6b6;background:#fff0f0;color:#a52a2a}.zalo-bubble{width:fit-content;max-width:72%;margin:10px 0}.zalo-bubble p{margin:0;padding:10px 12px;border-radius:10px 10px 10px 2px;background:#fff;box-shadow:0 2px 7px rgba(20,45,64,.08);font-size:12px;line-height:1.5}.zalo-bubble-content>img{display:block;max-width:min(320px,55vw);max-height:360px;border-radius:10px;object-fit:contain;background:#fff;box-shadow:0 2px 7px rgba(20,45,64,.12);cursor:zoom-in}.zalo-bubble-content>img+p{margin-top:4px}.zalo-bubble time{display:block;margin-top:4px;color:#82909b;font-size:9px}.zalo-bubble.outgoing{margin-left:auto}.zalo-bubble.outgoing p{border-radius:10px 10px 2px 10px;background:#0877e8;color:#fff}.zalo-bubble.outgoing time{text-align:right}.zalo-bubble.failed{opacity:.65}
.zalo-composer{padding:10px 14px 9px;border-top:1px solid var(--line)}.zalo-compose-tools{display:flex;gap:4px;margin-bottom:5px}.zalo-compose-tools button{height:27px;padding:0 8px;border:0;border-radius:5px;background:transparent;color:#5d6e7c;font-size:11px;cursor:pointer}.zalo-compose-tools button:hover{background:#edf3f6}.zalo-compose-row{display:flex;align-items:flex-end;gap:9px}.zalo-compose-row textarea{width:100%;resize:none;padding:10px;border:1px solid var(--line);border-radius:8px;outline:none;font-family:inherit;font-size:12px}.zalo-compose-row textarea:focus{border-color:#0877e8;box-shadow:0 0 0 3px rgba(8,119,232,.1)}.zalo-send-button{display:grid;place-items:center;width:42px;height:42px;flex:0 0 auto;border:0;border-radius:9px;background:#0877e8;color:#fff;font-size:17px;cursor:pointer}.zalo-composer>small{display:block;margin-top:5px;color:#8b98a2;font-size:9px;text-align:right}

.zalo-login-backdrop{z-index:1200;align-items:center;justify-content:center;background:rgba(14,29,41,.6)}
.zalo-login-modal{position:relative;width:min(430px,calc(100vw - 28px));padding:25px 30px 20px;border-radius:14px;background:#fff;text-align:center;box-shadow:0 28px 80px rgba(5,20,33,.35)}
.zalo-login-close{position:absolute;top:12px;right:13px;width:34px;height:34px;border:0;border-radius:50%;background:#f1f4f6;color:#60707d;font-size:22px;cursor:pointer}.zalo-login-close:hover{background:#e5eaee}
.zalo-login-brand{display:grid;place-items:center;width:44px;height:44px;margin:0 auto 10px;border-radius:12px;background:#0877e8;color:#fff;font-size:22px;font-weight:900}
.zalo-login-modal h2{margin:0;font-size:20px}.zalo-login-subtitle{margin:7px auto 15px;color:var(--muted);font-size:12px;line-height:1.45}
.zalo-qr-frame{position:relative;display:grid;place-items:center;width:218px;height:218px;margin:auto;padding:10px;border:1px solid #d8e3ea;border-radius:12px;background:#fff;box-shadow:0 6px 18px rgba(27,61,84,.08)}.zalo-qr-frame:before,.zalo-qr-frame:after{content:"";position:absolute;inset:-4px;border:3px solid #0877e8;border-left-color:transparent;border-right-color:transparent;border-radius:14px;pointer-events:none}.zalo-qr-frame:after{transform:rotate(90deg)}.zalo-qr-frame img{position:relative;z-index:1;width:100%;height:100%;object-fit:contain;background:#fff}.zalo-qr-loading,.zalo-qr-expired{position:relative;z-index:2;display:grid;place-items:center;gap:9px;color:var(--muted);font-size:11px}.zalo-qr-loading[hidden],.zalo-qr-expired[hidden]{display:none}.zalo-qr-loading span{width:30px;height:30px;border:3px solid #dbe9f7;border-top-color:#0877e8;border-radius:50%;animation:zalo-spin .8s linear infinite}.zalo-qr-loading p{margin:0}.zalo-qr-expired strong{font-size:12px;color:var(--text)}.zalo-qr-expired button{padding:7px 12px;border:0;border-radius:6px;background:#0877e8;color:#fff;font-size:11px;font-weight:800;cursor:pointer}
.zalo-qr-frame[hidden]{display:none}.zalo-login-state{display:flex;align-items:center;justify-content:center;gap:9px;margin:15px 0 12px}.zalo-login-state>span{width:10px;height:10px;border:2px solid #cfe3f8;border-top-color:#0877e8;border-radius:50%;animation:zalo-spin .8s linear infinite}.zalo-login-state p,.zalo-login-state strong,.zalo-login-state small{display:block;margin:0;text-align:left}.zalo-login-state strong{font-size:11px}.zalo-login-state small{margin-top:2px;color:var(--muted);font-size:9px}.zalo-login-state.scanned>span{border:0;background:#f29a20;animation:none}.zalo-login-state.success>span{display:grid;place-items:center;width:22px;height:22px;border:0;background:#18a873;animation:none}.zalo-login-state.success>span:after{content:"✓";color:#fff;font-size:12px;font-weight:900}.zalo-login-state.error>span,.zalo-login-state.expired>span{border:0;background:#d04437;animation:none}
.zalo-login-steps{display:grid;gap:7px;margin:0;padding:12px 14px;border-radius:9px;background:#f6f9fb;text-align:left;list-style:none}.zalo-login-steps li{display:flex;align-items:center;gap:9px;color:#536572;font-size:10px}.zalo-login-steps b{display:grid;place-items:center;width:21px;height:21px;flex:0 0 auto;border-radius:50%;background:#e2effc;color:#0877e8;font-size:10px}.zalo-login-steps span strong{color:var(--text)}.zalo-login-error{margin-top:10px;padding:8px 10px;border-radius:7px;background:var(--danger-soft);color:var(--danger);font-size:10px;line-height:1.4}.zalo-login-security{margin:12px 0 0;color:#84919b;font-size:9px}

@media (max-width: 1180px) {
  .zalo-summary { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .zalo-workspace { grid-template-columns: 235px minmax(0,1fr); }
  .metrics-grid {
    grid-template-columns: repeat(3, minmax(160px, 1fr));
  }

  .admin-summary,
  .filter-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .operation-hero,
  .operation-grid {
    grid-template-columns: 1fr;
  }

  .user-management-grid,
  .role-management-grid,
  .org-management-grid,
  .permission-management-grid {
    grid-template-columns: 1fr;
  }

  .org-tree-panel {
    position: static;
  }

  .work-grid,
  .detail-grid,
  .service-background,
  .status-band {
    grid-template-columns: 1fr;
  }

  .module-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .zalo-page-heading { align-items: stretch; flex-direction: column; }
  .zalo-connect-button { justify-content: center; }
  .zalo-connection-actions { justify-content:stretch }
  .zalo-connection-actions > button { flex:1;justify-content:center }
  .zalo-summary { grid-template-columns: 1fr; }
  .zalo-workspace { grid-template-columns: 1fr; }
  .zalo-accounts { border-right: 0; border-bottom: 1px solid var(--line); }
  .zalo-account-note { display: none; }
  .zalo-toolbar { grid-template-columns: 1fr; }
  .zalo-contact-columns { display:none; }
  .zalo-contact { grid-template-columns: 44px minmax(0,1fr) 78px; padding-inline: 12px; }
  .zalo-contact-id,.zalo-contact-phone,.zalo-contact-status,.zalo-contact-sync { display:none; }
  .zalo-contact-head { align-items: flex-start; gap: 8px; }
  .zalo-contact-head > span { text-align: right; }
  .zalo-chat { width: 100vw; height: 100vh; border-radius: 0; }
  .zalo-chat-header { grid-template-columns: 42px minmax(0,1fr) 32px; }
  .zalo-friend-button,.zalo-via { grid-column: 2; justify-self: start; }
  .zalo-via { display: none; }
  .zalo-chat-context > span:nth-child(2) { display: none; }

  .page-heading,
  .panel-header {
    display: grid;
  }

  .admin-summary,
  .filter-grid {
    grid-template-columns: 1fr;
  }

  .customer-filter-layout,
  .form-grid.two-columns,
  .form-grid.three-columns {
    grid-template-columns: 1fr;
  }

  .work-calendar-card {
    overflow-x: auto;
  }

  .month-calendar {
    min-width: 860px;
  }

  .detail-list {
    grid-template-columns: 1fr;
  }

  .customer-filter-actions {
    justify-content: flex-start;
    min-width: 0;
  }

  .modal-backdrop {
    padding: 12px;
  }

  .page-actions,
  .detail-actions {
    width: 100%;
  }

  .primary-button,
  .secondary-button,
  .detail-actions button {
    flex: 1 1 160px;
  }

  .segmented-control {
    align-items: stretch;
  }

  .personal-kpi-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .bar-chart {
    grid-template-columns: repeat(3, minmax(46px, 1fr));
  }

  .overview-bars,
  .revenue-overview-bars {
    grid-template-columns: repeat(2, minmax(90px, 1fr));
  }
}

@media (max-width: 760px) {
  .app-shell,
  .app-shell.sidebar-collapsed {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    overflow: visible;
  }

  .nav-menu {
    overflow: visible;
  }

  .brand {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .app-shell.sidebar-collapsed .brand-copy,
  .app-shell.sidebar-collapsed .nav-text,
  .app-shell.sidebar-collapsed .nav-caret {
    display: block;
  }

  .app-shell.sidebar-collapsed .nav-children.open {
    display: grid;
  }

  .app-shell.sidebar-collapsed .nav-link,
  .app-shell.sidebar-collapsed .nav-parent {
    grid-template-columns: 34px minmax(0, 1fr) 16px;
    justify-content: stretch;
  }

  .topbar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
    padding: 16px;
  }

  .topbar-actions {
    width: 100%;
    justify-content: flex-end;
  }

  main {
    padding: 16px;
  }

  .metrics-grid,
  .service-background dl,
  .contract-list,
  .module-strip {
    grid-template-columns: 1fr;
  }

  .ticket-row {
    grid-template-columns: 1fr;
  }

  .account-name {
    display: none;
  }
}
.system-error-page {
  min-height: calc(100vh - 170px);
  display: grid;
  place-items: center;
  padding: 32px 16px;
}

.system-error-card {
  width: min(680px, 100%);
  padding: 48px;
  text-align: center;
  background: #fff;
  border: 1px solid #dbe4e8;
  border-radius: 22px;
  box-shadow: 0 18px 55px rgba(20, 42, 56, .10);
}

.system-error-icon {
  width: 76px;
  height: 76px;
  margin: 0 auto 20px;
  display: grid;
  place-items: center;
  color: #b42318;
  background: #feeceb;
  border-radius: 22px;
}

.system-error-icon svg {
  width: 42px;
  height: 42px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.system-error-card h1 {
  margin: 8px 0 12px;
  color: #142a38;
  font-size: clamp(28px, 4vw, 40px);
}

.system-error-message,
.system-error-hint {
  color: #647584;
}

.system-error-reference {
  margin: 28px 0 10px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  text-align: left;
  background: #f4f8f7;
  border: 1px solid #d8e6e2;
  border-radius: 12px;
}

.system-error-reference span {
  color: #526774;
  font-weight: 700;
}

.system-error-reference code {
  max-width: 65%;
  overflow-wrap: anywhere;
  color: #087f67;
  font-weight: 700;
}

.system-error-actions {
  margin-top: 30px;
  display: flex;
  justify-content: center;
  gap: 12px;
}

@media (max-width: 640px) {
  .system-error-card { padding: 32px 20px; }
  .system-error-reference { align-items: flex-start; flex-direction: column; }
  .system-error-reference code { max-width: 100%; }
  .system-error-actions { flex-direction: column; }
}
